Method and device for controlling equipment to enter different working modes

文档序号:1366430 发布日期:2020-08-11 浏览:10次 中文

阅读说明:本技术 一种控制设备进入不同工作模式的方法及装置 (Method and device for controlling equipment to enter different working modes ) 是由 吴华平 于 2020-04-30 设计创作,主要内容包括:本发明提供了一种控制设备进入不同工作模式的方法及装置,当接收到开机指令后开启设备,并在所述设备的存储器中累计开机次数,根据当前的开机次数确定所述设备应进入的工作模式,如果开机后在预设时长内接收到关机指令,则关闭所述设备,如果在所述预设时长内未接收到所述关机指令,则将所述开机次数置为零。本发明方案在不改动现有硬件情况下,只升级软件即可控制雷达感应灯等设备进入不同工作模式,同时控制方式也很方便,只需要用户在现有开关面板上快速地多次开关设备即可,通过累计开机次数就能告知雷达感应灯等设备应进入的工作模式,以零成本和简易的控制方式实现了雷达感应灯等设备不同工作模式的切换,也不存在蓝牙/WiFi等干扰。(The invention provides a method and a device for controlling equipment to enter different working modes, wherein the equipment is started after a starting instruction is received, the starting times are accumulated in a memory of the equipment, the working mode which the equipment should enter is determined according to the current starting times, if the equipment receives the stopping instruction within the preset time length after starting, the equipment is closed, and if the stopping instruction is not received within the preset time length, the starting times are set to be zero. According to the scheme of the invention, under the condition that the existing hardware is not changed, the equipment such as the radar induction lamp can be controlled to enter different working modes only by upgrading software, meanwhile, the control mode is very convenient, only the user needs to rapidly switch the equipment on and off for multiple times on the existing switch panel, the working mode which the equipment such as the radar induction lamp should enter can be informed by accumulating the starting-up times, the switching of the different working modes of the equipment such as the radar induction lamp is realized by a zero-cost and simple control mode, and the interference of Bluetooth/WiFi and the like does not exist.)

1. A method of controlling a device to enter different operating modes, the method comprising:

starting the equipment after receiving a starting instruction, and accumulating starting times in a memory of the equipment;

determining a working mode which the equipment should enter according to the current starting-up times;

if a shutdown instruction is received within a preset time length after the equipment is started, the equipment is closed;

and if the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

2. The method of claim 1, wherein the device is:

a radar sensing lamp.

3. The method of claim 2, wherein the operating mode comprises one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

4. The method of claim 1, wherein accumulating the number of boots in the memory of the device comprises:

reading the starting-up times stored in the memory;

adding one to the starting-up times;

and writing the starting-up times back to the memory.

5. The method of claim 1, wherein determining the operating mode that the device should enter based on the current number of boots comprises:

acquiring a corresponding relation between a preset working mode and the starting-up times;

judging whether the current starting-up times has a corresponding preset working mode according to the corresponding relation;

if the corresponding preset working mode exists, taking the corresponding preset working mode as the working mode to be entered;

and if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

6. The method of claim 1, further comprising:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered.

7. The method according to claim 1, wherein after selecting the operating mode to which the device should enter according to the current power-on number, before receiving a power-off instruction within a preset time period, the method further comprises:

and enabling the equipment to enter the working mode to be entered.

8. An apparatus for controlling a device to enter different operating modes, the apparatus comprising:

the starting counting module is used for starting the equipment after receiving a starting instruction and accumulating starting times in a memory of the equipment;

the working mode determining module is used for determining the working mode which the equipment should enter according to the current starting-up times;

the timing and control module is used for closing the equipment when a shutdown instruction is received within a preset time length after the equipment is started; and when the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

9. The apparatus of claim 8, wherein the device is:

a radar sensing lamp.

10. The apparatus of claim 9, wherein the operating mode comprises one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

11. The apparatus according to claim 8, wherein the boot counting module, when accumulating the number of boots in the memory of the device, is specifically configured to:

reading the starting-up times stored in the memory; adding one to the starting-up times; and writing the starting-up times back to the memory.

12. The apparatus of claim 8, wherein the operating mode determining module is specifically configured to:

acquiring a corresponding relation between a preset working mode and the starting-up times; judging whether the current starting-up times has a corresponding preset working mode according to the corresponding relation; if the corresponding preset working mode exists, taking the corresponding preset working mode as the working mode to be entered; and if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

13. The apparatus of claim 8, wherein the timing and control module is further configured to:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered.

14. The apparatus of claim 8, wherein the timing and control module is further configured to:

after the working mode which the equipment should enter is selected according to the current starting-up times, the equipment enters the working mode which the equipment should enter before a shutdown instruction is received within a preset time length.

Technical Field

The invention relates to the technical field of radar induction lamps, in particular to a method and a device for controlling equipment to enter different working modes.

Background

The radar induction lamp works by using the Doppler effect, sends microwave signals to the surroundings when working, and automatically lights when detecting the movement of an object. With the improvement of technology and the enhancement of energy-saving and environment-friendly consciousness of people, the radar induction lamp is gradually the mainstream of lamps used in underground garages, public corridors, street lamps and other scenes. The parameters of the radar induction lamp can comprise radar induction distance, lamp-on holding time, photosensitive threshold values and the like, and the parameters can be set to different parameter values according to requirements in different application scenes, namely, different working modes can be entered, and therefore optimal performance is achieved.

In order to control the radar sensing lamp to enter different working modes, one scheme in the prior art is to add an infrared receiving module on the radar sensing lamp, wherein the infrared receiving module comprises an infrared receiving circuit and an infrared receiving head, a control end is controlled by an infrared remote controller to transmit a key code, and the radar module decodes different infrared receiving codes through software when receiving an infrared signal, so that the radar sensing lamp is controlled to enter different working modes. Another scheme in the prior art is that a dial switch module is added on a radar sensing lamp, each dial on the dial switch needs to be connected to an IO port of an MCU, and the MCU controls the radar sensing lamp to enter different working modes by reading a level state value of the IO port. In the prior art, a scheme is that a bluetooth module or a WiFi module is additionally installed on a radar induction lamp, and the radar induction lamp is connected to the radar induction lamp module through a mobile phone bluetooth/WiFi module and sends a control command through a specific APP to enable the radar induction lamp to enter different working modes.

The inventor finds that in the process of implementing the invention, the schemes in the prior art need to additionally add a hardware module on the original radar induction lamp, so that not only is a hardware circuit more complex, but also the hardware cost is increased, and in addition, bluetooth and WiFi can generate interference signals during communication to influence the normal operation of the radar induction lamp.

Disclosure of Invention

The embodiment of the invention provides a method and a device for controlling equipment to enter different working modes, which can switch the working modes of equipment such as a radar induction lamp and the like under the condition of not changing the existing hardware.

According to a first aspect of the embodiments of the present invention, there is provided a method for controlling a device to enter different operating modes, the method including:

starting the equipment after receiving a starting instruction, and accumulating starting times in a memory of the equipment;

determining a working mode which the equipment should enter according to the current starting-up times;

if a shutdown instruction is received within a preset time length after the equipment is started, the equipment is closed;

and if the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

Optionally, the apparatus is:

a radar sensing lamp.

Optionally, the operation mode includes one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

Optionally, accumulating the boot times in the memory of the device includes:

reading the starting-up times stored in the memory;

adding one to the starting-up times;

and writing the starting-up times back to the memory.

Optionally, determining the working mode that the device should enter according to the current boot-up times includes:

acquiring a corresponding relation between a preset working mode and the starting-up times;

judging whether the current starting-up times has a corresponding preset working mode according to the corresponding relation;

if the corresponding preset working mode exists, taking the corresponding preset working mode as the working mode to be entered;

and if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

Optionally, the method further includes:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered.

Optionally, after selecting the working mode that the device should enter according to the current power-on number, before receiving a power-off instruction within a preset time period, the method further includes:

and enabling the equipment to enter the working mode to be entered.

According to a second aspect of the embodiments of the present invention, there is provided an apparatus for controlling a device to enter different operation modes, the apparatus comprising:

the starting counting module is used for starting the equipment after receiving a starting instruction and accumulating starting times in a memory of the equipment;

the working mode determining module is used for determining the working mode which the equipment should enter according to the current starting-up times;

the timing and control module is used for closing the equipment when a shutdown instruction is received within a preset time length after the equipment is started; and when the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

Optionally, the apparatus is:

a radar sensing lamp.

Optionally, the operation mode includes one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

Optionally, the boot counting module is configured to, when the boot frequency is accumulated in the memory of the device, specifically:

reading the starting-up times stored in the memory; adding one to the starting-up times; and writing the starting-up times back to the memory.

Optionally, the working mode determining module is specifically configured to:

acquiring a corresponding relation between a preset working mode and the starting-up times; judging whether the current starting-up times has a corresponding preset working mode according to the corresponding relation; if the corresponding preset working mode exists, taking the corresponding preset working mode as the working mode to be entered; and if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

Optionally, the timing and control module is further configured to:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered.

Optionally, the timing and control module is further configured to:

after the working mode which the equipment should enter is selected according to the current starting-up times, the equipment enters the working mode which the equipment should enter before a shutdown instruction is received within a preset time length.

The technical scheme provided by the embodiment of the invention has the following beneficial effects:

in the invention, after a starting-up instruction is received, equipment is started, the starting-up times are accumulated in a memory of the equipment, a working mode which the equipment should enter is determined according to the current starting-up times, if a shutdown instruction is received within a preset time length after the equipment is started up, the equipment is closed, and if the shutdown instruction is not received within the preset time length, the starting-up times are set to be zero. According to the scheme of the invention, under the condition that the existing hardware is not changed, the equipment such as the radar induction lamp can be controlled to enter different working modes only by upgrading software, meanwhile, the control mode is very convenient, a user only needs to rapidly switch the equipment on and off for multiple times on the existing switch panel, and the working mode which the equipment such as the radar induction lamp should enter can be informed through accumulating the starting times. The method of the invention realizes the switching function of different working modes of equipment such as the radar induction lamp and the like in a zero-cost and simple control mode, in addition, no interference signals such as Bluetooth/WiFi and the like exist, no specific APP is required to be installed, and the operation of a user is simplified.

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 invention, as claimed.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise. Furthermore, these descriptions should not be construed as limiting the embodiments, wherein elements having the same reference number designation are identified as similar elements throughout the figures, and the drawings are not to scale unless otherwise specified.

FIG. 1 is a flow chart illustrating a method of controlling a device to enter different operating modes in accordance with an exemplary embodiment of the present invention;

FIG. 2 is a flow chart illustrating a method of controlling a device to enter different operating modes in accordance with an exemplary embodiment of the present invention;

FIG. 3 is a flow chart illustrating a method of controlling a device to enter different operating modes in accordance with an exemplary embodiment of the present invention;

FIG. 4 is a flow chart illustrating a method of controlling a device to enter different operating modes in accordance with another exemplary embodiment of the present invention;

fig. 5 is a schematic diagram illustrating an apparatus for controlling a device to enter different operating modes according to yet another exemplary embodiment of the present invention.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.

Fig. 1 is a flow chart illustrating a method of controlling a device to enter different operating modes according to an exemplary embodiment of the present invention. The method can be used for equipment such as radar induction lamps and the like.

As described with reference to fig. 1, the method may include the steps of:

step S101, after receiving a starting-up instruction, starting up the equipment, and accumulating the starting-up times in a memory of the equipment.

As an example, the device may specifically be a radar-sensitive lamp.

Taking the radar induction lamp as an example, when a user turns on a switch button on a switch panel of the radar induction lamp, a power-on instruction is sent to the radar induction lamp, the radar induction lamp is powered on and powered on, and the power-on times are accumulated in a memory of the radar induction lamp. For example, if the number of boot-ups is 5 before the boot-up of this time, the number of boot-ups becomes 6 after the boot-up of this time. The number of power-on times is accumulated until it is set to zero.

In this embodiment or some other embodiments of the present invention, referring to fig. 2, the accumulating the boot times in the memory of the device may specifically include:

in step S1011, the number of boot-up times stored in the memory is read.

In step S1012, the number of times of power-on is increased by one.

Step S1013, writing the boot frequency back to the memory.

For example, the memory may be a non-volatile memory NVRAM, or a Flash memory Flash, which is a memory that is usually provided by a device such as a radar sensing lamp, and can store the number of times of power-on when power is off. The embodiment of the present invention is not limited to a specific memory, and those skilled in the art can select and design the embodiment according to different requirements/different scenarios without departing from the spirit and scope of the present invention.

Continuing with reference to FIG. 1:

and S102, determining a working mode to which the equipment should enter according to the current starting-up times.

Taking a radar-sensitive lamp as an example, the operation mode may include one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

When the parameters are set to different values, different operation modes can be corresponded, such as a basement mode, a public corridor mode, an office mode and the like.

Various working modes can be preset in the radar induction lamp, different working modes can correspond to different starting times, in other words, various preset working modes and the corresponding relation between the preset working modes and the starting times can be stored in the radar induction lamp.

In this embodiment or some other embodiments of the present invention, referring to fig. 3, determining the working mode that the device should enter according to the current boot-up frequency may specifically include:

step S1021, acquiring the corresponding relation between the preset working mode and the starting-up times.

Step S1022, determining whether the current boot frequency has a corresponding preset operating mode according to the corresponding relationship.

Step S1023, if there is a corresponding preset working mode, taking the corresponding preset working mode as the working mode to be entered.

Step S1024, if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

Continuing with reference to FIG. 1:

and step S103, if a shutdown instruction is received within a preset time length after the device is started, the device is closed.

And step S104, if the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

As an example, in this embodiment or some other embodiments of the present invention, a timer may be started immediately after the radar sensing lamp is turned on, for example, 15 seconds may be timed, and if the radar sensing lamp is turned off within 15 seconds, it represents that the user performs an action of turning on and then rapidly turning off, which is a case where the user wants to switch the operating mode by the number of times of turning on, at this time, the user may directly turn off the radar sensing lamp, the number of times of turning on may not be cleared, and the number of times of turning on may be increased by one when turning on next time.

If the user does not power off within 15 seconds of starting the computer, the user only needs to start the computer once (that is, the user does not want to switch the working mode), or the user already switches the working mode through multiple times of power on and power off before the computer. Then the number of times of starting should be set to zero after the timing of 15 seconds, and the light-on state is kept unchanged. Therefore, in this embodiment or some other embodiments of the present invention, the method may further include:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered. The working mode to be entered is a preset working mode or a default working mode corresponding to the starting-up times before zero clearing.

In addition, what kind of working mode the device is in is within the preset time length after the device is turned on, which embodiment is not limited, for example, the device may be in the default working mode within the preset time length. Or, the device may be in the preset working mode that is currently matched, for example, when the user starts the device for the first time, the number of times of starting the device is 1, the radar induction lamps are all in the working mode 1 within 15 seconds, the user starts the device again within 15 seconds, the number of times of starting the device becomes 2, the radar induction lamps are all in the working mode 2 within 15 seconds, and the user does not turn off the device within 15 seconds, then the radar induction lamps continue to be in the working mode 2 after 15 seconds, and the working mode 2 is the working mode that the user expects to enter.

Therefore, in this embodiment or some other embodiments of the present invention, after selecting the operating mode that the device should enter according to the current power-on number, before receiving a power-off instruction within a preset time period, the method may further include:

and enabling the equipment to enter the working mode to be entered.

In this embodiment, only upgrading software can control equipment such as radar response lamp to get into different mode under the condition of not changing current hardware, and the control mode is also very convenient simultaneously, only need the user on current flush mounting plate of switch many times fast can, just can inform the mode that equipment such as radar response lamp should get into through the number of times of starting up accumulatively. The method of the invention realizes the switching function of different working modes of equipment such as the radar induction lamp and the like in a zero-cost and simple control mode, in addition, no interference signals such as Bluetooth/WiFi and the like exist, no specific APP is required to be installed, and the operation of a user is simplified.

The invention will be further described with reference to specific application scenarios by taking a radar sensor lamp as an example. Of course, the following application scenarios are only exemplary, and in practical applications, the application scenarios may also be applied to other application scenarios.

Fig. 4 is a flowchart illustrating a method of controlling a device to enter different operating modes according to another exemplary embodiment of the present invention.

Referring to fig. 4, the present embodiment may include the steps of:

step S401, the radar induction lamp is started normally and is electrified and initialized.

That is, the user starts up for the first time, and before the first start up, the number of times of start up stored in the NVRAM is 0.

In step S402, a Timer is set.

The timer time can be set according to actual conditions, such as setting 15 seconds, and clearing the boot time data stored in the NVRAM in the interrupt processing program of the timer after the 15 seconds. The normal switch lamp can not get into the mode setting, and its characteristics are that can last more for a long time after generally turning on the light, and the timer that sets up 15 seconds clears away the switch lamp number of times and combines the judgement to many times fast switch lamp can guarantee that normal switch lamp can not get into radar mode setting.

In step S403, the last boot-up time is read from the NVRAM.

In step S404, the boot count is incremented by 1 and written back to the NVRAM.

Step S405, setting a working mode according to the current startup frequency.

For example, if the number of times of power-on is 5, the operation mode is set to 0; if the number of power-on times is 6, the operation mode is set to 1, …, and if the number of power-on times is x, the operation mode is set to n.

And if the starting-up times are not matched with the preset working mode, setting the working mode as a default working mode.

In step S406, the set operation mode is entered.

If no condition is met in the previous step, the working mode to be entered works according to default parameters (parameters such as radar sensing distance, light-up holding time and photosensitive threshold value), namely, the default working mode is entered, and if the condition is met in the previous step, the working mode works according to the matched preset working mode parameters.

In step S407, the boot frequency stored in the NVRAM is cleared.

And when the Timer is up, entering a Timer interrupt service program, and clearing the boot-up times stored in the NVRAM. Normally, the operation mode of the lamp entering S406 is within 2 seconds, and the set Timer overflow time is 15 seconds, and the Timer interrupt service routine will enter and exit at S406.

The starting times stored in the NVRAM are cleared through the Timer, the normal lamp turning-on and turning-off of a user can not enter the mode setting by combining the condition judgment of the times of fast lamp turning-on and turning-off for many times, and different working mode parameters can be set through different times of fast lamp turning-on and turning-off when the user has the mode setting requirement.

In this embodiment, only upgrading software can control equipment such as radar response lamp to get into different mode under the condition of not changing current hardware, and the control mode is also very convenient simultaneously, only need the user on current flush mounting plate of switch many times fast can, just can inform the mode that equipment such as radar response lamp should get into through the number of times of starting up accumulatively. The method of the invention realizes the switching function of different working modes of equipment such as the radar induction lamp and the like in a zero-cost and simple control mode, in addition, no interference signals such as Bluetooth/WiFi and the like exist, no specific APP is required to be installed, and the operation of a user is simplified.

The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.

Fig. 5 is a schematic diagram illustrating an apparatus for controlling a device to enter different operating modes according to yet another exemplary embodiment of the present invention. The device can be used for equipment such as radar induction lamps.

Referring to fig. 5, the apparatus may include:

the boot counting module 501 is configured to start the device after receiving the boot instruction, and accumulate boot times in a memory of the device.

A working mode determining module 502, configured to determine, according to the current boot frequency, a working mode that the device should enter.

The timing and control module 503 is configured to turn off the device when a shutdown instruction is received within a preset time period after the device is turned on; and when the shutdown instruction is not received within the preset time length, setting the startup frequency to be zero.

In this embodiment or some other embodiment of the present invention, the apparatus may be:

a radar sensing lamp.

In this or some other embodiment of the invention, the operating mode may include one or more of the following parameters:

radar sensing distance, light-on holding time and photosensitive threshold.

For example, in this embodiment or some other embodiments of the present invention, the boot count module, when used to accumulate the boot times in the memory of the device, may be specifically configured to:

reading the starting-up times stored in the memory; adding one to the starting-up times; and writing the starting-up times back to the memory.

As an example, in this embodiment or some other embodiments of the present invention, the operation mode determining module may specifically be configured to:

acquiring a corresponding relation between a preset working mode and the starting-up times; judging whether the current starting-up times has a corresponding preset working mode according to the corresponding relation; if the corresponding preset working mode exists, taking the corresponding preset working mode as the working mode to be entered; and if the corresponding preset working mode does not exist, taking the default working mode as the working mode to be entered.

For example, in this embodiment or some other embodiments of the present invention, the timing and control module may further be configured to:

and if the shutdown instruction is not received within the preset time length, enabling the equipment to enter the working mode to be entered.

For example, in this embodiment or some other embodiments of the present invention, the timing and control module may further be configured to:

after the working mode which the equipment should enter is selected according to the current starting-up times, the equipment enters the working mode which the equipment should enter before a shutdown instruction is received within a preset time length.

Regarding the apparatus in the foregoing embodiments, the specific manner in which each unit \ module executes operations has been described in detail in the embodiments of the related method, and is not described herein again.

In this embodiment, only upgrading software can control equipment such as radar response lamp to get into different mode under the condition of not changing current hardware, and the control mode is also very convenient simultaneously, only need the user on current flush mounting plate of switch many times fast can, just can inform the mode that equipment such as radar response lamp should get into through the number of times of starting up accumulatively. The method of the invention realizes the switching function of different working modes of equipment such as the radar induction lamp and the like in a zero-cost and simple control mode, in addition, no interference signals such as Bluetooth/WiFi and the like exist, no specific APP is required to be installed, and the operation of a user is simplified.

Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种灯具智能控制方法、装置及灯具

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!