Lamp networking method

Through the light intensity perception and feature vector generation of lamps, combined with multi-path effect suppression and Q-learning routing decisions, the problem of difficulty in efficient networking of lamps in a signal-poor environment is solved, and a stable and reliable topology and optimization of lamps in a network are achieved. data transmission efficiency.

CN119402988AActive Publication Date: 2025-02-07ZHOU GANG LIGHTING TECH (CHENGDU) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411486334.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-07
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

The existing lamp networking scheme is difficult to efficiently form the network in large-scale indoors, especially in basements, and other environments with poor network signals, and faces the problems of limited signal coverage, unstable network connections and difficulty in network maintenance.

Method used

Light intensity perception is performed through lamps, the light intensity change sequence is extracted and the light intensity characteristic vector is generated, the light intensity change time difference is calculated, the multi-path effect is identified and suppressed, the node relative position matrix is ​​constructed, the initial connection relationship is established, the topological structure is optimized, and the topological structure is adopted The pre-trained Q-learning routing decision model performs dynamic routing updates to realize the networking of lamps.

Benefits of technology

This method can accurately locate lamp nodes in complex environments, build an efficient, reliable and balanced lamp network topology, improve data transmission efficiency and reliability, adapt to communication limitations in the actual environment, and optimize network performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402988A_ABST
    Figure CN119402988A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wireless networks, in particular to a lamp networking method. The method comprises the following steps: performing light intensity perception and light intensity variation sequence extraction through a lamp to obtain a light intensity variation sequence; generating a light intensity feature vector according to the light intensity variation sequence to obtain the light intensity feature vector; performing light intensity change time difference calculation according to the light intensity feature vector to obtain a light intensity change time difference matrix; performing multi-path effect identification and path effect suppression on the light intensity change time difference matrix to obtain multi-path effect suppression data; constructing a node relative position matrix according to the multipath effect suppression data to obtain a node relative position matrix; and establishing an initial connection relationship according to the node relative position matrix to obtain initial network connection relationship data. By optimizing data transmission, delay and network congestion are reduced, and efficient and stable lamp networking is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wireless network, and in particular to a lamp networking method. Background Art

[0002] Existing lighting networking solutions mainly rely on traditional wireless communication technologies such as WiFi, Bluetooth, and Zigbee. When facing large-scale indoor spaces, especially in environments with poor network signals such as basements, it is often difficult to efficiently network. In scenarios such as large-scale indoor spaces with poor network signals, traditional lighting networking technology faces the following challenges: Limited signal coverage: Basements are often large and complex in structure. Walls and metal structures severely block wireless signals, resulting in limited coverage of WiFi, Bluetooth and other signals, making it difficult to achieve stable connection of all lamps.

[0003] Unstable network connection: Even if some areas can receive weak signals, they are easily affected by environmental interference, resulting in intermittent network connection and affecting the normal control of lamps.

[0004] Difficulty in networking and maintenance: Due to poor signal quality, lamps will frequently go offline, requiring reconfiguration or adding relay equipment, which increases the difficulty of networking and maintenance. Summary of the invention

[0005] Based on this, it is necessary to provide a lighting networking method to solve at least one of the above technical problems.

[0006] To achieve the above object, a lamp networking method includes the following steps: Step S1: sensing light intensity through the lamp and extracting a light intensity variation sequence to obtain a light intensity variation sequence; generating a light intensity feature vector according to the light intensity variation sequence to obtain a light intensity feature vector; Step S2: Calculate the light intensity change time difference according to the light intensity feature vector to obtain the light intensity change time difference matrix; identify the multipath effect of the light intensity change time difference matrix and suppress the path effect to obtain multipath effect suppression data; construct the node relative position matrix according to the multipath effect suppression data to obtain the node relative position matrix; Step S3: Establishing an initial connection relationship according to the node relative position matrix to obtain initial network connection relationship data; constructing a topological structure and optimizing the topological structure according to the initial network connection relationship data to obtain a network topology diagram; Step S4: Calculate the routing evaluation index according to the network topology diagram to obtain routing evaluation index data; use the pre-trained Q learning routing decision model and the routing evaluation index data to make Q learning routing decisions and perform dynamic routing updates to obtain a dynamic routing table; Step S5: Perform network status analysis according to the dynamic routing table to obtain network status analysis result data; perform node networking control processing according to the network status analysis result data to realize the lighting networking operation.

[0007] The present invention can effectively identify the unique light change pattern of each lamp through light intensity perception, data preprocessing, light intensity change sequence extraction, pattern analysis and feature vector generation, and convert it into a quantifiable feature vector, providing a reliable basis for subsequent node identification, positioning and networking, and overcoming the problem that traditional wireless communication technology is susceptible to environmental interference. Through feature vector broadcasting, neighbor node screening, light intensity change time difference calculation, multipath effect identification and suppression, initial relative position calculation and least squares optimization, the accurate positioning of lamp nodes is achieved, and an accurate node relative position matrix can be constructed even in a complex environment, laying the foundation for the subsequent construction of a reliable network topology. Through node relative position visualization, triangulation, minimum spanning tree construction, communication range constraints, node centrality calculation and load balancing adjustment, an efficient, reliable and balanced lamp network topology is constructed. The structure can adapt to the communication restrictions of the actual environment and effectively balance the node load, laying the foundation for subsequent network communication and management. Through neighbor node information maintenance, greedy forwarding, link state information exchange, multipath routing search, routing evaluation index calculation and Q learning routing decision, a dynamic routing mechanism based on Q learning is realized. The mechanism can adaptively select the optimal routing path according to the change of network status, thereby improving the data transmission efficiency, reliability and network resource utilization. Through real-time collection of network performance indicators, data aggregation, parameter optimization, fuzzy logic reasoning and control instruction issuance, a lamp networking control mechanism based on prediction and feedback is realized. The mechanism can dynamically adjust network parameters and routing strategies according to changes in network status, optimize network performance, improve data transmission efficiency and reliability, and ensure stable operation of the network. Therefore, the present invention provides a lamp and a lamp networking method to solve the problem that traditional lamp networking is difficult to efficiently network in scenarios with poor network signals such as large-scale indoor environments. By introducing a high-precision light intensity sensor array and a dynamic routing decision mechanism based on Q learning, the performance of lamps in large-scale indoor environments (such as basements and other areas with poor network signals) is significantly improved. First, the light intensity sensor can monitor the changes in ambient light in real time, accurately generate light intensity feature vectors, and ensure that the lamps are automatically adjusted according to actual lighting conditions. Secondly, by calculating the time difference of light intensity changes and suppressing multipath effects, signal interference is effectively reduced and communication stability is enhanced. In addition, the dynamic routing update mechanism adaptively adjusts the communication path according to the real-time network status, optimizes data transmission, reduces latency and network congestion, and ultimately achieves efficient and stable lighting networking and improves user experience.

[0008] Preferably, step S1 comprises the following steps: Step S11: collecting light intensity data through the light intensity sensor array of the lamp to obtain raw light intensity data; performing data preprocessing on the raw light intensity data to obtain preprocessed light intensity data; Step S12: Establishing an ambient light intensity baseline according to the pre-processed light intensity data to obtain an ambient light intensity baseline value; Step S13: extracting a light intensity variation sequence from the pre-processed light intensity data and the ambient light intensity baseline value to obtain a light intensity variation sequence; Step S14: performing light intensity variation pattern analysis on the light intensity variation sequence to obtain light intensity variation pattern data; Step S15: Generate a light intensity feature vector according to the light intensity variation pattern data to obtain a light intensity feature vector.

[0009] The present invention collects raw light intensity data through a light intensity sensor array and performs data preprocessing, which can effectively remove the influence of high-frequency noise and ambient light fluctuations, obtain more accurate and stable light intensity data, and lay the foundation for subsequent light intensity change analysis and feature extraction. Establishing an ambient light intensity baseline can eliminate the interference of ambient light intensity changes on the light intensity changes of the lamp itself, more accurately extract the light intensity change information of the lamp itself, and improve the accuracy of light intensity change pattern recognition. Extracting a sequence of light intensity changes can convert the light intensity data into a sequence that more intuitively represents the light intensity changes of the lamp itself, which is more convenient for subsequent light intensity change pattern analysis and feature extraction. Performing light intensity change pattern analysis on the light intensity change sequence can identify different light intensity change patterns of the lamp, such as flickering, gradual change, periodic change, etc., and provide a basis for generating unique identification information for each lamp. Generating a light intensity feature vector based on the light intensity change pattern data can convert the light intensity change information of the lamp into a quantifiable feature vector, providing a basis for subsequent node identification, positioning and networking.

[0010] Preferably, step S2 comprises the following steps: Step S21: broadcasting the light intensity feature vector through the lamp and receiving the feature vector to obtain the node light intensity feature vector; Step S22: screening potential neighboring nodes for the node light intensity feature vector to obtain potential neighboring nodes; calculating the light intensity change time difference for the potential neighboring nodes to obtain a light intensity change time difference matrix; Step S23: Estimating the initial distance of the node according to the light intensity change time difference matrix to obtain the initial distance value of the node; Step S24: performing multipath effect identification and path effect suppression on the light intensity variation time difference matrix to obtain multipath effect suppression data; Step S25: performing initial relative position calculation according to the node initial distance value and multipath effect suppression data to obtain node relative position data; Step S26: performing least square optimization on the node relative position data to obtain node relative position optimization data; constructing a node relative position matrix based on the node relative position optimization data to obtain a node relative position matrix.

[0011] The present invention broadcasts and receives light intensity feature vectors, so that each lamp can sense the existence of other lamps around it and obtain their feature vector information, providing a data basis for subsequent neighbor node screening and distance estimation. By screening potential neighbor nodes through feature vector similarity measurement, nodes with long distances or large differences in light intensity change patterns can be effectively excluded, thereby improving the efficiency and accuracy of subsequent distance estimation and positioning. At the same time, the light intensity change time difference between potential neighbor nodes is calculated to provide necessary data for subsequent distance estimation and multipath effect suppression. According to the light intensity change time difference and the speed of light, the initial distance between the nodes is estimated, providing an initial reference value for subsequent node positioning, and providing distance information for multipath effect suppression. By identifying and suppressing the multipath effect of the light intensity change time difference matrix, the influence of multipath propagation on distance estimation and positioning accuracy can be effectively reduced, the estimation accuracy of the relative position of the node can be improved, and the foundation for building a more accurate network topology map can be laid. According to the initial distance value of the node and the data after the multipath effect is suppressed, the initial relative position of the node is calculated using the three-sided positioning algorithm, providing an initial value for the subsequent least squares optimization. Least squares optimization of the initial relative position data can further improve the estimation accuracy of the node relative position and construct a node relative position matrix to provide accurate node position information for subsequent network topology construction.

[0012] Preferably, calculating the time difference of light intensity change of potential neighboring nodes includes the following steps: Calculate the light intensity change rate of potential neighboring nodes to obtain a light intensity change rate sequence; The cross-correlation function is calculated according to the light intensity change rate sequence to obtain the cross-correlation function; Perform a maximum peak search on the cross-correlation function to obtain the maximum peak; The time difference matrix is ​​constructed according to the maximum peak value to obtain the light intensity change time difference matrix.

[0013] The present invention can amplify the detail changes in the light intensity signal by calculating the light intensity change rate, improve the sensitivity of the time difference calculation, and especially can more accurately capture the difference of the light intensity change when the light intensity changes relatively slowly. The correlation of two light intensity change rate sequences is calculated by using the cross-correlation function, which can effectively eliminate noise interference and extract the time delay information between the two signals. Even in the presence of certain noise, the time difference can be accurately calculated. The maximum peak value is searched in the cross-correlation function, and the most matching time delay between the two light intensity change signals can be determined, that is, the corresponding most likely real time difference, thereby improving the accuracy of the time difference calculation. The light intensity change time difference between all potential neighbor nodes is constructed into a matrix, which can facilitate subsequent distance estimation and multipath effect suppression operations, and provide the necessary data basis for building a network topology structure.

[0014] Preferably, step S24 comprises the following steps: Step S241: performing multipath signal feature analysis on the light intensity variation time difference matrix to obtain multipath signal features; Step S242: performing signal source time difference azimuth estimation according to the multipath signal characteristics to obtain signal source azimuth data; performing signal arrival angle estimation according to the multipath signal characteristics to obtain signal arrival angle data; Step S243: performing multipath signal separation according to the signal arrival angle data and the signal source azimuth data to obtain a multipath signal set; Step S244: performing line-of-sight path identification on the multipath signal set and performing line-of-sight path signal classification according to the multipath signal characteristics to obtain line-of-sight path signals and non-line-of-sight path signals; Step S245: performing non-line-of-sight path suppression on the non-line-of-sight path signal to obtain non-line-of-sight path suppression data; performing line-of-sight path distance estimation according to the line-of-sight path signal to obtain line-of-sight path distance data; Step S246: performing multipath effect suppression on the line-of-sight path distance data according to the non-line-of-sight path suppression data to obtain multipath effect suppression data.

[0015] The present invention can identify node pairs that may have multipath effects by analyzing the characteristics of multipath signals on the time difference matrix of light intensity changes, and extract characteristic information of multipath signals, such as the standard deviation of time difference, change law, etc., to provide a basis for subsequent multipath effect suppression. According to the characteristics of multipath signals, the MUSIC algorithm and TDOA technology are used to estimate the signal source time difference azimuth and signal arrival angle respectively, and the spatial position information of multipath signals can be obtained, providing direction for subsequent multipath signal separation. According to the signal arrival angle and signal source azimuth, beamforming technology is used to separate multipath signals, which can effectively distinguish signals from different directions, separate mixed multipath signals into multiple independent signals, and provide clearer signals for subsequent line-of-sight path identification and suppression. According to the characteristics of multipath signal intensity, signal-to-noise ratio, time difference stability, etc., line-of-sight path signals and non-line-of-sight path signals can be identified, and reliable signals that are less affected by multipath effects can be distinguished, providing more accurate data for subsequent distance estimation. Suppressing non-line-of-sight path signals can reduce the impact of multipath effects on distance estimation, and estimate the line-of-sight path distance based on line-of-sight path signals to obtain an estimated value closer to the actual distance. Based on the results after non-line-of-sight path suppression, multipath effect suppression is performed on line-of-sight path distance data to further improve the accuracy of distance estimation, obtain more reliable distance information, and provide more accurate data support for subsequent node positioning and network topology construction.

[0016] Preferably, step S3 comprises the following steps: Step S31: Visualize the node relative position matrix to obtain a node distribution map; triangulate the node distribution map to obtain triangulation data; Step S32: establishing an initial connection relationship based on the triangulation data to obtain initial network connection relationship data; constructing a minimum spanning tree based on the initial network connection relationship data to obtain minimum spanning tree data; Step S33: Acquire actual communication range data of the lamp; constrain the minimum spanning tree data for communication range according to the actual communication range data of the lamp to obtain node network constraint data; Step S34: performing node degree centrality calculation on the node network constraint data to obtain node degree centrality data; performing node betweenness centrality calculation on the node network constraint data to obtain node betweenness centrality data; Step S35: performing load balancing adjustment according to the node degree centrality data and the node betweenness centrality data to obtain load balancing adjustment data; Step S36: Optimize the topology structure of the node network constraint data according to the load balancing adjustment data and generate a network topology map to obtain a network topology map.

[0017] The present invention can intuitively understand the distribution of nodes by visualizing the node relative position matrix, providing a reference for the subsequent network topology construction. Triangulation divides the node distribution into multiple adjacent triangles, providing a basis for the establishment of the initial connection relationship. By establishing the initial connection relationship based on the triangulation data, an initial network structure connecting all nodes can be quickly generated. On this basis, constructing a minimum spanning tree can remove redundant connections, retain the shortest path connecting all nodes, improve network communication efficiency, and provide a basis for subsequent topology optimization. Constrain the minimum spanning tree according to the actual communication range of the lamp, delete the connection beyond the communication range, ensure that the generated network topology is feasible in the actual environment, and avoid the situation where the connection is unreliable due to the long communication distance. Calculating the degree centrality and betweenness centrality of the node can quantitatively evaluate the importance and load of each node in the network, providing a basis for subsequent load balancing adjustment. Load balancing adjustment based on node centrality can transfer the connection relationship of some high-load nodes to low-load nodes, avoid local congestion in the network, and improve the overall performance and stability of the network. The final network topology diagram is generated based on the results of load balancing adjustment, which can intuitively display the network connection relationship and node load status, making it easier for users to understand the network structure and provide a basis for subsequent routing decisions and network management.

[0018] Preferably, step S4 comprises the following steps: Step S41: maintaining neighbor node information according to the network topology map to obtain a neighbor node information table; calculating the relative position of the target node according to the neighbor node information table to obtain the relative position data of the target node; Step S42: performing greedy forwarding candidate node selection according to the target node relative position data and the neighbor node information table to obtain the greedy forwarding candidate node; Step S43: exchange link state information according to the greedy forwarding candidate nodes to obtain link state information; perform multi-path routing search according to the link state information to obtain multi-path routing data; Step S44: calculating the routing evaluation index for the multi-path routing data to obtain routing evaluation index data; Step S45: using the pre-trained Q learning routing decision model and routing evaluation index data to perform Q learning routing decision, and obtain Q learning routing decision data; Step S46: Perform dynamic routing update according to the Q-learning routing decision data and the multi-path routing data to obtain a dynamic routing table.

[0019] By maintaining a neighbor node information table, each node can quickly obtain the location information of the neighbor node, simplify the target node location query process, and improve routing efficiency. Even if the target node is not within the neighbor range, the target node can be quickly located through multi-hop query. Based on the greedy forwarding strategy, the neighbor node closest to the target node is selected as the candidate node, which can simplify the routing decision process, reduce the calculation complexity, and at the same time ensure the efficiency of data transmission to a certain extent. By exchanging link state information with the candidate node, the sending node can obtain more comprehensive path information, including the number of nodes on the path, packet loss rate, delay, etc., to provide a data basis for subsequent multi-path routing search and routing evaluation. Routing evaluation indicators such as path length, average delay, number of hops, etc. are calculated for multiple candidate paths, and the advantages and disadvantages of each path can be quantitatively evaluated to provide a reference basis for subsequent routing decisions. Using the pre-trained Q learning routing decision model, routing decisions are made according to routing evaluation indicator data, and factors such as path quality and historical experience can be comprehensively considered to select the optimal routing path to improve the efficiency and reliability of data transmission. By updating the dynamic routing table according to the Q learning decision results, the routing strategy can be dynamically adjusted according to the changes in network status, avoiding network congestion, improving network resource utilization, and ensuring network stability and efficiency.

[0020] Preferably, the construction of the pre-trained Q-learning routing decision model includes the following steps: The light intensity change prediction analysis is performed through the light intensity sensor array of the lamp to obtain the light intensity change prediction data; Path lighting nodes are predicted based on light intensity change prediction data to obtain path lighting nodes; Perform Q learning state space expansion on the path lamp nodes to obtain Q learning state space expansion data; perform path link quality evaluation on the path lamp nodes to obtain path link quality data; Design the Q learning reward function according to the Q learning state space expansion data and the path link quality data to obtain the Q learning reward function; The Q learning model is trained and optimized according to the Q learning reward function and the light intensity change prediction data to obtain the Q learning routing decision model.

[0021] The present invention predicts the trend of light intensity changes in the future by analyzing historical light intensity data, and can predict which lamp nodes will be controlled by users, so as to more accurately predict the path of data transmission. According to the light intensity change prediction data, the lamp nodes located on the data transmission path in the future can be identified, and the state information of these nodes can be obtained in advance, providing a basis for the subsequent Q learning state space expansion and link quality evaluation. Taking the path lamp nodes as the state in the Q learning state space can describe the network state more finely and improve the efficiency and accuracy of the Q learning algorithm. Evaluating the quality of the links between the path lamp nodes according to the historical network performance data can provide a reference for the design of the Q learning reward function. For example, high-quality links can be given higher rewards. Designing the Q learning reward function according to the path link quality evaluation results can guide the Q learning algorithm to select high-quality paths, avoid selecting congested or unreliable paths, and improve the efficiency and reliability of data transmission. Using the light intensity change prediction data, the path link quality evaluation results and the designed reward function to train and optimize the Q learning model can enable the model to learn a better routing strategy and improve the performance of the model in the actual network environment.

[0022] Preferably, step S5 comprises the following steps: Step S51: Real-time collection of network performance indicators is performed through monitoring nodes deployed in the network to obtain network performance indicator data; Step S52: Gather network performance indicator data to the central controller node according to the dynamic routing table, perform network status analysis, and obtain network status analysis result data; Step S53: constructing a genetic algorithm parameter optimization model according to the network status analysis result data to obtain a genetic algorithm parameter optimization model; outputting a network performance index prediction value using the genetic algorithm parameter optimization model to obtain a network performance index prediction value; Step S54: Perform fuzzy logic reasoning and output network control instructions according to the network performance index prediction value and the network performance index data to obtain network control instructions; Step S55: the central controller node issues the network control instruction according to the dynamic routing table to obtain the node network control instruction; and executes the node instruction according to the node network control instruction to realize the lighting networking operation.

[0023] The present invention can timely grasp the operation status of the network, such as node connectivity, data transmission delay, data packet loss rate, etc., by real-time collection of network performance indicators by monitoring nodes deployed in the network, and provide data support for subsequent network status analysis and control. According to the dynamic routing table, the network performance indicator data is aggregated to the central controller node, and the performance data of the whole network can be centrally managed and analyzed to form a global network status view, which provides a basis for subsequent network control decisions. The parameter optimization model is constructed by using a genetic algorithm, and training is performed according to the network status analysis result data, so that the optimal network parameter configuration can be found, such as the learning rate and discount factor in the Q learning model, so as to optimize the network performance and improve the data transmission efficiency and reliability. According to the predicted value of the network performance indicator and the actual collected performance data, the fuzzy logic reasoning system is used to judge the network status, and the corresponding control instructions are output, so that more flexible network control can be achieved, such as dynamically adjusting the data transmission rate according to the network load situation. The central controller node sends the network control instruction to the corresponding lamp node according to the dynamic routing table, and the node performs the corresponding operation according to the instruction, such as adjusting the communication module parameters, changing the routing strategy, etc., and finally realizes the real-time monitoring, dynamic adjustment and optimization control of the lamp networking, and ensures the efficient and stable operation of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of the steps of the lamp networking method; Figure 2 for Figure 1 Detailed implementation steps of step S3 in FIG. Figure 3 for Figure 1 Detailed implementation steps of step S4 in FIG.

[0025] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0026] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. 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 technicians in this field without creative work are within the scope of protection of the present invention.

[0027] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0028] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0029] To achieve this, please refer to Figures 1 to 3 , a lamp networking method, comprising the following steps: Step S1: sensing light intensity through the lamp and extracting a light intensity variation sequence to obtain a light intensity variation sequence; generating a light intensity feature vector according to the light intensity variation sequence to obtain a light intensity feature vector; Step S2: Calculate the light intensity change time difference according to the light intensity feature vector to obtain the light intensity change time difference matrix; identify the multipath effect of the light intensity change time difference matrix and suppress the path effect to obtain multipath effect suppression data; construct the node relative position matrix according to the multipath effect suppression data to obtain the node relative position matrix; Step S3: Establishing an initial connection relationship according to the node relative position matrix to obtain initial network connection relationship data; constructing a topological structure and optimizing the topological structure according to the initial network connection relationship data to obtain a network topology diagram; Step S4: Calculate the routing evaluation index according to the network topology diagram to obtain routing evaluation index data; use the pre-trained Q learning routing decision model and the routing evaluation index data to make Q learning routing decisions and perform dynamic routing updates to obtain a dynamic routing table; Step S5: Perform network status analysis according to the dynamic routing table to obtain network status analysis result data; perform node networking control processing according to the network status analysis result data to realize the lighting networking operation.

[0030] In the embodiment of the present invention, reference Figure 1The above is a schematic diagram of the steps of the lamp networking method of the present invention. In this example, the lamp networking method includes the following steps: Step S1: sensing light intensity through the lamp and extracting a light intensity variation sequence to obtain a light intensity variation sequence; generating a light intensity feature vector according to the light intensity variation sequence to obtain a light intensity feature vector; In the embodiment of the present invention, the light intensity sensor array on the lamp collects ambient light intensity data at a frequency of 100Hz, and obtains a preprocessed light intensity data sequence after sliding window mean filtering and baseline correction preprocessing based on polynomial fitting. The preprocessed light intensity data sequence is subtracted from the ambient light intensity baseline value to obtain a light intensity variation sequence. Then, the light intensity variation sequence is subjected to a short-time Fourier transform to extract the frequency and time characteristics, and is matched with a preset light intensity variation pattern library to identify the light intensity variation pattern. Finally, the frequency and time characteristics of the light intensity variation pattern are quantized into numerical values ​​to construct a light intensity feature vector.

[0031] Step S2: Calculate the light intensity change time difference according to the light intensity feature vector to obtain the light intensity change time difference matrix; identify the multipath effect of the light intensity change time difference matrix and suppress the path effect to obtain multipath effect suppression data; construct the node relative position matrix according to the multipath effect suppression data to obtain the node relative position matrix; In an embodiment of the present invention, each lamp broadcasts its own light intensity feature vector through visible light communication, and receives broadcasts from other lamps, and selects feature vectors whose Euclidean distance to its own feature vector is less than a threshold, and regards the sending lamp as a potential neighbor node. Calculate the cross-correlation function of the light intensity change between itself and each potential neighbor node, find the time delay corresponding to the maximum peak, and construct a light intensity change time difference matrix. According to the light intensity change time difference matrix, the initial distance between the nodes is estimated using the relationship between the speed of light and the time difference. Then, analyze the time difference matrix, identify potential multipath paths, separate multipath signals using a spatial filtering algorithm, extract line-of-sight path signals and suppress non-line-of-sight path signals, recalculate the light intensity change time difference between the nodes based on the line-of-sight path signals, and obtain the time difference matrix after multipath effect suppression. Finally, according to the initial distance matrix and the time difference matrix after multipath effect suppression, the initial relative position of the node is calculated using the three-sided positioning algorithm, and the node relative position matrix is ​​optimized by the least squares method.

[0032] Step S3: Establishing an initial connection relationship according to the node relative position matrix to obtain initial network connection relationship data; constructing a topological structure and optimizing the topological structure according to the initial network connection relationship data to obtain a network topology diagram; In an embodiment of the present invention, the node relative position matrix is ​​input into Python's Matplotlib library to visualize the node distribution, and the `Delaunay` function in the SciPy library is used for triangulation to obtain triangulation data. According to the triangulation data, the lamp nodes constituting the three vertices of each triangle are connected in pairs to generate initial network connection relationship data, and the minimum spanning tree is constructed using the NetworkX library. The minimum spanning tree is constrained according to the actual communication range of the lamp (for example, 5 meters), and the edges beyond the communication range are deleted to obtain the node network constraint data. Then, the NetworkX library is used to calculate the degree centrality and betweenness centrality of each node in the node network constraint data. According to the preset centrality threshold, nodes with excessive load are identified, and some connection relationships are transferred to neighboring nodes with lower load to achieve load balancing. Finally, based on the node network constraint data after load balancing, the NetworkX library is used to generate the final network topology diagram.

[0033] Step S4: Calculate the routing evaluation index according to the network topology diagram to obtain routing evaluation index data; use the pre-trained Q learning routing decision model and the routing evaluation index data to make Q learning routing decisions and perform dynamic routing updates to obtain a dynamic routing table; In an embodiment of the present invention, each lamp node maintains a neighbor node information table according to the network topology diagram. When data needs to be sent to a target node, the sending node first queries the neighbor node information table maintained by itself to find out whether the target node exists. If not, the query request is broadcast to the neighbor node until the relative position data of the target node is found. Then, the sending node selects the neighbor node closest to the target node as the greedy forwarding candidate node based on the relative position data of the target node. The sending node sends a link state information exchange request to the candidate node, and searches for multiple feasible paths using a multi-path routing algorithm based on the received link state information. Next, the sending node calculates the routing evaluation index of each path, such as path length, average delay, number of hops, etc. Using the pre-trained Q learning routing decision model, a routing decision is made based on the routing evaluation index data, and the path with the highest Q value is selected as the optimal path. Finally, the dynamic routing table of the sending node is updated according to the next hop node ID of the Q learning decision.

[0034] Step S5: Perform network status analysis according to the dynamic routing table to obtain network status analysis result data; perform node networking control processing according to the network status analysis result data to realize the lighting networking operation; In an embodiment of the present invention, a number of monitoring nodes are deployed in the lighting network, and each monitoring node collects network performance indicators every 1 second, including node connectivity, data transmission delay, and data packet loss rate. The monitoring node uploads the collected network performance indicator data to the central controller node according to the dynamic routing table. The central controller node constructs a parameter optimization model based on a genetic algorithm based on the network status analysis result data, and trains the model using the genetic algorithm to find the optimal model parameters. Then, the trained genetic algorithm parameter optimization model is used to predict the network performance indicators for a period of time in the future. According to the preset network performance indicator threshold and the predicted value of the network performance indicator, the fuzzy logic reasoning system is used to judge the current network status and output the corresponding network control instructions. Finally, the central controller node sends the network control instructions to the corresponding lighting nodes according to the dynamic routing table, and the nodes perform corresponding operations according to the instruction content to achieve real-time monitoring and optimization of the lighting network. Preferably, step S1 comprises the following steps: Step S11: collecting light intensity data through the light intensity sensor array of the lamp to obtain raw light intensity data; performing data preprocessing on the raw light intensity data to obtain preprocessed light intensity data; Step S12: Establishing an ambient light intensity baseline according to the pre-processed light intensity data to obtain an ambient light intensity baseline value; Step S13: extracting a light intensity variation sequence from the pre-processed light intensity data and the ambient light intensity baseline value to obtain a light intensity variation sequence; Step S14: performing light intensity variation pattern analysis on the light intensity variation sequence to obtain light intensity variation pattern data; Step S15: Generate a light intensity feature vector according to the light intensity variation pattern data to obtain a light intensity feature vector.

[0035] In the embodiment of the present invention, the light intensity sensor array on the lamp is sampled at a frequency of 100 Hz to obtain the light intensity data of the surrounding environment, and obtain a raw light intensity data sequence with a length of 1000. Since the light intensity data acquisition process is affected by factors such as random noise and ambient light fluctuations, the raw light intensity data needs to be preprocessed. First, the sliding window mean filtering method is used to smooth the raw light intensity data to remove high-frequency random noise. The sliding window size is set to 10, that is, the average value is calculated for every 10 consecutive sampling points to obtain a new data point, and finally a smoothed light intensity data sequence with a length of 991 is obtained. Then, in order to eliminate the influence of ambient light fluctuations, a baseline correction method based on polynomial fitting is used to process the smoothed light intensity data. A third-order polynomial is selected to fit the smoothed light intensity data sequence to obtain an ambient light intensity change trend curve, and the trend curve is subtracted from the smoothed light intensity data sequence to obtain a preprocessed light intensity data sequence with a length of 991, which effectively eliminates the influence of ambient light fluctuations. The preprocessed light intensity data obtained in step S11 is used to establish an ambient light intensity baseline. First, the preprocessed light intensity data sequence is divided into a time window for every 100 data points in chronological order, and a total of 10 time windows are obtained (the last time window contains 91 data points). Then, the average value of the preprocessed light intensity data in each time window is calculated to obtain 10 average values. Finally, these 10 average values ​​are used as the ambient light intensity baseline value. Each data point in the preprocessed light intensity data sequence obtained in step S11 is subtracted from the ambient light intensity baseline value obtained in step S12 to obtain a light intensity variation sequence with a length of 991. This sequence reflects the variation relative to the ambient light intensity baseline at each sampling moment, eliminates the influence of the ambient light intensity change, and highlights the light intensity change information of the lamp itself. The light intensity variation sequence obtained in step S13 is analyzed for the light intensity variation pattern. First, the short-time Fourier transform (STFT) is used to perform time-frequency analysis on the light intensity variation sequence to obtain the law of energy distribution of the light intensity variation sequence at different frequencies over time. The window size of STFT is set to 20 and the step size is set to 10. Then, the frequency characteristics and time characteristics of the light intensity variation sequence are extracted according to the STFT results. The frequency characteristics include: main frequency, bandwidth, frequency center, etc.; the time characteristics include: rise time, fall time, duration, etc. Finally, according to the extracted frequency characteristics and time characteristics, combined with the pre-set light intensity variation pattern library, the light intensity variation sequence is pattern matched to identify the light intensity variation pattern data, such as: flickering, gradual change, periodic change, etc. According to the light intensity variation pattern data obtained in step S14, the light intensity feature vector is constructed.For example, the frequency features and time features in the light intensity change pattern data are quantified into values ​​between 0 and 1, respectively, to construct a light intensity feature vector with a length of 10. Among them, the first 5 elements represent the frequency features, and the last 5 elements represent the time features. The value of each element represents the strength of the corresponding feature, and the larger the value, the more significant the feature. Ultimately, each lamp will have a unique light intensity feature vector for subsequent node identification and positioning.

[0036] Preferably, step S2 comprises the following steps: Step S21: broadcasting the light intensity feature vector through the lamp and receiving the feature vector to obtain the node light intensity feature vector; Step S22: screening potential neighboring nodes for the node light intensity feature vector to obtain potential neighboring nodes; calculating the light intensity change time difference for the potential neighboring nodes to obtain a light intensity change time difference matrix; Step S23: Estimating the initial distance of the node according to the light intensity change time difference matrix to obtain the initial distance value of the node; Step S24: performing multipath effect identification and path effect suppression on the light intensity variation time difference matrix to obtain multipath effect suppression data; Step S25: performing initial relative position calculation according to the node initial distance value and multipath effect suppression data to obtain node relative position data; Step S26: performing least square optimization on the node relative position data to obtain node relative position optimization data; constructing a node relative position matrix based on the node relative position optimization data to obtain a node relative position matrix.

[0037] In the embodiment of the present invention, each lamp broadcasts its own light intensity feature vector to the surrounding environment by visible light communication at intervals of 1 second. At the same time, each lamp also receives the light intensity feature vector broadcasted by other lamps. Each lamp maintains a list of received light intensity feature vectors, recording the received feature vectors, the ID of the sending lamp, and the receiving timestamp. Each lamp screens out feature vectors whose Euclidean distance to its own feature vector is less than a threshold of 0.5 according to the list of received light intensity feature vectors, and regards the lamps that send these feature vectors as potential neighboring nodes. Then, the light intensity change time difference between itself and each potential neighboring node is calculated. Specifically, the light intensity change data collected at the same time between itself and each potential neighboring node is selected, the cross-correlation function of the two sets of data is calculated, and the time delay corresponding to the maximum peak of the cross-correlation function is found as the light intensity change time difference between the two nodes. Finally, the light intensity change time difference between all potential neighboring nodes is constructed into a matrix, namely, the light intensity change time difference matrix. According to the light intensity change time difference matrix, the initial distance between the nodes is estimated by using the relationship between the speed of light and the time difference. Assuming the speed of light is c, the time difference of light intensity change between node i and node j is , then the initial distance between node i and node j is It can be estimated as: . The initial distances between all nodes are constructed into a matrix, namely the node initial distance matrix. The light intensity change time difference matrix obtained in step S22 is used to identify and suppress multipath effects. First, the time difference matrix is ​​analyzed to identify node pairs that may have multipath effects. If there are multiple propagation paths between two nodes, the values ​​of their corresponding elements in the time difference matrix will be significantly larger than other elements. Then, the multipath signals are separated by a spatial filtering algorithm, the line-of-sight path signals are extracted, and the non-line-of-sight path signals are suppressed. Finally, the light intensity change time difference between the nodes is recalculated based on the line-of-sight path signals to obtain the time difference matrix after multipath effect suppression. According to the node initial distance matrix obtained in step S23 and the time difference matrix after multipath effect suppression obtained in step S24, the initial relative position of the node is calculated using the three-sided positioning algorithm. Three nodes that are close and not collinear are selected as reference nodes. According to the distance and time difference information between them, a set of three-variable quadratic equations is established to solve the coordinates of the target node. The initial relative position data of the nodes obtained in step S25 are optimized by the least square method to obtain a more accurate relative position of the nodes. An error function with node coordinates as variables is constructed to represent the difference between the observed and calculated distances between all nodes. The error function is optimized by the least square method to find the node coordinates that minimize the error function, which is the relative position optimization data of the nodes. Finally, a node relative position matrix is ​​constructed based on the node relative position optimization data, and each element in the matrix represents the relative distance between the corresponding two nodes.

[0038] Preferably, calculating the time difference of light intensity change of potential neighboring nodes includes the following steps: Calculate the light intensity change rate of potential neighboring nodes to obtain a light intensity change rate sequence; The cross-correlation function is calculated according to the light intensity change rate sequence to obtain the cross-correlation function; Perform a maximum peak search on the cross-correlation function to obtain the maximum peak; The time difference matrix is ​​constructed according to the maximum peak value to obtain the light intensity change time difference matrix.

[0039] In the embodiment of the present invention, for each potential neighboring node, the light intensity data sequence after preprocessing is used to calculate the light intensity change rate sequence. Specifically, the light intensity data of two adjacent sampling moments are subtracted by the first-order difference method to obtain the light intensity change rate at each sampling moment. For example, for the light intensity data sequence after preprocessing , the light intensity change rate series ,in .

[0040] Get the light intensity change rate sequence of the lamp itself and each potential neighbor node respectively. Take two sets of light intensity change rate sequences of the same length as an example, assuming that the light intensity change rate sequence of the lamp itself is , the light intensity change rate sequence of the potential neighboring nodes is The correlation between two sets of sequences is calculated using the cross-correlation function to obtain the cross-correlation function sequence ,in Represents the correlation coefficient between the R1 sequence and the R2 sequence after the delay of k sampling points. In the calculated cross-correlation function sequence C, search for the maximum peak and its corresponding time delay. The time delay corresponding to the maximum peak reflects the time difference between the light intensity changes of the two nodes. The light intensity change time difference between the lamp and all potential neighboring nodes is constructed into a matrix, namely the light intensity change time difference matrix. The rows and columns of the matrix represent different lamp nodes, and each element in the matrix represents the light intensity change time difference between the corresponding two nodes. For example, the matrix element (i, j) represents the light intensity change time difference between node i and node j.

[0041] Preferably, step S24 comprises the following steps: Step S241: performing multipath signal feature analysis on the light intensity variation time difference matrix to obtain multipath signal features; Step S242: performing signal source time difference azimuth estimation according to the multipath signal characteristics to obtain signal source azimuth data; performing signal arrival angle estimation according to the multipath signal characteristics to obtain signal arrival angle data; Step S243: performing multipath signal separation according to the signal arrival angle data and the signal source azimuth data to obtain a multipath signal set; Step S244: performing line-of-sight path identification on the multipath signal set and performing line-of-sight path signal classification according to the multipath signal characteristics to obtain line-of-sight path signals and non-line-of-sight path signals; Step S245: performing non-line-of-sight path suppression on the non-line-of-sight path signal to obtain non-line-of-sight path suppression data; performing line-of-sight path distance estimation according to the line-of-sight path signal to obtain line-of-sight path distance data; Step S246: performing multipath effect suppression on the line-of-sight path distance data according to the non-line-of-sight path suppression data to obtain multipath effect suppression data.

[0042] In an embodiment of the present invention, the time difference matrix of light intensity change is analyzed to extract multipath signal characteristics. First, the standard deviation of each element in the time difference matrix is ​​calculated as an indicator to measure the stability of the path. The larger the standard deviation, the more seriously the path is affected by the multipath effect. Then, according to a preset threshold, the path with a standard deviation greater than the threshold is identified as a potential multipath path. For these potential multipath paths, the change law of their time difference is further analyzed, for example, whether there are periodic fluctuations, mutations, etc., and the correlation between these changes and environmental factors (such as people walking, objects moving, etc.). These analysis results are used as multipath signal characteristics for subsequent multipath effect suppression. According to the multipath signal characteristics, the time difference azimuth and signal arrival angle of the signal source are estimated. Taking node A and node B as an example, it is assumed that node A receives a signal from node B with a multipath effect. First, the number of multipaths is determined according to the standard deviation of the corresponding elements of the AB path in the time difference matrix. Assuming that there are two multipaths, the MUSIC algorithm can be used to estimate the time difference azimuth of the signal source of the two paths to obtain two azimuths. and At the same time, according to the time difference between the two paths and the geometric size of node A, the time difference of arrival (TDOA) technology is used to estimate the signal arrival angle, and two arrival angles are obtained. and According to the signal arrival angle data and signal source azimuth data, the multipath signal is separated by beamforming technology to obtain a multipath signal set. Taking node A as the center, according to the estimated arrival angle and , construct two beams pointing in different directions. Then, the received signal is passed through the two beams respectively to obtain two separated signals, which are two multipath signals from node B. According to the multipath signal characteristics, the multipath signal set is identified and classified by line-of-sight path. For example, it can be judged according to the signal strength, signal-to-noise ratio, time difference stability and other characteristics. Under normal circumstances, the line-of-sight path signal strength is higher, the signal-to-noise ratio is larger, and the time difference is more stable. According to these characteristics, the multipath signal set can be divided into line-of-sight path signals and non-line-of-sight path signals. The non-line-of-sight path signal is suppressed, for example, adaptive equalization technology, blind source separation technology, etc. can be used. At the same time, according to the line-of-sight path signal, the line-of-sight path distance is calculated using the distance estimation method in step S23. According to the result after the non-line-of-sight path is suppressed, the line-of-sight path distance data is subjected to multipath effect suppression. For example, the suppressed non-line-of-sight path signal can be used as noise, and the line-of-sight path distance data can be filtered using algorithms such as Kalman filtering to further reduce the impact of the multipath effect and obtain a more accurate distance estimate, that is, multipath effect suppression data.

[0043] Preferably, step S3 comprises the following steps: Step S31: Visualize the node relative position matrix to obtain a node distribution map; triangulate the node distribution map to obtain triangulation data; Step S32: establishing an initial connection relationship based on the triangulation data to obtain initial network connection relationship data; constructing a minimum spanning tree based on the initial network connection relationship data to obtain minimum spanning tree data; Step S33: Acquire actual communication range data of the lamp; constrain the minimum spanning tree data for communication range according to the actual communication range data of the lamp to obtain node network constraint data; Step S34: performing node degree centrality calculation on the node network constraint data to obtain node degree centrality data; performing node betweenness centrality calculation on the node network constraint data to obtain node betweenness centrality data; Step S35: performing load balancing adjustment according to the node degree centrality data and the node betweenness centrality data to obtain load balancing adjustment data; Step S36: Optimize the topology structure of the node network constraint data according to the load balancing adjustment data and generate a network topology map to obtain a network topology map.

[0044] As an example of the present invention, refer to Figure 2 As shown, in this example, step S3 includes: Step S31: Visualize the node relative position matrix to obtain a node distribution map; triangulate the node distribution map to obtain triangulation data; In an embodiment of the present invention, the node relative position matrix obtained in step S26 is input into the Matplotlib library of Python. The `scatter()` function of the library is used to draw a two-dimensional scatter plot, and the horizontal and vertical coordinates of each scatter point correspond to the X-axis and Y-axis coordinate values ​​of the corresponding node in the node relative position matrix, so as to visualize the node distribution and obtain a node distribution map. Subsequently, the `Delaunay` function in the SciPy library is called to triangulate the node distribution map. The triangle object returned by the `Delaunay` function is converted into a list containing triangle vertex indices and stored as triangulation data.

[0045] Step S32: establishing an initial connection relationship based on the triangulation data to obtain initial network connection relationship data; constructing a minimum spanning tree based on the initial network connection relationship data to obtain minimum spanning tree data; In an embodiment of the present invention, according to the triangulation data obtained in step S31, the triangle vertex index list is traversed. For each triangle, the lamp nodes constituting its three vertices are connected in pairs to generate initial network connection relationship data. These connection relationships are stored in the form of an adjacency matrix composed of 0 and 1, and the rows and columns of the matrix represent different nodes. 1 represents that there is a connection between two nodes, and 0 represents the opposite. Subsequently, based on the constructed adjacency matrix, the `minimum_spanning_tree()` function in the NetworkX library is used to select the Prim algorithm to construct a minimum spanning tree. The minimum spanning tree is stored in a NetworkX graph data structure, which contains all nodes and the shortest path information connecting these nodes.

[0046] Step S33: Acquire actual communication range data of the lamp; constrain the minimum spanning tree data for communication range according to the actual communication range data of the lamp to obtain node network constraint data; In the embodiment of the present invention, it is assumed that the maximum communication distance of the lamp is 5 meters according to the specification of the communication chip of the lamp and the actual test results. The minimum spanning tree data structure generated in step S32 is traversed, and the length of each edge (i.e., the Euclidean distance between the two end nodes) is calculated using the `networkx.shortest_path_length()` function. If the length of the edge exceeds 5 meters, the edge is deleted from the minimum spanning tree data structure, and finally the node network constraint data that meets the communication distance constraint is obtained, and the data is still stored in the NetworkX graph data structure.

[0047] Step S34: performing node degree centrality calculation on the node network constraint data to obtain node degree centrality data; performing node betweenness centrality calculation on the node network constraint data to obtain node betweenness centrality data; In an embodiment of the present invention, based on the node network constraint data obtained in step S33, the degree centrality of each node, that is, the number of nodes directly connected to the node, is calculated using the `degree_centrality()` function provided by the NetworkX library, and the result is stored in a dictionary, with the key being the node index and the value being the corresponding degree centrality. Next, the betweenness centrality of each node is calculated using the `betweenness_centrality()` function provided by the NetworkX library. This function calculates the number of times each node is passed in the shortest path between all pairs of nodes in the network, and stores the result in a dictionary, with the key being the node index and the value being the corresponding betweenness centrality.

[0048] Step S35: performing load balancing adjustment according to the node degree centrality data and the node betweenness centrality data to obtain load balancing adjustment data; In an embodiment of the present invention, the degree centrality and betweenness centrality thresholds are set, for example, 0.8 and 0.6 respectively. The two centrality dictionaries calculated in step S34 are traversed. If both the degree centrality and betweenness centrality of a node exceed the set thresholds, the node is considered to be overloaded. For nodes with overload, nodes with relatively low loads among their neighboring nodes are identified, and some connection relationships are transferred to these nodes to achieve load balancing. The adjusted connection relationship is updated to the node network constraint data.

[0049] Step S36: Optimizing the topology structure of the node network constraint data according to the load balancing adjustment data and generating a network topology map to obtain a network topology map; In the embodiment of the present invention, according to the node network constraint data after load balancing adjustment in step S35, the drawing function of the NetworkX library, such as the `draw()` function, is called again to generate the final network topology diagram. In the topology diagram, different visual elements such as different colors and line thicknesses can be used to distinguish information such as node loads and connection strengths.

[0050] Preferably, step S4 comprises the following steps: Step S41: maintaining neighbor node information according to the network topology map to obtain a neighbor node information table; calculating the relative position of the target node according to the neighbor node information table to obtain the relative position data of the target node; Step S42: performing greedy forwarding candidate node selection according to the target node relative position data and the neighbor node information table to obtain the greedy forwarding candidate node; Step S43: exchange link state information according to the greedy forwarding candidate nodes to obtain link state information; perform multi-path routing search according to the link state information to obtain multi-path routing data; Step S44: calculating the routing evaluation index for the multi-path routing data to obtain routing evaluation index data; Step S45: using the pre-trained Q learning routing decision model and routing evaluation index data to perform Q learning routing decision, and obtain Q learning routing decision data; Step S46: Perform dynamic routing update according to the Q-learning routing decision data and the multi-path routing data to obtain a dynamic routing table.

[0051] As an example of the present invention, refer to Figure 3 As shown, in this example, step S4 includes: Preferably, step S4 comprises the following steps: Step S41: maintaining neighbor node information according to the network topology map to obtain a neighbor node information table; calculating the relative position of the target node according to the neighbor node information table to obtain the relative position data of the target node; In the embodiment of the present invention, each lamp node maintains a neighbor node information table according to the network topology diagram generated in step S36. The table is stored in the form of a dictionary, and the key-value pairs are the neighbor node ID and the relative position coordinates of the neighbor node. When it is necessary to send data to the target node, the sending node first queries the neighbor node information table maintained by itself to find out whether the target node exists. If it exists, the relative position data of the target node is directly obtained. If it does not exist, the sending node broadcasts a query request to all its neighbor nodes, and the request includes the target node ID. The neighbor node that receives the request also queries the information table maintained by itself, and passes the query results step by step until the relative position data of the target node is found.

[0052] Step S42: performing greedy forwarding candidate node selection according to the target node relative position data and the neighbor node information table to obtain the greedy forwarding candidate node; In the embodiment of the present invention, the sending node performs greedy forwarding candidate node selection based on the relative position data of the target node obtained in step S41 and the neighbor node information table maintained by itself. Specifically, the sending node calculates the Euclidean distance between each neighbor node and the target node. The neighbor node closest to the target node is selected as the greedy forwarding candidate node. If there are multiple neighbor nodes with the same distance, one of them is randomly selected as the candidate node.

[0053] Step S43: exchange link state information according to the greedy forwarding candidate nodes to obtain link state information; perform multi-path routing search according to the link state information to obtain multi-path routing data; In the embodiment of the present invention, the sending node sends a link state information exchange request to the greedy forwarding candidate node selected in step S42. The request contains information such as the sending node ID, the candidate node ID, and the target node ID. After receiving the request, the candidate node returns the link state information from itself to the target node, including the number of nodes on the path, the average packet loss rate, the average delay, etc. The sending node searches for multiple feasible paths from the sending node to the target node based on the received link state information using a multipath routing algorithm such as the Dijkstra algorithm or the A* algorithm, and stores the node sequence of each path as multipath routing data.

[0054] Step S44: calculating the routing evaluation index for the multi-path routing data to obtain routing evaluation index data; In the embodiment of the present invention, the sending node calculates the routing evaluation index of each path, such as path length, average delay, number of hops, etc., according to the multipath routing data obtained in step S43. The path length is defined as the sum of the distances between all adjacent nodes on the path. The average delay is calculated based on the average delay of each link in the link state information. The number of hops is defined as the number of nodes on the path. The routing evaluation index of each path is stored in a list, and each element corresponds to the index value of a path.

[0055] Step S45: using the pre-trained Q learning routing decision model and routing evaluation index data to perform Q learning routing decision, and obtain Q learning routing decision data; In the embodiment of the present invention, a pre-trained Q learning routing decision model is used to make routing decisions based on the routing evaluation index data calculated in step S44. The routing evaluation index data is input into the Q learning model, and the model outputs the Q value of each candidate path based on the current network status and historical experience. The path with the highest Q value is selected as the optimal path, and the routing decision data (e.g., the next hop node ID) corresponding to the path is stored.

[0056] Step S46: Perform dynamic routing update according to the Q learning routing decision data and the multi-path routing data to obtain a dynamic routing table; In the embodiment of the present invention, the dynamic routing table of the sending node is updated according to the Q learning routing decision data obtained in step S45. The routing table is stored in the form of a dictionary, and the key-value pairs are the target node ID and the next hop node ID. The routing table items corresponding to the next hop node ID and the target node ID of the Q learning decision are updated to realize dynamic routing update.

[0057] Preferably, the construction of the pre-trained Q-learning routing decision model includes the following steps: The light intensity change prediction analysis is performed through the light intensity sensor array of the lamp to obtain the light intensity change prediction data; Path lighting nodes are predicted based on light intensity change prediction data to obtain path lighting nodes; Perform Q learning state space expansion on the path lamp nodes to obtain Q learning state space expansion data; perform path link quality evaluation on the path lamp nodes to obtain path link quality data; Design the Q learning reward function according to the Q learning state space expansion data and the path link quality data to obtain the Q learning reward function; The Q learning model is trained and optimized according to the Q learning reward function and the light intensity change prediction data to obtain the Q learning routing decision model.

[0058] In an embodiment of the present invention, a time series model is constructed using historical light intensity data collected by a light intensity sensor array of a lamp. For example, an ARIMA model is used to train historical light intensity data to learn the periodicity, trend and other laws of light intensity changes. The trained ARIMA model is used to predict the light intensity change trend in the future period to obtain light intensity change prediction data, including the light intensity prediction value and prediction confidence interval at each sampling moment. According to the network topology map generated in step S36 and the light intensity change prediction data, the lamp nodes that may be located on the data transmission path in the future period are predicted. For example, according to the network topology map, the shortest path between all node pairs is calculated, and the nodes passed by each path are recorded. Combined with the light intensity change prediction data, it is analyzed whether each node is in an active state in the future period (for example, a drastic change in light intensity indicates that the node may be controlled by the user). All nodes in the shortest path that are in an active state are regarded as path lamp nodes. According to the path lamp nodes, the state space of Q learning is expanded, and each path lamp node is regarded as a state in the Q learning state space. For example, assuming that there are three path lamp nodes on a path, these three nodes are represented as state 1, state 2 and state 3 respectively, forming a Q learning state space containing three states. According to the historical network performance data, the quality of the links between the path lamp nodes is evaluated. For example, the average delay, average packet loss rate and other indicators of each link are counted, and the link quality is divided into multiple levels according to the preset threshold, such as excellent, good, medium and poor. The quality level of each link is used as one of the input features of Q learning. According to the evaluation results of the path link quality, the reward function of Q learning is designed. For example, for high-quality links, a higher positive reward is given; for low-quality links, a lower positive reward or negative penalty is given. At the same time, the reward function is adjusted considering factors such as path length and number of hops. For example, the shorter the path and the fewer the hops, the more additional positive rewards are given. The network topology generated in step S36, the light intensity change prediction data, the path link quality evaluation results and the designed reward function are used to train and optimize the Q learning model. For example, the Q-learning algorithm is used to simulate the process of data transmission in the network, and the Q table is continuously updated according to the reward function until the Q table converges. The trained Q learning model is used as a pre-trained Q learning routing decision model for the routing decision in step S4.

[0059] Preferably, step S5 comprises the following steps: Step S51: Real-time collection of network performance indicators is performed through monitoring nodes deployed in the network to obtain network performance indicator data; Step S52: Gather network performance indicator data to the central controller node according to the dynamic routing table, perform network status analysis, and obtain network status analysis result data; Step S53: constructing a genetic algorithm parameter optimization model according to the network status analysis result data to obtain a genetic algorithm parameter optimization model; outputting a network performance index prediction value using the genetic algorithm parameter optimization model to obtain a network performance index prediction value; Step S54: Perform fuzzy logic reasoning and output network control instructions according to the network performance index prediction value and the network performance index data to obtain network control instructions; Step S55: the central controller node issues the network control instruction according to the dynamic routing table to obtain the node network control instruction; and executes the node instruction according to the node network control instruction to realize the lighting networking operation.

[0060] In the embodiment of the present invention, several monitoring nodes are deployed in the lighting network. For example, nodes with higher degree centrality in the network are selected as monitoring nodes. Each monitoring node collects network performance indicators every 1 second, including: Node connectivity: Detect the connection status with neighboring nodes by sending heartbeat packets, and record information such as connection success rate and disconnection times.

[0061] Data transmission delay: Send test data packets to specific neighbor nodes, record the time difference between sending and receiving the data packets, and calculate indicators such as average delay and maximum delay.

[0062] Packet loss rate: counts the number of packets sent and received, and calculates the proportion of packet loss.

[0063] The monitoring node uploads the collected network performance index data to the central controller node through multi-hop relay according to the routing table dynamically updated in step S46. After receiving the data from all monitoring nodes, the central controller node performs data cleaning and integration to obtain the network performance index data of the entire network. The central controller node constructs a parameter optimization model based on a genetic algorithm based on the network status analysis result data. The objective function of the model is defined as the difference between the network performance index and the preset target value, for example, minimizing the average delay and data packet loss rate. The optimization parameters of the model include parameters such as the learning rate, discount factor, and exploration rate in the Q learning model. The model is trained using a genetic algorithm to find the optimal model parameters so that the network performance index reaches the preset target. The central controller node uses the genetic algorithm parameter optimization model obtained by training in step S53 to predict the network performance index in the future period of time and obtain the predicted value of the network performance index. According to the preset network performance index threshold, such as the maximum acceptable delay, the maximum acceptable packet loss rate, etc., combined with the predicted value of the network performance index, the fuzzy logic reasoning system is used to judge the current network state and output the corresponding network control instruction. For example, if it is predicted that the network is about to be congested, an instruction to reduce the data transmission rate is output. The central controller node sends the network control instruction generated in step S54 to the corresponding lamp node according to the routing table dynamically updated in step S46. After receiving the control instruction, the lamp node performs the corresponding operation according to the content of the instruction. For example, after receiving the instruction to reduce the data transmission rate, the node will adjust the parameters of the communication module to reduce the data transmission rate. In this way, the central controller node can dynamically adjust the network parameters according to the predicted results of the network status, realize real-time monitoring and optimization of the lamp networking, and ensure the stability and efficiency of the network.

[0064] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0065] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A lamp networking method, characterized in that: The following steps are involved: Step S1: sensing light intensity through the lamp and extracting a light intensity variation sequence to obtain a light intensity variation sequence; generating a light intensity feature vector according to the light intensity variation sequence to obtain a light intensity feature vector; Step S2: Calculate the light intensity change time difference according to the light intensity feature vector to obtain the light intensity change time difference matrix; identify the multipath effect of the light intensity change time difference matrix and suppress the path effect to obtain multipath effect suppression data; construct the node relative position matrix according to the multipath effect suppression data to obtain the node relative position matrix; Step S3: Establishing an initial connection relationship according to the node relative position matrix to obtain initial network connection relationship data; constructing a topological structure and optimizing the topological structure according to the initial network connection relationship data to obtain a network topology diagram; Step S4: Calculate the routing evaluation index according to the network topology diagram to obtain routing evaluation index data; use the pre-trained Q learning routing decision model and the routing evaluation index data to make Q learning routing decisions and perform dynamic routing updates to obtain a dynamic routing table; Step S5: Perform network status analysis according to the dynamic routing table to obtain network status analysis result data; perform node networking control processing according to the network status analysis result data to realize the lighting networking operation.

2. The lamp networking method according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: collecting light intensity data through the light intensity sensor array of the lamp to obtain raw light intensity data; performing data preprocessing on the raw light intensity data to obtain preprocessed light intensity data; Step S12: Establishing an ambient light intensity baseline according to the pre-processed light intensity data to obtain an ambient light intensity baseline value; Step S13: extracting a light intensity variation sequence from the pre-processed light intensity data and the ambient light intensity baseline value to obtain a light intensity variation sequence; Step S14: performing light intensity variation pattern analysis on the light intensity variation sequence to obtain light intensity variation pattern data; Step S15: Generate a light intensity feature vector according to the light intensity variation pattern data to obtain a light intensity feature vector.

3. The lamp networking method according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: broadcasting the light intensity feature vector through the lamp and receiving the feature vector to obtain the node light intensity feature vector; Step S22: screening potential neighboring nodes for the node light intensity feature vector to obtain potential neighboring nodes; calculating the light intensity change time difference for the potential neighboring nodes to obtain a light intensity change time difference matrix; Step S23: Estimating the initial distance of the node according to the light intensity change time difference matrix to obtain the initial distance value of the node; Step S24: performing multipath effect identification and path effect suppression on the light intensity variation time difference matrix to obtain multipath effect suppression data; Step S25: performing initial relative position calculation according to the node initial distance value and multipath effect suppression data to obtain node relative position data; Step S26: performing least square optimization on the node relative position data to obtain node relative position optimization data; constructing a node relative position matrix based on the node relative position optimization data to obtain a node relative position matrix.

4. The lamp networking method according to claim 3, characterized in that: The calculation of the time difference of light intensity change for potential neighboring nodes includes the following steps: Calculate the light intensity change rate of potential neighboring nodes to obtain a light intensity change rate sequence; The cross-correlation function is calculated according to the light intensity change rate sequence to obtain the cross-correlation function; Perform a maximum peak search on the cross-correlation function to obtain the maximum peak; The time difference matrix is ​​constructed according to the maximum peak value to obtain the light intensity change time difference matrix.

5. The lamp networking method according to claim 3, characterized in that: Step S24 includes the following steps: Step S241: performing multipath signal feature analysis on the light intensity variation time difference matrix to obtain multipath signal features; Step S242: performing signal source time difference azimuth estimation according to the multipath signal characteristics to obtain signal source azimuth data; performing signal arrival angle estimation according to the multipath signal characteristics to obtain signal arrival angle data; Step S243: performing multipath signal separation according to the signal arrival angle data and the signal source azimuth data to obtain a multipath signal set; Step S244: performing line-of-sight path identification on the multipath signal set and classifying the line-of-sight path signals according to the multipath signal characteristics to obtain line-of-sight path signals and non-line-of-sight path signals; Step S245: performing non-line-of-sight path suppression on the non-line-of-sight path signal to obtain non-line-of-sight path suppression data; performing line-of-sight path distance estimation according to the line-of-sight path signal to obtain line-of-sight path distance data; Step S246: performing multipath effect suppression on the line-of-sight path distance data according to the non-line-of-sight path suppression data to obtain multipath effect suppression data.

6. The lamp networking method according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: Visualize the node relative position matrix to obtain a node distribution map; triangulate the node distribution map to obtain triangulation data; Step S32: establishing an initial connection relationship based on the triangulation data to obtain initial network connection relationship data; constructing a minimum spanning tree based on the initial network connection relationship data to obtain minimum spanning tree data; Step S33: Acquire actual communication range data of the lamp; constrain the minimum spanning tree data for communication range according to the actual communication range data of the lamp to obtain node network constraint data; Step S34: performing node degree centrality calculation on the node network constraint data to obtain node degree centrality data; performing node betweenness centrality calculation on the node network constraint data to obtain node betweenness centrality data; Step S35: performing load balancing adjustment according to the node degree centrality data and the node betweenness centrality data to obtain load balancing adjustment data; Step S36: Optimize the topology structure of the node network constraint data according to the load balancing adjustment data and generate a network topology map to obtain a network topology map.

7. The lamp networking method according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: maintaining neighbor node information according to the network topology map to obtain a neighbor node information table; calculating the relative position of the target node according to the neighbor node information table to obtain the relative position data of the target node; Step S42: performing greedy forwarding candidate node selection according to the target node relative position data and the neighbor node information table to obtain the greedy forwarding candidate node; Step S43: exchange link state information according to the greedy forwarding candidate nodes to obtain link state information; perform multi-path routing search according to the link state information to obtain multi-path routing data; Step S44: calculating the routing evaluation index for the multi-path routing data to obtain routing evaluation index data; Step S45: using the pre-trained Q learning routing decision model and routing evaluation index data to perform Q learning routing decision, and obtain Q learning routing decision data; Step S46: Perform dynamic routing update according to the Q-learning routing decision data and the multi-path routing data to obtain a dynamic routing table.

8. The lamp networking method according to claim 7, characterized in that: The construction of the pre-trained Q-learning routing decision model includes the following steps: The light intensity change prediction analysis is performed through the light intensity sensor array of the lamp to obtain the light intensity change prediction data; Path lighting nodes are predicted based on light intensity change prediction data to obtain path lighting nodes; Perform Q learning state space expansion on the path lamp nodes to obtain Q learning state space expansion data; perform path link quality evaluation on the path lamp nodes to obtain path link quality data; Design the Q learning reward function according to the Q learning state space expansion data and the path link quality data to obtain the Q learning reward function; The Q learning model is trained and optimized according to the Q learning reward function and the light intensity change prediction data to obtain the Q learning routing decision model.

9. The lamp networking method according to claim 1, characterized in that: Step S5 includes the following steps: Step S51: Real-time collection of network performance indicators is performed through monitoring nodes deployed in the network to obtain network performance indicator data; Step S52: Gathering network performance indicator data to the central controller node according to the dynamic routing table, performing network status analysis, and obtaining network status analysis result data; Step S53: constructing a genetic algorithm parameter optimization model according to the network status analysis result data to obtain a genetic algorithm parameter optimization model; outputting a network performance index prediction value using the genetic algorithm parameter optimization model to obtain a network performance index prediction value; Step S54: Perform fuzzy logic reasoning and output network control instructions according to the network performance index prediction value and the network performance index data to obtain network control instructions; Step S55: the central controller node issues the network control instruction according to the dynamic routing table to obtain the node network control instruction; and executes the node instruction according to the node network control instruction to realize the lighting networking operation.

Citation Information

Patent Citations

  • Ad hoc network method and ad hoc network system

    WO2023029815A1

  • Illumination assembly communication

    WO2023031446A1

  • Automatic networking method for intelligent lighting system

    WO2023279708A1

  • Control plane policy verification method based on GNN failure model learning

    WO2024192782A1