Plateau ecological cabin intelligent home control method based on infrared remote control learning
By using infrared remote control learning and dynamic protocol conversion, the problems of cumbersome operation and unstable network of infrared equipment in the plateau ecological cabin have been solved, realizing unified control and communication stability of multi-brand equipment and adapting to the complex plateau environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN ZHONGJIAN QIPEI TECH CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-14
AI Technical Summary
In the plateau ecological cabin, the existing centralized control method of infrared remote control equipment has problems such as cumbersome operation, unstable network signal, high system deployment complexity due to differences in equipment encoding formats, and lack of coordinated linkage when smart home devices operate independently.
The infrared remote control learning method is adopted. The infrared controller dynamically adjusts the transmission power and timing parameters, and combines iterative approximation mechanism for verification and solidified coding to achieve adaptive matching of the local protocol library. The ecological cabin central controller dynamically adjusts semantic parsing based on cabin status and historical command frequency, and automatically selects baud rate based on communication link quality to achieve unified control of the equipment.
It improves the success rate and accuracy of infrared code learning, reduces reliance on pre-set code libraries, achieves unified control and communication stability for multi-brand devices, and adapts to high-altitude environments with weak or no networks.
Smart Images

Figure CN122392291A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart home control technology, and more specifically, to a smart home control method for a plateau ecological cabin based on infrared remote control learning. Background Technology
[0002] The Plateau Smart Eco-cabin is a fully enclosed, pressurized living space primarily used in high-altitude scientific expeditions, border outposts, and high-altitude cultural tourism. The cabin typically integrates various infrared-controlled smart home devices, including air conditioning, humidifiers, lighting, a fresh air system, and an oxygen generator, to ensure basic living comfort for personnel in low-oxygen, low-pressure, and intense sunlight environments.
[0003] Currently, there are two main types of centralized control methods for multi-device infrared remote control. The first type relies on the independent remote control natively equipped with each device. This method allows direct control of a single device, without network dependence, and is intuitive. However, when there are many devices in the cabin, users need to switch between the corresponding remote controls for different devices, making the operation relatively cumbersome, and the storage and management of multiple remote controls is also inconvenient. The second type is a smart gateway solution based on cloud forwarding. This solution connects infrared devices from various brands to a unified cloud platform, allowing users to centrally control them via a mobile application or a central control screen. Under conditions of stable network coverage, this method provides a good user experience. However, in some areas of high-altitude regions, there is insufficient base station coverage, weak network signals, or disconnections. In such cases, the reliability of the cloud control method may be affected, and some control commands may not be issued or executed in a timely manner.
[0004] Furthermore, different brands and models of infrared devices employ different communication protocols. Common encoding formats include NEC protocol, RC series protocol, and PWM modulation format. Some existing centralized control systems have pre-installed infrared code libraries for specific brands of devices. When adding or replacing devices, if the encoding format of the new device is not in the pre-installed code library, customized modifications or replacement of the control system are required, which increases the complexity of system deployment and maintenance to some extent.
[0005] On the other hand, as a closed environment, the high-altitude ecological cabin requires that parameters such as air pressure, oxygen concentration, temperature, and humidity be maintained within specific ranges to ensure the safety and comfort of personnel. The regulation of these environmental parameters is typically accomplished by the cabin's pressurization and oxygenation system and temperature and humidity control system, while the smart home devices within the cabin (such as air conditioners and humidifiers) also possess environmental regulation capabilities. In existing solutions, these two systems often operate independently and have not yet achieved sufficient synergy. Therefore, this invention proposes a smart home control method for the high-altitude ecological cabin based on infrared remote control learning, aiming to solve the aforementioned problems. Summary of the Invention
[0006] To achieve the above objectives, the present invention provides the following technical solution: A smart home control method for a plateau ecological cabin based on infrared remote control learning includes the following steps: Infrared learning, verification, and solidification steps: The infrared controller retrieves candidate infrared codes and transmits verification signals to the target device with dynamically changing transmission power and timing parameters, while monitoring whether the target device performs the expected action; if the target device does not respond or responds abnormally, the transmission parameters of the verification signal are dynamically adjusted and retransmitted, while the waveform restoration parameters of the candidate infrared codes are corrected according to the response deviation, using an iterative approximation mechanism until the target device responds correctly; when multiple consecutive verifications yield correct responses, the finally confirmed coded data is solidified into a local infrared protocol library entry; if the verification fails within the set number of iterations, the encoding capture operation is automatically re-executed; Local command parsing and dynamic protocol conversion steps: After receiving local control commands, the central controller of the ecological cabin dynamically adjusts the semantic parsing weight model based on the current cabin operating status, historical command frequency, and environmental feedback. It maps the local control commands to a candidate set of device types and function key values, sorting them by confidence level. Based on the candidate set and the device-code mapping relationship in the local infrared protocol library, it dynamically selects matching code entries. Subsequently, it encapsulates the selected control code into an industrial fieldbus communication protocol command packet and dynamically negotiates communication parameters, automatically selecting the corresponding baud rate based on the communication link quality. Finally, it sends the protocol command packet to the infrared controller through a standard industrial communication interface.
[0007] In a preferred embodiment, a smart home control method for a plateau ecological cabin based on infrared remote control learning further includes an infrared signal transmission and execution step: after receiving the protocol instruction packet, the infrared controller parses and extracts the target infrared code, generates a corresponding infrared signal, and transmits it directionally to the target smart home device.
[0008] In a preferred embodiment, the infrared controller retrieving candidate infrared codes, transmitting verification signals to the target device with dynamically varying transmission power and timing parameters, and dynamically adjusting transmission parameters and retransmitting refer to: The infrared controller reads the candidate infrared coded waveform sequence obtained from the most recently learned data from the local memory. The waveform sequence consists of alternating carrier pulse durations and idle interval durations. The infrared controller transmits a verification signal with the initial transmit power and the initial carrier pulse duration, and monitors the response delay of the target device from receiving the verification signal to performing the expected action. If the target device does not respond, the transmission power is gradually increased by one-tenth of the maximum transmission power each time, while the carrier pulse duration is adjusted to 1.2 times the original duration, and then retransmitted. If the target device responds but its operation is abnormal, the carrier pulse duration is adjusted according to the absolute value of the deviation between the response delay duration and the expected delay duration, as follows: the adjustment factor of the carrier pulse duration is equal to one plus a preset proportional coefficient multiplied by the ratio of the absolute value of the deviation to the expected delay duration, where the preset proportional coefficient is greater than zero and less than or equal to 0.5. The device is retransmitted after each adjustment.
[0009] In a preferred embodiment, correcting the waveform restoration parameters of the candidate infrared code based on the response deviation and employing an iterative approximation mechanism until the target device responds correctly refers to: The infrared controller records the response of the target device after each verification transmission. The response results are divided into three categories: no response, abnormal response, or correct response. When the response result is abnormal, the infrared controller extracts the deviation between the actual action parameters and the expected action parameters of the target device. The infrared controller maps the deviation to the correction amplitude of the carrier pulse duration and the correction amplitude of the idle interval duration, respectively. The correction amplitude of the carrier pulse duration is equal to the deviation divided by the product of the preset scaling factor and the current carrier pulse duration, and the correction amplitude of the idle interval duration is equal to the deviation divided by the product of the preset scaling factor and the current idle interval duration. The infrared controller updates the waveform restoration parameters as follows: the duration of the carrier pulse in the next iteration is equal to the duration of the current carrier pulse multiplied by one minus the correction magnitude of the carrier pulse duration; the idle interval duration in the next iteration is equal to the duration of the current idle interval multiplied by one minus the correction magnitude of the idle interval duration. After each update, a verification signal is retransmitted until the target device responds correctly or the preset iteration limit is reached.
[0010] When automatically re-executing the encoding capture operation, the last corrected parameters are retained as the initial baseline for the next learning iteration, specifically: The waveform restoration parameters obtained from the last correction are used as the initial reference parameters after encoding and capture in the next learning process; the waveform restoration parameters include the values of carrier pulse duration and idle interval duration.
[0011] In a preferred embodiment, the weight model for dynamically adjusting semantic parsing by the central controller of the ecological cabin based on the current cabin operating status, historical command frequency, and environmental feedback refers to: The central controller of the ecological cabin maintains a semantic parsing weight matrix. The rows of the matrix correspond to each semantic parsing path, and the columns of the matrix include cabin state weight, historical frequency weight, and environmental feedback weight. For each semantic parsing path, the cabin state weight is determined by the absolute value of the deviation between the current cabin operating parameters and the preset ideal parameters. The historical frequency weight is equal to the number of times the semantic parsing path was successfully invoked within the past preset time period divided by the total number of invocations; the environmental feedback weight is equal to the response success rate of the device corresponding to the semantic parsing path within the most recent preset number of invocations. The central controller of the ecological cabin calculates the comprehensive weight value of each semantic parsing path according to the following formula: the comprehensive weight value is equal to the product of the cabin state weight and the first coefficient, plus the product of the historical frequency weight and the second coefficient, plus the product of the environmental feedback weight and the third coefficient, where the first coefficient, the second coefficient and the third coefficient are all positive numbers and the sum of the three is equal to one. The central controller of the ecological cabin normalizes the comprehensive weight value to the range of zero to one, which is used as the final semantic parsing weight for this semantic parsing path.
[0012] In a preferred embodiment, the ecological cabin central controller mapping local control commands to a candidate set of device types and function key values and sorting them by confidence level refers to: The central controller of the ecological cabin performs word segmentation and part-of-speech tagging on the received local control commands, extracting action verbs and object nouns from the commands; it performs string matching between the action verbs and the predefined function key value library; if no complete match is found, it calculates the edit distance similarity and selects entries with similarity exceeding the preset similarity threshold. The object nouns are matched against a predefined device type library in the same way to generate several candidate combinations of device types and function key values. For each candidate combination, the central controller of the ecological cabin retrieves the comprehensive weight value of the semantic parsing path corresponding to the candidate combination as the confidence level, and at the same time corrects the confidence level according to the online status of the equipment in the current cabin operation state: If the device type in the candidate combination is offline or faulty, the confidence level is multiplied by zero; if the device is in power-saving standby mode, the confidence level is multiplied by a preset discount factor, which is less than one. The central controller of the ecological cabin sorts all candidate combinations from high to low according to the corrected confidence level and outputs the sorted candidate set.
[0013] In a preferred embodiment, dynamically negotiated communication parameters refer to: The selected control code is filled into the data field according to the frame format of the industrial fieldbus communication protocol to generate the protocol instruction packet to be sent; During the encapsulation process, a dynamic negotiation process for communication parameters is initiated. This process includes sending a set of test data packets of a preset length to the infrared controller via a standard industrial communication interface and recording the response time and number of errors received. The quality of the communication link is calculated as follows: the link quality score is equal to one minus the ratio of the response time to the maximum allowed response time, and then minus the ratio of the number of bit errors to the total number of bits in the test data packet; Link quality scores of 0.7 or higher are classified as excellent, scores of 0.3 or higher but less than 0.7 are classified as average, and scores less than 0.3 are classified as poor. The baud rate corresponding to the link quality level is automatically selected.
[0014] The technical effects and advantages of this invention are as follows: This invention retrieves candidate infrared codes via an infrared controller, transmits verification signals to the target device with dynamically varying transmission power and timing parameters, and dynamically adjusts transmission parameters and corrects waveform restoration parameters when the device does not respond or responds abnormally. An iterative approximation mechanism is employed until the target device responds correctly, effectively improving the success rate and accuracy of infrared code learning. For infrared devices of different brands and standards, this invention eliminates the need for a pre-built code library, achieving code solidification through adaptive iterative correction, reducing learning failures caused by signal interference or coding deviations, and lowering the system's reliance on the device's native remote control and customized adaptations.
[0015] This invention utilizes a central controller in the ecological cabin to dynamically adjust the weight model of semantic parsing based on the current cabin operating status, historical command frequency, and environmental feedback. It maps local control commands to a candidate set of device types and function key values, sorting them by confidence level. This enables unified control and adaptive command parsing of multiple brands of devices in offline environments. Users do not need to distinguish between different remote controls; they can simply issue commands via voice or touch. The system dynamically matches coded entries from the local infrared protocol library to achieve unified management of various devices such as air conditioners, humidifiers, and lighting. This improves the cumbersome operation of multiple devices and avoids reliance on cloud networks, making it suitable for high-altitude, weak-network, or no-network scenarios.
[0016] This invention encapsulates selected control codes into industrial fieldbus communication protocol instruction packets and automatically selects the corresponding baud rate based on the communication link quality. Finally, it sends the packets to the infrared controller via a standard industrial communication interface, achieving dynamic negotiation of communication parameters. When the communication link quality changes, the system can adaptively adjust the transmission rate to ensure reliable delivery of instruction packets. Combined with the iterative approximation mechanism in infrared learning verification and solidification, this invention possesses dynamic adjustment capabilities at the code learning, instruction parsing, and signal transmission levels, enhancing the stability and robustness of the entire control link in complex high-altitude environments. Attached Figure Description
[0017] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings; Figure 1This is a schematic diagram of a smart home control method for a plateau ecological cabin based on infrared remote control learning, as described in this invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] Reference Figure 1 The following examples were obtained: Example 1: A smart home control method for a plateau ecological cabin based on infrared remote control learning, comprising the following steps: Infrared learning, verification, and solidification steps: The infrared controller retrieves candidate infrared codes and transmits verification signals to the target device with dynamically changing transmission power and timing parameters, while monitoring whether the target device performs the expected action; if the target device does not respond or responds abnormally, the transmission parameters of the verification signal are dynamically adjusted and retransmitted, while the waveform restoration parameters of the candidate infrared codes are corrected according to the response deviation, using an iterative approximation mechanism until the target device responds correctly; when multiple consecutive verifications yield correct responses, the finally confirmed coded data is solidified into a local infrared protocol library entry; if the verification fails within the set number of iterations, the encoding capture operation is automatically re-executed; Local command parsing and dynamic protocol conversion steps: After receiving local control commands, the central controller of the ecological cabin dynamically adjusts the semantic parsing weight model based on the current cabin operating status, historical command frequency, and environmental feedback. It maps the local control commands to a candidate set of device types and function key values, sorting them by confidence level. Based on the candidate set and the device-code mapping relationship in the local infrared protocol library, it dynamically selects matching code entries. Subsequently, it encapsulates the selected control code into an industrial fieldbus communication protocol command packet and dynamically negotiates communication parameters, automatically selecting the corresponding baud rate based on the communication link quality. Finally, it sends the protocol command packet to the infrared controller through a standard industrial communication interface.
[0020] A smart home control method for a plateau ecological cabin based on infrared remote control learning also includes the following steps: Learning Mode Trigger: Users can activate infrared learning mode via touchscreen operation on the eco-cabin's central control screen or by issuing an offline voice command. Upon receiving this command, the eco-cabin's central controller sends a learning trigger command to the infrared controller. Upon receiving the command, the infrared controller switches its operating state to encoding and capture mode and simultaneously activates the infrared receiving module to listen for infrared signals at a preset carrier frequency. This preset carrier frequency can be 38 kHz, as most infrared remote controls on the market use this frequency. This frequency is chosen because 38 kHz effectively avoids interference from natural light and electromagnetic interference from common electrical appliances, ensuring clear and usable infrared signals. For example, when a user points an air conditioner remote control at the infrared controller and presses the power button, the infrared controller can accurately capture the 38 kHz carrier signal.
[0021] Infrared Encoding Acquisition: The user points the remote control of the device to be learned at the infrared receiver of the infrared controller, and then presses the target function button on the remote control, such as the "cooling" button on an air conditioner remote control or the "on" button on a humidifier. The infrared controller captures the core encoded data in the infrared signal emitted by the remote control in real time. This core encoded data includes the carrier frequency, address code, command code, and pulse width. The carrier frequency is fixed at 38 kHz. The address code is used to distinguish different brands of devices, the command code is used to distinguish different buttons on the same remote control, and the pulse width records the duration of the high and low levels of the signal. The infrared controller is compatible with multiple infrared encoding formats, such as NEC format, air conditioner code format, RC5 format, RC6 format, and PWM format. Simultaneously, the infrared controller supports complete acquisition of multiple segments of encoding from a single button press. That is, when a button is pressed and emits multiple segments of encoding (for example, the temperature adjustment button on an air conditioner will simultaneously send two segments of encoding: mode and temperature setting), the infrared controller will record all segments completely. For example, if the user presses the "26 degrees cooling" button on an air conditioner remote control, the infrared controller will capture the mode encoding segment and the temperature encoding segment sequentially, without missing any segment.
[0022] Encoding Binding and Storage: The central controller of the eco-cabin binds the captured core encoded data one-to-one with specific device types and function commands. Device types refer to air conditioners, lights, humidifiers, electric curtains, etc., while function commands refer to specific operations such as switching on / off, temperature adjustment, dimming, and raising / lowering. Binding means that the central controller of the eco-cabin records a mapping relationship: for example, the combination of "air conditioner" and "cooling" corresponds to the captured string of infrared encoded data. After binding, the infrared controller stores these bound encoded data in local memory. Local memory is non-volatile, and data will not be lost after power failure. For example, after the user learns the "cooling" button of the air conditioner, the central controller of the eco-cabin will save a record in local memory: device type equals air conditioner, function command equals cooling, and infrared encoded data equals the captured string of binary data.
[0023] Multi-terminal command input: Users can input control commands locally in three ways: offline voice interaction, central control screen touch control, and host computer software debugging. All command transmission and execution are completed locally, without relying on an external network. Offline voice interaction works as follows: the user speaks a voice command, such as "turn on the living room air conditioner," and the offline voice interaction module converts the speech into a text command, which is then sent to the central controller of the eco-cabin. Central control screen touch control works as follows: the user directly clicks a virtual button on the central control screen, and the screen directly sends the corresponding command to the central controller of the eco-cabin. Host computer software debugging works as follows: maintenance personnel send debugging commands through computer software connected to the eco-cabin. For example, in an unattended high-altitude environment, a user can directly say "set the temperature to 26 degrees Celsius," without needing to use a mobile phone or network.
[0024] Infrared Signal Transmission and Execution: After receiving the protocol command packet from the central controller of the eco-cabin, the infrared controller parses and extracts the target infrared code from the packet. This target infrared code is the string of binary data stored during infrared learning, corresponding to the control signal for a specific function of a device. The infrared controller calls its internal infrared transmitting module, uses drive current to generate an infrared signal corresponding to this code, and then transmits the infrared signal directionally to the target smart home device. The target smart home device refers to all electrical appliances inside the eco-cabin that are controlled by infrared remote control, including air conditioners, lights, humidifiers, electric curtains, fresh air systems, oxygen concentrators, and booster units. The effective control distance of the infrared transmission is greater than or equal to eight meters, covering the entire enclosed space of the eco-cabin. For example, when the user issues the command "turn off the humidifier," the infrared controller extracts the infrared code for the humidifier's off function from the protocol command packet, then drives the infrared transmitter to emit the corresponding infrared signal in the direction of the humidifier. Upon receiving the signal, the humidifier will turn off.
[0025] It's important to note that the target smart home devices refer to all electrical appliances inside the eco-cabin that are controlled via infrared remote control signals. These devices include air conditioners, lights, humidifiers, electric curtains, fresh air systems, oxygen concentrators, booster units, dehumidifiers, air purifiers, etc. Each device has its own infrared receiving window. When the infrared signal emitted by the infrared controller is aligned with and covers the receiving window of these devices, the devices will execute the control commands carried in the signal. For example, the infrared receiving window of an air conditioner is usually located near the display panel of the indoor unit; the signal emitted by the infrared controller needs to illuminate this area to be received by the air conditioner.
[0026] The complete infrared learning process is as follows: First, the learning mode is triggered, putting the infrared controller into learning mode; then, infrared encoding capture is performed to obtain infrared encoding data from the remote control; next, encoding binding and storage are performed to associate the captured data with specific device functions and save it; finally, the infrared learning verification and solidification steps are performed. This step will send a verification signal to confirm whether the encoding is correct. If it is incorrect, it will be repeatedly corrected until it is correct. Then, the correct encoding is solidified into the local infrared protocol library entry. If multiple consecutive verifications are correct, it means that the learning is complete.
[0027] The complete local control process is as follows: First, multi-terminal command input is executed, where users issue commands via voice, touch, or debugging software; then, local command parsing and dynamic protocol conversion are performed, where the central controller of the eco-cabin performs semantic parsing of the commands, matches the encoding in the protocol library, encapsulates them into protocol command packets, and negotiates communication parameters; finally, infrared signal transmission and execution are performed, where the infrared controller converts the protocol command packets into infrared signals and transmits them to the target smart home device, which then performs the corresponding action upon receiving the signal.
[0028] The process of an infrared controller retrieving candidate infrared codes, transmitting verification signals to the target device with dynamically changing transmission power and timing parameters, and dynamically adjusting transmission parameters and retransmitting refers to: The infrared controller reads the most recently learned candidate infrared coded waveform sequence from its local memory. This waveform sequence consists of alternating carrier pulse durations and idle interval durations. For example, an NEC-formatted infrared coded waveform sequence might be: a carrier pulse duration of nine milliseconds, followed by an idle interval of four and a half milliseconds, then a carrier pulse duration of 0.5625 milliseconds, followed by an idle interval of 0.5625 milliseconds, and so on. The carrier pulse duration represents the length of time the infrared emitter is lit and transmitting a carrier signal, while the idle interval represents the length of time the infrared emitter is off and not transmitting a signal. These two durations, alternating, constitute a complete frame of infrared control signal.
[0029] The infrared controller uses an initial transmit power and an initial carrier pulse duration to transmit a verification signal. The initial transmit power is set to ensure that the infrared signal can be reliably received by the target device within an eight-meter range, while avoiding excessive power that could cause unnecessary energy consumption or signal reflection interference. Typically, the initial transmit power is set to 50% of the maximum transmit power.
[0030] The initial carrier pulse duration is set based on the pulse width standard of the most common infrared remote controls on the market. For example, the basic pulse width of one data bit in the NEC protocol is 0.5625 milliseconds, so the initial carrier pulse duration is also set to 0.5625 milliseconds. Simultaneously with transmitting the verification signal, the infrared controller begins monitoring the target device's response. Specifically, the infrared controller records the time from transmitting the verification signal to the target device performing the expected action; this time is called the response delay. For example, if the infrared controller transmits an "on" verification signal to an air conditioner and then waits for the air conditioner to beep and start operating, the time from transmitting the signal to hearing the beep is the response delay.
[0031] If the target device does not respond at all—that is, it does not perform any expected action or send any feedback signal—the infrared controller determines it as unresponsive. Possible causes of unresponsiveness include insufficient transmission power, preventing the infrared signal from reaching the target device, or a carrier pulse duration that is too short, causing the receiver to be unable to properly demodulate the signal. To address this issue, the infrared controller gradually increases the transmission power by one-tenth of the maximum power each time. For example, assuming the maximum transmission power is ten milliwatts, the first increase would reduce the power to one milliwatt (the original 0.5 milliwatts plus one milliwatt), the second to two milliwatts, and so on.
[0032] The infrared controller adjusts the carrier pulse duration to 1.2 times the original duration. For example, if the original carrier pulse duration was 0.5625 milliseconds, the adjusted duration becomes 0.675 milliseconds. After adjustment, the infrared controller retransmits the verification signal with the new transmission power and the new carrier pulse duration. This process can be repeated multiple times until the target device responds or the preset iteration limit is reached.
[0033] If the target device responds, but the response action does not meet expectations, this is called a response anomaly. For example, a user might transmit a "cooling" verification signal for an air conditioner, but the air conditioner executes "fan" mode; or a user might transmit a "medium humidity" signal for a humidifier, but the humidifier is set to "maximum humidity." The main cause of response anomalies is a mismatch between the carrier pulse duration and the pulse width required by the actual device. To correct this problem, the infrared controller needs to adjust the carrier pulse duration based on the deviation between the response delay and the expected delay. The expected delay is a reference value derived from extensive normal control experience; for example, for air conditioning, the expected delay from signal transmission to the air conditioner's feedback beep is typically 0.5 seconds. The infrared controller measures the actual response delay and then calculates the absolute value of the deviation—the absolute value of the actual value minus the expected value. The larger the absolute value of the deviation, the greater the pulse width deviation.
[0034] The carrier pulse duration is adjusted using the following formula: The adjustment factor for the carrier pulse duration equals one plus a preset proportional coefficient multiplied by the ratio of the absolute value of the deviation to the expected delay duration. The preset proportional coefficient is a number greater than zero and less than or equal to 0.5, for example, 0.3. For instance, assuming the expected delay duration is 0.5 seconds and the actual response delay duration is 0.8 seconds, then the absolute value of the deviation is 0.3 seconds, and the ratio of the absolute value of the deviation to the expected delay duration is 0.6. With a preset proportional coefficient of 0.3, the adjustment factor equals one plus 0.3 multiplied by 0.6, which equals one plus 0.18, which equals 1.18. In other words, the current carrier pulse duration needs to be multiplied by 1.18. If the original carrier pulse duration was 0.5625 milliseconds, then the adjusted duration is 0.5625 multiplied by 1.18, approximately 0.664 milliseconds. After adjustment, the infrared controller retransmits the verification signal using the new carrier pulse duration. If the response is normal, stop adjusting; if it is still abnormal, continue repeating this process, retransmitting after each adjustment, until the target device responds correctly or the preset iteration limit is reached. The preset iteration limit is usually set to five times, because if it is still abnormal after five rounds of adjustment, it indicates that the failure may be caused by other reasons, and the encoding and capture steps need to be restarted.
[0035] Correcting the waveform restoration parameters of candidate infrared codes based on response deviations and employing an iterative approximation mechanism until the target device responds correctly refers to: The infrared controller records the target device's response after each verification transmission. The response is categorized into three cases: First, no response, meaning the target device does nothing. Second, abnormal response, meaning the target device moves, but in the wrong way; for example, an air conditioner should be cooling but it's heating, or a humidifier should be on medium but it's on high. Third, correct response, meaning the target device performs the expected action. For example, if a user is learning the "26-degree cooling" function of an air conditioner, and after the infrared controller transmits a verification signal, the air conditioner starts cooling mode but the temperature is only 24 degrees Celsius, this would be considered an abnormal response.
[0036] When the response result is abnormal, the infrared controller extracts the deviation between the actual and expected action parameters of the target device. The actual action parameter is the value the device actually achieves, such as an actual temperature of 24 degrees Celsius. The expected action parameter is the value the user wants the device to reach, such as a desired temperature of 26 degrees Celsius. The deviation is the difference between these two values, expressed as an absolute value. Continuing the example above, with an actual temperature of 24 degrees Celsius and an expected temperature of 26 degrees Celsius, the deviation is two degrees. This deviation is used to calculate the subsequent correction range.
[0037] The infrared controller maps the deviation to corrections for the carrier pulse duration and idle interval duration. The correction for the carrier pulse duration is equal to the deviation divided by a preset scaling factor multiplied by the current carrier pulse duration. The correction for the idle interval duration is equal to the deviation divided by the same preset scaling factor multiplied by the current idle interval duration. It should be noted that the deviation is dimensionless before calculation; that is, it can be converted to a deviation ratio. The deviation ratio is equal to the deviation divided by a preset deviation reference value. This preset deviation reference value is determined by the type of device being learned; for example, it is five degrees Celsius for temperature control devices.
[0038] The preset scaling factor is a fixed value that ensures the correction range is neither too large nor too small, typically set to two or four. For example, assuming the current carrier pulse duration is 500 microseconds and the idle interval duration is 300 microseconds, with a preset scaling factor of two, the deviation ratio is 2:2. Therefore, the correction range for the carrier pulse duration is equal to two divided by two multiplied by 500, which is two divided by 1000, equaling 0.002. The correction range for the idle interval duration is equal to two divided by two multiplied by 300, which is two divided by 600, approximately equaling 0.0033. Both of these correction ranges are very small, ensuring that each adjustment is a fine-tuning, preventing large sudden changes.
[0039] The infrared controller updates the waveform restoration parameters as follows: the carrier pulse duration for the next iteration is equal to the current carrier pulse duration multiplied by (1) minus the correction magnitude for the carrier pulse duration. The idle interval duration for the next iteration is equal to the current idle interval duration multiplied by (1) minus the correction magnitude for the idle interval duration. This formula means that each iteration slightly reduces the current duration value by the calculated correction magnitude. Continuing the example above, the current carrier pulse duration is 500 microseconds, and the correction magnitude is 0.002. 1 minus 0.002 equals 0.998, so the next carrier pulse duration is 500 multiplied by 0.998, which equals 499 microseconds. The current idle interval duration is 300 microseconds, and the correction magnitude is 0.0033. 1 minus 0.0033 equals 0.9967, so the next idle interval duration is 300 multiplied by 0.9967, which equals 299 microseconds. As can be seen, by changing only a very small amount each time, the correct waveform parameters can be gradually approximated.
[0040] After each waveform restoration parameter update, the infrared controller retransmits a verification signal. Then, it observes the target device's response again. If the target device still responds abnormally, it continues to calculate the new deviation, correct the waveform restoration parameters, and retransmit the verification signal. This process repeats until the target device responds correctly or a preset iteration limit is reached. The preset iteration limit refers to the maximum number of correction attempts allowed, for example, a maximum of ten attempts. If there is still no correct response after ten attempts, the attempt stops and a learning failure is reported. This limit is set based on the assumption that if multiple fine-tuning attempts still fail, it indicates that the initial captured code may be faulty, or the remote control and the device being learned are incompatible, making further attempts pointless. For example, when a user is learning an old air conditioner, after five corrections, the air conditioner correctly responds to "cooling at 26 degrees Celsius," and the iteration ends successfully. If, after ten corrections, the air conditioner still only cools to 24 degrees Celsius, the iteration stops, and the system prompts the user to recapture the code.
[0041] When automatically re-executing the encoding capture operation, the last corrected parameters are retained as the initial baseline for the next learning iteration, specifically: The waveform restoration parameters obtained from the last correction are used as the initial reference parameters after encoded capture in the next learning process. These waveform restoration parameters include the carrier pulse duration and idle interval duration. During the learning, verification, and solidification process, if the infrared controller fails to pass verification after multiple consecutive corrections and has reached the preset iteration limit, it will automatically re-execute the encoded capture operation. Re-executing the encoded capture operation means that the user needs to point the remote control at the infrared controller again and press the same function button; the infrared controller will then re-capture the infrared code. However, this re-capture will not start from zero.
[0042] The infrared controller saves the waveform reconstruction parameters obtained from the last correction as the initial reference parameters after the encoding capture is completed in the next learning process. The waveform reconstruction parameters include the values of the carrier pulse duration and the idle interval duration. For example, when a user first learns the air conditioner's cooling function, it still fails after eight corrections. Before reaching the preset limit of ten iterations, the system recaptures the signal. The carrier pulse duration obtained in the last correction is 495 microseconds, and the idle interval duration is 298 microseconds. When the user presses the remote control button again, the infrared controller captures the new infrared code. It does not directly use the originally captured waveform parameters, but uses the previously saved 495 microseconds and 298 microseconds as the starting point to begin a new correction process.
[0043] The rationale for this approach is that the parameters obtained through multiple corrections during the initial learning process are already very close to the correct values. Using this approximate value directly after recapture significantly reduces the number of corrections required for the second learning iteration. The threshold setting is based on the fact that the preset upper limit for the number of iterations is generally set to ten to twenty. This is because, according to engineering statistics, the correction of most infrared codes can be completed within ten iterations. If it fails after more than ten iterations, it indicates that the original captured code may have a significant systematic deviation, making recapture more efficient than continued correction.
[0044] The ecological cabin central controller dynamically adjusts the semantic parsing weight model based on the current cabin operating status, historical command frequency, and environmental feedback. The central controller of the eco-cabin maintains a semantic parsing weight matrix. The rows of this matrix correspond to each semantic parsing path, that is, each possible way of understanding a command. The columns of the matrix include three types of weights: cabin state weight, historical frequency weight, and environmental feedback weight.
[0045] For each semantic parsing path, the cabin state weight is determined by the absolute value of the deviation between the current cabin operating parameters and the preset ideal parameters, as well as the direction of the action in that semantic parsing path. First, the absolute value of the deviation between the current cabin operating parameters and the preset ideal parameters is calculated. For example, if the preset ideal temperature is 24 degrees Celsius and the current actual temperature is 28 degrees Celsius, the absolute value of the deviation is 4 degrees Celsius. Then, it is determined whether the device action corresponding to this semantic parsing path can reduce this deviation. If the action can bring the cabin parameters closer to the ideal value, such as choosing to "turn on the air conditioning" when the temperature is too high, then the cabin state weight for this path is high. If the action cannot reduce the deviation or even increases it, such as choosing to "turn on the heating" when the temperature is too high, then the cabin state weight for this path is low. For paths that do not affect the parameter, such as those where the temperature deviation is unrelated to "turning on the lighting," an intermediate baseline weight is assigned.
[0046] When determining the weight values, a function of the absolute value of the deviation is used. Two commonly used functions are the linearly decreasing function and the exponentially decreasing function. Both functions apply to "beneficial action" paths; that is, the larger the absolute value of the deviation, the higher the weight; the smaller the absolute value of the deviation, the lower the weight. However, it's important to note that "high" and "low" here are relative to the magnitude of the deviation; in actual calculations, the weights are usually limited to between zero and one.
[0047] The linearly decreasing function means that the weight increases linearly with the increase of the absolute value of the deviation. The calculation formula is: cabin state weight equals the minimum weight plus the absolute value of the deviation divided by the product of the maximum expected deviation and the minimum weight. A more commonly used simplified form is: cabin state weight equals the absolute value of the deviation divided by the preset upper limit of the deviation. For example, if the upper limit of the temperature deviation is set to five degrees, when the absolute value of the deviation reaches five degrees or more, the weight is one; when the absolute value of the deviation is zero, the weight is zero; when the absolute value of the deviation is two degrees, the weight is two divided by five, i.e., 0.4. The larger the absolute value of the deviation, the greater the weight increases linearly. This preset upper limit of the deviation is set based on the human comfort perception range. The human body's sensitivity to temperature changes is approximately within plus or minus two degrees. Exceeding two degrees will cause noticeable discomfort. Therefore, setting the upper limit of the deviation to five degrees ensures that the weight reaches 0.4 when the deviation is two degrees and achieves full response when the deviation is five degrees.
[0048] The meaning of an exponentially decreasing function is that the weight increases exponentially with the increase of the absolute value of the deviation, with the growth rate being fast at first and then slowing down. The calculation formula is: cabin state weight equals 1 minus the negative absolute value of the deviation to the base of the natural constant e, divided by the power of the characteristic deviation. Or, in a simpler form: cabin state weight equals 1 divided by 1 plus e^(-k) multiplied by the absolute value of the deviation raised to the power of 1, where k is a coefficient controlling the steepness of the growth. For example, taking k equal to 1, the characteristic deviation is two degrees. When the absolute value of the deviation is zero, the weight equals 0.5. When the absolute value of the deviation is two degrees, the weight is approximately 0.88. When the absolute value of the deviation is four degrees, the weight is approximately 0.98. The advantage of the exponentially decreasing function (actually exponentially increasing, but usually called the logistic function) is that the weight changes sensitively when the deviation is small, and the weight approaches saturation when the deviation is large. The basis for setting this function is that the human body is already quite sensitive to slight deviations (one to two degrees), and the weight needs to be increased quickly; while when the deviation is large (more than four degrees), the weight is already close to the maximum value, and further increasing the deviation will not have much effect on increasing the weight, which is in line with the non-linear characteristics of human perception.
[0049] Specific application example: Assume the current cabin temperature is 30 degrees Celsius, the preset ideal temperature is 24 degrees Celsius, and the absolute deviation is 6 degrees Celsius. Using a linear decreasing function, the upper limit of the deviation is set to 5 degrees Celsius. Six degrees Celsius exceeds the upper limit, so the cabin state weight is set to 1. For the path "turn on the air conditioner to cool down," because its action direction is to lower the temperature, it is a beneficial action, so the final cabin state weight is 1. For the path "turn on the humidifier," because humidification does not affect the temperature, it is an irrelevant action, and is given a base weight of 0.5. For the path "turn on the heating," because its action direction is to raise the temperature, it will increase the deviation, and is a harmful action, so it is given a weight of 0. In the semantic parsing weight matrix, the cabin state weight of "turn on the air conditioner to cool down" is the highest, and the system will prioritize this path.
[0050] If we use an exponentially decreasing function, taking k = 0.8, and the characteristic deviation is two degrees, we calculate e^(-0.8) multiplied by the sixth power, which equals e^(-4.8), approximately 0.008. Therefore, the cabin state weight equals one divided by one plus 0.008, approximately 0.992, which is also very close to one. Both functions can achieve the effect of higher weight for larger deviations; the choice of which depends on the actual system's response characteristics. Linear functions are suitable for scenarios where the deviation and demand have a linear relationship, while exponential functions are suitable for scenarios where demand grows rapidly when the deviation is small.
[0051] The historical frequency weight is equal to the number of times this semantic parsing path was successfully invoked within a preset time period, divided by the total number of invocations. The preset time period is typically the most recent seven or thirty days. For example, if a user issued a total of one hundred commands in the past seven days, and the command "turn on the air conditioner" was successfully invoked thirty times, then the historical frequency weight of the "turn on the air conditioner" path would be 0.3. This weight reflects the user's usage habits; frequently used commands are more likely to be used again.
[0052] The environmental feedback weight is equal to the success rate of the device corresponding to this path within the most recent preset number of responses. The most recent preset number is generally the last ten responses. For example, if a humidifier responds successfully eight times and fails to respond twice in the last ten times it has been controlled, then the environmental feedback weight for the humidifier is 0.8. If a device frequently fails to respond, it may be malfunctioning or have poor infrared signal coverage, so its environmental feedback weight will be reduced, and the system will reduce the number of commands selected for that device.
[0053] The central controller of the ecological cabin calculates the comprehensive weight value of each semantic parsing path according to the following formula: the comprehensive weight value equals the cabin state weight multiplied by a first coefficient, plus the historical frequency weight multiplied by a second coefficient, plus the environmental feedback weight multiplied by a third coefficient. The first, second, and third coefficients are all positive numbers, and their sum equals one. These three coefficients are not arbitrarily set but are derived from empirical data from existing technologies. In the field of smart home control, the first coefficient (corresponding to the cabin state weight) is typically between 0.4 and 0.6, because the current cabin state has the most significant impact on command parsing. The second coefficient (corresponding to the historical frequency weight) is between 0.2 and 0.3, because user habits are an important but not decisive reference. The third coefficient (corresponding to the environmental feedback weight) is between 0.2 and 0.3, because the device response success rate reflects the system's reliability and also needs to be considered. A common setting is the first coefficient equal to 0.5, the second coefficient equal to 0.25, and the third coefficient equal to 0.25. The sum of these three coefficients is one. The settings are based on relevant technical literature on adaptive semantic understanding. Extensive experiments have demonstrated that this allocation method can ensure real-time response while taking into account user habits and device status.
[0054] After calculating the comprehensive weight value, the central controller of the ecological cabin normalizes the comprehensive weight value to the range of zero to one, which is then used as the final semantic parsing weight for this semantic parsing path. Normalization means dividing the comprehensive weight value of all paths by the largest of these values, making the largest one one, and proportionally reducing the others to between zero and one. For example, if the comprehensive weight values of three paths are 0.8, 0.4, and 0.2, after normalization they become 1, 0.5, and 0.25. This processing maintains the relative relationships between different paths, and each value is within the range of zero to one, facilitating subsequent use with confidence ranking.
[0055] The central controller of the eco-cabin maps local control commands to a candidate set of device types and function key values and sorts them by confidence level. The central controller of the eco-cabin performs word segmentation and part-of-speech tagging on the received local control commands. Word segmentation breaks down a complete command into individual words. For example, if a user says "turn on the living room air conditioner," the segmentation results in the words "turn on," "living room," and "air conditioner." Part-of-speech tagging assigns a grammatical type to each word. For instance, "turn on" is a verb, "living room" is a noun indicating a location, and "air conditioner" is a noun indicating a device. After these two steps, the central controller extracts action verbs and object nouns from these words. Action verbs are words indicating what to do, such as "turn on," "turn off," "adjust up," and "adjust down." Object nouns are words indicating which device to operate, such as "air conditioner," "humidifier," and "lighting."
[0056] The central controller of the eco-pod performs a string-by-string match between the extracted action verbs and a predefined function key-value library. This library contains all possible function verbs; for example, "open," "start," and "launch" all correspond to the same function key-value "open"; "close," "turn off," and "stop" all correspond to the function key-value "close." A complete match means that the Chinese characters of the action verb must be exactly the same as the entry in the library. If no complete match is found, the edit distance similarity is calculated. Edit distance refers to the minimum number of modifications required to transform one word into another. For example, changing "open" to "start" only requires modifying one character, resulting in an edit distance of one and a high similarity. The formula for calculating edit distance similarity is: similarity = one minus the edit distance divided by the longer of the two words. The central controller selects all entries with similarity exceeding a preset similarity threshold as the matching results.
[0057] The basis for setting this preset similarity threshold is that, according to actual tests, when the similarity is greater than 0.8, two words can basically be considered to have the same meaning. For example, when the user says "start the air conditioner", and in the function key value library there is "turn on", calculate the edit distance between "start" and "turn on": "start" has two characters, "turn on" has two characters, changing "start" to "turn on" requires one modification, the edit distance is 1, and the similarity is equal to 1 minus 1 divided by 2, which is 0.5. 0.5 is less than 0.8, so the match will not succeed. But if the user says "open", and in the library there is "turn on", "open" and "turn on" are different, "on" is the same, "open" has two characters, "turn on" has two characters, the edit distance is 1, and the similarity is also 0.5, still not matching. So in actual use, the similarity threshold needs to be adjusted according to the specific word library, usually set to 0.6 or 0.7. For example, when the user says "turn on the air conditioner", the action verb "turn on" exactly matches "turn on" in the library, and it succeeds directly, or predefined the user's personal word library, for example, according to the user's personal habits, replace all the "start" words in the basic word library with "turn on" words.
[0058] The central controller of the ecological cabin matches the extracted object nouns with the predefined device type library in the same way. The device type library stores all possible device names, such as "air conditioner", "lighting lamp", "humidifier", "curtain", "fresh air fan". The matching method is the same as above, first do an exact match, if there is no exact match, calculate the edit distance similarity and select the entries with similarity exceeding the preset similarity threshold. For example, when the user says "kong diao", and in the device type library there is "air conditioner", calculate the edit distance: for "kong diao" and "air conditioner", the first character is the same, both are "kong", the second character "diao" and "tiao" are different, the edit distance is 1, and the similarity is equal to 1 minus 1 divided by 2, which is 0.5. If the preset similarity threshold is 0.6, there will be no match; if the threshold is 0.5, the match will succeed. The basis for setting the threshold is: too high a threshold will miss the user's slips of the tongue or dialects, too low a threshold will mis-match to irrelevant devices, and usually 0.6 is used as the balance value.
[0059] After completing the matching of the action verb and the object noun, the central controller of the ecological cabin generates several candidate combinations of device types and function key values. For example, if the action verb matches the function key value "turn on", and the object nouns match two device types, "air conditioner" and "humidifier", then there are two candidate combinations: the first group is "air conditioner" plus "turn on", and the second group is "humidifier" plus "turn on". If there is only one object noun and the action verb matches multiple, multiple combinations will also be generated. For example, when the user says "open the air conditioner", the action verb "open" matches the function key value "turn on", and the object noun "air conditioner" matches the device type "air conditioner", only one candidate combination is generated.
[0060] For each candidate combination, the central controller of the eco-cabin retrieves the comprehensive weight value of the semantic parsing path corresponding to that candidate combination as the confidence level. This comprehensive weight value, calculated in the previous steps, reflects the probability that this semantic parsing path will be selected under the current cabin state. The confidence level is this comprehensive weight value, ranging from zero to one. For example, if the comprehensive weight value corresponding to the candidate combination "air conditioning plus on" is 0.85, then the confidence level is 0.85.
[0061] The central controller of the eco-cabin also adjusts the confidence level based on the online status of the devices in the current cabin operation. The adjustment rule is as follows: if a device in a candidate combination is offline or faulty, the confidence level is multiplied by zero. Because offline or faulty devices cannot respond, the confidence level becomes zero, and this candidate combination will not be selected. If a device is in energy-saving standby mode, the confidence level is multiplied by a preset discount factor, which is less than one. Energy-saving standby mode means that although the device is online, it is in a low-power standby mode and needs to be woken up before it can execute commands. Wake-up requires additional time, so a discount is applied. The discount factor is generally set between 0.5 and 0.9, with the specific value depending on the device's wake-up success rate. If the device wake-up success rate is very high, such as over 95%, the discount factor can be 0.9; if the wake-up success rate is average, it is 0.7. For example, in the candidate combination "air conditioning plus on", the air conditioner is in normal operation, no discount is needed, and the confidence level remains at 0.85. In the candidate combination "humidifier plus on", the humidifier is in energy-saving standby mode, and the discount factor is 0.8. If the original confidence level is 0.7, it will be corrected to 0.5 or 0.6.
[0062] The central controller of the eco-cabin sorts all candidate combinations from highest to lowest confidence level, and then outputs the sorted candidate set. The first candidate in the sorted set is the most likely to be correctly interpreted. For example, there are three candidate combinations: the first group, "air conditioner + on," with a confidence level of 0.85; the second group, "humidifier + on," with a confidence level of 0.56; and the third group, "lighting + on," with a confidence level of 0.30. The sorted output order would be air conditioner, humidifier, and lighting. Subsequent steps can directly use the first candidate combination for processing. If the first device is excluded due to being offline or other reasons, the system will automatically try the second candidate combination.
[0063] Dynamic negotiation of communication parameters refers to the process by which the central controller of the eco-cabin fills the selected control code into the data field according to the frame format of the industrial fieldbus communication protocol, generating a protocol command packet to be sent. There are many types of industrial fieldbus communication protocols, such as Modbus and abbreviated code protocols. Each protocol defines a fixed structure for a data frame, which includes the device address, function code, data field, and checksum. The selected control code is the specific instruction content to be sent, such as the binary data corresponding to "air conditioner on". The central controller of the eco-cabin places this control code into the data field, and then fills in other necessary fields to form a complete protocol command packet. For example, a data frame of the Modbus RTU protocol contains one byte of address, one byte of function code, several bytes of data, and two bytes of CRC checksum. Assuming the air conditioner's address is 0x01, the function code for turning on the air conditioner is 0x05, and the control code data is 0xFF00, then the resulting protocol command packet after filling will be 0105FF00 plus two checksum bytes.
[0064] Simultaneously with generating the protocol command packet, the central controller of the eco-cabin initiates a dynamic negotiation process for communication parameters. The first step of this dynamic negotiation process is to send a set of test data packets of a preset length to the infrared controller via a standard industrial communication interface, and record the response time and number of bit errors received. The standard industrial communication interface refers to an RS485 or RS232 interface. The preset length refers to the number of bits contained in the test data packet, typically one hundred or one thousand bits, which is sufficient to measure the basic quality of the communication link. After the central controller sends the test data packet, the infrared controller receives it and sends back an acknowledgment signal. The central controller records the time elapsed from the start of transmission to receiving the feedback; this time is called the response time. Simultaneously, the central controller compares the sent test data packet with the received feedback data packet, counting the differences; this number is called the number of bit errors. For example, if the central controller sends a one-thousand-bit test data packet, and the infrared controller sends back a one-thousand-bit data packet with two bits differing from the sent value, then the number of bit errors is two.
[0065] The link quality score is calculated using the following formula: Link quality score equals one minus the ratio of response time to the maximum allowed response time, and then minus the ratio of the number of bit errors to the total number of bits in the test data packet. The maximum allowed response time is a pre-set time limit based on the communication protocol and hardware performance, such as ten milliseconds. Dividing the response time by the maximum allowed response time yields a ratio; the smaller this ratio, the faster the communication. Dividing the number of bit errors by the total number of bits in the test data packet yields the bit error rate (BER); the lower the BER, the more accurate the communication. This ratio is also subtracted from the ratio, but the BER is directly subtracted from the score in the formula. The final link quality score is a value between zero and one. The closer the score is to one, the better the communication quality; the closer it is to zero, the worse the quality. For example, if the maximum allowed response time is ten milliseconds and the actual response time is two milliseconds, then the response time ratio is 0.2, and one minus 0.2 equals 0.8. If the total number of bits in the test data packet is one thousand bits, the number of bit errors is two, and the BER is 0.002. The link quality score equals 0.8 minus 0.002, which equals 0.798.
[0066] The central controller of the eco-cabin classifies communication links into three levels based on their link quality scores. A score of 0.7 or higher is considered excellent; a score of 0.3 or higher but less than 0.7 is considered average; and a score less than 0.3 is considered poor. These thresholds of 0.7 and 0.3 are based on extensive field test data. Test results show that when the score is above 0.7, the bit error rate remains below 0.01% even when using high baud rates, indicating highly reliable communication. When the score is below 0.3, using high baud rates causes the bit error rate to rise sharply to over 1%, severely impacting command reliability; therefore, the baud rate must be reduced to ensure successful communication. A score between 0.3 and 0.7 represents medium quality, and using a medium baud rate strikes a balance between speed and reliability. For example, a link with a score of 0.8 is excellent, a link with a score of 0.5 is average, and a link with a score of 0.2 is poor.
[0067] Based on the link quality level, the central controller of the eco-pod automatically selects the corresponding baud rate. Excellent level corresponds to the highest baud rate, average level to the middle baud rate, and poor level to the lowest baud rate. The specific baud rate value depends on the hardware capabilities of the communication interface; the common highest baud rate is 115,200 bits per second, the middle baud rate is 9,600 bits per second, and the lowest baud rate is 2,400 bits per second. The selection principle is: use a high rate to reduce command transmission time when the quality is good, and use a low rate to ensure no data loss when the quality is poor. For example, if the link quality score is 0.8, which is excellent, the central controller of the eco-pod selects a baud rate of 115,200 bits per second. If the score is 0.5, which is average, it selects 9,600 bits per second. If the score is 0.2, which is poor, it selects 2,400 bits per second. After selecting the baud rate, the central controller of the eco-pod uses this baud rate to send the previously generated protocol command packets to the infrared controller.
[0068] The above algorithms or formulas are all dimensionless and numerical calculations, and the results are obtained by software simulation based on a large amount of collected data to obtain the most recent real-world results. The preset parameters are set by those skilled in the art according to the actual situation.
[0069] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0070] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0071] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0072] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A smart home control method for a plateau ecological cabin based on infrared remote control learning, characterized in that, Includes the following steps: Infrared learning, verification, and solidification steps: The infrared controller retrieves candidate infrared codes, transmits verification signals to the target device with dynamically changing transmission power and timing parameters, and monitors whether the target device performs the expected action; If the target device does not respond or responds abnormally, the transmission parameters of the verification signal are dynamically adjusted and retransmitted. At the same time, the waveform restoration parameters of the candidate infrared code are corrected according to the response deviation, and an iterative approximation mechanism is used until the target device responds correctly. After multiple consecutive verifications receive correct responses, the finally confirmed encoded data is solidified into a local infrared protocol library entry; if the verification fails within the set number of iterations, the encoding and capture operation is automatically re-executed. Local command parsing and dynamic protocol conversion steps: After receiving local control commands, the central controller of the ecological cabin dynamically adjusts the semantic parsing weight model based on the current cabin operating status, historical command frequency, and environmental feedback. It maps the local control commands to a candidate set of device types and function key values, sorting them by confidence level. Based on the candidate set and the device-code mapping relationship in the local infrared protocol library, it dynamically selects matching code entries. Subsequently, it encapsulates the selected control code into an industrial fieldbus communication protocol command packet and dynamically negotiates communication parameters, automatically selecting the corresponding baud rate based on the communication link quality. Finally, it sends the protocol command packet to the infrared controller through a standard industrial communication interface.
2. The method for intelligent home control of a plateau ecological cabin based on infrared remote control learning according to claim 1, characterized in that, It also includes infrared signal transmission and execution steps: after receiving the protocol instruction packet, the infrared controller parses and extracts the target infrared code, generates the corresponding infrared signal, and transmits it in a directional manner to the target smart home device.
3. The method for intelligent home control of a plateau ecological cabin based on infrared remote control learning according to claim 2, characterized in that, The process of an infrared controller retrieving candidate infrared codes, transmitting verification signals to the target device with dynamically changing transmission power and timing parameters, and dynamically adjusting transmission parameters and retransmitting refers to: The infrared controller reads the candidate infrared coded waveform sequence obtained from the most recently learned data from the local memory. The waveform sequence consists of alternating carrier pulse durations and idle interval durations. The infrared controller transmits a verification signal with the initial transmit power and the initial carrier pulse duration, and monitors the response delay of the target device from receiving the verification signal to performing the expected action. If the target device does not respond, the transmission power is gradually increased by one-tenth of the maximum transmission power each time, while the carrier pulse duration is adjusted to 1.2 times the original duration, and then retransmitted. If the target device responds but its operation is abnormal, the carrier pulse duration is adjusted according to the absolute value of the deviation between the response delay duration and the expected delay duration, as follows: the adjustment factor of the carrier pulse duration is equal to one plus a preset proportional coefficient multiplied by the ratio of the absolute value of the deviation to the expected delay duration, where the preset proportional coefficient is greater than zero and less than or equal to 0.
5. The device is retransmitted after each adjustment.
4. The method for intelligent home control of a plateau ecological cabin based on infrared remote control learning according to claim 3, characterized in that, Correcting the waveform restoration parameters of candidate infrared codes based on response deviations and employing an iterative approximation mechanism until the target device responds correctly refers to: The infrared controller records the response of the target device after each verification transmission. The response results are divided into three categories: no response, abnormal response, or correct response. When the response result is abnormal, the infrared controller extracts the deviation between the actual action parameters and the expected action parameters of the target device. The infrared controller converts the deviation into a dimensionless deviation ratio, which is equal to the deviation divided by a preset deviation reference value. The preset deviation reference value is determined by the type of the device being learned; for temperature control devices, it is five degrees Celsius, and for humidity control devices, it is 20%. The infrared controller calculates the correction range of the carrier pulse duration and the correction range of the idle interval duration according to the deviation ratio. The correction range of the carrier pulse duration is equal to the deviation ratio multiplied by the first preset ratio coefficient, and the correction range of the idle interval duration is equal to the deviation ratio multiplied by the second preset ratio coefficient. Both the first preset ratio coefficient and the second preset ratio coefficient are positive numbers that are greater than zero and less than or equal to 0.
5. The infrared controller updates the waveform restoration parameters as follows: the duration of the carrier pulse in the next iteration is equal to the duration of the current carrier pulse multiplied by one minus the correction magnitude of the carrier pulse duration; the idle interval duration in the next iteration is equal to the duration of the current idle interval multiplied by one minus the correction magnitude of the idle interval duration. After each update, a verification signal is retransmitted until the target device responds correctly or the preset iteration limit is reached.
5. The method for intelligent home control of a plateau ecological cabin based on infrared remote control learning according to claim 1, characterized in that, When automatically re-executing the encoding capture operation, the last corrected parameters are retained as the initial baseline for the next learning iteration, specifically: The waveform restoration parameters obtained from the last correction are used as the initial reference parameters after encoding and capture in the next learning process; the waveform restoration parameters include the values of carrier pulse duration and idle interval duration.
6. The method for intelligent home control of a plateau ecological cabin based on infrared remote control learning according to claim 5, characterized in that, The ecological cabin central controller dynamically adjusts the semantic parsing weight model based on the current cabin operating status, historical command frequency, and environmental feedback. The central controller of the ecological cabin maintains a semantic parsing weight matrix. The rows of the matrix correspond to each semantic parsing path, and the columns of the matrix include cabin state weight, historical frequency weight, and environmental feedback weight. For each semantic parsing path, the cabin state weight is determined by the absolute value of the deviation between the current cabin operating parameters and the preset ideal parameters; The historical frequency weight is equal to the number of times the semantic parsing path was successfully invoked within a preset time period in the past, divided by the total number of invocations. The environmental feedback weight is equal to the response success rate of the device corresponding to the semantic parsing path within the most recent preset number of responses; The central controller of the ecological cabin calculates the comprehensive weight value of each semantic parsing path according to the following formula: the comprehensive weight value is equal to the product of the cabin state weight and the first coefficient, plus the product of the historical frequency weight and the second coefficient, plus the product of the environmental feedback weight and the third coefficient, where the first coefficient, the second coefficient and the third coefficient are all positive numbers and the sum of the three is equal to one. The central controller of the ecological cabin normalizes the comprehensive weight value to the range of zero to one, which is used as the final semantic parsing weight for this semantic parsing path.
7. A smart home control method for a plateau ecological cabin based on infrared remote control learning according to claim 6, characterized in that, The central controller of the eco-cabin maps local control commands to a candidate set of device types and function key values and sorts them by confidence level. The central controller of the ecological cabin performs word segmentation and part-of-speech tagging on the received local control commands, extracting action verbs and object nouns from the commands; it performs string matching between the action verbs and the predefined function key value library; if no complete match is found, it calculates the edit distance similarity and selects entries with similarity exceeding the preset similarity threshold. The object nouns are matched against a predefined device type library in the same way to generate several candidate combinations of device types and function key values. For each candidate combination, the central controller of the ecological cabin retrieves the comprehensive weight value of the semantic parsing path corresponding to the candidate combination as the confidence level, and at the same time corrects the confidence level according to the online status of the equipment in the current cabin operation state: If the device type in the candidate combination is offline or faulty, the confidence level is multiplied by zero; if the device is in power-saving standby mode, the confidence level is multiplied by a preset discount factor, which is less than one. The central controller of the ecological cabin sorts all candidate combinations from high to low according to the corrected confidence level and outputs the sorted candidate set.
8. A smart home control method for a plateau ecological cabin based on infrared remote control learning according to claim 7, characterized in that, Dynamically negotiated communication parameters refer to: The selected control code is filled into the data field according to the frame format of the industrial fieldbus communication protocol to generate the protocol instruction packet to be sent; During the encapsulation process, a dynamic negotiation process for communication parameters is initiated. This process includes sending a set of test data packets of a preset length to the infrared controller via a standard industrial communication interface and recording the response time and number of errors received. The quality of the communication link is calculated as follows: the link quality score is equal to one minus the ratio of the response time to the maximum allowed response time, and then minus the ratio of the number of bit errors to the total number of bits in the test data packet; Link quality scores of 0.7 or higher are classified as excellent, scores of 0.3 or higher but less than 0.7 are classified as average, and scores less than 0.3 are classified as poor. The baud rate corresponding to the link quality level is automatically selected.