Networking Method, Device, Electronic Device and Storage Medium
By determining the adjacent relationship of the gateway and selecting the optimal channel, the problem of mutual interference after gateway construction is solved and the communication quality is improved.
Patent Information
- Application Number
- CN202210542285.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-05-18
AI Technical Summary
During the construction of the gateway, due to the uncertainty of the construction sequence and the difficulty in testing the channel quality, multiple gateways select the same channel, resulting in mutual interference and channel congestion, affecting the communication quality.
By acquiring the networking request of the first gateway, the second gateway adjacent to it is determined based on its identification and preset neighbor relationship information, and combined with the location relationship, network parameter information and channel quality, the optimal target channel is selected from the available channels, and the networking parameters are sent to the first gateway, so that it can network with the corresponding equipment.
Reduces the probability of interference during normal operation of the gateway and improves communication quality.
Smart Images

Figure CN116112374B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communications, and particularly relates to a networking method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, during the construction of gateways, a gateway will automatically select the optimal channel to form a network with relevant indoor devices. However, if multiple gateways within a region (such as a building) are under construction simultaneously, due to the uncertainty of the construction sequence and the difficulty of testing the channel quality during simultaneous construction, almost all gateways may select the same channel after construction. In this way, when all gateways are operating normally, interference and even conflicts may occur, resulting in channel congestion and thus affecting communication quality. Summary of the Invention
[0003] In view of this, embodiments of this application provide a networking method, apparatus, electronic device, and storage medium, which can solve the problem of poor communication quality of each gateway after network formation.
[0004] The first aspect of the embodiments of this application provides a networking method, including:
[0005] Obtain a networking request sent by a first gateway, where the networking request includes an identifier of the first gateway;
[0006] Determine at least one second gateway adjacent to the first gateway according to the identifier of the first gateway and preset adjacent relationship information;
[0007] Determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, where the network parameter information of the second gateway includes an identifier of the channel used by the second gateway and the number of devices connected to the second gateway;
[0008] Send the networking parameters of the target channel to the first gateway, and the first gateway is used to form a network with corresponding devices according to the networking parameters of the target channel.
[0009] In a possible implementation, the determining a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels includes:
[0010] Determine a distance coefficient corresponding to each second gateway according to the positional relationship between the first gateway and the second gateway;
[0011] Determine the equivalent number of gateways corresponding to each channel in the available channels according to the distance coefficient and the identifier of the channel used by the second gateway;
[0012] Determine the equivalent number of devices corresponding to each channel in the available channels according to the distance coefficient and the number of devices connected to the second gateway;
[0013] Determine a target channel from the available channels according to the equivalent number of gateways, the equivalent number of devices, and the channel quality of the available channels.
[0014] In a possible implementation, the determining a target channel from the available channels according to the equivalent number of gateways, the equivalent number of devices, and the channel quality of the available channels includes:
[0015] Determine the selection weight of each channel in the available channels according to the equivalent number of gateways, the equivalent number of devices, the channel quality of the available channels, and the corresponding weight coefficient;
[0016] Use the channel with the largest selection weight as the target channel.
[0017] In a possible implementation, the channel quality of the available channels is the initial channel quality of the available channels.
[0018] In a possible implementation, before obtaining the networking request sent by the first gateway, the method further includes:
[0019] Obtain a three-dimensional space model of the area to be networked, where the three-dimensional space model is used to represent the positional relationship of each subspace in the area to be networked;
[0020] Obtain the association information between each of the subspaces and the identifier of the gateway;
[0021] Determine the preset adjacent relationship information according to the three-dimensional space model and the association information.
[0022] In a possible implementation, the obtaining a three-dimensional space model of the area to be networked includes:
[0023] When detecting gateway construction information or changed gateway information, obtain a three-dimensional space model of the area to be networked.
[0024] In a possible implementation, the method further includes:
[0025] When a preset condition is met, re-determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, where the preset condition includes detecting change information of the network parameters of any one of the first gateway and the second gateway.
[0026] The second aspect of the embodiments of the present application provides a networking device, including:
[0027] An acquisition module, configured to acquire a networking request sent by a first gateway, where the networking request includes an identifier of the first gateway;
[0028] A determination module, configured to determine at least one second gateway adjacent to the first gateway according to the identifier of the first gateway and preset adjacent relationship information;
[0029] A calculation module, configured to determine a target channel from available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, where the network parameter information of the second gateway includes an identifier of a channel used by the second gateway and the number of devices connected to the second gateway;
[0030] A sending module, configured to send networking parameters of the target channel to the first gateway, and the first gateway is configured to perform networking with corresponding devices according to the networking parameters of the target channel.
[0031] The third aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the networking method described in the first aspect above is implemented.
[0032] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the networking method described in the first aspect above is implemented.
[0033] The fifth aspect of the embodiments of the present application provides a computer program product, which when running on an electronic device, causes the electronic device to execute the networking method described in any item of the first aspect above.
[0034] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: When obtaining the networking request of the first gateway, at least one second gateway adjacent to the first gateway is determined according to the identifier of the first gateway and the preset adjacent relationship information. Then, according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, the target channel is determined from the available channels. Since the network parameter information of the second gateway includes the identifier of the channel used by the second gateway and the number of devices connected to the second gateway, the network parameter information of the second gateway can reflect the communication status when the second gateway is working properly. Therefore, the target channel determined by combining the positional relationship and the network parameter information of the second gateway can reflect the optimal channel that can be selected when the adjacent gateways are working properly. Then, the networking parameters of the target channel are sent to the first gateway, so that the first gateway can network with the corresponding devices according to the networking parameters of the target channel, thereby enabling the first gateway to network according to the networking parameters of the optimal channel. After the networking is completed, the probability of interference when each gateway is working properly is reduced, and thus the communication quality of each gateway is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions.
[0036] Figure 1 It is a schematic flowchart of the implementation of the networking method provided by an embodiment of the present application;
[0037] Figure 2 It is a schematic diagram of the adjacent relationship in space provided by an embodiment of the present application;
[0038] Figure 3 It is a schematic flowchart of the specific process for determining the target channel provided by an embodiment of the present application;
[0039] Figure 4 It is a schematic diagram of the networking device provided by an embodiment of the present application;
[0040] Figure 5 It is a schematic diagram of the structure of the electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0042] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0043] It should also be understood that the terms used in the specification of this application are merely for the purpose of describing specific embodiments and are not intended to limit this application. As used in the specification of this application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0044] It should be further understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0045] In addition, in the description of this application, the terms "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0046] In the existing networking methods, if multiple gateways in an area are under construction simultaneously, almost all gateways will select the same channel after the construction is completed. In this way, when the devices corresponding to all gateways are working properly, interference and even conflicts will occur, resulting in channel congestion and further affecting the communication quality.
[0047] Therefore, this application provides a networking method. When obtaining the networking request of the first gateway, at least one second gateway adjacent to the first gateway is determined according to the identifier of the first gateway and the preset adjacent relationship information. The target channel is determined from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels. Since the network parameter information of the second gateway includes the identifier of the channel used by the second gateway and the number of devices connected to the second gateway, the network parameter information of the second gateway can reflect the communication status when the second gateway is working properly. Therefore, the target channel determined by combining the positional relationship and the network parameter information of the second gateway can reflect the optimal channel that can be selected when the adjacent gateways are working properly. Then, the networking parameters of the target channel are sent to the first gateway, so that the first gateway can perform networking with the corresponding devices according to the networking parameters of the target channel, thereby enabling the first gateway to perform networking according to the networking parameters of the optimal channel. After the networking is completed, the probability of interference when each gateway is working properly is reduced, and thus the communication quality of each gateway is improved.
[0048] The following gives an exemplary description of the networking method provided by this application.
[0049] The networking method provided by the embodiment of the present application is applied to an electronic device, which may be an aggregation router, a terminal installed with a construction application, an Interface Message Processor (IMP), etc. Taking the electronic device as an aggregation router as an example, the networking method provided by the embodiment of the present application will be described below.
[0050] Please refer to the attached Figure 1 , the networking method provided by an embodiment of the present application includes:
[0051] S101: Obtain a networking request sent by a first gateway, where the networking request includes an identifier of the first gateway.
[0052] Specifically, the aggregation router is communicatively connected to multiple gateways. The first gateway is any one of the multiple gateways. When the first gateway needs to perform networking or change networking parameters, it sends a networking request to the aggregation router to obtain the networking parameters determined by the aggregation router. The identifier of the first gateway may be the device identification code of the first gateway.
[0053] S102: Determine at least one second gateway adjacent to the first gateway according to the identifier of the first gateway and the preset adjacent relationship information.
[0054] Specifically, the second gateway adjacent to the first gateway refers to the second gateway whose positional relationship with the first gateway meets the preset conditions. The preset adjacent relationship information stores the adjacent gateways corresponding to each gateway. Exemplarily, a gateway is installed in each room of a building. As Figure 2 shown, if the gateway installed in the room at the central position among 27 rooms is the first gateway, then the gateways installed in the remaining 26 rooms are all second gateways adjacent to the first gateway, that is, the 8 gateways on the same floor as the first gateway, the 9 gateways on the upper floor of the first gateway, and the 9 gateways on the lower floor of the first gateway are all second gateways. It should be noted that in other spatial layout forms, other forms of adjacent relationship information can also be determined according to the predefined preset conditions, and then the second gateway can be determined. For example, the second gateway may also be 2 gateways on the same floor as the first gateway, 3 gateways on the upper floor of the first gateway, and 3 gateways on the lower floor of the first gateway, a total of 8 gateways.
[0055] Exemplarily, a gateway is installed in each classroom of a teaching building. The corresponding adjacent relationship information is shown in Table 1. In Table 1, "*" represents the same classroom, "0" represents that two classrooms do not meet the adjacent conditions, "1" represents that two classrooms meet the adjacent conditions and are close, and "3" represents that two classrooms meet the adjacent conditions and are far.
[0056] Table 1
[0057] Classroom 31 Classroom 32 Classroom 33 Classroom 34 Classroom 35 Classroom 36 。。。 Classroom 31 * 3 1 0 0 0 Classroom 32 3 * 3 1 0 0 Classroom 33 1 3 * 3 1 0 Classroom 34 0 1 3 * 3 1 Classroom 35 0 0 1 3 * 3 Classroom 36 0 0 0 1 3 * 。。。 。。。
[0058] In one embodiment, when it is determined that networking is required, the aggregation router obtains a three-dimensional space model of the area to be networked, and the three-dimensional space model is used to represent the positional relationship of each subspace within the area to be networked. For example, the three-dimensional space model is a three-dimensional building model, and each room within the building model is a subspace. There is a gateway in each subspace, and the aggregation router obtains the association information between each subspace and the identifier of the gateway input by the user. Based on the three-dimensional space model and the association information, the preset adjacent relationship information can be determined. Exemplarily, the aggregation router determines the adjacent gateways corresponding to each gateway from the three-dimensional space model according to the positional relationship that the adjacent relationship needs to satisfy, which is the adjacent relationship information.
[0059] In one embodiment, if the aggregation router detects gateway construction information or changes in gateway information, determines that networking is required, and obtains a three-dimensional space model of the area to be networked for generating adjacent relationship information.
[0060] S103: Determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels. The network parameter information of the second gateway includes the identifier of the channel used by the second gateway and the number of devices connected to the second gateway.
[0061] Among them, the positional relationship between the first gateway and the second gateway can be determined according to the adjacent relationship information or according to the three-dimensional space model. The positional relationship between the first gateway and the second gateway can be the distance information between the subspace where the first gateway is located and the subspace where the second gateway is located, or the relative angle information between the subspace where the first gateway is located and the subspace where the second gateway is located.
[0062] Considering the interference degree of the channel by the positional relationship between the first gateway and the second gateway, the influence degree of the number of devices connected to the second gateway on the communication quality of the channel, the channel used by the second gateway, and the channel quality of the available channels, select the optimal channel from the available channels, which is the target channel.
[0063] As Figure 3 shown, in one embodiment, S103 specifically includes:
[0064] S301: Determine the distance coefficient corresponding to each second gateway according to the positional relationship between the first gateway and the second gateway.
[0065] Specifically, determine the distance coefficient corresponding to the second gateway according to whether the first gateway and the second gateway are adjacent in position, or according to whether the first gateway and the second gateway are on the same floor of the building, or according to the straight-line distance between the first gateway and the second gateway.
[0066] Exemplarily, in the second gateway, the distance coefficient of the second gateway in the subspace adjacent to the subspace where the first gateway is located in terms of position is 3, and the distance coefficient of the second gateway in the subspace not adjacent to the subspace where the first gateway is located in terms of position is 1. The larger the distance coefficient, the greater the interference degree when the two gateways share the same channel.
[0067] S302: Determine the equivalent gateway number corresponding to each channel in the available channels according to the distance coefficient and the identifier of the channel used by the second gateway.
[0068] Specifically, for the same channel, determine the equivalent gateway number of the second gateway according to the distance coefficient of the second gateway using this channel. For example, the distance coefficient of the second gateway can be used as the corresponding equivalent gateway number. If the distance coefficient of the second gateway is 3, then the second gateway is equivalent to 3 gateways. If the distance coefficient of the second gateway is 1, then the second gateway is equivalent to 1 gateway. For the same channel, sum up the distance coefficients of all the second gateways using this channel to obtain the equivalent gateway number corresponding to this channel.
[0069] S303: Determine the equivalent device number corresponding to each channel in the available channels according to the distance coefficient and the number of devices connected to the second gateway.
[0070] Among them, the number of devices of the second gateway can be obtained by the aggregation router from the second gateway. Exemplarily, use the product of the distance coefficient corresponding to the second gateway and the number of devices of the second gateway as the equivalent device number corresponding to the second gateway. For example, if the number of devices of the second gateway is 10 and the distance coefficient of this second gateway is 3, then the equivalent number of devices is 30. If the number of devices of the second gateway is 20 and the distance coefficient of this second gateway is 1, then the equivalent number of devices is 20. For the same channel, sum up the equivalent device numbers of all the second gateways using this channel to obtain the equivalent device number corresponding to this channel.
[0071] S304: Determine the target channel from the available channels according to the equivalent gateway number, the equivalent device number, and the channel quality of the available channels.
[0072] Specifically, select a channel with a small equivalent gateway number, a small equivalent device number, and a high channel quality from the available channels as the target channel.
[0073] Among them, the channel quality can be the initial channel quality of the channel or the channel quality detected in real time. Using the initial channel quality of the available channels as the channel quality of the available channels can reduce the test complexity compared with the channel quality detected in real time, and can avoid the problem of inaccurate calculation results caused by the uncertainty of real-time detection.
[0074] In one embodiment, according to the number of equivalent gateways, the number of equivalent devices, the channel quality of available channels, and the corresponding weight coefficients, the selection weight of each channel in the available channels is determined, and the channel with the largest selection weight is used as the target channel. Exemplarily, the selection weight of the i-th channel is calculated according to the formula Q(i)=Pq*Q0(i)+Pn*N(i)+Pd*D(i), where i represents a positive integer, Q(i) represents the selection weight of the i-th channel, Q0(i) represents the channel quality of the i-th channel, Pq represents the weight corresponding to the channel quality, N(i) represents the number of equivalent gateways of the i-th channel, Pn represents the weight corresponding to the number of equivalent gateways, D(i) represents the number of equivalent devices of the i-th channel, Pd represents the weight corresponding to the number of equivalent devices, and each weight can be a positive number or a negative number. By calculating the selection weights, the selection weights of the available channels can be sorted, and according to the sorting result, the channel with the largest selection weight is determined as the target channel, thereby improving the calculation accuracy.
[0075] The available channels are the channels with a relatively low probability of co-frequency interference with other wireless signals among all the channels that the first gateway can connect to. The probability of co-frequency interference with other wireless signals can be determined by testing or according to the pre-set information of the channels. In one embodiment, all channels can be sorted according to the probability of co-frequency interference with other wireless signals, that is, all channels are sorted in ascending order of probability, and the selection weight corresponding to each channel is calculated in turn. When a selection weight greater than the preset value is obtained, the calculation is stopped, and the channel corresponding to the selection weight is used as the target channel, thereby avoiding using the channel with co-frequency interference with other wireless signals as the target channel.
[0076] In the above embodiment, first, the distance coefficient corresponding to the second gateway is determined according to the positional relationship, and then the number of equivalent gateways and the number of equivalent devices are calculated according to the distance coefficient. The obtained number of equivalent gateways and the number of equivalent devices can reflect the channel usage of the second gateway adjacent to the first gateway. Then, the target channel is determined according to the number of equivalent gateways, the number of equivalent devices, and the channel quality of the available channels, improving the accuracy of the selected target channel, and further improving the subsequent communication quality.
[0077] S104: Send the networking parameters of the target channel to the first gateway, and the first gateway is used to perform networking with the corresponding devices according to the networking parameters of the target channel.
[0078] Specifically, after the first gateway receives the networking parameters of the target channel, it broadcasts the networking parameters of the target channel, and the corresponding devices perform network switching according to the received networking parameters of the target channel. After the construction is completed, even if the gateway installed in the subspace is removed, the devices in each subspace can work on the optimal channel.
[0079] In one embodiment, when the change information of the network parameters of any one of the first gateway and the second gateway is detected, it indicates that the arrangement of the preferred channels has changed, and the channels currently connected by each gateway may not be the optimal channels. Then, according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, the target channel is re-determined from the available channels, so as to ensure that the devices corresponding to each gateway work on the optimal channel, thereby improving the communication quality.
[0080] In other embodiments, when the devices corresponding to each gateway detect poor communication quality, they report the information of poor communication quality to the aggregation router through the gateway, and the aggregation router re-determines the target channel according to the information of poor communication quality. Or when the aggregation router detects that the set time interval is reached, it determines the target channel corresponding to each gateway from the available channels according to the positional relationship between the gateways, the network parameter information of the adjacent gateways corresponding to each gateway, and the channel quality of the available channels. If there is a gateway whose target channel has changed, the networking parameters of the target channel are sent to the corresponding gateway, so as to ensure that the devices corresponding to each gateway work on the optimal channel.
[0081] In the above embodiments, the target channel in the available channels is determined through the positional relationship between adjacent gateways and the network parameter information of adjacent gateways, so that the determined target channel can reflect the optimal channel that can be selected under the normal operation of adjacent gateways. Thus, the optimal channel can be selected without the need for adjacent gateways to work simultaneously, and the optimal channel can be selected during the network construction process. Each gateway networks according to the networking method provided in the embodiments of the present application. After the construction is completed, each gateway can select the optimal channel. When each gateway is working properly, the probability of interference during the normal operation of each gateway can be reduced, thereby improving the communication quality of each gateway.
[0082] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0083] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0084] Corresponding to the networking method described in the above embodiments, Figure 4The structural block diagram of the networking device provided by the embodiment of the present application is shown. For ease of description, only the parts related to the embodiment of the present application are shown.
[0085] As Figure 4 shown, the networking device includes
[0086] an acquisition module 41, configured to acquire a networking request sent by a first gateway, where the networking request includes an identifier of the first gateway;
[0087] a determination module 42, configured to determine at least one second gateway adjacent to the first gateway according to the identifier of the first gateway and preset adjacent relationship information;
[0088] a calculation module 43, configured to determine a target channel from available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, where the network parameter information of the second gateway includes an identifier of the channel used by the second gateway and the number of devices connected to the second gateway;
[0089] a sending module 44, configured to send networking parameters of the target channel to the first gateway, and the first gateway is configured to perform networking with corresponding devices according to the networking parameters of the target channel.
[0090] In a possible implementation manner, the calculation module 43 is specifically configured to:
[0091] determine a distance coefficient corresponding to each second gateway according to the positional relationship between the first gateway and the second gateway;
[0092] determine the equivalent gateway number corresponding to each channel in the available channels according to the distance coefficient and the identifier of the channel used by the second gateway;
[0093] determine the equivalent device number corresponding to each channel in the available channels according to the distance coefficient and the number of devices connected to the second gateway;
[0094] determine a target channel from the available channels according to the equivalent gateway number, the equivalent device number, and the channel quality of the available channels.
[0095] In a possible implementation manner, the calculation module 43 is specifically further configured to:
[0096] determine the selection weight of each channel in the available channels according to the equivalent gateway number, the equivalent device number, the channel quality of the available channels, and the corresponding weight coefficient;
[0097] take the channel with the largest selection weight as the target channel.
[0098] In a possible implementation, the channel quality of the available channel is the initial channel quality of the available channel.
[0099] In a possible implementation, the obtaining module 41 is further configured to:
[0100] Obtain a three-dimensional space model of the area to be networked, where the three-dimensional space model is used to represent the positional relationship of each subspace within the area to be networked;
[0101] Obtain the association information between each of the subspaces and the identifier of the gateway;
[0102] Determine the preset adjacent relationship information according to the three-dimensional space model and the association information.
[0103] In a possible implementation, the obtaining module 41 is specifically configured to:
[0104] When detecting gateway construction information or changed gateway information, obtain a three-dimensional space model of the area to be networked.
[0105] In a possible implementation, the calculation module 43 is further configured to:
[0106] When a preset condition is satisfied, re-determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channel, where the preset condition includes detecting changed information of the network parameters of any one of the first gateway and the second gateway.
[0107] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiment of the present application, for their specific functions and the technical effects brought, please refer to the method embodiment part for details, and will not be elaborated here.
[0108] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 5 shown, the electronic device of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51. When the processor 51 executes the computer program 53, the steps in the above-mentioned network formation method embodiment are implemented, such as Figure 1 the steps S101 to S104 shown. Alternatively, when the processor 51 executes the computer program 53, the functions of each module / unit in the above-mentioned device embodiments are implemented, such as Figure 4 the functions of the obtaining module 41 to the sending module 44 shown.
[0109] Exemplarily, the computer program 53 may be divided into one or more modules / units, which are stored in the memory 52 and executed by the processor 51 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 53 in the electronic device.
[0110] Those skilled in the art can understand that Figure 5 merely examples of the electronic device, and do not constitute a limitation on the electronic device. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0111] The processor 51 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0112] The memory 52 may be an internal storage unit of the electronic device, such as the hard disk or memory of the electronic device. The memory 52 may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 52 may also include both the internal storage unit and the external storage device of the electronic device. The memory 52 is used to store the computer program and other programs and data required by the electronic device. The memory 52 may also be used to temporarily store data that has been output or will be output.
[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0114] In the embodiments provided in this application, it should be understood that the disclosed device / electronic device and method can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0115] The unit described as a separated component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0117] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0118] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of this application, and should all be included in the protection scope of this application.
Claims
1. A networking method, characterized in that, Including: Obtain a network formation request sent by a first gateway, where the network formation request includes an identifier of the first gateway; When it is determined that network formation is required, obtain a three-dimensional space model of the area to be networked for generating adjacent relationship information. The three-dimensional space model is used to represent the positional relationship of each subspace within the area to be networked. The three-dimensional space model is a three-dimensional building model, and each room within the building model is a subspace; According to the identifier of the first gateway and the preset adjacent relationship information, determine at least one second gateway adjacent to the first gateway; where the second gateway adjacent to the first gateway refers to a second gateway whose positional relationship with the first gateway satisfies a preset condition; Determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, including: determining a distance coefficient corresponding to each second gateway according to the positional relationship between the first gateway and the second gateway; determining the equivalent gateway number corresponding to each channel in the available channels according to the distance coefficient and the identifier of the channel used by the second gateway; determining the equivalent device number corresponding to each channel in the available channels according to the distance coefficient and the number of devices connected to the second gateway; determining the selection weight of each channel in the available channels according to the equivalent gateway number, the equivalent device number, the channel quality of the available channels, and the corresponding weight coefficient; taking the channel with the largest selection weight as the target channel; the network parameter information of the second gateway includes the identifier of the channel used by the second gateway and the number of devices connected to the second gateway; Send the network formation parameters of the target channel to the first gateway, and the first gateway is used to form a network with corresponding devices according to the network formation parameters of the target channel.
2. The method according to claim 1, characterized in that, The channel quality of the available channels is the initial channel quality of the available channels.
3. The method according to claim 1, characterized in that Before obtaining the network formation request sent by the first gateway, the method further includes: Obtain a three-dimensional space model of the area to be networked, where the three-dimensional space model is used to represent the positional relationship of each subspace within the area to be networked; Obtain the association information between each subspace and the identifier of the gateway; Determine the preset adjacent relationship information according to the three-dimensional space model and the association information.
4. The method according to claim 3, wherein The obtaining of the three-dimensional space model of the area to be networked includes: When gateway construction information or gateway information change is detected, obtain a three-dimensional space model of the area to be networked.
5. The method according to claim 1, characterized in that The method further includes: When a preset condition is met, re-determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels. The preset condition includes detecting change information of the network parameters of any one of the first gateway and the second gateway.
6. A networking device, characterized in that, Including: An obtaining module, configured to obtain a network formation request sent by a first gateway, where the network formation request includes an identifier of the first gateway; A determination module, configured to determine at least one second gateway adjacent to the first gateway according to the identifier of the first gateway and preset adjacent relationship information; wherein, the second gateway adjacent to the first gateway refers to the second gateway whose positional relationship with the first gateway meets a preset condition; A calculation module, configured to determine a target channel from the available channels according to the positional relationship between the first gateway and the second gateway, the network parameter information of the second gateway, and the channel quality of the available channels, including: determining a distance coefficient corresponding to each second gateway according to the positional relationship between the first gateway and the second gateway; determining the equivalent gateway number corresponding to each channel in the available channels according to the distance coefficient and the identifier of the channel used by the second gateway; determining the equivalent device number corresponding to each channel in the available channels according to the distance coefficient and the number of devices connected to the second gateway; determining the selection weight of each channel in the available channels according to the equivalent gateway number, the equivalent device number, the channel quality of the available channels, and the corresponding weight coefficient; and taking the channel with the largest selection weight as the target channel; the network parameter information of the second gateway includes the identifier of the channel used by the second gateway and the number of devices connected to the second gateway; A sending module, configured to send the networking parameters of the target channel to the first gateway, and the first gateway is configured to perform networking with corresponding devices according to the networking parameters of the target channel; The networking device is further configured to, when determining that networking is required, obtain a three-dimensional space model of the area to be networked, so as to generate adjacent relationship information. The three-dimensional space model is used to represent the positional relationship of each subspace in the area to be networked. The three-dimensional space model is a three-dimensional building model, and each room in the building model is a subspace.
7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method described in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Wireless network connection method, terminal equipment and storage medium
CN108040358A
Methods and systems for forming equipment network
CN110677272A
Networking method, device and system
CN113905349A