Self-adaptive control method and system for smart home, and medium
Through the coordinated control of smart curtains and smart lamps, indoor illumination is adjusted according to outdoor light intensity and user needs, solving the problem that traditional smart home light adjustment is difficult to adapt, and energy-saving and comfortable lighting management is achieved.
Patent Information
- Application Number
- CN202510151300.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When lighting adjustment is performed in traditional smart homes, it is difficult to adaptively control according to user's actual needs and changes in outdoor light intensity, resulting in increased energy waste and operational complexity.
Through the coordinated control of smart curtains and smart lamps, the outdoor light intensity is collected by using light sensors, the opening width of smart curtains and the illumination control sequence of smart lamps is determined, and the adaptive adjustment of the indoor illumination environment is achieved.
It realizes adaptive adjustment of indoor illumination environment, improves user experience, saves energy, ensures that light comfort is highly consistent with user needs, improves energy use efficiency, and simplifies user operation process.
Smart Images

Figure CN120010258A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart home, and in particular to an adaptive control method, system and medium of a smart home. Background Art
[0002] With the rapid development of science and technology, smart home has become an important part of modern families. However, when adjusting lighting, traditional smart home is difficult to perform adaptive control according to the actual needs of users and changes in outdoor light intensity, resulting in energy waste and increased operational complexity. Summary of the invention
[0003] The purpose of the present invention is to provide an adaptive control method, system and medium for a smart home, which can optimize energy utilization and meet the personalized lighting needs of users through the coordinated control of smart curtains and smart lamps.
[0004] In order to achieve the above object, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides an adaptive control method for a smart home, the method comprising the following steps: S100, in response to an illumination control instruction sent by a user, obtaining outdoor light intensity during a time period in which the smart curtain is allowed to be opened, and determining whether the outdoor light intensity is greater than a minimum illumination threshold; wherein the illumination control instruction includes a target activity area and the illumination required by the user for the target activity area; S200, when it is determined that the outdoor light intensity is greater than the minimum illumination threshold, determining the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width, calculating the deviation between the predicted illumination and the required illumination, and obtaining the illumination difference of the target activity area; S300, if it is determined that the illumination difference is a negative number, the smart curtain is controlled to open to the maximum opening width, and the illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence; wherein the illumination control sequence includes lighting intensity and corresponding control time.
[0005] Preferably, the determining of the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width comprises: S210, dividing the maximum span width of the smart curtain into multiple sampling widths at equal intervals; S220, when the smart lamp is turned off, under multiple outdoor light intensities greater than a minimum illumination threshold, respectively control the smart curtains to open to various sampling widths, and collect a first color image of the room, and determine a first illumination sequence of the target activity area based on the first color image; wherein the first color image includes the target activity area, and the first illumination sequence includes the first illumination of the target activity area under various sampling widths; S230, constructing sample data, and using the sample data to train a deep learning model to obtain an illumination prediction model for the activity area; wherein the sample data includes input data and corresponding output data, the input data is outdoor light intensity and sampling width, and the output data is a first illumination sequence; S240, obtaining the current outdoor light intensity, inputting the outdoor light intensity into the illumination prediction model, obtaining a predicted illumination sequence of the target activity area, and selecting the predicted illumination when the smart curtain is at the maximum bay width from the predicted illumination sequence; wherein the predicted illumination sequence includes the predicted illumination corresponding to the target activity area at each bay width.
[0006] Preferably, the determining a first illumination sequence of the target active area based on the first color image comprises: S221, calculating the first illumination of the target active area at each sampling width by the following formula; ; Wherein, Lsi is the first illumination of the target active area at the i-th sampling width, Gij is the average grayscale value of the j-th active area in the first color image at the i-th sampling width, Gr is the reference grayscale value of the target active area, M is the total number of active areas, N is the total number of sampling widths, Gsi is the average grayscale value of the target active area in the first color image at the i-th sampling width, avg(Gi) is the average grayscale value of all active areas in the first color image at the i-th sampling width, and max(Gi) represents the maximum illumination value at the i-th sampling width.
[0007] S222, forming a first illumination sequence based on the first illumination of the target active area at each sampling width.
[0008] Preferably, if it is determined that the illumination difference is a negative number, the smart curtain is controlled to be opened to the maximum bay width, and an illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence, including: S310, obtaining the illumination difference of the target activity area at every set sampling time; S320, if it is determined that the illumination difference is a negative number, obtaining a second illumination sequence of the target activity area, calculating the difference between the second illumination sequence and the required illumination, and obtaining a first difference sequence; the first difference sequence includes a plurality of first differences arranged in ascending order; wherein the second illumination sequence includes the second illumination of the target activity area under a plurality of different illumination intensities; S330, controlling the smart curtain to open to the maximum sampling width, obtaining a third color image of the room under the current outdoor light intensity, determining the third illumination of each activity area in the room based on the third color image, determining the position of the activity area with higher third illumination, determining the change trend of the predicted illumination based on the position of the activity area with higher third illumination, and determining the adjustment direction of the lighting intensity based on the change trend of the predicted illumination; wherein the change trend is rising or falling, and the adjustment direction of the lighting intensity is increasing or decreasing; S340, obtaining the third illumination of the target activity area at two adjacent sampling times, and determining a unit illumination change based on a difference between the third illuminations at two adjacent sampling times and the sampling time ratio; S350, dividing each first difference in the first difference sequence by the unit illumination change to obtain a first adjustment time corresponding to the first difference, and forming a first adjustment time sequence with the first adjustment times corresponding to the first differences; S360, determining the lighting intensity corresponding to the first difference value with the smallest absolute value in the first difference value sequence as the initial lighting intensity, and selecting subsequent lighting intensities in sequence based on the adjustment direction of the lighting intensity to obtain a lighting intensity sequence; S370, determine the first difference corresponding to each lighting intensity in the lighting intensity sequence, use the first adjustment time corresponding to the first difference as the control time corresponding to the illumination intensity, use each lighting intensity and the corresponding control time in the lighting intensity sequence as an illumination control sequence, and adjust the lighting intensity of the smart lamp according to the illumination control sequence.
[0009] Preferably, the acquiring of the second illumination sequence of the target active area comprises: S321, obtaining the smart lamps corresponding to the target activity area; S322, when the smart curtains are closed, the smart lamps are controlled to operate at a plurality of different lighting intensities, and a second color image of the room is collected, and a second illumination sequence of the target activity area is determined based on the second color image.
[0010] Preferably, the method further comprises: S331, if it is determined that the illumination difference is a positive number or 0, obtaining a predicted illumination sequence of the target activity area, selecting a predicted illumination closest to the required illumination from the predicted illumination sequence, and adjusting the smart curtain to a bay width corresponding to the predicted illumination; S332, determining a first illumination change amount of the target activity area at each bay width based on the predicted illumination sequence, and obtaining a first illumination change amount sequence of the target activity area at different bay widths; S333, selecting first illumination changes from the first illumination change sequence in sequence, dividing the first illumination change by the unit illumination change to obtain a second adjustment time, and determining an adjustment direction of the bay width based on the change trend of the predicted illumination; the adjustment direction of the bay width is increasing or decreasing; S334, adjusting the span width of the smart curtain according to the second adjustment time and the adjustment direction of the span width.
[0011] Preferably, the method further comprises: When it is determined that the outdoor light intensity is less than or equal to the minimum illumination threshold, a second illumination closest to the required illumination is selected from the second illumination sequence, and the lighting intensity of the smart lamp is adjusted to the second illumination.
[0012] In a second aspect, an embodiment of the present invention provides an adaptive control system for a smart home, the system comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements any one of the methods described above.
[0013] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to execute any one of the methods described above.
[0014] The beneficial effects of the present invention are as follows: according to the illumination control instruction sent by the user, in the time period when the smart curtain is allowed to be opened, the outdoor light intensity is obtained, and it is determined whether the outdoor light intensity is greater than the minimum illumination threshold, and the user's illumination demand is obtained in real time; when it is determined that the outdoor light intensity is greater than the minimum illumination threshold, the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum bay width is determined, and the deviation between the predicted illumination and the required illumination is calculated to obtain the illumination difference of the target activity area; if it is determined that the illumination difference is a negative number, the smart curtain is controlled to open to the maximum bay width, and the illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence; thereby realizing the adaptive adjustment of the indoor illumination environment, improving the user experience, saving energy, and ensuring that the light comfort is highly consistent with the user's needs. Intelligent management of lighting is realized, energy efficiency is improved, and the user operation process is simplified. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0016] Figure 1 is a flow chart of an adaptive control method for a smart home in an embodiment of the present invention; Figure 2 It is a schematic diagram of the structure of the adaptive control system of the smart home in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0018] In the related art, smart curtains are usually opened according to the opening width set by the user, and smart lamps are usually illuminated according to the illumination set by the user. However, the intensity and angle of sunlight are constantly changing throughout the day. If the smart curtains and smart lamps work independently, when adjusting the indoor lighting, simply adjusting the opening width of the smart curtains to use outdoor light for lighting will result in uneven indoor lighting or fail to meet the required illumination, making it difficult to meet the user's lighting needs; providing lighting solely through smart lamps will result in energy waste; and manual adjustment of smart curtains and smart lamps by users will result in cumbersome operations and a poor user experience.
[0019] The present invention collects outdoor light intensity through a light sensor, determines the span width of the smart curtain according to the outdoor light intensity and the required illumination during the time period when the smart curtain is allowed to be opened, and adjusts the indoor light intensity according to the span width of the smart curtain; combines the indoor light intensity and the lighting intensity of the smart lamp to meet the user's required illumination, and optimizes energy utilization through intelligent collaborative control of the smart curtain and the smart lamp, eliminating the user's tedious operations and improving the user experience.
[0020] See also Figure 1 The present invention provides an adaptive control method for a smart home, the method comprising the following steps: S100, in response to an illumination control instruction sent by a user, obtaining outdoor light intensity during a time period in which the smart curtain is allowed to be opened, and determining whether the outdoor light intensity is greater than a minimum illumination threshold; wherein the illumination control instruction includes a target activity area and the illumination required by the user for the target activity area; It should be noted that the minimum illumination threshold is pre-set to determine whether the outdoor light intensity can meet the indoor lighting needs. For example, at night, the outdoor light intensity is generally weak, and the effect of opening the smart curtains on indoor lighting can be ignored. Therefore, when the outdoor light intensity does not exceed the minimum illumination threshold, the program sets the smart curtains to be closed by default; the smart curtains will be opened only when the outdoor light intensity is greater than the minimum illumination threshold.
[0021] S200, when it is determined that the outdoor light intensity is greater than the minimum illumination threshold, determining the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width, calculating the deviation between the predicted illumination and the required illumination, and obtaining the illumination difference of the target activity area; Specifically, since window glass and gauze curtains block light to a certain extent, the outdoor light intensity is weakened, but there is a certain relationship between the outdoor light intensity and the indoor light intensity. The indoor light intensity can be predicted by the outdoor light intensity, and then the illumination difference of the target activity area can be determined.
[0022] S300, if it is determined that the illumination difference is a negative number, the smart curtain is controlled to open to the maximum opening width, and the illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence; wherein the illumination control sequence includes multiple lighting intensities and corresponding control times.
[0023] It should be noted that the embodiments provided by the present invention are applied to adjust the light in a room. Specifically, daytime is used as the time period when the smart curtains are allowed to be opened. During the time period when the smart curtains are allowed to be opened, the outdoor light is generally sunlight. The outdoor light intensity is collected by a light sensor. If the outdoor light intensity reaches the minimum illumination threshold, the smart curtains are awakened to open. The indoor light intensity is predicted based on the outdoor light intensity. If the indoor light intensity is sufficient to meet the required illumination, the width of the smart curtains is determined according to the indoor light intensity and the required illumination, and the required illumination is met by adjusting the width of the smart curtains. If the outdoor light intensity reaches the minimum illumination threshold, but the indoor light intensity cannot meet the required illumination, the smart lamps are awakened, and the illumination is supplemented by the smart lamps. The required illumination is met by combining the outdoor light and the smart lamps. The present invention realizes dynamic optimization of the indoor environment by automatically adjusting the light brightness and curtain status of the room, adjusts and optimizes the linkage effect of the smart curtains and lamps, and provides the most suitable indoor lighting, which is both energy-saving and environmentally friendly and meets personalized needs.
[0024] In some improved embodiments, the step of determining the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width includes: S210, dividing the maximum span width of the smart curtain into multiple sampling widths at equal intervals; S220, when the smart lamp is turned off, under multiple outdoor light intensities greater than a minimum illumination threshold, respectively control the smart curtains to open to various sampling widths, and collect a first color image of the room, and determine a first illumination sequence of the target activity area based on the first color image; wherein the first color image includes the target activity area, and the first illumination sequence includes the first illumination of the target activity area under various sampling widths; Specifically, an indoor camera is installed to capture images of the indoor environment, obtain an indoor color image containing the activity area, identify the activity area in the indoor color image, and calculate the average illumination of each activity area to obtain a first illumination sequence of the activity area; the activity area includes the user's bedside table, computer desktop, aisle and other areas where user behaviors occur, and the activity area is also the area where the smart lamps focus on lighting.
[0025] S230, constructing sample data, and using the sample data to train a deep learning model to obtain an illumination prediction model for the activity area; wherein the sample data includes input data and corresponding output data, the input data is outdoor light intensity and sampling width, and the output data is a first illumination sequence; Specifically, the deep learning model can use convolutional neural networks and long short-term memory networks, combining convolutional layers to extract spatial features, and LSTM to capture changes in light intensity over time. Transformer can also be used. Transformer is suitable for long sequence data and can better capture global dependencies.
[0026] S240, obtaining the current outdoor light intensity, inputting the outdoor light intensity into the illumination prediction model, obtaining a predicted illumination sequence of the target activity area, and selecting the predicted illumination when the smart curtain is at the maximum bay width from the predicted illumination sequence; wherein the predicted illumination sequence includes the predicted illumination corresponding to the target activity area at each bay width.
[0027] In some improved embodiments, determining a first illumination sequence of the target activity area based on the first color image includes: S221, calculating the first illumination of the target active area at each sampling width by the following formula; ; Among them, Lsi is the first illuminance of the target active area at the i-th sampling width, Gij is the average grayscale value of the j-th active area in the first color image at the i-th sampling width, Gr is the reference grayscale value of the target active area, and the grayscale value is the grayscale value corresponding to the required illumination in the first color image, M is the total number of active areas, N is the total number of sampling widths, Gsi is the average grayscale value of the target active area in the first color image at the i-th sampling width, avg(Gi) is the average grayscale value of all active areas in the first color image at the i-th sampling width, and max(Gi) represents the maximum illumination value at the i-th sampling width.
[0028] This formula takes into account the differences in illumination at different locations and the maximum and average values of light intensity, making the calculated illumination more accurate and representative. It can accurately predict the illumination required for the target activity area, and then adjust the smart curtains and lamps according to actual needs to achieve the optimal configuration of the indoor light environment.
[0029] S222, forming a first illumination sequence based on the first illumination of the target active area at each sampling width.
[0030] In some improved embodiments, if it is determined that the illumination difference is a negative number, the smart curtain is controlled to open to the maximum bay width, and the illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence, including: S310, obtaining the illumination difference of the target activity area at every set sampling time; A positive illuminance difference indicates that the predicted illuminance is greater than the required illuminance, and a negative illuminance difference indicates that the predicted illuminance is less than the required illuminance. Through the illuminance difference corresponding to each activity area, it can be preliminarily concluded that each activity area may need to be adjusted in a certain way. If the illuminance difference is a positive number, the predicted illuminance can be reduced by adjusting the width of the smart curtains. If the illuminance difference is a negative number, the required illuminance can be met by increasing the illuminance of the smart lamps. However, since the illuminances of various activity areas in a room are interrelated, adjusting the illuminance of one activity area will inevitably affect the illuminance of other activity areas. Therefore, it is necessary to make overall adjustments to each activity area in subsequent steps to evenly meet the required illuminance of the target activity area.
[0031] S320, if it is determined that the illumination difference is a negative number, obtaining a second illumination sequence of the target activity area, calculating the difference between the second illumination sequence and the required illumination, and obtaining a first difference sequence; the first difference sequence includes a plurality of first differences arranged in ascending order; wherein the second illumination sequence includes the second illumination of the target activity area under a plurality of different illumination intensities; The first difference sequence represents the deviation between the second illumination of the smart lamp at multiple different illumination intensities and the required illumination. It can be understood that the smart lamp meets the required illumination at the maximum illumination intensity. Therefore, at least the largest element in the first difference sequence is a positive number.
[0032] S330, controlling the smart curtain to open to the maximum sampling width, obtaining a third color image of the room under the current outdoor light intensity, determining the third illumination of each activity area in the room based on the third color image, determining the position of the activity area with higher third illumination, determining the change trend of the predicted illumination based on the position of the activity area with higher third illumination, and determining the adjustment direction of the lighting intensity based on the change trend of the predicted illumination; wherein the change trend is rising or falling, and the adjustment direction of the lighting intensity is increasing or decreasing; Specifically, if the third illuminance of the indoor activity area on the east side is higher than the third illuminance of the indoor activity area on the west side, it means that the current time is afternoon when the sun sets, and the predicted illuminance will decrease. Otherwise, it is morning and the predicted illuminance will increase.
[0033] S340, obtaining the third illumination of the target activity area at two adjacent sampling times, and determining a unit illumination change based on a difference between the third illuminations at two adjacent sampling times and the sampling time ratio; Specifically, the difference between the current third illuminance of the target activity area and the third illuminance of the previous sampling time is calculated and divided by the sampling time to obtain a unit illuminance change, which reflects the change in illumination of the target activity area due to outdoor light intensity per unit time.
[0034] S350, dividing each first difference in the first difference sequence by the unit illumination change to obtain a first adjustment time corresponding to the first difference, and forming a first adjustment time sequence with the first adjustment times corresponding to the first differences; S360, determining the lighting intensity corresponding to the first difference value with the smallest absolute value in the first difference value sequence as the initial lighting intensity, and selecting subsequent lighting intensities in sequence based on the adjustment direction of the lighting intensity to obtain a lighting intensity sequence; Specifically, if the adjustment direction of the lighting intensity is to increase, a subsequent lighting intensity greater than the initial lighting intensity is selected, otherwise a subsequent lighting intensity less than the initial lighting intensity is selected, until all first differences correspond to a lighting intensity, forming a lighting intensity sequence.
[0035] S370, determine the first difference corresponding to each lighting intensity in the lighting intensity sequence, use the first adjustment time corresponding to the first difference as the control time corresponding to the illumination intensity, use each lighting intensity and the corresponding control time in the lighting intensity sequence as an illumination control sequence, and adjust the lighting intensity of the smart lamp according to the illumination control sequence.
[0036] By controlling the smart curtains to open to the maximum sampling width, outdoor light can be utilized as much as possible; after calculating the first difference sequence, the first adjustment time corresponding to the first difference is obtained in combination with the unit illuminance change, thereby effectively shortening the control time of the smart lamp when adjusting the lighting intensity, ensuring that the indoor illuminance keeps pace with the changes in outdoor light, thereby improving lighting efficiency and reducing energy waste.
[0037] In some improved embodiments, the step of acquiring a second illumination sequence of the target active area includes: S321, obtaining the smart lamps corresponding to the target activity area; Specifically, during initialization, a corresponding activity area is set for each smart lamp according to its light intensity contribution, and the smart lamp with the largest light intensity contribution is used as the smart lamp corresponding to the activity area.
[0038] S322, when the smart curtains are closed, the smart lamps are controlled to operate at a plurality of different lighting intensities, and a second color image of the room is collected, and a second illumination sequence of the target activity area is determined based on the second color image.
[0039] The second color image includes the activity area corresponding to the smart lamp, and the first illumination sequence and the second illumination sequence are fused and analyzed to more accurately predict the indoor illumination. This not only takes into account the influence of natural light changes, but also combines the adjustment effect of indoor lighting equipment. By analyzing the difference between the two, the collaborative working mode of the smart curtains and lamps can be adjusted to achieve a better lighting effect.
[0040] In some improved embodiments, the method further comprises: S331, if it is determined that the illumination difference is a positive number or 0, obtaining a predicted illumination sequence of the target activity area, selecting a predicted illumination closest to the required illumination from the predicted illumination sequence, and adjusting the smart curtain to a bay width corresponding to the predicted illumination; S332, determining a first illumination change amount of the target activity area at each bay width based on the predicted illumination sequence, and obtaining a first illumination change amount sequence of the target activity area at different bay widths; Specifically, the predicted illuminances of the same active area corresponding to adjacent sampling widths are differentiated to obtain a first illuminance variation of the active area, and the first illuminance variation of the active area is sorted by sampling width to form a first illuminance variation sequence.
[0041] S333, selecting first illumination changes from the first illumination change sequence in sequence, dividing the first illumination change by the unit illumination change to obtain a second adjustment time, and determining an adjustment direction of the bay width based on the change trend of the predicted illumination; the adjustment direction of the bay width is increasing or decreasing; S334, adjusting the span width of the smart curtain according to the second adjustment time and the adjustment direction of the span width.
[0042] Specifically, the first illumination change is divided by the unit illumination change, the unit illumination change required to generate the first illumination change is calculated, and the adjustment time is obtained; if the change trend is rising, the bay width is increased, otherwise it is decreased.
[0043] In the fusion analysis process, time factors are taken into account, such as the impact of changes in outdoor light intensity at different times of the day on indoor illumination. The lighting intensity of smart lamps and the width of the opening of smart curtains are adjusted according to the illumination deviation. By adjusting the operation of smart curtains and lamps to better meet actual lighting conditions, the indoor light environment is ensured to match the user's comfort requirements. By automatically adjusting smart curtains and lamps, unnecessary energy consumption is reduced, thereby achieving effective energy management while ensuring comfort.
[0044] In some improved embodiments, the method further comprises: When it is determined that the outdoor light intensity is less than or equal to the minimum illumination threshold, a second illumination closest to the required illumination is selected from the second illumination sequence, the lighting intensity of the smart lamp is adjusted to the second illumination, and the smart curtain is controlled to close.
[0045] and Figure 1 Corresponding to the method, refer to Figure 2, an embodiment of the present invention provides an adaptive control system for a smart home, comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0046] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0047] In addition, an embodiment of the present invention further discloses a computer program product or a computer program, which is stored in a computer-readable storage medium. A processor of a computer device can read the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the contents of the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those of the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0048] It will be appreciated by those skilled in the art that all or some of the methods disclosed above and the system may be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0049] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. An adaptive control method for a smart home, characterized in that: The method comprises the following steps: S100, in response to an illumination control instruction sent by a user, obtaining outdoor light intensity during a time period in which the smart curtain is allowed to be opened, and determining whether the outdoor light intensity is greater than a minimum illumination threshold; wherein the illumination control instruction includes a target activity area and the illumination required by the user for the target activity area; S200, when it is determined that the outdoor light intensity is greater than the minimum illumination threshold, determining the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width, calculating the deviation between the predicted illumination and the required illumination, and obtaining the illumination difference of the target activity area; S300, if it is determined that the illumination difference is a negative number, the smart curtain is controlled to open to the maximum opening width, and the illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence; wherein the illumination control sequence includes lighting intensity and corresponding control time.
2. The method according to claim 1, characterized in that: The step of determining the predicted illumination of the target activity area under the outdoor light intensity when the smart curtain is at the maximum opening width comprises: S210, dividing the maximum span width of the smart curtain into multiple sampling widths at equal intervals; S220, when the smart lamp is turned off, under multiple outdoor light intensities greater than a minimum illumination threshold, respectively control the smart curtains to open to various sampling widths, and collect a first color image of the room, and determine a first illumination sequence of the target activity area based on the first color image; wherein the first color image includes the target activity area, and the first illumination sequence includes the first illumination of the target activity area under various sampling widths; S230, constructing sample data, and using the sample data to train a deep learning model to obtain an illumination prediction model for the activity area; wherein the sample data includes input data and corresponding output data, the input data is outdoor light intensity and sampling width, and the output data is a first illumination sequence; S240, obtaining the current outdoor light intensity, inputting the outdoor light intensity into the illumination prediction model, obtaining a predicted illumination sequence of the target activity area, and selecting the predicted illumination when the smart curtain is at the maximum bay width from the predicted illumination sequence; wherein the predicted illumination sequence includes the predicted illumination corresponding to the target activity area at each bay width.
3. The method according to claim 2, characterized in that The step of determining a first illumination sequence of a target active area based on the first color image comprises: S221, calculating the first illumination of the target active area at each sampling width by the following formula; ; Wherein, Lsi is the first illumination of the target active area at the i-th sampling width, Gij is the average grayscale value of the j-th active area in the first color image at the i-th sampling width, Gr is the reference grayscale value of the target active area, M is the total number of active areas, N is the total number of sampling widths, Gsi is the average grayscale value of the target active area in the first color image at the i-th sampling width, avg(Gi) is the average grayscale value of all active areas in the first color image at the i-th sampling width, and max(Gi) represents the maximum illumination value at the i-th sampling width; S222, forming a first illumination sequence based on the first illumination of the target active area at each sampling width.
4. The method according to claim 1, characterized in that: If it is determined that the illumination difference is a negative number, the smart curtain is controlled to be opened to the maximum opening width, and an illumination control sequence of the smart lamp is determined according to the required illumination, and the smart lamp is controlled to work according to the illumination control sequence, including: S310, obtaining the illumination difference of the target activity area at every set sampling time; S320, if it is determined that the illumination difference is a negative number, obtaining a second illumination sequence of the target activity area, calculating the difference between the second illumination sequence and the required illumination, and obtaining a first difference sequence; the first difference sequence includes a plurality of first differences arranged in ascending order; wherein the second illumination sequence includes the second illumination of the target activity area under a plurality of different illumination intensities; S330, controlling the smart curtain to open to the maximum sampling width, obtaining a third color image of the room under the current outdoor light intensity, determining the third illumination of each activity area in the room based on the third color image, determining the position of the activity area with higher third illumination, determining the change trend of the predicted illumination based on the position of the activity area with higher third illumination, and determining the adjustment direction of the lighting intensity based on the change trend of the predicted illumination; wherein the change trend is rising or falling, and the adjustment direction of the lighting intensity is increasing or decreasing; S340, obtaining the third illumination of the target activity area at two adjacent sampling times, and determining a unit illumination change based on a difference between the third illuminations at two adjacent sampling times and the sampling time ratio; S350, dividing each first difference in the first difference sequence by the unit illumination change to obtain a first adjustment time corresponding to the first difference, and forming a first adjustment time sequence with the first adjustment times corresponding to the first differences; S360, determining the lighting intensity corresponding to the first difference value with the smallest absolute value in the first difference value sequence as the initial lighting intensity, and selecting subsequent lighting intensities in sequence based on the adjustment direction of the lighting intensity to obtain a lighting intensity sequence; S370, determine the first difference corresponding to each lighting intensity in the lighting intensity sequence, use the first adjustment time corresponding to the first difference as the control time corresponding to the illumination intensity, use each lighting intensity and the corresponding control time in the lighting intensity sequence as an illumination control sequence, and adjust the lighting intensity of the smart lamp according to the illumination control sequence.
5. The method according to claim 4, characterized in that The step of acquiring a second illumination sequence of the target active area comprises: S321, obtaining the smart lamps corresponding to the target activity area; S322, when the smart curtains are closed, the smart lamps are controlled to operate at a plurality of different lighting intensities, and a second color image of the room is collected, and a second illumination sequence of the target activity area is determined based on the second color image.
6. The method according to claim 4, characterized in that The method further comprises: S331, if it is determined that the illumination difference is a positive number or 0, obtaining a predicted illumination sequence of the target activity area, selecting a predicted illumination closest to the required illumination from the predicted illumination sequence, and adjusting the smart curtain to a bay width corresponding to the predicted illumination; S332, determining a first illumination change amount of the target activity area at each bay width based on the predicted illumination sequence, and obtaining a first illumination change amount sequence of the target activity area at different bay widths; S333, selecting first illumination changes from the first illumination change sequence in sequence, dividing the first illumination change by the unit illumination change to obtain a second adjustment time, and determining an adjustment direction of the bay width based on the change trend of the predicted illumination; the adjustment direction of the bay width is increasing or decreasing; S334, adjusting the span width of the smart curtain according to the second adjustment time and the adjustment direction of the span width.
7. The method according to claim 4, characterized in that The method further comprises: When it is determined that the outdoor light intensity is less than or equal to the minimum illumination threshold, a second illumination closest to the required illumination is selected from the second illumination sequence, and the lighting intensity of the smart lamp is adjusted to the second illumination.
8. An adaptive control system for a smart home, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Cited By
Miniature stepping motor of smart home curtain and wireless networking control method
CN120523010A