Energy-saving lamp adjacent relation self-discovery and control method and device based on Mesh networking
By using Mesh networking technology to automatically detect adjacent relationships and realize light control in energy-saving lamps in underground parking lots, the problems of difficulty and cost of linkage control in the existing technology are solved, and the use effect and user experience of energy-saving lamps are improved .
Patent Information
- Application Number
- CN202411016365.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-27
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-27
AI Technical Summary
When implementing linkage control of existing underground parking lot energy-saving lights, it requires a lot of manpower investment, which makes it difficult to implement, costly, and poor use effect, making it difficult to promote.
The adjacent relationship self-discovery and control method of energy-saving lamps based on Mesh network is adopted. Through induction events and Bluetooth Mesh network communication, the adjacent relationship is automatically detected and the lighting control is realized, reducing debugging needs and improving linkage effect.
Automatic linkage control of energy-saving lights in parking lots has been realized, which has reduced implementation costs, improved user experience, and promoted the transformation of energy-saving and low-carbon.
Smart Images

Figure CN119071979A_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 relations 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, and can achieve linkage control between energy-saving lamps. The energy-saving lamps in front of the lane can be lit in advance, which has better energy-saving effects and user perception than the first type of energy-saving lamps.
[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, after the installation of the networkable induction energy-saving lamps, if a better linkage effect is to be achieved, a large amount of manpower is required to solve the above problems, otherwise the use effect of the networkable energy-saving lamps is similar to that of energy-saving lamps that cannot be controlled in linkage. It can be seen that the difficulty and high investment in achieving linkage effects for networkable energy-saving lamps in the relevant technology are obvious pain points in the promotion and use of such energy-saving lamps. Summary of the invention
[0006] In order to enable the energy-saving lamps in parking lots to automatically achieve highly accurate linkage control without too much 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 objective of the present application is achieved through the following technical solutions: A method for self-discovering and controlling neighbor relations of energy-saving lamps based on Mesh networking, the method comprising: When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is transferred to, and it is determined whether to synchronously transfer to the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is transferred to. 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 adjacent relationship of energy-saving lamps, and the registration lighting interrupt processing flow is used for lighting control of 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 having 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 neighbor judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the 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.
[0008] 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 is a person or a car 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 flow, that is, the registered interrupt processing flow corresponding to the first sensing event and the second sensing event is different. For example, when the current is the first sensing event, the subsequent interrupt processing flow 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 energy-saving lamps in the parking lot 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 the brightness, thereby improving the energy-saving effect of the energy-saving lamp.
[0009] In a preferred example, the present application can 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 other energy-saving lamps, and the third sensing event is an event of receiving a linkage control signal sent by other energy-saving lamps; the determination of whether to synchronously enter the registration lighting interrupt processing flow specifically includes: When responding to the first sensing event, it is determined that the registration and lighting interruption processing flow is synchronously transferred, and when responding to the second sensing event, it is determined that the registration and lighting interruption processing flow is not synchronously transferred; When it is determined that the registration lighting interruption processing flow is synchronously transferred to or the registration lighting interruption processing flow corresponding to the third sensing event is transferred to, lighting control is performed, specifically including: 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 an 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 in a unicast manner. If it is determined to be no, the second linkage level control information is generated, and the second linkage level control information is sent in a low-power multicast and non-relay manner. 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 an 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.
[0010] By adopting the above technical solution, the first sensing event is defined as the event that the energy-saving lamp in the current parking lot senses a human signal, and the second sensing event is defined as the event that the energy-saving lamp in the current parking lot receives a human signal sent by other energy-saving lamps. If the current sensing event is the first sensing event, that is, the event that the energy-saving lamp in the current parking lot senses a human signal, and the current energy-saving lamp has not found an adjacent energy-saving lamp, the second linkage level control information will be sent out by broadcasting, so that when the energy-saving lamps in the nearby parking lot receive the event information, they can be lit even if they are not adjacent, thereby realizing linkage control in the initial installation of energy-saving lamps that have not found an adjacent relationship. If the registration lighting interrupt processing flow corresponding to the third sensing event is transferred to, it means that the linkage level control information sent by other energy-saving lamps is received. Therefore, according to the linkage level control information sent by other energy-saving lamps, it is determined whether to send it to the adjacent energy-saving lamps by unicast, so as to realize automatic communication of all energy-saving lamps in the parking lot and automatically discover adjacent relationships, so that the energy-saving lamps in the parking lot can automatically achieve high-accuracy linkage control without too much debugging, thereby reducing the implementation cost and improving the user's perception effect, facilitating the promotion and use of energy-saving lamps in underground parking lot scenes, and promoting the energy-saving and low-carbon transformation of parking lots.
[0011] In a preferred example, the present application can be further configured as follows: when entering the registration self-discovery interrupt processing flow, 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: When entering the registered self-discovery interrupt processing flow, the 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.
[0012] By adopting the above technical solution, no matter it is the first sensing event or the second sensing event, when the event triggers a response, the relevant information of the event that triggers the response is recorded, including the timestamp of the trigger response. The timestamp information enables the calculation of the time difference between different sensing events, thereby serving as an important basis for determining whether the energy-saving lamps in the parking lot have a neighboring relationship. The energy-saving lamp network address is used to determine the specific reference of the energy-saving lamp in the parking lot that sends the event of sensing a human signal. Therefore, the current sensing event occurrence information 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.
[0013] In a preferred example, the present application can be further configured as follows: if the judgment is yes, then adjusting the linkage level control information sent by the other energy-saving lamps, generating the 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 lamps in a unicast manner, specifically including: If the answer is yes, the order of the adjacent energy-saving lamps found is obtained; Based on a preset adjustment rule, the linkage level control information sent by the other energy-saving lamps is adjusted decrementally 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 and the current sensing event occurrence information are sequentially sent to the corresponding adjacent energy-saving lamps in a unicast manner.
[0014] By adopting the above technical scheme, 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 the 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 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 first pass the adjacent energy-saving lamp in front 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, sending the first linkage level control information for adjusting the brightness of the adjacent energy-saving lamp that has been found in the order in which the adjacent energy-saving lamps have been found can achieve the effect of decreasing the brightness of the energy-saving lamps from near to far, thereby further improving the energy-saving effect of the energy-saving lamps.
[0015] In a preferred example, the present application may be further configured as follows: the querying of a database corresponding to another sensing event, 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 there is another sensing event 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 other energy-saving lamp sensing trigger information.
[0016] 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 cycle. For example, after the event that the current parking lot energy-saving lamp senses the movement of a person or a car occurs, it is necessary to determine whether an event of receiving information indicating that other parking lot energy-saving lamps sense the movement of a person or a car occurs, that is, the person or the car passes by other parking lot energy-saving lamps that send event information within the preset sensing cycle before passing by the current parking lot energy-saving lamp, and the preset sensing cycle is determined according to the average speed of the person or the car when moving. Therefore, only when both events occur within the preset sensing cycle can the adjacent relationship of the parking lot energy-saving lamps be determined. Otherwise, if the time difference between the occurrence of the two events exceeds the preset sensing cycle, it means that the parking lot energy-saving lamps that send information indicating that other parking lot energy-saving lamps sense the movement of a person or a car are not adjacent. Therefore, by querying another sensing event database within the preset sensing cycle, the accuracy of the adjacent relationship judgment is improved.
[0017] 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 synchronously enter the registration lighting interrupt processing flow; when responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered, specifically including: When responding to the first sensing event or the second sensing event, the corresponding registered self-discovery interrupt processing flow is entered, and it is determined whether to synchronously enter the registered lighting interrupt processing flow. When responding to the third sensing event, the corresponding registered lighting interrupt processing flow is entered. When responding to the fourth sensing event, the corresponding registered clock interrupt processing flow is entered. 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 lighting 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.
[0018] By adopting the above technical scheme, 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.
[0019] In a preferred example, the present application can be further configured as follows: judging whether the energy-saving lamp corresponding to the current sensing event or the other sensing event satisfies a preset adjacent relationship condition according to the adjacent judgment information, and if it is judged to be satisfied, taking the corresponding energy-saving lamp as an adjacent energy-saving lamp, specifically including: According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the another sensing event meets the preset adjacent relationship condition; if it is judged to be yes, it is judged whether the current energy-saving lamp finds a preset maximum number of adjacent energy-saving lamps; if it is judged to be yes, the adjacent judgment information of the current energy-saving lamp is compared with the adjacent judgment information of the found adjacent energy-saving lamps, and the adjacent energy-saving lamps are determined according to the comparison result; If the judgment 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.
[0020] By adopting the above technical scheme, 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 the human signal, including the number of times the energy-saving lamp in the current parking lot senses the human, and 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 other parking lots senses the human signal, including the number of times the energy-saving lamp in other parking lots senses the human signal. In this way, by calculating the number of times the energy-saving lamp in the current parking lot senses the human and the number of times the energy-saving lamp in other parking lots senses the human signal, as well as the ratio, and comparing them with the adjacent threshold in the preset adjacent relationship condition, it is possible to filter out the energy-saving lamps in nearby non-adjacent parking lots that are occasionally falsely triggered because different people and vehicles simultaneously trigger the sensing human signal, reduce the probability of identifying non-adjacent lamps as adjacent lamps, and ensure the accuracy of adjacent relationship discovery.
[0021] In the second aspect, the above invention objective of the present application is achieved through the following technical solutions: A Mesh-based energy-saving lamp neighbor relationship self-discovery and control device, the Mesh-based energy-saving lamp neighbor relationship self-discovery and control device comprising: An interrupt processing module, for, when responding to a first sensing event or a second sensing event, entering a corresponding registration self-discovery interrupt processing flow, and determining whether to synchronously enter a registration lighting interrupt processing flow, and when responding to a third sensing event, entering a corresponding registration lighting interrupt processing flow, wherein the first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows, the registration self-discovery interrupt processing flows are used to determine the neighbor relationship of energy-saving lamps, and the registration lighting interrupt processing flows are used to control the lighting of energy-saving lamps; A lighting control module, used for performing 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, used for generating current sensing event occurrence information when entering the registration self-discovery interrupt processing flow, and recording the current sensing event occurrence information 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, used for 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; 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 according to 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.
[0022] In the third aspect, the above invention objective of the present application is achieved through the following technical solutions: A computer device comprises 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-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking are implemented.
[0023] In a fourth aspect, the above-mentioned invention objective of the present application is achieved through the following technical solutions: 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-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking.
[0024] In summary, the present application includes at least one of the following beneficial technical effects: 1. Only when both the first sensing event and the second sensing event occur can it be determined whether the energy-saving lamps in the parking lot are adjacent, that is, only when the energy-saving lamp in the current parking lot senses the movement of a person or a car; 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 energy-saving lamp in the current parking lot senses the movement of a person or a car, the lamp is controlled to light up, and the brightness of the adjacent energy-saving lamps is controlled to gradually decrease, thereby improving the energy-saving effect of the energy-saving lamp; 2. According to the linkage level control information sent by other energy-saving lamps, it is determined whether to send it to adjacent energy-saving lamps through unicast, so as to realize automatic communication of all energy-saving lamps in the parking lot and automatically discover the adjacent relationship, so that the energy-saving lamps in the parking lot can automatically achieve high-accuracy linkage control without too much debugging, thereby reducing the implementation cost and improving the user's perception effect, facilitating the promotion and use of energy-saving lamps in underground parking lots, and promoting the energy-saving and low-carbon transformation of parking lots; 3. Timestamp information enables calculation of the time difference between different sensing events, thus serving as an important basis for determining whether the energy-saving lamps in the parking lot are adjacent to each other. 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 human signal. 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
[0025] Figure 1This is a first implementation flow chart of a method for self-discovering and controlling neighbor relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 2 This is a second implementation flow chart of the method for self-discovery and control of neighboring relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 3 It is a flow chart of S30 of the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 4 It is a flowchart of S22 of the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 5 It is a flow chart of S40 of the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 6 This is a third implementation flow chart of the method for self-discovery and control of neighboring relationships of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 7 It is a flow chart of S50 of the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking in an embodiment of the present application; Figure 8 It is a principle block diagram of a device for self-discovering and controlling neighbor relations of energy-saving lamps based on Mesh networking in an embodiment of the present application; Fig. 9 It is a diagram of the internal structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following is combined with Figure 1-9 This application is described in further detail.
[0027] In one embodiment, if Figure 1 As shown, the present application discloses a method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking, which specifically includes the following steps: 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. 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.
[0028] In this embodiment, the self-discovery and control method of neighbor relationship of energy-saving lamps based on Mesh networking is applied to parking lot energy-saving lamps. The parking lot energy-saving lamps have the functions of brightness adjustment, sensing and networking communication based on Bluetooth Mesh. Bluetooth Mesh networking is a wireless network structure designed based on Bluetooth Low Energy (BLE) technology. It allows many Bluetooth devices to form many-to-many connections and communications, thereby creating a self-organizing network that can be expanded to a large area and accommodate thousands of nodes. In the Bluetooth Mesh network, each device can be a sender or receiver of messages, or even a relay node for the propagation of messages in the network. In this way, even if there is no direct radio communication link between two devices, the message can be relayed by other devices in the network to ensure the reliable propagation of information in the entire network. In addition, in this embodiment, the address length in the Bluetooth Mesh network is 16 bits. The unicast address is used to uniquely identify the element address of the node in the network (the parking lot energy-saving lamp in this embodiment has a unicast address), and the multicast address is used to represent the group address in the network. The group address can be shared by one or more nodes. The broadcast address (0xFFFF) used in this embodiment is a type of multicast address, which is shared by all nodes. The sensing function of the parking lot energy-saving lamp is realized through infrared sensing / microwave sensing.
[0029] When several parking lot energy-saving lamps determine their adjacent relationship, a linkage control relationship will be formed, that is, a group of parking lot energy-saving lamps that form an adjacent relationship can perform related synchronous operations (such as turning on and off the lights / brightness adjustment).
[0030] In this embodiment, the first sensing event refers to any one of the events that the parking lot energy-saving lamp generates a signal sensing a person or a car or the event that the parking lot energy-saving lamp receives a signal sensing a person or a car sent by other parking lot energy-saving lamps, the second sensing event refers to the other of the events that the parking lot energy-saving lamp generates a signal sensing a person or a car or the event that the parking lot energy-saving lamp receives a signal sensing a person or a car sent by other parking lot energy-saving lamps, and the third sensing event refers to the event that the parking lot energy-saving lamp receives a linkage control signal sent by other parking lot energy-saving lamps. The registered interrupt processing flow refers to the interrupt processing function implemented by the interrupt service routine (ISR, Interrupt Service Routine). The interrupt service routine 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, wherein the first sensing event and the second sensing event correspond to the registered self-discovery interrupt processing flow, and the third sensing event corresponds to the registered light-on interrupt processing flow. The registered interrupt processing flows corresponding to the first sensing event and the second sensing event are different. For example, when the current is the first sensing event, the subsequent interrupt processing flow is to determine whether there is a second sensing event.
[0031] 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 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, 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 parking lot energy-saving lamp receives a signal event or 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, the corresponding registered lighting interrupt processing flow is entered, and the registered lighting interrupt processing flow is used for the lighting control of the energy-saving lamp.
[0032] S20: When it is determined that the registration lighting interruption processing flow is synchronously transferred to or the registration lighting interruption processing flow corresponding to the third sensing event is transferred to, lighting control is performed.
[0033] 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 there is currently a person or a car 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 of 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 other energy-saving lamps that sense a person or a car are not adjacent to the current energy-saving lamp, and cannot receive the signal 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 people or cars before, and the current energy-saving lamp has received the linkage control signal 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 signal sent by other parking lot energy-saving lamps.
[0034] It should be noted that the registration light interrupt processing flow and the registration self-discovery interrupt processing flow are independent of each other, that is, the registration light interrupt processing flow and the registration self-discovery interrupt processing flow can be carried out simultaneously. For example, when the current sensing event sent is an event in which the parking lot energy-saving lamp generates a signal that senses a person or a car, it will enter the registration self-discovery interrupt processing flow corresponding to the event, and synchronously enter the registration light interrupt processing flow corresponding to the event.
[0035] S30: 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. There is a first database corresponding to the first sensing event and a second database corresponding to the second sensing event.
[0036] In this embodiment, the current sensing event occurrence information refers to relevant information of the sensing event currently occurring.
[0037] Specifically, when entering the registered self-discovery interrupt processing flow, the registered 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 of the event corresponding to the parking lot energy-saving lamp generating the sensing signal of a person or a car includes the timestamp of this event, the current sensing event occurrence information of the event corresponding to the parking lot energy-saving lamp receiving the sensing signal of 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 sent the signal. In this embodiment, when the energy-saving lamp does not find the adjacent relationship, because each parking lot energy-saving lamp sends a signal (report The broadcast address (0xFFFF) is used for sending when the information is received (text), and the transmission mode 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, the non-relay mode is used for sending, which can ensure that the information will not be relayed, so that the energy-saving lamps in the parking lot outside the radius of 10 meters cannot receive the information, thereby limiting the 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 the Mesh address of the parking lot energy-saving lamp will be associated with each recorded timestamp.
[0038] 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.
[0039] In this embodiment, the neighbor determination information refers to information used to determine whether a neighbor relationship is established.
[0040] 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 one after another 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 condition that there is another sensing event in the database corresponding to the other sensing event, it means that the conditions for the establishment of a preliminary adjacent relationship are met, and 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.
[0041] In this embodiment, the second database records the relevant information of 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 sends the signal, and each time the current parking lot energy-saving lamp receives a certain parking lot energy-saving lamp, the parking lot energy-saving lamp is recorded as a triggering number, and the second database counts the triggering number of each other parking lot energy-saving lamp; the first database is used to record the relevant information of each time the current parking lot energy-saving lamp senses a person or a car, including the timestamp of each time the person or the car is sensed, and when the current parking lot energy-saving lamp queries the database of the second sensing event after responding to the first sensing event and determines that there is a second sensing event that meets the query condition, and when the current parking lot energy-saving lamp queries the database of the first sensing event after responding to the second sensing event and determines that there is a first sensing event that meets the query condition, it is recorded as a hit number in the first database, that is, the trigger number indicates the number of times the current parking lot energy-saving lamp receives other parking lot energy-saving lamps, and the hit number indicates the number of times the current parking lot energy-saving lamp senses a person or a car and receives other parking lot energy-saving lamps under certain query conditions (for example, within 5 seconds); Therefore, for example, if the second database of the second sensing event is queried after the current parking lot energy-saving lamp responds to the first sensing event, the set condition may be whether there is a second sensing event within 5 seconds before the current first sensing event occurs. If it is determined to be yes, the most recent second sensing event within 5 seconds before the current first sensing event occurs is determined (because the current parking lot energy-saving lamp may receive signals from multiple other 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 is, the closer the interval between the first sensing event and the second sensing event is, 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), extract the Mesh address corresponding to the most recent second sensing event and the triggering number of the parking lot energy-saving lamp corresponding to the address, then record the hitting number of the parking lot energy-saving lamp corresponding to the address plus one in the first database, and then extract the hitting number of the parking lot energy-saving lamp corresponding to the address. The adjacent judgment information includes the triggering number and the hitting number. When 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 condition can be set for 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.
[0042] S50: judging whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies a preset adjacent relationship condition according to the adjacent judgment information; if so, taking the corresponding energy-saving lamp as an adjacent energy-saving lamp.
[0043] 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 corresponding Mesh addresses of the suspected adjacent parking lot energy-saving lamps. Therefore, it is determined whether the energy-saving lamps corresponding to the current sensing event or another sensing event meet the preset adjacent relationship conditions. If it is determined that the energy-saving lamps corresponding to the current sensing event or another sensing event meet the preset adjacent relationship conditions, the corresponding energy-saving lamps are used as adjacent energy-saving lamps. If it is determined that the energy-saving lamps corresponding to the current sensing event or another sensing event do not meet the preset adjacent relationship conditions, it is determined that the currently suspected adjacent parking lot energy-saving lamps are not yet the confirmed adjacent parking lot energy-saving lamps, and the current registration interrupt processing process ends, and the current parking lot energy-saving lamps continue to wait for a response to the first sensing event or the second sensing event.
[0044] For example, the step of determining whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies the preset neighbor relationship condition includes the following steps: 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 judging that 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 occasionally 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 it is judged as no, it is judged that the currently suspected adjacent parking lot energy-saving lamp is not yet a confirmed adjacent parking lot energy-saving lamp, then the current registration interrupt processing flow 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. If it is judged as yes, proceed to step 2; 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 it is judged as no, go to step 3. If it is judged as yes, go to step 7. Step 3: Whether the number of the found adjacent parking lot energy-saving lamp sets is 4, if it is judged to be yes, go to step 4, if it is judged to be no, go to step 6; Step 4: extract the minimum ratio of the calculated hit count and the 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 the trigger count ratio is ≥ the minimum ratio. If it is determined to be yes, proceed to step 5. If it is determined to be 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, and the current parking lot energy-saving lamp continues to wait for a response to the first sensing event or the second sensing event. Step 5: Delete the adjacent parking lot energy-saving lamps corresponding to the minimum ratio, because the parking lot energy-saving lamps with higher hit ratios (that is, more obvious adjacent characteristics) are currently found; Step 6: Add the parking lot energy-saving lamp corresponding to the ratio of the current calculated hit count to the trigger count to the adjacent parking lot energy-saving lamp set, and record it as the adjacent parking lot energy-saving lamp; 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.
[0045] In one embodiment, if Figure 2As shown, 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 other energy-saving lamps, and the third sensing event is an 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: S11: when responding to the first sensing event, determining whether to synchronously enter the registration and lighting interruption processing flow, and when responding to the second sensing event, determining whether to asynchronously enter the registration and lighting interruption processing flow.
[0046] 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 light interrupt processing flow. When responding to the second sensing event, it is determined that it is not necessary to synchronously enter the registration light interrupt processing flow.
[0047] In step S20, when it is determined that the registration lighting interruption processing flow is synchronously transferred to or the registration lighting interruption processing flow corresponding to the third sensing event is transferred to, lighting control is performed, specifically including: 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.
[0048] Specifically, when it is determined that the synchronization is transferred to the registration lighting interrupt processing flow in response to the first sensing event, based on the corresponding registration lighting interrupt processing flow, the current energy-saving lamp is first lit, and the current timestamp is recorded in the lighting database. In addition, it is necessary to determine 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, and 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 broadcasting 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 by unicast; 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 and notifying the surrounding energy-saving lamps, and the second linkage level control information is sent by low-power multicast and non-relay mode, 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 turn on.
[0049] It should be noted that the first linkage level control information and the second linkage level control information are in the same form, but the broadcasting methods of the first linkage level control information and the second linkage level control information are different.
[0050] 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.
[0051] 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 broadcasting 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 lamp determined to be adjacent, and the first linkage level control information is sent to the adjacent energy-saving lamps via unicast.
[0052] It can be understood that no matter other energy-saving lamps receive the first linkage level control information or the second linkage level control information, other energy-saving lamps will respond to the third sensing event.
[0053] For example, the steps to register the light-on interrupt processing flow are as follows: Step 01: In response to the first sensing event or the third sensing event, enter the corresponding registration lighting interrupt processing flow; Step 02: Determine whether it is the first sensing event, if yes, proceed to step 08, otherwise proceed to step 03; Step 03: Determine whether it is the third sensing event, if yes, proceed to step 04, otherwise return to step 01 and continue to wait for the interrupt event; Step 04: Obtain 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); Step 05: Set the brightness of the energy-saving lamp to 100*q / p, and record the current time as the timestamp of the last time the lamp was turned on in the lamp database. In this step, the brightness is set to 100*q / p, which can achieve the effect of the brightness changing from bright to dark as the distance from the energy-saving lamp that senses the presence of people (i.e. the energy-saving lamp on the top of the moving vehicle) changes from near to far; Step 06: Determine whether the current energy-saving lamp has found an adjacent energy-saving lamp, and determine whether the linkage level control information sent by other energy-saving lamps meets the preset sending conditions. The preset sending conditions include determining whether q is greater than 1. If so, proceed to step 07, otherwise return to step 01 to continue waiting for the interrupt event. The maximum value of p can be set by yourself. In different projects, the scope of linkage control is different. The initial linkage level can be adjusted. It is generally set between 3 and 10. Here, 5 is used as the default value for explanation; 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, set the current linkage level to (q-1), and use unicast to send the first linkage level control information and the current sensing event occurrence information to the adjacent lamps found in sequence. 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 to turn on the light, and there is no need to continue to notify the next level of neighbors to turn on the light in a linkage manner, thus realizing the range control of the linkage control to turn on the light. In this way, the decrement operation of the current linkage level can realize the range control of the linkage control to turn on the light after sensing the human signal; Step 08: Set the brightness of the energy-saving lamp to 100, and record the current time as the timestamp of the last time the lamp was turned on in the lamp database; Step 09: Determine whether the current energy-saving lamp has found at least one adjacent lamp, if so, proceed to step 010, otherwise proceed to step 011; 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 occurrence information to the adjacent lights found in sequence; Step 011: Generate the second linkage level control information, that is, set the initial linkage level and the current linkage level to 1, and use multicast and non-relay methods to send the second linkage level control information and the current sensing event occurrence information to the nearby energy-saving lamps. In this step, when the energy-saving lamps are just installed at the beginning of the project and the adjacent relationship between the energy-saving lamps has not yet been learned, in order to ensure the basic lighting effect, through this step, the energy-saving lamps that sense the vehicle will control the lighting of the energy-saving lamps around themselves in a linkage manner. 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.
[0054] In one embodiment, if Figure 3 As shown, in step S30, when entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated, and the current sensing event occurrence information is recorded in the database corresponding to the current sensing event, specifically including: S31: When entering the registration self-discovery interrupt processing flow, the 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. The current sensing event occurrence information includes the energy-saving lamp network address and timestamp information.
[0055] Specifically, when entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated according to the first sensing event or the second sensing event, wherein if it is a 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 senses a human signal; if it is a 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 receives the human signal sent by other energy-saving lamps, and the Mesh address of the parking lot energy-saving lamp that sends the signal; the current sensing event occurrence information is then recorded in 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 via low-power multicast and non-relay mode.
[0056] 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. The second linkage level control information is sent by low-power multicast and non-relay methods. When the current energy-saving lamp finds the adjacent relationship, the current sensing event occurrence information is sent by low-power multicast and non-relay methods, and the first linkage level control information is sent to the adjacent energy-saving lamp by unicast. In other words, regardless of whether the current energy-saving lamp finds the adjacent relationship, the current sensing event occurrence information is sent by low-power multicast and non-relay methods, so that the current energy-saving lamp always maintains a 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).
[0057] In one embodiment, if Figure 4 As shown, in step S22, if the judgment is yes, then adjusting the linkage level control information sent by the other energy-saving lamps, generating first linkage level control information, and sending the first linkage level control information to the adjacent energy-saving lamps in a unicast manner, specifically including: S221: If the answer is yes, the order of the found adjacent energy-saving lamps is obtained.
[0058] 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 adjacent energy-saving lamps 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 there is 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.
[0059] 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.
[0060] 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, so as to generate at least one first linkage level control information corresponding to the order of the current energy-saving lamps.
[0061] 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 in sequence.
[0062] 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.
[0063] In one embodiment, if Figure 5 As shown, in step S40, a database corresponding to another sensing event is queried, and 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: S41: querying a database corresponding to another sensing event. If it is determined that there is another sensing event within a preset sensing period, extracting 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 other energy-saving lamp sensing trigger information.
[0064] In this embodiment, no matter in response 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 as the query condition of the information within the preset sensing period before the current sensing event occurs; Therefore, a database corresponding to another sensing event is queried to determine whether there is another sensing event within a preset sensing period, and if it is determined that there is another sensing event within the preset sensing period, adjacent determination information is extracted from the first database and the second database; For example, if the current sensing event is the first sensing event, then the second database within the preset sensing period is queried whether there is a second sensing event within the preset sensing period before the first sensing event occurs. If it is determined to be yes, the 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, that is, the sensing triggering information of other energy-saving lamps, and the adjacent judgment information is extracted from the first database, including the hitting times, that is, the sensing information of the current energy-saving lamp; If the current sensing event is the second sensing event, then the first database is queried within the preset sensing period whether there is a first sensing event within the preset sensing period before the second sensing event occurs. If the judgment is yes, the adjacent judgment information is extracted from the second database, including the triggering number and corresponding timestamp information of the parking lot energy-saving lamp corresponding to the second sensing event, that is, the sensing triggering information of other energy-saving lamps, and the adjacent judgment information is extracted from the first database, including the hitting number, that is, the current energy-saving lamp sensing information.
[0065] 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 synchronously 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: 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 interrupt processing flow; when responding to the third sensing event, enter the corresponding registered light 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 database, and 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.
[0066] Specifically, after the energy-saving lamp is installed in the parking lot, in order to ensure the energy-saving effect of the energy-saving lamp, the energy-saving lamp needs to have the function of automatic shutdown. Therefore, in addition to responding to the first sensing event, the second sensing event and the third sensing event, it will also respond to the fourth sensing event. When responding to the fourth sensing event, it will enter the corresponding registration clock interrupt processing flow. The fourth sensing event is the second interrupt event of the system clock. The registration clock interrupt processing flow is used to control the shutdown of the energy-saving lamp. For example, when the energy-saving lamp is turned on, the timing will start synchronously to determine the lighting duration of the energy-saving lamp. When the energy-saving lamp does not sense the passing of a person or a car within a certain period of time or does not receive a signal sent by other energy-saving lamps indicating that a person or a car has passed, the fourth sensing event is triggered. At this time, in response to the fourth sensing event, the light-off judgment information is obtained from the lighting database. The light-off judgment information is the lighting duration of the energy-saving lamp when it was last turned on. When the light-off judgment information meets the preset light-off condition, that is, when the lighting duration of the energy-saving lamp when it was last turned on reaches the preset light-off duration (for example, 10 seconds), the energy-saving lamp can be turned off, thereby further improving the energy-saving effect of the energy-saving lamp.
[0067] In one embodiment, if Figure 7 As shown, in step S50, 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 an adjacent energy-saving lamp, which specifically includes: 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.
[0068] Specifically, according to the neighbor judgment information, in the neighbor judgment information, the neighbor 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 the signal of a person, including the number of times the energy-saving lamp in the current parking lot senses a person, and the neighbor judgment information corresponding to the second database includes other energy-saving lamp sensing trigger information, that is, the relevant information of the event that other parking lot energy-saving lamps send sensing signals, including the number of times other parking lot energy-saving lamps send sensing signals, thereby calculating the ratio of the number of times the energy-saving lamp in the current parking lot senses a person to the number of times the energy-saving lamps in the other parking lots sense the signal of a person, 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, the preset maximum number is 4, then 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 sent by other energy-saving lamps in the parking lot is determined as the adjacent energy-saving lamp.
[0069] S52: If the judgment is no, the energy-saving lamp corresponding to the current sensing event or another sensing event is used as an adjacent energy-saving lamp.
[0070] Specifically, if the judgment is no, that is, the current energy-saving lamp has not found 4 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.
[0071] S53: judging whether the energy-saving lamp corresponding to the current sensing event or another sensing event satisfies the adjacent judgment condition according to the adjacent judgment information; if it is judged to be satisfied, the corresponding energy-saving lamp is regarded as the adjacent energy-saving lamp.
[0072] Specifically, 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 adjacent judgment condition. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0073] 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 the present application.
[0074] In one embodiment, a Mesh-based energy-saving lamp neighbor relationship self-discovery and control device is provided, and the Mesh-based energy-saving lamp neighbor relationship self-discovery and control device corresponds to the Mesh-based energy-saving lamp neighbor relationship self-discovery and control method 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 detailed description of each functional module is as follows: An interrupt processing module, which is used to enter the corresponding registration self-discovery interrupt processing flow when responding to the first sensing event or the second sensing event, and determine whether to simultaneously enter the registration lighting interrupt processing flow, and enter the corresponding registration lighting interrupt processing flow when responding to the third sensing event. 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; A lighting control module, used for controlling lighting 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, used for generating information about the occurrence of a current sensing event when entering the registration self-discovery interrupt processing flow, and recording 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; An event query module, used 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 another sensing event meets the preset adjacent relationship condition according to the adjacent judgment information. If it is judged to be satisfied, the corresponding energy-saving lamp is used as the adjacent energy-saving lamp.
[0075] Optionally, 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 other energy-saving lamps, and the third sensing event is an event of receiving a linkage control signal sent by other energy-saving lamps; The interrupt handling module includes: The light-on transition judgment submodule is used to judge whether to synchronously transition to the registration light-on interrupt processing flow in response to the first sensing event, and to judge whether to asynchronously transition to the registration light-on interrupt processing flow in response to the second sensing event; The lighting control module includes: The first lighting control submodule is used to light up the current energy-saving lamp when it is determined that the registration lighting interrupt processing flow is synchronously transferred, record the current timestamp in the lighting database, and determine whether the current energy-saving lamp has found an adjacent energy-saving lamp. If it is determined to be yes, generate first linkage level control information, and send the first linkage level control information to the adjacent energy-saving lamp in a unicast manner; if it is determined to be no, generate second linkage level control information, and send the second linkage level control information in a low-power multicast and non-relay manner; The second lighting control submodule is used to light up the current energy-saving lamp when entering the registration lighting interrupt processing flow corresponding to the third sensing event, record the current timestamp in the lighting database, and obtain the linkage level control information sent by other energy-saving lamps, and determine whether the current energy-saving lamp has found the adjacent energy-saving lamp. If so, determine whether the linkage level control information sent by other energy-saving lamps meets the preset sending conditions. If so, adjust the linkage level control information sent by other energy-saving lamps, generate the first linkage level control information, and send the first linkage level control information to the adjacent energy-saving lamps via unicast.
[0076] Optionally, the recording module includes: The event generation submodule is used to generate the current sensing event occurrence information according to the first sensing event or the second sensing event when entering the registration self-discovery interrupt processing flow, and record the current sensing event occurrence information 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 through low-power multicast and non-relay mode, and the current sensing event occurrence information includes the energy-saving lamp network address and timestamp information.
[0077] Optionally, the second lighting control submodule includes: A sequence extraction unit, for obtaining the sequence of adjacent energy-saving lamps found if the judgment is yes; A decreasing adjustment unit, used for decreasingly adjusting the linkage level control information sent by other energy-saving lamps in sequence based on the order in which the adjacent energy-saving lamps have been found, to generate at least one first linkage level control information; The sending unit is used to send the first linkage level control information to the corresponding adjacent energy-saving lamps in a unicast manner.
[0078] Optionally, the event query module includes: The event query submodule is used to query the database corresponding to another sensing event. 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. 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 other energy-saving lamp sensing trigger information.
[0079] Optionally, the interrupt processing module also includes: The clock interrupt processing submodule is used to, 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, and 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.
[0080] Optionally, the adjacent judgment module includes: A first judgment submodule 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 according to the adjacent judgment information, and if it is judged to be yes, judge whether the current energy-saving lamp finds a preset maximum number of adjacent energy-saving lamps, and if it is judged to be 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 according to the comparison result; The second judgment submodule is used to, if the judgment result is no, take the energy-saving lamp corresponding to the current sensing event or another sensing event as the adjacent energy-saving lamp.
[0081] For the specific definition of the energy-saving lamp neighbor relationship self-discovery and control device based on Mesh networking, please refer to the definition of the energy-saving lamp neighbor relationship self-discovery and control method based on Mesh networking above, which will not be repeated here. Each module in the above-mentioned energy-saving lamp neighbor relationship self-discovery and control device based on Mesh networking can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0082] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, 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 a first sensing event, a second sensing event, a third sensing event, a registration interrupt processing flow, current sensing event occurrence information, a first database, a second database, adjacent judgment information and event occurrence information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for self-discovery and control of adjacent relationships of energy-saving lamps based on Mesh networking is implemented.
[0083] 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, wherein the processor implements the following steps when executing the computer program: When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is transferred to, and it is determined whether to synchronously transfer to the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is transferred to. 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. 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; When entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated, and the current sensing event occurrence information is recorded in a 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; 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 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.
[0084] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: When responding to the first sensing event or the second sensing event, the corresponding registration self-discovery interrupt processing flow is transferred to, and it is determined whether to synchronously transfer to the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is transferred to. 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. 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; When entering the registration self-discovery interrupt processing flow, the current sensing event occurrence information is generated, and the current sensing event occurrence information is recorded in a 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; 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 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.
[0085] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and 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 (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0086] Those skilled in the art can clearly understand that for the convenience and simplicity 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.
[0087] The embodiments described above 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, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking, characterized in that: The energy-saving lamp neighbor relationship self-discovery and control method 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 transferred to, and it is determined whether to synchronously transfer to the registration lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is transferred to. 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 adjacent relationship of energy-saving lamps, and the registration lighting interrupt processing flow is used for lighting control of 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 having 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 neighbor judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the 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.
2. According to the Mesh networking-based energy-saving lamp neighbor relationship self-discovery and control method of claim 1, it is 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 other energy-saving lamps, and the third sensing event is an event of receiving a linkage control signal sent by other energy-saving lamps; 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 transferred, and when responding to the second sensing event, it is determined that the registration and lighting interruption processing flow is not synchronously transferred; When it is determined that the registration lighting interruption processing flow is synchronously transferred to or the registration lighting interruption processing flow corresponding to the third sensing event is transferred to, lighting control is performed, specifically including: 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 an 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 in a unicast manner. If it is determined to be no, the second linkage level control information is generated, and the second linkage level control information is sent in a low-power multicast and non-relay manner. 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 an 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-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking according to claim 2 is characterized in that: When entering the registration self-discovery interrupt processing flow, generating current sensing event occurrence information, and recording the current sensing event occurrence information in a database corresponding to the current sensing event, specifically includes: When entering the registered self-discovery interrupt processing flow, the 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-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking according to claim 2 is 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 in a unicast manner, specifically includes: If the answer is yes, the order of the 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 sent to the corresponding adjacent energy-saving lamps in sequence in a unicast manner.
5. The method for self-discovery and control of neighbor relations 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 there is another sensing event 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 other energy-saving lamp sensing trigger information.
6. The method for self-discovery and control of neighbor relations 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 lighting interrupt processing flow. When responding to the third sensing event, the corresponding registration lighting interrupt processing flow is entered, which specifically includes: When responding to the first sensing event or the second sensing event, the corresponding registered self-discovery interrupt processing flow is entered, and it is determined whether to synchronously enter the registered lighting interrupt processing flow. When responding to the third sensing event, the corresponding registered lighting interrupt processing flow is entered. When responding to the fourth sensing event, the corresponding registered clock interrupt processing flow is entered. 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 lighting 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-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking according to claim 1, characterized in that: The step of judging, according to the neighbor judgment information, whether the energy-saving lamp corresponding to the current sensing event or the another sensing event satisfies a preset neighbor relationship condition, and if so, taking the corresponding energy-saving lamp as a neighbor energy-saving lamp, specifically includes: According to the adjacent judgment information, it is judged whether the energy-saving lamp corresponding to the current sensing event or the another sensing event meets the preset adjacent relationship condition; if it is judged to be yes, it is judged whether the current energy-saving lamp finds a preset maximum number of adjacent energy-saving lamps; if it is judged to be yes, the adjacent judgment information of the current energy-saving lamp is compared with the adjacent judgment information of the found adjacent energy-saving lamps, and the adjacent energy-saving lamps are determined according to the comparison result; If the judgment 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, for, when responding to a first sensing event or a second sensing event, entering a corresponding registration self-discovery interrupt processing flow, and determining whether to synchronously enter a registration lighting interrupt processing flow, and when responding to a third sensing event, entering a corresponding registration lighting interrupt processing flow, wherein the first sensing event and the second sensing event correspond to different registration self-discovery interrupt processing flows, the registration self-discovery interrupt processing flows are used to determine the neighbor relationship of energy-saving lamps, and the registration lighting interrupt processing flows are used to control the lighting of energy-saving lamps; A lighting control module, used for performing 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, used for generating current sensing event occurrence information when entering the registration self-discovery interrupt processing flow, and recording the current sensing event occurrence information 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, used for 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; 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 according to 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, characterized in that: When the processor executes the computer program, the steps of the method for self-discovery and control of neighbor relations of energy-saving lamps based on Mesh networking as described 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-discovery and control of neighbor relations 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
Street lamp node self-recovery method and system based on Mesh network
CN117750409A
Control of traffic flow by sensing traffic states
US20070273552A1
Cited By
Lamp control method based on BLE channel detection
CN120201614A
