Sleep-aiding device linkage remote control method and device based on internet of things
By collecting and analyzing sleep data to generate collaborative control commands, intelligent linkage and adaptive adjustment of sleep aid devices are achieved, solving the problem of automatic adjustment in existing technologies and ensuring the consistency and adaptability of device actions in the time dimension.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN NEW HOPE MEDICAL EQUIP CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-17
AI Technical Summary
Existing sleep aids cannot automatically adjust based on real-time sleep status and environmental disturbances, lack dynamic control strategies, and the logic for multi-device linkage relies on manual configuration by the user, making intelligent decision-making impossible.
By collecting sleep-related data, analyzing sleep states, generating collaborative control commands, and linking devices through remote communication via the Internet of Things, adaptive adjustments are made based on device feedback and external disturbances.
It achieves continuity, integrity, and adaptability of the sleep-aid environment, avoids rhythm overlap and execution deviation caused by multiple device actions, and ensures the consistency of device action modes in the time dimension.
Smart Images

Figure CN121541486B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote control technology, specifically a method and device for remote control of sleep aid devices based on the Internet of Things. Background Technology
[0002] Existing sleep aid devices can typically collect basic data such as heart rate, respiration, body movement, noise, and light, and can also be used for simple parameter settings or remote operation via mobile terminals.
[0003] In existing smart home platforms, some technologies have achieved rule-based linkage between multiple devices, such as timed on / off switching and scene preset triggering. However, the linkage logic is usually manually configured by the user and cannot be combined with sleep stages or physiological patterns for intelligent decision-making. Furthermore, most existing sleep monitoring algorithms are used for stage determination or sleep quality assessment, rather than providing guidance for the coordinated behavior of multiple devices. On the other hand, although remote control technology has been applied to smart devices such as lighting, air conditioning, and security systems, a complete closed-loop control system has not yet been formed in sleep scenarios. Existing technologies typically cannot automatically adjust based on real-time sleep status, environmental disturbances, or device feedback, and also lack dynamic control strategies to cope with sudden factors (such as noise interference, abnormal body movement, and sudden changes in breathing). Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention proposes a method and device for remote control of sleep aid devices based on the Internet of Things.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] IoT-based methods for remotely controlling sleep aid devices include:
[0007] Collect users' sleep-related data and analyze users' sleep status based on the sleep-related data, which includes heart rate, respiration, body movement and environmental noise;
[0008] Based on the sleep state, collaborative control instructions for various sleep aid devices are generated, including coordination parameters for adjusting the sequence and intensity of device actions.
[0009] The collaborative control commands are sent to each sleep aid device via a remote communication channel, and adaptive adjustments are made based on device feedback and external disturbances.
[0010] Specifically, the collection of users' sleep-related data and the analysis of users' sleep states based on the sleep-related data include:
[0011] Collect users' sleep-related data and timestamp and preprocess the sleep-related data according to a preset sampling period;
[0012] The preprocessed sleep-related data is divided into multi-channel data segments corresponding to the preset sleep analysis window, and a unique identifier is assigned to each data segment.
[0013] Extract features from multi-channel data segments to form a corresponding set of multi-dimensional feature vectors;
[0014] Based on the multidimensional feature vector set, a sleep feature sequence arranged in chronological order is constructed, and the feature vectors corresponding to adjacent sleep analysis windows are combined to form a temporal feature combination, which is used to characterize the evolution trend of the current sleep stage.
[0015] The combined temporal features are input into a pre-established sleep state analysis model, which outputs sleep states that correspond one-to-one with each sleep analysis window.
[0016] Specifically, the combined temporal features are input into a pre-established sleep state analysis model, which outputs sleep states corresponding one-to-one with each sleep analysis window, including:
[0017] The time-series feature combination is dimension-mapped and sequence-sorted according to a preset input format, and the mapped and sorted sequence is divided into input units corresponding to multiple sleep analysis windows.
[0018] The input units are input one by one into a pre-established sleep state analysis model, and an intermediate state sequence is generated within the sleep state analysis model according to a preset state propagation rule. The intermediate state sequence is used to characterize changes in sleep stages.
[0019] Window-level determination is performed on the intermediate state sequence, and the intermediate state corresponding to each sleep analysis window is associated with the intermediate states of its preceding and following adjacent windows to generate an association determination result.
[0020] The association determination results are converted into sleep states that correspond one-to-one with each sleep analysis window, and the labels of the sleep states are bound to the corresponding temporal features in chronological order.
[0021] Specifically, based on the sleep state, collaborative control instructions for various sleep aid devices are generated, including:
[0022] Based on the sleep state, the target device group to participate in the collaborative control is determined from the preset set of sleep aid devices, and a corresponding collaborative participation identifier is assigned to each target device;
[0023] The sleep state is associated with the historical action records of the target device group to generate a stage mapping sequence, and the initial control parameters of each target device are determined based on the stage mapping sequence.
[0024] Cross-device correlation analysis is performed on the initial control parameters, and parameter combinations that have conflicting actions, overlapping times, or rhythmic interference are adjusted to obtain a set of coordinated parameters;
[0025] Based on the set of coordination parameters, a cross-device control instruction structure is constructed, and the action instructions, execution order and control amplitude of each target device are combined according to a preset logic to form a collaborative control instruction set;
[0026] The collaborative control instruction set is time-referenced to ensure that each collaborative control instruction maintains an executable sequential constraint relationship on the time axis, thereby obtaining collaborative control instructions for various sleep aid devices.
[0027] Specifically, the sleep state is associated with the historical action records of the target device group to generate a stage mapping sequence, and the initial control parameters of each target device are determined based on the stage mapping sequence, including:
[0028] After identifying the target device group, the historical action records of each target device are organized in chronological order, and the sleep state is paired with the historical action records of the corresponding time period to obtain the original stage fragment.
[0029] The original stage segments are filtered, and segments that exhibit the same movement pattern in different sleep stages are merged, and a stage mapping sequence is constructed based on the merging results.
[0030] Arrange the mapping units in the stage mapping sequence according to the time axis, extract the action parameters contained in the mapping units by interval, and generate a set of action parameters in the current sleep state.
[0031] Based on the set of motion parameters, initial control parameters corresponding to the motion trajectory are assigned to each target device.
[0032] Specifically, cross-device correlation analysis is performed on the initial control parameters, and parameter combinations that have conflicting actions, overlapping times, or rhythmic interference are adjusted to obtain a set of coordinated parameters, including:
[0033] The initial control parameters of each target device are classified and organized according to time interval and rhythm characteristics to construct a multi-dimensional parameter matrix;
[0034] Based on the multidimensional parameter matrix, the initial control parameters of different target devices in the same or adjacent time intervals are compared item by item to identify parameter combinations with overlapping relationships and generate a list of conflicting parameters.
[0035] For the conflict parameter list, based on the preset rhythm constraint rules and equipment priority rules, the initial control parameters in the conflict parameter combination are time-shifted, amplitude-leveled, or rhythm-rearranged to obtain the intermediate control parameter set;
[0036] The intermediate control parameter set is subjected to consistency verification. Intermediate control parameters that satisfy the rhythm constraint rules and equipment priority rules are marked as coordination parameters. The coordination parameters are then rearranged to form a coordination parameter set.
[0037] Specifically, a cross-device control command structure is constructed based on the aforementioned coordination parameter set. The action commands, execution order, and control amplitude of each target device are combined according to preset logic to form a collaborative control command set, including:
[0038] The coordination parameter set is split according to the device identifier, and a device-level parameter sequence containing action type, control amplitude and expected execution time is generated for each target device;
[0039] Based on the sequence of parameters at each device level, action instructions belonging to the same time period or having adjacent execution relationships are arranged sequentially to generate an instruction sequence framework.
[0040] In the instruction sequence framework, parameters are embedded for each action instruction, and the corresponding control amplitude, execution time period and device identifier are combined and written to the corresponding instruction node.
[0041] The instruction sequence framework with embedded parameters is formatted, and each instruction node is combined into a collaborative control instruction set according to the time sequence and collaborative constraint relationship.
[0042] Specifically, the collaborative control commands are sent to each sleep aid device via a remote communication channel, and adaptive adjustments are made based on device feedback and external disturbances, including:
[0043] The collaborative control instruction set is split according to the target device identifier, and a corresponding instruction fragment is generated for each sleep aid device;
[0044] The instruction fragments are sent one by one to each sleep aid device through a remote communication channel, and remote identification information is attached to each instruction fragment during the transmission process;
[0045] Receive device feedback information returned by each sleep aid device after executing the instruction segment, and generate a feedback record sequence based on the device feedback information;
[0046] The feedback record sequence is merged with the current external disturbance monitoring data, the device nodes that cause execution offset or action conflict are marked, and intermediate adjustment parameters are generated based on the marking results;
[0047] The intermediate adjustment parameters are compared with the original cooperative control instruction set, and the instruction nodes that involve execution offset or disturbance risk are rearranged or the parameters are replaced to obtain the adaptive adjustment instruction set.
[0048] Specifically, the intermediate adjustment parameters are compared with the original cooperative control instruction set, and the instruction nodes involved in the risk of execution offset or disturbance are rearranged or their parameters replaced to obtain an adaptive adjustment instruction set, including:
[0049] The intermediate adjustment parameters are categorized and organized, and compared one-to-one with the corresponding instruction nodes in the original collaborative control instruction set to determine the set of target instruction nodes to be adjusted.
[0050] Execution trajectory analysis is performed on each instruction node in the target instruction node set. The execution time period and control amplitude of the instruction node are associated with the execution logic of its preceding and following adjacent instruction nodes to identify conflict locations that cause action deviation or rhythm disturbance.
[0051] Based on the conflict location, the execution time period of the corresponding instruction node is offset, the control amplitude is replaced by order, or the execution order between multiple nodes is rearranged to form a set of reconstructed instruction nodes that matches the intermediate adjustment parameters.
[0052] The set of reconstructed instruction nodes is combined to generate an adaptive adjustment instruction set.
[0053] The IoT-based sleep aid device linkage remote control device is used to implement the IoT-based sleep aid device linkage remote control method, including: a sleep state analysis module, an instruction generation module, and an instruction adjustment module.
[0054] The sleep state analysis module is used to collect the user's sleep-related data and analyze the user's sleep state based on the sleep-related data. The sleep-related data includes heart rate, respiration, body movement and environmental noise.
[0055] The instruction generation module generates collaborative control instructions for various sleep aid devices based on the sleep state. The collaborative control instructions include coordination parameters for adjusting the sequence and intensity of device actions.
[0056] The instruction adjustment module is used to send the collaborative control instructions to each sleep aid device through a remote communication channel, and to make adaptive adjustments based on device feedback and external disturbances.
[0057] Compared with the prior art, the beneficial effects of the present invention are:
[0058] This invention proposes a remote control method and device for sleep aids based on the Internet of Things (IoT). By using sleep state as the core input, it constructs collaborative behavioral logic across multiple sleep aids, enabling the unified generation and dynamic adjustment of the action sequence, control amplitude, and rhythmic relationship of each device. This ensures the continuity, integrity, and adaptability of the entire sleep environment. Furthermore, based on adaptive adjustments to device feedback and external disturbances, control commands can be rearranged according to real-time changes during execution, avoiding rhythmic overlap and execution deviation caused by simultaneous actions of multiple devices. Simultaneously, the staged mapping relationship between sleep state and historical device behavior ensures consistency of collaborative control over time, guaranteeing that multiple devices can implement matching action modes at different sleep stages of the user. This provides stable command generation capabilities and flexible remote control capabilities for complex sleep scenarios. Attached Figure Description
[0059] Figure 1 Flowchart of the IoT-based sleep aid device linkage remote control method provided by the present invention;
[0060] Figure 2 The flowchart for generating sleep state provided by the present invention;
[0061] Figure 3 The remote control flowchart provided by this invention;
[0062] Figure 4 This invention provides an architecture diagram of a remote control device for sleep aids based on the Internet of Things. Detailed Implementation
[0063] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0065] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. In addition, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0066] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0067] Example 1
[0068] Please see Figures 1-3 The present invention provides an embodiment of a method for remotely controlling sleep aid devices based on the Internet of Things, comprising the following specific steps:
[0069] Step S1: Collect sleep-related data of the user and analyze the user's sleep state based on the sleep-related data, which includes heart rate, respiration, body movement and environmental noise.
[0070] like Figure 2 As shown, the specific steps of step S1 are as follows:
[0071] Step S101: Collect the user's sleep-related data and timestamp and preprocess the sleep-related data according to the preset sampling period.
[0072] In this embodiment, different data channels such as heart rate, respiration, body movement, and environmental noise differ in physical sampling methods and signal change rates. Without unified time stamping, it is impossible to construct continuous temporal features that can be used for subsequent sleep stage identification. Therefore, after acquisition, various raw signals are timestamped according to a preset sampling period to ensure the correspondence of multi-channel data on the time axis. Subsequently, each raw signal is preprocessed, mainly including removing abnormal jump points, smoothing pseudo fluctuations caused by hardware noise, and mapping data from different amplitude ranges to a unified numerical range, so that the data from different sensors are comparable in form, facilitating the next stage of feature extraction and temporal combination. After the above processing, each signal is stored in the form of data segments with a unified time scale, no abnormal interference, and resolvable data.
[0073] Step S102: Divide the preprocessed sleep-related data into multi-channel data segments corresponding to the preset sleep analysis window, and assign a unique identifier to each data segment.
[0074] In this embodiment, the determination of sleep state typically relies on physiological and environmental indicators within several consecutive time periods. Therefore, it is necessary to segment the preprocessed multi-channel sleep-related data according to a preset sleep analysis window length so that each data segment can completely cover a minimum analysis cycle. Specifically, by using the timestamp sequence as the segmentation benchmark, data from multiple sensor channels within the same time range are grouped together to form multi-channel data segments with consistent time length and number of channels. To avoid cross-referencing or sequence confusion between different segments, a unique identifier is generated for each data segment. This unique identifier can be constructed based on the segment start time, channel index set, or internal sequence number, and is used to maintain the singleness of segment-level reference relationships in subsequent feature extraction, model inference, and control links. After the above processing, data from different signal sources are organized into a fragmented data set with a unified structure, clear boundaries, and direct model reference.
[0075] Step S103: Extract features from multi-channel data segments to form a corresponding set of multi-dimensional feature vectors.
[0076] In this embodiment, the fluctuation patterns, rates of change, and periodic structures of signals such as heart rate, respiration, body movement, and environmental noise differ in their respective channels. Directly using the raw data makes it difficult to construct a stable basis for sleep discrimination. Therefore, it is necessary to transform the segmented multi-channel data fragments into feature vectors that reflect the internal structural characteristics of the signals. Specifically, multi-dimensional features reflecting trends, fluctuation amplitudes, rhythmic structures, and irregular changes can be calculated for each fragment. These include time-axis-based trajectory features, frequency band features reflecting the stability of respiration and heart rate, energy distribution features characterizing body movement levels, and amplitude distribution features describing the noise environment. By combining the outputs of different feature dimensions at the fragment level, each fragment forms a multi-dimensional feature vector with consistent structure and rich content. It should be noted that channel source information is preserved during feature combination, ensuring that each feature dimension can be traced back to a specific signal channel. This ensures that the correlation between fragment features and channel information is not disrupted when constructing temporal features or inferring sleep states. Finally, the feature vectors of all fragments are organized into a set in chronological order.
[0077] Step S104: Based on the multidimensional feature vector set, construct a sleep feature sequence arranged in chronological order, and combine the feature vectors corresponding to adjacent sleep analysis windows to form a temporal feature combination, which is used to characterize the evolution trend of the current sleep stage.
[0078] In this embodiment, the feature vectors within a single sleep analysis window can only reflect signal changes in a local time period and cannot describe the evolution of sleep stages over time. Therefore, a time series structure needs to be introduced to arrange the aforementioned multidimensional feature vectors according to the time order of segment generation, constructing a sleep feature sequence to characterize the continuous sleep process. Specifically, by using timestamps as the main index, the feature vectors corresponding to adjacent sleep analysis windows are extracted in sequence, and several adjacent feature vectors are combined according to a set combination span, so that the combination has cross-window continuity in the time dimension, thereby forming a time-series feature combination that can reflect the stage change trajectory. It should be noted that the combination process keeps the channel source information and feature dimension structure within each feature vector unchanged, so that the time-series combination contains both the statistical features of the local window and retains the continuous change information across the window, ultimately obtaining a serialized feature input that can characterize the gradual evolution trend of sleep stages.
[0079] Step S105: Input the combined temporal features into the pre-established sleep state analysis model and output the sleep state corresponding to each sleep analysis window.
[0080] The specific steps of step S105 are as follows:
[0081] Step S1051: The time series feature combination is dimension-mapped and sequence-sorted according to a preset input format, and the mapped and sorted sequence is divided into input units corresponding to multiple sleep analysis windows.
[0082] In this embodiment, the temporal features formed by combining multiple adjacent data segments differ in the number of dimensions, channel arrangement, and internal nesting structure. If directly input into the sleep state analysis model, it will be difficult to guarantee the consistency of the model's interpretation of features in different time periods during inference. Therefore, it is necessary to perform dimensional mapping on the temporal feature combinations according to a preset input format, so that features from different sources and at different scales are transformed into a unified representation in terms of the number of dimensions and arrangement. Subsequently, the mapped sequence is sorted according to the timestamp order, so that each feature unit maintains a strict temporal order in the input link. It should be noted that after sorting, the sequence is divided according to a preset sleep analysis window granularity, so that each segmented input unit contains feature content covering the corresponding window range, thereby forming multiple input units that can be independently input into the model. After the above processing, the temporal features are transformed from the initial free combination structure into a set of model input units with fixed dimensions, clear order, and clear boundaries.
[0083] Step S1052: Input the input units one by one into the pre-established sleep state analysis model, and generate an intermediate state sequence within the sleep state analysis model according to the preset state propagation rules. The intermediate state sequence is used to characterize the changes in sleep stages.
[0084] In this embodiment, since a single input unit can only reflect the characteristics of a local time period, and sleep stages typically exhibit a gradual change from light sleep to deep sleep and then to REM sleep, multiple input units need to be sequentially input into a pre-established sleep state analysis model so that the model can gradually construct a state evolution chain based on the input order. Specifically, after receiving each input unit, the model associates the current feature vector with the previously derived implicit state according to a preset state propagation rule, so that the new state not only reflects the characteristics of the current window but also retains the temporal dependencies of the previous window. After continuous input and propagation, the model generates a set of intermediate states in the order of the input units and uses the time axis as the main line to form an intermediate state sequence. It should be noted that this intermediate state sequence is not the final sleep determination result, but is used to characterize the changing trend of sleep stages between consecutive windows, so that the final determination of sleep state can be inferred based on the complete temporal stage structure.
[0085] Step S1053: Perform window-level determination on the intermediate state sequence, associate the intermediate state corresponding to each sleep analysis window with the intermediate states of its preceding and following adjacent windows, and generate association determination results.
[0086] In this embodiment, the intermediate state corresponding to a single window can only reflect the local physiological changes within that window, and cannot accurately present the continuity of sleep stages from the previous window to the next. Therefore, cross-temporal correlation determination is required at the window level. Specifically, by parsing the intermediate state sequence in chronological order, the intermediate state corresponding to each sleep analysis window forms a local three-window correlation structure with the intermediate states of its preceding and following adjacent windows. In this structure, by comparing the direction and magnitude of change of the intermediate state in its internal expression space, as well as the similarity characteristics with the states of adjacent windows, it is determined whether the window is in a stage of rising, falling, or stable change trajectory. It should be noted that when generating the correlation determination result, the reference to the states of the preceding and following windows is maintained to ensure that the determination result can reflect the continuous pattern between windows, rather than processing each window independently. After the above correlation determination, a determination result that simultaneously reflects the characteristics of the current window and the changing trends of the preceding and following windows is obtained.
[0087] Step S1054: Convert the association determination result into a sleep state corresponding to each sleep analysis window, and bind the labels of the sleep states with the corresponding temporal features in chronological order.
[0088] In this embodiment, since the association determination results have depicted the phase change trend of each window on the time axis, it is necessary to map the determination results to a preset sleep state set, so that the intermediate state corresponding to each window is converted into a specific sleep state label by comparing with the phase change pattern. Specifically, based on the change direction, change magnitude and phase continuity characteristics reflected in the determination results, the window state is classified into predefined categories such as light sleep, deep sleep, REM sleep or transitional state. After the state label is generated, it is bound to the corresponding temporal feature combination in chronological order, so that each label and the multi-window feature sequence it represents are consistently mapped at the data level, ensuring that the subsequent control strategy generation steps can retrieve the corresponding feature combination with the state label as the main index. After the above processing, the state sequence that was originally in the intermediate representation layer of the model is solidified into a sleep state sequence with clear window boundaries and semantic definitions.
[0089] Step S2: Based on the sleep state, generate collaborative control instructions for various sleep aid devices, the collaborative control instructions including coordination parameters for adjusting the sequence and intensity of device actions.
[0090] like Figure 3 As shown, the specific steps of step S2 are as follows:
[0091] Step S201: Based on the sleep state, determine the target device group to participate in the collaborative control from the preset set of sleep aid devices, and assign a corresponding collaborative participation identifier to each target device.
[0092] In this embodiment, the sensitivity to light, sound, smell, and rhythmic guidance differs between light sleep, deep sleep, and REM sleep stages. If a fixed group of devices is used to execute linkage commands, the control process cannot match the current sleep state. Therefore, it is necessary to dynamically select suitable devices to participate in the control based on the sleep state. Specifically, by comparing the current sleep state with preset device function rules, the selection of device groups can correspond to the type of environmental regulation required for that sleep stage. For example, rhythmic guidance devices are prioritized in stages with frequent body movements, and acoustic devices are prioritized in stages with significant changes in environmental noise. After completing the selection of target device groups, to ensure that subsequent cross-device parameter correlation analysis and command arrangement can correctly identify device roles, a collaborative participation identifier is generated for each selected device. This identifier is composed of a time period, device function category, and internal serial number, enabling subsequent processes to retrieve device attributes, execution order, and collaborative relationships based on the identifier. After the above processing, the sleep aid devices are reorganized from the preset set into target device groups that match the current sleep state, and an identifier system that can be used for collaborative control links is obtained.
[0093] Step S202: Associate the sleep state with the historical action records of the target device group to generate a stage mapping sequence, and determine the initial control parameters of each target device based on the stage mapping sequence.
[0094] The specific steps of step S202 are as follows:
[0095] Step S2021: After determining the target device group, organize the historical action records of each target device in chronological order, and pair the sleep state with the historical action records of the corresponding time period to obtain the original stage segment.
[0096] In this embodiment, different sleep aids often exhibit specific action patterns at different sleep stages. For example, a light device may exhibit a gradually weakening action trajectory before falling asleep, while an acoustic device may maintain a low-amplitude steady-state output during deep sleep. Therefore, it is necessary to extract original behavioral fragments that reflect the device response relationship under specific sleep stages from the historical action records of the devices. Specifically, after determining the target device group, the historical action records of each device are organized using timestamps as the primary index to form a sequence of actions arranged continuously by time. These sequences are then paired with sleep state sequences at the time period level, thereby obtaining the set of device actions corresponding to each sleep stage window. It should be noted that during the pairing process, the window boundaries are used as constraints to ensure that the action records are only associated with sleep states that occur within the same time period, thus forming original stage fragments that describe the relationship between sleep stages and device actions. After the above processing, the original stage fragments have clear time definitions and device behavior structures.
[0097] Step S2022: Filter the original stage segments, merge segments that exhibit the same action pattern in different sleep stages, and construct a stage mapping sequence based on the merging results.
[0098] In this embodiment, devices such as lighting, acoustics, odor diffusion, or rhythm guidance often exhibit similar action patterns when facing similar sleep stages (e.g., the transition window from light sleep to deep sleep or the stable window of deep sleep). Therefore, it is necessary to filter out segments from the original stage fragments that belong to the same sleep stage at different time periods and have consistent or highly similar action patterns, and extract stage behaviors that are generally representative. Specifically, by comparing the action trajectory, changes in action amplitude, execution order, and coordination between devices for each original stage fragment, fragments that conform to the characteristics of the same action pattern are grouped into the same category, so that the merged category can reflect the typical device response pattern of a certain type of sleep stage. It should be noted that after merging, a stage mapping sequence is constructed based on the time order and internal structural differences of the merged categories, so that the mapping sequence can characterize the structured relationship between different sleep stages and corresponding device actions with stage categories as nodes and action patterns as core descriptive units. After the above processing, the initial scattered fragments are organized into a mapping sequence.
[0099] Step S2023: Arrange the mapping units in the stage mapping sequence according to the time axis, extract the action parameters contained in the mapping units by interval, and generate a set of action parameters in the current sleep state.
[0100] In this embodiment, each mapping unit in the stage mapping sequence records typical device action characteristics corresponding to different sleep stages. Therefore, these mapping units need to be reordered according to the time axis to present a sequential structure from the pre-sleep stage to the deep sleep or REM stage. Specifically, after sorting, the mapping units adjacent to or directly corresponding to the current sleep state are identified by determining the position of the current sleep state in the stage sequence. The action amplitude range, execution time range, and rhythm change range contained within the mapping unit are extracted so that the current sleep state can extract a reference parameter range from historical behavior patterns. It should be noted that the range extraction process maintains the original upper and lower limits of the action parameters so that the extracted action parameter set reflects the typical parameter distribution of the sleep state and avoids parameter mixing caused by the blurring of different stage boundaries. After the above processing, the stage mapping sequence is converted into a set of action parameters directly associated with the current sleep state.
[0101] Step S2024: Based on the set of motion parameters, assign initial control parameters corresponding to the motion trajectory of each target device.
[0102] In this embodiment, since the motion trajectories of different devices differ in terms of time structure, amplitude variation, and rhythmic response, for example, optical devices rely more on gradual trajectories, acoustic devices rely more on amplitude ranges, and rhythmic guidance devices rely more on temporal rhythms, it is necessary to split the motion parameter set according to device category and motion mode so that each device can obtain a parameter range that is only related to its own trajectory type. Specifically, by comparing the historical motion trajectory characteristics of the target device with the interval attributes in the motion parameter set, the parameter segment closest to the device's operating mode is extracted, and corresponding initial control parameters are generated based on the time boundary, amplitude range, and rhythmic structure of the segment, so that each device obtains parameter settings that can reflect its specific motion path. It should be noted that the correspondence between parameters and motion trajectories is maintained during parameter allocation, so that the generated initial control parameters not only meet the stage requirements of the current sleep state, but also logically remain consistent with the inherent motion mode of the device. After the above processing, each target device obtains initial control parameters that are structurally clear, traceable in origin, and matched with its motion trajectory.
[0103] Step S203: Perform cross-device correlation analysis on the initial control parameters, adjust the parameter combinations that have mutual action conflicts, time overlaps or rhythm interference, and obtain a set of coordinated parameters.
[0104] The specific steps of step S203 are as follows:
[0105] Step S2031: Classify and organize the initial control parameters of each target device according to time interval and rhythm characteristics, and construct a multi-dimensional parameter matrix.
[0106] In this embodiment, since the initial control parameters of each device typically include multiple attributes such as execution time period, action amplitude, rhythm of change, and rhythm phase, it would be difficult to establish a comparison relationship with a unified coordinate system among multiple devices if they were still used in the original list form for subsequent comparison. Therefore, it is necessary to first stratify the parameters according to the time interval, and group parameters belonging to the same or adjacent execution time periods into the same time period group. Then, based on the rhythm characteristics, the parameters within each group are further decomposed so that rhythmic actions (such as periodic brightness fluctuations, respiratory rhythm guidance, etc.) have independent parameter dimensions. After completing the above classification, the parameter entries of each device are mapped into independent elements in a matrix by using the time interval as the main axis and rhythm and amplitude as the auxiliary axes. This matrix presents the device dimension horizontally, the time series vertically, and retains rhythm and amplitude information in the internal dimensions. After the above processing, the initial control parameters are structured into a multi-dimensional parameter matrix that can be directly used for multi-device correlation comparison.
[0107] Step S2032: Based on the multidimensional parameter matrix, compare the initial control parameters of different target devices in the same or adjacent time intervals item by item, identify parameter combinations with overlapping relationships, and generate a list of conflicting parameters.
[0108] In this embodiment, the multidimensional parameter matrix maps the action parameters of each device in each time segment to matrix elements, enabling parameters in the same time period and adjacent time periods to be directly located in a two-dimensional structure. Specifically, using the time segment as the main index, device parameter units in the same or adjacent rows are retrieved one by one, and their execution duration overlap, action amplitude overlap, and rhythm phase similarity are compared at the item level to identify device combinations that cause interference within the same time window. It should be noted that some parameters are allowed to have unavoidable slight overlap during the comparison process, but for cases where the time completely overlaps, the amplitude range exceeds the allowable threshold, or the rhythm phase convergence is too high, they are marked as conflicting parameter units. After the above item-by-item comparison, a conflicting parameter list is formed, which records each conflicting entry using the time segment where the parameter is located and the device identifier as the index.
[0109] Step S2033: For the conflict parameter list, according to the preset rhythm constraint rules and equipment priority rules, the initial control parameters in the conflict parameter combination are time offset, amplitude classification or rhythm rearrangement is performed to obtain the intermediate control parameter set.
[0110] In this embodiment, the conflict parameter list clearly identifies the time periods and device combinations where conflicts occur. Therefore, it is necessary to first determine the main device that should maintain the continuity of action in the conflict combination according to the device priority rules, so that the adjustment process does not disrupt the overall sleep phase matching logic of the system. Subsequently, the conflict parameters are classified and processed according to the rhythm constraint rules. For example, when the conflict is manifested as overlapping execution periods, the execution time of low-priority devices is shifted forward or backward to avoid the critical control window of the main device. When the conflict is manifested as excessive amplitude superposition, the amplitude range is graded so that different devices use different amplitude levels in the same time period, thereby avoiding the concentrated superposition of output peaks. When the conflict originates from the convergence of rhythm phases, the rhythm parameters need to be rearranged so that the rhythm changes of each device form distinguishable intervals in phase. It should be noted that after the above processing is completed, the parameters that have undergone time offset, amplitude grading or rhythm rearrangement are reorganized according to the device dimension so that the parameter sets of each device maintain complete continuity in logical structure, and finally form an intermediate control parameter set.
[0111] Step S2034: Perform consistency verification on the intermediate control parameter set, mark the intermediate control parameters that satisfy the rhythm constraint rules and the equipment priority rules as coordination parameters, and rearrange the coordination parameters to form a coordination parameter set.
[0112] In this embodiment, since time offset, amplitude grading, and rhythm rearrangement may introduce new parameter boundary changes between different devices, it is necessary to first verify the intermediate control parameter set item by item according to the rhythm constraint rules to ensure that the rhythm phase, rhythm period, and rhythm level of each parameter item remain distinguishable within the same time period and do not generate new rhythm overlaps. Subsequently, the device action structure of each time period is reviewed according to the device priority rules to ensure that the main device action within the same action window is not covered or weakened by the parameter rearrangement of secondary devices. After completing the above verification, the parameters that pass the verification are marked as coordination parameters, and the items that do not meet the constraints are removed. It should be noted that, in order to ensure the readability and executability of subsequent instruction construction, the coordination parameters are rearranged according to the time order and device identifier, so that the device actions of each time period form an ordered structure in the logical link. After the above processing, the obtained coordination parameter set has the parameter foundation of cross-device action unification, rhythm hierarchical rationalization, and priority logic clarity.
[0113] Step S204: Construct a cross-device control instruction structure based on the coordination parameter set, and combine the action instructions, execution order and control amplitude of each target device according to preset logic to form a collaborative control instruction set.
[0114] The specific steps of step S204 are as follows:
[0115] Step S2041: The coordination parameter set is split according to the device identifier, and a device-level parameter sequence containing action type, control amplitude and expected execution time is generated for each target device.
[0116] In this embodiment, the parameters in the coordination parameter set are structured with time periods as the main index and mixed records across devices. Without device-level splitting, each device cannot independently generate control instruction fragments in subsequent steps. Therefore, it is necessary to first group the parameter entries in the set according to device category based on device identifier, so that action entries belonging to the same device are extracted into the same subset. Then, in each subset, the parameters are rearranged in chronological order according to the attributes such as action type, control amplitude, and expected execution period contained in the parameter entries, forming a device-level action timeline from early to late. It should be noted that the original structure of amplitude and rhythm attributes will be maintained in this timeline, so that each device-level parameter sequence can fully present the action intention of the device in the entire control cycle, including the start and end of the action, the change in strength, and the rhythm distribution. After the above processing, the coordination parameter set is decomposed into multiple device-level parameter sequences, each of which is consistent with the action logic, functional attributes, and execution order of the corresponding target device.
[0117] Step S2042: Based on the sequence of parameters at each device level, arrange the action instructions that belong to the same time period or have adjacent execution relationships in sequence to generate an instruction sequence framework.
[0118] In this embodiment, firstly, using the execution time periods in all device-level parameter sequences as the time axis, action items within the same time period or exhibiting temporal adjacency are jointly sorted according to their start time, duration, and rhythm identifier, so that the actions of different devices form comparable sequence positions on the time axis. Subsequently, action items with overlapping time periods or rhythmic associations that appear during the sorting process are merged, so that these actions can form a continuous structure that connects with each other at the instruction level, thereby avoiding breaks in the execution link of cross-device actions. After forming the initial time sorting, action instructions with dependencies are further arranged in the sequence according to the logical order based on the triggering logic of the action type, so that the combined sequence has both temporal order and logical coherence. After the above processing, the action instructions of different devices are integrated into the same sequence structure, and the resulting instruction sequence framework expresses the collaborative execution process with a unified time axis and logical relationship.
[0119] Step S2043: In the instruction sequence framework, parameters are embedded for each action instruction, and the corresponding control amplitude, execution period and device identifier are merged and written to the corresponding instruction node.
[0120] In this embodiment, the instruction sequence framework only provides the time and logic skeleton of cross-device actions, but does not yet include parameter content that can be directly executed by the device. Therefore, the amplitude, time period, and device identifier in the aforementioned device-level parameter sequence need to be written into specific instruction nodes in the framework, so that the abstract action position is transformed into an executable control instruction. Specifically, firstly, the execution window of each node on the time axis is located one by one using the node order in the sequence framework as the main index, and control parameter entries that are consistent with the action type corresponding to the node are retrieved from the coordination parameter set within the same time range according to the window. After the parameter retrieval is completed, the control amplitude, execution start and end time, rhythm identifier, and device identifier in the entry are embedded into the node according to the preset field structure, so that the node is transformed from a simple action placeholder into an execution unit with complete parameter attributes. It should be noted that the correlation between parameter attributes is maintained during the parameter embedding process, and the amplitude range, time period boundary, or rhythm field is not reconstructed, so that the embedded node completely retains the coordination logic established in the previous steps. After the above processing, the originally abstract sequence framework is given control content that can be parsed by the device, forming a structured sequence composed of multiple instruction nodes with complete parameters.
[0121] Step S2044: Format the instruction sequence framework with completed parameter embedding, and combine each instruction node into a cooperative control instruction set according to the time sequence and cooperative constraint relationship.
[0122] In this embodiment, the instruction nodes may retain field structures from different source parameters during the embedding process. If directly used for issuing, the instruction parser will not be able to uniformly identify them. Therefore, it is necessary to first format the fields of each node according to the preset instruction encoding standard to ensure that the action type, execution period, control amplitude, rhythm identifier and device identifier are consistent at the encoding level. Then, the formatted nodes are rearranged according to the time order as the main axis, so that the instructions in the earlier execution window are at the beginning of the sequence. In the sorting process, combined with the aforementioned cooperative constraint relationship, the relative positions of nodes with strong dependencies or those that need to be executed in a cooperative order are adjusted in the sequence to avoid execution offset caused by different parsing order between devices. After the node sorting is completed, all nodes are combined into a cooperative control instruction set in the form of a linear structure or a hierarchical structure, so that it carries the complete action link across devices with a single data structure. After the above processing, the instruction sequence framework is transformed into a cooperative control instruction set with unified encoding, clear order and consistent constraint logic.
[0123] Step S205: Perform time base calibration on the collaborative control instruction set to ensure that each collaborative control instruction maintains an executable sequential constraint relationship on the time axis, thereby obtaining collaborative control instructions for various sleep aid devices.
[0124] In this embodiment, although the collaborative control instruction set has completed parameter embedding and serialization, different sleep aid devices differ in execution mechanisms, response latency, and hardware processing cycles. If the instruction set is not calibrated with a unified time base, cross-device actions will be out of sync in the execution chain. Therefore, a time axis calibration mechanism needs to be introduced to form a unified reference framework in the time structure of the entire instruction set that can be synchronously parsed by multiple devices. Specifically, the execution start time and expected duration of all instruction nodes in the collaborative control instruction set are used as preliminary time markers. By identifying the collaborative, dependent, and mutually exclusive relationships between nodes, fine adjustments are made to time segments that conflict, overlap, or have unreasonable intervals, so that instructions within the same device remain continuous and instructions between different devices do not interfere with each other in rhythm. It should be noted that during the time base calibration process, priority is given to ensuring that the execution time of key control nodes does not shift across stages, and the start time of non-key nodes is slightly shifted when necessary, so that the entire instruction sequence forms a strict time constraint chain from front to back. After the above calibration process, the collaborative control instruction set is corrected into an executable instruction sequence with a unified time base and clear sequential dependencies.
[0125] Step S3: Send the collaborative control command to each sleep aid device through a remote communication channel, and make adaptive adjustments based on device feedback and external disturbances.
[0126] The specific steps of step S3 are as follows:
[0127] Step S301: The collaborative control instruction set is split according to the target device identifier, and a corresponding instruction fragment is generated for each sleep aid device.
[0128] In this embodiment, each instruction node in the collaborative control instruction set carries a preset device identifier field, which indicates which specific device should execute the node. Therefore, all instruction nodes can be traversed and grouped one by one using the device identifier as the classification key value, so that instruction nodes belonging to the same device are grouped into the same set. Then, within each set, the instruction nodes are rearranged according to the time order field, so that the instruction fragments corresponding to each device present a continuous execution structure from early to late, thereby ensuring that the devices can execute the instructions in chronological order when parsing them. It should be noted that during the splitting process, the original fields such as the action type, control amplitude, execution period and rhythm parameters of each node are retained without any parameter simplification or structural deformation, so that the split instruction fragments fully inherit the coordination logic already constructed in the collaborative control instruction set. After the above processing, the cross-device collaborative control instruction set is refined into multiple independent instruction fragments for a single device, so that each sleep aid device can directly receive the instruction set corresponding to its own execution path in the subsequent remote delivery steps.
[0129] Step S302: Send the instruction fragments one by one to each sleep aid device through the remote communication channel, and attach remote identification information to each instruction fragment during the sending process.
[0130] In this embodiment, collaborative control requires establishing a stable remote command transmission link between multiple sleep aid devices distributed in space. The command fragments obtained by device identification need to correspond one-to-one with specific physical devices. Therefore, during transmission, not only must data be pushed one by one, but identification information for remote identification and management must also be attached to each command fragment. Specifically, based on the sleep aid device's network access information, a unique remote address or session channel identifier can be assigned to each device. When encapsulating the command fragment into a transmittable data unit, the device identifier, command version number, batch number, and timestamp are written into the remote identification field so that the device can recognize the command at the receiving end. The system can identify the control round to which the instruction fragment belongs and its position in the overall collaborative link. Subsequently, the instruction fragments are sent one by one according to the device dimension through a preset remote communication channel (such as a local area network channel or a cloud forwarding channel). During the transmission process, a binding relationship between the instruction and the session channel is established based on the remote identification information, so that subsequent feedback data from the same device can be reverse-correlated based on the remote identification. It should be noted that the remote identification can also be reused and updated during this process, so that the collaborative control instructions of different batches can be clearly distinguished at the transmission level, ultimately forming a set of instruction fragments that have been marked with remote identification and can be independently parsed and executed by each sleep aid device.
[0131] Step S303: Receive device feedback information returned by each sleep aid device after executing the instruction segment, and generate a feedback record sequence based on the device feedback information.
[0132] In this embodiment, the behavior of the sleep aid device after executing the command needs to be continuously monitored to determine whether its execution deviates from expectations and to provide a basis for subsequent adaptive adjustments. Therefore, a complete feedback link needs to be constructed from the device-side information feedback to the central-side structured record: after each sleep aid device completes a certain action node of the command segment, it will return feedback information including the action completion status, execution time, hardware operating status, rhythm response status, and anomaly markers according to a preset feedback mechanism; to avoid cross-contamination of feedback data from different time periods and different devices, the returned data stream needs to be classified according to the device identifier and command version number so that the feedback can accurately correspond to the original command. Instruction fragments; after classification, each feedback data is sorted by its feedback timestamp, and fields such as action execution deviation, execution delay, amplitude deviation, and rhythm response difference are extracted and written into a unified format recording unit, so that the feedback from different devices can be aligned in parallel in structure; it should be noted that, in order to maintain the temporal continuity of the feedback, the time-sorted recording units will be recombined into a feedback record sequence, so that the sequence can present the behavior trajectory of the device in the execution process in a time axis manner; after the above processing, the discrete feedback information at the device end is integrated into a time-series feedback record sequence that can be used for subsequent disturbance detection, adaptive modulation, and execution offset analysis.
[0133] Step S304: Merge the feedback record sequence with the current external disturbance monitoring data, mark the device nodes that cause execution offset or action conflict, and generate intermediate adjustment parameters based on the marking results.
[0134] In this embodiment, the deviation of the device when executing coordinated control commands is often not from a single source, but is caused by the combined effect of the device's own execution error and external disturbances. Therefore, it is necessary to refer to the external disturbance monitoring data when analyzing the feedback record sequence so that the cause of the deviation can be accurately located and output in a parameterized form. Specifically, the feedback record sequence can first be aligned with the external disturbance monitoring data along the time axis, so that the feedback record containing information such as action delay, insufficient amplitude, and rhythm misalignment is correlated with the noise peak, ambient light change, abnormal body movement, or respiratory fluctuation data of the same period. Then, according to the preset deviation identification rules, the device feedback shows a delay in the execution period. Device nodes with amplitude deviations or unstable rhythms, and which are subject to external disturbance signals during the corresponding time period, are marked as offset nodes caused by disturbances. For nodes that do not detect external disturbances but show continuous deviations in feedback, they are marked as offset nodes executed by the device itself. After completing the node marking, the positional relationship, offset magnitude, and rhythm misalignment degree of the marked nodes in each device sequence are analyzed and converted into intermediate adjustment parameters for subsequent control adjustments. These parameters may include time correction, amplitude compensation, or rhythm phase correction. After the above processing, the multi-source offset information from the device end and the environment end is uniformly converted into structured intermediate adjustment parameters.
[0135] Step S305: Compare the intermediate adjustment parameters with the original cooperative control instruction set, rearrange or replace the parameters of the instruction nodes that involve execution offset or disturbance risk, and obtain the adaptive adjustment instruction set.
[0136] The specific steps of step S305 are as follows:
[0137] Step S3051: Classify and organize the intermediate adjustment parameters, and compare them one-to-one with the corresponding instruction nodes in the original collaborative control instruction set to determine the set of target instruction nodes to be adjusted.
[0138] In this embodiment, the intermediate adjustment parameters only provide an abstract description of the offset source and correction amount. To complete the instruction-level reprogramming, it is necessary to first clarify the specific instruction nodes in the collaborative control instruction set to which these adjustment amounts correspond. Therefore, the intermediate adjustment parameters need to be structurally classified and a mapping relationship established. Specifically, the intermediate adjustment parameters are first classified and organized according to their applicable dimensions (e.g., time correction, amplitude compensation, rhythm phase correction) so that offset information of the same type is aggregated in the same parameter group, so that they can be compared based on a consistent field structure when comparing instruction nodes. Then, using the instruction node timestamp, action type, and device identifier in the collaborative control instruction set as the main index, the adjustment parameters of each category are matched one by one with the instruction nodes of the corresponding time period and device, so that each intermediate adjustment parameter finds a target node in the instruction set that corresponds to it. It should be noted that, in order to avoid matching deviations due to different parameter update rounds, the version number or execution sequence number field of the instruction node is also referenced during the comparison process to ensure the accuracy of the mapping. After the above one-to-one comparison, the instruction nodes that correspond to the intermediate adjustment parameters can be extracted from the collaborative control instruction set, and these nodes constitute the target instruction node set to be adjusted.
[0139] Step S3052: Perform execution trajectory analysis on each instruction node in the target instruction node set, associate the execution time period and control amplitude of the instruction node with the execution logic of its preceding and following adjacent instruction nodes, and identify conflict locations that cause action deviation or rhythm disturbance.
[0140] In this embodiment, motion offsets and rhythmic disturbances are often not caused independently by a single instruction node, but rather by the combined effects of the node's execution position on the time axis, the way its control amplitude changes, and its logical connection with adjacent nodes. Therefore, it is necessary to perform execution trajectory-level analysis on each node in the target instruction node set to locate the specific conflict location causing the offset. Specifically, firstly, based on the execution time period of the instruction node, its time interval in the overall instruction sequence is analyzed, and the offset or rhythmic mismatch information of the same time period in the feedback record sequence is compared to confirm whether the node has a significant delay, advance, or amplitude abnormality on its execution trajectory. Subsequently, the control amplitude and rhythm of the node are analyzed. The parameters are associated with the logical relationships between their preceding and following nodes to identify discontinuities in amplitude transitions, rhythm phase alternations, or execution order. For example, amplitude changes between adjacent nodes may be too sudden, there may be a lack of transition intervals between rhythm phases, or the execution order may be inconsistent with the device priority. It should be noted that during this association process, the dependencies between nodes are also acquired to determine whether the offset of a node will cause subsequent node cascading offsets, thereby identifying nodes belonging to critical conflict positions. After the above analysis, conflict labels based on execution time period, amplitude trajectory, and rhythm transitions can be generated for each target instruction node to clarify which part of the instruction logic causes action offset or rhythm disturbance.
[0141] Step S3053: Based on the conflict location, offset the execution time period of the corresponding instruction node, replace the order of the control amplitude, or rearrange the execution order among multiple nodes to form a set of reconstructed instruction nodes that matches the intermediate adjustment parameters.
[0142] In this embodiment, the source of the offset is clearly indicated at the conflict location, and the intermediate adjustment parameters available for correction provide executable adjustment dimensions such as time period correction, amplitude compensation, or rhythm phase correction. Therefore, it is necessary to structurally reconstruct the corresponding instruction node for each conflict location so that the revised node is reintegrated into the cooperative control sequence and satisfies the logical relationship between the preceding and following parts: Specifically, for offsets caused by execution time period conflicts, the execution start time or duration of the node is shifted forward or backward according to the time correction amount given by the intermediate adjustment parameters, so that it falls back into the allowable range of the cooperative window; for conflicts caused by amplitude superposition or insufficient amplitude, the control amplitude recorded in the node is adjusted according to the pre-defined... The order replacement rule is adjusted to the amplitude level corresponding to the intermediate adjustment parameter, so that the amplitude change re-forms an amplitude distribution that can be distinguished from other nodes within this time period. In the case of rhythm conflict or sequence conflict, the execution order among multiple nodes can be rearranged so that interdependent or sequentially executed nodes return to the logically correct arrangement position, and their rhythm parameters are adjusted so that they form a rhythm chain that can be connected with the preceding and following nodes in terms of phase and period structure. It should be noted that after all adjustments are completed, the nodes that have undergone time offset, amplitude replacement or sequence rearrangement will be reorganized into a new set of reconstruction instruction nodes, so that the parameter attributes of this set are consistent with the intermediate adjustment parameter.
[0143] Step S3054: Combine the reconstructed instruction node set to generate an adaptive adjustment instruction set.
[0144] In this embodiment, the set of reconstructed instruction nodes generated by time offset, amplitude replacement, or sequence rearrangement only completes local corrections at the node level. To make these corrections effective in subsequent control processes, they need to be reintegrated into an adaptive adjustment instruction set that can be parsed by the device and maintains a continuous execution relationship on the time axis. Specifically, firstly, based on the execution time period and device identifier of each reconstructed node, the nodes are rearranged in chronological order, placing nodes in earlier time windows at the beginning of the sequence, while maintaining the rhythmic connection between nodes during the sorting process. Subsequently, the sorted nodes are structurally integrated, and the action type, control amplitude, rhythm parameters, and corrected time period boundaries are uniformly written into the instruction field. This ensures that the field format of each node is consistent with the collaborative control instruction set, thereby preventing parsing errors due to encoding differences when the instructions are sent to the device. It should be noted that when combining nodes, the logically dependent nodes can be appropriately fine-tuned according to the collaborative constraint rules between devices to ensure that the adaptive adjustment instruction set maintains the continuity of the logic and execution path in the overall structure. After the above processing, the originally loose node-level adjustment results are organized into an adaptive adjustment instruction set with a unified format, clear order, and executable boundaries, so that subsequent control flows can replace the corresponding parts of the original instruction set with the adjusted instruction set, thereby achieving closed-loop correction of execution offsets or disturbance responses.
[0145] Specifically, transcutaneous electrical nerve stimulation (TENS) technology is used to release low-frequency pulsed currents through electrodes on the skin surface, which stimulate nerve fibers, regulate the function of the nervous system, block nerve pain signals, and achieve auxiliary effects such as relieving discomfort and helping with sleep.
[0146] Example 2
[0147] Please see Figure 4 Another embodiment of the present invention provides: a sleep aid device linked to a remote control device based on the Internet of Things, comprising: a sleep state analysis module, an instruction generation module, and an instruction adjustment module;
[0148] The sleep state analysis module is used to collect the user's sleep-related data and analyze the user's sleep state based on the sleep-related data. The sleep-related data includes heart rate, respiration, body movement and environmental noise.
[0149] The instruction generation module generates collaborative control instructions for various sleep aid devices based on the sleep state. The collaborative control instructions include coordination parameters for adjusting the sequence and intensity of device actions.
[0150] The instruction adjustment module is used to send the collaborative control instructions to each sleep aid device through a remote communication channel, and to make adaptive adjustments based on device feedback and external disturbances.
[0151] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.
[0152] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for remotely controlling sleep aid devices based on the Internet of Things, characterized in that, include: Collect users' sleep-related data and analyze users' sleep status based on the sleep-related data, which includes heart rate, respiration, body movement and environmental noise; Based on the sleep state, collaborative control instructions for various sleep aid devices are generated, including coordination parameters for adjusting the sequence and intensity of device actions. The collaborative control commands are sent to each sleep aid device via a remote communication channel, and adaptive adjustments are made based on device feedback and external disturbances. Based on the sleep state, collaborative control instructions for various sleep aid devices are generated, including: Based on the sleep state, the target device group to participate in the collaborative control is determined from the preset set of sleep aid devices, and a corresponding collaborative participation identifier is assigned to each target device; The sleep state is associated with the historical action records of the target device group to generate a stage mapping sequence, and the initial control parameters of each target device are determined based on the stage mapping sequence. Cross-device correlation analysis is performed on the initial control parameters, and parameter combinations that have conflicting actions, overlapping times, or rhythmic interference are adjusted to obtain a set of coordinated parameters; Based on the set of coordination parameters, a cross-device control instruction structure is constructed, and the action instructions, execution order and control amplitude of each target device are combined according to a preset logic to form a collaborative control instruction set; The collaborative control instruction set is time-referenced to ensure that each collaborative control instruction maintains an executable sequential constraint relationship on the time axis, thereby obtaining collaborative control instructions for various sleep aid devices. The sleep state is associated with the historical action records of the target device group to generate a stage mapping sequence, and the initial control parameters of each target device are determined based on the stage mapping sequence, including: After identifying the target device group, the historical action records of each target device are organized in chronological order, and the sleep state is paired with the historical action records of the corresponding time period to obtain the original stage fragment. The original stage segments are filtered, and segments that exhibit the same movement pattern in different sleep stages are merged, and a stage mapping sequence is constructed based on the merging results. Arrange the mapping units in the stage mapping sequence according to the time axis, extract the action parameters contained in the mapping units by interval, and generate a set of action parameters in the current sleep state. Based on the set of motion parameters, assign initial control parameters corresponding to the motion trajectory of each target device; Cross-device correlation analysis is performed on the initial control parameters to adjust parameter combinations that have conflicting actions, overlapping times, or rhythmic interference, resulting in a set of coordinated parameters, including: The initial control parameters of each target device are classified and organized according to time interval and rhythm characteristics to construct a multi-dimensional parameter matrix; Based on the multidimensional parameter matrix, the initial control parameters of different target devices in the same or adjacent time intervals are compared item by item to identify parameter combinations with overlapping relationships and generate a list of conflicting parameters. For the conflict parameter list, based on the preset rhythm constraint rules and equipment priority rules, the initial control parameters in the conflict parameter combination are time-shifted, amplitude-leveled, or rhythm-rearranged to obtain the intermediate control parameter set; The intermediate control parameter set is subjected to consistency verification. Intermediate control parameters that satisfy the rhythm constraint rules and equipment priority rules are marked as coordination parameters. The coordination parameters are then rearranged to form a coordination parameter set. Based on the aforementioned coordination parameter set, a cross-device control command structure is constructed. The action commands, execution order, and control amplitude of each target device are combined according to preset logic to form a collaborative control command set, including: The coordination parameter set is split according to the device identifier, and a device-level parameter sequence containing action type, control amplitude and expected execution time is generated for each target device; Based on the sequence of parameters at each device level, action instructions belonging to the same time period or having adjacent execution relationships are arranged sequentially to generate an instruction sequence framework. In the instruction sequence framework, parameters are embedded for each action instruction, and the corresponding control amplitude, execution time period and device identifier are combined and written to the corresponding instruction node. The instruction sequence framework with embedded parameters is formatted, and each instruction node is combined into a collaborative control instruction set according to the time sequence and collaborative constraint relationship.
2. The method for remotely controlling sleep aid devices based on the Internet of Things as described in claim 1, characterized in that, The process of collecting users' sleep-related data and analyzing users' sleep states based on the sleep-related data includes: Collect users' sleep-related data and timestamp and preprocess the sleep-related data according to a preset sampling period; The preprocessed sleep-related data is divided into multi-channel data segments corresponding to the preset sleep analysis window, and a unique identifier is assigned to each data segment. Extract features from multi-channel data segments to form a corresponding set of multi-dimensional feature vectors; Based on the multidimensional feature vector set, a sleep feature sequence arranged in chronological order is constructed, and the feature vectors corresponding to adjacent sleep analysis windows are combined to form a temporal feature combination, which is used to characterize the evolution trend of the current sleep stage. The combined temporal features are input into a pre-established sleep state analysis model, which outputs sleep states that correspond one-to-one with each sleep analysis window. 3.The IoT-based sleep-aiding device linkage remote control method of claim 2, wherein, The combined temporal features are input into a pre-established sleep state analysis model, which outputs sleep states corresponding one-to-one with each sleep analysis window, including: The time-series feature combination is dimension-mapped and sequence-sorted according to a preset input format, and the mapped and sorted sequence is divided into input units corresponding to multiple sleep analysis windows. The input units are input one by one into a pre-established sleep state analysis model, and an intermediate state sequence is generated within the sleep state analysis model according to a preset state propagation rule. The intermediate state sequence is used to characterize changes in sleep stages. Window-level determination is performed on the intermediate state sequence, and the intermediate state corresponding to each sleep analysis window is associated with the intermediate states of its preceding and following adjacent windows to generate an association determination result. The association determination results are converted into sleep states that correspond one-to-one with each sleep analysis window, and the labels of the sleep states are bound to the corresponding temporal features in chronological order. 4.The IoT-based sleep-aiding device linkage remote control method of claim 3, wherein, The collaborative control commands are sent to each sleep aid device via a remote communication channel, and adaptive adjustments are made based on device feedback and external disturbances, including: The collaborative control instruction set is split according to the target device identifier, and a corresponding instruction fragment is generated for each sleep aid device; The instruction fragments are sent one by one to each sleep aid device through a remote communication channel, and remote identification information is attached to each instruction fragment during the transmission process; Receive device feedback information returned by each sleep aid device after executing the instruction segment, and generate a feedback record sequence based on the device feedback information; The feedback record sequence is merged with the current external disturbance monitoring data, the device nodes that cause execution offset or action conflict are marked, and intermediate adjustment parameters are generated based on the marking results; The intermediate adjustment parameters are compared with the original cooperative control instruction set, and the instruction nodes that involve execution offset or disturbance risk are rearranged or the parameters are replaced to obtain the adaptive adjustment instruction set. 5.The IoT-based sleep-aiding device linkage remote control method of claim 4, wherein, The intermediate adjustment parameters are compared with the original cooperative control instruction set, and the instruction nodes involved in the risk of execution offset or disturbance are rearranged or their parameters replaced to obtain an adaptive adjustment instruction set, including: The intermediate adjustment parameters are categorized and organized, and compared one-to-one with the corresponding instruction nodes in the original collaborative control instruction set to determine the set of target instruction nodes to be adjusted. Execution trajectory analysis is performed on each instruction node in the target instruction node set. The execution time period and control amplitude of the instruction node are associated with the execution logic of its preceding and following adjacent instruction nodes to identify conflict locations that cause action deviation or rhythm disturbance. Based on the conflict location, the execution time period of the corresponding instruction node is offset, the control amplitude is replaced by order, or the execution order between multiple nodes is rearranged to form a set of reconstructed instruction nodes that matches the intermediate adjustment parameters. The set of reconstructed instruction nodes is combined to generate an adaptive adjustment instruction set.
6. A remote control device for linking sleep aids based on the Internet of Things (IoT), used to implement the remote control method for linking sleep aids based on the IoT as described in any one of claims 1-5, characterized in that, include: Sleep state analysis module, instruction generation module, and instruction adjustment module; The sleep state analysis module is used to collect the user's sleep-related data and analyze the user's sleep state based on the sleep-related data. The sleep-related data includes heart rate, respiration, body movement and environmental noise. The instruction generation module generates collaborative control instructions for various sleep aid devices based on the sleep state. The collaborative control instructions include coordination parameters for adjusting the sequence and intensity of device actions. The instruction adjustment module is used to send the collaborative control instructions to each sleep aid device through a remote communication channel, and to make adaptive adjustments based on device feedback and external disturbances.
Citation Information
Patent Citations
Feature information extraction method and system of sleep state monitoring model
CN119498776A
Multi-device cooperative control method and device based on user state and air conditioner
CN120444722A