A passive lighting switch control method and device based on a WiFi module channel state perception
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳市微著智能有限公司
- Filing Date
- 2026-05-19
- Publication Date
- 2026-08-07
AI Technical Summary
传统楼梯间照明多采用声控或红外感应开关,存在以下问题:一是需要电池供电或外接电源,电池更换频繁且不环保;二是感应存在盲区,人员走到灯下才亮起,体验差;三是各开关独立工作,无法提前点亮上层或下层灯具,造成照明延迟甚至安全隐患
[0016]This invention provides a passive lighting switch control method and device based on WiFi module channel state perception. It utilizes a passive energy harvesting circuit to extract electrical energy from environmental mechanical energy (such as from a pressed switch or stair vibration) to power the WiFi module, eliminating the need for batteries or external power sources, making it environmentally friendly and maintenance-free. By transmitting detection signals through the WiFi module and extracting the channel state information sequence, combined with a dynamic time warping algorithm, it accurately identifies signal disturbance patterns generated by footsteps in the stairwell, reliably determining the direction and speed of movement, avoiding the blind spots of traditional infrared or sound-based sensors. Furthermore, based on the movement... The system predicts the direction and speed at which a person will arrive at the next lighting switch and generates a pre-lighting command. This command is sent to the target switch via a WiFi self-organizing network link, ensuring the target switch lights up before the person arrives, achieving a lighting tracking effect and significantly improving the safety and comfort of stairwell lighting. Furthermore, the self-organizing network requires no central controller or cloud support, allowing for collaborative operation even during network outages. Each switch can independently perform sensing, decision-making, and communication, resulting in high system robustness. Additionally, by having subordinate switches return confirmation signals, the original switch delays its extinguishing, and event data is stored, further reducing energy consumption and providing maintenance records. In summary, this invention represents a significant advancement in passive power supply, precise sensing, predictive collaboration, and self-organizing network communication.
Smart Images

Figure CN122534733A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent lighting control technology, and more specifically, to a passive lighting switch control method and device based on WiFi module channel state perception. Background Technology
[0002] Stairwell lighting is an important aspect of building energy conservation. Traditional stairwell lighting often uses voice-activated or infrared sensor switches, which have the following problems: First, it requires battery power or an external power source, resulting in frequent battery replacements and environmental issues; second, the sensors have blind spots, only turning on when someone walks right up to the light, leading to a poor user experience; and third, each switch operates independently, making it impossible to pre-light the lights on the upper or lower floors, causing lighting delays and even safety hazards.
[0003] While existing wireless smart switches can achieve linkage, they rely on a central controller or cloud platform, fail when the network is down, and have high power consumption, making it difficult to use passive power.
[0004] Therefore, there is an urgent need for a stairwell lighting control solution that requires no wiring or batteries and can predict and activate the lights in advance. Summary of the Invention
[0005] This invention aims to overcome the shortcomings of the prior art and provide a passive lighting switch control method and device based on WiFi module channel status perception. It utilizes environmental mechanical energy for power supply, senses the footstep characteristics of people through WiFi channel status information, predicts the movement trajectory, and lights up the lights in front in advance through an ad hoc network, thereby realizing passive, intelligent, and collaborative control of stairwell lighting.
[0006] In a first aspect, the present invention provides a passive lighting switch control method based on WiFi module channel state awareness, the method comprising: A passive energy harvesting circuit is used to extract electrical energy from the mechanical energy of the environment to provide power for the WiFi module inside the lighting switch. The WiFi module is controlled to continuously transmit detection signals and receive echo signals to extract channel state information sequences. Based on the channel state information sequence, the signal disturbance pattern generated by people's footsteps in the stairwell is identified by the dynamic time warping algorithm, and the movement direction and speed of the people are determined. Based on the direction and speed of movement, predict the location of the next lighting switch that the person will reach and generate a pre-lighting instruction. The pre-lighting command is sent to the slave lighting switch at the next lighting switch location via the self-organizing network link established by the WiFi module, so that the slave lighting switch performs the lighting operation.
[0007] Preferably, the extracted channel state information sequence includes: The amplitude and phase of multiple subcarriers received by the WiFi module are demodulated to obtain the original channel state matrix; The original channel state matrix is subjected to moving average filtering to remove environmental static clutter, resulting in the channel state information sequence.
[0008] Preferably, the step of identifying signal disturbance patterns caused by footsteps in the stairwell based on the channel state information sequence and determining the movement direction and speed of the personnel through a dynamic time warping algorithm includes: A reference channel state information template for typical foot gait is pre-collected, and the reference channel state information template corresponds to the foot impact characteristics of people of different heights and weights in the stairwell; The real-time obtained channel state information sequence is compared with the reference channel state information template to perform dynamic time-normalized distance calculation; When the dynamic time warp distance is less than a preset threshold, it is determined that there are footsteps, and the rising and falling phases of the footsteps are identified to determine the direction of movement; The movement speed is calculated based on the time interval between adjacent foot disturbances in the channel state information sequence and the preset average step size.
[0009] Preferably, the passive energy harvesting circuit is a piezoelectric energy harvester, installed on the back of the lighting switch panel in the stairwell, used to convert the environmental mechanical energy generated by people pressing the switch or the vibration of the stairwell into electrical energy and store it in a supercapacitor.
[0010] Preferably, predicting the next light switch location that the person will reach based on the direction of movement and the speed of movement includes: The arrival time is calculated based on the fixed installation spacing between adjacent lighting switches in the stairwell and the moving speed. If the direction of movement is upward, the predicted target lighting switch is the staircase lighting switch on the floor above the current switch. If the direction of movement is downward, the predicted target lighting switch is the stairwell lighting switch on the next floor below the current switch.
[0011] Preferably, the self-organizing network link established through the WiFi module includes: The WiFi modules in each lighting switch form a wireless mesh network according to the IEEE 802.11s protocol. Each lighting switch acts as a network node and maintains a routing table with its neighboring nodes. When any node generates the pre-lighting instruction, it forwards the instruction to the target node through the routing table in a single-hop or multi-hop manner.
[0012] Preferably, it further includes: After the slave lighting switch performs the lighting operation, it returns an acknowledgment signal to the original switch through the self-organizing network link; After receiving the confirmation signal, the original switch controls its own lighting to turn off after a preset delay and stores the event data of the personnel passing through into the local memory.
[0013] Secondly, the present invention provides a passive lighting switch control device based on WiFi module channel state awareness, comprising: The power harvesting module is used to extract electrical energy from the mechanical energy of the environment using a passive energy harvesting circuit, and to provide working power for the WiFi module in the lighting switch. The channel state information sequence extraction module is used to control the WiFi module to continuously transmit detection signals and receive echo signals to extract the channel state information sequence. The signal disturbance pattern recognition module is used to identify the signal disturbance pattern generated by people's footsteps in the stairwell based on the channel state information sequence and through a dynamic time warping algorithm, and to determine the movement direction and speed of the people. The instruction generation module is used to predict the location of the next lighting switch that the person will reach based on the direction of movement and the speed of movement, and generate an instruction to turn on the lights in advance. The instruction execution module is used to send the pre-lighting instruction to the slave lighting switch at the next lighting switch position through the self-organizing network link established by the WiFi module, so that the slave lighting switch performs the lighting operation.
[0014] Thirdly, the present invention provides a readable medium including executable instructions, which, when executed by a processor of an electronic device, cause the electronic device to perform any of the methods described in the first aspect.
[0015] Fourthly, the present invention provides an electronic device including a processor and a memory storing execution instructions, wherein when the processor executes the execution instructions stored in the memory, the processor performs the method as described in any of the first aspects.
[0016] This invention provides a passive lighting switch control method and device based on WiFi module channel state perception. It utilizes a passive energy harvesting circuit to extract electrical energy from environmental mechanical energy (such as from a pressed switch or stair vibration) to power the WiFi module, eliminating the need for batteries or external power sources, making it environmentally friendly and maintenance-free. By transmitting detection signals through the WiFi module and extracting the channel state information sequence, combined with a dynamic time warping algorithm, it accurately identifies signal disturbance patterns generated by footsteps in the stairwell, reliably determining the direction and speed of movement, avoiding the blind spots of traditional infrared or sound-based sensors. Furthermore, based on the movement... The system predicts the direction and speed at which a person will arrive at the next lighting switch and generates a pre-lighting command. This command is sent to the target switch via a WiFi self-organizing network link, ensuring the target switch lights up before the person arrives, achieving a lighting tracking effect and significantly improving the safety and comfort of stairwell lighting. Furthermore, the self-organizing network requires no central controller or cloud support, allowing for collaborative operation even during network outages. Each switch can independently perform sensing, decision-making, and communication, resulting in high system robustness. Additionally, by having subordinate switches return confirmation signals, the original switch delays its extinguishing, and event data is stored, further reducing energy consumption and providing maintenance records. In summary, this invention represents a significant advancement in passive power supply, precise sensing, predictive collaboration, and self-organizing network communication.
[0017] The further effects of the aforementioned non-conventional preferred method will be explained below in conjunction with specific embodiments. Attached Figure Description
[0018] To more clearly illustrate the embodiments of the present invention or the existing technical solutions, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of a passive lighting switch control method based on WiFi module channel state awareness, provided in an embodiment of the present invention. Figure 2 A schematic diagram of another passive lighting switch control method based on WiFi module channel state awareness provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the composition of a passive lighting switch control device based on WiFi module channel state awareness, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0021] See Figure 1 The image shows a specific embodiment of a passive lighting switch control method based on WiFi module channel state awareness provided by the present invention. In this embodiment, the passive lighting switch control method based on WiFi module channel state awareness includes:
[0022] Step 101: Use a passive energy harvesting circuit to extract electrical energy from the mechanical energy of the environment to provide power for the WiFi module inside the lighting switch; Specifically, the passive energy harvesting circuit in this embodiment employs a piezoelectric energy harvester. This piezoelectric energy harvester is composed of a composite of multiple layers of piezoelectric ceramic sheets (e.g., PZT-5H material) and a metal substrate, and is fixed to the center area of the back of the stairwell lighting switch panel using high-strength structural adhesive. When a person presses the switch button, the panel undergoes a bending deformation of approximately 50μm to 200μm. When a person walks in the stairwell, the impact of their footsteps causes vibrations in the stairwell structure. This vibration is transmitted through the wall to the switch panel, generating high-frequency micro-amplitude vibrations (frequency range 20Hz to 200Hz, amplitude approximately 5μm to 20μm). Due to the positive piezoelectric effect, the piezoelectric ceramic sheets convert mechanical deformation into electrical charge output; the open-circuit voltage is proportional to the deformation, typically ranging from 1V to 10V. This pulsed voltage is rectified by a full-bridge rectifier (using a BAT54S Schottky diode, with a forward voltage drop of approximately 0.3V) to obtain pulsating direct current. The rectified output is connected to a low-power power management chip (model LTC3588-1), which integrates undervoltage lockout, a high-efficiency buck converter, and an energy storage capacitor interface. The power management chip stores the rectified energy in a supercapacitor (model SP-5R5-Z104, 0.1F capacity, 5.5V withstand voltage). When the voltage across the supercapacitor reaches the upper threshold of 3.3V, the power management chip outputs a high level through the PWR_OK pin, enabling the subsequent WiFi module; when the voltage drops below the lower threshold of 2.8V, the power to the WiFi module is cut off, and the device re-enters the energy accumulation state. Actual measurements show that a single press of the switch generates approximately 300μJ of energy, sufficient to support the WiFi module in completing one detection, sensing, decision-making, and communication cycle (total energy consumption approximately 150μJ). Environmental mechanical energy specifically refers to the pressing and vibration energy generated by human movement within the stairwell, excluding any external power source or chemical battery.
[0023] Step 102: Control the WiFi module to continuously transmit detection signals and receive echo signals to extract the channel state information sequence; Furthermore, the WiFi module uses a chip that supports Channel State Information (CSI) output, such as the Espressif ESP32-S3 (with a built-in 2.4GHz WiFi baseband and RF front-end) or the Texas Instruments CC3235. The WiFi module is configured in monitoring mode, transmitting probe signals at a fixed center frequency of 2.412GHz (corresponding to 802.11n protocol channel 1), a bandwidth of 20MHz, and a rate of 100 times / second. The probe signal uses a null data packet (NDP) from the 802.11n standard. This packet does not carry a payload, but only contains a preamble and a channel estimation field to stimulate the channel response. Simultaneously, the WiFi module's receiving link continuously receives echo signals reflected from people, walls, the ground, etc., after propagation through space. The specific process for extracting the channel state information sequence is as follows:
[0024] First, the amplitude and phase of the received subcarriers are demodulated. In 20MHz bandwidth and 802.11n mode, there are 56 effective subcarriers (including 52 data subcarriers and 4 pilot subcarriers). The receiver extracts the complex channel frequency response on each subcarrier using least-squares channel estimation to construct the original channel state matrix. ,in The number of time sampling points, matrix elements Indicates the first The subcarrier at the ... Complex gain at each sampling time.
[0025] Secondly, a moving average filter is applied to the original channel state matrix to remove static clutter. Static clutter originates from stationary objects such as walls and fixed furniture, and its channel response is approximately constant over a short period. The moving average filter uses a rectangular window with a window length of... The value is 7 (corresponding to a 70ms time window). For each subcarrier, the filtered sequence is:
[0026] , That is, the current value is subtracted from the mean within the window, retaining the dynamically changing components. After moving average filtering, a channel state information sequence representing dynamic disturbances such as footsteps is obtained. To reduce computational complexity, the subcarrier with the strongest signal energy (e.g., the 28th subcarrier) is typically chosen as the object of analysis, and its amplitude sequence is analyzed. As input for subsequent steps.
[0027] Step 103: Based on the channel state information sequence, identify the signal disturbance pattern generated by people's footsteps in the stairwell through the dynamic time warping algorithm, and determine the movement direction and speed of the people. Dynamic Time Warping (DTW) is an algorithm used to measure the similarity between two time series. It can handle the stretching and warping of sequences along the time axis, and is particularly suitable for biosignals such as gait, which exhibit variable speeds. This step specifically includes the following sub-processes:
[0028] (1) Pre-collect reference channel state information templates for typical footsteps. The collection method is as follows: In the stairwell, 10 testers of different heights and weights (height range 1.5m to 1.9m, weight range 45kg to 90kg) were invited to walk in two directions (upward and downward) and at three speeds (slow (0.8m / s), medium (1.2m / s), and fast (1.8m / s). Each time a foot landed, the amplitude sequence of channel state information at the switch panel was recorded synchronously, and a 0.5-second segment (50 sampling points) from 0.2 seconds before the foot landed to 0.3 seconds after the foot landed was extracted as a reference sample. All samples in the same direction were averaged to obtain the upward footstep reference template and the downward footstep reference template. Each template is a real number sequence of length 50. These templates are stored in the local Flash of the lighting switch.
[0029] (2) Calculate the distance by dynamically time-warping the real-time channel state information sequence and the reference channel state information template. Assume the real-time sequence... Reference template ,in and The sequence length (in this embodiment) =50, The detection window length is variable, typically set to 100. The DTW distance is defined as the minimum cumulative distance under the optimal regularized path that satisfies the boundary conditions and continuity constraints. The calculation formula is:
[0030] , Among them, regularized path satisfy: Boundary conditions: =1, =1, = , = ; Continuity and monotonicity: 0≤ - ≤1,0≤ - ≤1, and cannot be 0 at the same time.
[0031] The recurrence relation for solving dynamic programming is: , Initial conditions , .final .
[0032] (3) When the calculated DTW distance is less than a preset threshold, it is determined that footsteps exist, and the rising and falling phases of the footsteps are identified to determine the direction of movement. The DTW distance between the real-time sequence and the upward footstep reference template and the downward footstep reference template are calculated respectively, and denoted as . and The preset threshold θ = 0.35 (determined by adding a margin, based on the maximum DTW distance of 0.28 obtained from numerous tests of non-footstep disturbances (such as elevator vibration, wind, and pipe vibration)). If min ( If θ < θ, then it is determined that there are footsteps; if < If the foot lands, the movement direction is upward; otherwise, it is downward. Simultaneously, the direction is further confirmed by identifying the phase of the foot's rise and fall: a positive peak appears in the CSI amplitude sequence when the foot lands, and a negative peak appears when the foot is lifted; if the peak order is "positive → negative," it is determined to be upward (landing first, then lifting the foot); if it is "negative → positive," it is determined to be downward (lifting the foot first, then landing). Combining these two methods improves robustness.
[0033] (4) The moving speed is calculated based on the time interval between adjacent footstep disturbances in the channel state information sequence, combined with the preset average step size. At the moment when two consecutive footstep peaks are detected... and ( > After that, the step time interval Preset average step size The standard tread width for stairs is taken as 0.75 meters (this value can be obtained by multiplying the stair tread width (0.25m~0.32m) in building codes by the number of steps per step (2~3 steps)). Moving speed The calculation formula is:
[0034] , For example, if seconds, then =0.75 / 0.6=1.25 m / s. If there is only one foot in a detection window, the historical average speed or the default speed of 1.0 m / s is used as the estimate.
[0035] Step 104: Based on the direction and speed of movement, predict the location of the next lighting switch that the person will reach and generate a pre-lighting instruction; Specifically, the first step is based on the fixed installation spacing between adjacent lighting switches in the stairwell. In this embodiment, one lighting switch is installed on each landing of the stairwell, and the vertical distance between adjacent switches is [missing information]. =3.0 meters (actual distance can be determined based on architectural drawings or on-site measurements). Combined with movement speed Calculate the estimated time to reach the next switch. :
[0036] , For example =1.25 m / s, =3.0 / 1.25=2.4 seconds.
[0037] Secondly, the address of the target switch is determined based on the direction of movement. If the movement direction is upward, the target lighting switch is predicted to be the stairwell lighting switch on the floor above the current switch; if the movement direction is downward, the target lighting switch is predicted to be the stairwell lighting switch on the floor below the current switch. Each lighting switch is pre-assigned a unique node ID during installation (e.g., "2F" represents the second-floor switch, "3F" represents the third-floor switch), and the IDs of its upper and lower-floor neighbors are obtained through a neighbor discovery protocol.
[0038] Finally, a pre-lighting instruction data packet is generated. This data packet uses a custom frame format and includes the following fields: start of frame (0xAA), target node ID (1 byte), instruction type (0x01 represents lighting), estimated arrival time (2 bytes, in 10ms units, maximum value 655.35 seconds), and checksum (1 byte, CRC-8). The instruction is generated by the current switch's microprocessor (embedded in the WiFi module) and delivered to the MAC layer transmission queue.
[0039] Step 105: Through the self-organizing network link established by the WiFi module, the pre-lighting command is sent to the slave lighting switch at the next lighting switch position so that the slave lighting switch performs the lighting operation.
[0040] Furthermore, the self-organizing network links in this embodiment are established as follows: the WiFi modules in each lighting switch automatically form a wireless mesh network according to the IEEE 802.11s protocol standard. Under the 802.11s framework, each node acts as a Mesh Station, running the Hybrid Wireless Mesh Protocol (HWMP). Nodes periodically (every 1 second) send beacon frames and Prepared Route Requests (PREQ) to discover neighbors and maintain routing tables. Routing table entries include the destination node ID, next-hop node ID, link quality index (LQI, ranging from 0 to 255, calculated by weighting Received Signal Strength Index (RSSI) and packet loss rate), hop count, etc. Each node independently maintains its local routing table, eliminating the need for a central controller.
[0041] When any node (referred to as the source node) generates an early activation command, the following operations are performed: First, the local routing table is queried to find the entry corresponding to the target node ID. If the target node is a direct neighbor (i.e., hop count is 1), the command is encapsulated into an 802.11 data frame and sent directly to the target node's MAC address using unicast. If the target node's hop count is greater than 1 (e.g., spanning multiple layers), the command is encapsulated and sent to the next-hop node. Each hop node checks the hop count field in the command (initially 0), incrementing the hop count by 1 for each forward. If the hop count exceeds the maximum hop count limit (set to 3 in this embodiment), the command is discarded to prevent broadcast storms. Simultaneously, each node maintains a recently processed command cache (length 16). For duplicate received commands (determined by command ID + source node ID), they are not forwarded again.
[0042] After receiving a command, the slave lighting switch (i.e., the target node) first performs a CRC check. If the check passes, it immediately drives the relay or TRIAC to conduct, illuminating the controlled light fixture. Simultaneously, the slave switch can set a minimum illumination duration timer based on the expected arrival time in the command, ensuring that the lights are on before the expected time and remain lit for at least 5 seconds, preventing premature extinguishing due to prediction errors.
[0043] As can be seen from the above technical solutions, the beneficial effects of this embodiment are: by passive energy harvesting, WiFiCSI sensing, DTW mode matching, and self-organizing network advance command, it realizes the wiring-free, battery-free, and seamless following control of stairwell lighting, which significantly improves energy efficiency and user experience.
[0044] Figure 1 The embodiments shown are merely basic examples of the method of the present invention. Other preferred embodiments of the method can be obtained by making certain optimizations and extensions based on them.
[0045] like Figure 2The image shows another specific embodiment of the passive lighting switch control method based on WiFi module channel state awareness according to the present invention. This embodiment further describes the method based on the foregoing embodiments, and includes the following steps:
[0046] Step 201: After the slave lighting switch performs the lighting operation, it returns an acknowledgment signal to the original switch through the self-organizing network link; In this embodiment, the original switch refers to the lighting switch that generates and sends the pre-lighting command, i.e., the switch at the current location of the person. After the slave lighting switch successfully executes the lighting operation, its internal WiFi module immediately generates an acknowledgment frame (ACK Frame). This acknowledgment frame uses the same custom format as the command frame and includes the following fields: start of frame character (0xBB), source node ID (i.e., the slave switch's own ID), original node ID (i.e., the original switch ID), command reception status (0x01 indicates successful lighting, 0x02 indicates failure), actual lighting timestamp (4 bytes, Unix timestamp, accurate to milliseconds), remaining energy percentage of this node (1 byte, 0~100%), and checksum. The acknowledgment frame is unicast back to the original switch through the same ad hoc network link (following the IEEE 802.11s routing protocol). To ensure reliability, the slave switch adopts a stop-and-wait protocol. After sending an acknowledgment frame, a timeout timer (timeout period of 200ms) is started. If a secondary acknowledgment (i.e., a short ACK reply from the original switch after receiving the acknowledgment) is not received, the acknowledgment frame is retransmitted, up to a maximum of 3 times.
[0047] After issuing the early lighting command, the original switch also starts a receive timeout timer (500ms). If the original switch does not receive an acknowledgment frame within the timeout period, it determines that the command transmission has failed and triggers a retransmission mechanism: the original switch retransmits the early lighting command, up to 3 times. If no acknowledgment is received after 3 retransmissions, a communication fault log is recorded, and the lighting attempt is abandoned. This two-way acknowledgment mechanism ensures reliable delivery of commands in the complex electromagnetic environment of the stairwell.
[0048] Step 202: After receiving the confirmation signal, the original switch controls its own lighting to turn off after a preset delay and stores the event data of this person passing through into the local memory.
[0049] After receiving the confirmation frame, the original switch first extracts the actual lighting timestamp and slave switch status, and then starts its own light's extinguishing timer. The extinguishing delay is not a fixed value, but is dynamically calculated based on the movement speed of people to avoid lights behind people turning off too early, causing safety hazards, and also to avoid wasting energy by turning off too late. The specific calculation formula is as follows:
[0050] , in, The spacing between adjacent switches is 3.0 meters in this embodiment. The moving speed measured in step 103 This is the buffer coefficient, with a value ranging from 0.7 to 0.9. In this embodiment, we take... =0.8, meaning the original switch will turn off 80% of the time it would take for personnel to reach the target switch as expected. For example, when At meters per second, =1.92 seconds. The original switch turns off the light fixture by disconnecting the relay or the SCR after the timer expires.
[0051] Simultaneously, the original switch stores the event data of this personnel passage into local non-volatile memory. In this embodiment, an embedded Flash chip (such as W25Q64, 8MB capacity) or the MCU's internal EEPROM is used. The event data structure is defined as follows (32 bytes in total):
[0052] After each event is written, the current write pointer is recorded. When the memory is full, a circular overwrite strategy is used to retain the latest 1000 records. This event data can be read via WiFi or Bluetooth by maintenance personnel's mobile phones or dedicated debuggers for energy consumption analysis, fault diagnosis, personnel flow statistics, and can also be used as offline training data to optimize prediction algorithms.
[0053] As can be seen from the above technical solutions, the beneficial effects of this embodiment are: the reliability of command execution is guaranteed by the two-way confirmation mechanism, the dynamic extinguishing delay enables smooth light following, and the event data storage provides a data foundation for intelligent operation and maintenance.
[0054] This invention also provides a passive lighting switch control device based on WiFi module channel state awareness. See also Figure 3 The image shows a specific embodiment of a passive lighting switch control device based on WiFi module channel state awareness provided by the present invention. This embodiment of the device is used to execute... Figures 1-2 The physical apparatus of the method. Its technical solution is essentially the same as the above embodiments, and the corresponding descriptions in the above embodiments also apply to this embodiment. The apparatus includes:
[0055] The power acquisition module 301 is configured to acquire electrical energy from environmental mechanical energy using a passive energy harvesting circuit to provide operating power for the WiFi module in the lighting switch. The channel state information sequence extraction module 302 is configured to control the WiFi module to continuously transmit detection signals and receive echo signals to extract the channel state information sequence. The signal disturbance pattern recognition module 303 is configured to identify the signal disturbance pattern generated by people's footsteps in the stairwell based on the channel state information sequence and through a dynamic time warping algorithm, and determine the movement direction and speed of the people. The instruction generation module 304 is configured to predict the location of the next lighting switch that the person will reach based on the direction and speed of movement, and generate an instruction to turn on the lights in advance. The instruction execution module 305 is configured to send a pre-lighting instruction to the slave lighting switch at the next lighting switch position via a self-organizing network link established by the WiFi module, so that the slave lighting switch performs the lighting operation.
[0056] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.
[0057] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. Buses can be categorized as address buses, data buses, and other types. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0058] Memory is used to store instructions for execution. Specifically, instructions for execution are computer programs that can be executed. Memory can include main memory and non-volatile memory, and it provides the processor with execution instructions and data.
[0059] In one possible implementation, the processor reads the corresponding execution instructions from non-volatile memory into main memory and then executes them. Alternatively, it may obtain the corresponding execution instructions from other devices to logically form a passive lighting switch control device based on WiFi module channel state awareness. The processor executes the execution instructions stored in the memory to implement the passive lighting switch control method based on WiFi module channel state awareness provided in any embodiment of the present invention.
[0060] The above is as described in the present invention. Figure 3 The method for controlling a passive lighting switch based on WiFi module channel state awareness, as provided in the illustrated embodiment, can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed through integrated logic circuits in the processor's hardware or through software instructions. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0061] The steps of the method disclosed in the embodiments of this invention can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0062] This invention also proposes a readable medium storing execution instructions. When these instructions are executed by the processor of an electronic device, the electronic device can perform a passive lighting switch control method based on WiFi module channel state awareness provided in any embodiment of this invention, specifically for performing actions such as... Figure 1 , Figure 2The method shown.
[0063] The electronic devices in the foregoing embodiments may be computers.
[0064] Those skilled in the art will understand that embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention can be implemented in a completely hardware embodiment, a completely software embodiment, or a combination of software and hardware.
[0065] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0066] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0067] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A passive lighting switch control method based on WiFi module channel state awareness, characterized in that, The method includes: A passive energy harvesting circuit is used to extract electrical energy from the mechanical energy of the environment to provide power for the WiFi module inside the lighting switch. The WiFi module is controlled to continuously transmit detection signals and receive echo signals to extract channel state information sequences. Based on the channel state information sequence, the signal disturbance pattern generated by people's footsteps in the stairwell is identified by the dynamic time warping algorithm, and the movement direction and speed of the people are determined. Based on the direction and speed of movement, predict the location of the next lighting switch that the person will reach and generate a pre-lighting instruction. The pre-lighting command is sent to the slave lighting switch at the next lighting switch location via the self-organizing network link established by the WiFi module, so that the slave lighting switch performs the lighting operation.
2. The method according to claim 1, characterized in that, The extracted channel state information sequence includes: The amplitude and phase of multiple subcarriers received by the WiFi module are demodulated to obtain the original channel state matrix; The original channel state matrix is subjected to moving average filtering to remove environmental static clutter, resulting in the channel state information sequence.
3. The method according to claim 2, characterized in that, The step of identifying signal disturbance patterns caused by footsteps in the stairwell based on the channel state information sequence and determining the movement direction and speed of the personnel through a dynamic time warping algorithm includes: A reference channel state information template for typical foot gait is pre-collected, and the reference channel state information template corresponds to the foot impact characteristics of people of different heights and weights in the stairwell; The real-time obtained channel state information sequence is compared with the reference channel state information template to perform dynamic time-normalized distance calculation; When the dynamic time warp distance is less than a preset threshold, it is determined that there are footsteps, and the rising and falling phases of the footsteps are identified to determine the direction of movement; The movement speed is calculated based on the time interval between adjacent foot disturbances in the channel state information sequence and the preset average step size.
4. The method according to claim 1, characterized in that, The passive energy harvesting circuit is a piezoelectric energy harvester, installed on the back of the lighting switch panel in the stairwell. It is used to convert the environmental mechanical energy generated by people pressing the switch or the vibration of the stairs into electrical energy and store it in a supercapacitor.
5. The method according to claim 1, characterized in that, The method of predicting the next light switch location that the person will reach based on the direction of movement and the speed of movement includes: The arrival time is calculated based on the fixed installation spacing between adjacent lighting switches in the stairwell and the moving speed. If the direction of movement is upward, the predicted target lighting switch is the staircase lighting switch on the floor above the current switch. If the direction of movement is downward, the predicted target lighting switch is the stairwell lighting switch on the next floor below the current switch.
6. The method according to claim 1, characterized in that, The self-organizing network link established through the WiFi module includes: The WiFi modules in each lighting switch form a wireless mesh network according to the IEEE 802.11s protocol. Each lighting switch acts as a network node and maintains a routing table with its neighboring nodes. When any node generates the pre-lighting instruction, it forwards the instruction to the target node through the routing table in a single-hop or multi-hop manner.
7. The method according to any one of claims 1 to 6, characterized in that, Also includes: After the slave lighting switch performs the lighting operation, it returns an acknowledgment signal to the original switch through the self-organizing network link; After receiving the confirmation signal, the original switch controls its own lighting to turn off after a preset delay and stores the event data of the personnel passing through into the local memory.
8. A passive lighting switch control device based on WiFi module channel state perception, characterized in that, include: The power harvesting module is used to extract electrical energy from the mechanical energy of the environment using a passive energy harvesting circuit, and to provide working power for the WiFi module in the lighting switch. The channel state information sequence extraction module is used to control the WiFi module to continuously transmit detection signals and receive echo signals to extract the channel state information sequence. The signal disturbance pattern recognition module is used to identify the signal disturbance pattern generated by people's footsteps in the stairwell based on the channel state information sequence and through a dynamic time warping algorithm, and to determine the movement direction and speed of the people. The instruction generation module is used to predict the location of the next lighting switch that the person will reach based on the direction of movement and the speed of movement, and generate an instruction to turn on the lights in advance. The instruction execution module is used to send the pre-lighting instruction to the slave lighting switch at the next lighting switch position through the self-organizing network link established by the WiFi module, so that the slave lighting switch performs the lighting operation.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 7.
10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 7.