Lamp condition detection method, device, terminal and storage medium
Technical field
The present embodiments relate to data processing technique more particularly to a kind of lamp condition detection method, device, terminal and deposit
Storage media.
Background technique
In short supply instantly in electric power resource, using electricity wisely is everyone obligation and responsibility, and turn off the light when you leave the room forms timely pass
The habit of lamp, it is extremely important in terms of using electricity wisely.
Now, accomplish the mode turned off the light in time be detection room in whether someone, in the case where nobody control lamp close
It closes, this kind of mode needs additional detection device, and increases control program, higher cost, and control process is cumbersome.
Summary of the invention
The embodiment of the present invention provides a kind of lamp condition detection method, device, terminal and storage medium, solves currently employed inspection
Survey the mode higher cost that whether someone turns off the light in device detection room, and the problem that control process is cumbersome.
In a first aspect, the embodiment of the invention provides a kind of lamp condition detection methods, this method comprises:
Within a preset period of time, the luminance information of lamp and/or the status information of lamp switch are obtained;
According to the status information of the luminance information and/or lamp switch, the open state of lamp is determined;
The open state is transmitted to intelligent terminal by wireless transmission protocol;
Intelligent terminal is received to control the control signal of the open state in the open state and preset time period
Default open state matching.
Further, this method further include:
According to the status information of the luminance information and/or lamp switch, the closed state of lamp is determined;
The closed state is transmitted to intelligent terminal by wireless transmission protocol;
It receives intelligent terminal and keeps the closed state to the control signal of the open state.
Further, described according to the luminance information, determine the open state of lamp, comprising:
The corresponding intrinsic brilliance of the luminance information is compared with predetermined luminance threshold value, when the intrinsic brilliance is greater than
When predetermined luminance threshold value, determine that lamp is in the open state.
Further, the status information according to lamp switch, determines the open state of lamp, comprising:
According to the status information of lamp switch, determine that lamp switch is open state;
According to the open state of lamp switch, determine that lamp is in the open state.
Wherein, the wireless transmission protocol includes at least:
Bluetooth, ZigBee or Wifi.
Second aspect, the embodiment of the invention also provides a kind of lamp condition checkout gear, which includes:
Data obtaining module, within a preset period of time, obtaining the luminance information of lamp and/or the state letter of lamp switch
Breath;
Open state determining module determines opening for lamp for the status information according to the luminance information and/or lamp switch
Open state;
Open state transmission module, for the open state to be transmitted to intelligent terminal by wireless transmission protocol;
Control module, for receiving intelligent terminal to the control signal of the open state with control the open state with
Default open state matching in preset time period.
Further, the device further include:
Closed state determining module determines the pass of lamp for the status information according to the luminance information and/or lamp switch
Closed state;
Closed state transmission module, for the closed state to be transmitted to intelligent terminal by wireless transmission protocol;
Closed state keeps module, for receiving intelligent terminal to the control signal of the open state to keep the pass
Closed state.
Further, the open state determining module, is specifically used for:
The corresponding intrinsic brilliance of the luminance information is compared with predetermined luminance threshold value, when the intrinsic brilliance is greater than
When predetermined luminance threshold value, determine that lamp is in the open state.
The third aspect, the embodiment of the invention also provides a kind of terminal, which includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realize any embodiment of that present invention provide it is any as described in lamp condition detection method.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer
Program, when which is executed by processor realize any embodiment of that present invention provide it is any as described in lamp state-detection side
Method.
The embodiment of the present invention passes through the status information of the luminance information and/or lamp switch that obtain lamp within a preset period of time,
It is accurate to guarantee that the open state of lamp determines for the open state that lamp can be determined by the luminance information of lamp or the switch state of lamp
Rate;According to intelligent terminal to the default opening state in the control signal control open state and preset time period of the open state of lamp
State matching, the process of simplified control lamp state improve the efficiency that control is turned off the light.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing does one and simply introduces, it should be apparent that, drawings in the following description are some embodiments of the invention, for this
For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others
Attached drawing.
Fig. 1 is a kind of flow diagram for lamp condition detection method that the embodiment of the present invention one provides;
Fig. 2 is a kind of structural schematic diagram of lamp condition checkout gear provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of structural schematic diagram for terminal that the embodiment of the present invention three provides.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, hereinafter with reference to attached in the embodiment of the present invention
Figure, clearly and completely describes technical solution of the present invention by embodiment, it is clear that described embodiment is the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is a kind of flow chart for lamp condition detection method that the embodiment of the present invention one provides.The technical side of the present embodiment
The case where case can be adapted for controlling the state of lamp, and especially control lamp is closed.This method can be implemented by the present invention
A kind of lamp condition checkout gear that example provides executes, which can be realized by the way of software and/or hardware, and be configured
In terminal, which has wireless communication module, such as can be intelligent lamp, is also possible to the equipment of any movement, this sets
It is standby to be used cooperatively with common non intelligent lamp, save the cost.This method specifically includes following operation:
S110, within a preset period of time, obtains the luminance information of lamp and/or the status information of lamp switch.
Preset time period can independently be set by user, such as can be the daily schedule according to user, by sleeping at night
Time is set as preset time, for example, at night 10 points to 7 points of morning.Also multistage preset time period can be set, by one day 20
Be divided within four hours different preset time periods, for example, the first preset time period be at night 10 points to 7 points of morning, second it is default when
Between section be 7 points of morning to 7 points at night, third preset time period is 7 points to 10 points at night at night.Within a preset period of time, it obtains
Take the luminance information of lamp and/or the status information of lamp switch.Wherein, the luminance information of lamp can be by the optical sensor that is arranged on lamp
It obtains, the status information of lamp switch is obtained by the state acquisition device being arranged on lamp switch, and state acquisition device for example can be electric current
Table is connected in the firewire in lamp switch, and when lamp switch is in the open state, ammeter detects electric current, at lamp switch
When closed state, ammeter detects no current, and the state of lamp switch can be then determined according to current value.
S120, according to the status information of the luminance information and/or lamp switch, determine the open state of lamp.
The status information of the switch of the luminance information and/or lamp of lamp can reflect the open state of lamp.Illustratively, described
According to the luminance information, the open state of lamp is determined, comprising:
The corresponding intrinsic brilliance of the luminance information is compared with predetermined luminance threshold value, when the intrinsic brilliance is greater than
When predetermined luminance threshold value, determine that lamp is in the open state.Setting predetermined luminance threshold value can be confirmed as to avoid by the daylight on daytime
The case where light.It is daylight or light to distinguish the source of light, can be determined according to the ingredient of light, such as can basis
Whether it is daylight or light there are also ultraviolet light determination, ultraviolet light is contained in daylight, and the light for being usually used in illumination day does not contain
Ultraviolet light, except the ultraviolet radiator of specific use.
Illustratively, the status information according to lamp switch, determines the open state of lamp, can also include:
According to the status information of lamp switch, determine that lamp switch is open state;
According to the open state of lamp switch, determine that lamp is in the open state.
According to the status information of lamp switch, determine that lamp switch is open state, for example, according to the firewire for being connected to lamp switch
In the registration of ammeter determine that lamp switch is that open state can be determined when determining the open state of lamp switch to open
Lamp is in the open state.By switching on or closing, directly judges opening or closing for lamp, judgement speed can be improved.
S130, the open state is transmitted to intelligent terminal by wireless transmission protocol.
The open state of lamp is transmitted to intelligent terminal by wireless transmission protocol terminal, the wireless transmission protocol is at least
It include: bluetooth, ZigBee or Wifi.Intelligent terminal receives the open state of lamp, is opened according to the generation of the open state of lamp lamp
Open the control signal of state.
S140, reception intelligent terminal control the control signal of the open state open state and preset time
Default open state matching in section.
Wherein, the default open state of lamp within a preset period of time for example can be in the first preset time period as pass
It closes, is to close in the second preset time period, be to open in third preset time period.When in the open state and preset time period of lamp
Open state mismatch when, intelligent terminal generate control signal matched with the open state for controlling lamp with default open state,
For example, lamp is to open in the first preset time period, presetting open state is to close, then controls signal and close for control lamp.By
This forgets to turn off the light automatically in the case of turning off the light between guaranteeing user during the break.As can also be in the second preset time period between at work
Guarantee that lamp is in close state, the outgoing working family lamp of user is avoided to be in the situation of normally open waste electricity.In life-time
Such as the third time, controls lamp and open, avoid mentioning the case where the peak of power consumption period, user power utilization needed the switch of frequent starting lamp
High user experience.
The brightness of lamp can also carry out different settings according to the difference of preset time period, such as in the second preset time period
Interior brightness value is the first brightness value, is the second brightness value in the first preset time period, is the in third preset time period
Three brightness values, wherein the first brightness value is less than third brightness value less than the second brightness value, the second brightness value.It is possible thereby to guarantee
When daylight environment brightness is high, lamplight brightness is low, and when night ambient brightness is low, lamplight brightness is high, using electricity wisely, improves user's body
It tests.
In another preferred embodiment of the present invention, this method further include:
According to the status information of the luminance information and/or lamp switch, the closed state of lamp is determined;
The closed state is transmitted to intelligent terminal by wireless transmission protocol;
It receives intelligent terminal and keeps the closed state to the control signal of the open state.
It according to the status information of the luminance information of lamp and/or lamp switch, determines that lamp is in close state, is closed when lamp is in
When state, the control signal of intelligent terminal is the closed state for keeping lamp, meets user demand.When lamp is in the open state,
Lamp is controlled in state is turned off or on according to the control signal of intelligent terminal, and when lamp is in close state, control lamp is in
Closed state, using electricity wisely improve user experience.
The embodiment of the present invention passes through the status information of the luminance information and/or lamp switch that obtain lamp within a preset period of time,
It is accurate to guarantee that the open state of lamp determines for the open state that lamp can be determined by the luminance information of lamp or the switch state of lamp
Rate;According to intelligent terminal to the default opening state in the control signal control open state and preset time period of the open state of lamp
State matching, the process of simplified control lamp state improve the efficiency that control is turned off the light.
Embodiment two
Fig. 2 is a kind of structural block diagram of lamp condition checkout gear provided by Embodiment 2 of the present invention.The device is for executing
A kind of lamp condition detection method provided by above-mentioned any embodiment.The device includes:
Data obtaining module 210, within a preset period of time, obtaining the luminance information of lamp and/or the state of lamp switch
Information;
Open state determining module 220 determines lamp for the status information according to the luminance information and/or lamp switch
Open state;
Open state transmission module 230, for the open state to be transmitted to intelligent terminal by wireless transmission protocol;
Control module 240, for receiving intelligent terminal to the control signal of the open state to control the opening state
State is matched with the default open state in preset time period.
The embodiment of the present invention passes through the status information of the luminance information and/or lamp switch that obtain lamp within a preset period of time,
It is accurate to guarantee that the open state of lamp determines for the open state that lamp can be determined by the luminance information of lamp or the switch state of lamp
Rate;According to intelligent terminal to the default opening state in the control signal control open state and preset time period of the open state of lamp
State matching, the process of simplified control lamp state improve the efficiency that control is turned off the light.
Further, the device further include:
Closed state determining module determines the pass of lamp for the status information according to the luminance information and/or lamp switch
Closed state;
Closed state transmission module, for the closed state to be transmitted to intelligent terminal by wireless transmission protocol;
Closed state keeps module, for receiving intelligent terminal to the control signal of the open state to keep the pass
Closed state.
Further, the open state determining module, is specifically used for:
The corresponding intrinsic brilliance of the luminance information is compared with predetermined luminance threshold value, when the intrinsic brilliance is greater than
When predetermined luminance threshold value, determine that lamp is in the open state.
Further, the open state determining module, is specifically also used to:
According to the status information of lamp switch, determine that lamp switch is open state;
According to the open state of lamp switch, determine that lamp is in the open state.
Wherein, the wireless transmission protocol includes at least:
Bluetooth, ZigBee or Wifi.
Lamp condition checkout gear provided by Embodiment 2 of the present invention ensure that the accuracy rate that the open state of lamp determines, letter
Change the process of control lamp state, improves the efficiency that control is turned off the light.
Lamp shape provided by any embodiment of the invention can be performed in lamp condition checkout gear provided by the embodiment of the present invention
State detection method has the corresponding functional module of execution method and beneficial effect.
Embodiment three
Fig. 3 is a kind of structural schematic diagram for terminal that the embodiment of the present invention three provides, as shown in figure 3, the terminal includes place
Manage device 30, memory 31, input unit 32 and output device 33;The quantity of processor 30 can be one or more in terminal,
In Fig. 3 by taking a processor 30 as an example;Processor 30, memory 31, input unit 32 and output device 33 in terminal can be with
It is connected by bus or other modes, in Fig. 3 for being connected by bus.
Memory 31 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer
Sequence and module, if the corresponding program instruction/module of lamp condition detection method in the embodiment of the present invention is (for example, acquisition of information
Module 210, open state determining module 220, open state transmission module 230 and control module 240).Processor 30 passes through fortune
Software program, instruction and the module that row is stored in memory 31, thereby executing the various function application and data of equipment
Processing, that is, realize above-mentioned lamp condition detection method.
Memory 31 mainly include storing program area and storage data area, wherein storing program area can storage program area,
Application program needed at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.In addition,
Memory 31 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a disk
Memory device, flush memory device or other non-volatile solid state memory parts.In some instances, memory 31 can be wrapped further
The memory remotely located relative to processor 30 is included, these remote memories can pass through network connection to equipment.Above-mentioned net
The example of network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 32 can be used for receiving the number or character information of input, and generate with the user setting of equipment and
The related key signals input of function control.Output device 33 may include that display screen etc. shows equipment.
Example IV
The embodiment of the present invention four also provides a kind of storage medium comprising computer executable instructions, and the computer can be held
Row instruction is used to execute a kind of lamp condition detection method when being executed by computer processor, this method comprises:
Within a preset period of time, the luminance information of lamp and/or the status information of lamp switch are obtained;
According to the status information of the luminance information and/or lamp switch, the open state of lamp is determined;
The open state is transmitted to intelligent terminal by wireless transmission protocol;
Intelligent terminal is received to control the control signal of the open state in the open state and preset time period
Default open state matching.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention
Lamp state inspection provided by any embodiment of the invention can also be performed in the method operation that executable instruction is not limited to the described above
Relevant operation in survey method.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set
Standby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.