CN117994960A - Wireless switch, processing method and control system of wireless switch - Google Patents

Wireless switch, processing method and control system of wireless switch Download PDF

Info

Publication number
CN117994960A
CN117994960A CN202410329612.9A CN202410329612A CN117994960A CN 117994960 A CN117994960 A CN 117994960A CN 202410329612 A CN202410329612 A CN 202410329612A CN 117994960 A CN117994960 A CN 117994960A
Authority
CN
China
Prior art keywords
wireless switch
processing module
communication processing
state
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410329612.9A
Other languages
Chinese (zh)
Inventor
郑威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Linptech Co Ltd
Original Assignee
Wuhan Linptech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Linptech Co Ltd filed Critical Wuhan Linptech Co Ltd
Priority to CN202410329612.9A priority Critical patent/CN117994960A/en
Publication of CN117994960A publication Critical patent/CN117994960A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/20Dynamic coding, i.e. by key scanning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application provides a wireless switch, a processing method and a control system of the wireless switch, which can respond to a wake-up instruction to enter a second working state under a first working state of the wireless switch; if the wake-up instruction is determined to be a trigger signal, generating and sending out a control message, and entering a first working state within a specified time after the control message is sent out, wherein the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption when the first dormant state is switched to the second working state is larger than that when the second dormant state is switched to the second working state; the power consumption in the first operating state is smaller than the power consumption in the second operating state. In the application, the communication processing module is set to be in the second dormant state in the normal state of the wireless switch, and is switched to be in the second working state from the second dormant state after receiving the wake-up instruction, so that the power consumption is the lowest, the standby and running power consumption of the switch can be reduced, and the service life of the battery of the wireless switch can be prolonged.

Description

Wireless switch, processing method and control system of wireless switch
Technical Field
The application mainly relates to the technical field of wireless switches, in particular to a wireless switch, a processing method of the wireless switch and a control system.
Background
The traditional switch is directly used for controlling the on-off of strong electricity, thereby achieving the aim of controlling lamps or other electric appliances. Traditional mechanical switch needs manual operation, easy operation, and the selling price is cheap, but produces the spark easily, can take place the short circuit, needs frequent maintenance, and the operation is inconvenient in the dark, also often forgets to turn off the lamp easily, leads to the expense electricity. In addition, since there is no remote control function, the larger the room is, the more inconvenient the conventional switch is used.
In the process of updating and iterating smart home and traditional home, wireless switches are increasingly arranged in general families, and the wireless switches can be understood as switches configured with wireless communication circuits, and the wireless communication circuits generally adopt radio frequency signals to realize external interaction. Compared with the traditional switch, the wireless switch wirelessly controls the lamp or other electric appliances through the chip. The biggest difference between the wireless switch and the traditional switch is that the wireless switch is movable and free of wiring. The mobile characteristic provides a more convenient equipment control scheme for users; the wiring-free electric wire has the characteristic of no wiring, and the use amount of the electric wire and the PVC pipe is reduced during installation.
At present, a general wireless switch is powered by a battery, and power consumption is high in the standby and use processes of the wireless switch, so that the service life of the wireless switch battery is not long, and the battery needs to be replaced frequently.
Disclosure of Invention
The application provides a wireless switch, a processing method and a control system of the wireless switch, and aims to solve the problems of higher power consumption and shorter service life of a battery in the standby and use processes of the wireless switch in the prior art.
According to a first aspect of an embodiment of the present application, there is provided a wireless switch including: the device comprises a power supply module, a communication processing module, at least one key and at least one induction module;
The power supply module is electrically connected with the communication processing module to supply power to the communication processing module;
The key can trigger the corresponding sensing module in response to external control;
The sensing module is electrically connected with the communication processing module so as to transmit a trigger signal to the communication processing module when triggered;
the communication processing module is used for:
Responding to the wake-up instruction to enter a second working state;
If the wake-up instruction is determined to be the trigger signal, generating and sending out a control message according to the trigger signal, and entering a first working state within a designated time after the control message is sent out;
The communication processing module is configured to be in a first sleep state if the communication processing module has a specified state, and is configured to be in a second sleep state if the communication processing module has the specified state; the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
According to a second aspect of an embodiment of the present application, there is provided a wireless switch including: the device comprises a power supply module, a communication processing module, a bottom shell, at least one key and at least one induction module;
the keys are connected with the bottom shell in a sealing way so as to form a sealing cavity; the power supply module, the communication processing module and the induction module are all arranged in the sealed cavity;
The power supply module is electrically connected with the communication processing module to supply power to the communication processing module; the key can trigger the corresponding sensing module in response to external control; the sensing module is electrically connected with the communication processing module so as to transmit a trigger signal to the communication processing module when touched; the communication processing module is used for:
Responding to the wake-up instruction to enter a second working state;
If the wake-up instruction is determined to be the trigger signal, generating and sending out a control message according to the trigger signal, and entering a first working state within a designated time after the control message is sent out;
The communication processing module is configured to be in a first sleep state if the communication processing module has a specified state, and is configured to be in a second sleep state if the communication processing module has the specified state; the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
According to a third aspect of the embodiment of the present application, there is provided a processing method of a wireless switch, including:
The wireless switch responds to the wake-up instruction to enter a second working state;
If the wake-up instruction is determined to be a trigger signal, the wireless switch generates and outwards transmits a control message according to the trigger signal, and enters a first working state within a designated time after the control message is transmitted; the trigger signal is generated in response to external manipulation of a key of the wireless switch;
The wireless switch is configured to be in a first sleep state if the wireless switch has a specified state, otherwise, the first working state is configured to be in a second sleep state; the power consumption of the wireless switch in the first dormant state is smaller than that in the second dormant state, and the power consumption of the wireless switch when the wireless switch is switched from the first dormant state to the second working state is larger than that when the wireless switch is switched from the second dormant state to the second working state; the power consumption of the wireless switch in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
According to a fourth aspect of an embodiment of the present application, there is provided a control system including: a wireless switch, intelligent controller, electronic device as in any of the first or second aspects; the wireless switch and the intelligent controller can communicate with the electronic equipment after joining a specified network; the electronic equipment comprises a terminal and/or a gateway, and the designated network comprises a network corresponding to the gateway;
The wireless switch is used for: generating and sending a control message to the electronic equipment when the electronic equipment is subjected to external control;
the electronic device is used for: after receiving the control message, generating corresponding control information according to the control message, and sending the control information to an intelligent controller associated with the wireless switch;
The intelligent controller is used for: and receiving the control information and executing a control result pointed by the control information.
The wireless switch, the processing method and the control system of the wireless switch can respond to the wake-up instruction to enter the second working state under the first working state of the wireless switch; if the wake-up instruction is determined to be a trigger signal, a control message is generated and sent outwards according to the trigger signal, and the first working state is entered in a designated time after the control message is sent. Because the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state. Therefore, the communication processing module is set to be in the second dormant state in the normal state of the wireless switch, and is switched to enter the second working state from the second dormant state after receiving the wake-up instruction, so that the power consumption is the lowest, the standby power consumption and the running power consumption of the switch can be reduced, and the service life of the battery of the wireless switch is prolonged.
Further, if the communication processing module has a specified state, the first working state is configured as a first dormant state, otherwise, the first working state is configured as a second dormant state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6]. Because the duration of the first working state is far longer than the message transmitting time of the second working state in the appointed state, the standby power consumption of the wireless switch and the power consumption in the using process can be further reduced, and the service life of the wireless switch battery is prolonged.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a scenario of an embodiment of a control system provided by an embodiment of the present application;
FIG. 2 is a schematic block diagram of an embodiment of a wireless switch according to an embodiment of the present application;
fig. 3 is a schematic diagram of a relationship between duration and power consumption in a first sleep state, a second sleep state, and a second operating state in an application scenario in an embodiment of the present application;
FIG. 4 is a schematic diagram of an exploded view of an embodiment of a wireless switch according to an embodiment of the present application;
FIG. 5 is a schematic cross-sectional view of an embodiment of a wireless switch according to the present application;
FIG. 6 is a schematic diagram of a first structure of a key of an embodiment of a wireless switch according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a second structure of a key of an embodiment of a wireless switch according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a bottom case of a wireless switch according to an embodiment of the application;
FIG. 9 is a schematic diagram of an exploded view of another embodiment of a wireless switch in accordance with an embodiment of the present application;
FIG. 10 is a schematic diagram of a button structure of a wireless switch according to another embodiment of the present application;
FIG. 11 is a flow chart of an embodiment of a method for processing a wireless switch according to an embodiment of the present application;
FIG. 12 is a flow chart of an embodiment of sending out a corresponding message based on the reported event queue in FIG. 11 according to an embodiment of the present application;
FIG. 13 is a flow chart of a specific embodiment of sending a corresponding message to the outside according to a report event queue in the embodiment of the present application;
FIG. 14 is a flow chart of one embodiment of a wireless switch network in accordance with an embodiment of the present application;
Fig. 15 is a schematic structural diagram of still another embodiment of a wireless switch provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the drawings are merely for convenience in describing the present application and simplifying the description, and do not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described as "exemplary" in this disclosure is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The embodiment of the application provides a wireless switch, a processing method and a control system of the wireless switch, and the processing method and the control system are respectively described in detail below.
The present application provides a control system comprising: wireless switch, intelligent controller and electronic equipment; the wireless switch and the intelligent controller can communicate with the electronic equipment after joining a specified network; the electronic equipment comprises a terminal and/or a gateway, and the designated network comprises a network corresponding to the gateway;
The wireless switch is used for: generating and sending a control message to the electronic equipment when the electronic equipment is subjected to external control;
the electronic device is used for: after receiving the control message, generating corresponding control information according to the control message, and sending the control information to an intelligent controller associated with the wireless switch;
The intelligent controller is used for: and receiving the control information and executing a control result pointed by the control information.
Further, after the at least one intelligent controller is paired with the wireless switch, the at least one intelligent controller can directly receive the paired application control message sent by the wireless switch and execute the control result pointed by the paired application control message.
In one embodiment, referring to fig. 1 to 3, the present application provides a control system, which may include a wireless switch 1, a gateway 2, an intelligent controller 3, and a terminal 4.
The wireless switch 1 may be a switch capable of generating and transmitting a command and having a wireless transmission function. For example, the switch may be a switch having a radio transmission function such as radio frequency radio transmission, infrared transmission, bluetooth transmission, wiFi transmission, or the like for generating and transmitting commands such as control and management. The wireless switch 1 may include: a self-generating switch or a battery switch.
Meanwhile, the wireless switch 1 is also a device capable of receiving and executing commands, and may be, for example, a device for receiving and executing commands such as control and management, and having wireless transmission functions such as radio frequency wireless transmission and reception, infrared transmission and reception, bluetooth transmission and reception, and WiFi transmission and reception. The wireless switch 1 may be any device capable of communicating with the gateway 2, the intelligent controller 3 and the terminal 4, respectively, for example, a device provided with a WiFi communication module (for communicating with the terminal 4) and a bluetooth communication module (for communicating with the intelligent controller 3).
The intelligent controller 3 may be any device or combination of devices capable of realizing on-off control, and is provided with a circuit with data processing capability such as a processing module, and a circuit with wireless communication capability such as a wireless communication module, wherein one example of the intelligent controller may be a wall switch, and other examples of the intelligent controller may be a fan, a lamp, a socket, a garbage disposal device, or the like, or connected thereto such as a single-channel receiver, a multi-channel receiver, or the like. The external communication mode of the intelligent controller 7 may include at least one of the following: radio frequency, bluetooth, wiFi, mobile network, etc., in the embodiment of the present application, the description is mainly based on the bluetooth mode.
The terminal 4 may be, for example, a mobile phone, a tablet computer, a car machine, an intelligent home appliance, etc. The terminal 4 may interact with the wireless gateway 1, for example via a mobile network, a WiFi network, etc., or may interact with the wireless gateway 1 using bluetooth, etc. The terminal 4 may be connected to a target network and may communicate with the wireless gateway 1 via the target network, for example.
In an alternative embodiment, the control system may further comprise a server, which may be any device or combination of devices having data storage capability, data processing capability, and capable of interacting with the gateway 2, and may specifically be, for example, a local or cloud server, where a desired program may be deployed.
In an alternative embodiment, the control system may also include controlled devices, which may include any home, commercial, industrial use devices, such as air conditioners, smart curtains, fans, refrigerators, lights, wall switches, door bells, and the like; the system can also be terminal equipment such as mobile phones, tablet computers, car computers, intelligent household appliances and the like. The controlled device can communicate with the gateway 2, the terminal 4 or the server to be controlled by the gateway 2, the terminal 4 or the server, and can also be connected with the intelligent controller 3 to be indirectly controlled by the gateway 2, the terminal 4 or the server through the intelligent controller 3.
In an alternative embodiment, the control system may further comprise a control device, which may interact with the terminal 4, the server via a mobile network, a WiFi network, etc., and further send control instructions to other devices (such as the wireless switch 1) via the terminal 4, the server. The control device may be connected to a target network and may communicate with the terminal 4, the server 4 via the target network, for example. The control device may be a device capable of generating and transmitting commands and having a wireless transmission function. For example, it may refer to a device having radio transmission functions such as radio frequency radio transmission, infrared transmission, bluetooth transmission, wiFi transmission, and the like for generating and transmitting commands for control, management, and the like.
In an alternative embodiment, the control system may further include a speaker device, which may be understood as any device with sound playing capability, and may also have the capability of wired or wireless communication to the outside. The speaker device may be configured to communicate with the outside through a network added to the gateway, or may be configured to communicate with the outside through a network added to the terminal 4 (e.g., a WiFi hotspot of the terminal or a target network to which the terminal is connected), for example, with a server, so that the speaker device may receive a control command as a controlled device to play a specific sound. In addition, in an alternative embodiment, the speaker device may also be an intelligent voice speaker, and further, may also have a voice recognition capability, a protocol conversion capability, and so on. The sound box device can also be used as a control device to recognize external voice signals, and generate control instructions according to the recognized voice signals and send the control instructions to the appointed controlled device through the network so as to realize the control of the controlled device. Therefore, the sound box device in the embodiment of the application can be used as the controlled device in the control system or the control device in the control system, and is not limited herein.
The number of the wireless switch 1, the gateway 2, the intelligent controller 3, the terminal 4, the server, the controlled device and the control device is not limited to the number shown in the figure, and may be any number.
In an alternative embodiment, both the wireless switch and the intelligent controller may communicate with the gateway via bluetooth by joining the bluetooth network of the gateway after the network is provisioned. The gateway can also be connected to the Internet to communicate with other devices connected to the Internet, for example, in the embodiment of the application, the gateway and the terminal can interact with the server, further, a wireless switch and an intelligent controller of a distribution network can be displayed on the terminal such as a mobile phone APP, a user can formulate control strategies of various wireless switches on the intelligent controller on the mobile phone APP, and when the wireless switch is controlled, a control signal can be sent to the intelligent controller through the gateway and the server to control. In addition, the wireless switch can be directly communicated with the intelligent controller based on Bluetooth signals, such as communication between the wall switch and the wireless switch, and can be directly communicated after pairing is completed, a gateway is not needed, the control is more direct, forwarding of the gateway is not needed, and the speed is higher. And the opposite is also a networking reporting event, namely an event which is sent by the wireless switch and needs to be processed by the gateway or the cloud, and the networking reporting event can be sent to the gateway or the cloud only by networking of the wireless switch.
In the embodiment of the application, the wireless switch 1 comprises a power supply module, a communication processing module, at least one key and at least one induction module; the power supply module is electrically connected with the communication processing module to supply power to the communication processing module; the key can trigger the corresponding sensing module in response to external control; the sensing module is electrically connected with the communication processing module so as to transmit a trigger signal to the communication processing module when triggered.
The wireless switch 1 may include a first working state and a second working state, where the first working state is divided into a first sleep state and a second sleep state, the power consumption of the communication processing module in the first sleep state is smaller than the power consumption in the second sleep state, and the power consumption of the communication processing module when the communication processing module is switched from the first sleep state to the second working state is larger than the power consumption when the communication processing module is switched from the second sleep state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state.
Taking a communication processing module as a chip as an example, the chip comprises a working mode, a first low-power consumption mode and a second low-power consumption mode, wherein the working mode is a first working state of the chip, the low-power consumption mode is a second working state of the chip, the second working state comprises the first low-power consumption mode and the second low-power consumption mode, the energy consumption of the wireless switch in the second low-power consumption mode is lower than that of the wireless switch in the working mode, and the energy consumption of the wireless switch in the second low-power consumption mode is higher than that of the wireless switch in the first low-power consumption mode.
In some embodiments of the present application, the wireless switch 1 includes a key and a bottom case, the key and the bottom case form a cavity, a groove is formed in an inner wall of the key, a sealing member is disposed in the groove, an edge of the bottom case penetrates into the groove and presses the sealing member to seal the key and the bottom case, the key includes a thick-wall area and a thin-wall area located in the thick-wall area, an abutment arm is disposed in the thin-wall area, a thickness of the thick-wall area is greater than that of the thin-wall area, a switch component is disposed at a position of the control board corresponding to the abutment arm, and when the thin-wall area is pressed to trigger the switch component, the key is detected to be pressed.
It should be noted that, the schematic view of the scenario of the control system of the wireless switch shown in fig. 1 is only an example, and the control system and scenario of the wireless switch described in the embodiments of the present application are for more clearly describing the technical solution of the embodiments of the present application, and do not constitute a limitation on the technical solution provided by the embodiments of the present application, and as one of ordinary skill in the art can know, along with the evolution of the control system of the wireless switch and the appearance of a new service scenario, the technical solution provided by the embodiments of the present application is equally applicable to similar technical problems.
Firstly, in the embodiment of the present application, as shown in fig. 2, a wireless switch is provided, where the wireless switch includes a power supply module 201, a communication processing module 202, at least one key 204, and at least one sensing module 203; the power supply module 201 is electrically connected to the communication processing module 202 to supply power to the communication processing module 202; the key 204 can trigger the corresponding sensing module 203 in response to external control; the sensing module 203 is electrically connected to the communication processing module 202, so as to transmit a trigger signal to the communication processing module 202 when triggered;
The communication processing module 202 is configured to:
Responding to the wake-up instruction to enter a second working state;
If the wake-up instruction is determined to be the trigger signal, generating and sending out a control message according to the trigger signal, and entering a first working state within a designated time after the control message is sent out;
The communication processing module is configured to be in a first sleep state if the communication processing module has a specified state, and is configured to be in a second sleep state if the communication processing module has the specified state; the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
Specifically, in some embodiments of the present application, the message transmission time in the second working state may refer to a transmission time of a single message in the second working state, and the duration of the first working state may refer to a duration of the first working state before the single message is transmitted. In other embodiments of the present application, the message transmission time in the second working state may also be a single message transmission time in the second working state (for example, a single continuous transmission of a plurality of messages in the second working state, a plurality of messages continuously transmitted may be used to represent a single control event or may represent a plurality of control events), and the duration of the first working state may refer to the duration of the first working state before the single message is transmitted. In addition, the duration of the first working state may also be an average time, a median of time, etc. of the wireless switch in the first working state in a specified time period (such as a day, 8 hours, etc.), and in summary, the duration of the first working state may represent a sleep time interval of the wireless switch during normal use.
The inventor discovers that the power consumption of the existing wireless switch is higher in the use process, and researches of the inventor discovers that the communication processing module of the wireless switch has a specified state, and the power consumption of the wireless switch can be effectively reduced by configuring the working state of the communication processing module based on the specified state. Specifically:
When the communication processing module receives a wake-up instruction in the first working state, the communication processing module can respond to the wake-up instruction to enter a second working state, and send a message to the outside in the second working state according to the wake-up instruction, and the wake-up instruction can be generated by a key in response to external control. In this embodiment, the power consumption of the communication processing module in the first working state is smaller than the power consumption of the communication processing module in the second working state, so that the communication processing module is in a relatively low-power consumption state in the first working state where the packet sending task is not executed, and is switched to the second working state to send packets only when the communication processing module is awakened.
Further, the inventor finds that the relatively low power consumption state of the communication processing module can also comprise a plurality of different sleep states, and configures the first working state of the communication processing module to have an association relationship between the different sleep states and the power consumption of the wireless switch. Illustratively, the sleep state may include the following: dormancy requiring a large number of initialization operations when awakened, dormancy requiring a simple small number of initialization operations when awakened, dormancy allowing direct packet delivery without initialization when awakened, and the like. In this embodiment, the first sleep state is a wake-up state, and the second sleep state is a wake-up state, and may be directly used for packet sending. Of course, it is within the protection scope of the present embodiment as long as it is satisfied that the power consumption of the communication processing module in the first sleep state is smaller than the power consumption in the second sleep state, and the power consumption when the communication processing module is switched from the first sleep state to the second working state is larger than the power consumption when the communication processing module is switched from the second sleep state to the second working state.
As shown in fig. 3, in this embodiment, after the communication processing module in the first sleep state is awakened, an operation of power-on initialization retransmission signal is required. And the communication processing module in the second sleep state is awakened and only performs signal transmitting operation. Assuming that the power-up initialization consumes a amount of energy, the second sleep state consumes W 1 and the first sleep state consumes W 2, W 1>W2. The total power consumption P 1=W1 t of the communication processing module in the second sleep state and the total power consumption P 2=W2 t+a of the communication processing module in the first sleep state should be noted, where the total power consumption refers to the power consumption in the process of waking up from the first sleep state or the second sleep state and completing the message transmission, and since the power consumption consumed by the message transmission is a fixed value, the total power consumption is omitted when calculating the total power consumption. The communication processing module consumes energy by delta p=p 1-P2=W1t-(W2t+A)=(W1-W2) t-a in the second sleep state and the first sleep state, t=a/(W 1-W2) when delta p=0, and delta P >0 when t > a/(W 1-W2). In this embodiment, the communication processing module may be regarded as having a designated state in Δp=0 and subsequent states, and assuming that the message transmission time is B, when Δp >0, the ratio of the duration of the first working state to the message transmission time in the second working state is greater than a/(W 1-W2) B, and when a/(W 1-W2) b=n is set, the communication processing module may have a designated state when the ratio of the duration of the first working state to the message transmission time in the second working state is greater than or equal to N. After the selection and test of each circuit and module in the communication processing module by the inventor of the present application, the value range of N is preferably [4,6].
In this embodiment, when the communication processing module is in the first working state, the first sleep state can save a certain amount of energy relative to the second sleep state, and when the communication processing module is awakened, the first sleep state is powered on and initialized to consume a certain amount of energy relative to the second sleep state. If and only if the communication processing module has a specified state, namely the ratio of the duration time of the first working state to the message transmitting time in the second working state is greater than or equal to N, the energy saved by the first dormancy state in the first working state can offset the energy consumed by the power-on initialization of the first dormancy state, namely delta P is more than or equal to 0. Therefore, when the wireless switch has a designated state, the first operating state of the communication processing module can be configured as a first sleep state, and the energy saved by the first sleep state in the duration of the first operating state can completely offset the energy consumed by initialization when the first sleep state is awakened, so that the power consumption of the wireless switch can be reduced as a whole, and the power consumption of the wireless switch can be reduced more effectively with the increase of time. And when the wireless switch does not have the designated state (or N is smaller than 4), the first working state is configured to be the second dormant state (if the first working state is still set to be the first dormant state in this state, the energy saved in the first working state in the duration time cannot be offset by the energy saved in the first dormant state, which is consumed by the initialization when the first dormant state is awakened, so that the whole power consumption of the wireless switch cannot be reduced).
In some embodiments, the message transmission time in the second working state is set to be 100ms, the duration of the first working state is the sleep time of the wireless switch before the message is sent, then in a period of time, the wireless switch is awakened and enters the first working state after the message is sent, when the sleep time in the first working state lasts for 0.4s, if the wireless switch is awakened in response to the awakening instruction, the ratio n=0.4 s/100 ms=4 of the duration of the first working state to the message transmission time in the second working state. At this time, if the first operating state is configured as the first sleep state, the energy saved by the first sleep state in the duration (0.4 s) of the first operating state just can offset the energy consumed by the initialization when the first sleep state is awakened. In addition, if the wireless switch is awakened in response to the wake-up instruction after the first working state is dormant for 1 hour, the ratio n=1h/100 ms=36000 of the duration time of the first working state to the message transmitting time in the second working state. At this time, if the first operating state is configured as the first sleep state, the energy saved by the first sleep state in the duration (1 h) of the first operating state is much larger than the energy consumed by the initialization when the first sleep state is awakened.
It should be noted that, according to the influences of the working state, the transmitting parameters, different message types, different communication protocols, and the like of the wireless switch, in some embodiments, the message transmitting time in the second working state may be set to be 270ms, 290ms, 1s, or the like; correspondingly, the duration of the first working state, the designated state, and the configuration between the first sleep state and the second sleep state are correspondingly adjusted, so long as the first sleep state or the second sleep state of the wireless switch is configured according to the designated state, and the designated state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6], so that the message transmitting time falls into the protection scope of the application.
In some embodiments of the present application, the communication processing module may further include a random access memory (RandomAccess Memory, RAM), and the inventor finds that the existing wireless switch is always in a working mode or a light sleep mode (a second sleep state) during use, that is, each part of the wireless switch is in a real-time power-on state, which results in higher power consumption, for example, when a button battery is used to power the wireless switch, the higher power consumption results in frequent battery replacement for a user, which not only results in resource waste, but also reduces user experience. It has further been found that when other power consumption in the wireless switch is fixed, the power consumption of the wireless switch is greatly affected by the random access memory in the communication processing module. The wireless switch is in a light sleep mode (second sleep state), and the RAM in the communication processing module only retains a part of data, but the RAM is still in a powered-on state, and the RAM consumes high power when powered on based on the characteristics of the RAM itself, and the RAM-based memory consumes power even when no memory read or write occurs because it constantly recharges the internal capacitor.
If the first working state is configured to be a first dormant state, the random access memory is powered off when the communication processing module is in the first working state; and if the first working state is configured to be the second dormant state, the communication processing module reserves at least part of data in the random access memory when in the first working state.
Taking a communication processing module as an example of a chip, assume that a second working state of the chip is a working mode, the chip is in a recovery mode in a second sleep state, in order to reduce power consumption in the recovery mode, part of data in the RAM is reserved, and the first sleep state is in an SOC OFF mode in which the RAM is powered OFF and has the lowest power consumption. For example, the chip a, the first operation state is a sleep state, including a first sleep state and a second sleep state, the second operation state (operation mode) is Active TX, the power consumption is 4mA, the first sleep state (first low power consumption mode) is an SOC OFF mode, and the RAM is powered down in this mode, and the power consumption is 300nA. The second sleep state (second low power mode) is a recall mode, which is also to reduce power consumption, but will retain at least part of the data in RAM, with a power consumption of 2 ua. It can be seen that the power consumption in the sleep state is much smaller than that in the operation mode, while the power consumption in the SOC OFF mode is the lowest, which is smaller than that in the attention mode.
If the first working state is configured as a first dormant state, the random access memory is powered off when the communication processing module is in the first working state, and if the communication processing module is awakened, the awakening reason is firstly acquired immediately so as to prevent the fact that the key is quickly pressed and cannot be identified when the key is awakened. In the embodiment of the application, the type of the communication processing module awakening comprises key awakening, timed awakening, OTA awakening, software reset and the like.
The wake-up instruction corresponding to key wake-up is a trigger signal, the wake-up instruction corresponding to timing wake-up is a timing signal, the wake-up instruction corresponding to OTA wake-up is an OTA signal, and the wake-up instruction corresponding to software reset is a software reset signal. After the communication processing module wakes up, initializing the resources: hardware resource initialization, such as initialization of an IO port, a control device, an intelligent platform (such as a millet SDK), flash memory reading and writing and the like.
And when the judgment is that the key is awakened, the wireless switch enters a key processing flow, and the related key awakening event is sent out through an event sending flow. In the embodiment of the present application, after the communication processing module enters the second working state in response to the wake-up instruction, the communication processing module is further configured to: and judging the wake-up instruction as a timing signal, acquiring the electric quantity information of the power supply module, and sending a state message outwards, wherein the state message characterizes the electric quantity information. When the key wake-up (wake-up instruction is a trigger signal) is judged, the power (such as battery voltage parameter) of the wireless switch is collected, and the collected power information is sent to the outside through a state message. The wake-up is timed, and the power data can be sent and keep alive at regular time, for example, the power detection timer is started for 50 minutes: one function is to send power data to the APP every 50 minutes, and the other function is to have a keep-alive operation with the gateway to tell the gateway that the wireless switch is still on-line.
For key wakeup, since key press must be done before key press is waken, the sub-process of key press is given before "recognition of press" is judged, and since the communication processing module wakes up and the key may be pressed, i.e. released, then the release of the key may not be detected, a sub-process of key release (i.e. detection of key release state) is added after "recognition of press" to compensate for the vulnerability of key detection logic (to prevent too fast press, remedial action).
Specifically, if the communication processing module determines that the wake-up instruction is a trigger signal, when generating and sending the control message outwards according to the trigger signal, the communication processing module is further configured to: determining the current state of the key, if the key is in a release state, judging the control action type of the key in the appointed time, and sending out a corresponding control message.
In some embodiments of the present application, the communication processing module is further configured to determine whether the wake-up instruction is a trigger signal before determining whether the wake-up instruction is a timing signal. That is, it is preferentially determined whether the communication processing module is awakened by a key (whether the awakening instruction is a trigger signal), and then it is determined whether the communication processing module is awakened at a timing (whether the awakening instruction is a timing signal). Because a timed wake-up is only turned on, it must be included in the wake-up reasons. Taking the communication processing module as a chip as an example, in order to reduce the power consumption, some chips may directly relate to the flag position 1 after the timer is timed, instead of waiting for the timer to finish and then setting 1 (an additional logic circuit is needed to realize, so that additional power consumption may be brought) so as to avoid the increase of the power consumption, and in order to prevent the key from being quickly pressed and not being recognized when the key is awakened, whether the key is awakened is preferentially judged.
When the communication processing module is awakened, whether the key is awakened is firstly judged, if yes, the current state of the key is timely determined, and the control action of the key is captured as soon as possible when the communication processing module is awakened. When the current state of the key is detected to be a pressing state, the operation and control actions of the key are captured after the wake-up is described, and the single click, the long press, the double click and the long press of the key or the operation and control action types of the key of any two combinations of the single click, the double click and the long press can be identified, and corresponding control messages are sent out.
In the embodiment of the application, when the communication processing module wakes up, the key processing flow is entered, and the key processing flow can be divided into a key pressing sub-flow and a key releasing sub-flow, wherein the key pressing sub-flow can be an action of identifying a falling edge, namely an action of identifying that the key pressing is an action of identifying a low level of an IO port of the communication processing module, and the key releasing sub-flow is an action of identifying a rising edge, namely an action of identifying that the key releasing is an action of identifying a high level of the IO port of the communication processing module, which is a complete key pressing and lifting flow. It will be appreciated that the reverse may be true from the technical implementation point of view in the embodiments of the present application, i.e. the key press sub-flow may be a recognition rising edge and the key release sub-flow is a recognition falling edge, which is not limited herein. In the embodiment of the application, the awakening operation of the communication processing module can be performed by a hardware circuit, and the judging of the IO port level of the communication processing module is performed by a software algorithm.
When the key is pressed, the sensing module inputs a first level to an IO port of the communication processing module; when the key is released, the sensing module inputs a second level to an IO port of the communication processing module; the first level and the second level are different;
In some embodiments of the present application, the communication processing module is specifically configured to: if the wake-up instruction is the trigger signal (namely, key wake-up type), detecting whether the current input level of the IO port of the communication processing module is a first level or not; if the current level of the IO port of the communication processing module is a first level, determining that the key is in a pressed state, and acquiring a first pressing duration of the key; and determining the control action type of the key according to the first pressing duration.
Further, the communication processing module is specifically further configured to: judging whether the first pressing time length of the key exceeds a first preset time length, if the first pressing time length does not exceed the first preset time length, detecting whether the current level of an IO port of the communication processing module is a second level; if the current level of the IO port of the communication processing module is the second level, detecting first key operation information of the key in a third preset period; and determining the control action type of the key according to the first key operation information.
The key event corresponding to various operation types may be predefined in the embodiment of the present application, for example, if the controlled device corresponding to the wireless switch is a lamp, the single click may be defined as a lighting event.
Further, the communication processing module is specifically further configured to: if the first key operation information indicates that the key is not pressed in a third preset period, determining that the control action type is a single click operation; if the first key operation information indicates that the key is pressed in a third preset period, determining that the control action type is double-click operation; if the first key operation information indicates that the key is pressed in a third preset period, detecting second key operation information of the key in a fourth preset period, and determining the control action type of the key according to the third key operation information, wherein the fourth preset period is after the third preset period.
Further, the communication processing module is specifically further configured to: if the second key operation information indicates that the key is pressed again in a fourth preset period, acquiring a second pressing duration of the key in the fourth preset period; if the second pressing duration is a second preset duration, determining that the control action type is double-click long-pressing operation; and if the second pressing duration is a third preset duration, determining that the operation-by-operation action type is OTA operation.
It should be noted that the first preset duration, the second preset duration, the third preset duration, the fourth preset period, the fifth preset period, and the like described above may be preset according to an actual application scenario, and are not limited herein.
When the current state of the key is detected to be a release state, the fact that the operation action of the key is not captured is indicated, if the key is already released after being awakened, namely, if the current state of the key is detected to be the release state, the key is pressed down before the current state is detected, namely, the communication processing module is awakened, the key is possibly pressed down, so that the detected state is the release state, the action of pressing down the key once can be recorded at the moment, the operation action type of the key in the follow-up appointed time is continuously detected and judged, and the corresponding control message is sent out. For example, when the current state of the key is detected to be a release state, detecting whether there is one click operation of the key in a specified time, if so, determining that the operation type of the key is double click (one click which is not captured by calculation); if the key is not operated within the specified time, the type of manipulation action of the key may be determined to be a click (a click that is not captured), or the like.
The specified time may be a time preset according to an actual application scenario, for example, 300ms, and is not limited thereto.
In the prior art, the general key identification is simple, and is not so complicated, and the standby power consumption of the wireless switch in the embodiment of the application is very low, so that the communication processing module (such as the SOC) of the wireless switch is generally in the first sleep state of the communication processing module, and the communication processing module needs a certain time to wake up, so that the problem that the key cannot be detected when the key is sprung up after the communication processing module wakes up exists, and therefore, compared with the key detection flow of the switch in which the general SOC is always in the wake-up mode, the key detection flow of the embodiment of the application is more complicated.
In some embodiments of the present application, the communication processing module generates and sends out a control packet according to the trigger signal, and may include at least one of the following ways:
(1) The communication processing module generates and sends out a control message according to the trigger signal, and the control message comprises: judging the control action type of the key in the appointed time, and sending a second control message and/or a third control message outwards according to the control action type; the second control message is generated by the key in response to a second control action type in the control action types, and the third control message is generated by the key in response to a third control action type in the control action types; at least one of the following of the second and third manipulation action types is distinguished: the number of pressing times, the number of releasing times and the pressing time.
The second control message may be a message related to a device of the same manufacturer and the same communication development protocol as the wireless switch, that is, the second control message may be regarded as a manufacturer custom message, and the manufacturer custom message may be used to directly communicate between products of the same manufacturer or authorized products thereof without networking. The third control message may be a networking message that needs to be sent to the cloud through the gateway, for example, a message sent to the cloud such as millet, hua-to-doodle, etc., so the third control message needs to be sent to the gateway or the server when the wireless switch is networked.
For example, the type of the control action corresponding to the vendor custom message may be preset to be different from the type of the control action corresponding to the networking message, so that whether the vendor custom message or the networking message should be sent may be determined according to the type of the different control actions received by the key. For example, the operation action corresponding to the networking message is a complete action, wherein the complete action refers to an action with at least one pressing and at least one releasing, and the times of pressing and releasing are the same. Further, the corresponding generated control message may include: and responding to the complete action of the control operation to generate a complete action control message. The complete action control message may be the third control message, or may not be limited thereto.
The control action corresponding to the vendor custom message is a push-down operation, which is a push-down post-push control message generated in response to the push-down in the push-down operation; the message is generated and sent in response to the pressing, and can not be the complete actions of pressing and releasing; the push-down post-control message may be regarded as the second control message, and the push-down post-control message is used to make: and the intelligent controller matched with the wireless switch responds to the pressed control message and executes a corresponding control result.
The complete action control message is usually sent to the gateway, and the gateway may send corresponding control information (e.g. send the control information to the intelligent controller) based on the complete action control message, or may forward the complete action control message to the terminal, the server, the speaker device or other devices. The push-down control message is typically sent directly to the intelligent controller.
Based on this, it is possible to realize: under the condition that no gateway or terminal exists, the wireless switch and the intelligent controller can also perform basic pairing and control function actions. And under the condition of the gateway, the control message is applied by utilizing the complete action, and rich control data can be sent to the gateway, so that when the control data is further forwarded to the server, more rich control actions can be carried out. And both are seamlessly switched. Through the design, signals can be sent respectively when the intelligent controller is pressed and released, double-click, long-press and other actions can be recognized, and the information is sent to the intelligent controller (such as a wall switch) and a gateway, so that rich control actions can be carried out, and rich control effects are achieved.
In addition, in the embodiment of the present application, different combinations based on the number of pressing times, the number of releasing times, and the pressing duration may respectively correspond to the types of manipulation actions, such as a single click operation, a double click operation, a long press operation, an OTA operation, and the like.
(2) The communication processing module generates and sends out a control message according to the trigger signal, and the control message comprises:
Judging whether the wireless switch joins a designated network; if the wireless switch is not added into the appointed network, a second control message is sent outwards; otherwise, sending a second control message and/or a third control message outwards; wherein, the second control message and the receiving object pointed by the third control message are different.
Specifically, if the wireless switch is not networked, the wireless switch can only communicate with the intelligent controller paired with the wireless switch through the vendor custom message, and then the second control message, namely the vendor custom message, is sent outwards when the trigger signal is received, and the receiving object is the intelligent controller paired with the wireless switch. When the wireless switch is connected with the network, the wireless switch can communicate with the matched intelligent controller through the vendor custom message, and can communicate with the connected gateway through the network message, namely the third control message, so that the matched intelligent controller and the networked controlled equipment are controlled. Therefore, when the wireless switch is connected with the network, the second control message can be sent outwards, and the third control message can be sent outwards.
It should be noted that, in some special scenarios of the present application, even if an intelligent controller such as a wall switch or a sound box can be used as a gateway, at this time, the receiving object of the vendor custom message is the device itself, that is, the intelligent controller for controlling pairing with the wireless switch performs corresponding control. The receiving object of the networking message is a device serving as a gateway to communicate with the gateway through a network, i.e. the receiving object of the networking message is essentially the gateway, so that the receiving object of the networking message can be regarded as different from the receiving object of the networking message.
In the embodiment of the present application, the first control action type may be the same as or different from the second control action type and the third control action type. Specifically, when the manipulation action type further includes the first manipulation action type, the communication processing module is further configured to: before or simultaneously with the second control message and the third control message, the first control message is sent; the first control message is used for indicating a wake-up event of the communication processing module, and the first control message is generated by the key in response to the first control action type. The first control message may be a networking message, when the key is awakened by a first action of manipulating and awakening, such as a clicking operation, the first control message may be generated and sent to the outside, in some embodiments, the first control message may further enable the terminal to learn an awakening event of the wireless switch according to the first control message, so as to prompt the user or record the awakening event, and in other embodiments, the first control message only carries event information of the clicking operation and may be regarded as the same type as the third control message.
In a specific implementation scenario of the present application, when it is determined that the wake-up reason of the communication processing module is key wake-up, in a key press sub-process, when it is determined that a key is pressed, different key actions are identified according to a duration of the key press, for example, if the key press duration is not more than 2s and is released, a key release sub-process is entered, and identified as a single click operation, further, in the key release sub-process, the number of single clicks can be continuously determined, and if a second press is detected in a preset short time, identified as a double click operation; if the key is pressed again after double-clicking, the key pressing sub-flow is shifted to, and if the key pressing time in the key pressing sub-flow exceeds 5s but is less than 7s, the double-clicking and long-pressing operation can be identified, and the corresponding event can be a reset network distribution event; if the key pressing time exceeds 7s in the key pressing sub-flow after the key is pressed, identifying that OTA operation is performed, and activating OTA to facilitate upgrading; the upgrade is to upgrade the equipment through intelligent equipment such as a mobile phone, the equipment is activated before the upgrade (after 7S is pressed for a long time, the equipment sends an activation broadcast for 1 minute), the intelligent equipment such as the mobile phone detects the activation broadcast, then the intelligent equipment is connected with the equipment, and the upgrade is carried out after the connection.
For example, when the number of clicks in the key release sub-flow is 1, the timing of 300ms is turned on, and when the second press is not detected at the end of the timing of 300ms, it is determined as a click event, and the click event is transmitted. Otherwise, a millet double click event is sent and the number of single clicks is set to 0. Clicking a key is an event, which may be defined as a light-on event, for example.
Optionally, the communication processing module is further configured to: if the generated message is a first control message and/or a second control message, writing the first control message into a preset reporting event queue. The first control message may be a message corresponding to a key wake-up event, the second control message may be a vendor custom message, and the third control message may be a networking message.
Specifically, various events such as a control event for the pairing intelligent controller, a networking report event, a key wake-up event and the like are generated in each flow, and because the communication processing module is in a first sleep state (such as an SOC OFF mode), in order to increase the response speed, when the key wake-up event is judged to be yes, the event is directly input into the report event queue, and whether the event is transmitted later or not is judged in another way (for example, if the device is not configured with a network, although the event is input into the report event queue, the event is not transmitted), the control event for the pairing intelligent controller does not need to be networked, and therefore the control event can also be directly input into the report event queue.
Further, the communication processing module is further configured to: if the generated message is a third control message, writing the third control message into the report event queue after determining that the wireless switch joins the designated network; and sending out the corresponding message according to the report event queue.
In the embodiment of the application, different control messages correspond to different reporting events, and some reporting events can be sent after the distribution network, so that the networking reporting events are transmitted through a gateway, for example, single click events. Therefore, a wireless switch is required to make a bluetooth connection with the gateway. In the embodiment of the application, if the generated message is a third control message, the network reporting event corresponding to the third control message is indicated, whether the wireless switch is added to the designated network is determined first, and after the wireless switch is determined to be added to the designated network, the third control message is written into the reporting event queue, and the corresponding message is sent outwards.
If the reporting event is a non-networking reporting event, such as a control event to the pairing intelligent controller, the non-networking reporting event is transmitted through Bluetooth or other communication protocols, and the reporting event is written into an event queue. The second control message is taken as a manufacturer custom message, namely a message is transmitted between the pairing intelligent controller and the wireless switch through Bluetooth or other communication protocols, communication can be directly carried out without networking, and the reporting event corresponding to the second control message is a non-networking reporting event.
Specifically, taking the networking report event as the millet event as an example, in order to prevent congestion of the report event queue, if the millet event is judged to be yes, it needs to further judge whether the wireless switch is already connected, and if the wireless switch is already connected, the millet event is put into the report event queue (for example, if a certain key is pressed continuously for multiple times, the communication processing module is awakened by the first pressing, that is, the millet key is awakened, and the event is put into the report event queue, and if the subsequent multiple pressing is not connected with the network, the event is directly put into the report event queue, if the event is not already connected with the network, the congestion of the report event queue is not connected with the network, and if the event is not already connected with the network, then the event is not connected with the network, wherein, the event is awakened by the millet key in the process, and the event is awakened by the first pressing, the event is the event which is sent in the normal process, and if the event is not connected with the network, the whole event is not connected with the network, the network is not connected with the network, and if the event is not connected with the network, the whole event is not connected with the network, and the network is not connected with the network, and the event is not connected with the network.
In the embodiment of the application, after the event is input into the event queue, the package sending can be started only after the initialization of sdk (for example, the millet sdk) preset by the gateway is completed. If the gateway sdk sends the control message first without initializing, the control message may be interrupted by the stop called in the initialization process of the gateway sdk when the control message is sent to half, or the set_data is called to change the data of the control message, thereby causing abnormal control message sending. The two most important resources for initializing the gateway sdk are a serial number and a key (for encrypting data), and therefore, it is necessary to wait for the initialization of the gateway sdk to complete.
When the message is sent outwards in the wireless switch, a report sequence identifier is provided, and the report sequence identifier is used for identifying different messages in a report event queue. Optionally, when the communication processing module sends the corresponding message outwards according to the report event queue, the communication processing module is further configured to: acquiring a reporting sequence identifier, wherein the reporting sequence identifier is used for identifying different messages in the reporting event queue; and based on the report sequence identifier, sending the message in the report event queue outwards.
In an embodiment of the present application, the wireless switch may further include a target memory, where the target memory is a memory that does not lose data after power failure, for example, the target memory may be a Non-volatile memory (NVM), and the target memory may be a flash memory.
In the conventional mode of the wireless switch, taking the sequence identifier as a sequence number as an example, each 1 added to the sequence number exists in the RAM, and each packet sequence number is compared with the previous 1 added, so that the sequence number is not repeated. After entering the first sleep state (e.g., SOC OFF mode), the data stored in the RAM memory area of the wireless switch is lost, so that the communication processing module (e.g., SOC) is reinitialized after each wake-up. The gateway sdk adds 512 to the serial number after each initialization, and stores the serial number in the flash memory, and sends a message according to the serial number added with 512, but adds 512 when each wake-up, and exceeds the range of 1 byte mark, the low byte is unchanged, and the gateway or the cloud of the millet judges whether the packet is repeated or not through the serial number of 8 bits of the low byte, so that the packet loss risk exists. For example, the sequence number is stored in the flash memory every time the packet is sent, the gateway or the cloud side of the millet judges whether the packet is a valid packet according to the low byte (1 byte) of the sequence number, if the sequence number is added 512 each time when the packet is awakened from the first sleep state (such as the SOC OFF mode), the data of the low byte is not changed, for example, the original sequence number is 00000000, the original sequence number is added 512 (2 bytes) and then is changed to 00000010, the low byte 0 is unchanged, or the data of the 8 bits of 00000000, if the packet is judged to be a valid packet according to the low byte of the sequence number, the gateway or the cloud side judges that two packets before the addition 512 and after the addition 512 are the same packets, and then one packet is dropped, thereby causing the packet loss problem.
That is, in the normal mode, the sequence number of the message of the reporting event is added by 1 and stored in the RAM, the sequence number added by 512 is written to the flash memory once, instead of being written to the flash memory once every time, so as to reduce the number of times of reading and writing of the flash, and the gateway sdk also adds and stores the sequence number added by 512 to the flash after waking up from the first sleep state (such as SOC OFF mode) every time, which causes packet loss as described above.
Based on this, in the embodiment of the present application, after the communication processing module enters the second working state in response to the wake-up instruction, the communication processing module is further configured to: acquiring a generated initial sequence identifier, wherein the initial sequence identifier is stored in the random access memory; before sending the message in the report event queue, updating the initial sequence identifier, and storing the updated initial sequence identifier as a report sequence identifier to the target memory.
For example, taking the first sleep state as the SOC OFF mode, the gateway is a millet gateway, and after the communication processing module of the wireless switch wakes up from the SOC OFF mode, the operation of masking the sequence number written by the millet sdk to the flash memory is only written once when data is sent, that is, after the communication processing module wakes up from the SOC OFF mode, the sequence number of the message of the reporting event is added 512 and stored in the RAM, but is not written into the flash memory.
Furthermore, the sequence numbers of the messages based on the reported event can be de-duplicated, for example, 30 packets of data exist in one event, the sequence numbers of the 30 packets of data are identical, the sequence numbers corresponding to different events are different, and then the sequence numbers are required to be introduced for de-duplication, so that the situation that the packets are lost in the same sequence number is avoided.
In some embodiments of the present application, the report sequence identifier includes a deduplication unit; the content of the de-duplication part of the reported sequence identifier is different from that of the de-duplication part of the initial sequence identifier. In the embodiment of the application, the deduplication part can be any byte in the serial number, preferably the lowest byte of the serial number, so that the deduplication can be performed by adding 1bit, the readable and writable times of the flash memory can be increased, and the service life of the flash memory can be prolonged.
For example, when a data packet of a message is sent, the data packet is stored in the flash after the sequence number is added with 1, so that the sequence number is equal to 513, 8 bits of a low byte can be changed, the repeated sequence number can not cause the packet loss by mistake, and the duplication can be removed only by adding only 1 bit, so that the readable and writable times of the flash memory can be increased.
Since the target memory is a memory which does not lose data after power failure, for example, an NVM memory, and the number of times of reading and writing is limited, further, in order to further improve the service life of the target memory, the operation of writing the serial number into the target memory by the gateway sdk can be intercepted (shielded), and the serial number can be saved into the flash memory every time a packet is sent. Specifically, the communication processing module is further configured to: and if a write request for writing the initial sequence identifier into the target memory is received, not responding to the write request.
For example, if a key is pressed 10 ten thousand times, it is necessary to ensure that the service life of the flash memory can be written 10 ten thousand times at least. Whereas 10 ten thousand presses are generally rarely achieved by users, and a typical flash can be written at least 10 ten thousand times, so this approach is feasible and can significantly improve the lifetime of the target memory.
In the embodiment of the application, the control messages corresponding to different home devices are time division multiplexed to avoid collision when the messages are sent even though the control messages are of the same type of communication protocol (for example, different manufacturer devices adopting Bluetooth protocols).
In some embodiments of the present application, when the communication processing module sends the corresponding message outwards according to the report event queue, the communication processing module is further configured to: the method comprises the steps that a first control message in the report event queue is sent outwards through a designated communication channel in a first period; sending the second control message outwards through the appointed communication channel in a second period; and/or sending the third control message outwards through the appointed communication channel in a third period; wherein the first period, the second period, and the third period are different.
For the equipment, taking a gateway and an intelligent controller as examples, sending a first control message to the gateway, and executing a preset broadcasting alternate flow after the sending is completed; and sending a second control message to the intelligent controller, and executing a preset broadcasting alternate flow after the sending is completed. The preset broadcasting alternate flow may be: stop-set data-start-Stop, i.e. Stop bluetooth broadcast-set broadcast data-start bluetooth broadcast-Stop bluetooth broadcast.
The first period, the second period and the third period may be adjacent periods or non-adjacent periods, where it is mainly guaranteed that the control messages are sent in different periods through the designated communication channels, so that time division multiplexing is achieved when the messages are sent, and other specific embodiments are not limited herein.
In the following, the first control message is taken as a networking message, the second control message is taken as a manufacturer custom message, and the manufacturer custom message is also a bluetooth packet, and the output data is bluetooth data no matter the manufacturer custom message or the networking message, but the specific protocols are different. Although vendor custom messages use their own protocols, the hardware base is bluetooth, so time division multiplexing is needed, i.e. vendor custom messages and networking messages are developed separately, and alternate steps are strictly controlled. The alternating execution steps are as follows: stop-set data-start-Stop: stopping bluetooth broadcasting-setting broadcasting data-starting bluetooth broadcasting-stopping bluetooth broadcasting; when the vendor custom message is issued, one Stop-set data-start-Stop is executed, and when the networking message is issued, one Stop-set data-start-Stop is executed. Therefore, different periods of protocol message transmission corresponding to different types of equipment are ensured, and time division multiplexing during message transmission is realized.
In addition, the second control message and/or the third control message bear a connection scanning control parameter, and the connection scanning control parameter is used for indicating that the wireless switch is not connectable and/or not scannable currently.
For example, taking the second control message as a vendor custom message, the vendor custom message carries an ADV parameter, that is, the connection scan control parameter, for indicating that the wireless switch is currently not connectable and/or not scannable. Specifically, the ADV parameter of the vendor custom message can be modified to be non_conn_non_scan (indicating that the connection is not available and the scanning is not available), because when the data packet is sent, one Tx is sent first, and then the Rx is sent (used for scanning), if the data packet is instead not available, only the Tx is needed, and the current for sending the Rx can be omitted, so that the power consumption of the wireless switch can be further reduced.
In the embodiment of the application, the wireless switch only generates an active task when being controlled, and the wireless switch enters the first sleep state (such as SOC OFF mode) in most of the time when not being controlled so as to reduce standby power consumption. Therefore, after the communication processing module sends the control message outwards, if the communication processing module does not have an active task in a first preset period and does not detect that the key is pressed in a second preset period, the communication processing module is switched from the second working state to the first working state (i.e. a sleep state, such as a response mode or an SOC OFF mode).
The communication processing module is used for judging whether a key is pressed in a second preset period if the communication processing module does not have an active task in the first preset period after the control message is sent outwards when entering the first working state in the appointed time after the control message is sent completely; and if the key is not detected to be pressed in the second preset period, switching the communication processing module from the second working state to the first working state.
For example, firstly, it is determined whether the wireless switch is currently active in a first preset period, if so, the active task is executed, if not, a timer with a preset duration (e.g. 15 s) is started, and whether the key is in a release state in a second preset period is detected, if so, it is indicated that there is no active task currently and the key is not pressed, and the first sleep state (SOC OFF mode) can be entered. If not, it indicates that the key is pressed and cannot enter the first sleep state (SOC OFF mode), because the key is immediately awakened if it is pressed for a long time to enter the SOC OFF mode (first sleep state), so that the communication processing module (e.g. SOC) frequently enters and exits the first sleep state (SOC OFF mode) and consumes much power, and therefore, after the key is pressed for a long time, the key enters the second sleep state (e.g. the notification mode) and periodically detects whether the key has been released.
In the embodiment of the application, the second preset period may be 15s, i.e. the 15s timer may be started to set the second preset period, and after 15s, whether the key is released is judged, because the key cannot enter the SOC OFF mode when the key is in the pressed state, and whether the key is released is circularly detected by starting the 15s timer until the key is detected, and then the 15s timer is ended. It should be noted that, the reason for selecting 15 seconds here is that the inventor selects the second preset period with 15s as an example in the above embodiment in consideration of the response speed and the power consumption cost of the wake-up of the recall mode and the socoff mode, and it is understood that other values may be selected for the second preset period, and the second preset period may be increased or decreased on the basis of 15s according to the actual application scenario, which is not limited herein.
The communication processing module judges that no active task can pass through detection of various conditions of the wireless switch in a first preset period.
Specifically, the communication processing module is further configured to: detecting whether the wireless switch is broadcast in a first preset period; detecting whether the wireless switch is in a connection state in a first preset period; and if the wireless switch is not broadcasted in the first preset period and/or is not in a connection state, determining that the communication processing module has no active task in the first preset period.
Further, when detecting whether the wireless switch is in a connected state in a first preset period, the communication processing module is specifically configured to: detecting whether the wireless switch is in a Bluetooth GATT protocol connection state in a first preset period; if the wireless switch is not in the Bluetooth GATT protocol connection state in the first preset period, determining that the wireless switch is not in the connection state in the first preset period.
Further, the communication processing module detects whether the wireless switch is broadcast in a first preset period, including: detecting whether the wireless switch has an unassigned network broadcast in a first preset period; detecting whether the wireless switch has OTA broadcasting in a first preset period; if the wireless switch has no unassigned network broadcast and OTA broadcast in the first preset period, determining that the wireless switch has no broadcast in the first preset period.
For example, the determining, by the communication processing module, that there is no active task in the first preset period may include the following determination:
1. Detecting whether the wireless switch has an unassigned network broadcast in a first preset period;
2. Detecting whether the wireless switch has OTA broadcasting in a first preset period;
3. whether the wireless switch is in a Bluetooth GATT protocol connection state in a first preset period;
4. If the wireless switch is not broadcast in the first preset period and is not in a connection state, determining that the communication processing module has no active task in the first preset period.
It should be noted that, the value of the first preset period and the value of the second preset period may be preset according to the actual application scenario, which is not limited herein.
Before judging whether the wireless switch has an active task in a first preset period, the wireless switch can firstly enter a sleep locking state, in the sleep locking state, the communication processing module cannot enter the first sleep state (SOC OFF mode), but can enter a second sleep state (regeneration mode), so that the wireless switch is prevented from directly entering the first sleep state (SOC OFF mode) when the wireless switch has the active task, and then exits after the wireless switch has the active task, and the power consumption is overlarge due to repeated adjustment of the working state.
Specifically, before detecting whether the wireless switch is broadcast in the first preset period, the communication processing module is further configured to: and locking the communication processing module to enable the communication processing module to enter a dormant locking state, wherein the communication processing module can be set to enter the second dormant state and cannot be set to enter the first dormant state in the dormant locking state.
For example, the wireless gateway has a sleep Lock state, i.e., a hiber state, and may perform Lock hiber before determining whether the wireless switch has an active task in the first preset period: after hiber is locked, the communication processing module cannot enter the first sleep state (SOC OFF mode) but can enter the second sleep state (attention mode).
In the embodiment of the application, the communication processing module of the timing wake-up wireless switch can be further set, the timing duration can be set through a timer, and the communication processing module of the timing wake-up wireless switch can be started, for example, the electric quantity detection timer is started for 50 minutes: one function is to send out the electric quantity data every 50 minutes, and the other function is to have a keep-alive operation with the gateway to tell the gateway that the wireless switch is still on-line.
It should be noted that, in the embodiment of the present application, before entering the first sleep state (SOC OFF mode), the wireless switch needs to ensure that only one timer (i.e. the power detection timer) is active, otherwise, it cannot be determined which timer is awake when waking up next time. Of course, it is possible to identify which timer is awake (e.g. record the current state into flash memory, and transition from the current state to another state when waking up next time) by means of a timestamp, but the timestamp is not necessarily accurate.
Specifically, before the second working state is switched to the first working state, the communication processing module is further configured to: it is determined that the wireless switch is currently only one timing task to be turned on, the timing task being for periodically generating a timing signal to periodically wake up the communication processing module.
Optionally, after entering the second working state in response to the wake-up instruction, the communication processing module is further configured to: if the wake-up instruction is judged not to be a trigger signal and a timing signal, the communication processing module is switched from the second working state to the second dormant state; after keeping the communication processing module in the second dormant state for a preset time, acquiring stable electric quantity information of the power supply module; and sending out a state message comprising the stable electric quantity information.
Specifically, the wake-up instruction is not a trigger signal and a timing signal, that is, represents that the wake-up type of the communication processing module is not button wake-up or timing wake-up, if the wake-up type of the communication processing module is not button wake-up or timing wake-up, or is wake-up due to other reasons, such as OTA wake-up, software reset, etc., after timing 10s (within 10s, the program is in a recovery mode, that is, the program is suspended, and continues to be executed after completion, and is not reinitialized), stable electric quantity collection (such as ADC electric quantity collection) is performed, and the reason for timing 10s is to avoid larger power-up power consumption, pull down the battery voltage, and cause inaccurate collected battery voltage. After the voltage is collected, whether the wireless switch is matched with a network is judged, namely whether the wireless switch is added into a gateway or not is judged, if the wireless switch is not added, whether the wireless switch is subjected to factory test (aiming at measuring current), and if the voltage is not measured to be 0.3uA, the control board of the wireless switch possibly has the problems of electric leakage and the like. And when the wireless switch is judged to be not provided with the network, the factory test is not performed, and the network distribution flow of the wireless switch is directly entered to complete the network distribution of the wireless switch. After judging that the wireless switch is matched with the network, namely added into the gateway, entering a low-power consumption flow to enter a first sleep state (SOC OFF mode) mode, and reducing standby power consumption.
In the embodiment of the application, some reporting events (such as generated energy and millet events) can be sent only after the wireless switch is distributed with the network, so that the wireless switch is required to be connected with the gateway through Bluetooth. For example, if the wireless switch is already configured with the network, the power event is directly reported, and after the power event is acquired by other terminals, the user can check how much power remains.
Therefore, before the communication processing module sends the status message including the stable electric quantity information, the communication processing module is further configured to: confirming that the wireless switch is configured with a network; if the wireless switch is not matched with the network, broadcasting a network distribution message outwards; if a device adding request returned by the designated device based on the broadcast distribution network message is obtained, generating a confirmation message in response to target operation received by the key, wherein the confirmation message characterizes the wireless switch and/or the target operation; sending the confirmation message outwards; and receiving a connection network access request returned by the designated equipment based on the confirmation message, and joining a network corresponding to the designated equipment according to the connection network access request.
In a specific application scenario, if the wireless gateway is not configured with a network, the communication processing module configures the network for the wireless switch, including:
(1) If the wireless switch is not matched with the network, a broadcast network distribution message is sent.
If the network is not allocated, the wireless switch and the gateway are allocated. Specifically, the wireless switch firstly broadcasts the distribution network message outwards, the terminal can display the wireless switch after scanning the broadcast distribution network message, after receiving the operation of adding the wireless switch on the terminal by a user (such as clicking the wireless switch on a terminal APP interface), continuously judging whether a single click event occurs on the wireless switch, if so, broadcasting the message marked with the single click event outwards, prompting the user whether to confirm the addition after scanning the message on the terminal, if the user confirms the addition of the wireless switch on the terminal APP, entering a terminal APP connection network access sub-flow, initiating connection by the terminal APP, establishing connection with the wireless switch to enable the wireless switch to access the network, and interacting information such as key information. The reason for detecting the clicking event is as follows: if 10 wireless gateways are scanned into the addable list of the terminal APP at the same time and only one of the wireless gateways is wanted to be added, the key of the wireless gateway is pressed down so as to be convenient for sending a broadcast with a flag bit to the terminal, and the terminal adds the equipment, so that the mistaken addition is prevented.
Specifically, the wireless switch may send a broadcast network allocation message without a single click event flag bit in a period of 200ms first, and perform 2 minutes of broadcast timing, that is, the time that the device can add is only two minutes, for example, the terminal scans the broadcast network allocation message sent by the wireless switch and displays that the wireless switch can be added, if 2 minutes have passed, the wireless switch can be added, and if 2 minutes have not passed, the wireless switch cannot be added. If it is desired to add it later, the wireless switch is reset.
(2) If a device adding request based on the broadcast distribution network message returned by the gateway is obtained, judging whether a click operation exists on a key on the wireless switch.
If the equipment is added within 2 minutes, the APP performs scanning addition, namely the APP scans the millet beacon broadcast without the single click event zone bit sent by the equipment, and then the equipment is displayed on the APP to be added; the wireless switch continues to determine whether a click has occurred.
(3) If the click operation exists on the key on the wireless switch, a click broadcast message identifying the click operation is sent out.
If the click operation exists on the key on the wireless switch, a click broadcast message identifying the click operation is sent out. For example, a click broadcast message is sent with a 200ms period identifying a click operation. And after the APP scans the broadcast, 10s countdown is carried out, namely, the equipment is added to the time of the user for 10s to access the network, and the 10s countdown is finished.
(4) When a device adding request based on a click broadcast message returned by the gateway is obtained, network connection is established between the wireless switch and the gateway.
For example, after scanning the broadcast, the terminal APP sends a connection window for 10s counting down, and if it detects that the confirm key is pressed within 10s, the wireless gateway is added. When the wireless gateway obtains a device adding request based on a click broadcast message returned by the gateway, network connection is established between the wireless switch and the gateway. And when the wireless gateway does not acquire the equipment adding request based on the click broadcast message returned by the gateway, repeatedly sending the click broadcast message with the click operation identified. For example, if the confirmation key is not detected to be pressed within 10 seconds, the wireless switch continues to send a broadcast network allocation message with a period of 200ms, so that other devices can be added. The purpose of timing 10s is, among other things, that it is desired to add this device within 10 s. In order to allow the user operating time on the terminal, different manufacturers may be different. If the user clicks the add button within 10s, a network connection is established between the wireless switch and the gateway.
Furthermore, in the embodiment of the present application, when the terminal APP initiates connection to the wireless switch to access the network, the wireless switch may first enter a connection locking state, where the communication processing module cannot enter the first working state. Specifically, the communication processing module is further configured to: if a connection network access request sent by a designated device is received, setting the communication processing module to a connection locking state, wherein the communication processing module cannot enter the first working state in the connection locking state;
At this time, after completing the wireless switch network allocation, the communication processing module is further configured to: and releasing the connection locking state of the communication processing module so that the communication processing module can enter the first working state.
In one embodiment of the present application, the terminal APP initiates connection to the wireless switch to access the network, and performs Lock sleep, where Lock sleep is a connection locking state, so as not to allow a chip (i.e. a communication processing module) of the wireless switch to enter sleep mode, because: in the process of Bluetooth network allocation, bluetooth GATT protocol connection is needed, and an internal 32K RC clock source has large drift and cannot establish connection (clock precision needs < =500 ppm). Therefore, when the network is connected, the 16M master clock is used for locking sleep, and after the connection is disconnected, the clock is unlocked (or an external 32K crystal oscillator is used). The clock is prevented from being asynchronous when the sleep mode is suddenly entered in the Bluetooth GATT protocol connection process, and further the Bluetooth GATT protocol connection is affected due to unexpected disconnection of the Bluetooth GATT protocol connection caused by inaccurate clock, so that the stability of the Bluetooth GATT protocol connection is improved. After key information interaction and network access are completed in the Lock sleep, the Lock sleep can be unlocked after the connection is disconnected. Wherein the bluetooth connection comprises two communications: connection state communication and broadcast state communication; the connection state communication is mainly used for network access, and the connection is disconnected after the network access is successful, namely the connection state communication is disconnected, and then an event (control message) is sent through the broadcast state communication. The message sent after successful network access is provided with security information (key) so as to judge whether the device is legal or not, namely, the Lock sleep is carried out in the connection state communication in the description.
The present application also provides a wireless switch comprising: the device comprises a power supply module, a communication processing module, a bottom shell, at least one key and at least one induction module;
the keys are connected with the bottom shell in a sealing way so as to form a sealing cavity; the power supply module, the communication processing module and the induction module are all arranged in the sealed cavity;
The power supply module is electrically connected with the communication processing module to supply power to the communication processing module; the key can trigger the corresponding sensing module in response to external control; the sensing module is electrically connected with the communication processing module so as to transmit a trigger signal to the communication processing module when touched; the communication processing module is used for: responding to the wake-up instruction to enter a second working state; if the wake-up instruction is determined to be the trigger signal, generating and sending out a control message according to the trigger signal, and entering a first working state within a designated time after the control message is sent out;
The communication processing module is configured to be in a first sleep state if the communication processing module has a specified state, and is configured to be in a second sleep state if the communication processing module has the specified state; the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
In the wireless switch provided by the embodiment of the application, the communication processing module is set to the second dormant state in a normal state of the wireless switch, and is switched to the second working state from the second dormant state after receiving the wake-up instruction, so that the power consumption is the lowest, the standby power consumption and the running power consumption of the switch can be reduced, and the service life of a battery of the wireless switch is prolonged. Further, if the communication processing module has a specified state, the first working state is configured as a first dormant state, otherwise, the first working state is configured as a second dormant state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6]. Because the duration of the first working state is far longer than the message transmitting time of the second working state in the appointed state, the standby power consumption of the wireless switch can be further reduced, and the service life of the wireless switch battery is prolonged.
Further, the key comprises a thick-wall area and a thin-wall area positioned in the thick-wall area, wherein an abutting arm is arranged in the thin-wall area, the thickness of the thick-wall area is larger than that of the thin-wall area, the position of the sensing module is matched with that of the abutting arm, and when the sensing module is triggered by extrusion of the thin-wall area, the key is detected to be pressed down.
According to the embodiment of the application, the key is fixed through the thick-wall area, the thin-wall area is supported, and the deformation quantity is generated through the thin-wall area, so that the effective triggering of the switch component can be realized under the action of external force, and the self-recovery force can be realized; and the thin-wall area can trigger the switch component by itself or the abutting arm, and the thin-wall area and the thick-wall area are integrally formed, so that the production process and the cost are saved, and the connection part between the thin-wall area and the thick-wall area is well sealed, waterproof and dustproof.
In a specific embodiment, taking a communication processing module as an example of a chip, referring to fig. 4-8, in the embodiment of the present application, the wireless switch 1 includes a control board 3 and a battery 72, the control board 3 is integrated with the chip, the wireless switch 1 includes a key 1 and a bottom shell 2, the key 1 and the bottom shell 2 form a cavity, a groove 114 is disposed on an inner wall of the key 1, a sealing member 4 is disposed in the groove 114, an edge of the bottom shell 2 penetrates into the groove 114 and presses the sealing member 4 to seal the key 1 and the bottom shell 2, the key 1 includes a thick-wall area 112 and a thin-wall area 111 located in the thick-wall area 112, an abutment arm 13 is disposed in the thin-wall area 111, a thickness of the thick-wall area 112 is greater than that of the thin-wall area 111, a switch part 5 is disposed at a position of the control board 3 corresponding to the abutment arm 13, and when the thin-wall area 111 is pressed to trigger the switch part 5, the key 1 is detected to be pressed.
The wireless switch 1 comprises a key 1, a bottom shell 2, a control board 3 and a sealing element 4. The sealing element 4 is matched with the key 1 and the bottom shell 2 to form a sealing cavity; the control panel 3 is positioned in the sealing cavity, and the control panel 3 is connected with the switch component 5; when the key 1 is subjected to external force, the key presses against and triggers the switch component 5. The control board 3 is provided with a light emitting member 61 and a light condensing member 62.
The light emitting member 61 is connected to the control board 3, so that the light emitting area corresponding to the light emitting member 61 is generally located within the thin-walled area, so as to be more beneficial to the light transmission. The light emitting member 61 may be an LED, and the light condensing member 62 may be annular foam. The annular foam is attached to the PCB, encloses the LEDs and can play a role in condensing light. The switch part 5 can be triggered when the middle area of the key 1 is pressed, the emitter can send out a signal, meanwhile, the LED can be lightened, light emitted by the LED passes through the condensing effect of the annular foam and directly passes through the thin wall of the key 1 to transmit light, an additional light guide column is not needed, and meanwhile, a good waterproof effect can be achieved.
The key 1 includes a thin-walled region 111 and a thick-walled region 112; the thin-walled region 111 is located in the thick-walled region 112, the abutting arm 13 is provided in the middle of the thin-walled region 111, the key 1 includes a key panel 11 and a key side wall 12, the key panel 11 includes the thin-walled region 111 and the thick-walled region 112, the key side wall 12 and the thick-walled region 112 together may also be referred to as a thick-walled region, and when the thin-walled region including the abutting arm 13 region is pressed 111, the switch member 5 is triggered.
The sealing element 4 cooperates with the key 1 and the bottom shell 2 to form a sealing cavity so as to realize effective waterproof sealing. The sealing ring can be extruded after the key 1 and the bottom shell 2 are assembled to form a waterproof seal. One design approach for waterproof sealing: the inner side of the panel of the key and the side wall of the key form a groove; the sealing element 4 is placed in the groove, and when the key 1 is clamped with the bottom shell 2, the side wall of the bottom shell presses the sealing element 4 to form a sealing cavity. In this way, the sealing element 4 is placed on the key 1, and the sealing element 4 is pressed by the bottom shell 2, so that a waterproof seal is realized.
The bottom shell 2 and the key 1 are buckled through buckling buckles and/or anti-loosening buckles. The side wall of the key 1 is provided with an assembling clamping groove 14 and a fixing clamping hook 15, and the bottom shell 2 is provided with an assembling clamping hook 23, an elastic clamping hook 24 and a clamping hook hole 25.
In the embodiment of the application, the key 1 is a thin-wall key, and the function of the switch component can be triggered by light touch of the thin-wall key, and the switch component can also be a light touch switch. Namely, by adding sealing elements such as waterproof adhesive strips, rubber rings and the like, sealing is formed between the fixed part of the key and the bottom shell of the signal transmitter, so that the waterproof is realized without additional waterproof design, and the structure is simple and reliable. The signal transmitter has the advantages of simple integral structure, convenient operation, easy disassembly and assembly, convenient replacement or maintenance of internal parts by users, tight clamping, difficult looseness and good waterproof performance. Through the design of thin wall button and waterproof sealing circle, realized simple reliable waterproof dustproof function.
Referring to fig. 9 to 10, in another embodiment based on the same inventive concept, the wireless switch includes a key 1a, a control board 3a, a bottom case 2a, a battery 72a, and a sealing member (not shown). ; the difference from the above-described solution is that the keys 1a are square or rectangular instead of circular. Correspondingly, the bottom shell 2a, the control board 3a, etc. are also square correspondingly. The key has a plurality of thin-walled areas 111a, a plurality of contact arms 13a are correspondingly arranged, a plurality of switch members 5a are correspondingly arranged on the control board 3a, and each contact arm can trigger the corresponding switch member 5a when the thin-walled area 111a is pressed. The key 1a comprises a key side wall 12a.
In some embodiments of the application, the communication processing module includes a random access memory; if the first working state is configured to be a first dormant state, the random access memory is powered off when the communication processing module is in the first working state; and if the first working state is configured to be the second dormant state, the communication processing module reserves at least part of data in the random access memory when in the first working state.
In some embodiments of the present application, the communication processing module is further configured to, after entering the second operating state in response to the wake-up instruction:
And if the wake-up instruction is judged to be a timing signal, acquiring the electric quantity information of the power supply module, and sending a state message outwards, wherein the state message characterizes the electric quantity information.
In some embodiments of the present application, the communication processing module is further configured to determine whether the wake-up instruction is a trigger signal before determining whether the wake-up instruction is a timing signal.
In some embodiments of the present application, the communication processing module is further configured to generate and send out a control packet according to the trigger signal:
And determining the current state of the key, judging the control action type of the key in the appointed time if the key is in the release state, and sending out a corresponding control message.
In some embodiments of the present application, the communication processing module generates and sends out a control packet according to the trigger signal, including:
Judging the control action type of the key in the appointed time, and sending a second control message and/or a third control message outwards according to the control action type; the second control message is generated by the key in response to the second control action type, and the third control message is generated by the key in response to the third control action type; at least one of the following of the second and third manipulation action types is distinguished: the number of pressing times, the number of releasing times and the duration of pressing;
And/or the number of the groups of groups,
Judging whether the wireless switch joins a designated network; if yes, a second control message is sent outwards; otherwise, sending a second control message and/or a third control message outwards; wherein, the second control message and the receiving object pointed by the third control message are different.
In some embodiments of the present application, the manipulation action type further includes a first manipulation action type, and the communication processing module is further configured to: before or simultaneously with the second control message and the third control message, the first control message is sent; the first control message is used for indicating that the communication processing module is awakened, and the first control message is generated by the key in response to the first control action type.
In some embodiments of the application, the communication processing module is further configured to:
if the generated message is a first control message and/or a second control message, writing the first control message into a preset reporting event queue;
If the generated message is a third control message, writing the third control message into the report event queue after determining that the wireless switch joins the designated network;
And sending out the corresponding message according to the report event queue.
In some embodiments of the present application, when the communication processing module sends the corresponding message outwards according to the report event queue, the communication processing module is further configured to:
Acquiring a reporting sequence identifier, wherein the reporting sequence identifier is used for identifying different messages in the reporting event queue;
and based on the report sequence identifier, sending the message in the report event queue outwards.
In some embodiments of the present application, the wireless switch further includes a target memory, where the target memory is a memory that does not lose data after power failure; the communication processing module is further configured to, after entering the second working state in response to the wake-up instruction:
acquiring a generated initial sequence identifier, wherein the initial sequence identifier is stored in the random access memory;
Before sending the message in the report event queue, updating the initial sequence identifier, and storing the updated initial sequence identifier as a report sequence identifier to the target memory.
In some embodiments of the present application, the report sequence identifier includes a deduplication unit; the content of the de-duplication part of the reported sequence identifier is different from that of the de-duplication part of the initial sequence identifier.
In some embodiments of the application, the communication processing module is further configured to:
And if a write request for writing the initial sequence identifier into the target memory is received, not responding to the write request.
In some embodiments of the present application, when the communication processing module sends the corresponding message outwards according to the report event queue, the communication processing module is further configured to:
The method comprises the steps that a first control message in the report event queue is sent outwards through a designated communication channel in a first period; sending the second control message outwards through the appointed communication channel in a second period; and/or sending the third control message outwards through the appointed communication channel in a third period;
wherein the first period, the second period, and the third period are different.
In some embodiments of the present application, the second control packet and/or the third control packet carries a connection scan control parameter, where the connection scan control parameter is used to indicate that the wireless switch is currently not connectable and/or not scannable.
In some embodiments of the present application, when the communication processing module enters the first working state within a specified time after the control packet is sent, the communication processing module is further configured to:
after the control message is sent outwards, if the communication processing module has no active task in a first preset period, judging whether the communication processing module detects that a key is pressed in a second preset period;
And if the key is not detected to be pressed in the second preset period, switching the communication processing module from the second working state to the first working state.
In some embodiments of the application, the communication processing module is further configured to:
detecting whether the wireless switch is broadcast in a first preset period;
detecting whether the wireless switch is in a connection state in a first preset period;
And if the wireless switch is not broadcasted in the first preset period and/or is not in a connection state, determining that the communication processing module has no active task in the first preset period.
In some embodiments of the present application, the communication processing module is specifically configured to, when detecting whether the wireless switch is in a connected state within a first preset period:
Detecting whether the wireless switch is in a Bluetooth GATT protocol connection state in a first preset period;
If the wireless switch is not in the Bluetooth GATT protocol connection state in the first preset period, determining that the wireless switch is not in the connection state in the first preset period.
In some embodiments of the present application, the communication processing module is further configured to, prior to detecting whether the wireless switch is broadcasting within a first preset period:
And locking the communication processing module to enable the communication processing module to enter a dormant locking state, wherein the communication processing module can be set to enter the second dormant state and cannot be set to enter the first dormant state in the dormant locking state.
In some embodiments of the present application, the communication processing module is further configured to, before switching from the second operation state to the first operation state:
It is determined that the wireless switch is currently only one timing task to be turned on, the timing task being for periodically generating a timing signal to periodically wake up the communication processing module.
In some embodiments of the present application, the communication processing module is further configured to, after entering the second operating state in response to the wake-up instruction:
If the wake-up instruction is judged not to be a trigger signal and a timing signal, the communication processing module is switched from the second working state to the second dormant state;
after keeping the communication processing module in the second dormant state for a preset time, acquiring stable electric quantity information of the power supply module;
and sending out a state message comprising the stable electric quantity information.
In some embodiments of the present application, before the communication processing module sends the status message including the stable electric quantity information, the communication processing module is further configured to:
Confirming that the wireless switch is configured with a network;
If the wireless switch is not matched with the network, broadcasting a network distribution message outwards;
if a device adding request returned by the designated device based on the broadcast distribution network message is obtained, generating a confirmation message in response to target operation received by the key, wherein the confirmation message characterizes the wireless switch and/or the target operation;
sending the confirmation message outwards;
And receiving a connection network access request returned by the designated equipment based on the confirmation message, and joining a network corresponding to the designated equipment according to the connection network access request.
In some embodiments of the application, the communication processing module is further configured to:
If a connection network access request sent by a designated device is received, setting the communication processing module to a connection locking state, wherein the communication processing module cannot enter the first working state in the connection locking state;
The communication processing module is further configured to, after completing the wireless switch network configuration:
And releasing the connection locking state of the communication processing module so that the communication processing module can enter the first working state.
The technical terms, features, alternative embodiments and technical effects referred to above can be understood with reference to the related description of the above embodiments, and will not be described here again for repeated matters.
In order to better implement the wireless switch in the embodiment of the present application, on the basis of the wireless switch, the embodiment of the present application further provides a processing method of the wireless switch, as shown in fig. 11, which is a schematic flow chart of an embodiment of the processing method of the wireless switch, where the processing method of the wireless switch includes:
1101. The wireless switch enters a second operating state in response to the wake-up instruction.
1102. If the wake-up instruction is determined to be a trigger signal, the wireless switch generates and outwards transmits a control message according to the trigger signal, and enters a first working state within a designated time after the control message is transmitted; the trigger signal is generated in response to external manipulation of a key of the wireless switch;
The wireless switch is configured to be in a first sleep state if the wireless switch has a specified state, otherwise, the first working state is configured to be in a second sleep state; the power consumption of the wireless switch in the first dormant state is smaller than that in the second dormant state, and the power consumption of the wireless switch when the wireless switch is switched from the first dormant state to the second working state is larger than that when the wireless switch is switched from the second dormant state to the second working state; the power consumption of the wireless switch in the first working state is smaller than that in the second working state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6].
The processing method of the wireless switch provided by the application can respond to the wake-up instruction to enter the second working state in the first working state of the wireless switch; if the wake-up instruction is determined to be a trigger signal, a control message is generated and sent outwards according to the trigger signal, and the first working state is entered in a designated time after the control message is sent. Because the power consumption of the communication processing module in the first dormant state is smaller than that in the second dormant state, and the power consumption of the communication processing module when the communication processing module is switched from the first dormant state to the second working state is larger than that when the communication processing module is switched from the second dormant state to the second working state; the power consumption of the communication processing module in the first working state is smaller than that in the second working state. Therefore, the communication processing module is set to be in the second dormant state in the normal state of the wireless switch, and is switched to enter the second working state from the second dormant state after receiving the wake-up instruction, so that the power consumption is the lowest, the standby power consumption and the running power consumption of the switch can be reduced, and the service life of the battery of the wireless switch is prolonged.
Further, if the communication processing module has a specified state, the first working state is configured as a first dormant state, otherwise, the first working state is configured as a second dormant state; the specified state is: the ratio of the duration of the first working state to the message transmitting time in the second working state is greater than or equal to N, and the value of N is [4,6]. Because the duration of the first working state is far longer than the message transmitting time of the second working state in the appointed state, the standby power consumption of the wireless switch can be further reduced, and the service life of the wireless switch battery is prolonged.
In some embodiments of the application, the wireless switch includes a random access memory; if the first working state is configured to be a first dormant state, the random access memory is powered off when the wireless switch is in the first working state; and if the first working state is configured to be the second dormant state, the wireless switch keeps at least part of data in the random access memory when in the first working state.
In some embodiments of the application, after entering the second operational state in response to the wake-up instruction, the method further comprises:
And if the wake-up instruction is judged to be a timing signal, acquiring the electric quantity information of the power supply module, and sending a state message outwards, wherein the state message characterizes the electric quantity information.
In some embodiments of the application, the method further comprises: before judging whether the wake-up instruction is a timing signal, judging whether the wake-up instruction is a trigger signal.
In some embodiments of the present application, if the wake-up instruction is determined to be the trigger signal, when the control packet is generated and sent out according to the trigger signal, the method further includes:
And determining the current state of the key, judging the control action type of the key in the appointed time if the key is in the release state, and sending out a corresponding control message.
In some embodiments of the present application, the generating and sending the control packet according to the trigger signal includes:
Judging the control action type of the key in the appointed time, and sending a second control message and/or a third control message outwards according to the control action type; the second control message is generated by the key in response to the second control action type, and the third control message is generated by the key in response to the third control action type; at least one of the following of the second and third manipulation action types is distinguished: the number of pressing times, the number of releasing times and the duration of pressing;
And/or the number of the groups of groups,
Judging whether the wireless switch joins a designated network; if the wireless switch is not added into the appointed network, a second control message is sent outwards; otherwise, sending a second control message and/or a third control message outwards; wherein, the second control message and the receiving object pointed by the third control message are different.
In some embodiments of the present application, the manipulation action type further includes a first manipulation action type, and the method further includes: before or simultaneously with the second control message and the third control message, the first control message is sent; the first control message is used for indicating that the communication processing module is awakened, and the first control message is generated by the key in response to the first control action type.
In some embodiments of the present application, as shown in fig. 12, the method further includes the following steps 1201-1203:
1201. If the generated message is a first control message and/or a second control message, writing the first control message into a preset reporting event queue.
1202. If the generated message is a third control message, writing the third control message into the report event queue after determining that the wireless switch joins the designated network.
1203. And sending out the corresponding message according to the report event queue.
In some embodiments of the present application, as shown in fig. 13, when in step 1203, a corresponding message is sent outwards according to the report event queue, the method may further include the following steps 1301 to 1302:
1301. And acquiring a reporting sequence identifier, wherein the reporting sequence identifier is used for identifying different messages in the reporting event queue.
1302. And based on the report sequence identifier, sending the message in the report event queue outwards.
In some embodiments of the present application, the wireless switch further includes a target memory, where the target memory is a memory that does not lose data after power failure; after the wake-up instruction enters the second working state, the method further comprises the following steps:
acquiring a generated initial sequence identifier, wherein the initial sequence identifier is stored in the random access memory;
Before sending the message in the report event queue, updating the initial sequence identifier, and storing the updated initial sequence identifier as a report sequence identifier to the target memory.
In some embodiments of the present application, the report sequence identifier includes a deduplication unit; the content of the de-duplication part of the reported sequence identifier is different from that of the de-duplication part of the initial sequence identifier.
In some embodiments of the application, the method further comprises:
And if a write request for writing the initial sequence identifier into the target memory is received, not responding to the write request.
In some embodiments of the present application, when sending the corresponding message outwards according to the report event queue, the method further includes:
The method comprises the steps that a first control message in the report event queue is sent outwards through a designated communication channel in a first period; sending the second control message outwards through the appointed communication channel in a second period; and/or sending the third control message outwards through the appointed communication channel in a third period;
wherein the first period, the second period, and the third period are different.
In some embodiments of the present application, the second control packet and/or the third control packet carries a connection scan control parameter, where the connection scan control parameter is used to indicate that the wireless switch is currently not connectable and/or not scannable.
In some embodiments of the present application, when the first working state is entered within a specified time after the control packet is sent, the method further includes:
after the control message is sent outwards, if the communication processing module has no active task in a first preset period, judging whether the communication processing module detects that a key is pressed in a second preset period;
And if the key is not detected to be pressed in the second preset period, switching the communication processing module from the second working state to the first working state.
In some embodiments of the application, the method further comprises:
detecting whether the wireless switch is broadcast in a first preset period;
detecting whether the wireless switch is in a connection state in a first preset period;
And if the wireless switch is not broadcasted in the first preset period and/or is not in a connection state, determining that the communication processing module has no active task in the first preset period.
In some embodiments of the present application, the detecting whether the wireless switch is in a connected state in a first preset period specifically includes:
Detecting whether the wireless switch is in a Bluetooth GATT protocol connection state in a first preset period;
If the wireless switch is not in the Bluetooth GATT protocol connection state in the first preset period, determining that the wireless switch is not in the connection state in the first preset period.
In some embodiments of the present application, before detecting whether the wireless switch is broadcast within a first preset period, the method further includes:
And locking the communication processing module to enable the communication processing module to enter a dormant locking state, wherein the communication processing module can be set to enter the second dormant state and cannot be set to enter the first dormant state in the dormant locking state.
In some embodiments of the present application, before the switching from the second operation state to the first operation state, the method further includes:
It is determined that the wireless switch is currently only one timing task to be turned on, the timing task being for periodically generating a timing signal to periodically wake up the communication processing module.
In some embodiments of the application, after entering the second operating state in response to the wake-up instruction, the method further comprises:
If the wake-up instruction is judged not to be a trigger signal and a timing signal, the communication processing module is switched from the second working state to the second dormant state;
after keeping the communication processing module in the second dormant state for a preset time, acquiring stable electric quantity information of the power supply module;
and sending out a state message comprising the stable electric quantity information.
In some embodiments of the present application, as shown in fig. 14, before the status message including the stable electric quantity information is sent out, the method further includes the following steps 1401 to 1405:
1401. confirming that the wireless switch is configured with a network;
1402. if the wireless switch is not matched with the network, broadcasting a network distribution message outwards;
1403. if a device adding request returned by the designated device based on the broadcast distribution network message is obtained, generating a confirmation message in response to target operation received by the key, wherein the confirmation message characterizes the wireless switch and/or the target operation;
1404. Sending the confirmation message outwards;
1405. And receiving a connection network access request returned by the designated equipment based on the confirmation message, and joining a network corresponding to the designated equipment according to the connection network access request.
In some embodiments of the application, the method further comprises:
If a connection network access request sent by a designated device is received, setting the communication processing module to a connection locking state, wherein the communication processing module cannot enter the first working state in the connection locking state;
After the wireless switch network is configured, the method further comprises:
And releasing the connection locking state of the communication processing module so that the communication processing module can enter the first working state.
The technical terms, features, alternative embodiments and technical effects referred to above can be understood with reference to the related description of the above embodiments, and will not be described here again for repeated matters.
As shown in fig. 15, an internal structure of the wireless switch according to the embodiment of the present application is schematically shown, specifically:
The wireless switch may include one or more processor cores 'processors 1501, one or more computer-readable storage media's memory 1502, power supply 1503, and input unit 1504, among other components. It will be appreciated by those skilled in the art that the wireless switch structure shown in the figures is not limiting and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components. Wherein:
The processor 1501 is a control center of the wireless switch, connects various parts of the entire wireless switch using various interfaces and lines, and performs various functions of the wireless switch and processes data by running or executing software programs and/or modules stored in the memory 1502 and invoking data stored in the memory 1502, thereby performing overall monitoring of the wireless switch. Optionally, the processor 1501 may include one or more processing cores; the Processor 1501 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and preferably the processor 1501 may integrate an application processor primarily handling operating systems, user interfaces, application programs, etc. and a modem processor primarily handling wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1501.
The memory 1502 may be used to store software programs and modules, and the processor 1501 executes the software programs and modules stored in the memory 1502 to perform various functional applications and data processing. The memory 1502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the wireless switch, etc. In addition, the memory 1502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1502 may also include a memory controller to provide the processor 1501 with access to the memory 1502.
The wireless switch also includes a power supply 1503 for powering the various components, preferably, the power supply 1503 can be logically coupled to the processor 1501 by a power management system to provide for managing charging, discharging, and power consumption by the power management system. The power supply 1503 may also include one or more of any components, such as a dc or ac power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The wireless switch may also include an input unit 1504, which input unit 1504 may be used to receive entered numeric or character information, as well as to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the wireless switch may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 1501 in the wireless switch loads executable files corresponding to the processes of one or more application programs into the memory 1502 according to the following instructions, and the processor 1501 executes the application programs stored in the memory 1502, so as to implement the steps in the processing method of the wireless switch.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), random access Memory (RAM, randomAccess Memory), magnetic disk or optical disk, etc. The computer program is stored on the wireless switch, and the computer program is loaded by a processor to execute the steps in any control method of the wireless switch provided by the embodiment of the application. For example, loading the computer program by the processor may perform the steps in the processing method of the wireless switch described above.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of one embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of other embodiments, which are not described herein again.
In the implementation, each unit or structure may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit or structure may be referred to the foregoing method embodiments and will not be repeated herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The above description is provided in detail of a wireless switch, a processing method of the wireless switch and a control system provided by the embodiment of the present application, and specific examples are applied to describe the principles and implementations of the present application, where the description of the above embodiments is only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the ideas of the present application, the present description should not be construed as limiting the present application in summary.

Claims (10)

1. A wireless switch, comprising: the device comprises a power supply module, a communication processing module, a bottom shell, at least one key and at least one induction module;
The keys are arranged on the bottom shell;
The power supply module is electrically connected with the communication processing module to supply power to the communication processing module;
The key can trigger the corresponding sensing module in response to external control;
The sensing module is electrically connected with the communication processing module so as to transmit a trigger signal to the communication processing module when triggered.
2. The wireless switch of claim 1, wherein the communication processing module is configured to:
Responding to the wake-up instruction to enter a second working state;
If the wake-up instruction is determined to be the trigger signal, generating and sending out a control message according to the trigger signal, and entering a first working state within a designated time after the control message is sent out; the power consumption of the communication processing module in the first working state is smaller than that in the second working state.
3. The wireless switch of claim 1, wherein the communication processing module, after entering the second operational state in response to the wake-up instruction, is further configured to:
And if the wake-up instruction is judged to be a timing signal, acquiring the electric quantity information of the power supply module, and sending a state message outwards, wherein the state message characterizes the electric quantity information.
4. The wireless switch of claim 3, wherein the communication processing module is further configured to determine whether the wake-up instruction is a trigger signal before determining whether the wake-up instruction is a timing signal.
5. The wireless switch of claim 1, wherein the communication processing module generates and sends out a control message according to the trigger signal, comprising:
Judging the control action type of the key in the appointed time, and sending a second control message and/or a third control message outwards according to the control action type; the second control message is generated by the key in response to a second control action type in the control action types, and the third control message is generated by the key in response to a third control action type in the control action types; at least one of the following of the second and third manipulation action types is distinguished: the number of pressing times, the number of releasing times and the pressing time.
6. The wireless switch of claim 1, wherein the communication processing module generates and sends out a control message according to the trigger signal, comprising:
Judging whether the wireless switch joins a designated network; if the wireless switch is not added into the appointed network, a second control message is sent outwards; otherwise, sending a second control message and/or a third control message outwards; wherein, the second control message and the receiving object pointed by the third control message are different.
7. The wireless switch of claim 1, wherein the communication processing module is further configured to:
Confirming that the wireless switch is configured with a network;
If the wireless switch is not matched with the network, broadcasting a network distribution message outwards;
if a device adding request returned by the designated device based on the broadcast distribution network message is obtained, generating a confirmation message in response to target operation received by the key, wherein the confirmation message characterizes the wireless switch and/or the target operation;
sending the confirmation message outwards;
And receiving a connection network access request returned by the designated equipment based on the confirmation message, and joining a network corresponding to the designated equipment according to the connection network access request.
8. The wireless switch of claim 1, wherein when the key is pressed, the sensing module inputs a first level to an IO port of the communication processing module; when the key is released, the sensing module inputs a second level to an IO port of the communication processing module; the first level and the second level are different.
9. A control system, comprising: the wireless switch, intelligent controller, electronic device of any one of claims 1 to 8; the wireless switch and the intelligent controller can communicate with the electronic equipment after joining a specified network; the electronic equipment comprises a terminal and/or a gateway, and the designated network comprises a network corresponding to the gateway;
The wireless switch is used for: generating and sending a control message to the electronic equipment when the electronic equipment is subjected to external control;
the electronic device is used for: after receiving the control message, generating corresponding control information according to the control message, and sending the control information to an intelligent controller associated with the wireless switch;
The intelligent controller is used for: and receiving the control information and executing a control result pointed by the control information.
10. The control system of claim 9, wherein at least one intelligent controller, after pairing with the wireless switch, is capable of directly receiving a paired application control message sent by the wireless switch to execute a control result pointed by the paired application control message.
CN202410329612.9A 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch Pending CN117994960A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410329612.9A CN117994960A (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210626145.7A CN115019494B (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch
CN202410329612.9A CN117994960A (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202210626145.7A Division CN115019494B (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch

Publications (1)

Publication Number Publication Date
CN117994960A true CN117994960A (en) 2024-05-07

Family

ID=83073015

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210626145.7A Active CN115019494B (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch
CN202410329612.9A Pending CN117994960A (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202210626145.7A Active CN115019494B (en) 2022-06-02 2022-06-02 Wireless switch, processing method and control system of wireless switch

Country Status (1)

Country Link
CN (2) CN115019494B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116781744B (en) * 2023-07-11 2024-03-01 北京和欣运达科技有限公司 Key event scanning method based on half-duplex bus, gateway and terminal

Family Cites Families (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI220955B (en) * 2003-03-11 2004-09-11 Acer Inc Computer system being operated under multiple operation modes and operation method thereof
CN1282059C (en) * 2003-03-12 2006-10-25 联想(北京)有限公司 Guiding method for speeding up operation system
CN101959311B (en) * 2009-07-17 2013-03-13 富士通株式会社 Wireless communication device and wireless communication method
US8351996B2 (en) * 2009-09-08 2013-01-08 Apple Inc. Power management of a radio data transceiver
CN105404378A (en) * 2014-09-15 2016-03-16 丰唐物联技术(深圳)有限公司 Smart bracelet and electricity saving method of smart bracelet
CN104657057A (en) * 2015-01-06 2015-05-27 小米科技有限责任公司 Terminal waking method and device
JP6376108B2 (en) * 2015-11-19 2018-08-22 京セラドキュメントソリューションズ株式会社 Information processing apparatus and program
CN107367948B (en) * 2016-05-13 2020-08-28 南宁富桂精密工业有限公司 Intelligent switch system and control method thereof
CN106375396A (en) * 2016-08-30 2017-02-01 乐视控股(北京)有限公司 Method and device for dormancy and awakening of vehicle-mounted intelligent terminal
CN107800739A (en) * 2016-09-05 2018-03-13 比亚迪股份有限公司 The car-mounted terminal means of communication, car-mounted terminal, vehicle and Vehicular system
CN106341733A (en) * 2016-10-20 2017-01-18 北京小米移动软件有限公司 Smart TV power control method and apparatus
CN109565749B (en) * 2017-03-21 2020-10-09 华为技术有限公司 Determination method, device and equipment of dormancy mechanism
CN109600765B (en) * 2017-09-30 2021-01-15 中国移动通信有限公司研究院 Dormancy and awakening control method and device, DU (data Unit), CU (Central Unit) and storage medium
CN108377484B (en) * 2018-02-01 2021-06-04 海信视像科技股份有限公司 Bluetooth controller power consumption control method and device
CN108599904B (en) * 2018-03-21 2021-09-28 中兴通讯股份有限公司 Data transmission method and device
CN109038784A (en) * 2018-08-01 2018-12-18 深圳硕日新能源科技有限公司 A kind of Low-power-consumptiodormancy dormancy device, the system and method for solar controller
WO2020133495A1 (en) * 2018-12-29 2020-07-02 华为技术有限公司 Smart device management method, mobile terminal, and system
CN110677903B (en) * 2019-10-28 2022-09-09 华为终端有限公司 Dormancy control method, apparatus, medium and system for wireless access device, and wireless access device
CN110621086B (en) * 2019-10-30 2022-11-01 京东方科技集团股份有限公司 Communication system, gateway, terminal and communication method
CN111007781A (en) * 2019-12-27 2020-04-14 北京润科通用技术有限公司 Control method and system of environment monitoring device
CN111262914A (en) * 2020-01-10 2020-06-09 内蒙古显鸿科技股份有限公司 Monitoring equipment and monitoring system for electric power well environment
CN114449491A (en) * 2020-10-30 2022-05-06 华为技术有限公司 Communication method, device and electronic equipment
CN114501598B (en) * 2020-11-13 2023-12-12 海能达通信股份有限公司 Terminal dormancy control method, device, equipment and readable storage medium
CN112530056B (en) * 2020-11-18 2023-07-25 深圳Tcl新技术有限公司 Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
CN112208470B (en) * 2020-12-11 2022-04-01 智道网联科技(北京)有限公司 Method for realizing low power consumption of equipment and vehicle-mounted terminal
CN112764812B (en) * 2021-01-12 2022-08-16 青岛海信移动通信技术股份有限公司 Electronic device and control method thereof
CN113433841B (en) * 2021-05-16 2022-05-31 武汉领普科技有限公司 Self-generating wireless switch, controlled equipment and control system
CN115421401A (en) * 2021-05-16 2022-12-02 武汉领普科技有限公司 Self-generating switch and control system thereof
CN115802201A (en) * 2021-06-22 2023-03-14 武汉领普科技有限公司 Control system, terminal processing method, wireless switch and processing method thereof
CN113300473B (en) * 2021-06-22 2023-04-18 武汉领普科技有限公司 Intelligent controller, processing method thereof and control system
CN114035477A (en) * 2021-11-11 2022-02-11 北京润科通用技术有限公司 Equipment awakening method, device and system
CN114442788A (en) * 2022-04-08 2022-05-06 北京智芯半导体科技有限公司 Low power consumption system of chip, low power consumption management method, control device and storage medium

Also Published As

Publication number Publication date
CN115019494B (en) 2024-02-06
CN115019494A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
JP4691548B2 (en) Connecting a device to a peer-to-peer network
KR101309840B1 (en) Apparatus and method for supplying power in a wireless sensor network
US10285128B2 (en) Method and apparatus for waking up devices in batches, and device
US9774637B2 (en) Method of establishing control relationships, configuration device, networked device and computer program product
CN102523402B (en) Intelligent television remote controller and power-saving method thereof
US9462623B2 (en) Method and system for optimized bluetooth low energy communications using dynamic broadcasting schedule
US8199687B2 (en) Information-communication terminal having function of controlling electric power consumption
US6724339B2 (en) System and method for controlling home appliances
US9918372B2 (en) Low power battery mode for wireless-enabled device prior to commissioning
US8755913B2 (en) Lighting control network
CN109982417B (en) Sensor control method, sensor control device, sensor, and storage medium
CN115019494B (en) Wireless switch, processing method and control system of wireless switch
CN108712740B (en) Bluetooth low-power connection method and device
CN110278135B (en) Equipment position searching method, device, gateway and storage medium
CN109788536B (en) Sensor control method, sensor control device, sensor, and storage medium
JP2009055301A (en) Wireless sensor network system
CN111654844A (en) Device pairing method and related device and device
CN106648021B (en) The data broadcasting method and low consumption circuit of low consumption circuit
KR101499307B1 (en) Wireless personal area network (pan) coordinator implementing power savings by transitioning between active and sleep states
US8532132B2 (en) Communication method in a home-automation installation
CN118038655A (en) Wireless switch, processing method and control system of wireless switch
US9357497B2 (en) Controlling the power consumption of a receiving unit
US9520055B2 (en) Process of communication between a first node and a second node of a home automation installation
CN113794610B (en) Gateway communication method, device, equipment and storage medium
WO2013000110A1 (en) A switch control method for wireless devices, a wireless devices and a wireless system

Legal Events

Date Code Title Description
PB01 Publication