Intelligent switch networking method and device based on Bluetooth mesh
By classifying and optimizing the network topology of smart switches, monitoring and adjusting network loads in real time, the problems of energy management and battery life in the smart switch system are solved, and efficient energy management and stable network performance are achieved.
Patent Information
- Application Number
- CN202510047777.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-13
AI Technical Summary
In a Bluetooth mesh-based smart switch system, how to achieve efficient energy management while ensuring network performance, especially for battery-powered wireless smart switches, how to extend the battery life of the device.
By sorting the hardware capabilities, power type and geolocation information of each smart switch, the initial network topology is constructed and network load is monitored in real time. When the integrated load index exceeds the threshold, the edge switches are evaluated, communication tasks are reassigned, and network topology is optimized to reduce unnecessary energy consumption.
It achieves the ability to extend the battery life of wireless smart switches, balance the energy consumption of each switch, maintain good communication quality, and ensure the stability and reliability of network performance while ensuring network performance.
Smart Images

Figure CN119485241B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication networking technology, and in particular to a smart switch networking method and device based on Bluetooth mesh. Background Art
[0002] At present, with the rapid development of smart home technology, smart switch systems based on Bluetooth mesh are becoming increasingly popular. This system includes various types of switches, such as wall switches, dimmer switches, remote control switches, voice-activated switches, and induction switches. Among them, wireless switches are widely welcomed for their flexibility, but they also face the challenge of power management. In contrast, wired switches do not have power issues, but have low installation flexibility. Bluetooth mesh networks use a publish-and-subscribe mechanism to allow devices to network and communicate efficiently. However, in practical applications, how to achieve efficient energy management while ensuring network performance has become an urgent problem to be solved. This involves multiple aspects, including network configuration, wake-up time, overall network load, network latency, communication wake-up time, and subscription group management. Especially for battery-powered wireless smart switches, extending the battery life of the device is crucial. This requires not only optimizing the energy consumption of a single device, but also considering energy efficiency from the perspective of the entire network. For example, how to minimize the wake-up frequency and communication time of the device while ensuring network performance, how to reduce unnecessary energy consumption by optimizing network topology and routing strategies, and how to use subscription group management to achieve more efficient message delivery. Summary of the invention
[0003] The present application provides a Bluetooth mesh-based smart switch networking method and device for balancing the energy consumption and networking quality of the smart switch.
[0004] In a first aspect, an embodiment of the present application provides a smart switch networking method based on Bluetooth mesh, the method comprising:
[0005] Obtain initial feature data based on the hardware capability information, power type information, and geographic location information of each smart switch connected to the Bluetooth mesh network;
[0006] According to the initial characteristic data, performing type analysis on each of the intelligent switches to obtain switch type data;
[0007] According to a preset network allocation algorithm and the switch type data, an initial network topology structure is obtained, wherein the initial network topology structure includes a backbone switch and an edge switch;
[0008] Performing networking communication according to the initial network topology structure, collecting single load data during the networking communication process, and performing multi-dimensional evaluation according to the single load data to obtain a comprehensive load index;
[0009] When the comprehensive load index exceeds a preset threshold, a role upgrade evaluation is performed on the edge switch to obtain a role adjustment decision, and an optimized network topology is obtained according to the role adjustment decision and the initial network topology.
[0010] In a second aspect, an embodiment of the present application provides a smart switch networking device based on Bluetooth mesh, the device comprising:
[0011] A data acquisition module is used to obtain initial feature data based on the hardware capability information, power type information and geographic location information of each smart switch connected to the Bluetooth mesh network;
[0012] A type analysis module, used to perform type analysis on each of the smart switches according to the initial feature data to obtain switch type data;
[0013] A topology determination module, configured to obtain an initial network topology structure according to a preset network allocation algorithm and the switch type data, wherein the initial network topology structure includes a backbone switch and an edge switch;
[0014] A load calculation module, used to perform networking communication according to the initial network topology structure, collect single load data during the networking communication process, and perform multi-dimensional evaluation according to the single load data to obtain a comprehensive load index;
[0015] A topology optimization module is used to perform a role upgrade evaluation on the edge switch when the comprehensive load index exceeds a preset threshold, obtain a role adjustment decision, and obtain an optimized network topology structure based on the role adjustment decision and the initial network topology structure.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor;
[0017] The memory is used to store computer programs;
[0018] The processor is used to execute the computer program and implement the Bluetooth mesh-based smart switch networking method as described in any one of the embodiments of the present application when executing the computer program.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the Bluetooth mesh-based smart switch networking method as described in any one of the embodiments of the present application.
[0020] The embodiment of the present application provides a smart switch networking method based on Bluetooth mesh, the method comprising: obtaining initial feature data according to hardware capability information, power type information and geographic location information of each smart switch connected to the Bluetooth mesh network; performing type analysis on each smart switch according to the initial feature data to obtain switch type data; obtaining an initial network topology structure according to a preset network allocation algorithm and the switch type data, the initial network topology structure including a backbone switch and an edge switch; performing networking communication according to the initial network topology structure, and collecting single load data during the networking communication process, performing multi-dimensional evaluation according to the single load data to obtain a comprehensive load index; when the comprehensive load index exceeds a preset threshold, performing role upgrade evaluation on the edge switch to obtain a role adjustment decision, and obtaining an optimized network topology structure according to the role adjustment decision and the initial network topology structure. Through the above method, switches are classified according to hardware capabilities, power type and geographical location to ensure that the initial network structure distributes the load reasonably, avoiding wireless switches from becoming backbone switches directly during the initial network distribution. The network load is then monitored in real time and multi-dimensional evaluation is performed. When the load exceeds the threshold, the role upgrade evaluation is triggered, allowing communication tasks to be redistributed according to actual conditions, transferring the load from switches with higher energy consumption to other switches, and then balancing the overall energy consumption. By optimizing the network topology, unnecessary data transmission is reduced, and the overall energy consumption is reduced. This adaptive method not only balances the energy consumption of each wireless switch, but also maintains good communication quality by timely adjusting the network structure, ensuring the stability and reliability of network performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0022] Figure 1 A schematic flow chart of a smart switch networking method based on Bluetooth mesh provided in an embodiment of the present application;
[0023] Figure 2 A schematic block diagram of a Bluetooth mesh-based smart switch networking device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0026] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0027] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] See also Figure 1 , Figure 1 The embodiment of the present application also provides a schematic flow chart of a method for networking a smart switch based on Bluetooth mesh. Figure 1 The Bluetooth mesh-based smart switch networking method shown is applied to a central network manager of the networking, which may be a server. The specific steps of the method include: S101-S105.
[0029] S101. Obtain initial feature data according to hardware capability information, power type information, and geographic location information of each smart switch connected to the Bluetooth mesh network.
[0030] For example, the processor performance and storage capacity of each smart switch are tested to obtain hardware capability information. The power supply mode of each smart switch is identified and divided into wired power supply or battery power supply to obtain power type information. The spatial coordinates of each smart switch are obtained through GPS or indoor positioning technology to obtain geographic location information. This information is integrated into a multidimensional feature vector to form initial feature data. This step provides basic data support for subsequent network planning.
[0031] S102: Perform type analysis on each intelligent switch according to the initial feature data to obtain switch type data.
[0032] Exemplarily, a multi-factor scoring model is designed to perform weighted calculations on the various indicators in the initial feature data. For example, a higher weight is given to the power type (wired power supply has a high score), followed by processing capacity, and then geographical location centrality. Through this scoring model, the comprehensive score of each smart switch is calculated. A threshold is set, and those above the threshold are preliminarily classified as potential backbone switches, and those below the threshold are classified as potential edge switches, thereby obtaining switch type data. This step realizes the preliminary classification of network nodes and lays the foundation for building an efficient network topology.
[0033] S103: Obtain an initial network topology structure according to a preset network allocation algorithm and switch type data. The initial network topology structure includes backbone switches and edge switches.
[0034] Exemplarily, a network allocation algorithm is designed that considers the following factors: 1) The uniformity of the spatial distribution of backbone switches. 2) Each edge switch is directly connected to at least one backbone switch. 3) The connection redundancy between backbone switches. The algorithm first selects the potential backbone switch with the highest score as the seed node, and then iteratively selects other backbone switches step by step until the network coverage and connectivity requirements are met. Finally, the remaining nodes are set as edge switches and their connection relationships with the backbone switches are determined. This step constructs an initial, hierarchical network topology, which provides an infrastructure for the efficient operation of the network.
[0035] S104, performing networking communication according to the initial network topology structure, collecting single load data during the networking communication process, and performing multi-dimensional evaluation based on the single load data to obtain a comprehensive load index.
[0036] Exemplarily, network communication starts under the initial network topology. At the same time, a distributed monitoring system is deployed, which runs on each backbone switch to collect the following data: message forwarding times, message path length, and message throughput per unit time. The sliding time window technology is used for each data to calculate the average value of different time scales (such as 1 minute, 5 minutes, 1 hour) to obtain single load data. Then, a multi-dimensional evaluation model is designed, which includes: path load factor (based on message forwarding times and message path length), information density factor (based on message throughput) and topology complexity factor (based on node connectivity of the initial network topology). These factors are weighted and summed to obtain the comprehensive load index (CLI).
[0037] This step realizes real-time monitoring and quantitative evaluation of network operation status, providing a basis for subsequent network optimization.
[0038] S105. When the comprehensive load index exceeds a preset threshold, a role upgrade evaluation is performed on the edge switch to obtain a role adjustment decision, and an optimized network topology is obtained according to the role adjustment decision and the initial network topology.
[0039] Exemplarily, a CLI threshold is set. When the CLI exceeds the threshold, the role upgrade evaluation process is triggered. The process includes: 1) Identify the backbone switch area with the highest load. Select potential edge switches around the area for evaluation. 3) For each candidate edge switch, consider its current battery power, processing power, connectivity with surrounding nodes and other factors. 4) Use a machine learning algorithm (such as a decision tree or random forest) to predict the degree of improvement in network performance after upgrading the edge switch to a backbone switch. 5) If the prediction result shows that the CLI can be significantly reduced after the upgrade and the node power will not be excessively consumed, the edge switch is marked as a node to be upgraded. Finally, a role adjustment decision is obtained, which contains a list of all edge switches to be upgraded. After completing the above steps, a role upgrade request is sent to each edge switch to be upgraded in the role adjustment decision. Receive the confirmation response of the node and guide it to adjust its internal state (such as increasing the listening frequency, expanding the routing table, etc.). Update the global network topology information and add the new backbone switch to the routing calculation. Broadcast the topology update information to the adjacent nodes to guide them to update their respective routing tables. Recalculate the optimal routing path in the network. Finally, an optimized network topology is obtained, which reflects the latest node role assignment and connection relationship. This step realizes the dynamic reconstruction of the network topology and improves the overall performance and reliability of the network.
[0040] The embodiment of the present application provides a smart switch networking method based on Bluetooth mesh, the method comprising: obtaining initial feature data according to hardware capability information, power type information and geographic location information of each smart switch connected to the Bluetooth mesh network; performing type analysis on each smart switch according to the initial feature data to obtain switch type data; obtaining an initial network topology structure according to a preset network allocation algorithm and the switch type data, the initial network topology structure including a backbone switch and an edge switch; performing networking communication according to the initial network topology structure, and collecting single load data during the networking communication process, performing multi-dimensional evaluation according to the single load data to obtain a comprehensive load index; when the comprehensive load index exceeds a preset threshold, performing role upgrade evaluation on the edge switch to obtain a role adjustment decision, and obtaining an optimized network topology structure according to the role adjustment decision and the initial network topology structure. Through the above method, switches are classified according to hardware capabilities, power type and geographical location to ensure that the initial network structure distributes the load reasonably, avoiding wireless switches from becoming backbone switches directly during the initial network distribution. The network load is then monitored in real time and multi-dimensional evaluation is performed. When the load exceeds the threshold, the role upgrade evaluation is triggered, allowing communication tasks to be redistributed according to actual conditions, transferring the load from switches with higher energy consumption to other switches, and then balancing the overall energy consumption. By optimizing the network topology, unnecessary data transmission is reduced, and the overall energy consumption is reduced. This adaptive method not only balances the energy consumption of each wireless switch, but also maintains good communication quality by timely adjusting the network structure, ensuring the stability and reliability of network performance.
[0041] In order to more clearly introduce the technical solution of the present application, the technical solution of the present application will be introduced through specific embodiments below. It should be noted that the specific embodiments are used to expand the technical solution of the present application, but are not intended to limit the present application.
[0042] In some embodiments, a type analysis is performed on each smart switch based on the initial feature data to obtain switch type data, including: dividing the smart switches into wired switches and wireless switches based on the power type information; setting the wireless switches as class I edge switches; determining the backbone switches and class II edge switches from the wired switches based on a preset weighting algorithm, hardware capability information, and geographic location information; and generating switch type data based on the flags of the smart switches, class I edge switches, class II edge switches, and backbone switches.
[0043] Exemplarily, according to the power type information, the smart switches are divided into wired switches and wireless switches. Wired switches are usually powered directly by power lines, while wireless switches rely on portable power sources such as batteries. All wireless switches are automatically set to class I edge switches. Such switches are usually deployed at the edge of the network to expand network coverage or connect specific devices. For wired switches, a preset weighted algorithm is used to comprehensively consider hardware capability information (such as processing power, storage capacity, etc.) and geographic location information (such as centrality, connectivity, etc.), and backbone switches and class II edge switches are determined from them. Backbone switches usually have strong processing capabilities and key network locations, while class II edge switches are between backbone switches and class I edge switches. Finally, according to the unique identifier of each smart switch, combined with the classification results of class I edge switches, class II edge switches and backbone switches determined previously, complete switch type data is generated. These data will be used for subsequent network management and optimization.
[0044] In some embodiments, a role upgrade evaluation is performed on the edge switch to obtain a role adjustment decision, including: S1051-S1057.
[0045] S1051. According to the initial network topology structure, construct an adjacency matrix and a degree matrix to obtain a network topology representation.
[0046] Exemplarily, the initial network topology refers to the initial state of all nodes and their connections in the network. The adjacency matrix is a two-dimensional matrix used to represent the connection relationship between nodes in a graph. If there is a connection between node i and node j, the element at the corresponding position in the matrix is 1, otherwise it is 0. The degree matrix is a diagonal matrix, and the elements on the diagonal represent the degree of each node (the number of edges connected to it). By combining the adjacency matrix and the degree matrix, we can get a complete network topology representation, which contains the structural information of the network.
[0047] S1052: Collect data on the first-class edge switches and the second-class edge switches to obtain edge switch state vectors, where the edge switch state vectors include: hardware capability information, power type information, geographic location information, and current load data.
[0048] Exemplarily, hardware capability information includes: processor performance, memory capacity, storage space, etc. Power type information includes: mains power, battery power, or solar power, etc. Geographic location information includes: physical installation location coordinates of the device. Current load data includes: CPU usage, memory usage, network throughput, etc. This information is organized into a vector to represent the current state of each edge switch.
[0049] S1053, input the network topology representation and the edge switch state vector into a graph convolutional neural network to obtain a topology-aware feature representation of the edge switch. The graph convolutional neural network includes two graph convolutional layers, and the output feature dimensions of each layer are 32 and 16 respectively.
[0050] Exemplarily, the network topology representation is used as a graph structure input. The edge switch state vector is used as the node feature input. The first layer of GCN converts the input features into 32-dimensional hidden features. The second layer of GCN further compresses the features to 16 dimensions. The output 16-dimensional feature vector contains the topology-aware information of each edge switch, that is, it takes into account the node's own characteristics and its position relationship in the network.
[0051] S1054. Apply a self-attention mechanism to the topological perception feature representation to obtain the spatial correlation features of the edge switch. The self-attention mechanism uses single-head attention, and the attention dimension is 16.
[0052] For example, topology-aware feature representation is used as input. Single-head attention is used, which means there is only one attention calculation process. The attention dimension is 16, which matches the input feature dimension. The self-attention mechanism calculates the degree of correlation of each feature with other features. The output spatial correlation feature contains the relationship information of each edge switch with the entire network.
[0053] S1055: Input the spatial correlation features into a fully connected layer to obtain the upgraded fitness score of the edge switch. The output dimension of the fully connected layer is 1.
[0054] Exemplarily, spatial correlation features are used as input. The weight matrix of the fully connected layer maps the 16-dimensional input to a 1-dimensional output. An activation function (such as sigmoid) is applied to compress the output into the range of 0-1. The single numerical value output represents the upgrade fitness score of each edge switch, reflecting the suitability of the switch for upgrading.
[0055] S1056: sort the first-class edge switches and the second-class edge switches respectively according to the upgrade fitness scores, and select N edge switches with the highest scores as candidate upgrade nodes, where N is the preset number of upgrade nodes.
[0056] For example, class 1 and class 2 edge switches are processed separately, perhaps because they have different upgrade strategies or restrictions. In each class, the switches are sorted in descending order based on their upgrade fitness scores. The top N switches are selected from the sorted list. N is a predetermined number, which may be based on factors such as budget, resource constraints, etc. The selected switches become candidate upgrade nodes, which means they are most likely to be considered in the next upgrade process.
[0057] S1057, applying a graph attention network (GAT) to the candidate upgrade nodes and the initial network topology structure, simulating the network performance after the upgrade, and obtaining the role adjustment decision. The graph attention network includes 2 layers, each layer has 4 attention heads, and the output dimension is the number of optional roles.
[0058] Exemplarily, candidate upgrade nodes are taken as input along with the initial network topology. Each layer of GAT has 4 attention heads, which allows the network to learn the relationship between nodes from different perspectives. The output dimension is equal to the number of optional roles, which means that the network directly predicts the new role that each node is suitable for. Through this process, the model simulates the performance of the upgraded network and recommends the most suitable new role for each candidate node. The final role adjustment decision is based on these recommendations, and may also need to consider other practical constraints.
[0059] By combining graph neural networks and attention mechanisms, an intelligent network optimization system is realized. It can fully perceive the network topology, integrate multi-dimensional node features, and perform context-aware analysis. The system's adaptive scoring and classification processing improve the accuracy of upgrade decisions, while performance simulation and role optimization functions help predict upgrade effects. The solution has good scalability and dynamic adaptability, can effectively improve the performance and management efficiency of large-scale networks, and represents the advanced level in the field of network optimization.
[0060] In some embodiments, a graph attention network is applied to candidate upgrade nodes and an initial network topology structure to simulate the performance of the upgraded network and obtain a role adjustment decision. The specific steps include: S1061-S1066.
[0061] S1061. Perform time series analysis on historical load data of candidate upgrade nodes to obtain a load prediction model.
[0062] Exemplarily, the time series analysis uses a long short-term memory network (LSTM), and the number of hidden layer units of the LSTM is 128.
[0063] S1062: Predict the load of the candidate upgrade node within a preset time period according to the load prediction model to obtain a predicted load sequence.
[0064] Exemplarily, the preset time period is 24 hours and the prediction interval is 1 hour, so that it can be ensured that the wireless switch will not serve as an important communication node for a long time, thereby causing excessive power consumption.
[0065] S1063. Apply a graph attention network to the predicted load sequence and the initial network topology to obtain node importance scores.
[0066] S1064. Screen candidate upgrade nodes according to node importance scores to obtain a target edge switch set.
[0067] Exemplarily, since the aforementioned process has taken into account the energy usage of a class of edge switches, during the screening process, if the importance score of a class of edge switches is higher than a preset threshold, it will be included in the target edge switch set. This can improve the communication quality and avoid skipping a class of edge switches, resulting in an excessively long data link.
[0068] S1065 . For each first-category edge switch in the target edge switch set, perform substitute switch matching among the surrounding second-category edge switches to obtain a substitute switch mapping table.
[0069] Exemplarily, the substitute switch matching is scored based on geographic location proximity and hardware capability similarity, and the second-category edge switch with the highest score is selected as a substitute.
[0070] S1066: construct a role transition graph according to the target edge switch set, the substitute switch mapping table and the initial network topology structure, and perform minimum spanning tree algorithm processing on the role transition graph to obtain a role adjustment decision.
[0071] Exemplarily, the minimum spanning tree algorithm adopts the Kruskal algorithm, and uses the upgrade cost between nodes as the edge weight.
[0072] In some embodiments, network communication is performed according to the initial network topology structure, and single load data in the process of network communication is collected, and a multi-dimensional evaluation is performed according to the single load data to obtain a comprehensive load index, including: spatially dividing the initial network topology structure to obtain multiple sub-areas; spatial division adopts a density-based spatial clustering algorithm, and clustering parameters include neighborhood radius and minimum number of points; load data of edge switches in each sub-area are collected to obtain a sub-area load data set; the load data includes network throughput, delay and packet loss rate; sliding time window processing is applied to the sub-area load data set to obtain time series load data; sliding time window The length is 5 minutes and the step size is 1 minute; the time series load data is input into the first long short-term memory network and the second long short-term memory network to obtain the sub-region load characteristics; the self-attention mechanism is applied to the sub-region load characteristics to obtain the weighted load characteristics; the self-attention mechanism adopts single-head attention, and the attention dimension is 64; the weighted load characteristics are input into the fully connected layer to obtain the sub-region comprehensive load index; the output dimension of the fully connected layer is 1; the sub-region comprehensive load index is threshold judged to identify the overloaded sub-region; the threshold is dynamically adjusted according to the statistical distribution of the historical load data; according to the number and distribution of overloaded sub-regions, the comprehensive load index of the overall network is calculated.
[0073] By spatially partitioning the initial network topology, the density-based spatial clustering algorithm is used to divide the network into multiple sub-regions, and load data is collected for edge switches in each sub-region. By collecting load data such as network throughput, latency, and packet loss rate, and applying sliding time window processing, time series load data is generated. Subsequently, the time series load data is input into the long short-term memory network (LSTM) to extract the sub-region load features, and weighted processing is performed through the self-attention mechanism to further improve the accuracy of feature representation. Finally, the sub-region comprehensive load index is calculated through the fully connected layer, and the overloaded sub-region is identified according to the dynamically adjusted threshold. On this basis, the comprehensive load index of the overall network is calculated. This method can not only accurately capture the load status of each sub-region in the network, but also dynamically adapt to network load changes in time series, providing efficient overload identification and optimization decisions. This multi-dimensional evaluation and dynamic adjustment mechanism significantly improves the network's load perception and adaptive optimization capabilities, ensuring the stability and performance of the network under high-load environments.
[0074] In some embodiments, the time series load data is input into the first long short-term memory network and the second long short-term memory network to obtain the sub-region load characteristics, including: inputting the time series load data into the first layer long short-term memory network for processing to obtain the first layer hidden state sequence; the hidden state dimension of the first layer long short-term memory network is 128; performing a Dropout operation on the first layer hidden state sequence to obtain a hidden state sequence after dropout; the dropout rate of the Dropout operation is 0.3; performing a second layer long short-term memory network on the hidden state sequence after dropout to obtain a second layer hidden state sequence; the hidden state dimension of the second layer long short-term memory network is 128; performing an attention pooling operation on the second layer hidden state sequence to obtain a sub-region load characteristic of a fixed dimension; the attention pooling operation uses an additive attention mechanism, and the attention weight is calculated by a single-layer feedforward neural network; performing batch normalization processing on the sub-region load characteristics to obtain normalized sub-region load characteristics; performing a residual connection between the normalized sub-region load characteristics and the hidden state of the last time step of the first layer hidden state sequence to obtain the sub-region load characteristics.
[0075] In this embodiment, by inputting the time series load data into a two-layer long short-term memory network (LSTM), the sub-region load features are extracted, which can effectively capture the long-term dependencies of the time series data. After the first layer of LSTM processing, the overfitting is reduced by the Dropout operation, and then the second layer of LSTM further extracts deep features. The additive attention mechanism is used for the attention pooling operation, so that the model can focus on the key time points in the load data and obtain a feature vector of fixed dimension. The stability and expressiveness of the features are further enhanced through batch normalization processing and residual connection. Ultimately, this method can provide more accurate and robust sub-region load features, which is helpful for subsequent prediction and optimization tasks.
[0076] In some embodiments, an optimized network topology is obtained based on the role adjustment decision and the initial network topology, including: determining the need for a target edge switch based on the role adjustment decision; updating the target edge switch to a backbone switch to obtain optimized switch type data; and generating an optimized network topology based on a preset network allocation algorithm and the optimized switch type data.
[0077] See also Figure 2 , Figure 2 The embodiment of the present application also provides a schematic block diagram of a smart switch networking device based on Bluetooth mesh, wherein the smart switch networking device based on Bluetooth mesh 200 is used to execute the aforementioned smart switch networking method based on Bluetooth mesh. The smart switch networking device based on Bluetooth mesh 200 can be configured in a server.
[0078] Among them, the server can be an independent server or a server cluster, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms.
[0079] like Figure 2 As shown, the smart switch networking device 200 based on Bluetooth mesh includes: a data acquisition module 201, a type analysis module 202, a topology determination module 203, a load calculation module 204 and a topology optimization module 205.
[0080] The data acquisition module 201 is used to obtain initial feature data according to the hardware capability information, power type information and geographical location information of each smart switch connected to the Bluetooth mesh network.
[0081] The type analysis module 202 is used to perform type analysis on each of the smart switches according to the initial feature data to obtain switch type data.
[0082] The topology determination module 203 is used to obtain an initial network topology structure according to a preset network allocation algorithm and the switch type data, wherein the initial network topology structure includes a backbone switch and an edge switch.
[0083] The load calculation module 204 is used to perform networking communication according to the initial network topology structure, collect single load data during the networking communication process, and perform multi-dimensional evaluation based on the single load data to obtain a comprehensive load index.
[0084] The topology optimization module 205 is used to perform role upgrade evaluation on the edge switch when the comprehensive load index exceeds a preset threshold, obtain a role adjustment decision, and obtain an optimized network topology structure based on the role adjustment decision and the initial network topology structure.
[0085] An embodiment of the present application provides an electronic device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a Bluetooth mesh-based smart switch networking method as any one of the embodiments of the present application when executing the computer program.
[0086] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements any Bluetooth mesh-based smart switch networking method as described in the embodiments of the present application.
[0087] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A smart switch networking method based on Bluetooth mesh, characterized in that: The method comprises: Obtain initial feature data based on the hardware capability information, power type information, and geographic location information of each smart switch connected to the Bluetooth mesh network; According to the initial characteristic data, performing type analysis on each of the intelligent switches to obtain switch type data; According to a preset network allocation algorithm and the switch type data, an initial network topology structure is obtained, wherein the initial network topology structure includes a backbone switch and an edge switch; The initial network topology is spatially divided to obtain multiple sub-areas; the spatial division adopts a density-based spatial clustering algorithm, and the clustering parameters include the neighborhood radius and the minimum number of points; the load data of the edge switches in each sub-area is collected to obtain a sub-area load data set; the load data includes network throughput, delay and packet loss rate; the sub-area load data set is processed by a sliding time window to obtain time series load data; the length of the sliding time window is 5 minutes and the step length is 1 minute; the time series load data is input into the first long short-term memory network and the second long short-term memory network to obtain sub-area load characteristics; the self-attention mechanism is applied to the sub-area load characteristics to obtain weighted load characteristics; the self-attention mechanism adopts single-head attention, and the attention dimension is 64; the weighted load characteristics are input into the fully connected layer to obtain the sub-area comprehensive load index; the output dimension of the fully connected layer is 1; the sub-area comprehensive load index is threshold judged to identify overloaded sub-areas; the threshold is dynamically adjusted according to the statistical distribution of historical load data; according to the number and distribution of the overloaded sub-areas, the comprehensive load index of the overall network is calculated; When the comprehensive load index exceeds a preset threshold, a role upgrade evaluation is performed on the edge switch to obtain a role adjustment decision, and an optimized network topology is obtained according to the role adjustment decision and the initial network topology.
2. The smart switch networking method based on Bluetooth mesh according to claim 1, characterized in that: The step of performing type analysis on each of the intelligent switches according to the initial feature data to obtain switch type data includes: According to the power type information, the smart switch is divided into a wired switch and a wireless switch; Setting the wireless switch to be a type of edge switch; Determine a backbone switch and a second type of edge switch from the wired switches according to a preset weighting algorithm, the hardware capability information and the geographic location information; The switch type data is generated according to the flag of the intelligent switch, the first type edge switch, the second type edge switch and the backbone switch.
3. The Bluetooth mesh-based smart switch networking method according to claim 2, characterized in that: The performing role upgrade evaluation on the edge switch to obtain a role adjustment decision includes: According to the initial network topology structure, construct an adjacency matrix and a degree matrix to obtain a network topology representation; Collecting data on the first type of edge switches and the second type of edge switches to obtain edge switch state vectors; Inputting the network topology representation and the edge switch state vector into a graph convolutional neural network to obtain a topology-aware feature representation of the edge switch; Applying a self-attention mechanism to the topology-aware feature representation to obtain spatial correlation features of edge switches; Inputting the spatial correlation features into a fully connected layer to obtain an upgraded fitness score of the edge switch; According to the upgrade fitness scores, the first type edge switches and the second type edge switches are sorted respectively, and the N edge switches with the highest scores are selected as candidate upgrade nodes; A graph attention network is applied to the candidate upgrade nodes and the initial network topology structure to simulate the upgraded network performance and obtain the role adjustment decision.
4. The Bluetooth mesh-based smart switch networking method according to claim 3, characterized in that: The applying a graph attention network to the candidate upgrade node and the initial network topology structure to simulate the upgraded network performance and obtain the role adjustment decision includes: Performing time series analysis on the historical load data of the candidate upgrade node to obtain a load prediction model; Predicting the load of the candidate upgrade node within a preset time period according to the load prediction model to obtain a predicted load sequence; Applying a graph attention network to the predicted load sequence and the initial network topology to obtain node importance scores; Screening candidate upgrade nodes according to the node importance scores to obtain a target edge switch set; For each first-class edge switch in the target edge switch set, performing substitute switch matching among the surrounding second-class edge switches, and obtaining a substitute switch mapping table; A role transition graph is constructed according to the target edge switch set, the substitute switch mapping table and the initial network topology structure, and a minimum spanning tree algorithm is performed on the role transition graph to obtain the role adjustment decision.
5. The smart switch networking method based on Bluetooth mesh according to claim 1, characterized in that: The step of inputting the time series load data into the first long short-term memory network and the second long short-term memory network to obtain the sub-region load characteristics includes: Input the time series load data into the first layer of long short-term memory network for processing to obtain a first layer hidden state sequence; the hidden state dimension of the first layer of long short-term memory network is 128; Performing a Dropout operation on the hidden state sequence of the first layer to obtain a hidden state sequence after dropout; the dropout rate of the Dropout operation is 0.3; Performing a second-layer long short-term memory network processing on the hidden state sequence after dropout to obtain a second-layer hidden state sequence; the hidden state dimension of the second-layer long short-term memory network is 128; Performing an attention pooling operation on the second layer hidden state sequence to obtain a sub-region load feature of a fixed dimension; the attention pooling operation uses an additive attention mechanism, and the attention weight is calculated by a single-layer feedforward neural network; Performing batch normalization processing on the sub-region load characteristics to obtain normalized sub-region load characteristics; The normalized sub-region load feature is residually connected to the hidden state of the last time step of the first layer hidden state sequence to obtain the sub-region load feature.
6. The Bluetooth mesh-based smart switch networking method according to claim 3, characterized in that: The step of obtaining an optimized network topology structure according to the role adjustment decision and the initial network topology structure includes: Determining a required target edge switch from the edge switches according to the role adjustment decision; Updating the target edge switch to a backbone switch to obtain optimized switch type data; The optimized network topology is generated according to a preset network allocation algorithm and the optimized switch type data.
7. A smart switch networking device based on Bluetooth mesh, characterized in that: The Bluetooth mesh-based smart switch networking device is used to execute the Bluetooth mesh-based smart switch networking method according to any one of claims 1 to 6, and the Bluetooth mesh-based smart switch networking device includes: A data acquisition module is used to obtain initial feature data based on the hardware capability information, power type information and geographic location information of each smart switch connected to the Bluetooth mesh network; A type analysis module, used to perform type analysis on each of the smart switches according to the initial feature data to obtain switch type data; A topology determination module, configured to obtain an initial network topology structure according to a preset network allocation algorithm and the switch type data, wherein the initial network topology structure includes a backbone switch and an edge switch; A load calculation module is used to spatially divide the initial network topology structure to obtain multiple sub-areas; the spatial division adopts a density-based spatial clustering algorithm, and the clustering parameters include the neighborhood radius and the minimum number of points; load data is collected from the edge switches in each sub-area to obtain a sub-area load data set; the load data includes network throughput, delay and packet loss rate; sliding time window processing is applied to the sub-area load data set to obtain time series load data; the length of the sliding time window is 5 minutes and the step length is 1 minute; the time series load data is input into the first long short-term memory network and the second long short-term memory network to obtain sub-area load characteristics; a self-attention mechanism is applied to the sub-area load characteristics to obtain weighted load characteristics; the self-attention mechanism adopts single-head attention, and the attention dimension is 64; the weighted load characteristics are input into a fully connected layer to obtain a sub-area comprehensive load index; the output dimension of the fully connected layer is 1; a threshold judgment is performed on the sub-area comprehensive load index to identify overloaded sub-areas; the threshold is dynamically adjusted according to the statistical distribution of historical load data; the comprehensive load index of the overall network is calculated according to the number and distribution of the overloaded sub-areas; A topology optimization module is used to perform a role upgrade evaluation on the edge switch when the comprehensive load index exceeds a preset threshold, obtain a role adjustment decision, and obtain an optimized network topology structure based on the role adjustment decision and the initial network topology structure.
Citation Information
Patent Citations
Method for establishing decentralized Bluetooth SIG mesh network and intelligent lighting system applying method
CN111556477A
Networking method and device of single-live-wire Bluetooth intelligent switch, electronic equipment and medium
CN112543413A