A communication baud rate self-adaptive adjusting method for OTA upgrade of an electric control system
By adaptively adjusting the baud rate of the electronic control system's OTA upgrade, the problems of long upgrade time and high error rate caused by fixed baud rate are solved, achieving efficient and reliable upgrades in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI ZHIMEI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-12
AI Technical Summary
In existing OTA upgrades of electronic control systems, the fixed baud rate communication method cannot balance upgrade efficiency and communication reliability, resulting in long upgrade times or high error rates in complex electromagnetic environments, or even upgrade failure.
An adaptive baud rate adjustment method is adopted, which dynamically adjusts the baud rate through environmental feature perception, multi-dimensional operation indicator monitoring and fusion evaluation, gear determination within the hysteresis interval and binary search algorithm. Combined with a dynamic blacklist and confidence decay mechanism, adaptive baud rate adjustment is achieved.
While ensuring data transmission reliability, we maximize upgrade efficiency, avoid repeated oscillations around the baud rate, and improve the stability and efficiency of the upgrade process.
Smart Images

Figure CN122204239A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of firmware upgrade technology for electronic control systems, and in particular to an adaptive adjustment method for communication baud rate for OTA upgrades of electronic control systems. Background Technology
[0002] In the field of over-the-air (OTA) firmware upgrade technology for electronic control systems, OTA upgrades have become a key means for the maintenance and functional iteration of embedded devices. However, existing technical solutions generally adopt a fixed baud rate communication method. This static configuration mode has significant drawbacks: on the one hand, while using a lower fixed baud rate can ensure the reliability of data transmission in complex electromagnetic environments, it leads to a lengthy upgrade process, severely impacting the user experience; on the other hand, while using a higher fixed baud rate can shorten the upgrade time, the bit error rate will rise sharply in harsh environments with electromagnetic interference or signal attenuation, easily causing data packet loss or corruption, or even upgrade failure, rendering the device unusable. Furthermore, fixed baud rate solutions lack the ability to perceive and adapt to the actual communication environment and cannot dynamically optimize based on real-time link quality, making it difficult to balance upgrade efficiency and communication reliability in different deployment scenarios. Summary of the Invention
[0003] To address the aforementioned shortcomings, the present invention aims to propose an adaptive baud rate adjustment method for over-the-air (OTA) upgrades of electronic control systems. This method achieves adaptive dynamic adjustment of the communication baud rate during OTA upgrades by constructing a baud rate initialization mechanism based on environmental feature perception, a real-time monitoring and fusion evaluation system for multi-dimensional operating indicators, an intelligent gear determination strategy within the hysteresis interval, a baud rate gear locking mechanism optimized by a binary search algorithm, and a failure gear management strategy based on a dynamic blacklist and confidence decay. This maximizes upgrade efficiency while ensuring data transmission reliability and avoids repeated oscillations near the critical baud rate.
[0004] To achieve this objective, the present invention adopts the following technical solution: An adaptive baud rate adjustment method for over-the-air (OTA) upgrades of electronic control systems includes: The system acquires environmental characteristic information of the current communication environment, retrieves historical communication parameters that match the environmental characteristic information, determines the initial communication baud rate based on the retrieval results, establishes an OTA upgrade link based on the initial communication baud rate, and collects operational indicators in real time using a sliding window during data transmission. The operating indicators are fused and calculated to generate a comprehensive quality score. Based on the comprehensive quality score, it is determined whether to trigger a gear adjustment within a preset hysteresis interval. When it is determined that a gear adjustment is triggered, a binary search algorithm is used to lock the target baud rate gear within a preset baud rate candidate space. Initiate a switching request including the target baud rate level, and after receiving a response signal, control both communicating parties to synchronously execute the baud rate change, and perform a switching validity verification at the changed baud rate; Baud rate levels that meet preset failure conditions are added to a dynamic blacklist, and a confidence mechanism that decays over time is used to manage the retry access permissions of each level in the dynamic blacklist. When the OTA upgrade task is completed, the current stable baud rate level, dynamic blacklist status, and the environmental feature information are associated and saved for subsequent retrieval.
[0005] Preferably, the operational metrics include data confirmation status, signal strength, transmission delay, and retransmission frequency.
[0006] Preferably, establishing an OTA upgrade link based on the initial communication baud rate and collecting operational metrics in real time using a sliding window during data transmission includes: Obtain the transmission timestamp of the data packet to be transmitted at the transport layer, and obtain the acknowledgment timestamp when the corresponding response signal is received. Calculate the difference between the two to extract the single transmission delay in the operation metrics. Monitor the verification error flags and response timeout status during a single data interaction process, and count the frequency of abnormal interactions within a preset window period to extract the real-time packet loss rate from the operational metrics. The received signal strength of the current link is obtained by reading the physical layer communication interface, and the transmission efficiency index in the operation index is extracted by combining the data throughput per unit time at the current baud rate. The extracted operational indicators of each dimension are sequentially stored into the storage units of the sliding window according to the time series, and a decay coefficient is assigned to each storage unit according to the storage order of each storage unit relative to the current time, so that the weight of the operational indicators in the sliding window decreases over time.
[0007] Preferably, the process of integrating and calculating the operational indicators to generate a comprehensive quality score includes: The various operational metrics stored in the sliding window are normalized to map metrics of different dimensions to a unified numerical range. Constructing a comprehensive quality score The weighted evaluation model Satisfying the relation: ; in, This indicates the total number of dimensions for the operational metrics. Indicates the first The impact weights corresponding to dimensional performance metrics. Indicates the first The steady-state score of the dimensional performance indicator within the sliding window; The steady-state score By normalizing the values of each sampling point within the window Obtained by execution time weighted calculation. Satisfying the relation: ; in, Indicates the sampling size of the sliding window. This represents the attenuation coefficient allocated according to the storage order; Based on the comprehensive quality score The sampling scale is dynamically adjusted based on the calculation results and their volatility within a preset time period. and the attenuation coefficient The slope of the distribution.
[0008] Preferably, determining whether to trigger gear adjustment based on the comprehensive quality score within a preset hysteresis range includes: Obtain the gear shifting frequency within a preset time period before the current moment, and calculate the oscillation correction factor based on the shifting frequency; If the comprehensive quality score Greater than the upshift determination threshold Then, based on the duration period count required for the dynamic extension of the oscillation correction factor, the comprehensive quality score is calculated. The first derivative is used to obtain the environmental change rate bias; When the environmental change rate deviation is non-negative and the comprehensive quality score meets the extended duration count, an upgrade adjustment is triggered. If the comprehensive quality score Less than the downgrade determination threshold If the current data transmission triggers a preset number of consecutive failures, then the downgrade step size is determined based on the absolute value of the environmental change rate deviation. If the absolute value of the environmental change rate deviation exceeds the preset change threshold, it is determined that the current baud rate level will be directly downgraded to the preset safe backup level; otherwise, it is determined that a step-by-step downgrade adjustment will be triggered. After performing any gear adjustment action, a viewing window of a preset duration is opened, and the current baud rate gear is locked within the viewing window, preventing the triggering of upshift requests.
[0009] Preferably, locking the target baud rate level within a preset baud rate candidate space using a binary search algorithm includes: Obtain the list of selectable baud rate levels that are not included in the dynamic blacklist within the baud rate candidate space, and determine the current lower search limit index and the current upper search limit index of the selectable baud rate level list; Calculate the midpoint between the current search lower limit index and the current search upper limit index to determine the test level, and use the switching request to attempt to switch to the test level; If the communication quality under the test level meets the preset stability threshold, then the current search lower limit index is updated to the test level, and the test level is marked as the known best stable level. If the communication quality under the test level does not meet the preset stable threshold or the switching fails, the current search upper limit index is updated to the previous index of the test level, and the test level is added to the dynamic blacklist. Repeat the intermediate position calculation and index update steps until the difference between the current upper search limit index and the current lower search limit index is less than the preset step threshold, and finally lock the known best stable position as the target baud rate position.
[0010] Preferably, performing handover validity verification at the changed baud rate includes: After both parties in the control communication perform a baud rate change, a verification timer of a preset duration is started, and the system enters a pending confirmation state. In the pending confirmation state, a probe frame including a preset sequence is sent using the changed baud rate, and the feedback signal of the communication bus is monitored in real time. If an acknowledgment response matching the probe frame is received before the verification timer reaches zero, the switch is deemed valid, the current baud rate is maintained, and the verification timer is cleared. If no valid confirmation response is received when the verification timer reaches zero, or if a continuous overflow exception is detected by the hardware layer during the verification process, the switch is deemed invalid, and an automatic rollback process is triggered to restore the baud rate level to the level before the change.
[0011] Preferably, managing retry access permissions for each tier in the dynamic blacklist using a confidence mechanism that decays over time includes: Obtain the initial confidence score corresponding to the tier included in the dynamic blacklist, and record the most recent failure timestamp of the tier in the dynamic blacklist when communication anomalies occurred. Monitor the duration of the current system clock relative to the most recent failure timestamp, and calculate the confidence decay based on the duration, so as to obtain the current real-time confidence by subtracting the confidence decay from the initial confidence score; If the real-time confidence level is lower than a preset admission threshold, the corresponding baud rate level is removed from the dynamic blacklist and allowed to re-participate in the search of the baud rate candidate space. If the gear triggers the failure condition again after re-engaging in communication, the initial confidence score for its next inclusion in the blacklist will be increased exponentially based on the failure frequency.
[0012] Preferably, associating and saving the current stable baud rate setting, dynamic blacklist status, and environmental feature information includes: Obtain the final baud rate level at the end of this OTA upgrade task, and extract the real-time confidence level and failure frequency count of each baud rate level in the dynamic blacklist. The final baud rate setting, the real-time confidence level, and the failure frequency count are encapsulated into a communication quality feature set, and then bound to the environmental feature information through multi-dimensional mapping. The bound communication quality feature set and the environmental feature information are written into the preset address space of the non-volatile storage area to construct a parameter search index for different communication scenarios; When a subsequent OTA upgrade task is initiated, the communication quality feature set that matches the real-time acquired environmental feature information in the non-volatile storage area is matched first, and the initial state of the initial communication baud rate and dynamic blacklist is restored accordingly.
[0013] One of the above technical solutions has the following advantages or beneficial effects: This invention determines the initial communication baud rate by acquiring environmental characteristics of the current communication environment and retrieving matching historical communication parameters. This allows the system to quickly converge to a better starting baud rate suitable for the current scenario based on past experience, avoiding the time overhead of blind trial and error. Secondly, during data transmission, a sliding window is used to collect operational indicators in real time, and these indicators are fused and calculated to generate a comprehensive quality score, thereby achieving a comprehensive quantitative perception of the communication link status and providing a reliable basis for subsequent decision-making. By determining whether to trigger baud rate adjustment within a preset hysteresis interval and using a binary search algorithm to lock the target baud rate ... The system employs a complex switching mechanism, significantly reducing the number of iterations for baud rate searching through binary search. By initiating a switching request and controlling both communicating parties to synchronously execute baud rate changes, coupled with a switching validity verification mechanism, reliable baud rate adjustments and fallback capabilities are ensured. By adding failed baud rates to a dynamic blacklist and managing their retry access permissions using a confidence mechanism that decays over time, the system can learn and remember the communication boundaries of the current environment, avoiding repeated attempts at unstable baud rate levels that could cause oscillations during the upgrade process. Finally, by associating and saving the current stable baud rate level, dynamic blacklist status, and environmental characteristic information at the end of the OTA upgrade task, a knowledge accumulation mechanism for different communication scenarios is constructed, enabling subsequent upgrade tasks to reuse historical experience for faster convergence. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0015] Figure 1 This is a flowchart of a communication baud rate adaptive adjustment method for OTA upgrade of an electronic control system provided in an embodiment of the present invention. Detailed Implementation
[0016] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0017] In this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0018] An adaptive baud rate adjustment method for over-the-air (OTA) upgrades of electronic control systems, such as... Figure 1 As shown, a preferred embodiment of the present invention is illustrated using a system capable of implementing the adaptive adjustment method for communication baud rate in OTA upgrades of electronic control systems, comprising the following steps: S1: Obtain the environmental characteristic information of the current communication environment, retrieve the historical communication parameters that match the environmental characteristic information, determine the initial communication baud rate based on the retrieval results, establish an OTA upgrade link based on the initial communication baud rate, and collect operating indicators in real time using a sliding window during data transmission. It should be noted that environmental characteristic information refers to a multi-dimensional set of parameters that characterize the attributes of the current communication scenario, including but not limited to device model, firmware version, geographic location identifier, deployment environment type (such as industrial environment, home environment, vehicle environment), time period information, and historical communication quality level. This information is used to distinguish different communication scenarios to match corresponding historical experience data. Historical communication parameters refer to the optimal communication configuration data accumulated from past OTA upgrade tasks and associated with specific environmental characteristic information, which are pre-saved by the system in the non-volatile storage area. This includes information such as stable baud rate levels, dynamic blacklist status, and failure frequency of each level. Its role is to provide experience reference for newly launched upgrade tasks to achieve rapid convergence. The initial communication baud rate refers to the first communication rate value used in the OTA upgrade link establishment phase. The selection of this value directly affects the success or failure of link establishment and the starting position of subsequent adaptive adjustments. The OTA upgrade link refers to a bidirectional data channel established between the main controller and the electronic control unit to be upgraded based on a specific communication protocol for transmitting firmware upgrade data. The stability of the link determines whether the upgrade data can be delivered to the target device completely and reliably. A sliding window is a time-series data management structure that uses a fixed-capacity or fixed-duration storage unit to cyclically record the latest collected operational metrics data. As new data arrives, the oldest data is removed, thus dynamically tracking the recent communication status. Operational metrics refer to various parameters used to quantitatively evaluate the quality of communication links, including but not limited to data acknowledgment status, signal strength, transmission delay, and retransmission frequency. These metrics provide a data foundation for subsequent communication quality assessment and baud rate adjustment decisions.
[0019] Understandably, by acquiring environmental characteristic information and retrieving matching historical communication parameters, the system can identify the current communication scenario type and directly utilize the baud rate configuration experience accumulated from past successful upgrades in that scenario. This avoids the blind trial-and-error process starting from the lowest baud rate, significantly shortening link establishment time and improving the initial connection success rate. After establishing the OTA upgrade link based on the determined initial communication baud rate, the system immediately enters the data transmission phase. At this time, a sliding window is used to collect operational metrics in real time, allowing the evaluation of communication quality to be based on actual performance over a recent period rather than instantaneous states. This time-series data collection method can effectively smooth out occasional communication anomalies and provide a more representative sample basis for subsequent comprehensive quality score calculations.
[0020] S2: Perform fusion calculation on the operating indicators to generate a comprehensive quality score, and determine whether to trigger gear adjustment within a preset hysteresis interval based on the comprehensive quality score. When it is determined that a gear adjustment is triggered, lock the target baud rate gear using a binary search algorithm within a preset baud rate candidate space. It should be noted that fusion computing refers to the process of integrating multiple dimensions and different units of operational indicators into a single numerical evaluation result through a specific mathematical model. Its purpose is to eliminate dimensional differences between indicators and achieve a comprehensive balance of multiple factors. The comprehensive quality score is a dimensionless numerical value obtained through fusion computing, used to quantitatively characterize the overall quality level of the current communication link. A higher score indicates better communication quality, while a lower score indicates problems such as excessive transmission delay, severe packet loss, or signal attenuation. The hysteresis interval refers to the range defined by two intervald judgment thresholds set on the numerical axis of the comprehensive quality score. It typically includes an upgrade threshold and a downgrade threshold, with the upgrade threshold being higher than the downgrade threshold. This asymmetric interval design is used to prevent frequent baud rate switching caused by small fluctuations in the score near the critical value. Baud rate adjustment refers to the operation of increasing or decreasing the currently used baud rate level based on the communication quality assessment results. Upgrade adjustment aims to increase the transmission rate to shorten upgrade time, while downgrade adjustment aims to decrease the transmission rate to ensure communication reliability. The baud rate candidate space refers to the ordered set of all available baud rate levels supported by the system. It is typically arranged in ascending order of baud rate value, for example, from 1200bps to 115200bps, divided into multiple discrete levels. The binary search algorithm is an efficient search strategy for quickly locating a target element in an ordered set. It repeatedly divides the search interval in half and narrows the search range based on the comparison results of intermediate elements, thus completing the target location within logarithmic time complexity.
[0021] Understandably, by integrating operational metrics to generate a comprehensive quality score, the system simplifies the complex state of the communication link into a single evaluation indicator, facilitating intuitive trend judgment and threshold comparison. By determining whether to trigger a gear adjustment within a preset hysteresis interval, the system introduces a decision lag mechanism. A gear increase is triggered only when the comprehensive quality score is significantly higher than the gear increase threshold, and a gear decrease is triggered only when it is significantly lower than the gear decrease threshold. When the score is between these two thresholds, the current gear is maintained. This design effectively avoids gear oscillations caused by slight fluctuations in communication quality, ensuring the stability of the upgrade process. When a gear increase adjustment is triggered, a binary search algorithm is used within the baud rate candidate space to lock in the target baud rate gear. Compared to linear traversal search, binary search can quickly locate the highest baud rate gear capable of stable communication in the current environment with fewer trials, significantly reducing time overhead and communication risks during gear adjustment trials.
[0022] S3: Initiate a switching request including the target baud rate level, and after receiving the response signal, control both communicating parties to synchronously perform baud rate changes, and perform switching validity verification at the changed baud rate; It should be noted that a switching request is a control command sent by the main controller to the target device to notify it of the preparation to change the communication baud rate. This request carries the target baud rate level information so that the receiver can configure accordingly. A response signal is an acknowledgment returned by the target device to the main controller after receiving the switching request and completing its local baud rate configuration, indicating that the receiver is ready to communicate at the new baud rate. Synchronous baud rate change by both parties means that the main controller and the target device simultaneously switch their respective serial communication parameters at an agreed time or when conditions are met, ensuring that both parties can correctly recognize the data sent by the other at the changed baud rate. Switching validity verification refers to the process of confirming whether the communication link is working properly at the new baud rate by sending test data and monitoring feedback after the baud rate change. Its purpose is to promptly detect problems such as switching failures or configuration errors.
[0023] Understandably, by initiating a switching request that includes the target baud rate level, the main controller clearly informs the target device of the intention and target of the level change, enabling the receiver to prepare the corresponding hardware configuration in advance. By controlling both communicating parties to synchronously execute the baud rate change after receiving the response signal, the system achieves coordinated and consistent change timing, avoiding data parsing failures caused by unilateral premature or delayed changes. By performing a switching validity verification at the changed baud rate, the system can confirm whether the communication link at the new baud rate is stable and reliable before officially transmitting upgrade data. If the verification passes, the upgrade process continues; if the verification fails, a rollback mechanism is triggered in a timely manner to restore the stable state before the change, thereby preventing upgrade interruption or device disconnection due to baud rate switching failure.
[0024] S4: Add baud rate levels that meet preset failure conditions to the dynamic blacklist, and use a confidence mechanism that decays over time to manage the retry access permissions of each level in the dynamic blacklist. It should be noted that the preset failure conditions refer to the criteria used to determine whether a certain baud rate level cannot work properly in the current communication environment. These typically include handover failure, persistently substandard communication quality, and exceeding a threshold for consecutive retransmissions. The dynamic blacklist is a runtime-maintained data structure used to record baud rate levels confirmed as failed in the current OTA upgrade task. Levels included in the blacklist will be excluded from the candidate space during subsequent adaptive adjustments to avoid repeated attempts. The confidence mechanism is an evaluation method used to quantitatively assess the reusability of each level in the blacklist. Each level corresponds to a confidence score, which reflects the system's level of confidence in the level's ability to work stably in the current environment. Time decay refers to the dynamic characteristic of the confidence score gradually decreasing over time. Its purpose is to give previously failed levels the opportunity to re-enter the candidate pool after a certain period to adapt to potential changes in the communication environment. Retry admission permission refers to the permission status of levels in the blacklist to re-enter the baud rate candidate space for searching. This permission is activated when the real-time confidence of a level is lower than a preset admission threshold.
[0025] Understandably, by adding baud rate settings that meet preset failure conditions to a dynamic blacklist, the system can record information on unavailable baud rates in the current communication environment, avoiding retrying these confirmed failure settings during subsequent adaptive adjustments, thereby saving trial time and reducing the risk of upgrade failure. By using a confidence mechanism that decays over time to manage the retry access permissions of each baud rate setting in the dynamic blacklist, the system can prevent repeated attempts of failure settings in the short term to ensure stability, and also provide these settings with the opportunity to re-verify in the long term to adapt to possible improvements in the communication environment. This time-varying permission management strategy makes the blacklist mechanism both rigidly constrained and flexibly recoverable.
[0026] S5: When the OTA upgrade task is completed, the current stable baud rate level, dynamic blacklist status and the environmental feature information are associated and saved for subsequent retrieval.
[0027] It should be noted that the OTA upgrade task completion refers to the state where all firmware data transmission is completed, the target device successfully completes firmware flashing and reboot verification, marking the successful completion of this upgrade process. The current stable baud rate level refers to the baud rate level that the system finally determines and continues to use at the end of the upgrade task, which has been verified in practice to ensure stable communication. This level represents the optimal communication rate configuration under the current environment. The dynamic blacklist status refers to the collection of real-time confidence scores, failure frequency counts, and other information for each level in the dynamic blacklist at the end of the upgrade task, reflecting the perceived availability of each level during this upgrade process. Associated storage refers to the process of binding and storing the above communication quality characteristic data with environmental characteristic information. Its purpose is to establish a mapping relationship between scenarios and optimal configurations, realizing the persistence of experience and cross-task reuse.
[0028] Understandably, by associating and saving the current stable baud rate, dynamic blacklist status, and environmental characteristic information at the end of the OTA upgrade task, the system can solidify and store the environmental knowledge and configuration experience gained during this upgrade process, forming a knowledge record for specific communication scenarios. When this saved data is retrieved and used later, it can serve as the basis for determining the initial communication baud rate in similar scenarios, so that new upgrade tasks do not need to start from the default conservative baud rate, but can start directly from the better baud rate verified by past experience, thereby significantly shortening the link establishment time and improving the initial connection success rate.
[0029] Preferably, the operational metrics include data confirmation status, signal strength, transmission delay, and retransmission frequency.
[0030] It should be noted that data acknowledgment status refers to the status indicator of whether a data packet has been correctly received by the receiver and whether an acknowledgment response has been returned during transmission. This typically includes several states such as successful acknowledgment, response timeout, and verification error. This indicator directly reflects the success or failure of a single data interaction and is a fundamental basis for evaluating the reliability of the communication link. Signal strength refers to the power level of the radio frequency or electrical signal received by the physical layer communication interface, usually expressed in dBm or relative strength values. This indicator characterizes the channel quality under the current electromagnetic environment; lower signal strength indicates stronger environmental interference or a longer transmission distance. Transmission delay refers to the time interval between the sending of a data packet and the receiving of an acknowledgment response. This indicator reflects the response speed and congestion level of the communication link; excessive delay may indicate degraded link quality or insufficient equipment processing capacity. Retransmission frequency refers to the proportion of data retransmissions occurring per unit time or unit data volume to the total number of transmissions. This indicator comprehensively reflects the packet loss rate and the trigger frequency of error correction mechanisms, and is an important indicator of communication stability. The above four dimensions of operational indicators together constitute a complete indicator system for communication quality assessment, characterizing the link status from four perspectives: reliability, environmental adaptability, timeliness, and stability.
[0031] Preferably, establishing an OTA upgrade link based on the initial communication baud rate and collecting operational metrics in real time using a sliding window during data transmission includes: Obtain the transmission timestamp of the data packet to be transmitted at the transport layer, and obtain the acknowledgment timestamp when the corresponding response signal is received. Calculate the difference between the two to extract the single transmission delay in the operation metrics. Monitor the verification error flags and response timeout status during a single data interaction process, and count the frequency of abnormal interactions within a preset window period to extract the real-time packet loss rate from the operational metrics. The received signal strength of the current link is obtained by reading the physical layer communication interface, and the transmission efficiency index in the operation index is extracted by combining the data throughput per unit time at the current baud rate. The extracted operational indicators of each dimension are sequentially stored into the storage units of the sliding window according to the time series, and a decay coefficient is assigned to each storage unit according to the storage order of each storage unit relative to the current time, so that the weight of the operational indicators in the sliding window decreases over time.
[0032] It should be noted that the sending timestamp refers to the system time value corresponding to the moment when the data packet is formally submitted to the physical layer for transmission at the transport layer. Accurate recording of this timestamp is the starting point for calculating transmission delay. The acknowledgment timestamp refers to the system time value corresponding to the moment when the response signal corresponding to the sent data packet is correctly received and parsed by the receiver. The acquisition of this timestamp marks the completion of a single data interaction. Single transmission delay refers to the time interval from the sending timestamp to the acknowledgment timestamp; this parameter directly reflects the round-trip transmission time of the data packet on the link. The checksum error flag is an abnormal state flag set by the receiver when it detects checksum mismatch or data integrity corruption during data parsing. This flag is used to identify data corruption during transmission. The response timeout state refers to the time overflow state determined when the sender has not received a valid response after waiting for a preset waiting time limit. This state is used to identify data packet loss or severe delay. The abnormal interaction frequency refers to the proportion of the number of abnormal states such as checksum errors and response timeouts occurring within a preset window period to the total number of interactions. This frequency, after calculation, is the real-time packet loss rate. Data throughput per unit time refers to the number of valid data bytes successfully transmitted within a specific time interval. This parameter reflects the actual data throughput capacity under the current baud rate configuration. Transmission efficiency index is a comprehensive indicator used to characterize the link transmission performance at the current baud rate, calculated by combining received signal strength and data throughput per unit time. A storage unit refers to the memory space within a sliding window used to store operational indicator data for each dimension at a single point in time; each storage unit corresponds to a complete set of indicators for a sampling time. The attenuation coefficient is the weight multiplier assigned to each storage unit. This coefficient decreases according to the storage order of the storage unit relative to the current time (i.e., time proximity), with more recent data receiving a higher attenuation coefficient.
[0033] Understandably, by obtaining the sending timestamp and acknowledgment timestamp to calculate the single transmission delay, the system obtains an accurate link response time metric. This metric can sensitively reflect the impact of baud rate changes on transmission time and the trend of link congestion or quality degradation. By monitoring verification error flags and response timeout status and statistically analyzing abnormal interaction frequencies to extract the real-time packet loss rate, the system achieves a dynamic quantitative assessment of communication reliability. This metric directly reflects the carrying limit of the current baud rate in the current environment. By reading the physical layer received signal strength and combining it with the data throughput per unit time to extract the transmission efficiency index, the system achieves a correlation analysis between physical layer quality and link layer performance. This metric can identify abnormal situations where the signal quality is good but the transmission efficiency is low (such as excessive protocol overhead or equipment processing bottlenecks). By storing the operational metrics of each dimension sequentially into the storage unit of a sliding window according to the time series and assigning attenuation coefficients that decrease over time, the system achieves weighted utilization of historical data, making recent metrics have a higher influence in the comprehensive evaluation, thereby ensuring that the evaluation results can reflect the latest changes in the communication status in a timely manner.
[0034] Preferably, the process of integrating and calculating the operational indicators to generate a comprehensive quality score includes: The various operational metrics stored in the sliding window are normalized to map metrics of different dimensions to a unified numerical range. Constructing a comprehensive quality score The weighted evaluation model Satisfying the relation: ; in, This indicates the total number of dimensions for the operational metrics. Indicates the first The impact weights corresponding to dimensional performance metrics. Indicates the first The steady-state score of the dimensional performance indicator within the sliding window; The steady-state score By normalizing the values of each sampling point within the window Obtained by execution time weighted calculation. Satisfying the relation: ; in, Indicates the sampling size of the sliding window. This represents the attenuation coefficient allocated according to the storage order; Based on the comprehensive quality score The sampling scale is dynamically adjusted based on the calculation results and their volatility within a preset time period. and the attenuation coefficient The slope of the distribution.
[0035] It should be noted that normalization refers to the process of converting raw indicator data with different dimensions and value ranges into a unified numerical range (usually [0,1]) through linear transformation or nonlinear mapping. This process avoids the impact of dimensional differences on the fusion calculation. The weighted evaluation model is a mathematical model that calculates the comprehensive score by assigning influence weights to each dimension indicator and summing them. This model achieves a comprehensive trade-off among multiple factors. The steady-state score is the representative value obtained by averaging the operating indicators of a single dimension over time within a sliding window. This score smooths out instantaneous fluctuations and reflects the recent average level of that dimension. The sampling scale refers to the number of sampling points actually stored in the sliding window; this parameter determines the reference depth of historical data. The distribution slope is the rate parameter of change of the decay coefficient with the storage order; this parameter determines the degree of weight difference between recent and distant data. Volatility refers to the statistical measure of the change in the comprehensive quality score within a preset time period; this parameter reflects the stability of the communication status.
[0036] Understandably, by normalizing the operational metrics of each dimension within the sliding window, the numerical scale differences between metrics of different dimensions, such as transmission delay (milliseconds), packet loss rate (percentage), and signal strength (dBm), are avoided, enabling fair comparison and weighted calculation of each metric within the same numerical range. By constructing a weighted evaluation model to calculate the comprehensive quality score, the system achieves a multi-factor comprehensive evaluation of communication quality. The influence weight of each metric can be configured according to its importance to the success of the upgrade, for example, increasing the weight of reliability-related metrics to reduce the risk of upgrade failure. Through time-weighted steady-state score calculation, the system utilizes historical data to smooth instantaneous fluctuations while ensuring the higher influence of recent data through attenuation coefficients, making the evaluation results both stable and sensitive. By dynamically adjusting the sampling scale and attenuation coefficient distribution slope according to the volatility of the comprehensive quality score, the system achieves adaptive optimization of evaluation parameters: when the communication state is stable and the score fluctuation is small, the sampling scale can be increased and the attenuation slope can be smoothed to fully utilize the statistical stability of historical data; when the communication state changes drastically and the score fluctuation is large, the sampling scale can be reduced and the attenuation slope can be steepened to quickly respond to the latest changes.
[0037] Preferably, determining whether to trigger gear adjustment based on the comprehensive quality score within a preset hysteresis range includes: Obtain the gear shifting frequency within a preset time period before the current moment, and calculate the oscillation correction factor based on the shifting frequency; If the comprehensive quality score Greater than the upshift determination threshold Then, based on the duration period count required for the dynamic extension of the oscillation correction factor, the comprehensive quality score is calculated. The first derivative is used to obtain the environmental change rate bias; When the environmental change rate deviation is non-negative and the comprehensive quality score meets the extended duration count, an upgrade adjustment is triggered. If the comprehensive quality score Less than the downgrade determination threshold If the current data transmission triggers a preset number of consecutive failures, then the downgrade step size is determined based on the absolute value of the environmental change rate deviation. If the absolute value of the environmental change rate deviation exceeds the preset change threshold, it is determined that the current baud rate level will be directly downgraded to the preset safe backup level; otherwise, it is determined that a step-by-step downgrade adjustment will be triggered. After performing any gear adjustment action, a viewing window of a preset duration is opened, and the current baud rate gear is locked within the viewing window, preventing the triggering of upshift requests.
[0038] It should be noted that the baud rate switching frequency refers to the statistical value of the number of baud rate changes within a preset time period. This parameter reflects the degree of oscillation in the system under critical conditions. The oscillation correction factor is a multiplier or addend calculated based on the baud rate switching frequency, used to adjust the strictness of the upshift judgment. This factor increases with the switching frequency and is used to suppress frequent switching. The duration period count refers to the minimum number of sampling periods required to continuously maintain the overall quality score to meet the upshift conditions. This parameter prevents premature upshifts triggered by instantaneous quality improvements. The first derivative is the slope of the overall quality score curve over time. This derivative reflects the trend of communication quality changes; a positive value indicates quality improvement, and a negative value indicates quality deterioration. The environmental change rate deviation is the specific value of the first derivative, used to quantify the speed and direction of changes in the communication environment. The continuous failure logic refers to the abnormal state judgment rule for multiple consecutive transmission failures or acknowledgment timeouts during data transmission. This logic is used to identify sudden deterioration of the communication link. The downshift step size refers to the number of baud rates skipped when performing a downshift adjustment. This parameter determines the aggressiveness of the downshift. The safety backup baud rate setting refers to a conservative baud rate setting preset by the system and widely verified to ensure stable communication in most environments. This setting serves as a fallback option in extreme cases. The observation window is a lockout period set after the baud rate adjustment is completed, preventing further baud rate upgrade requests. This window provides a buffer time for link stability.
[0039] Understandably, by acquiring the gear switching frequency and calculating the oscillation correction factor, the system can identify whether it is in a critical oscillation state and dynamically extend the duration period count required for gear upgrades, thereby increasing the prudence of gear upgrade decisions and effectively suppressing frequent gear switching near the unstable boundary. By calculating the first derivative of the comprehensive quality score to obtain the environmental change rate deviation, the system can perceive the changing trend of communication quality and only trigger gear upgrades when the quality continuously improves (the derivative is non-negative) and meets the duration period requirement, avoiding rash adjustments during periods of quality fluctuation or deterioration. In terms of downgrading judgment, by distinguishing between two triggering conditions—comprehensive quality score below the threshold and continuous failure logic—and introducing the absolute value of the environmental change rate deviation to determine the downgrading step size, the system achieves a refined downgrading strategy: when the quality slowly declines, it performs step-by-step downgrading to find the optimal gear; when the quality deteriorates sharply (the absolute value of the change rate deviation exceeds the change threshold), it directly jumps gears to a safe backup gear to quickly restore communication. By opening an observation window and prohibiting gear upgrade requests after any gear adjustment, the system provides the necessary buffer time for link stability and prevents instantaneous fluctuations after adjustment from triggering reverse adjustments.
[0040] Preferably, locking the target baud rate level within a preset baud rate candidate space using a binary search algorithm includes: Obtain the list of selectable baud rate levels that are not included in the dynamic blacklist within the baud rate candidate space, and determine the current lower search limit index and the current upper search limit index of the selectable baud rate level list; Calculate the midpoint between the current search lower limit index and the current search upper limit index to determine the test level, and use the switching request to attempt to switch to the test level; If the communication quality under the test level meets the preset stability threshold, then the current search lower limit index is updated to the test level, and the test level is marked as the known best stable level. If the communication quality under the test level does not meet the preset stable threshold or the switching fails, the current search upper limit index is updated to the previous index of the test level, and the test level is added to the dynamic blacklist. Repeat the intermediate position calculation and index update steps until the difference between the current upper search limit index and the current lower search limit index is less than the preset step threshold, and finally lock the known best stable position as the target baud rate position.
[0041] It should be noted that the lower search bound index refers to the position number of the lowest baud rate that has been confirmed to provide stable communication during the binary search process, within the list of available baud rates. This index dynamically moves upwards as the search progresses. The upper search bound index refers to the position number of the highest baud rate currently being tested during the binary search process, within the list of available baud rates. This index dynamically moves downwards as the search progresses. The intermediate position refers to the arithmetic mean (usually rounded down) of the lower and upper search bound indices; the baud rate corresponding to this position serves as the test target for the current iteration. The test baud rate refers to the baud rate selected for communication quality testing in a given iteration of the binary search; the stability of this baud rate determines the update direction of the search interval. The known best stable baud rate refers to the baud rate that has been most recently confirmed to meet the stability threshold during the search process; this baud rate becomes the target baud rate at the end of the search. The step threshold refers to the precision standard for determining search convergence; iteration stops when the difference between the upper and lower bound indices is less than this threshold.
[0042] Understandably, by obtaining a list of available gears not included in the dynamic blacklist and determining the upper and lower limit indices of the search, the system establishes an ordered search space and initial boundaries. By calculating the intermediate position to determine the test gear and executing switching tests, the system uses a binary search strategy to quickly approach the optimal gear. Compared to linear traversal, the logarithmic time complexity of binary search significantly reduces the number of tests required. By updating the search interval based on the test results (raising the lower limit and marking the optimal gear if the test is successful, lowering the upper limit and adding it to the blacklist if the test fails), the system continuously narrows the search range and accumulates available gear information. Through repeated iterations until the index difference is less than the step threshold, the system ensures that the search is completed and the target gear is locked within the preset precision.
[0043] For example, the main controller performs a binary search to lock onto the target baud rate level: Regarding the acquisition of the selectable level list, the candidate baud rate space includes levels 1 to 8, and the dynamic blacklist includes levels 7 and 8. After filtering, the selectable level list is [level 1, level 2, level 3, level 4, level 5, level 6], corresponding to indices 0 to 5; Regarding the determination of the initial boundary, the currently stable level is level 5, with an index of 4 in the list. The lower search limit index is set to low=4, and the upper search limit index is set to high=5; Regarding the iterative search, in the first round, mid=(4+5) / 2=4 (rounded down). The test level is level 5 corresponding to index 4, which is currently stable at this level. In the first round, communication is performed to determine if the stability threshold is met. Low is updated to 4 (unchanged), and the 5th baud rate is marked as the known optimal stable baud rate. In the second round, mid = (4+5) / 2 = 4 is calculated, the same as the previous round. The 5th baud rate is tested, and high-low = 1 is determined to be not less than the step threshold of 1. Iteration continues. In the third round, the strategy is adjusted, and the 6th baud rate corresponding to index 5 is tested. A switching request is sent and validity verification is performed. If the verification fails, high = 4 (mid-1) is updated, and the 6th baud rate is added to the dynamic blacklist. At this point, high = 4, low = 4, and the difference is 0, which is less than the step threshold of 1. The search converges, and the known optimal stable baud rate, the 5th baud rate, is locked as the target baud rate.
[0044] Preferably, performing handover validity verification at the changed baud rate includes: After both parties in the control communication perform a baud rate change, a verification timer of a preset duration is started, and the system enters a pending confirmation state. In the pending confirmation state, a probe frame including a preset sequence is sent using the changed baud rate, and the feedback signal of the communication bus is monitored in real time. If an acknowledgment response matching the probe frame is received before the verification timer reaches zero, the switch is deemed valid, the current baud rate is maintained, and the verification timer is cleared. If no valid confirmation response is received when the verification timer reaches zero, or if a continuous overflow exception is detected by the hardware layer during the verification process, the switch is deemed invalid, and an automatic rollback process is triggered to restore the baud rate level to the level before the change.
[0045] It should be noted that the verification timer refers to a hardware or software timer used to limit the maximum waiting time for verifying the validity of the handover. The preset duration of this timer must balance the sufficiency of verification and the timeliness of response. The pending confirmation state refers to the temporary operating state of the system after the baud rate change is completed and before the verification result is determined. In this state, the system suspends normal upgrade data transmission and focuses on the verification process. A probe frame is a short data frame specifically designed to verify the connectivity of the communication link. This frame contains a preset fixed sequence for the receiver to identify and respond quickly. An acknowledgment response is a response frame returned by the target device after correctly receiving the probe frame. The content of this response must match the preset sequence of the probe frame to verify normal bidirectional communication. A continuous overflow anomaly refers to a hardware anomaly state where the serial port receive buffer continuously generates overflow interrupts due to data parsing errors. This anomaly usually indicates a data format error caused by a baud rate mismatch. The automatic rollback process is a fault-tolerant mechanism that is automatically executed when the handover verification fails, restoring the communication parameters to their pre-change state. This process ensures that the system can quickly return to a known stable state.
[0046] Understandably, by starting the verification timer and entering the pending confirmation state after the baud rate change, the system sets clear time boundaries and operating modes for the verification process, avoiding infinite waiting or data confusion; by sending probe frames containing a preset sequence and monitoring feedback signals, the system completes the experimental verification of bidirectional communication capability at the new baud rate with minimal data overhead; by maintaining the new baud rate when verification is successful and triggering automatic rollback when verification fails (no response after timeout or hardware abnormality), the system ensures that the communication link will eventually be in a definite and usable state regardless of the verification result.
[0047] For example, the main controller performs a switch validity verification: Regarding the verification timer startup, after the main controller and the air conditioner indoor unit controller synchronously switch the baud rate from level 5 (38400bps) to level 6 (57600bps), the verification timer is immediately started, with a preset duration of 500 milliseconds; Regarding the pending confirmation state entry, the system pauses the continuous transmission of firmware data packets and enters a dedicated verification state; Regarding probe frame transmission and monitoring, probe frames are sent at the new baud rate of 57600bps, with the frame content being the fixed sequence 0xAA55A5A5, and reception is enabled. The monitoring bus feedback is interrupted. Regarding the verification result determination, assuming that a confirmation response is received from the air conditioner indoor unit controller 300 milliseconds before the timer resets to zero, and the response content is 0xAA55A5A5 which matches the local transmission sequence, the switch is deemed valid, the verification timer is cleared, and normal upgrade data transmission is restored. In another hypothetical scenario, if no response is received within 500 milliseconds, or if the UART receive overflow flag is detected to be set 3 times consecutively in the interrupt service routine, the switch is deemed invalid, and an automatic rollback process is immediately triggered to restore the baud rate of both parties to level 5, and level 6 is added to the dynamic blacklist.
[0048] Preferably, managing retry access permissions for each tier in the dynamic blacklist using a confidence mechanism that decays over time includes: Obtain the initial confidence score corresponding to the tier included in the dynamic blacklist, and record the most recent failure timestamp of the tier in the dynamic blacklist when communication anomalies occurred; Monitor the duration of the current system clock relative to the most recent failure timestamp, and calculate the confidence decay based on the duration, so as to obtain the current real-time confidence by subtracting the confidence decay from the initial confidence score; If the real-time confidence level is lower than a preset admission threshold, the corresponding baud rate level is removed from the dynamic blacklist and allowed to re-participate in the search of the baud rate candidate space. If the gear triggers the failure condition again after re-engaging in communication, the initial confidence score for its next inclusion in the blacklist will be increased exponentially based on the failure frequency.
[0049] It should be noted that the initial confidence score refers to the baseline confidence value assigned to a gear position when it is first added to the dynamic blacklist. This score determines the initial duration of the gear position's stay on the blacklist. The most recent failure timestamp refers to the system time record when the gear position was most recently confirmed to have a communication error and added to the blacklist; this timestamp is the time base for calculating confidence decay. Duration refers to the time difference between the current system clock and the most recent failure timestamp; this duration reflects the time the gear position has been on the blacklist. Confidence decay is the reduction value calculated based on the duration and deducted from the initial confidence score; this decay typically increases linearly or exponentially over time. Real-time confidence refers to the remaining confidence value of the gear position on the blacklist at the current moment; this value determines whether the gear position is eligible for retry access. The access threshold is the critical confidence value at which a gear position can be removed from the blacklist; access permission is activated when the real-time confidence value falls below this threshold. Failure frequency refers to the cumulative number of times a specific gear has been blacklisted. This parameter is used to identify problematic gears that repeatedly fail.
[0050] Understandably, by assigning initial confidence scores to blacklisted gears and recording failure timestamps, a quantitative description and time benchmark of the gear blacklist status are established. By continuously monitoring the duration and calculating the attenuation amount to obtain real-time confidence, the system achieves dynamic management of the blacklist stay time, enabling gears to gradually regain their access eligibility over time and adapt to possible improvements in the communication environment. By removing gears when the real-time confidence falls below the access threshold and allowing them to re-participate in the candidate pool, the system achieves automatic blacklist cleanup and gear reuse. By exponentially increasing the initial confidence score based on the failure frequency when a gear fails again, the system imposes stricter penalties on repeatedly failing gears, extending their blacklist stay time to avoid frequent invalid attempts.
[0051] For example, the main controller manages the 6th tier in the dynamic blacklist: In terms of initial state, the 6th tier is added to the blacklist for the first time due to a failed switch verification, assigned an initial confidence score of 100 points, and the most recent failure timestamp is recorded as the 600th second after system startup; regarding confidence decay, the system adopts a linear decay model, decaying 10 points per minute. The current time is the 720th second, and the duration is 120 seconds (2 minutes), calculating a confidence decay of 20 points. The real-time confidence score is 100-20=80 points, which is higher than the quasi-confidence level. With an entry threshold of 10 points, tier 6 remains in the blacklist. As time progresses to the 1500th second (lasting 900 seconds, or 15 minutes), the confidence decays by 150 points (upper limit of the initial score), resulting in a real-time confidence score of 0, below the entry threshold. Therefore, tier 6 is removed from the blacklist and allowed to re-participate in the candidate space search. Regarding re-failure handling, assuming tier 6 triggers the failure condition again at the 1600th second after re-participation, and the historical failure frequency is 2 times, a new initial confidence score is calculated. =200 points, the most recent failure timestamp is recorded as 1600 seconds, and the 6th tier is re-entered into the blacklist with a longer expected stay time.
[0052] Preferably, associating and saving the current stable baud rate setting, dynamic blacklist status, and environmental feature information includes: Obtain the final baud rate level at the end of this OTA upgrade task, and extract the real-time confidence level and failure frequency count of each baud rate level in the dynamic blacklist. The final baud rate setting, the real-time confidence level, and the failure frequency count are encapsulated into a communication quality feature set, and then bound to the environmental feature information through multi-dimensional mapping. The bound communication quality feature set and the environmental feature information are written into the preset address space of the non-volatile storage area to construct a parameter search index for different communication scenarios; When a subsequent OTA upgrade task is initiated, the communication quality feature set that matches the real-time acquired environmental feature information in the non-volatile storage area is matched first, and the initial state of the initial communication baud rate and dynamic blacklist is restored accordingly.
[0053] It should be noted that the final baud rate level refers to the baud rate level used by the system when the OTA upgrade task is successfully completed, which has been verified and stabilized throughout the process. This level represents the optimal communication configuration under the current environment. The failure frequency count refers to the cumulative number of times each level is included in the dynamic blacklist, reflecting the historical reliability performance of each level. The communication quality feature set refers to a structured data set containing information such as the final baud rate level, the real-time confidence level of each blacklist level, and the failure frequency. This set encapsulates the communication experience gained from this upgrade task. Multi-dimensional mapping and binding refers to the process of establishing a correlation between the communication quality feature set and environmental feature information. This binding ensures a one-to-one correspondence between experience data and scenario features. The non-volatile storage area refers to a storage medium area where data is not lost after power failure, such as flash memory or EEPROM. This area is used to persistently store communication experience. The parameter search index refers to a data retrieval structure using environmental feature information as the key and the communication quality feature set as the value. This index supports fast experience matching queries. Restoration refers to the process of restoring the system to its initial state based on historical experience data, including setting the initial baud rate and rebuilding the dynamic blacklist.
[0054] Understandably, by acquiring the final baud rate setting and dynamic blacklist status and encapsulating them into a communication quality feature set, the system has structured and organized the optimal configuration and failure awareness obtained during this upgrade process. By mapping and binding the communication quality feature set with environmental feature information in a multi-dimensional way, the system establishes a correspondence between scenarios and experience, enabling configuration experience in different environments to be stored in categories without interference. By writing the bound data into a non-volatile storage area to build a parameter search index, the system achieves power-off retention and fast retrieval of experience. By prioritizing matching the matching communication quality feature set and restoring the initial state when subsequent tasks are started, the system enables new tasks to directly inherit past experience, start from the verified optimal setting and pre-set blacklist information, avoiding blind trial and error starting from the default state.
[0055] For example, the main controller performs experience saving and reuse: Regarding task completion, it confirms that the firmware data of the indoor unit controller has been 100% transmitted, receives an upgrade completion ACK frame, determines the task is complete, and obtains the final baud rate level as level 6. The dynamic blacklist includes level 7 (real-time confidence score 0, failure frequency 1 time) and level 8 (real-time confidence score 0, failure frequency 2 times). Regarding data encapsulation and binding, the final baud rate level 6, the blacklist level list [7,8], the real-time confidence score [0,0] for each level, and the failure frequency [1,2] are encapsulated into a communication quality feature set, along with environmental feature information (device model "AC-INDOOR-2024"). The system performs multi-dimensional mapping and binding of data (A), firmware version "V2.3.1", deployment environment "residential", and time period "night") to form key-value pair records. For persistent storage, the bound data is written to the parameter search index area of the non-volatile storage area, and the index table is updated. For subsequent task reuse, when the next OTA upgrade task for the same model, version, and environment of the air conditioner indoor unit is started, the main controller reads the current environmental feature information, prioritizes matching in the parameter search index, finds matching records, extracts the communication quality feature set, and directly sets the initial communication baud rate to level 6, and initializes the dynamic blacklist to include levels 7 and 8, realizing rapid reuse of experience.
[0056] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0057] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for adaptive adjustment of communication baud rate for OTA upgrades of electronic control systems, characterized in that, include: The system acquires environmental characteristic information of the current communication environment, retrieves historical communication parameters that match the environmental characteristic information, determines the initial communication baud rate based on the retrieval results, establishes an OTA upgrade link based on the initial communication baud rate, and collects operational indicators in real time using a sliding window during data transmission. The operating indicators are fused and calculated to generate a comprehensive quality score. Based on the comprehensive quality score, it is determined whether to trigger a gear adjustment within a preset hysteresis interval. When it is determined that a gear adjustment is triggered, a binary search algorithm is used to lock the target baud rate gear within a preset baud rate candidate space. Initiate a switching request including the target baud rate level, and after receiving a response signal, control both communicating parties to synchronously execute the baud rate change, and perform a switching validity verification at the changed baud rate; Baud rate levels that meet preset failure conditions are added to a dynamic blacklist, and a confidence mechanism that decays over time is used to manage the retry access permissions of each level in the dynamic blacklist. When the OTA upgrade task is completed, the current stable baud rate level, dynamic blacklist status, and the environmental feature information are associated and saved for subsequent retrieval.
2. The adaptive baud rate adjustment method for OTA upgrade of an electronic control system according to claim 1, characterized in that, The operational metrics include data confirmation status, signal strength, transmission delay, and retransmission frequency.
3. The adaptive baud rate adjustment method for OTA upgrade of an electronic control system according to claim 1, characterized in that, An OTA upgrade link is established based on the initial communication baud rate, and operational metrics are collected in real time using a sliding window during data transmission, including: Obtain the transmission timestamp of the data packet to be transmitted at the transport layer, and obtain the acknowledgment timestamp when the corresponding response signal is received. Calculate the difference between the two to extract the single transmission delay in the operation metrics. Monitor the verification error flags and response timeout status during a single data interaction process, and count the frequency of abnormal interactions within a preset window period to extract the real-time packet loss rate from the operational metrics. The received signal strength of the current link is obtained by reading the physical layer communication interface, and the transmission efficiency index in the operation index is extracted by combining the data throughput per unit time at the current baud rate. The extracted operational indicators of each dimension are sequentially stored into the storage units of the sliding window according to the time series, and a decay coefficient is assigned to each storage unit according to the storage order of each storage unit relative to the current time, so that the weight of the operational indicators in the sliding window decreases over time.
4. The adaptive baud rate adjustment method for OTA upgrade of an electronic control system according to claim 1, characterized in that, The process of integrating and calculating the aforementioned operational indicators to generate a comprehensive quality score includes: The various operational metrics stored in the sliding window are normalized to map metrics of different dimensions to a unified numerical range. Constructing a comprehensive quality score The weighted evaluation model Satisfying the relation: ; in, This indicates the total number of dimensions for the operational metrics. Indicates the first The impact weights corresponding to dimensional performance metrics. Indicates the first The steady-state score of the dimensional performance indicator within the sliding window; The steady-state score By normalizing the values of each sampling point within the window Obtained by execution time weighted calculation. Satisfying the relation: ; in, Indicates the sampling size of the sliding window. This represents the attenuation coefficient allocated according to the storage order; Based on the comprehensive quality score The sampling scale is dynamically adjusted based on the calculation results and their volatility within a preset time period. and the attenuation coefficient The slope of the distribution.
5. The adaptive baud rate adjustment method for OTA upgrade of an electronic control system according to claim 4, characterized in that, Determining whether to trigger gear adjustment based on the comprehensive quality score within a preset hysteresis range includes: Obtain the gear shifting frequency within a preset time period before the current moment, and calculate the oscillation correction factor based on the shifting frequency; If the comprehensive quality score Greater than the upshift determination threshold Then, based on the duration period count required for the dynamic extension of the oscillation correction factor, the comprehensive quality score is calculated. The first derivative is used to obtain the environmental change rate bias; When the environmental change rate deviation is non-negative and the comprehensive quality score meets the extended duration count, an upgrade adjustment is triggered. If the comprehensive quality score Less than the downgrade determination threshold If the current data transmission triggers a preset number of consecutive failures, then the downgrade step size is determined based on the absolute value of the environmental change rate deviation. If the absolute value of the environmental change rate deviation exceeds the preset change threshold, it is determined that the current baud rate level will be directly downgraded to the preset safe backup level; otherwise, it is determined that a step-by-step downgrade adjustment will be triggered. After performing any gear adjustment action, a viewing window of a preset duration is opened, and the current baud rate gear is locked within the viewing window, preventing the triggering of upshift requests.
6. The method for adaptive adjustment of communication baud rate for OTA upgrade of an electronic control system according to claim 1, characterized in that, Within a predefined baud rate candidate space, a binary search algorithm is used to pinpoint the target baud rate level, including: Obtain the list of selectable baud rate levels that are not included in the dynamic blacklist within the baud rate candidate space, and determine the current lower search limit index and the current upper search limit index of the selectable baud rate level list; Calculate the midpoint between the current search lower limit index and the current search upper limit index to determine the test level, and use the switching request to attempt to switch to the test level; If the communication quality under the test level meets the preset stability threshold, then the current search lower limit index is updated to the test level, and the test level is marked as the known best stable level. If the communication quality under the test level does not meet the preset stable threshold or the switching fails, the current search upper limit index is updated to the previous index of the test level, and the test level is added to the dynamic blacklist. Repeat the intermediate position calculation and index update steps until the difference between the current upper search limit index and the current lower search limit index is less than the preset step threshold, and finally lock the known best stable position as the target baud rate position.
7. The method for adaptive adjustment of communication baud rate for OTA upgrade of electronic control system according to claim 1, characterized in that, Performing handover validity verification at the changed baud rate includes: After both parties in the control communication perform a baud rate change, a verification timer of a preset duration is started, and the system enters a pending confirmation state. In the pending confirmation state, a probe frame including a preset sequence is sent using the changed baud rate, and the feedback signal of the communication bus is monitored in real time. If an acknowledgment response matching the probe frame is received before the verification timer reaches zero, the switch is deemed valid, the current baud rate is maintained, and the verification timer is cleared. If no valid confirmation response is received when the verification timer reaches zero, or if a continuous overflow exception is detected by the hardware layer during the verification process, the switch is deemed invalid, and an automatic rollback process is triggered to restore the baud rate level to the level before the change.
8. The method for adaptive adjustment of communication baud rate for OTA upgrade of electronic control system according to claim 1, characterized in that, Managing retry access permissions for each tier in the dynamic blacklist using a confidence mechanism that decays over time includes: Obtain the initial confidence score corresponding to the tier included in the dynamic blacklist, and record the most recent failure timestamp of the tier in the dynamic blacklist when communication anomalies occurred; Monitor the duration of the current system clock relative to the most recent failure timestamp, and calculate the confidence decay based on the duration, so as to obtain the current real-time confidence by subtracting the confidence decay from the initial confidence score; If the real-time confidence level is lower than a preset admission threshold, the corresponding baud rate level is removed from the dynamic blacklist and allowed to re-participate in the search of the baud rate candidate space. If the gear triggers the failure condition again after re-engaging in communication, the initial confidence score for its next inclusion in the blacklist will be increased exponentially based on the failure frequency.
9. The method for adaptive adjustment of communication baud rate for OTA upgrade of electronic control system according to claim 1, characterized in that, The current stable baud rate setting, dynamic blacklist status, and environmental feature information are associated and saved, including: Obtain the final baud rate level at the end of this OTA upgrade task, and extract the real-time confidence level and failure frequency count of each baud rate level in the dynamic blacklist. The final baud rate setting, the real-time confidence level, and the failure frequency count are encapsulated into a communication quality feature set, and then bound to the environmental feature information through multi-dimensional mapping. The bound communication quality feature set and the environmental feature information are written into the preset address space of the non-volatile storage area to construct a parameter search index for different communication scenarios; When a subsequent OTA upgrade task is initiated, the communication quality feature set that matches the real-time acquired environmental feature information in the non-volatile storage area is matched first, and the initial state of the initial communication baud rate and dynamic blacklist is restored accordingly.