Mesh-based networking energy-saving lamp adjacent relationship self-discovery and control method and device
Through the self-discovery and control method of energy-saving lamps based on Mesh networking, the adjacent relationship is automatically detected and the lighting control is realized, which solves the high cost debugging problem of networked energy-saving lamps in underground parking lots and improves energy-saving effects and user experience.
Patent Information
- Application Number
- CN202411016365.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-27
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-07-27
AI Technical Summary
In underground parking lots, existing networkable energy-saving lamps require a lot of manpower to debug after installation to achieve linkage control, resulting in high implementation costs and poor results, making them difficult to promote and use.
A self-discovery and control method for neighbor relationships of energy-saving lamps based on Mesh networking is adopted. Through sensing events and Bluetooth Mesh networking communication, neighbor relationships are automatically detected and lighting control is achieved, reducing the need for manual debugging.
It realizes automatic and accurate linkage control of energy-saving lamps in parking lots, reduces implementation costs, improves user perception, and facilitates promotion and use.
Smart Images

Figure CN119071979B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of self-organizing networks of lamps, and in particular to a method and device for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking. Background Art
[0002] Energy-saving lamps in underground parking lots generally rely on infrared or microwave sensing to detect whether there are people or vehicles around the lamps. When no one is around, the lights will automatically turn off or turn down the brightness. When someone is detected, the lights will automatically turn on or increase the brightness, thereby achieving the purpose of energy saving.
[0003] Currently, the common energy-saving lamps in underground parking lots are divided into two types: non-networkable induction energy-saving lamps and networkable induction energy-saving lamps. For the former non-networkable induction energy-saving lamps, it is impossible to achieve linkage control between energy-saving lamps, and the lamps can only be turned on when people and cars arrive. The energy-saving effect and user perception are average. For the second type of networkable induction energy-saving lamps, the energy-saving lamps have the function of mutual networking and communication, which can achieve linkage control between energy-saving lamps and light up the energy-saving lamp in front of the lane in advance. Compared with the first type of energy-saving lamps, they have better energy-saving effects and user perception.
[0004] However, in the relevant technologies, during the implementation and use of the project, networkable induction energy-saving lamps often face the problems of how to sort out the adjacent relationships of energy-saving lamps according to their actual installation locations and usage scenarios, design and plan the linkage relationships of energy-saving lamps to ensure the linkage effect, and arrange implementation personnel to configure and debug each energy-saving lamp according to the above design plans.
[0005] Therefore, even after installing networked induction energy-saving lamps, achieving a good linkage effect requires significant manpower investment to address the aforementioned issues. Otherwise, the performance of these lamps will be similar to that of non-linked control lamps. This demonstrates the difficulty and high investment required to achieve linkage effects with networked energy-saving lamps in related technologies, a significant pain point in promoting their widespread use. Summary of the Invention
[0006] In order to enable energy-saving lamps in parking lots to automatically achieve highly accurate linkage control without excessive debugging, thereby reducing implementation costs and improving user perception, facilitating the promotion and use of energy-saving lamps in underground parking lot scenarios, and promoting the energy-saving and low-carbon transformation of parking lots, the present application provides a method and device for self-discovery and control of adjacent relationships of energy-saving lamps based on Mesh networking, computer equipment and storage media.
[0007] In the first aspect, the above-mentioned invention object of the present application is achieved through the following technical solutions:
[0008] A method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking, the method comprising:
[0009] When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered. The first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the neighbor relationship of the energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps.
[0010] When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, lighting control is performed;
[0011] When entering the registration self-discovery interrupt processing flow, generating current sensing event occurrence information, recording the current sensing event occurrence information in a database corresponding to the current sensing event, having a first database corresponding to the first sensing event and a second database corresponding to the second sensing event;
[0012] querying a database corresponding to another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database;
[0013] According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the other sensing event meets the preset adjacent relationship condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0014] By adopting the above technical solution, the parking lot energy-saving lamp has the functions of sensing and networking communication based on Bluetooth Mesh, so that the parking lot energy-saving lamp can detect whether there are people or cars moving around the device, and form many-to-many connections and communications between multiple parking lot energy-saving lamps, thereby creating a self-organizing network that can be expanded to a large area and accommodate thousands of nodes. Therefore, the parking lot energy-saving lamp can sense the movement of people or cars and receive information indicating that other parking lot energy-saving lamps sense the movement of people or cars, that is, the first sensing event and the second sensing event. When the first sensing event or the second sensing event is triggered, it enters the corresponding registered self-discovery interrupt processing process, that is, the registered interrupt processing process corresponding to the first sensing event and the second sensing event is different. For example, when the current event is the first sensing event, the subsequent interrupt processing process is to determine whether there is a second sensing event. The first sensing event and the second sensing event are different. Only when both sensing events occur can it be determined whether the parking lot energy-saving lamps are adjacent. That is, only when the current parking lot energy-saving lamp senses the movement of a person or a car and receives information indicating that other parking lot energy-saving lamps sense the movement of a person or a car, the current parking lot energy-saving lamp and the parking lot energy-saving lamp that sends the information may be in an adjacent relationship. Therefore, it is necessary to record the current sensing event so that it can be further determined whether the conditions for the adjacent relationship are met based on the recorded data information. For example, the time point when the current parking lot energy-saving lamp senses the movement of a person or a car is close to the time point when the information indicating that other parking lot energy-saving lamps sense the movement of a person or a car is received; in addition, if the energy-saving lamp has found an adjacent energy-saving lamp, then in response to the third sensing event or in response to the event that the current parking lot energy-saving lamp senses the movement of a person or a car, it controls the light to turn on, and controls the adjacent energy-saving lamps to gradually reduce their brightness, thereby improving the energy-saving effect of the energy-saving lamp.
[0015] In a preferred example, the present application may be further configured as follows: the first sensing event is an event of sensing a human signal; the second sensing event is an event of receiving a human signal sent by another energy-saving lamp; and the third sensing event is an event of receiving a linkage control signal sent by another energy-saving lamp; and the determination of whether to synchronously enter the registration lighting interrupt processing flow specifically includes:
[0016] When responding to the first sensing event, it is determined that the registration and lighting interruption processing flow is synchronously entered; when responding to the second sensing event, it is determined that the registration and lighting interruption processing flow is asynchronously entered;
[0017] When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, the lighting control is performed, specifically including:
[0018] When it is determined that the registration lighting interrupt processing flow has been synchronously transferred, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and it is determined whether the current energy-saving lamp has found an adjacent energy-saving lamp. If so, first linkage level control information is generated and sent to the adjacent energy-saving lamp via unicast. If not, second linkage level control information is generated and sent via low-power multicast and non-relay mode.
[0019] When entering the registration lighting interrupt processing flow corresponding to the third sensing event, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and the linkage level control information sent by other energy-saving lamps is obtained to determine whether the current energy-saving lamp has found the adjacent energy-saving lamp. If so, it is determined whether the linkage level control information sent by the other energy-saving lamps meets the preset sending conditions. If so, the linkage level control information sent by the other energy-saving lamps is adjusted to generate the first linkage level control information, and the first linkage level control information is sent to the adjacent energy-saving lamp via unicast.
[0020] By adopting the above technical solution, the first sensing event is defined as the event in which the current parking lot energy-saving lamp senses a human presence signal, and the second sensing event is defined as the event in which the current parking lot energy-saving lamp receives a human presence signal sent by another energy-saving lamp. If the current sensing event is the first sensing event, i.e., the event in which the current parking lot energy-saving lamp senses a human presence signal, and the current energy-saving lamp has not yet found a neighboring energy-saving lamp, the second linkage level control information is broadcast. When the nearby parking lot energy-saving lamps receive this event information, they can light up even if they are not neighbors, thus achieving linkage control in the early stages of installation for energy-saving lamps where no neighbor relationship has been found. If the registration lighting interrupt processing flow corresponding to the third sensing event is entered, it indicates that the linkage level control information sent by other energy-saving lamps has been received. Therefore, based on the linkage level control information sent by the other energy-saving lamps, it is determined whether to send it to the neighboring energy-saving lamps via unicast. This achieves automatic communication and automatic discovery of neighbor relationships among all parking lot energy-saving lamps, allowing parking lot energy-saving lamps to automatically achieve highly accurate linkage control without excessive debugging, thereby reducing implementation costs and improving user experience. This facilitates the promotion and use of energy-saving lamps in underground parking lots and promotes the energy-saving and low-carbon transformation of parking lots.
[0021] In a preferred example, the present application may be further configured as follows: when entering the registration self-discovery interrupt processing process, generating current sensing event occurrence information, and recording the current sensing event occurrence information in a database corresponding to the current sensing event, specifically including:
[0022] When entering the registration self-discovery interrupt processing process, current sensing event occurrence information is generated according to the first sensing event or the second sensing event, and the current sensing event occurrence information is recorded in the database corresponding to the current sensing event. If the current sensing event is the first sensing event, the current sensing event occurrence information is sent via low-power multicast and non-relay mode, and the current sensing event occurrence information includes the energy-saving lamp network address and timestamp information.
[0023] By adopting the above technical solution, regardless of the first sensing event or the second sensing event, when the event triggers a response, the relevant information of the event that triggered the response is recorded, including the timestamp of the trigger response. The timestamp information enables the calculation of the time difference between the occurrences of different sensing events, which serves as an important basis for determining whether the energy-saving lamps in the parking lot have a neighboring relationship. The network address of the energy-saving lamp is used to determine the specific reference of the energy-saving lamp in the parking lot that sends the event of sensing a person signal. Therefore, the information of the current sensing event is recorded in the database corresponding to the current sensing event, which is convenient for subsequent query of the database to determine the neighboring relationship of the energy-saving lamps in the parking lot.
[0024] In a preferred example, the present application may be further configured as follows: if the judgment is yes, adjusting the linkage level control information sent by the other energy-saving lamps to generate first linkage level control information, and sending the first linkage level control information and the current sensing event occurrence information to the adjacent energy-saving lamp via unicast, specifically including:
[0025] If the answer is yes, the order of adjacent energy-saving lamps found is obtained;
[0026] Based on a preset adjustment rule, decrementally adjust the linkage level control information sent by the other energy-saving lamps to generate at least one first linkage level control information;
[0027] Based on the order in which the adjacent energy-saving lamps have been found, the first linkage level control information and the current sensing event occurrence information are sequentially sent to the corresponding adjacent energy-saving lamps in a unicast manner.
[0028] By adopting the above technical solution, when it is determined that the linkage level control information sent by other energy-saving lamps meets the preset sending conditions, it means that the current energy-saving lamp has found the adjacent energy-saving lamp and the current energy-saving lamp is not ranked last in the adjacent relationship, because in the self-discovery process of the adjacent relationship of energy-saving lamps, each time it is determined that the adjacent energy-saving lamp is found, each adjacent energy-saving lamp will be ranked according to the time sequence when the adjacent energy-saving lamp is found. Because when people or cars walk in the underground parking lot, they will walk according to the guidance signs of the underground parking lot, that is to say, people or cars have a certain route when walking in the underground parking lot, and also have a certain order when passing different energy-saving lamps. Therefore, if there are adjacent energy-saving lamps before and after the energy-saving lamp, the person or car will pass by the adjacent energy-saving lamp in front first when walking in the underground parking lot, and the adjacent energy-saving lamp in front will also be identified as the adjacent energy-saving lamp first. Therefore, the first linkage level control information for adjusting the brightness of the adjacent energy-saving lamps that have been found is sent in the order in which the adjacent energy-saving lamps have been found, which can achieve the effect of decreasing the brightness of the energy-saving lamps from near to far, further improving the energy-saving effect of the energy-saving lamps.
[0029] In a preferred example, the present application may be further configured as follows: the querying of a database corresponding to another sensing event, and if it is determined that another sensing event exists, extracting adjacent judgment information from the first database and the second database, specifically including:
[0030] A database corresponding to another sensing event is queried. If it is determined that another sensing event occurs within a preset sensing period, adjacent judgment information is extracted from the first database and the second database. The adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, and the adjacent judgment information corresponding to the second database includes the sensing trigger information of other energy-saving lamps.
[0031] By adopting the above technical solution, after the parking lot energy-saving lamp responds to the first sensing event or the second sensing event, the database corresponding to the other sensing event is queried to determine whether there is another sensing event within the preset sensing period. For example, after the event of the current parking lot energy-saving lamp sensing the movement of a person or a car occurs, it is necessary to determine whether the event of receiving information indicating that other parking lot energy-saving lamps sensed the movement of a person or a car occurs, that is, the person or car passed by other parking lot energy-saving lamps that sent event information within the preset sensing period before passing by the current parking lot energy-saving lamp, and the preset sensing period is determined according to the average speed of the person or car when moving. Therefore, only when both events occur within the preset sensing period can the adjacent relationship of the parking lot energy-saving lamps be determined. Otherwise, if the time difference between the two events exceeds the preset sensing period, it means that the parking lot energy-saving lamps that sent the information indicating that other parking lot energy-saving lamps sensed the movement of a person or a car are not adjacent. Therefore, by querying the database of another sensing event within the preset sensing period, the accuracy of the adjacent relationship judgment is improved.
[0032] In a preferred example, the present application can be further configured as follows: when responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration light-on interrupt processing flow. When responding to the third sensing event, the corresponding registration light-on interrupt processing flow is entered, specifically including:
[0033] When responding to the first sensing event or the second sensing event, it enters the corresponding registered self-discovery interrupt processing flow, and determines whether to synchronously enter the registered light-on interrupt processing flow. When responding to the third sensing event, it enters the corresponding registered light-on interrupt processing flow. When responding to the fourth sensing event, it enters the corresponding registered clock interrupt processing flow. The fourth sensing event is the second interrupt event of the system clock. The registered clock interrupt processing flow is used to control the shutdown of the energy-saving lamp. When responding to the fourth sensing event, the light-off judgment information is obtained from the light-on database to determine whether the light-off judgment information meets the preset light-off condition. If the judgment is yes, the energy-saving lamp is controlled to be turned off.
[0034] By adopting the above technical solution, the fourth sensing event is a second interrupt event of the system clock, and the timing will start synchronously when the energy-saving lamp is turned on to judge the lighting time of the energy-saving lamp. When the energy-saving lamp does not sense the passing of people or vehicles within a certain period of time or does not receive the signal sent by other energy-saving lamps indicating that people or vehicles are sensed to pass, the fourth sensing event is triggered to achieve the automatic shutdown effect of the energy-saving lamp. Therefore, when responding to the fourth sensing event, the light-off judgment information is obtained from the lighting database, and the light-off judgment information is the lighting time of the energy-saving lamp. When the light-off judgment information meets the preset light-off condition, that is, when the lighting time of the energy-saving lamp reaches the preset light-off time, the energy-saving lamp can be turned off, thereby further improving the energy-saving effect of the energy-saving lamp.
[0035] In a preferred example, the present application may be further configured as follows: determining, based on the neighbor judgment information, whether the energy-saving lamp corresponding to the current sensing event or the other sensing event satisfies a preset neighbor relationship condition; if so, treating the corresponding energy-saving lamp as a neighboring energy-saving lamp, specifically including:
[0036] Determining, based on the neighbor determination information, whether the energy-saving lamp corresponding to the current sensing event or the other sensing event satisfies a preset neighbor relationship condition; if so, determining whether the current energy-saving lamp has found a preset maximum number of neighboring energy-saving lamps; if so, comparing the neighbor determination information of the current energy-saving lamp with the neighbor determination information of the found neighboring energy-saving lamps, and determining the neighboring energy-saving lamps based on the comparison result;
[0037] If the judgment result is no, the energy-saving lamp corresponding to the current sensing event or the other sensing event is taken as an adjacent energy-saving lamp.
[0038] By adopting the above technical solution, in the adjacent judgment information, the adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, that is, the relevant information of the event that the energy-saving lamp in the current parking lot senses a human signal, including the number of times the energy-saving lamp in the current parking lot senses a human; the adjacent judgment information corresponding to the second database includes other energy-saving lamp sensing trigger information, that is, the relevant information of the event that the energy-saving lamp in the other parking lot senses a human signal, including the number of times the energy-saving lamp in the other parking lot senses a human signal. In this way, by calculating the number of times the energy-saving lamp in the current parking lot senses a human and the number of times the energy-saving lamp in the other parking lot senses a human signal, as well as the ratio and other data, and comparing them with the adjacent threshold in the preset adjacent relationship condition, it is possible to filter out the accidental triggering of the energy-saving lamps in nearby non-adjacent parking lots due to the simultaneous triggering of the sensing human signal by different people and vehicles, thereby reducing the probability of identifying non-adjacent lamps as adjacent lamps, and ensuring the accuracy of the adjacent relationship discovery.
[0039] Secondly, the above-mentioned invention objectives of this application are achieved through the following technical solutions:
[0040] A device for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking, comprising:
[0041] an interrupt processing module, configured to, in response to a first sensing event or a second sensing event, enter a corresponding registration self-discovery interrupt processing flow and determine whether to simultaneously enter a registration lighting interrupt processing flow; and, in response to a third sensing event, enter a corresponding registration lighting interrupt processing flow. The first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the neighbor relationship of energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps.
[0042] A lighting control module, configured to perform lighting control when it is determined that the registration lighting interrupt processing flow is synchronously transferred to the registration lighting interrupt processing flow corresponding to the third sensing event;
[0043] a recording module, configured to generate information about a current sensing event when entering the registration self-discovery interrupt processing flow, and record the information about the current sensing event in a database corresponding to the current sensing event, wherein the first sensing event has a first database, and the second sensing event has a second database;
[0044] an event query module, configured to query a database corresponding to another sensing event, and if it is determined that there is another sensing event, extract adjacent judgment information from the first database and the second database;
[0045] The adjacent judgment module is used to judge whether the energy-saving lamp corresponding to the current sensing event or the other sensing event meets the preset adjacent relationship condition based on the adjacent judgment information, and if it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0046] Thirdly, the above-mentioned invention objectives of this application are achieved through the following technical solutions:
[0047] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking are implemented.
[0048] Fourthly, the above-mentioned invention objectives of this application are achieved through the following technical solutions:
[0049] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking.
[0050] In summary, this application includes at least one of the following beneficial technical effects:
[0051] 1. Whether parking lot energy-saving lamps are adjacent can only be determined when both the first and second sensing events occur. This means that only when the current parking lot energy-saving lamp senses the movement of a person or vehicle can the lamp be controlled to be adjacent. Furthermore, if the energy-saving lamp has already found an adjacent energy-saving lamp, then in response to the third sensing event or in response to the current parking lot energy-saving lamp sensing the movement of a person or vehicle, the lamp will be controlled to turn on, and the brightness of the adjacent energy-saving lamps will be controlled to gradually decrease, thereby improving the energy-saving effect of the energy-saving lamp.
[0052] 2. Based on the linkage level control information sent by other energy-saving lamps, it is determined whether to send it to adjacent energy-saving lamps via unicast. This enables automatic communication among all energy-saving lamps in the parking lot and automatically discovers adjacent relationships. This allows the energy-saving lamps in the parking lot to automatically achieve highly accurate linkage control without excessive debugging, thereby reducing implementation costs and improving user experience. This facilitates the promotion and use of energy-saving lamps in underground parking lots and promotes the energy-saving and low-carbon transformation of parking lots.
[0053] 3. Timestamp information enables calculation of the time difference between different sensing events, which serves as an important basis for determining whether the energy-saving lamps in the parking lot are adjacent. The energy-saving lamp network address is used to determine the specific reference of the energy-saving lamp in the parking lot that sent the event of sensing a person. Therefore, the information on the occurrence of the current sensing event is recorded in the database corresponding to the current sensing event, which facilitates subsequent query of the database to determine the adjacent relationship of the energy-saving lamps in the parking lot. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a first implementation flow chart of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0055] Figure 2 This is a second implementation flow chart of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0056] Figure 3 This is a flowchart of S30 of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0057] Figure 4 This is a flowchart of S22 of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0058] Figure 5 This is a flowchart of S40 of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0059] Figure 6 This is a third implementation flow chart of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0060] Figure 7 This is a flow chart of S50 of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0061] Figure 8 This is a principle block diagram of a device for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application;
[0062] Figure 9 It is a diagram of the internal structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following is combined with Figure 1-9 This application is described in further detail.
[0064] In one embodiment, if Figure 1As shown, the present application discloses a method for self-discovery and control of neighbor relationships of energy-saving lamps based on Mesh networking, which specifically includes the following steps:
[0065] S10: When responding to the first sensing event or the second sensing event, enter the corresponding registration self-discovery interrupt processing flow, and determine whether to synchronously enter the registration lighting interrupt processing flow. When responding to the third sensing event, enter the corresponding registration lighting interrupt processing flow. The first sensing event and the second sensing event have different registration self-discovery interrupt processing flows corresponding to them. The registration self-discovery interrupt processing flow is used to determine the adjacent relationship of energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of energy-saving lamps.
[0066] In this embodiment, a mesh-network-based method for self-discovering and controlling neighbor relationships for energy-saving lamps is applied to parking lot energy-saving lamps. These lamps feature brightness adjustment, sensing, and Bluetooth Mesh-based communication. Bluetooth Mesh networking is a wireless network architecture designed based on Bluetooth Low Energy (BLE) technology. It allows many-to-many connections and communication between numerous Bluetooth devices, creating a self-organizing network that can scale over large areas and accommodate thousands of nodes. In a Bluetooth Mesh network, each device can act as a sender, receiver, or even a relay node for message transmission within the network. This allows for reliable information transmission across the network, even if there's no direct radio communication link between two devices. This ensures reliable information transmission throughout the network. In this embodiment, addresses in a Bluetooth Mesh network are 16 bits long. Unicast addresses uniquely identify the element address of a node in the network (in this embodiment, the parking lot energy-saving lamp has a unicast address). Multicast addresses represent group addresses within the network, which can be shared by one or more nodes. The broadcast address (0xFFFF) used in this embodiment is a type of multicast address and is shared by all nodes. The sensing function of the parking lot energy-saving lamp is realized through infrared sensing / microwave sensing.
[0067] When several parking lot energy-saving lamps determine their adjacent relationship, a linkage control relationship will be formed, that is, a group of adjacent parking lot energy-saving lamps can perform related synchronous operations (such as turning on and off the lights / brightness adjustment).
[0068] In this embodiment, the first sensing event refers to either the event of a parking lot energy-saving lamp generating a signal sensing a person or vehicle, or the event of a parking lot energy-saving lamp receiving a signal sensing a person or vehicle from another parking lot energy-saving lamp. The second sensing event refers to the other of the event of a parking lot energy-saving lamp generating a signal sensing a person or vehicle, or the event of a parking lot energy-saving lamp receiving a signal sensing a person or vehicle from another parking lot energy-saving lamp. The third sensing event refers to the event of a parking lot energy-saving lamp receiving a linkage control signal from another parking lot energy-saving lamp. The registered interrupt handling process refers to the interrupt handling function implemented through an interrupt service routine (ISR). An ISR is a function called by the operating system when an interrupt occurs to ensure the correct use of the real-time operating system in the interrupt context. The first and second sensing events correspond to the registered self-discovery interrupt handling process, while the third sensing event corresponds to the registered light-on interrupt handling process. The first and second sensing events correspond to different registered interrupt handling processes. For example, if the current event is the first sensing event, the subsequent interrupt handling process is to determine whether the second sensing event has occurred.
[0069] Specifically, the parking lot energy-saving lamps complete Bluetooth Mesh networking before leaving the factory, so that after the parking lot energy-saving lamps are installed in the parking lot, they are in the Bluetooth Mesh after being installed on site and powered on, and can communicate with each other; in this embodiment, when the energy-saving lamps are installed in the parking lot (lanes or parking spaces, etc.), the distance between the parking lot energy-saving lamps in the parking lot is generally about 5 meters, and there are no more than 4 adjacent parking lot energy-saving lamps (the lights on the lanes are adjacent to each other in front and behind, and there are one in each of the four directions at the intersection); during the operation of the parking lot energy-saving lamps, the parking lot energy-saving lamps will automatically enter the adjacent lamp self-discovery state after being powered on. At the same time, the parking lot energy-saving lamps are in an automatic sensing state, that is, during the operation of the parking lot energy-saving lamps, the parking lot energy-saving lamps sense people or cars within the sensing range in real time, and receive information sent by other parking lot energy-saving lamps in real time. When the parking lot energy-saving lamps generate a sensed person or car When a signal event is generated or a parking lot energy-saving lamp receives a signal sent by other parking lot energy-saving lamps that senses a person or a car, that is, in response to the first sensing event or the second sensing event, the parking lot energy-saving lamp is triggered to automatically enter the corresponding registered self-discovery interrupt processing flow. Therefore, the self-discovery interrupt processing flow is used to determine the adjacent relationship of the energy-saving lamps, and it is also necessary to determine whether to synchronously enter the registered lighting interrupt processing flow. Because if the current sensing event is an event in which the parking lot energy-saving lamp generates a signal that senses a person or a car, that is, when the current parking lot energy-saving lamp senses a person or a car, it is necessary to light up the current parking lot energy-saving lamp to realize the basic lighting function while realizing the self-discovery of the adjacent relationship, and when the third sensing event occurs, that is, when the linkage control signal sent by other parking lot energy-saving lamps is received, it enters the corresponding registered lighting interrupt processing flow, and the registered lighting interrupt processing flow is used for lighting control of the energy-saving lamps.
[0070] S20: When it is determined that the process is synchronously transferred to the registration lighting interruption processing flow or transferred to the registration lighting interruption processing flow corresponding to the third sensing event, lighting control is performed.
[0071] Specifically, if the current sensing event is an event in which the parking lot energy-saving lamp generates a signal sensing a person or a car, it is determined that it is necessary to synchronously enter the registration lighting interrupt processing flow. Therefore, when it is determined to synchronously enter the registration lighting interrupt processing flow or enter the registration lighting interrupt processing flow corresponding to the third sensing event, it means that a person or a car is currently passing by the surrounding energy-saving lamps. Therefore, lighting control is performed, that is, the energy-saving lamps are controlled to light up first. Moreover, if the current sensing event is an event in which the parking lot energy-saving lamp senses a signal sensing a person or a car, it means that the current energy-saving lamp is the first energy-saving lamp to sense a person or a car, or the other energy-saving lamps that sense a person or a car are not adjacent to the current energy-saving lamp and cannot receive the signals sensing a person or a car sent by other parking lot energy-saving lamps. Therefore, the current energy-saving lamp is controlled to light up according to the preset normal brightness. If the current sensing event is the third sensing event, it means that other energy-saving lamps have sensed the passing of a person or a car before, and the current energy-saving lamp has received the linkage control signals sent by other parking lot energy-saving lamps. Therefore, the current energy-saving lamp can be controlled to light up according to the linkage control signals sent by other parking lot energy-saving lamps.
[0072] It should be noted that the registration light-on interrupt processing process and the registration self-discovery interrupt processing process are independent of each other, that is, the registration light-on interrupt processing process and the registration self-discovery interrupt processing process can be carried out simultaneously. For example, when the current sensing event sent is an event in which the energy-saving lamp in the parking lot generates a signal sensing a person or a car, it will enter the registration self-discovery interrupt processing process corresponding to the event, and synchronously enter the registration light-on interrupt processing process corresponding to the event.
[0073] S30: When entering the registration self-discovery interrupt processing flow, generate the current sensing event occurrence information, and record the current sensing event occurrence information in the database corresponding to the current sensing event, the first sensing event has a first database, and the second sensing event has a second database.
[0074] In this embodiment, the current sensing event occurrence information refers to relevant information of the sensing event that currently occurs.
[0075] Specifically, when entering the registration self-discovery interrupt processing flow, the registration self-discovery interrupt processing flow corresponding to different sensing events includes generating relevant information of the sensing event currently occurring, the current sensing event occurrence information corresponding to the event in which the parking lot energy-saving lamp generates a signal sensing a person or a car includes the timestamp of this event, the current sensing event occurrence information corresponding to the event in which the parking lot energy-saving lamp receives a signal sensing a person or a car sent by other parking lot energy-saving lamps includes the timestamp of this event, and the Mesh address of the parking lot energy-saving lamp that sends the signal. In this embodiment, when the energy-saving lamp does not find an adjacent relationship, because each parking lot energy-saving lamp sends a signal (report When sending a message (text), the broadcast address (0xFFFF) is used, and the transmission method is low power, so that only the energy-saving lamps in the parking lot within a radius of about 10 meters can directly receive the information. At the same time, it is sent in a non-relay mode to ensure that the information will not be relayed. In this way, the energy-saving lamps in the parking lot outside the 10-meter radius cannot receive the information, thereby limiting non-adjacent energy-saving lamps from receiving information irrelevant to themselves. After the current sensing event information is generated, the current sensing event information is recorded in the database corresponding to the current sensing event (the first sensing event or the second sensing event). The first sensing event has a first database, and the second sensing event has a second database. It can be foreseen that if the first sensing event is an event in which a parking lot energy-saving lamp generates a signal sensing a person or a car and the second sensing event is an event in which a parking lot energy-saving lamp receives a signal sensing a person or a car sent by other parking lot energy-saving lamps, then the first database is used to record relevant information each time the current parking lot energy-saving lamp senses a person or a car, including the timestamp of the event, and the second database is used to record the timestamp of each time the current parking lot energy-saving lamp receives a signal, and the corresponding Mesh address of the parking lot energy-saving lamp that sends the signal, and associate the timestamp with the Mesh address, that is, the second database records information related to the event and has nothing to do with whether the parking lot energy-saving lamp is the same. For example, when receiving signals sent by the same parking lot energy-saving lamp multiple times at different times, the second database will record the timestamp of each time the signal sent by the parking lot energy-saving lamp is received, and associate the Mesh address of the parking lot energy-saving lamp with each recorded timestamp.
[0076] S40: querying a database corresponding to another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database.
[0077] In this embodiment, the neighbor determination information refers to information used to determine whether a neighbor relationship is established.
[0078] Specifically, only when both the first sensing event and the second sensing event occur can it be determined whether the parking lot energy-saving lamps are adjacent. For example, two parking lot energy-saving lamps that are both lane lights need to sense the movement of people or cars in succession before further determining whether the two parking lot energy-saving lamps are adjacent. Therefore, after responding to the first sensing event or the second sensing event, the database corresponding to the other sensing event is queried to determine whether there is another sensing event; when specifically querying the database corresponding to another sensing event, query conditions can be added, for example, whether there is another sensing event within several seconds before the current first sensing event or the second sensing event occurs, or whether there is the same another sensing event within several seconds before the current first sensing event or the second sensing event occurs, etc.; in this way, if it is determined under the query conditions that there is another sensing event in the database corresponding to the other sensing event, it means that the conditions for the establishment of the preliminary adjacent relationship are met, and then information used to determine the establishment of the adjacent relationship, that is, adjacent judgment information, is extracted from the first database and the second database.
[0079] In this embodiment, the second database records information related to each time the current parking lot energy-saving lamp receives a signal, including the timestamp of each time the current parking lot energy-saving lamp receives a signal and the mesh address of the corresponding parking lot energy-saving lamp that sent the signal. Furthermore, each time the current parking lot energy-saving lamp receives a signal from a specific parking lot energy-saving lamp, the current parking lot energy-saving lamp is recorded as a trigger count. The second database also counts the trigger counts of each other parking lot energy-saving lamp. The first database is used to record information related to each time the current parking lot energy-saving lamp senses a person or vehicle, including the timestamp of each time the current parking lot energy-saving lamp senses a person or vehicle. Furthermore, each time the current parking lot energy-saving lamp responds to a first sensing event and queries the database of second sensing events and determines that a second sensing event meets the query criteria, and each time the current parking lot energy-saving lamp responds to a second sensing event and queries the database of first sensing events and determines that a first sensing event meets the query criteria, the first database records this as a hit count. In other words, the trigger count indicates the number of times the current parking lot energy-saving lamp receives signals from other parking lot energy-saving lamps, and the hit count indicates the number of times the current parking lot energy-saving lamp senses a person or vehicle and receives signals from other parking lot energy-saving lamps under certain query conditions (e.g., within 5 seconds).
[0080] Therefore, for example, if the second database of second sensing events is queried after the current parking lot energy-saving lamp responds to the first sensing event, the condition set may be whether there was a second sensing event within 5 seconds before the current first sensing event. If so, the most recent second sensing event within 5 seconds before the current first sensing event is determined (because the current parking lot energy-saving lamp may have received signals from multiple different parking lot energy-saving lamps within 5 seconds before sensing a person or a car. The closer the time to the current first sensing event, the closer the interval between the first sensing event and the second sensing event, and the greater the probability that the two parking lot energy-saving lamps are adjacent. Therefore, the most recent other parking lot energy-saving lamp is selected at this time). The mesh address corresponding to the most recent second sensing event and the trigger count of the parking lot energy-saving lamp corresponding to the address are extracted. Then, the hit count of the parking lot energy-saving lamp corresponding to the address is recorded in the first database plus one. Then, the hit count of the parking lot energy-saving lamp corresponding to the address is extracted. The adjacent determination information includes the trigger count and the hit count.
[0081] If the first database of the first sensing event is queried after the current parking lot energy-saving lamp responds to the second sensing event, the set condition can be whether there is a first sensing event within 5 seconds before the current second sensing event occurs. If it is judged to be yes, the triggering number of the parking lot energy-saving lamp corresponding to the second sensing event is extracted from the second database, and then the hitting number of the parking lot energy-saving lamp corresponding to the second sensing event is recorded in the first database plus one, and then the hitting number of the parking lot energy-saving lamp corresponding to the second sensing event is extracted. The adjacent judgment information includes the triggering number and the hitting number.
[0082] S50: judging whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies a preset adjacent relationship condition based on the adjacent judgment information; if so, taking the corresponding energy-saving lamp as an adjacent energy-saving lamp.
[0083] Specifically, the adjacent judgment information includes the number of triggers and the number of hits, and the timestamps of the sensing events corresponding to the number of triggers and the number of hits and the Mesh addresses of the corresponding suspected adjacent parking lot energy-saving lamps. Therefore, it is judged whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship conditions. If it is judged that the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship conditions, the corresponding energy-saving lamp is used as an adjacent energy-saving lamp. If it is judged that the energy-saving lamp corresponding to the current sensing event or another sensing event does not meet the preset adjacent relationship conditions, it is judged that the current suspected adjacent parking lot energy-saving lamp is not a confirmed adjacent parking lot energy-saving lamp, and the current registration interrupt processing process ends, and the current parking lot energy-saving lamp continues to wait for a response to the first sensing event or the second sensing event.
[0084] For example, the step of determining whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies a preset neighbor relationship condition includes the following steps:
[0085] Step 1: Calculate whether the ratio of the number of hits to the number of triggers is greater than 0.2 and the number of triggers is greater than 5. (By determining whether the number of triggers is greater than 5 and the ratio is greater than 0.2, the hit counts of nearby non-adjacent energy-saving lamps caused by different people and vehicles triggering the human sensing signal at the same time can be filtered out, reducing the probability of identifying non-adjacent lamps as adjacent lamps.) If the judgment is no, it is determined that the currently suspected adjacent parking lot energy-saving lamp is not yet a confirmed adjacent parking lot energy-saving lamp, and the current registration interrupt processing flow ends. The current parking lot energy-saving lamp continues to wait for a response to the first sensing event or the second sensing event. If the judgment is yes, proceed to step 2.
[0086] Step 2: Determine whether the adjacent parking lot energy-saving lamps found by the current parking lot energy-saving lamp include the energy-saving lamp with the mesh address (the maximum number of adjacent parking lot energy-saving lamp sets found is no more than 4). If the judgment is no, proceed to step 3. If the judgment is yes, proceed to step 7.
[0087] Step 3: Check whether the number of adjacent parking lot energy-saving lamp sets found is 4. If so, proceed to step 4; otherwise, proceed to step 6.
[0088] Step 4: Extract the minimum ratio of the calculated hit count and trigger count corresponding to the adjacent parking lot energy-saving lamps found in the adjacent parking lot energy-saving lamp set, and determine whether the currently calculated hit count and trigger count ratio is ≥ the minimum ratio. If so, proceed to step 5. If not, it is determined that the currently suspected adjacent parking lot energy-saving lamp is not yet a confirmed adjacent parking lot energy-saving lamp, and the current registration interrupt processing flow ends. The current parking lot energy-saving lamp continues to wait for a response to the first sensing event or the second sensing event.
[0089] Step 5: Delete the adjacent parking lot energy-saving lamp corresponding to the minimum ratio, because the parking lot energy-saving lamp with a higher hit ratio (that is, the adjacent characteristics are more obvious) has been found.
[0090] Step 6: Add the energy-saving lamp in the parking lot corresponding to the ratio of the current calculated hit count to the trigger count to the set of energy-saving lamps in the adjacent parking lot and record it as the energy-saving lamp in the adjacent parking lot;
[0091] Step 7: Update the original ratio of the adjacent parking lot energy-saving lamp set with the currently calculated ratio of the number of hits to the number of triggers, indicating an update of the ratio of the number of hits to the number of triggers of the parking lot energy-saving lamps at the current Mesh address.
[0092] In one embodiment, if Figure 2As shown, the first sensing event is the event of sensing a human signal, the second sensing event is the event of receiving a human signal sent by other energy-saving lamps, and the third sensing event is the event of receiving a linkage control signal sent by other energy-saving lamps. In step S10, it is determined whether to synchronously enter the registration lighting interrupt processing flow, which specifically includes:
[0093] S11: When responding to the first sensing event, it is determined that the registration and lighting interruption processing flow is synchronously transferred. When responding to the second sensing event, it is determined that the registration and lighting interruption processing flow is asynchronously transferred.
[0094] Specifically, the first sensing event is defined as the event in which the energy-saving lamp in the current parking lot senses a human signal, and the second sensing event is defined as the event in which the energy-saving lamp in the current parking lot receives a human signal sent by other energy-saving lamps. When responding to the first sensing event, it is determined that it is necessary to synchronously enter the corresponding registration lighting interrupt processing flow. When responding to the second sensing event, it is determined that it is not necessary to synchronously enter the registration lighting interrupt processing flow.
[0095] In step S20, when it is determined that the registration lighting interruption processing flow is synchronously transferred to or transferred to the registration lighting interruption processing flow corresponding to the third sensing event, lighting control is performed, specifically including:
[0096] S21: When it is determined that the registration lighting interrupt processing flow is synchronously transferred, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and it is determined whether the current energy-saving lamp has found the adjacent energy-saving lamp. If it is determined to be yes, the first linkage level control information is generated, and the first linkage level control information is sent to the adjacent energy-saving lamp via unicast. If it is determined to be no, the second linkage level control information is generated, and the second linkage level control information is sent via low-power multicast and non-relay methods.
[0097] Specifically, when it is determined that the synchronization is transferred to the registration lighting interrupt processing flow in response to the first sensing event, the current energy-saving lamp is first lit based on the corresponding registration lighting interrupt processing flow, and the current timestamp is recorded in the lighting database. In addition, it is necessary to determine whether the current energy-saving lamp has an adjacent relationship. Because if the current energy-saving lamp has an adjacent relationship, it is necessary to send a lighting control signal to the energy-saving lamp that has been determined to be adjacent. If the current energy-saving lamp does not have an adjacent relationship, it is necessary to send different lighting control signals to all surrounding energy-saving lamps in a broadcast manner. Therefore, it is determined whether the current energy-saving lamp has found an adjacent energy-saving lamp. If it is determined to be yes, a first linkage level CNC is generated. The first linkage level control information refers to the lighting control information sent to the energy-saving lamps determined to be adjacent, for example, the control information for controlling the brightness or lighting duration of the energy-saving lamps determined to be adjacent, and the first linkage level control information is sent to the adjacent energy-saving lamps in a unicast manner; and if it is determined that the current energy-saving lamp has not found the adjacent energy-saving lamp, the second linkage level control information is generated, and the second linkage level control information refers to the lighting control information for broadcasting notifications to the surrounding energy-saving lamps, and the second linkage level control information is sent through low-power multicast and non-relay methods, so that regardless of whether the current energy-saving lamp has found the adjacent energy-saving lamp, the energy-saving lamps in the nearby parking lot will be notified to light up.
[0098] It should be noted that the first linkage level control information and the second linkage level control information have the same format, but are broadcast in different ways.
[0099] S22: When entering the registration lighting interrupt processing flow corresponding to the third sensing event, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and the linkage level control information sent by other energy-saving lamps is obtained to determine whether the current energy-saving lamp has found the adjacent energy-saving lamp. If so, it is determined whether the linkage level control information sent by other energy-saving lamps meets the preset sending conditions. If so, the linkage level control information sent by other energy-saving lamps is adjusted to generate the first linkage level control information, and the first linkage level control information is sent to the adjacent energy-saving lamps via unicast.
[0100] Specifically, when entering the registration lighting interrupt processing flow corresponding to the third sensing event, it is in response to the third sensing event. Based on the corresponding registration lighting interrupt processing flow, the current energy-saving lamp is first lit, the current timestamp is recorded in the lighting database, and it is determined whether the current energy-saving lamp already has an adjacent relationship. Because if the current energy-saving lamp already has an adjacent relationship, it is necessary to send a lighting control signal to the energy-saving lamp that has been determined to be adjacent. If the current energy-saving lamp does not have an adjacent relationship, there is no need to send a lighting control signal to all surrounding energy-saving lamps in a broadcast manner. Therefore, the linkage level control information sent by other energy-saving lamps is obtained from the second sensing event. At this time, the energy-saving lamp cannot determine whether the linkage level control information is the first linkage level control information or the second linkage level control information. Therefore, it is first determined whether the current energy-saving lamp has found an adjacent energy-saving lamp. If the judgment is yes, it means that the current energy-saving lamp needs to be It has been determined that the adjacent energy-saving lamp sends a lighting control signal. Therefore, based on the linkage level control information sent by other energy-saving lamps, it is determined whether the linkage level control information sent by other energy-saving lamps meets the preset sending conditions. In this embodiment, the preset sending conditions include that the linkage level control information is the first linkage level control information, that is, the energy-saving lamp sending the linkage level control information has an adjacent relationship with the current energy-saving lamp. Therefore, if it is determined to be yes, it means that the energy-saving lamp sending the linkage level control information has an adjacent relationship with the current energy-saving lamp, and the current energy-saving lamp also has an adjacent relationship with other energy-saving lamps. Therefore, the linkage level control information sent by other energy-saving lamps is adjusted, for example, the brightness of the energy-saving lamp is reduced, so as to generate the first linkage level control information, that is, the lighting control information sent for the energy-saving lamps determined to be adjacent, and the first linkage level control information is sent to the adjacent energy-saving lamps via unicast.
[0101] It is understandable that no matter whether the other energy-saving lamps receive the first linkage level control information or the second linkage level control information, the other energy-saving lamps will respond to the third sensing event.
[0102] For example, the steps to register the light-on interrupt processing flow are as follows:
[0103] Step 01: In response to the first sensing event or the third sensing event, enter the corresponding registration light interrupt processing flow;
[0104] Step 02: Determine whether it is the first sensing event, if yes, proceed to step 08, otherwise proceed to step 03;
[0105] Step 03: Determine whether it is the third sensing event. If so, proceed to step 04; otherwise, return to step 01 and continue waiting for the interrupt event.
[0106] Step 04: Obtain the linkage level control information sent by other energy-saving lamps, including the initial linkage level (denoted as p) and the current linkage level (denoted as q);
[0107] Step 05: set the brightness of the energy-saving lamp to 100*q / p, and record the current time as the last time the lamp was turned on in the light-on database. In this step, the brightness is set to 100*q / p, which can achieve the effect of the brightness from bright to dark as the distance from the energy-saving lamp (i.e., the energy-saving lamp on the top of the moving vehicle) with the sensed person signal increases from near to far;
[0108] Step 06: determine whether the current energy-saving lamp has found a neighboring energy-saving lamp, and whether the linkage level control information sent by other energy-saving lamps meets the preset sending condition, which includes determining whether q is greater than 1. If yes, go to step 07, otherwise return to step 01 to continue waiting for the interrupt event. The maximum value of p can be set by oneself, and in different projects, the range of linkage control is different, the initial linkage level can be adjusted, and generally it is set between 3-10, here 5 is taken as the default value for illustration;
[0109] Step 07: adjust the linkage level control information sent by other energy-saving lamps to generate the first linkage level control information, that is, set the initial linkage level to p and the current linkage level to (q-1), and use unicast to send the first linkage level control information and the current sensing event information to the found neighboring lamps one by one. Through this step, the current linkage level is gradually reduced to 1, when q is 1, it means that the current energy-saving lamp is the last level of the linkage control light-on, and there is no need to continue to notify the next level neighbor to link the light-on, realizing the range control of the linkage control light-on. By this way, the decrement operation of the current linkage level can realize the range control of the linkage control light-on after sensing the person signal;
[0110] Step 08: set the brightness of the energy-saving lamp to 100, and record the current time as the last time the lamp was turned on in the light-on database;
[0111] Step 09: determine whether the current energy-saving lamp has found at least one neighboring lamp, if yes, go to step 010, otherwise go to step 011;
[0112] Step 010: generate the first linkage level control information, that is, set the initial linkage level and the current linkage level to 5, and use unicast to send the first linkage level control information and the current sensing event information to the found neighboring lamps one by one;
[0113] Step 011: generating the second linkage level number control information, i.e. setting the initial linkage level number and the current linkage level number to 1, and sending the second linkage level number control information and the current sensing event occurrence information to the nearby energy-saving lamps using the multicast and non-relay mode. In this step, when the project initial energy-saving lamps are just installed, and the energy-saving lamps have not learned the adjacent relationship, in order to ensure the basic lighting effect, through this step, the energy-saving lamps sensing the vehicle will link to control the energy-saving lamps around themselves, and the range is determined by the single-hop communication distance of the energy-saving lamp Bluetooth module, which is generally about 30 meters in radius.
[0114] In an embodiment, as shown in FIG. 3, when the registration self-discovery interrupt processing flow is entered in step S30, the current sensing event occurrence information is generated, and the current sensing event occurrence information is recorded to the database corresponding to the current sensing event, which specifically includes: Figure 3
[0115] S31: when the registration self-discovery interrupt processing flow is entered, the current sensing event occurrence information is generated according to the first sensing event or the second sensing event, the current sensing event occurrence information is recorded to the database corresponding to the current sensing event, and if the current sensing event is the first sensing event, the current sensing event occurrence information is sent through the low-power multicast and non-relay mode. The current sensing event occurrence information includes the energy-saving lamp network address and the timestamp information.
[0116] Specifically, when the registration self-discovery interrupt processing flow is entered, the current sensing event occurrence information is generated according to the first sensing event or the second sensing event, wherein if it is in response to the first sensing event, the current sensing event occurrence information includes the timestamp of the event that the current parking lot energy-saving lamp sensed the human signal, if it is in response to the second sensing event, the current sensing event occurrence information includes the timestamp of the event that the current parking lot energy-saving lamp received the sensing human signal sent by other energy-saving lamps, and the Mesh address of the parking lot energy-saving lamp sending the signal; then the current sensing event occurrence information is recorded to the database corresponding to the current sensing event, and if the current sensing event is the first sensing event, the current sensing event occurrence information is sent through the low-power multicast and non-relay mode.
[0117] It can be understood that when responding to the first sensing event, the registration self-discovery interrupt processing flow corresponding to the first sensing event is entered, and the current sensing event occurrence information will be sent through low-power multicast and non-relay methods, and the registration lighting interrupt processing flow corresponding to the first sensing event is synchronously entered, and the first linkage level control information will be sent to the adjacent energy-saving lamps through unicast, or the second linkage level control information will be sent through low-power multicast and non-relay methods. Therefore, when responding to the first sensing event and the current energy-saving lamp does not find the adjacent relationship, the current sensing event occurrence information will be sent through low-power multicast and non-relay methods. The second linkage level control information is sent through low-power multicast and non-relay modes. When the current energy-saving lamp discovers the adjacent relationship, the current sensing event occurrence information is sent through low-power multicast and non-relay modes, and the first linkage level control information is sent to the adjacent energy-saving lamp through unicast. That is to say, regardless of whether the current energy-saving lamp discovers the adjacent relationship, the current sensing event occurrence information is sent through low-power multicast and non-relay modes, so that the current energy-saving lamp always remains in the state of self-discovery of the adjacent relationship (for example, when replacing a nearby energy-saving lamp, it is necessary to continuously learn and discover the replaced energy-saving lamp).
[0118] In one embodiment, if Figure 4 As shown, in step S22, if the judgment is yes, then adjust the linkage level control information sent by the other energy-saving lamps to generate first linkage level control information, and send the first linkage level control information to the adjacent energy-saving lamps in a unicast manner, specifically including:
[0119] S221: If the answer is yes, the order of the found adjacent energy-saving lamps is obtained.
[0120] Specifically, when it is determined that the linkage level control information sent by other energy-saving lamps meets the preset sending conditions, it means that the current energy-saving lamp has found the adjacent energy-saving lamp and the current energy-saving lamp is not the last in the adjacent relationship. Because in the self-discovery process of the adjacent relationship of energy-saving lamps, each time it is determined that an adjacent energy-saving lamp is found, each adjacent energy-saving lamp will be sorted according to the time sequence when the adjacent energy-saving lamp is found. Because when people or cars walk in the underground parking lot, they will walk according to the guidance signs of the underground parking lot. That is to say, people or cars have a certain route when walking in the underground parking lot, and they also have a certain order when passing different energy-saving lamps. Therefore, if the judgment is yes, the order of the found adjacent energy-saving lamps is obtained.
[0121] S222: Based on a preset adjustment rule, adjust the linkage level control information sent by other energy-saving lamps to generate at least one first linkage level control information.
[0122] Specifically, based on the preset adjustment rules, the linkage level control information sent by other energy-saving lamps is adjusted, for example, the brightness control information in the linkage level control information sent by other energy-saving lamps is reduced, thereby generating at least one first linkage level control information corresponding to the order of the current energy-saving lamps.
[0123] S223: Based on the order in which the adjacent energy-saving lamps have been found, the first linkage level control information is sent to the corresponding adjacent energy-saving lamps in a unicast manner.
[0124] Specifically, the first linkage level control information is sent to the corresponding adjacent energy-saving lamps in a unicast manner in sequence according to the order in which the adjacent energy-saving lamps have been found.
[0125] In one embodiment, if Figure 5 As shown, in step S40, the database corresponding to another sensing event is queried. If it is determined that there is another sensing event, adjacent judgment information is extracted from the first database and the second database, specifically including:
[0126] S41: Query a database corresponding to another sensing event. If it is determined that another sensing event occurs within a preset sensing period, extract adjacent judgment information from the first database and the second database. The adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, and the adjacent judgment information corresponding to the second database includes the sensing trigger information of other energy-saving lamps.
[0127] In this embodiment, regardless of whether responding to the first sensing event or the second sensing event, when querying the database corresponding to the other sensing event, the query range is set to the query condition of information within the preset sensing period before the occurrence of the current sensing event;
[0128] Therefore, the database corresponding to another sensing event is queried to determine whether there is another sensing event within a preset sensing period. If it is determined that there is another sensing event within the preset sensing period, adjacent judgment information is extracted from the first database and the second database.
[0129] For example, if the current sensing event is a first sensing event, then the second database is queried within the preset sensing period to determine whether there is a second sensing event within the preset sensing period before the first sensing event occurs. If the answer is yes, adjacent judgment information is extracted from the second database, including the triggering times and corresponding timestamp information of the energy-saving lamp in the parking lot corresponding to the second sensing event, i.e., the sensing triggering information of other energy-saving lamps, and adjacent judgment information is extracted from the first database, including the hitting times, i.e., the sensing information of the current energy-saving lamp.
[0130] If the current sensing event is the second sensing event, the first database is queried within the preset sensing period to determine whether there was a first sensing event within the preset sensing period before the second sensing event occurred. If the answer is yes, adjacent judgment information is extracted from the second database, including the triggering times and corresponding timestamp information of the energy-saving lamp in the parking lot corresponding to the second sensing event, i.e., the sensing triggering information of other energy-saving lamps, and adjacent judgment information is extracted from the first database, including the number of hits, i.e., the sensing information of the current energy-saving lamp.
[0131] In one embodiment, if Figure 6 As shown, in step S10, when responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered, which specifically includes:
[0132] S011: When responding to the first sensing event or the second sensing event, enter the corresponding registered self-discovery interrupt processing flow, and determine whether to synchronously enter the registered light-on interrupt processing flow. When responding to the third sensing event, enter the corresponding registered light-on interrupt processing flow. When responding to the fourth sensing event, enter the corresponding registered clock interrupt processing flow. The fourth sensing event is the second interrupt event of the system clock. The registered clock interrupt processing flow is used to control the shutdown of the energy-saving lamp. When responding to the fourth sensing event, obtain the light-off judgment information from the light-on database to determine whether the light-off judgment information meets the preset light-off condition. If the judgment is yes, control the energy-saving lamp to be turned off.
[0133] Specifically, after the energy-saving lamp is installed in the parking lot, to ensure its energy-saving effect, the lamp needs to have an automatic shut-off function. Therefore, in addition to responding to the first, second, and third sensing events, the lamp also responds to a fourth sensing event. When responding to the fourth sensing event, the corresponding registered clock interrupt processing flow is entered. The fourth sensing event is a second interrupt event of the system clock. The registered clock interrupt processing flow is used to control the shutdown of the energy-saving lamp. For example, when the energy-saving lamp turns on, a timer is synchronously started to determine the duration of the energy-saving lamp's lighting. If the energy-saving lamp does not sense a person or vehicle passing by within a certain period of time, or does not receive a signal from another energy-saving lamp indicating that a person or vehicle has passed by, the fourth sensing event is triggered. At this time, in response to the fourth sensing event, light-off determination information is obtained from the light-on database. This light-off determination information is the duration of the last time the energy-saving lamp was turned on. If the light-off determination information satisfies a preset light-off condition, that is, if the last time the energy-saving lamp was turned on reaches a preset light-off duration (e.g., 10 seconds), the energy-saving lamp is turned off, thereby further improving the energy-saving effect of the energy-saving lamp.
[0134] In one embodiment, if Figure 7 As shown, in step S50, based on the neighbor judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset neighbor relationship condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the neighbor energy-saving lamp, which specifically includes:
[0135] S51: Based on the adjacent judgment information, determine whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship conditions. If the judgment is yes, determine whether the current energy-saving lamp has found a preset maximum number of adjacent energy-saving lamps. If the judgment is yes, compare the adjacent judgment information of the current energy-saving lamp with the adjacent judgment information of the found adjacent energy-saving lamps, and determine the adjacent energy-saving lamps based on the comparison results.
[0136] Specifically, according to the adjacent judgment information, the adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, that is, the relevant information of the event that the energy-saving lamp in the current parking lot senses a human signal, including the number of times the energy-saving lamp in the current parking lot senses a human; the adjacent judgment information corresponding to the second database includes the sensing trigger information of other energy-saving lamps, that is, the relevant information of the event that the energy-saving lamp in the other parking lot senses a human signal, including the number of times the energy-saving lamp in the other parking lot senses a human signal. In this way, by calculating the ratio of the number of times the energy-saving lamp in the current parking lot senses a human to the number of times the energy-saving lamp in the other parking lot senses a human signal, etc. Data, determine whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship condition. If the judgment is yes, determine whether the current energy-saving lamp has found a preset maximum number of adjacent energy-saving lamps. For example, if the preset maximum number is 4, determine whether the current energy-saving lamp has found 4 adjacent energy-saving lamps. If the judgment is yes, compare the adjacent judgment information of the current energy-saving lamp with the adjacent judgment information of the found adjacent energy-saving lamps. According to the comparison result, the energy-saving lamp with more obvious adjacent characteristics is determined as the adjacent energy-saving lamp. For example, the energy-saving lamp with a higher ratio of the number of times the energy-saving lamp in the current parking lot senses someone to the number of times it receives the signal of sensing someone from the energy-saving lamps in other parking lots is determined as the adjacent energy-saving lamp.
[0137] S52: If the judgment result is no, the energy-saving lamp corresponding to the current sensing event or another sensing event is used as an adjacent energy-saving lamp.
[0138] Specifically, if the judgment is no, that is, the current energy-saving lamp has not found four adjacent energy-saving lamps, the energy-saving lamp corresponding to the current sensing event or another sensing event is used as the adjacent energy-saving lamp.
[0139] S53: judging whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the adjacent judgment condition according to the adjacent judgment information; if so, taking the corresponding energy-saving lamp as the adjacent energy-saving lamp.
[0140] Specifically, based on the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the adjacent judgment condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0141] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0142] In one embodiment, a device for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking is provided. The device for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking corresponds to the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking in the above embodiment. Figure 8 As shown, the energy-saving lamp neighbor relationship self-discovery and control device based on Mesh networking includes an interrupt processing module, a lighting control module, a recording module, an event query module and a neighbor judgment module. The functional modules are described in detail as follows:
[0143] An interrupt processing module, configured to, in response to a first sensing event or a second sensing event, enter a corresponding registration self-discovery interrupt processing flow and determine whether to simultaneously enter a registration light-on interrupt processing flow. In response to a third sensing event, the module then enters a corresponding registration light-on interrupt processing flow. The first sensing event and the second sensing event have different corresponding registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the neighbor relationship of energy-saving lamps, and the registration light-on interrupt processing flow is used to control the lighting of energy-saving lamps.
[0144] A lighting control module, configured to control lighting when it is determined that the registered lighting interrupt processing flow has been synchronously transferred to or the registered lighting interrupt processing flow corresponding to a third sensing event has been transferred to;
[0145] A recording module is used to generate information about the occurrence of a current sensing event when entering the registration self-discovery interrupt processing flow, and record the information about the occurrence of the current sensing event in a database corresponding to the current sensing event, wherein a first database is provided for a first sensing event and a second database is provided for a second sensing event;
[0146] An event query module is used to query the database corresponding to another sensing event, and if it is determined that there is another sensing event, extract adjacent judgment information from the first database and the second database;
[0147] The adjacent judgment module is used to judge whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship condition based on the adjacent judgment information. If it is judged to be satisfied, the corresponding energy-saving lamp is regarded as an adjacent energy-saving lamp.
[0148] Optionally, the first sensing event is an event of sensing a human presence signal, the second sensing event is an event of receiving a human presence signal sent by another energy-saving lamp, and the third sensing event is an event of receiving a linkage control signal sent by another energy-saving lamp.
[0149] The interrupt processing module comprises:
[0150] The light-on transition judgment submodule is configured to, in response to the first sensing event, judge whether to synchronously transition into the registered light-on interrupt processing flow, and in response to the second sensing event, judge whether to asynchronously transition into the registered light-on interrupt processing flow.
[0151] The light-on control module comprises:
[0152] The first light-on control submodule is configured to, when it is judged that the synchronous transition into the registered light-on interrupt processing flow is to be performed, light up the current energy-saving lamp, record a current timestamp into the light-on database, and judge whether the current energy-saving lamp has found a neighboring energy-saving lamp. If the judgment is yes, the first linkage level control information is generated and sent to the neighboring energy-saving lamp through unicast. If the judgment is no, the second linkage level control information is generated and sent through low-power groupcast and non-relay.
[0153] The second light-on control submodule is configured to, when the registered light-on interrupt processing flow corresponding to the third sensing event is entered, light up the current energy-saving lamp, record a current timestamp into the light-on database, and acquire the linkage level control information sent by another energy-saving lamp. If it is judged that the current energy-saving lamp has found a neighboring energy-saving lamp, it is judged whether the linkage level control information sent by another energy-saving lamp meets a preset sending condition. If the judgment is yes, the linkage level control information sent by another energy-saving lamp is adjusted, the first linkage level control information is generated, and the first linkage level control information is sent to the neighboring energy-saving lamp through unicast.
[0154] Optionally, the recording module comprises:
[0155] The event generation submodule is configured to, when the registered self-discovery interrupt processing flow is entered, generate current sensing event occurrence information according to the first sensing event or the second sensing event, record the current sensing event occurrence information into a database corresponding to the current sensing event, and if the current sensing event is the first sensing event, send the current sensing event occurrence information through low-power groupcast and non-relay. The current sensing event occurrence information comprises an energy-saving lamp network address and timestamp information.
[0156] Optionally, the second light-on control submodule comprises:
[0157] The order extraction unit is configured to, if the judgment is yes, acquire an order in which the neighboring energy-saving lamp has been found.
[0158] A decrement adjustment unit, configured to decrementally adjust the linkage level control information sent by other energy-saving lamps based on the order in which the adjacent energy-saving lamps have been found, to generate at least one first linkage level control information;
[0159] The sending unit is configured to send the first linkage level control information to the corresponding adjacent energy-saving lamps in a unicast manner.
[0160] Optionally, the event query module includes:
[0161] The event query submodule is used to query the database corresponding to another sensing event. If it is determined that another sensing event occurs within the preset sensing period, adjacent judgment information is extracted from the first database and the second database. The adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, and the adjacent judgment information corresponding to the second database includes the sensing trigger information of other energy-saving lamps.
[0162] Optionally, the interrupt handling module also includes:
[0163] The clock interrupt processing submodule is used to enter the corresponding registered self-discovery interrupt processing process when responding to the first sensing event or the second sensing event, and determine whether to synchronously enter the registered light-on interrupt processing process; when responding to the third sensing event, enter the corresponding registered light-on interrupt processing process; when responding to the fourth sensing event, enter the corresponding registered clock interrupt processing process; the fourth sensing event is the second interrupt event of the system clock; the registered clock interrupt processing process is used to control the shutdown of the energy-saving lamp; when responding to the fourth sensing event, obtain the light-off judgment information from the light-on database, and determine whether the light-off judgment information meets the preset light-off condition. If the judgment is yes, the energy-saving lamp is controlled to be turned off.
[0164] Optionally, the adjacent judgment module includes:
[0165] a first judgment submodule, configured to judge, based on the neighbor judgment information, whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies a preset neighbor relationship condition; if so, to judge whether the current energy-saving lamp has found a preset maximum number of neighboring energy-saving lamps; if so, to compare the neighbor judgment information of the current energy-saving lamp with the neighbor judgment information of the found neighboring energy-saving lamps, and to determine the neighboring energy-saving lamps based on the comparison result;
[0166] The second judgment submodule is configured to, if the judgment result is negative, use the energy-saving lamp corresponding to the current sensing event or another sensing event as an adjacent energy-saving lamp.
[0167] The specific limitations of the mesh-network-based energy-saving lamp neighbor relationship self-discovery and control device can be found in the aforementioned limitations of the mesh-network-based energy-saving lamp neighbor relationship self-discovery and control method, and will not be further elaborated here. Each module in the mesh-network-based energy-saving lamp neighbor relationship self-discovery and control device can be implemented in whole or in part via software, hardware, or a combination thereof. Each of these modules can be embedded in or independent of a processor within a computer device in hardware form, or stored in a computer device memory in software form, allowing the processor to invoke and execute the corresponding operations of each module.
[0168] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first sensing event, the second sensing event, the third sensing event, the registration interrupt processing flow, the current sensing event occurrence information, the first database, the second database, the adjacent judgment information and the event occurrence information. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it realizes a method for self-discovery and control of adjacent relationships of energy-saving lamps based on Mesh networking.
[0169] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0170] When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered. The first sensing event and the second sensing event have different corresponding registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the adjacent relationship of the energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps.
[0171] When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, lighting control is performed;
[0172] When entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated and recorded in the database corresponding to the current sensing event, with a first database corresponding to the first sensing event and a second database corresponding to the second sensing event;
[0173] querying a database corresponding to another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database;
[0174] According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0176] When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered. The first sensing event and the second sensing event have different corresponding registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the adjacent relationship of the energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps.
[0177] When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, lighting control is performed;
[0178] When entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated and recorded in the database corresponding to the current sensing event, with a first database corresponding to the first sensing event and a second database corresponding to the second sensing event;
[0179] querying a database corresponding to another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database;
[0180] According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or another sensing event meets the preset adjacent relationship condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0181] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0182] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0183] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking, characterized in that: The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking includes: When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to simultaneously enter the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered. The first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the neighbor relationship of the energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps. When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, lighting control is performed; When entering the registration self-discovery interrupt processing flow, generating current sensing event occurrence information, recording the current sensing event occurrence information in a database corresponding to the current sensing event, having a first database corresponding to the first sensing event and a second database corresponding to the second sensing event; querying a database corresponding to another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database; According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the other sensing event meets the preset adjacent relationship condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
2. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 1, characterized in that: The first sensing event is an event of sensing a human signal, the second sensing event is an event of receiving a human signal sent by another energy-saving lamp, and the third sensing event is an event of receiving a linkage control signal sent by another energy-saving lamp; The determination of whether to synchronously enter the registration light interruption processing flow specifically includes: When responding to the first sensing event, it is determined that the registration and lighting interruption processing flow is synchronously entered; when responding to the second sensing event, it is determined that the registration and lighting interruption processing flow is asynchronously entered; When it is determined that the registration lighting interrupt processing flow is synchronously transferred to or the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, the lighting control is performed, specifically including: When it is determined that the registration lighting interrupt processing flow has been synchronously transferred, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and it is determined whether the current energy-saving lamp has found an adjacent energy-saving lamp. If so, first linkage level control information is generated and sent to the adjacent energy-saving lamp via unicast. If not, second linkage level control information is generated and sent via low-power multicast and non-relay mode. When entering the registration lighting interrupt processing flow corresponding to the third sensing event, the current energy-saving lamp is lit, the current timestamp is recorded in the lighting database, and the linkage level control information sent by other energy-saving lamps is obtained to determine whether the current energy-saving lamp has found the adjacent energy-saving lamp. If so, it is determined whether the linkage level control information sent by the other energy-saving lamps meets the preset sending conditions. If so, the linkage level control information sent by the other energy-saving lamps is adjusted to generate the first linkage level control information, and the first linkage level control information is sent to the adjacent energy-saving lamp via unicast.
3. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 2, characterized in that: When the registration self-discovery interrupt processing flow is entered, current sensing event occurrence information is generated and recorded in a database corresponding to the current sensing event, specifically including: When entering the registration self-discovery interrupt processing process, current sensing event occurrence information is generated according to the first sensing event or the second sensing event, and the current sensing event occurrence information is recorded in the database corresponding to the current sensing event. If the current sensing event is the first sensing event, the current sensing event occurrence information is sent via low-power multicast and non-relay mode, and the current sensing event occurrence information includes the energy-saving lamp network address and timestamp information.
4. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 2, characterized in that: If the judgment is yes, adjusting the linkage level control information sent by the other energy-saving lamps to generate first linkage level control information, and sending the first linkage level control information to the adjacent energy-saving lamps via unicast, specifically includes: If the answer is yes, the order of adjacent energy-saving lamps found is obtained; Based on a preset adjustment rule, adjusting the linkage level control information sent by the other energy-saving lamps to generate at least one first linkage level control information; Based on the order in which the adjacent energy-saving lamps have been found, the first linkage level control information is sequentially sent to the corresponding adjacent energy-saving lamps in a unicast manner.
5. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 1, characterized in that: The query corresponds to a database of another sensing event, and if it is determined that there is another sensing event, extracting adjacent judgment information from the first database and the second database, specifically including: A database corresponding to another sensing event is queried. If it is determined that another sensing event occurs within a preset sensing period, adjacent judgment information is extracted from the first database and the second database. The adjacent judgment information corresponding to the first database includes the current energy-saving lamp sensing information, and the adjacent judgment information corresponding to the second database includes the sensing trigger information of other energy-saving lamps.
6. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 2, characterized in that: When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is entered, and it is determined whether to synchronously enter the registration light interrupt processing flow. When responding to the third sensing event, the corresponding registration light interrupt processing flow is entered, specifically including: When responding to the first sensing event or the second sensing event, it enters the corresponding registered self-discovery interrupt processing flow, and determines whether to synchronously enter the registered light-on interrupt processing flow. When responding to the third sensing event, it enters the corresponding registered light-on interrupt processing flow. When responding to the fourth sensing event, it enters the corresponding registered clock interrupt processing flow. The fourth sensing event is the second interrupt event of the system clock. The registered clock interrupt processing flow is used to control the shutdown of the energy-saving lamp. When responding to the fourth sensing event, the light-off judgment information is obtained from the light-on database to determine whether the light-off judgment information meets the preset light-off condition. If the judgment is yes, the energy-saving lamp is controlled to be turned off.
7. The method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking according to claim 1, characterized in that: The step of determining, based on the adjacent judgment information, whether the energy-saving lamp corresponding to the current sensing event or the other sensing event satisfies a preset adjacent relationship condition, and if so, using the corresponding energy-saving lamp as an adjacent energy-saving lamp, specifically includes: Determining, based on the neighbor determination information, whether the energy-saving lamp corresponding to the current sensing event or the other sensing event satisfies a preset neighbor relationship condition; if so, determining whether the current energy-saving lamp has found a preset maximum number of neighboring energy-saving lamps; if so, comparing the neighbor determination information of the current energy-saving lamp with the neighbor determination information of the found neighboring energy-saving lamps, and determining the neighboring energy-saving lamps based on the comparison result; If the judgment result is no, the energy-saving lamp corresponding to the current sensing event or the other sensing event is taken as an adjacent energy-saving lamp.
8. A Mesh networking-based energy-saving lamp neighbor relationship self-discovery and control device, characterized in that: The energy-saving lamp neighbor relationship self-discovery and control device based on Mesh networking includes: an interrupt processing module, configured to, in response to a first sensing event or a second sensing event, enter a corresponding registration self-discovery interrupt processing flow and determine whether to simultaneously enter a registration lighting interrupt processing flow; and, in response to a third sensing event, enter a corresponding registration lighting interrupt processing flow. The first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows. The registration self-discovery interrupt processing flow is used to determine the neighbor relationship of energy-saving lamps, and the registration lighting interrupt processing flow is used to control the lighting of the energy-saving lamps. A lighting control module, configured to perform lighting control when it is determined that the registration lighting interrupt processing flow is synchronously transferred to the registration lighting interrupt processing flow corresponding to the third sensing event; a recording module, configured to generate information about a current sensing event when entering the registration self-discovery interrupt processing flow, and record the information about the current sensing event in a database corresponding to the current sensing event, wherein the first sensing event has a first database, and the second sensing event has a second database; an event query module, configured to query a database corresponding to another sensing event, and if it is determined that there is another sensing event, extract adjacent judgment information from the first database and the second database; The adjacent judgment module is used to judge whether the energy-saving lamp corresponding to the current sensing event or the other sensing event meets the preset adjacent relationship condition based on the adjacent judgment information, and if it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking as claimed in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for generating topology relation in wireless ad hoc network and terminal
CN111465074A
Radar radio frequency induction lamp-based intra-group synchronization and grouping linkage system and method
CN114302544A