Smart home control method based on mattress and electronic device

CN122592910APending Publication Date: 2026-08-18GUANGDONG SHANGCHI SMART HOME TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610896416.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-22
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]然而,上述现有方法存在一个显著缺陷:其环境调控完全依赖环境温湿度参数和预设时间曲线,忽略了用户个体之间的体表温度差异以及睡眠过程中体表温度分布的动态变化

Benefits of technology

在本申请的实施例中,通过融合床垫睡眠状态感知、红外热成像体表温度场分析以及空调多维出风控制,创造性地解决了现有智能睡眠系统中环境调控忽视个体体表温度分布差异的技术难题,实现了空调出风参数对用户个体热舒适状态的精准响应。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122592910A_ABST
    Figure CN122592910A_ABST
Patent Text Reader

Abstract

The application provides a mattress-based smart home control method and an electronic device. The mattress-based smart home control method comprises the following steps: when a user on a mattress is in a sleep state, generating a lighting-off instruction and a curtain-closing instruction; triggering body surface temperature acquisition based on the sleep state, obtaining a body surface area temperature matrix of the user based on an infrared thermal imaging sensor, and extracting a current highest body surface temperature value and a highest body surface temperature position corresponding to the current highest body surface temperature value based on the body surface area temperature matrix; based on the current highest body surface temperature value and the highest body surface temperature position, combining a preset comfortable temperature section and a preset wind-avoiding strategy, calculating a target air outlet direction, a target air outlet wind speed and a target air outlet temperature; based on the target air outlet direction, the target air outlet wind speed and the target air outlet temperature, generating an air conditioner driving control signal, and based on the air conditioner driving control signal, adjusting a deflection angle of an air outlet grille, a fan rotating speed and a compressor working frequency of the air conditioner respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mattress technology, specifically to smart home control methods and electronic devices based on mattresses. Background Technology

[0002] With the rapid development of the Internet of Things (IoT) and smart home technologies, users are demanding higher levels of comfort and intelligence in their living environments. Currently, various smart sleep systems integrating environmental sensing and device-linked control have emerged on the market. A typical existing method involves placing pressure sensors and heart rate / respiration monitoring modules within the mattress, combined with ambient light sensors and timing strategies, to achieve sleep state recognition and basic environmental regulation. Specifically, this method determines that the user has entered a sleep state after detecting that the user has been lying down continuously and that their heart rate and respiration are stabilizing. It then automatically turns off the main light and closes the curtains to create a dark environment. Simultaneously, the method uses indoor temperature and humidity sensors to acquire environmental parameters and, based on a preset fixed sleep temperature curve, adjusts the room temperature via air conditioning—for example, lowering the temperature at the beginning of sleep and appropriately raising it in the middle of the night—to simulate the body's nighttime temperature rhythm.

[0003] However, the existing methods have a significant drawback: their environmental control relies entirely on ambient temperature and humidity parameters and preset time curves, ignoring the differences in body surface temperature between individual users and the dynamic changes in body surface temperature distribution during sleep. In practice, differences in metabolic rate, bedding coverage, and sleeping posture among different users lead to drastically different heat dissipation needs in different areas of the body (such as the trunk, limbs, and head). A uniform room temperature control strategy often cannot prevent the air conditioner from blowing directly onto the user's hottest areas of the body (such as the chest or face). This can not only cause discomfort from localized overheating or cooling but also easily induce awakenings or respiratory discomfort during sleep, thereby reducing sleep quality. The root cause of this drawback is that existing methods lack the perception and utilization of the spatial distribution characteristics of user body surface temperature, resulting in the control of airflow direction, speed, and temperature always being based on coarse-grained judgments at the environmental level, failing to provide fine-grained adaptation to the actual thermal comfort state of individual users.

[0004] Therefore, how to make the air conditioner's air output parameters adaptively match the actual distribution of the user's body surface temperature during sleep without increasing the user's operational burden, and avoid direct impact of airflow on sensitive areas, has become a technical problem that urgently needs to be solved in the field of intelligent sleep environment control. Summary of the Invention

[0005] The embodiments of this application provide a smart home control method and electronic device based on a mattress, so as to at least partially solve the above-mentioned technical problems.

[0006] To achieve the above objectives, according to a first aspect of this application, a smart home control method based on a mattress is provided, comprising the following steps: A100. When the user on the mattress is asleep, a lighting off command and a curtain closing command are generated. Based on the lighting off command, the main lighting light is powered off, and based on the curtain closing command, the curtain motor is controlled to drive the curtain to move to the fully closed position. A200: Based on the sleep state, trigger body surface temperature acquisition, obtain the user's body surface area temperature matrix based on the infrared thermal imaging sensor, and extract the current highest body surface temperature value and the highest body surface temperature location corresponding to the current highest body surface temperature value based on the body surface area temperature matrix. A300: Based on the current highest body surface temperature value and the location of the highest body surface temperature, combined with the preset comfortable temperature range and the preset wind avoidance strategy, calculate the target air outlet direction, target air outlet speed and target air outlet temperature; A400: Based on the target air outlet direction, the target air outlet speed, and the target air outlet temperature, generate an air conditioning drive control signal, and adjust the air outlet grille deflection angle, fan speed, and compressor operating frequency of the air conditioner according to the air conditioning drive control signal, so that the actual air outlet direction, actual air outlet speed, and actual air outlet temperature correspond to the target air outlet direction, the target air outlet speed, and the target air outlet temperature, respectively.

[0007] According to a second aspect of this application, a mattress is provided, including a control component for performing the mattress-based smart home control method described above.

[0008] According to a third aspect of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described mattress-based smart home control method.

[0009] The beneficial effects of the embodiments of this application are as follows: In the embodiments of this application, by integrating mattress sleep state perception, infrared thermal imaging body surface temperature field analysis, and multi-dimensional air conditioning air outlet control, the technical problem of neglecting individual body surface temperature distribution differences in environmental regulation in existing smart sleep systems is creatively solved, and the air conditioning air outlet parameters are made to accurately respond to the individual thermal comfort state of the user. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the mattress structure provided in an embodiment of this application; Figure 2 This is one of the partial structural schematic diagrams of a mattress provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the base plate provided in an embodiment of this application; Figure 4 This is a second schematic diagram of a partial structure of a mattress provided in an embodiment of this application; Figure 5 This is a flowchart of a mattress-based smart home control method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0012] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In addition, it should be understood that the specific embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application. In this application, unless otherwise stated, directional terms such as "upper" and "lower" generally refer to the upper and lower positions of the device in actual use or operation, specifically the drawing directions in the accompanying drawings; while "inner" and "outer" refer to the outline of the device.

[0013] The following is combined with Figures 1 to 6 This application describes a mattress-based smart home control method and electronic device.

[0014] According to the embodiments of the first aspect of this application, such as Figure 5As shown, a smart home control method based on a mattress is provided. This method is executed based on a smart home system comprised of a mattress, air conditioner, lighting, curtain motor, and infrared thermal imaging sensor. The mattress is embedded with a pressure sensor and a heart rate and respiration monitoring module to detect the user's in-bed and sleep states in real time. The infrared thermal imaging sensor can be installed on a wall, ceiling, or bedside table above the mattress, with its field of view covering the user's lying area, to collect infrared radiation signals from the user's body surface and convert them into temperature distribution data.

[0015] The method includes the following steps: A100. When the user on the mattress is asleep, a light-off command and a curtain-closing command are generated. Based on the light-off command, the main light is powered off, and based on the curtain-closing command, the curtain motor is controlled to move the curtains to a fully closed position. Specifically, the mattress's built-in pressure sensor and heart rate / respiration monitoring module continuously collect the user's bed position signals and vital signs. When it detects that the user is lying down continuously, their heart rate is stabilizing, and their breathing rate has entered a preset sleep range, it is determined that the user has entered a sleep state. A light-off command is then generated and sent to the main light control circuit via wired or wireless communication, causing the main light to be powered off. Simultaneously, a curtain-closing command is generated and sent to the curtain motor drive controller via wireless communication, driving the curtain motor to rotate forward or reverse to move the curtains to a fully closed position, creating a dark environment for sleep. If there are users on both sides, only the lighting on the side corresponding to the sleeping user is turned off to avoid disturbing the other user who is not asleep.

[0016] A200. Based on the sleep state, surface temperature acquisition is triggered. An infrared thermal imaging sensor acquires a surface temperature matrix of the user's body area. Based on this matrix, the current highest surface temperature value and the corresponding location of the highest surface temperature are extracted. Specifically, the infrared thermal imaging sensor is activated after the user is determined to be asleep, acquiring radiation temperature data of the user's body surface area at a set frequency (e.g., once every 10 seconds). The acquired data is processed to generate a surface temperature matrix, where each element corresponds to the temperature value of a local area of ​​the body surface. The system extracts the maximum temperature value from this matrix as the current highest surface temperature value and records the matrix coordinates corresponding to this maximum value. A spatial mapping algorithm is used to convert the matrix coordinates into actual location coordinates on the user's body surface, thereby obtaining the location of the highest surface temperature. This location typically corresponds to the area with the most active metabolism and highest blood flow, such as the core torso or exposed areas not covered by bedding.

[0017] A300: Based on the current highest body surface temperature value and the location of the highest body surface temperature, combined with a preset comfort temperature range and a preset wind avoidance strategy, the system calculates the target airflow direction, target airflow speed, and target airflow temperature. Specifically, the preset comfort temperature range is a safe range of body surface temperature set according to human thermal comfort theory (e.g., 32℃~36℃), and the preset wind avoidance strategy is a control rule that prevents airflow from directly blowing onto the user's highest body surface temperature area. The system first compares the current highest body surface temperature value with the preset comfort temperature range: if the highest body surface temperature value is within the comfort range, the target airflow temperature remains unchanged or is slightly adjusted to the current room temperature; if the highest body surface temperature value is higher than the upper limit of the comfort range, the target airflow temperature is set to a cooling temperature lower than the room temperature, and the airflow speed is appropriately increased to accelerate heat dissipation; if the highest body surface temperature value is lower than the lower limit of the comfort range, the target airflow temperature is set to a heating temperature higher than the room temperature, and the airflow speed is reduced to avoid excessive air cooling. Based on the location of the highest body surface temperature, and combined with a preset wind avoidance strategy, the target airflow direction is determined, causing the airflow to deviate from the area where that location is located. This prevents the air conditioner's airflow from blowing directly onto the user's hottest area of ​​the body (such as the chest or face), thus preventing localized overcooling. Furthermore, the required deflection angle and direction can be calculated based on the relative spatial coordinates of the location of the highest body surface temperature and the air conditioner's air outlet, generating corresponding target airflow direction parameters.

[0018] A400 generates an air conditioning drive control signal based on the target air outlet direction, target air outlet speed, and target air outlet temperature. Based on this control signal, it adjusts the air outlet grille deflection angle, fan speed, and compressor operating frequency to ensure that the actual air outlet direction, speed, and temperature correspond to the target air outlet direction, speed, and temperature, respectively. Specifically, the system converts the calculated target air outlet direction into horizontal and vertical deflection angle control values ​​for the air outlet grille, the target air outlet speed into fan drive motor speed control value, and the target air outlet temperature into compressor operating frequency control value. These control values ​​are sent to the air conditioner's main control board via a communication protocol as drive control signals, and the main control board drives the corresponding actuators for adjustment. After adjustment, the actual air outlet direction avoids the hottest area on the user's body surface, and the actual air outlet speed and temperature match the target values, thus achieving precise adaptation to the user's thermal comfort during sleep.

[0019] The benefits of this implementation method are significant. First, by acquiring the user's body surface temperature matrix and extracting the highest body surface temperature value and location using an infrared thermal imaging sensor, the system can accurately perceive the individual user's thermal comfort state, rather than relying on coarse-grained ambient temperature, achieving an upgrade from "environment-level" control to "individual-level" control. Second, based on the location of the highest body surface temperature and a preset wind avoidance strategy, the target airflow direction is calculated, causing the air conditioner's airflow to actively avoid high-temperature sensitive areas on the user's body surface (such as the chest and face). This avoids sleep disturbance problems such as localized overcooling and discomfort caused by direct airflow onto high-temperature areas, as seen in existing technologies, significantly improving thermal comfort and sleep quality during sleep. Furthermore, the calculation of the target airflow temperature and wind speed comprehensively considers the deviation between the highest body surface temperature value and the comfort zone, achieving adaptive adjustment of cooling or heating intensity, balancing energy saving and comfort. The entire control process is automatically triggered after the user's sleep state is determined, requiring no manual operation from the user, fully realizing the automation and seamless experience of smart home technology. This method deeply integrates the sleep sensing capabilities of a mattress with the precise airflow control of an air conditioner, providing a more personalized solution for smart bedroom environments.

[0020] In summary, this application creatively solves the technical problem of neglecting individual differences in body surface temperature distribution in existing intelligent sleep systems by integrating mattress sleep state perception, infrared thermal imaging body surface temperature field analysis, and multi-dimensional air conditioning air outlet control, and achieves accurate response of air conditioning air outlet parameters to the individual thermal comfort state of users.

[0021] In some embodiments, the mattress-based smart home control method further includes an infant sleep safety monitoring step based on a surveillance camera. The surveillance camera is fixedly installed on the bedroom ceiling, with its field of view covering the area where the mattress is located, for capturing real-time images of the area on the bed.

[0022] The control method further includes the following steps: C100: Based on the sleep state determined in step A100, a monitoring camera activation command is generated, and the monitoring camera fixedly installed on the bedroom ceiling is controlled to start real-time image acquisition to obtain real-time images of the bed area. Specifically, after the pressure sensor and heart rate / respiration monitoring module built into the mattress determine that the user has entered a sleep state, the system immediately sends an activation command to the monitoring camera fixedly installed on the bedroom ceiling. This monitoring camera is usually a wide-angle or panoramic camera, installed in the center of the bedroom ceiling or directly above the mattress, with its field of view covering the entire mattress area. After receiving the activation command, the camera begins to acquire real-time images of the bed area at a set frame rate (e.g., 15fps or 30fps) and transmits the image data to the local controller or cloud processing platform. This activation command is executed synchronously or sequentially with the lighting off and curtain closing commands in step A100, ensuring that visual monitoring starts simultaneously with the creation of a sleep environment.

[0023] C200: Based on the real-time image of the bed area, extract the physical boundary line of the mattress in the image coordinate system, and extract all human target regions in the real-time image of the bed area to obtain a set of human target regions. Specifically, the controller or processing platform performs image processing and analysis on the received real-time image of the bed area. First, using an edge detection algorithm (such as the Canny operator) or a semantic segmentation model based on deep learning, identify and extract the physical boundary contour line of the mattress in the image. This boundary line is composed of a series of pixel coordinate points in the image coordinate system, which are used as a spatial reference for subsequent distance calculations. Second, using a target detection algorithm (such as YOLO, SSD, etc.) or a human pose estimation algorithm, extract all human target regions from the same frame image. Each target region is represented by a set of pixel coordinates, and all human target regions together constitute the set of human target regions. If there is only one adult on the mattress, the set of human target regions contains only one target; if an adult and an infant are in the same bed, the set contains two targets.

[0024] C300. Based on the area of ​​the geometric bounding rectangle of each target region in the human target region set, the human target region set is divided into infant target regions belonging to the infant and adult target regions belonging to the adult. The infant's center pixel coordinates are obtained based on the geometric center of the infant target region, and the adult's coverage pixel range is obtained based on the contour coverage boundary of the adult target region. Specifically, for each target in the human target region set, the area of ​​its minimum bounding rectangle is calculated. Since the infant's body size is significantly smaller than that of an adult, its bounding rectangle area is usually much smaller than that of an adult target. The system determines target regions with bounding rectangle areas smaller than a preset area threshold as infant target regions, and target regions with areas greater than or equal to this threshold as adult target regions. If multiple adults exist, they can be further distinguished based on area differences and positional relationships. After determining the infant target region, the pixel coordinates of its geometric center are calculated as the infant's center pixel coordinates. After determining the adult target region, the pixel range enclosed by its contour coverage boundary is extracted as the adult's coverage pixel range.

[0025] C400: Based on the baby's center pixel coordinates and the mattress's physical boundary line, calculate the shortest pixel distance from the baby's center pixel coordinates to the mattress's physical boundary line. Compare this shortest pixel distance with a preset safety distance threshold for the mattress edge to obtain a fall risk assessment result. Specifically, in the image coordinate system, calculate the Euclidean distance from the baby's center pixel coordinates to each pixel on the mattress's physical boundary line, and take the minimum value as the shortest pixel distance. This shortest distance represents the closest distance from the baby's current position on the mattress to the mattress edge. The preset safety distance threshold for the mattress edge is a pixel distance value (or converted to a physical distance value through calibration) pre-calibrated based on the mattress size, the baby's body shape, and the camera's installation angle. Compare the shortest pixel distance with this threshold: if the shortest pixel distance is less than the threshold, it indicates that the baby is too close to the mattress edge, posing a fall risk, and the fall risk assessment result is "risk exists"; otherwise, it is considered safe.

[0026] C500: Based on the infant target area and the adult coverage pixel range, calculate the overlapping pixel area between the infant target area and the adult coverage pixel range. Compare the overlapping pixel area with a preset pressure-safe area threshold to obtain a pressure-safe assessment result. Specifically, in the image coordinate system, perform an intersection operation on the pixel coordinate set of the infant target area and the pixel coordinate set of the adult coverage pixel range, calculate the number of overlapping pixels, and obtain the overlapping pixel area. This overlapping area reflects the degree to which the adult's body covers the infant's body. The preset pressure-safe area threshold is a pixel area value pre-set according to the infant's body shape and safety requirements. Compare the overlapping pixel area with this threshold: if the overlapping pixel area is greater than the threshold, it indicates that there is a pressure-safe risk for the adult on the infant, and the pressure-safe assessment result is "risk exists"; otherwise, it is determined to be safe.

[0027] C600: When the fall risk assessment result indicates that the shortest pixel distance is less than the preset bed edge safety distance threshold, or the crushing risk assessment result indicates that the overlapping pixel area is greater than the preset crushing safety area threshold, a composite alarm drive signal is generated, and the built-in speaker of the monitoring camera is controlled to emit an audible alarm based on the composite alarm drive signal. Specifically, when any one or both of the fall risk and crushing risk are determined to exist, the system immediately generates a composite alarm drive signal. This signal is transmitted to the built-in speaker drive circuit of the monitoring camera via wired or wireless means, driving the speaker to emit a preset audible alarm, such as a buzzer, voice reminder (e.g., "Baby is approaching the bedside, please pay attention"), or a recorded parental reminder. The duration and volume of the audible alarm can be set as needed, for example, playing continuously for 30 seconds or continuously broadcasting until the risk is manually resolved. If neither risk exists, no alarm is triggered, and the monitoring camera continues monitoring.

[0028] This implementation method offers significant advantages. First, by automatically activating the monitoring camera and analyzing images in real time during sleep, it simultaneously monitors and proactively warns of two typical infant sleep safety risks: infant falls and adult suffocation. This effectively addresses the issue of parents being unable to constantly monitor their infants' safety while they sleep. Second, calculations based on the bed edge distance and overlapping area of ​​the human body within the image coordinate system accurately quantify the risk level, avoiding false alarms and missed alarms based on single sensors or simple threshold judgments, thus improving monitoring reliability. Furthermore, the alarm signal is emitted through the built-in speaker of the monitoring camera, utilizing existing equipment resources without requiring additional alarm devices, reducing system costs and installation complexity. Finally, this monitoring and alarm mechanism is fully automated, automatically activating upon being detected as being in sleep mode, requiring no additional parental intervention. This provides 24 / 7, seamless protection for infant safety through smart home technology, making it particularly suitable for families where infants sleep in the same bed.

[0029] In some examples, step C400 (calculating the shortest pixel distance based on the baby's center pixel coordinates and the mattress's physical boundary line and determining the risk of fall) specifically includes the following sub-steps: C401. Based on the physical boundary line of the mattress, extract all continuous pixel positions occupied by the physical boundary line of the mattress in the image coordinate system to obtain the set of mattress boundary pixel coordinates. Specifically, after extracting the physical boundary line of the mattress, the controller or processing platform records the coordinates of each pixel point on the boundary line to form a set containing the coordinates of all continuous pixels on the boundary line, which serves as the data basis for subsequent distance calculations.

[0030] C402. Based on the infant's center pixel coordinates and the mattress boundary pixel coordinate set, calculate the Euclidean pixel distance from the infant's center pixel coordinates to each boundary pixel coordinate in the mattress boundary pixel coordinate set, thus obtaining a boundary distance value set. Specifically, for each boundary pixel coordinate point in the mattress boundary pixel coordinate set, perform Euclidean distance calculation with the infant's center pixel coordinates, that is, calculate the square root of the sum of the squares of the pixel differences between the two in the horizontal and vertical directions, respectively, to obtain a series of distance values, forming a boundary distance value set.

[0031] C403. Based on the set of boundary distance values, select the Euclidean pixel distance value with the smallest value from the set of boundary distance values ​​as the shortest pixel distance from the baby's center pixel coordinates to the physical boundary line of the mattress. This minimum value represents the closest distance between the baby's current position and the edge of the mattress, and is a key indicator for assessing the risk of fall.

[0032] C404. Based on the bed edge safety distance threshold stored in the preset storage medium, read the bed edge safety distance threshold and use it as a comparison benchmark value. The preset storage medium can be local storage or cloud storage space, which pre-stores bed edge safety distance thresholds calibrated according to mattress size, infant body shape, and camera installation angle. For example, a distance of less than 10 centimeters from the bed edge is considered dangerous. The controller reads this threshold from the storage medium as the benchmark value for subsequent comparisons.

[0033] C405. Based on the shortest pixel distance and the comparison benchmark value, compare the shortest pixel distance with the bed edge safety distance threshold. When the shortest pixel distance is less than the bed edge safety distance threshold, a judgment result indicating a true fall risk is generated; when the shortest pixel distance is greater than or equal to the bed edge safety distance threshold, a judgment result indicating a false fall risk is generated. Specifically, if the shortest pixel distance is less than the bed edge safety distance threshold, it indicates that the baby's center position is too close to the bed edge, posing a fall risk, and a fall risk judgment result is generated as true; conversely, if the shortest pixel distance is greater than or equal to the threshold, it indicates that the baby's distance from the bed edge is still within a safe range, and a fall risk judgment result is generated as false.

[0034] This implementation method offers significant advantages. First, by extracting the coordinates of all continuous pixels along the mattress boundary line and calculating the Euclidean distance for each boundary point, it achieves an accurate solution for the shortest distance from the infant to the edge of the bed, avoiding errors caused by measuring only a single direction or specific point. Second, by comparing the calculated shortest pixel distance with a preset safe distance threshold for the edge of the bed, a quantitative risk assessment result is provided, enabling the system to clearly and definitively determine whether the infant is in a fall-prone area. Furthermore, this comparison logic is simple and efficient, and can be executed in real-time at the image frame rate, ensuring the timeliness and reliability of fall risk monitoring.

[0035] In some embodiments, step C500 (calculating the overlapping pixel area based on the infant target area and the adult coverage pixel range and determining the overlay risk) specifically includes the following sub-steps: C501. Based on the infant target region, extract the minimum row coordinate, maximum row coordinate, minimum column coordinate, and maximum column coordinate of the infant target region in the image coordinate system to obtain the boundary coordinate parameters of the infant region. Specifically, in the image coordinate system, the row coordinate corresponds to the height direction of the image, and the column coordinate corresponds to the width direction of the image. The controller traverses the identified infant target region and extracts the minimum row coordinate, maximum row coordinate, minimum column coordinate, and maximum column coordinate of all pixels within the region. These four boundary values ​​together constitute the complete boundary range parameters of the infant region in the image.

[0036] C502. Based on the adult-covered pixel range, extract the minimum row coordinates, maximum row coordinates, minimum column coordinates, and maximum column coordinates of the adult-covered pixel range in the image coordinate system to obtain the boundary coordinate parameters of the adult region. Similarly, traverse the adult-covered pixel range and extract its minimum row coordinates, maximum row coordinates, minimum column coordinates, and maximum column coordinates to constitute the boundary range parameters of the adult region.

[0037] C503. Based on the minimum row coordinate in the boundary coordinate parameters of the infant region and the minimum row coordinate in the boundary coordinate parameters of the adult region, the larger of the two values ​​is used as the starting row coordinate of the overlapping region; based on the maximum row coordinate in the boundary coordinate parameters of the infant region and the maximum row coordinate in the boundary coordinate parameters of the adult region, the smaller of the two values ​​is used as the ending row coordinate of the overlapping region; based on the minimum column coordinate in the boundary coordinate parameters of the infant region and the minimum column coordinate in the boundary coordinate parameters of the adult region, the larger of the two values ​​is used as the starting column coordinate of the overlapping region; based on the maximum column coordinate in the boundary coordinate parameters of the infant region and the maximum column coordinate in the boundary coordinate parameters of the adult region, the smaller of the two values ​​is used as the ending column coordinate of the overlapping region, thus obtaining the row interval and column interval of the overlapping region. This step determines the starting and ending boundaries of the overlapping region by taking the intersection of the two rectangular regions in the row and column directions, avoiding the inefficient calculation of pixel-by-pixel traversal.

[0038] C504. Based on the starting row coordinates and ending row coordinates of the overlapping region, calculate the row coordinate difference between the ending row coordinates and the starting row coordinates to obtain the overlapping row pixel length; based on the starting column coordinates and ending column coordinates of the overlapping region, calculate the column coordinate difference between the ending column coordinates and the starting column coordinates to obtain the overlapping column pixel width; based on the overlapping row pixel length and the overlapping column pixel width, calculate the product of the overlapping row pixel length and the overlapping column pixel width to obtain the overlapping pixel area between the infant target area and the adult coverage pixel range. Specifically, the overlapping row pixel length = overlapping region ending row coordinates - overlapping region starting row coordinates, and the overlapping column pixel width = overlapping region ending column coordinates - overlapping region starting column coordinates. The product of the two is the pixel area of ​​the overlapping region, which quantitatively characterizes the size of the area covered by the adult body on the infant body.

[0039] C505. Based on the pressure safety area threshold stored in the preset storage medium, read the pressure safety area threshold, compare the overlapping pixel area with the pressure safety area threshold, and generate a judgment result that the pressure risk is true when the overlapping pixel area is greater than the pressure safety area threshold; and generate a judgment result that the pressure risk is false when the overlapping pixel area is less than or equal to the pressure safety area threshold. Specifically, the preset storage medium stores a pressure safety area threshold (e.g., in pixel area or converted to physical area after calibration) pre-calibrated according to the infant's body shape, mattress size, and infant safety requirements. If the overlapping pixel area is greater than the threshold, it indicates that the adult's coverage of the infant has exceeded the safety limit, and there is a risk of pressure suffocation, thus generating a judgment result that the pressure risk is true; if the overlapping pixel area is less than or equal to the threshold, it indicates that even slight contact is within the safe range, thus generating a judgment result that the pressure risk is false.

[0040] The benefits of this implementation method are significant. First, by extracting the boundary coordinate parameters of the infant and adult areas, the overlapping pixel area is calculated using a rectangular intersection algorithm. This eliminates the need for pixel-by-pixel traversal, resulting in low computational load and high speed. It can perform real-time assessment of crushing risk at image frame rates, meeting the real-time requirements of smart home monitoring. Second, compared to simple binary "contact" judgments, the quantitative calculation of overlapping pixel area can distinguish between different risk levels of slight touch and severe crushing. Combined with a preset crushing safety area threshold, it achieves a quantitative assessment of risk levels, avoiding frequent false alarms due to slight contact, while ensuring timely alarms when real crushing risks occur. Furthermore, the accuracy of this calculation method depends only on the accuracy of the boundary coordinate extraction of the target area, without relying on complex image feature matching or deep learning models. This makes it simple to implement, highly reliable, and easy to deploy and run on low-computing-power embedded devices.

[0041] According to an embodiment of the second aspect of this application, the mattress includes a control component for performing the control method described above.

[0042] In some embodiments, such as Figure 1 and Figure 3 As shown, the mattress also includes a base plate 1 and a back plate 2, with the back plate 2 connected to the base plate 1. The base plate 1 includes a base layer 11, a support assembly 12, an elastic layer 13, an air-filled layer 14, and an air-filled component 15.

[0043] The base layer 11 is the bottom structural layer of the mattress, used to support and install other components. The support assembly 12 includes multiple lifting drive components 121 and multiple support components 122. The lifting drive components 121 are mounted on the base layer 11, and the multiple support components 122 correspond one-to-one with the multiple lifting drive components 121. Each support component 122 is connected to the output end of the corresponding lifting drive component 121. The elastic layer 13 is connected to the side of the support components 122 away from the lifting drive components 121, that is, the elastic layer 13 covers all the support components 122 and is supported by all the support components 122. The air-filled layer 14 is connected to the side of the elastic layer 13 away from the support components 122, that is, the air-filled layer 14 is located above the elastic layer 13, serving as the surface layer of the mattress or a functional layer near the surface layer. The inflatable component 15 is connected to the outer wall of the base plate 1 and communicates with the air cavity of the inflatable layer 14, and is used to inflate gas into the inflatable layer 14 or expel gas from the inflatable layer 14.

[0044] Its working principle is as follows: Under normal use, each lifting drive component 121 can move independently or collaboratively according to the user's needs, driving the corresponding support component 122 to rise or fall. Since different support components 122 correspond to different positions of the elastic layer 13, when the lifting drive component 121 in a certain area drives the support component 122 to rise, the elastic layer 13 in that area is locally lifted, thereby changing the support height and support force distribution of that area to the user's body; when the lifting drive component 121 drives the support component 122 to fall, the elastic layer 13 in that area falls back accordingly. By controlling multiple lifting drive components 121 separately, the support height of different areas of the mattress (such as head, shoulders, waist, hips, and legs) can be independently adjusted to adapt to different sleeping positions, weight distributions, or personalized comfort needs of the user. At the same time, the air layer 14 is in a contracted or flat state when it is not inflated, and its internal air cavity volume is small, so it has little impact on the overall firmness of the mattress. The support characteristics of the mattress are mainly determined by the elastic layer 13 and the support components 12. When a user needs to improve comfort by adjusting the firmness of the mattress, air can be injected into the air layer 14 via the air inflator 15, causing the air layer 14 to inflate and the air chambers to expand. After the air layer 14 inflates, a medium with air pressure cushioning is added between the user's body and the elastic layer 13, changing the mattress's surface conformity and elasticity, resulting in a softer overall feel. When the user needs a firmer feel, the air in the air layer 14 can be expelled via the air inflator 15, causing the air layer 14 to return to its flat state, and the mattress firmness returns to normal. The zoned adjustment function of the support component 12 and the firmness adjustment function of the air layer 14 are independent and do not interfere with each other. Users can use both simultaneously or separately to meet multi-dimensional sleep comfort needs.

[0045] The beneficial effects of this implementation are significant. First, the one-to-one arrangement of multiple lifting drive components 121 and support components 122 enables independent and precise control of different support areas of the mattress. This allows for dynamic adjustment of the support height of each area according to the user's body curves and sleeping posture, effectively relieving pressure points, improving the physiological curvature of the spine, and enhancing sleep quality and overall comfort. Second, the combination of the air layer 14 and the air components 15 provides an independent means of adjusting firmness. Users can adjust the mattress firmness at any time according to seasonal changes, personal preferences, or physical conditions without replacing the mattress or padding, offering flexibility and convenience. Furthermore, when not inflated, the air layer 14 does not interfere with the original support characteristics of the elastic layer 13 and support components 12, ensuring the mattress maintains its basic performance when firmness adjustment is not required. The two adjustment mechanisms of the support components 12 and the air layer 14 are independent of each other, allowing users to use either one individually or in combination. This achieves dual personalization of support force distribution and overall firmness, significantly improving the mattress's adaptability to users of different body types and sleeping habits.

[0046] In some embodiments, such as Figure 3 and Figure 4 As shown, the inflatable layer 14 includes a first air chamber 141 and a second air chamber 142 separated from each other, and the inflatable component 15 includes a first inflatable component 151 and a second inflatable component 152. The base plate 1 also includes a first one-way valve 16 and a second one-way valve 17, the first one-way valve 16 connecting the first inflatable component 151 and the first air chamber 141, and the second one-way valve 17 connecting the second inflatable component 152 and the second air chamber 142.

[0047] Specifically, the air layer 14 is internally divided into a first air chamber 141 and a second air chamber 142 by partitions or sealing strips. The two air chambers are physically isolated from each other and do not communicate with each other. The first inflation component 151 (e.g., a first air pump or a first manually inflatable balloon) is connected to the first air chamber 141 via a first one-way valve 16, and the second inflation component 152 is connected to the second air chamber 142 via a second one-way valve 17. The first one-way valve 16 is configured to allow gas to flow unidirectionally from the first inflation component 151 into the first air chamber 141, preventing gas from flowing back from the first air chamber 141 to the first inflation component 151; the second one-way valve 17 is configured similarly. The two air chambers can correspond to different areas of the mattress, for example, the first air chamber 141 corresponds to the left side of the mattress, and the second air chamber 142 corresponds to the right side of the mattress; or the first air chamber 141 corresponds to the head and waist areas of the mattress, and the second air chamber 142 corresponds to the hip and leg areas of the mattress. Each air chamber is independently controlled. Users can inflate or release the gas in a specific air chamber using the corresponding inflation component 15 without affecting the inflation status of the other air chambers.

[0048] Its working principle is as follows: When the user needs to adjust the firmness of a certain area of ​​the mattress, gas is injected into the first air chamber 141 through the first inflation component 151. The gas enters the first air chamber 141 through the first one-way valve 16, causing the first air chamber 141 to inflate, and the mattress surface in the corresponding area softens. Due to the one-way conduction characteristic of the first one-way valve 16, the gas pressure in the first air chamber 141 will not leak when the first inflation component 151 stops working, and a stable inflation state can be maintained for a long time. Similarly, the user can independently adjust the inflation volume of the second air chamber 142 through the second inflation component 152. When the user needs to deflate a certain air chamber, the gas in that air chamber can be released through the deflation valve or exhaust port on the corresponding inflation component 15, so that area returns to a flat state. Since the two air chambers are independent of each other and are controlled by their respective one-way valves, the inflation layer 14 can achieve various zoned firmness combinations, such as soft on the left and firm on the right, or soft on the head and waist and firm on the buttocks and legs.

[0049] The beneficial effects of this implementation are significant. First, by dividing the air layer 14 into two independent air chambers and configuring each with an independent inflation component 15 and a one-way valve, independent zoned adjustment of the firmness of different areas of the mattress is achieved. Users can adjust the inflation volume of the corresponding air chamber according to the different firmness preferences of the users on the left and right sides of the double bed, so that the mattress can simultaneously meet the different comfort needs of two users, effectively solving the problem of difficulty in catering to individual preferences when sharing a mattress in a double bed. Second, the introduction of the one-way valve ensures that each air chamber can maintain a stable air pressure after inflation, without continuously relying on the inflation component 15 to maintain pressure, reducing energy consumption and noise. At the same time, the one-way valve prevents gas backflow, avoiding air chamber pressure fluctuations caused by depressurization of the inflation component 15 or pipeline leakage, so that the firmness of the mattress remains stable and consistent over long-term use. In addition, the independent air chamber design allows users to fine-tune the firmness of any area as needed without changing the other side or another area, making the adjustment flexible and convenient, further enhancing the mattress's ability to personalize its fit for different body types, sleeping positions, and seasonal needs.

[0050] In some embodiments, such as Figure 1 and Figure 2As shown, the mattress also includes a lighting assembly 3, which is mounted on the back panel 2. The lighting assembly 3 includes a rotating component 31, a left-side focusing component 32, a right-side focusing component 33, a left-side lighting component 34, and a right-side lighting component 35. The left-side focusing component 32 and the right-side focusing component 33 are both connected to the rotating component 31. The rotating component 31 is used to drive the left-side focusing component 32 and the right-side focusing component 33 to rotate. The left-side lighting component 34 is connected to the side of the left-side focusing component 32 that is away from the right-side focusing component 33. The right-side lighting component 35 is connected to the side of the right-side focusing component 33 that is away from the left-side focusing component 32. The left-side focusing component 32 is used to reflect the light emitted by the left-side lighting component 34 to the left side of the mattress, and the right-side focusing component 33 is used to reflect the light emitted by the right-side lighting component 35 to the right side of the mattress.

[0051] Understandably, when only left-side lighting is needed, the user controls the rotation of the rotating component 31 to adjust the left-side focusing element 32 to a suitable reflection angle. The light emitted by the left-side lighting element 34 is reflected by the left-side focusing element 32 and directed onto the left side of the mattress. Meanwhile, the right-side focusing element 33 rotates synchronously with the rotating component 31, directing the light from the right-side lighting element 35 to a location outside the right side (e.g., towards the outside of the mattress or upwards), thus avoiding light interference for the user on the right side. Similarly, when only right-side lighting is needed, the rotating component 31 adjusts the angle of the right-side focusing element 33, concentrating the light onto the right side of the mattress. When simultaneous lighting on both sides is required, the left and right focusing elements can be adjusted to their respective symmetrical reflection angles, allowing the light to cover both sides. Since the left-side lighting element 34 and the right-side lighting element 35 are respectively located outside their respective focusing elements and separated by the rotating component 31, the light sources do not obstruct each other, and the reflection of the focusing elements makes the light concentrated and soft, avoiding direct sunlight on the eyes.

[0052] First, the rotating component 31 synchronously drives the left and right focusing components to rotate, enabling independent or coordinated adjustment of the light emission angle on both sides. Users can flexibly choose single-sided or double-sided lighting according to their actual needs, effectively solving the problem of light interference on the other side when lighting is applied to one side of a double bed, thus improving the comfort and privacy of the sleeping environment. Second, the use of reflective lighting from the focusing components instead of direct light from the light source results in more uniform and softer light. Furthermore, the illumination area can be changed by adjusting the reflection angle to accommodate users of different heights and sleeping positions. In addition, the left and right lighting components are installed on the outside of the focusing components, resulting in a compact structure and easy installation. The rotating component 31 can be designed as a manual knob or electrically driven, offering flexible control.

[0053] In some examples, the rotating component 31 is a horizontally extending rotating shaft, with the left focusing component 32 and the right focusing component 33 fixed to the left and right ends of the rotating shaft, respectively. The rotating shaft is mounted on the back plate 2 via a bearing seat.

[0054] In some embodiments, the mattress further includes: A detection component for detecting the sleep status of the user on the left side of the mattress and the user on the right side of the mattress; The control component is communicatively connected to the main indoor lighting fixture. Both the lighting fixture 3 and the detection component are electrically connected to the control component. The control component is configured to control the operation of the main indoor lighting fixture and the lighting fixture 3 based on the detection data from the detection component.

[0055] Understandably, the detection component collects sleep parameters from the users on the left and right sides of the mattress in real time and sends the data to the control component. After analyzing the data, the control component determines the user's sleep depth, whether they are in a light sleep stage, or are about to wake up. When it detects signs of awakening such as turning over, opening their eyes, or preparing to get up, the control component can first adjust the corresponding side's light component 3 (left-side spotlight 32 or right-side spotlight 33) to a low brightness or reflect it under the bed to a direction that does not shine directly into the eyes, serving as a low-light guide at night. If the user sits up completely or gets out of bed, the control component further controls the main room light to gradually turn on, providing sufficient ambient light. At the same time, if the user on the other side is still in a deep sleep, the control component keeps their side's light component 3 off and adjusts the direction of the main light or the light shield to avoid light disturbing their sleep. In addition, the control component can also be linked with smart home devices to automatically open curtains and adjust the room temperature when both people wake up at the same time.

[0056] The benefits of this implementation are significant. First, by monitoring the sleep status of the left and right users in real time through the detection component, the control component can intelligently distinguish the needs of users on different sides, achieving zoned lighting management so that "the left user getting up at night does not disturb the right user," significantly improving the user experience and sleep quality of the double bed. Second, the reflective lighting of the lighting component 3 works in conjunction with the main indoor lighting, gradually adjusting the brightness according to the user's status, which not only meets the basic lighting needs for nighttime activities but also avoids discomfort or waking others caused by sudden bright light stimulation.

[0057] In some examples, the detection components include piezoelectric film sensors or fiber optic sensors embedded on the left and right sides of the mattress, respectively, for detecting body movement and heart rate. The control component is a controller with a built-in MCU that communicates with the smart ceiling light (main indoor lighting) via a Zigbee or Wi-Fi module. When the detection components detect an increase in the body movement frequency and heart rate of the user on the left (indicating that they are about to get up), while the user on the right is still in a stable deep sleep, the control component controls the left lighting component 34 to light up at 5% brightness, and reflects the light to the ground through the left spotlight component 32 to create a night light effect; if the user on the left gets out of bed, the control component sends a command to the ceiling light to slowly light up at 20% brightness, while keeping the right lighting component 3 off. After the user on the left returns to bed and falls asleep again, all lights automatically turn off.

[0058] According to an embodiment of the third aspect of this application, the control method based on the above-described mattress includes the following steps: S100. Acquire the sleep status of the user on the left and the user on the right. Specifically, the sleep parameters of the users on the left and right sides of the mattress are collected in real time through the detection components embedded in the mattress (such as piezoelectric film sensors, heart rate sensors, or body movement sensors), including heart rate, respiratory rate, number of body movements, and frequency of turning over. The data is processed and analyzed to determine whether the user on each side is currently in a sleep state or not (such as light sleep, deep sleep, about to wake up, or already awake).

[0059] S200. Based on the sleep states of the left-hand user and the right-hand user, determine whether only one side of the user is asleep. That is, determine whether only one side of the user is asleep, while the other side is awake or not in bed.

[0060] S300: Based on the determination that only one side of the user is asleep, the main indoor light is turned off. When only one side of the user is asleep, in order to avoid the light from the main light disturbing the rest of the user on that side, the control component automatically turns off the main indoor light (or adjusts it to the lowest brightness), while providing targeted local lighting for the awake user on the other side.

[0061] S400: Based on the determination that only one side of the user is asleep, the side of the user who is not asleep is identified as the target lighting side, and the target lighting element is determined based on the target lighting side. For example, if the user on the left is asleep and the user on the right is awake, then the target lighting side is the right side, and the target lighting element is the right-side lighting element 35. The reverse is also true.

[0062] S500: Control the target lighting component to turn on and obtain the real-time posture of the user on the target lighting side. Turn on the light component 3 on the target side (such as the right-side lighting component 35), and obtain the real-time posture of the user on that side through a posture detection sensor (such as a pressure distribution sensor, camera, or infrared pyroelectric sensor) set in the corresponding area of ​​the mattress, such as whether the user is lying flat, lying on their side, sitting up, preparing to get out of bed, or already standing.

[0063] S600. Based on the real-time posture of the user on the target lighting side, control the rotating component 31 to rotate the target lighting component to the target angle. Depending on the user's posture, control the rotating component 31 to drive the left focusing component 32 or the right focusing component 33 to rotate, so that the light emitted by the target lighting component is reflected by the focusing component and precisely projected onto the area required for the user's activity. For example: when the user is only sitting up, the light is reflected to the head of the bed or a low point on the ground, providing a soft nightlight effect; when the user is standing and preparing to walk, the light is reflected to the front of the bed or the path leading to the bathroom, forming guiding lighting; when the user is fully awake and gets out of bed, the light can be switched to general illumination or turned off.

[0064] The benefits of this implementation method are significant. First, by differentiating between left and right sleep states, the main light is turned off and local lighting is activated only when one side of the user is asleep. This avoids interference from the main light on the sleeper while providing necessary activity lighting for the awake user, achieving zoned lighting management in a two-person scenario and improving sleep quality and user experience. Second, the angle of the spotlight is dynamically adjusted based on the real-time posture of the awake user, ensuring that the light always follows the user's activity area. This satisfies lighting needs while preventing direct light from shining into the eyes or scattering onto the sleeping side, achieving intelligent and user-friendly following lighting. Furthermore, this control method is fully automated, requiring no manual operation from the user, making it particularly suitable for scenarios such as getting up at night or waking up early, reducing the risk of falls due to uncomfortable lighting.

[0065] In some embodiments, step S100 (obtaining the sleep state of the left user and the sleep state of the right user) specifically includes the following sub-steps: S101. Pressure signals from the left side of the mattress are acquired using an array of pressure sensors located on the left side of the mattress, and pressure signals from the right side of the mattress are acquired using an array of pressure sensors located on the right side of the mattress. The pressure sensor arrays can continuously detect the pressure distribution and amplitude in each area.

[0066] S102. The presence status of a user on the left side is obtained based on a first comparison result between the left pressure signal and a preset presence pressure threshold, and the presence status of a user on the right side is obtained based on a second comparison result between the right pressure signal and the preset presence pressure threshold. For example, when the maximum pressure value or average pressure value on a certain side exceeds the preset presence pressure threshold (such as the pressure corresponding to 10 kg), it is determined that a user exists on that side; otherwise, it is determined that no user exists.

[0067] S103. Based on the left-side pressure signal and the right-side pressure signal, count the number of pressure changes on the left side and the number of pressure changes on the right side within a preset time window. The preset time window can be set to 1 minute or 2 minutes, and the number of pressure changes can be counted based on the number of times the pressure value fluctuation exceeds a preset change threshold.

[0068] S104. The left-side user's body movement frequency is obtained based on the number of pressure changes on the left side and the preset time window; the right-side user's body movement frequency is obtained based on the number of pressure changes on the right side and the preset time window. For example, body movement frequency = number of pressure changes / time window (minutes), in units of times / minute.

[0069] S105. The sleep state of the left user is obtained based on the third comparison result between the body movement frequency of the left user and the preset body movement frequency threshold, and the sleep state of the right user is obtained based on the fourth comparison result between the body movement frequency of the right user and the preset body movement frequency threshold. Generally, a low body movement frequency (e.g., less than 5 times / minute) is determined to be a sleep state, and a high body movement frequency (e.g., greater than or equal to 5 times / minute) is determined to be a non-sleep state (e.g., light sleep, about to wake up, or already awake).

[0070] S106. Based on the presence status of the left user and the right user, verify the validity of the sleep state of the left user and the right user, respectively. When the presence status of the left user is "not present," forcibly set the sleep state of the left user to a non-sleep state; when the presence status of the right user is "not present," forcibly set the sleep state of the right user to a non-sleep state. This step is used to correct misjudgments caused by noise from body movement signals in empty beds, ensuring that the sleep state is only valid for actual users.

[0071] Through the above steps, the control component can accurately and in real time obtain the sleep status of users on both the left and right sides, providing a reliable basis for subsequent zoned lighting control.

[0072] This implementation method offers significant advantages. First, by collecting pressure signals from both sides using a pressure sensor array and independently calculating body movement frequencies, it achieves accurate differentiation of the sleep states of the left and right users in a double bed, avoiding the defect of unilateral body movement affecting the judgment of the other side. Second, the introduction of a presence verification mechanism effectively eliminates false body movement signals generated by sensor noise or interference on the empty bed side, ensuring the accuracy and reliability of sleep state judgment and preventing the lights from being mistakenly turned on on the unoccupied side.

[0073] In some embodiments, step S200 (determining whether only one side of the user is asleep based on the sleep states of the left and right users) specifically includes the following sub-steps: S201. Based on the first matching result between the left user's sleep state and the first preset sleep state value, a left-side determination result is obtained regarding whether the left side is in a sleep state; based on the second matching result between the right user's sleep state and the first preset sleep state value, a right-side determination result is obtained regarding whether the right side is in a sleep state. The first preset sleep state value can be set as the quantized value corresponding to "sleep" (e.g., "sleep" = 1, "non-sleep" = 0). By matching the detected sleep state with this preset value, a Boolean determination of whether each side is in a sleep state can be obtained.

[0074] S202. Based on the determination results of the left side and the right side, count the number of user sides determined to be in a sleep state to obtain a sleep side count. For example, if both the left and right sides are in a sleep state, the count is 2; if only one side is in a sleep state, the count is 1; if neither side is in a sleep state, the count is 0.

[0075] S203. Based on the comparison result between the sleep side count and the preset value 1, a preliminary judgment result is obtained as to whether it is unilateral sleep. When the sleep side count is equal to 1, it is preliminarily judged as unilateral sleep; when the count is 0 or 2, it is preliminarily judged as non-unilateral sleep.

[0076] S204. Based on the left-side determination result and the right-side determination result, determine the user side that is determined to be in a non-sleep state, and obtain a single-side identification result. That is, if only the left side is non-sleep and the right side is sleep, the single-side identification result is "left side"; if only the right side is non-sleep and the left side is sleep, the identification result is "right side".

[0077] S205. Based on the preliminary judgment result and the unilateral identification result, generate a final judgment result on whether only one side of the user is in a sleeping state. If the preliminary judgment is "unilateral sleep" and the unilateral identification result clearly points to a certain side, then the final output is "Yes, only the left user is sleeping" or "Yes, only the right user is sleeping"; if the preliminary judgment is not unilateral sleep, then the final output is "No".

[0078] Through the above steps, the control component can accurately identify whether only one side of the user in the double bed is asleep, and determine which side the user is awake and which side the user is still asleep, providing accurate target side information for subsequent zoned lighting control.

[0079] The beneficial effects of this implementation method are significant. First, by matching sleep states with preset values ​​and statistically counting them, a quantitative comparison of left and right sleep states is achieved. The judgment logic is clear, the calculation is simple, and misjudgments caused by fuzzy logic are avoided. Second, by determining the unilateral identification result, not only is it known whether unilateral sleep occurs, but the position of the awake side (left or right) is also accurately indicated, providing a clear basis for determining the target illumination device and adjusting the light angle in subsequent steps. In addition, the dual verification (preliminary judgment + identification) enhances the robustness of the judgment and prevents unilateral misjudgments due to transient sensor malfunctions.

[0080] In some examples, the first preset sleep state value is set to 1 for "sleep state" and 0 for "non-sleep state". Steps S101-S106 result in a left-side sleep state value of 1 (sleep) and a right-side sleep state value of 0 (non-sleep). The left-side determination is "yes", and the right-side determination is "no". The sleep side count is 1, initially indicating unilateral sleep. The unilateral identification result is "right side" (because the right side is non-sleep). The final determination is: only the right-side user is in a non-sleep state (i.e., the left-side user is asleep). The control component then executes S300-S600, turning off the main light, turning on the right-side illuminator 35, and adjusting the angle of the right-side spotlight 33 according to the right-side user's posture.

[0081] In some embodiments, step S500 (controlling the target illumination element to turn on and acquiring the real-time posture of the user on the target illumination side) specifically includes the following sub-steps: S501. Based on the target illumination side, determine the illumination element in the lighting assembly 3 corresponding to the target illumination side as the target illumination element, and generate an activation command for the target illumination element. Control the activation of the target illumination element based on the activation command. For example, if the target illumination side is the left side, the target illumination element is the left-side illumination element 34; if it is the right side, it is the right-side illumination element 35. When activated, the brightness can be adjusted to a lower level (e.g., 5%~10%) according to the preset ambient brightness or time (e.g., late at night) to avoid strong light stimulation.

[0082] S502. Based on the target illumination side, select a pressure sensor unit corresponding to the target illumination side from the pressure sensor array installed on the mattress as the target detection area. Independent pressure sensor arrays are arranged on the left and right sides of the mattress. After the target illumination side is determined, only the pressure sensor unit on that side is activated to collect data, reducing the amount of data processing and avoiding interference from the body movements of the user on the other side.

[0083] S503. Based on the target detection area, collect real-time pressure distribution data at the current moment. This data reflects the contact pressure distribution between the user's body and the mattress on the target side, including the coordinates and pressure amplitude of each sensor unit.

[0084] S504. Based on the real-time pressure distribution data, extract the coordinates of all sensor locations whose pressure amplitude is greater than a preset contact pressure threshold to obtain a set of pressure contact points. The preset contact pressure threshold can be set to a small value (e.g., 2~5 kPa) to distinguish between actual human contact and mattress deformation or noise signals. This set of points represents the actual contact area between the user's body and the mattress.

[0085] S505. Based on the set of pressure contact points, calculate the maximum coordinate difference of the set of pressure contact points along the length direction (i.e., head-to-tail direction) and the maximum coordinate difference along the width direction (i.e., left-to-right direction) of the mattress. Use the maximum coordinate difference as the torso extension range, and the end coordinates corresponding to the maximum coordinate difference as the estimated head position. Specifically, find the minimum and maximum coordinates along the length direction in the set of contact points; the difference is the torso extension range along the length direction. The difference between the minimum and maximum coordinates along the width direction reflects the body's lateral width. Typically, the estimated head position is determined by the maximum coordinate along the length direction (assuming the head is located at the top of the mattress) or by combining the center of gravity of the pressure distribution.

[0086] S506. Based on the torso extension range and the estimated head position, determine the real-time posture of the user on the target lighting side as supine, lateral, or sitting. For example: if the torso extension range is greater than 60% of the total mattress length and the difference in width coordinates is small, it can be determined as a supine posture; if the torso extension range is large but the difference in width coordinates is large and the pressure is concentrated on one side, it can be determined as a lateral posture; if the torso extension range is short (e.g., less than 30%), the pressure is concentrated in the upper middle area of ​​the mattress and there are signs of getting off the bed, it can be determined as a sitting posture (the user is sitting on the edge of the bed). In addition, historical data or heart rate sensor data can be used to assist in confirmation.

[0087] This implementation method offers significant advantages. First, by differentiating the target lighting side and collecting pressure sensor data only from the corresponding side, computational interference caused by mixing data from both sides is avoided, improving the accuracy and efficiency of posture recognition. Second, by utilizing the spatial distribution characteristics of the pressure contact point set (range in length direction, range in width direction, and end coordinates) to determine posture, no additional cameras or wearable devices are required, protecting user privacy, and the method is cost-effective and fast-responding. Furthermore, after accurately identifying the user's posture (supine, side-lying, sitting), the control system can further adjust the reflection angle of the focusing element, ensuring that light is precisely projected onto the area where the user needs the most illumination (such as the bedside table, floor path, or reading position), achieving humanized and intelligent zoned lighting.

[0088] In some embodiments, step S100 (obtaining the sleep state of the left user and the sleep state of the right user) specifically includes the following sub-steps: S101a: A piezoelectric thin-film sensor located on the left side of the mattress acquires a left-sided cardiac impulse signal (BCG signal), and a piezoelectric thin-film sensor located on the right side of the mattress acquires a right-sided cardiac impulse signal. The piezoelectric thin-film sensor can non-contactly sense the weak mechanical vibrations caused by the heartbeat, thereby extracting a composite signal containing information on heartbeat, respiration, and body movement.

[0089] S102a. Based on the first amplitude comparison result between the left cardiac impact signal and the preset resting signal amplitude threshold, a left-side body movement presence indicator is obtained; based on the second amplitude comparison result between the right cardiac impact signal and the preset resting signal amplitude threshold, a right-side body movement presence indicator is obtained. The large amplitude fluctuations in the cardiac impact signal are usually caused by body movements such as turning over or moving limbs. When the signal amplitude exceeds the preset resting signal amplitude threshold, body movement is determined to exist, and the body movement presence indicator is set to "body movement present"; otherwise, it is set to "no body movement present".

[0090] S103a. Calculate the instantaneous heart rate on the left side based on the time interval between adjacent heartbeat peaks in the left-side cardiac impact signal, and calculate the instantaneous heart rate on the right side based on the time interval between adjacent heartbeat peaks in the right-side cardiac impact signal. By filtering the cardiac impact signal and identifying feature points (such as J-wave extraction), the peak corresponding to each heartbeat is detected, the time interval between adjacent peaks is calculated, and then converted into heartbeats per minute to obtain the instantaneous heart rate value.

[0091] S104a. Based on the first heart rate comparison result between the instantaneous heart rate on the left side and the preset upper limit of the sleep heart rate, a left heart rate sleep label is obtained; based on the second heart rate comparison result between the instantaneous heart rate on the right side and the preset upper limit of the sleep heart rate, a right heart rate sleep label is obtained. Normally, the heart rate of a person in a waking state is higher than that in a sleeping state. The preset upper limit of the sleep heart rate can be set to 60-70 beats / minute (adjusted according to individual resting heart rate). When the instantaneous heart rate is lower than or equal to this upper limit, the heart rate sleep label is "sleep heart rate"; otherwise, it is "non-sleep heart rate".

[0092] S105a. Based on the left-side body movement presence identifier and the left-side heart rate sleep identifier, generate the left-side user sleep state. Specifically, when the left-side body movement presence identifier is "no body movement" and the left-side heart rate sleep identifier is "below the upper limit of sleep heart rate", it is determined to be a sleep state; otherwise (body movement exists or heart rate exceeds the upper limit), it is determined to be a non-sleep state. Similarly, based on the right-side body movement presence identifier and the right-side heart rate sleep identifier, generate the right-side user sleep state: when the right-side body movement presence identifier is "no body movement" and the right-side heart rate sleep identifier is "below the upper limit of sleep heart rate", it is determined to be a sleep state; otherwise, it is a non-sleep state.

[0093] By using the above-mentioned method based on the fusion of cardiac impact signals and heart rate, the control component can accurately and non-invasively obtain the real-time sleep status of users on both sides, providing highly reliable input data for subsequent zoned lighting control.

[0094] The benefits of this implementation method are significant. First, it uses a piezoelectric thin-film sensor to collect cardiac impact signals, requiring no user-worn devices or additional protrusions on the mattress surface, making it completely imperceptible and unaffected by sleep comfort. Second, it combines body movement detection and heart rate as dual indicators to determine sleep state: body movement quickly reflects a user's awakening or turning over, while heart rate reflects deeper physiological states. The fusion of these two indicators effectively avoids misjudgments that may arise from a single indicator (e.g., being still but not asleep, or occasionally turning over during sleep), improving the accuracy and robustness of sleep state recognition. Furthermore, the cardiac impact signal and heart rate calculation naturally support independent processing of left and right zones without interference, perfectly adapting to the zoned lighting control needs of double beds.

[0095] In some embodiments, the step of "obtaining the real-time posture of the user on the target lighting side" specifically includes the following sub-steps: S501b: Based on the target illumination side, select pressure sensor units corresponding to the target illumination side from the pressure sensor array installed on the mattress, collect the current pressure values ​​of all sensor units in that area, and obtain the target side pressure distribution matrix. For example, when the target illumination side is the left side, only the sensor units in the left area are activated to form an M×N pressure value matrix.

[0096] S502b: Based on the target-side pressure distribution matrix, extract the coordinates of all sensor locations where the pressure value is greater than a preset contact pressure threshold (e.g., 3 kPa) to form a target-side contact point set. These coordinate points represent the area where the user's body actually contacts the mattress, excluding low-pressure signals generated by mattress deformation or noise.

[0097] S503b. Based on the coordinates of all positions in the target-side contact point set, calculate the geometric center coordinates of the target-side contact point set as the position of the torso's center of mass. Specifically, calculate the average x-coordinate and average y-coordinate of all points in the contact point set to obtain the center of mass coordinates (x_c, y_c). This position roughly corresponds to the projection of the human torso's center of gravity.

[0098] S504b. Based on the coordinates of all positions in the target-side contact point set, calculate the principal axis direction angle of the target-side contact point set. The principal axis direction angle is the direction that minimizes the rotational inertia of the contact point set about the torso's center of mass, and can be obtained by calculating the covariance matrix of the contact point set and obtaining its eigenvectors. This principal axis direction angle reflects the main extension direction of the human torso on the mattress plane.

[0099] S505b: Based on the position of the torso's center of mass and the angle of the main axis, the percentage of contact points concentrated in the upper half and lower half of the mattress along its length is calculated to determine the torso's tilt direction. For example, the mattress is divided into an upper half (near the headboard) and a lower half (near the footboard) along its length, and the proportion of contact points in the upper half is calculated. Combined with the main axis direction, it can be determined whether the user is lying flat, with their head tilted upwards, or with their feet tilted upwards, etc.

[0100] S506b. Based on the angular inclusion relationship between the torso tilt direction and the preset supine angle range, determine whether the real-time posture of the user on the target lighting side is supine, lateral, or sitting. Specifically, the preset supine angle range is usually 0°±15° (i.e., the angle between the main axis direction and the mattress width direction is very small). If the angle is within this range and the contact area is large, it is determined to be supine; if the angle of the main axis direction is close to 90° and the contact points are concentrated on one side of the body, it is determined to be lateral; if the torso's center of mass is close to the top of the mattress and the contact point area is small and the pressure value is high, it is determined to be sitting.

[0101] The benefits of this implementation method are significant. First, by extracting the target side contact point set and calculating the geometric center and principal axis direction, the overall posture characteristics of the user on the mattress can be accurately characterized with low computational complexity and high real-time performance. Second, by matching the torso tilt direction with a preset angle range, three common nighttime postures—supine, lateral, and sitting—can be clearly distinguished, providing a reliable basis for subsequent adjustments to the angle of the light-reflecting element. Furthermore, this posture recognition method relies entirely on a pressure sensor array, requiring no camera or wearable device, protecting user privacy and not disturbing sleep, making it suitable for intelligent zoned lighting control in double beds.

[0102] In some embodiments, after step S600 (the target illumination element is rotated to the target angle based on the real-time attitude control of the rotating component 31 of the user on the target illumination side), the following steps are further included: S701c: Based on a pressure sensor array mounted on the mattress, pressure distribution data of the user on the target lighting side is continuously collected at least three consecutive time intervals to obtain a first time-series pressure distribution, a second time-series pressure distribution, and a third time-series pressure distribution. For example, after posture adjustment is completed, pressure distribution is collected every 0.5 seconds for three consecutive times.

[0103] S702c: Based on the first time-series pressure distribution and the second time-series pressure distribution, calculate the pressure change at the same sensor location to obtain a first pressure change map; based on the second time-series pressure distribution and the third time-series pressure distribution, calculate the pressure change at the same sensor location to obtain a second pressure change map. Each pressure change map reflects the spatial distribution of pressure increase and decrease at adjacent times. Positive values ​​indicate that the pressure in that area increases (the body presses towards that location), and negative values ​​indicate that the pressure decreases (the body moves away from that location).

[0104] S703c: Based on the first pressure change map and the second pressure change map, extract continuous sensor regions where the sign of the pressure value change remains unchanged and the magnitude of the change continues to increase, as the posture movement trend region. For example, if the sensor pressure value of a certain region is positive and the increment gradually increases in two consecutive time intervals, it indicates that the region is experiencing continuously increasing pressure, that is, the user's body is moving in that direction. Conversely, if the pressure change is continuously negative and the absolute value increases, it indicates that the body is leaving the region.

[0105] S704c: Based on the direction of the center of gravity coordinates of the posture movement trend region relative to the estimated current head position of the user on the target lighting side, predict the head movement direction of the user on the target lighting side. Since the human body's turning over or getting up is often driven by the head, by analyzing the direction of the area where the pressure is continuously increasing relative to the estimated head position (e.g., left front, right front, directly front), the direction in which the user is about to turn or the trend of getting up can be predicted.

[0106] S705c: Based on the head movement direction, control the rotating component 31 to drive the target lighting component to pre-rotate along the head movement direction by a preset step angle (e.g., 5°~10°) to obtain the pre-adjusted target angle. This pre-rotation is performed before the user actually completes the turning over or getting up action, so that the light is pre-illuminated on the area that the user is about to face, realizing the "proactive" adjustment of the lighting angle.

[0107] The benefits of this implementation method are significant. First, by continuously collecting multiple frames of pressure distribution data and analyzing pressure change trends, it can anticipate a user's intention to turn over or get up, rather than adjusting the lighting only after the user has completed the action, thus eliminating the lag in lighting response and improving the user experience. Second, the algorithm extracts the posture movement trend region based on the pressure change symbol and amplitude; it is simple and reliable, requires no complex modeling, and is adaptable to users of different body types. Furthermore, the pre-rotation follows the user's movements step by step, avoiding excessively abrupt changes in light that could irritate the user, while smoothly following the user's movement trajectory. This is particularly suitable for providing continuous, soft, and delay-free following lighting when getting up at night or turning over.

[0108] In some embodiments, step S100 (obtaining the sleep state of the left user and the sleep state of the right user) specifically includes the following sub-steps: S101d: Left-side pressure sensing data is acquired based on a first pressure sensor array located on the left side of the mattress, and left-side micro-body movement signals are acquired based on a piezoelectric film sensor located on the left side of the mattress. Similarly, right-side pressure sensing data is acquired based on a second pressure sensor array located on the right side of the mattress, and right-side micro-body movement signals are acquired based on a piezoelectric film sensor located on the right side of the mattress. The pressure sensor array is used to detect whether the user is on the bed and the body pressure distribution, while the piezoelectric film sensor is used to capture weak vibration signals caused by heartbeat, breathing, and minor limb movements.

[0109] S102d: Based on the first comparison result between the left-side pressure sensing data and the preset pressure threshold, a left-side user in-bed identifier is obtained; based on the second comparison result between the right-side pressure sensing data and the preset pressure threshold, a right-side user in-bed identifier is obtained. For example, when the maximum or average left-side pressure exceeds the preset threshold (e.g., 5 kPa), the left-side user in-bed identifier is determined to be "in bed"; otherwise, it is "out of bed".

[0110] S103d: Based on the third comparison result between the left-side micro-movement signal and the preset body movement amplitude threshold, a left-side body movement level identifier is obtained; based on the fourth comparison result between the right-side micro-movement signal and the preset body movement amplitude threshold, a right-side body movement level identifier is obtained. The amplitude of the micro-movement signal reflects the intensity of the user's physical activity. The body movement level can be divided into multiple levels, such as: no body movement (amplitude below threshold A), slight body movement (amplitude between threshold A and B), and significant body movement (amplitude above threshold B). The body movement level identifier can be used to determine the user's sleep depth or activity intention.

[0111] S104d. Based on the user's "in bed" indicator on the left and the user's body movement level indicator on the left, determine whether the user's "in bed" status is "in bed," "briefly out of bed," or "truly awake." The specific determination logic is as follows: If the user's "in bed" indicator is "in bed," and the body movement level is low or stable within a preset time window, then it is determined as "in bed." If the user's "in bed" indicator changes from "in bed" to "out of bed" within a short period and then recovers, and the body movement level does not change drastically before and after getting out of bed, then it is determined as "briefly out of bed" (e.g., going to the toilet). If the user's "in bed" indicator changes to "out of bed" and does not recover for a long time, and the body movement level significantly increases before getting out of bed (indicating the user actively got up), then it is determined as "truly awake." The same logic applies to the right side.

[0112] S105d. Based on the user's "in bed" indicator and body movement level indicator on the left side, determine whether the user's sleep intention is "lying down for entertainment," "preparing to fall asleep," or "already asleep." Specifically: if the user's "in bed" indicator is "in bed," and the body movement level is high and changes frequently, it is determined to be "lying down for entertainment" (such as looking at a mobile phone or reading); if the body movement level gradually decreases and the heart rate tends to level off, it is determined to be "preparing to fall asleep"; if the body movement level remains at a very low level for a long period of time, and the breathing and heart rate are stable, it is determined to be "already asleep." The same applies to the right side.

[0113] Through the above steps, the control component can comprehensively and meticulously obtain the bed status and sleep intentions of users on both the left and right sides, providing richer and more accurate decision-making basis for subsequent zoned lighting control.

[0114] The benefits of this implementation are significant. First, by integrating pressure sensors and piezoelectric film sensors, it simultaneously detects both "being in bed" and "micro-movements," which, compared to a single sensor, can more accurately determine whether the user has truly left the bed or is only getting up temporarily at night, as well as the user's pre-sleep activity, thus avoiding false or missed lighting triggers. Second, through movement level indicators, it can distinguish different sleep intentions such as lying down for entertainment, preparing to sleep, and already asleep, making lighting control more user-friendly: for example, providing reading light when lying down for entertainment, gradually dimming the light when preparing to sleep, and completely turning it off after falling asleep. Furthermore, this solution can recognize brief periods away from the bed (such as going to the toilet at night). The system can turn on a guiding nightlight when the user leaves the bed and automatically turn it off upon returning, while automatically turning on the main light when the user actually gets up, achieving refined and scenario-based intelligent lighting management.

[0115] In some embodiments, after step S600 (the target illumination element is rotated to the target angle based on the real-time attitude control of the rotating component 31 of the user on the target illumination side), the following steps are further included: S701e: Based on the sleep states of the left and right users, obtain the in-bed status and sleep intentions of the first and second users, where the first user is the left user and the second user is the right user. Specifically, through the comprehensive information such as user sleep state, in-bed status, body movement level, and sleep intention obtained in the aforementioned steps S100 to S105d, the current status of the left and right users is clearly distinguished. For example, the left user may be in a "briefly out of bed" state, while the right user may be in a "sleep" state.

[0116] S702e: Based on the determination result of the first user's in-bed status as having briefly left the bed and the determination result of the second user's sleep intention as having fallen asleep, a first scene control command is generated for the first user to turn on the first side nightlight associated with the user on the left, and a second scene control command is generated for the second user to maintain the current sleep mode. That is, when the user on the left temporarily leaves the bed (such as getting up to go to the toilet at night) while the user on the right is still in a deep sleep state, the control system only activates the left side partial nightlight without disturbing the right user's sleep environment.

[0117] S703e: Based on the first scene control command, control the auxiliary light located in the left side area of ​​the mattress to turn on in a preset low brightness mode. This auxiliary light can be a lighting element in the left-side spotlight 32 or a low-position night light independently installed on the side of the bed. The preset low brightness mode is usually an extremely low illuminance (such as 1~5 lumens). The light is reflected or shines directly downwards, illuminating only the floor or passageway on the left side of the bed, avoiding light scattering upwards to the right side.

[0118] S704e: Based on the second scene control command, the main bedroom light remains off and no wake-up devices are triggered. That is, the user on the right is still asleep, and the control system will not turn on the main room light, play sounds, or vibrate the pillow when the user on the left gets out of bed, ensuring that the user on the right is not awakened.

[0119] S705e: Based on the fact that the user's brief period of being out of bed on the left side continues for more than a preset time threshold (e.g., 2 minutes) and the pressure sensor data on the left side recovers to above the in-bed threshold, the first side nightlight is turned off. This means that after the user returns to bed, the brief period of being out of bed ends, the nightlight automatically turns off, and a completely dark sleep environment is restored. If the user's time out of bed exceeds a preset threshold (e.g., 15 minutes), it may be determined as a genuine awakening, and other scenarios (e.g., turning on the main lighting) may be executed.

[0120] The beneficial effects of this implementation method are significant. First, by distinguishing between brief periods of getting out of bed and actual wake-up, and based on the judgment of the sleep state of the user on the other side, intelligent lighting control is achieved in a double-person scenario, ensuring "one-sided nighttime awakening without disturbing the neighbor." The low-brightness nightlight on the bedside automatically turns on when the user gets up at night and automatically turns off upon returning, requiring no manual operation and significantly reducing the probability of waking the partner by turning on the light. Second, the auxiliary light uses a low-brightness, directional illumination method to avoid direct light shining into the eyes or scattering into the sleeping area, protecting the deep sleep of the user on the right. Furthermore, this method, combined with the focusing and reflecting structure of the lighting component 3, further concentrates the light along the ground path, meeting lighting needs without disturbing others, significantly improving the sleep quality and convenience of nighttime activities for double-bed users.

[0121] In some embodiments, after step S600 (the target illumination element is rotated to the target angle based on the real-time attitude control of the rotating component 31 of the user on the target illumination side), the following steps are further included: S801f: Based on the sleep states of the left-hand user and the right-hand user, obtain the in-bed status and sleep intention of the first user and the second user, wherein the first user is the left-hand user and the second user is the right-hand user. Through the aforementioned steps, monitor the in-bed status, body movement level, heart rate, and other parameters of the users on both sides of the double bed in real time, and comprehensively determine the in-bed status (in bed, briefly out of bed, actually awake) and sleep intention (lying down for entertainment, preparing to fall asleep, already asleep) of each user.

[0122] S802f: Based on the first user's status determination result being that they have truly woken up and the second user's sleep intention determination result being that they have fallen asleep, a first scene control command is generated for the first user to trigger the morning scene associated with the user on the left, and a second scene control command is generated for the second user to keep the bedroom main light off or switch to soft light mode. That is, when the user on the left truly wakes up in the morning (such as when the alarm clock rings or they wake up naturally), while the user on the right is still in deep sleep, the system initiates a gradual morning wake-up scene for the user on the left, while strictly protecting the sleep environment of the user on the right from disturbance.

[0123] S803f, based on the first scene control command, sequentially executes the following morning scene actions: controls the bedroom main light to gradually brighten to a preset morning brightness (e.g., smoothly increasing from 0% to 50% within 1 minute), controls the electric curtains to open to a preset morning opening degree (e.g., half-open or fully open), and controls the smart speaker to play preset morning content (e.g., soft music, news, or weather reports). These actions are executed sequentially or in tandem to help the user on the left gently transition from sleep to wakefulness.

[0124] S804f: Based on the second scene control command, keep the main bedroom light off and control the secondary light on the side where the second user is located to switch to soft light mode, wherein the brightness of the soft light mode is lower than the preset morning brightness. The right secondary light may switch to a very low brightness warm light (such as 2% brightness) or be completely off, and no audio will be played in the right area to ensure that the right user is not disturbed by the morning scene. If the right user also gradually wakes up, it can selectively switch to soft light mode to provide dim light guidance.

[0125] S805f: If the pressure sensor data corresponding to the actual wake-up determination result remains below the preset pressure threshold for more than the preset wake-up confirmation time, the execution state of the morning scene is locked until a reset command is received. For example, if the pressure signal disappears after the user on the left leaves the mattress, and does not recover for more than 5 minutes, the system confirms that the user has actually woken up rather than temporarily left the bed. In this case, the morning scene will remain active (lights, curtains, and music will continue to run) to prevent accidental exit from the scene due to the user briefly returning to bed (such as to pick up a mobile phone). The system will only exit the morning scene and return to standby mode when the user sends a reset command via voice, APP, or manual switch.

[0126] This implementation method offers significant benefits. First, by differentiating the sleep states of the left and right users, it achieves differentiated scene control, allowing users to wake up on one side while continuing to sleep on the other. The user on the left enjoys a gradual morning wake-up experience, while the user on the right remains undisturbed by light and sound, meeting the needs of users with different sleep schedules in a double bed. Second, the gradual brightening of the lights, opening of the curtains, and music playback in the morning scene are executed sequentially, simulating the natural sunrise process, which is more comfortable and healthier than a sudden alarm clock ringing, helping to alleviate morning grumpiness. In addition, the soft light mode of the secondary light provides a low-light transition for the right user who may be about to wake up, avoiding the discomfort of suddenly switching from complete darkness to bright light. Finally, a pressure sensor confirms actual wake-up and locks the scene status, preventing accidental exit due to brief return to bed, ensuring the complete execution of the morning scene.

[0127] According to the embodiments of the fourth aspect of this application, such as Figure 6 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call logic instructions in the memory 330 to execute a control method for the low-temperature lithium battery module, the method including: A100. When the user on the mattress is asleep, a lighting off command and a curtain closing command are generated. Based on the lighting off command, the main lighting light is powered off, and based on the curtain closing command, the curtain motor is controlled to drive the curtain to move to the fully closed position. A200: Based on the sleep state, trigger body surface temperature acquisition, obtain the user's body surface area temperature matrix based on the infrared thermal imaging sensor, and extract the current highest body surface temperature value and the highest body surface temperature location corresponding to the current highest body surface temperature value based on the body surface area temperature matrix. A300: Based on the current highest body surface temperature value and the location of the highest body surface temperature, combined with the preset comfortable temperature range and the preset wind avoidance strategy, calculate the target air outlet direction, target air outlet speed and target air outlet temperature; A400: Based on the target air outlet direction, the target air outlet speed, and the target air outlet temperature, generate an air conditioning drive control signal, and adjust the air outlet grille deflection angle, fan speed, and compressor operating frequency of the air conditioner according to the air conditioning drive control signal, so that the actual air outlet direction, actual air outlet speed, and actual air outlet temperature correspond to the target air outlet direction, the target air outlet speed, and the target air outlet temperature, respectively.

[0128] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A smart home control method based on a mattress, characterized in that, Includes the following steps: A100. When the user on the mattress is asleep, a lighting off command and a curtain closing command are generated. Based on the lighting off command, the main lighting light is powered off, and based on the curtain closing command, the curtain motor is controlled to drive the curtain to move to the fully closed position. A200: Based on the sleep state, trigger body surface temperature acquisition, obtain the user's body surface area temperature matrix based on the infrared thermal imaging sensor, and extract the current highest body surface temperature value and the highest body surface temperature location corresponding to the current highest body surface temperature value based on the body surface area temperature matrix. A300: Based on the current highest body surface temperature value and the location of the highest body surface temperature, combined with the preset comfortable temperature range and the preset wind avoidance strategy, calculate the target air outlet direction, target air outlet speed and target air outlet temperature; A400: Based on the target air outlet direction, the target air outlet speed, and the target air outlet temperature, generate an air conditioning drive control signal, and adjust the air outlet grille deflection angle, fan speed, and compressor operating frequency of the air conditioner according to the air conditioning drive control signal, so that the actual air outlet direction, actual air outlet speed, and actual air outlet temperature correspond to the target air outlet direction, the target air outlet speed, and the target air outlet temperature, respectively.

2. The smart home control method based on a mattress according to claim 1, characterized in that, The control method further includes: Step C100: Based on the sleep state determined in step A100, a monitoring camera start command is generated, and the monitoring camera fixedly installed on the top of the bedroom is controlled to start real-time acquisition based on the monitoring camera start command to obtain real-time images of the bed area. Step C200: Based on the real-time image of the bed area, extract the physical boundary line of the mattress in the image coordinate system, and extract all human target areas in the real-time image of the bed area to obtain a set of human target areas; Step C300: Based on the area of ​​the geometric bounding rectangle of each target region in the human target region set, the human target region set is divided into an infant target region belonging to the infant and an adult target region belonging to the adult. The infant center pixel coordinates are obtained based on the geometric center of the infant target region, and the adult coverage pixel range is obtained based on the contour coverage boundary of the adult target region. Step C400: Based on the baby's center pixel coordinates and the mattress's physical boundary line, calculate the shortest pixel distance from the baby's center pixel coordinates to the mattress's physical boundary line, and compare the shortest pixel distance with a preset bed edge safety distance threshold to obtain a fall risk assessment result. Step C500: Based on the infant target area and the adult coverage pixel range, calculate the overlapping pixel area between the infant target area and the adult coverage pixel range, and compare the overlapping pixel area with a preset overlay safety area threshold to obtain the overlay risk determination result. Step C600: When the fall risk determination result indicates that the shortest pixel distance is less than the preset bed edge safety distance threshold, or the crushing risk determination result indicates that the overlapping pixel area is greater than the preset crushing safety area threshold, a composite alarm drive signal is generated, and the speaker built into the monitoring camera is controlled to emit a sound alarm based on the composite alarm drive signal.

3. The smart home control method based on a mattress according to claim 2, characterized in that, Step C400 includes the following steps: Step C401: Based on the physical boundary line of the mattress, extract all continuous pixel positions occupied by the physical boundary line of the mattress in the image coordinate system to obtain the set of mattress boundary pixel coordinates; Step C402: Based on the baby's center pixel coordinates and the set of mattress boundary pixel coordinates, calculate the Euclidean pixel distance value from the baby's center pixel coordinates to each boundary pixel coordinate in the set of mattress boundary pixel coordinates, and obtain the set of boundary distance values. Step C403: Based on the set of boundary distance values, select the Euclidean pixel distance value with the smallest value from the set of boundary distance values ​​as the shortest pixel distance from the baby's center pixel coordinates to the physical boundary line of the mattress; Step C404: Based on the bed edge safety distance threshold stored in the preset storage medium, read the bed edge safety distance threshold and use the bed edge safety distance threshold as a comparison benchmark value; Step C405: Based on the shortest pixel distance and the comparison benchmark value, compare the shortest pixel distance with the bed edge safety distance threshold. When the shortest pixel distance is less than the bed edge safety distance threshold, generate a judgment result that the fall risk is real. When the shortest pixel distance is greater than or equal to the bed edge safety distance threshold, generate a judgment result that the fall risk is false.

4. The smart home control method based on a mattress according to claim 2, characterized in that, Step C500 includes the following steps: Step C501: Based on the infant target region, extract the minimum row coordinates, maximum row coordinates, minimum column coordinates, and maximum column coordinates of the infant target region in the image coordinate system to obtain the boundary coordinate parameters of the infant region; Step C502: Based on the adult coverage pixel range, extract the minimum row coordinate, maximum row coordinate, minimum column coordinate, and maximum column coordinate of the adult coverage pixel range in the image coordinate system to obtain the adult region boundary coordinate parameters; Step C503: Based on the minimum row coordinate in the infant region boundary coordinate parameters and the minimum row coordinate in the adult region boundary coordinate parameters, the larger of the two is used as the starting row coordinate of the overlapping region; based on the maximum row coordinate in the infant region boundary coordinate parameters and the maximum row coordinate in the adult region boundary coordinate parameters, the smaller of the two is used as the ending row coordinate of the overlapping region; based on the minimum column coordinate in the infant region boundary coordinate parameters and the minimum column coordinate in the adult region boundary coordinate parameters, the larger of the two is used as the starting column coordinate of the overlapping region; based on the maximum column coordinate in the infant region boundary coordinate parameters and the maximum column coordinate in the adult region boundary coordinate parameters, the smaller of the two is used as the ending column coordinate of the overlapping region, thus obtaining the overlapping region row interval and the overlapping region column interval. Step C504: Based on the starting row coordinates and ending row coordinates of the overlapping region, calculate the row coordinate difference between the ending row coordinates and the starting row coordinates of the overlapping region to obtain the overlapping row pixel length; based on the starting column coordinates and ending column coordinates of the overlapping region, calculate the column coordinate difference between the ending column coordinates and the starting column coordinates of the overlapping region to obtain the overlapping column pixel width; based on the overlapping row pixel length and the overlapping column pixel width, calculate the product of the overlapping row pixel length and the overlapping column pixel width to obtain the overlapping pixel area between the infant target region and the adult coverage pixel range. Step C505: Based on the overlay safety area threshold stored in the preset storage medium, read the overlay safety area threshold, compare the overlapping pixel area with the overlay safety area threshold, and generate a judgment result that the overlay risk is real when the overlapping pixel area is greater than the overlay safety area threshold, and generate a judgment result that the overlay risk is false when the overlapping pixel area is less than or equal to the overlay safety area threshold.

5. A mattress, characterized in that, It includes a control component for performing the mattress-based smart home control method as described in any one of claims 1 to 4.

6. The mattress according to claim 5, characterized in that, The mattress further includes a base plate and a back plate, the back plate being connected to the base plate, the base plate comprising: basal layer; The support assembly includes multiple lifting drive components and multiple support components. The lifting drive components are installed on the base layer. Each of the multiple support components corresponds to one of the multiple lifting drive components. The support components are connected to the lifting drive components. The lifting drive components are used to drive the support components to move up and down. An elastic layer is attached to the side of the support member opposite to the drive member; An inflatable layer is connected to the side of the elastic layer opposite to the support member; An inflatable component is connected to the outer wall of the base plate, and the inflatable component is in communication with the air cavity of the inflatable layer.

7. The mattress according to claim 6, characterized in that, The inflatable layer includes a first air chamber and a second air chamber that are separated from each other, and the inflatable component includes a first inflatable component and a second inflatable component. The base plate also includes a first one-way valve and a second one-way valve. The first one-way valve is connected to the first inflation component and the first air chamber, and the second one-way valve is connected to the second inflation component and the second air chamber.

8. The mattress according to claim 6, characterized in that, The mattress also includes a lighting assembly mounted on the back panel. The lighting assembly includes a rotating component, a left-side focusing component, a right-side focusing component, a left-side illumination component, and a right-side illumination component. The left-side and right-side focusing components are both connected to the rotating component. The rotating component is used to drive the left-side and right-side focusing components to rotate. The left-side illumination component is connected to the side of the left-side focusing component opposite to the right-side focusing component, and the right-side illumination component is connected to the side of the right-side focusing component opposite to the left-side focusing component. The left-side focusing component is used to reflect the light emitted by the left-side illumination component to the left side of the mattress, and the right-side focusing component is used to reflect the light emitted by the right-side illumination component to the right side of the mattress.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the mattress-based smart home control method according to any one of claims 1 to 4.