Lamp control method and device, electronic equipment and storage medium

By collecting user sleep data in real time and automatically turning off the lamp, the waste of resources and poor sleep caused by users accidentally falling asleep is solved, and the automatic control of the lamp and power saving is achieved.

CN120166609APending Publication Date: 2025-06-17ZHU HAI RU RAN ZHI NENG KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510532762.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Users accidentally fell asleep but did not turn off the lights, resulting in waste of resources and poor sleep.

Method used

By collecting the user's sleep data in real time, determining the user's sleep state, and automatically turning off the target lamp when the user enters sleep.

Benefits of technology

It realizes automatic turn-on and off of lamps, avoids long-term lighting of lamps, saves power resources, and improves the convenience of smart homes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166609A_ABST
    Figure CN120166609A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a lamp control method and device, electronic equipment and a storage medium, which are applied to the technical field of smart homes and can solve the problems that resource waste is easily caused and poor sleep is caused by light irradiation when a user falls asleep accidentally but the lamp is not turned off. The method comprises the following steps: collecting sleep data of a user in real time; determining a sleep state of the user according to the sleep data; and when the sleep state indicates that the user is in sleep, turning off the target lamp.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of smart home, and in particular, to a method and device for controlling a lamp, an electronic device, and a storage medium. Background Art

[0002] With the development of technology, smart home, as the main development trend of the future home market, has developed rapidly and gradually become popular in recent years. Lighting fixtures are very common furniture in daily life. When the indoor light is dim, lighting is provided through the fixtures. Many people are used to lying in bed or on the sofa at night with the light on and playing with electronic devices such as mobile phones and tablets. If the user accidentally falls asleep but does not turn off the light, not only is it easy to cause waste of resources, but also it will cause poor sleep due to the light irradiation. Summary of the Invention

[0003] To solve the above technical problems or at least partially solve the above technical problems, embodiments of the present application provide a method and device for controlling a lamp, an electronic device, and a storage medium, so as to solve the problem that if the user accidentally falls asleep but does not turn off the light, not only is it easy to cause waste of resources, but also it will cause poor sleep due to the light irradiation.

[0004] To achieve the above object, the technical solutions provided by the embodiments of the present application are as follows:

[0005] In a first aspect, embodiments of the present application provide a method for controlling a lamp, the method for controlling a lamp including: real-time collecting sleep data of a user;

[0006] Determining a sleep state of the user according to the sleep data;

[0007] When the sleep state indicates that the user has fallen asleep, turning off a target lamp.

[0008] As an optional implementation manner, in the first aspect of the embodiments of the present application, the real-time collecting sleep data of the user includes:

[0009] Real-time collecting the sleep data of the user through a sleep sensor;

[0010] Wherein, the sleep data at least includes: respiratory rate, heart rate value, posture condition, etc.

[0011] As an optional implementation manner, in the first aspect of the embodiments of the present application, the determining a sleep state of the user according to the sleep data includes:

[0012] When it is detected that the respiratory rate and the heart rate value are in a preset sleep interval, detecting the posture condition of the user within a first duration;

[0013] When it is detected that the pose condition of the user within the first duration meets the preset condition, it is determined that the sleep state of the user has entered sleep.

[0014] As an optional implementation manner, in the first aspect of the embodiments of the present application, when the sleep state indicates that the user has entered sleep, turning off the target lamp includes:

[0015] When the sleep state indicates that the user has entered sleep, determine the current moment;

[0016] When the current moment is within the preset lamp-off period, turn off the target lamp.

[0017] As an optional implementation manner, in the first aspect of the embodiments of the present application, when the sleep state indicates that the user has entered sleep, turning off the target lamp includes:

[0018] When the sleep state indicates that the user has entered sleep, start timing;

[0019] When the timing duration reaches the second duration, turn off the target lamp.

[0020] As an optional implementation manner, in the first aspect of the embodiments of the present application, when the sleep state indicates that the user has entered sleep, turning off the target lamp includes:

[0021] When the sleep state indicates that the user has entered sleep, send a turn-off instruction to the target lamp so that the target lamp performs an extinguishing operation after receiving the turn-off instruction.

[0022] As an optional implementation manner, in the first aspect of the embodiments of the present application, when the sleep state indicates that the user has entered sleep, turning off the target lamp includes:

[0023] When the sleep state indicates that the user has entered sleep, detect the brightness value of the current environment;

[0024] When the brightness value exceeds the preset brightness value, turn off the target lamp.

[0025] In a second aspect, an embodiment of the present application provides a lamp control device, and the lamp control device includes: an acquisition module for real-time collecting sleep data of a user;

[0026] A processing module for determining the sleep state of the user according to the sleep data;

[0027] The processing module is further configured to turn off the target lamp when the sleep state indicates that the user has entered sleep.

[0028] As an alternative embodiment, in the second aspect of the embodiments of the present application, the acquisition module is specifically configured to collect the sleep data of the user in real time through a sleep sensor;

[0029] Wherein, the sleep data at least includes: respiratory rate, heart rate value, posture condition, etc.

[0030] As an alternative embodiment, in the second aspect of the embodiments of the present application, the processing module is specifically configured to detect the posture condition of the user within a first duration when it is detected that the respiratory rate and the heart rate value are within a preset sleep interval;

[0031] The processing module is specifically configured to determine that the sleep state of the user has entered sleep when it is detected that the posture condition of the user within the first duration meets a preset condition.

[0032] As an alternative embodiment, in the second aspect of the embodiments of the present application, the processing module is specifically configured to determine the current time when the sleep state indicates that the user has entered sleep;

[0033] The processing module is specifically configured to turn off the target lamp when the current time is within a preset lights-out period.

[0034] As an alternative embodiment, in the second aspect of the embodiments of the present application, the processing module is specifically configured to start timing when the sleep state indicates that the user has entered sleep;

[0035] The processing module is specifically configured to turn off the target lamp when the timing duration reaches a second duration.

[0036] As an alternative embodiment, in the second aspect of the embodiments of the present application, the processing module is specifically configured to send a turn-off command to the target lamp when the sleep state indicates that the user has entered sleep, so that the target lamp performs an extinguishing operation after receiving the turn-off command.

[0037] As an alternative embodiment, in the second aspect of the embodiments of the present application, the processing module is specifically configured to detect the brightness value of the current environment when the sleep state indicates that the user has entered sleep;

[0038] The processing module is specifically configured to turn off the target lamp when the brightness value exceeds a preset brightness value.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, and the electronic device includes:

[0040] A memory storing executable program code;

[0041] A processor coupled to the memory;

[0042] The processor calls the executable program code stored in the memory and executes the lamp control method in the first aspect of the embodiments of the present application.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium that stores a computer program, and the computer program causes a computer to execute the lamp control method in the first aspect of the embodiments of the present application. The computer-readable storage medium includes ROM / RAM, a magnetic disk, an optical disc, etc.

[0044] In a fifth aspect, an embodiment of the present application provides a computer program product that, when running on a computer, causes the computer to execute some or all of the steps of any one of the methods in the first aspect.

[0045] In a sixth aspect, an embodiment of the present application provides an application publishing platform that is used to publish a computer program product. When the computer program product runs on a computer, the computer is caused to execute some or all of the steps of any one of the methods in the first aspect.

[0046] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0047] The embodiments of the present application provide a lamp control method, device, electronic device, and storage medium that collect users' sleep data in real time; determine the users' sleep states according to the sleep data; and turn off the target lamp when the sleep state indicates that the user has fallen asleep. In this solution, it is determined whether the user has fallen asleep based on the users' sleep data, and the lamp is turned off after it is determined that the user has fallen asleep, realizing the automatic turning on and off of the lamp. In this way, there is no need for the user to manually turn off the lamp, and the state of the device can be automatically sensed, avoiding the lamp from being illuminated for a long time, saving power resources, and improving the convenience of the smart home. Description of the Drawings

[0048] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application and used together with the specification to explain the principles of the present application.

[0049] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1It is a schematic flowchart of a lighting control method provided by an embodiment of the present application Figure 1 ;

[0051] Figure 2 It is a schematic flowchart of a lighting control method provided by an embodiment of the present application Figure 2 ;

[0052] Figure 3 It is a schematic structural diagram of a lighting control device provided by an embodiment of the present application;

[0053] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0054] In order to more clearly understand the above objects, features and advantages of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0055] The terms "first" and "second" in the specification and claims of the present application are used to distinguish different objects, rather than to describe a specific order of the objects.

[0056] The terms "including" and "having" in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0057] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0058] As Figure 1 shown, Figure 1 It is a flowchart of a lighting control method provided by an embodiment of the present application, and the method may include the following steps:

[0059] 101. Collect the sleep data of the user in real time.

[0060] In the embodiments of the present application, generally speaking, if the user enters the sleep state, the user's breathing rate and heart rate will gradually become flat, and compared with the waking state, both the breathing rate and heart rate will decrease. In addition, the user's posture will not change after the user enters the sleep state. Therefore, in order to accurately determine whether the user has entered the sleep state, it can be determined by collecting the user's sleep data.

[0061] In some embodiments, if the user enters the sleep state, it may be a continuous stage. Therefore, the sleep data can be collected in real time, so that the change of the user's state can be determined through the data change for a period of time.

[0062] 102. Determine the sleep state of the user according to the sleep data.

[0063] In the embodiments of the present application, the sleep data collected in real time can be immediately processed and judged to determine the sleep state of the user at the current moment.

[0064] In some embodiments, the sleep state may include that the user has entered the sleep state and the user is in the waking state. Among them, the user has entered the sleep state may specifically include: deep sleep state, light sleep state, eye movement state, etc.

[0065] In some embodiments, before determining the sleep state of the user, the sleep data can also be processed. For example: the average value, standard deviation, etc. of the sleep data can be calculated, the sleep data can also be denoised and normalized, or the obvious abnormal data in the sleep data can be removed, etc.

[0066] 103. When the sleep state indicates that the user has entered the sleep state, turn off the target lamp.

[0067] In the embodiments of the present application, if the sleep state indicates that the user has entered the sleep state, then the user no longer needs lighting at this time. Therefore, the target lamp can be turned off.

[0068] In some embodiments, the way to turn off the target lamp can be to send a turn-off instruction to the lamp. That is to say, when the sleep state indicates that the user has entered the sleep state, turn off the target lamp, which specifically includes: when the sleep state indicates that the user has entered the sleep state, send a turn-off instruction to the target lamp so that the target lamp performs an extinguishing operation after receiving the turn-off instruction.

[0069] It should be noted that the target lamp can be connected via Bluetooth to send instructions, or connected via Wi-Fi to send instructions, or connected via a physical line to send instructions. There is an intelligent switch set on the target lamp, which can control the switch by itself. As long as the target lamp receives a shutdown instruction, it can control the intelligent switch to switch to the off state, thereby turning off the target lamp.

[0070] A lamp control method provided by an embodiment of the present application determines whether a user has fallen asleep based on the user's sleep data, and turns off the lamp after determining that the user has fallen asleep, realizing the automatic turning on and off of the lamp. In this way, there is no need for the user to manually turn off the lamp, and the status of the device can be automatically sensed, avoiding long-term lighting of the lamp, saving power resources, and improving the convenience of the smart home.

[0071] As Figure 2 shown, Figure 2 is a flowchart of a lamp control method provided by an embodiment of the present application. The method may further include the following steps:

[0072] 201. Real-time collect the user's sleep data through a sleep sensor.

[0073] In an embodiment of the present application, the user's sleep data can be real-time collected through a sleep sensor. The sleep data may at least include: respiratory rate, heart rate value, body posture, etc.

[0074] It should be noted that the sleep sensor may specifically include an accelerometer, a heart rate sensor, a radar, an electroencephalogram (EEG), etc.

[0075] 202. When it is detected that the respiratory rate and the heart rate value are within a preset sleep range, detect the body posture of the user within a first duration.

[0076] In an embodiment of the present application, generally, during the sleep process of most users, the respiration and heart rate are lower than those in the waking state, and the values are also very smooth. Therefore, a preset sleep range can be set in advance. The preset sleep range can be a range for the respiratory rate and a range for the heart rate value respectively. First, detect whether the respiratory rate is within the corresponding preset sleep range, and detect whether the heart rate value is within the corresponding preset sleep range. If it is detected that both the respiratory rate and the heart rate value are within the corresponding preset sleep range, it indicates that the user may have fallen asleep, and the body posture of the user can also be detected. Since the body posture can be understood as a continuous parameter, that is, at least two corresponding body postures at different times are required to determine the user's state. Therefore, the body posture of the user within a first duration can be detected.

[0077] It should be noted that the first duration can be a duration set by the user himself. Since the user's pose remains unchanged for a period of time, it may indicate that the user has fallen asleep. Of course, it may also indicate that the user just has no body movement and may not necessarily be sleeping. Therefore, if the duration is too short, misjudgment may occur. And if the duration is too long, it may also cause the lamp to be turned on for too long, affecting resources and the user's sleep. Therefore, the first duration can be set by the user himself, can be a fixed duration, or can be a duration set during historical detection. The embodiments of the present application do not make specific limitations.

[0078] In some embodiments, the judgment of the breathing rate and heart rate value can also be a continuous judgment within a period of time. That is to say, the breathing rate and heart rate value can be continuously collected within a period of time. When the multiple breathing rates and heart rate values collected within this period are all within the corresponding preset sleep interval, it can be considered that the user may have fallen asleep, and then the user's pose can be detected continuously.

[0079] 203. When it is detected that the user's pose situation within the first duration meets the preset situation, determine that the user's sleep state is that the user has fallen asleep.

[0080] In the embodiments of the present application, if the user has fallen asleep, then the user's pose will not change much. It is only possible to have gentle breathing changes or occasional turning over and other movements. Therefore, a preset situation that meets common sleep scenarios can be set. As long as the user's pose meets the preset situation within the first duration, it can be considered that the user's sleep state is that the user has fallen asleep.

[0081] In some embodiments, the preset situation can be determined according to the user's usual sleep habits after falling asleep. For example: occasional turning over, occasional talking in sleep, or regular snoring, etc.

[0082] 204. When the sleep state indicates that the user has fallen asleep, turn off the target lamp.

[0083] In the embodiments of the present application, for the description of step 204, please refer to the detailed description of step 103 in the above embodiments. The embodiments of the present application will not repeat it.

[0084] In some embodiments, when the sleep state indicates that the user has fallen asleep, turning off the target lamp may specifically include: when the sleep state indicates that the user has fallen asleep, determine the current moment; when the current moment is within the preset lamp-off period, turn off the target lamp.

[0085] It should be noted that after it is determined that the user has fallen asleep according to the sleep state, the current moment, that is, the current time point, can also be determined, and then it can be compared with the preset lights-out period. If the current moment is within the preset lights-out period, then the target lamp can be turned off.

[0086] In some embodiments, when the user is playing with the mobile phone and unconsciously falls asleep, but the user may not actually be about to sleep. If the lamp is still directly and automatically turned off, the user may sleep too long in the dark environment, resulting in delays in subsequent work. Therefore, if the current moment is not within the preset lights-out period, the target lamp may not be turned off.

[0087] It should be noted that the preset lights-out period can be a preset lunch break period or a late night period, for example, after 23:00. In this way, if the user lies in bed at night playing with the mobile phone and then falls asleep, the lights can also be automatically turned off after 23:00. The preset lights-out period can be set by the user himself or set according to the user's usual sleep habits.

[0088] In some embodiments, when the sleep state indicates that the user has fallen asleep, turning off the target lamp may specifically include: when the sleep state indicates that the user has fallen asleep, start timing; when the timing duration reaches the second duration, turn off the target lamp.

[0089] It should be noted that after the user falls asleep, it may first be in the light sleep stage, and it takes some time to enter the deep sleep stage. In fact, it is relatively easy to wake up in the light sleep stage. Therefore, the light can be turned off after a period of time to determine that the user has entered the deep sleep stage or has not woken up during this period, and then the lamp can be turned off.

[0090] In some embodiments, timing can be performed by a timer. The second duration can be a duration set by the user himself. If the duration is too long, it may cause the lamp to be turned on for too long, affecting resources and the user's sleep. Therefore, the second duration can be set by the user himself, or it can be a fixed duration, or it can be a duration set during historical detection. The embodiments of the present application do not make specific limitations.

[0091] In some embodiments, the target lamp can be a main lighting lamp, or an atmosphere lamp in the bedroom, or just a bedside night light. Some users may be used to turning on a night light when sleeping and do not like to sleep in a completely dark environment. Then, even if it is detected that the user has fallen asleep, the target lamp may not be turned off.

[0092] In some embodiments, when the sleep state indicates that the user has fallen asleep, turning off the target lamp may specifically include: when the sleep state indicates that the user has fallen asleep, detecting the brightness value of the current environment; when the brightness value exceeds the preset brightness value, turning off the target lamp.

[0093] It should be noted that the preset brightness value can be a brightness value that is more suitable for the user during sleep and is set by the user himself, or it can be the brightness value when the user was sleeping historically. If the brightness value when the target lamp is turned on exceeds this preset brightness value, the target lamp can be turned off; if the brightness value when the target lamp is turned on does not exceed this preset brightness value, it means that the current brightness is acceptable even when the user is sleeping, then the target lamp can not be turned off.

[0094] In some embodiments, after determining that the user has fallen asleep according to the sleep state, different from directly turning off the lamp, different duration ranges and brightness gradients of the lamp can also be set. That is to say, when the sleep state indicates that the user has fallen asleep, turning off the target lamp may specifically include: when the sleep state indicates that the user has fallen asleep, adjusting the initial brightness of the target lamp to the preset brightness; when it is detected that the duration of the user's falling asleep reaches the third duration, turning off the target lamp.

[0095] It should be noted that the third duration can be a duration set by oneself. It can be understood that after determining that the user has fallen asleep, first lower the brightness of the target lamp, and then turn off the lamp after a period of time. That is to say, the preset brightness is lower than the initial brightness. First, lower the brightness of the lamp to ensure that the light is not too bright when the user is sleeping, and then when the user does not wake up during this period and is determined to still be sleeping, the target lamp is completely turned off.

[0096] A lamp control method provided by an embodiment of the present application determines whether the user has fallen asleep through the user's sleep data, and turns off the lamp after determining that the user has fallen asleep, realizing the automatic turning on and off of the lamp. In this way, there is no need for the user to manually turn off the lamp, and the state of the device can be automatically sensed, avoiding the long-term lighting of the lamp, saving power resources, and improving the convenience of the smart home.

[0097] As Figure 3 shown, an embodiment of the present application provides a lamp control device, and the lamp control device may include:

[0098] An acquisition module 301, configured to collect the user's sleep data in real time;

[0099] A processing module 302, configured to determine the user's sleep state according to the sleep data;

[0100] The processing module 302 is further configured to turn off the target lamp when the sleep state indicates that the user has fallen asleep.

[0101] In some embodiments, the acquisition module 301 is specifically configured to collect the sleep data of the user in real time through a sleep sensor;

[0102] Among them, the sleep data at least includes: respiratory rate, heart rate value, posture, etc.

[0103] In some embodiments, the processing module 302 is specifically configured to detect the posture of the user within a first duration when it is detected that the respiratory rate and the heart rate value are within a preset sleep range;

[0104] The processing module 302 is specifically configured to determine that the sleep state of the user has entered sleep when it is detected that the posture of the user within the first duration meets the preset condition.

[0105] In some embodiments, the processing module 302 is specifically configured to determine the current time when the sleep state indicates that the user has entered sleep;

[0106] The processing module 302 is specifically configured to turn off the target lamp when the current time is within a preset lights-out period.

[0107] In some embodiments, the processing module 302 is specifically configured to start timing when the sleep state indicates that the user has entered sleep;

[0108] The processing module 302 is specifically configured to turn off the target lamp when the timing duration reaches a second duration.

[0109] In some embodiments, the processing module 302 is specifically configured to send a turn-off instruction to the target lamp when the sleep state indicates that the user has entered sleep, so that the target lamp performs an extinguishing operation after receiving the turn-off instruction.

[0110] In some embodiments, the processing module 302 is specifically configured to detect the brightness value of the current environment when the sleep state indicates that the user has entered sleep;

[0111] The processing module 302 is specifically configured to turn off the target lamp when the brightness value exceeds a preset brightness value.

[0112] In the embodiments of the present application, each module can implement the lamp control method provided in the above method embodiments and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0113] As Figure 4 shown, the embodiments of the present application further provide an electronic device, which may include:

[0114] A memory 401 storing executable program code;

[0115] A processor 402 coupled to the memory 401;

[0116] Among them, the processor 402 calls the executable program code stored in the memory 401 and executes the lamp control method executed by the electronic device in the above method embodiments.

[0117] The embodiment of the present application provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the lamp control method in the above method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0118] The embodiment of the present application also provides a computer program product. The computer program product stores a computer program. When the computer program is executed by a processor, each process of the lamp control method in the above method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0119] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.

[0120] In several embodiments provided by the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the device, method, and computer program product according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code. A module, a program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0121] In this application, the processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0122] In this application, the memory may include non-permanent memory in the form of computer-readable media, Random Access Memory (RAM) and / or non-volatile memory such as Read-Only Memory (ROM) or flash RAM. The memory is an example of computer-readable media.

[0123] In this application, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable storage medium, and computer-readable media include permanent and non-permanent, removable and non-removable storage media. The storage medium can implement information storage by any method or technology, and the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (Parallel Random Access Memory, PRAM), static random access memory (Static Random Access Memory, SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), programmable read-only memory (Programmable Read-only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), other types of random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), one-time programmable read-only memory (One-time Programmable Read-Only Memory, OTPROM), electrically-erasable programmable read-only memory (Electrically-Erasable Programmable Read-Only Memory, EEPROM), flash memory or other memory technologies, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0124] It should be noted that, in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0125] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment" that appears throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application. The above-mentioned multiple embodiments are not necessarily multiple independent embodiments. Dividing them into multiple embodiments is only used to highlight the different technical features in different embodiments. Those skilled in the art should be aware that the above-mentioned multiple embodiments can also be combined arbitrarily.

[0126] In various embodiments of the present application, it should be understood that the magnitude of the sequence numbers of the above processes does not necessarily mean the inevitable sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0127] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] In addition, in each embodiment of the present application, each functional unit can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0129] When the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc., specifically, the processor in the computer device) to execute some or all of the steps of the above-mentioned methods in various embodiments of this application.

[0130] The above are only specific implementation manners of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application will not be limited to these embodiments herein, but rather will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A lamp control method, characterized in that: The method comprises: Collect users’ sleep data in real time; determining a sleeping state of the user according to the sleeping data; When the sleep state indicates that the user has fallen asleep, the target lamp is turned off.

2. The method according to claim 1, characterized in that The real-time collection of the user's sleep data includes: Collecting the sleep data of the user in real time through a sleep sensor; The sleep data includes at least: breathing frequency, heart rate, posture, etc.

3. The method according to claim 2, characterized in that The determining the sleep state of the user according to the sleep data includes: When it is detected that the breathing frequency and the heart rate value are in a preset sleep interval, detecting the posture of the user within a first time period; When it is detected that the posture of the user within the first time period meets a preset condition, it is determined that the sleeping state of the user is already asleep.

4. The method according to claim 1, characterized in that When the sleep state indicates that the user has fallen asleep, turning off the target lamp comprises: When the sleep state indicates that the user has fallen asleep, determining a current time; When the current moment is in the preset lights-off period, the target lamp is turned off.

5. The method according to claim 1, characterized in that When the sleep state indicates that the user has fallen asleep, turning off the target lamp comprises: When the sleep state indicates that the user has fallen asleep, start timing; When the timing duration reaches the second duration, the target lamp is turned off.

6. The method according to claim 1, characterized in that When the sleep state indicates that the user has fallen asleep, turning off the target lamp comprises: When the sleep state indicates that the user has fallen asleep, a shut-down instruction is sent to the target lamp, so that the target lamp performs a shut-down operation after receiving the shut-down instruction.

7. The method according to claim 1, characterized in that When the sleep state indicates that the user has fallen asleep, turning off the target lamp comprises: When the sleep state indicates that the user has fallen asleep, detecting a brightness value of the current environment; When the brightness value exceeds a preset brightness value, the target lamp is turned off.

8. A lighting control device, characterized in that: include: Acquisition module, used to collect user's sleep data in real time; A processing module, configured to determine the sleep state of the user according to the sleep data; The processing module is further configured to turn off the target lamp when the sleep state indicates that the user has fallen asleep.

9. An electronic device, characterized in that: include: A memory storing executable program code; and a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the lamp control method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the lamp control method according to any one of claims 1 to 7 is implemented.