Deep Learning-Based Parameter Optimization Method and System for Embedded Temperature Sensors

By constructing a thermal excitation marker sequence and improving the RetNet model, combined with a phase reentry closed-loop mechanism, the problem of separating transient error and self-heating hysteresis effect of embedded temperature sensors under high load conditions was solved, achieving high-precision online temperature compensation and optimization.

CN122306266APending Publication Date: 2026-06-30CHANGZHOU UNIV HUAIDE COLLEGE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGZHOU UNIV HUAIDE COLLEGE
Filing Date
2026-03-20
Publication Date
2026-06-30

Smart Images

  • Figure CN122306266A_ABST
    Figure CN122306266A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for optimizing parameters of an embedded temperature sensor based on deep learning, comprising the following steps: Step 1: Acquire a temperature sampling sequence and generate a thermal excitation marker sequence; Step 2: Construct an excitation-aligned temperature sequence; Step 3: Construct a set of excitation response segments; Step 4: Input the set of excitation response segments into an improved RetNet model, perform memory-state cross-modulation between the fast hidden state channel and the slow hidden state channel, and introduce a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state; Step 5: Obtain a set of short-time response difference vectors and a set of long-time response difference vectors; Step 6: Obtain the updated transient error parameters and self-thermal hysteresis parameters; Step 7: Perform range constraints to obtain the final transient error parameters and the final self-thermal hysteresis parameters. This invention achieves separate optimization of transient and hysteresis error parameters through thermal excitation and an improved RetNet model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of temperature measurement and parameter optimization technology, and in particular to a method and system for optimizing embedded temperature sensor parameters based on deep learning. Background Technology

[0002] With the widespread application of embedded processors in smart terminals, industrial control equipment, and IoT nodes, on-chip temperature sensors are widely used for chip overheat protection, power management, and performance scheduling. However, under high load operation or frequent task switching conditions, fluctuations in processor core power consumption can cause significant self-heating effects, leading to transient errors and hysteresis biases between the temperature measured by the on-chip sensor and the actual junction temperature. Existing embedded temperature compensation technologies mostly employ static calibration or simple linear correction methods for calibration, but these generally suffer from the following problems in practical applications: The processor's operating state exhibits strong time-varying characteristics. The temperature changes caused by load pulses have obvious nonlinearity and multi-timescale coupling characteristics. Traditional single-parameter or fixed models are difficult to simultaneously characterize the rapid transient temperature rise and slow heat accumulation process, resulting in a significant decrease in compensation accuracy under high-frequency load switching scenarios. Embedded systems lack independent reference temperature sources. Existing methods usually rely on external calibration equipment or constant temperature environments for offline calibration, which cannot dynamically separate and optimize the self-heating hysteresis effect under actual operating conditions. For temperature response data with strong sequence dependence, conventional filtering, wavelet decomposition, or simple recursive algorithms are difficult to effectively distinguish between excitation-driven response and environmental temperature drift background changes. They are prone to misjudging environmental disturbances as changes in self-heating parameters, resulting in unstable convergence or even divergence of compensation parameters.

[0003] Therefore, how to provide a method and system for optimizing embedded temperature sensor parameters based on deep learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] One objective of this invention is to propose a method and system for optimizing parameters of embedded temperature sensors based on deep learning. This invention constructs an excitation-aligned temperature sequence and a set of counterfactual segments through thermal excitation, an improved RetNet model, and a phase reentry closed-loop mechanism. This enables structured separation of transient errors and self-heating hysteresis effects and online parameter optimization. It achieves dynamic compensation of embedded temperature sensors without the need for an external reference temperature source, and has the advantages of high separation accuracy, strong convergence stability, low implementation cost, and strong engineering feasibility.

[0005] The method for optimizing embedded temperature sensor parameters based on deep learning according to embodiments of the present invention includes the following steps: Step 1: Acquire the temperature sampling sequence and generate a thermal excitation marker sequence by applying a load pulse to the embedded processor; Step 2: According to the sampling order, combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence to construct an excitation-aligned temperature sequence; Step 3: Using the excitation start time in the thermal excitation mark sequence as the center, extract the excitation response segment from the excitation alignment temperature sequence to construct an excitation response segment set; Step 4: Input the set of stimulus response fragments into the improved RetNet model. The improved RetNet model includes a fast hidden state channel, a slow hidden state channel, a memory crossover re-entry module, and an output module. The memory crossover re-entry module is used to perform memory crossover modulation between the fast hidden state channel and the slow hidden state channel and introduce a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state. Step 5: Construct a counterfactual fragment set based on the stimulus response fragment set, input the counterfactual fragment set into the improved RetNet model to obtain the counterfactual fast hidden state and the counterfactual slow hidden state, and compare them with the fast hidden state and the slow hidden state respectively to obtain the short-time response difference vector set and the long-time response difference vector set. Step 6: Update the transient error parameters based on the short-time response difference vector set to obtain the updated transient error parameters; update the self-heating hysteresis parameters based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters; Step 7: Apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.

[0006] Optionally, step one specifically includes: The embedded temperature sensor performs periodic sampling under the timer interrupt control of the embedded processor. The embedded processor reads the temperature sampling value output by the embedded temperature sensor each time the timer interrupt arrives and stores it as a temperature sampling sequence in chronological order. A load pulse schedule is set inside the embedded processor. The load pulse schedule includes a pulse start time index and the corresponding number of pulse duration sampling points. When the current sampling point index of the temperature sampling sequence is equal to the pulse start time index, the embedded processor continuously executes the no-wait loop operation instruction within the sampling period corresponding to the number of subsequent pulse continuous sampling points. The no-wait loop operation instruction is a set of continuous arithmetic operation instructions and does not enter a sleep state during execution, so that the embedded processor maintains a continuous operation state within the corresponding sampling period. During the execution of the no-wait loop operation instruction, the excitation flag value of the corresponding sampling point is set to 1, and the excitation flag value of the sampling point that has not executed the no-wait loop operation instruction is set to 0. Following the same sampling order as the temperature sampling sequence, the excitation marker values ​​are combined into a thermal excitation marker sequence of the same length as the temperature sampling sequence.

[0007] Optionally, step two specifically includes: According to the sampling order of the temperature sampling sequence, determine the corresponding sampling point index for each temperature sampling value in the temperature sampling sequence; Under the sampling point index, read the excitation tag value that matches the sampling point index from the thermal excitation tag sequence; The temperature sample values ​​and excitation marker values ​​are combined one-to-one according to the same sampling point index to form binary ordered data pairs, and then arranged in ascending order of sampling point index to form an excitation aligned temperature sequence composed of multiple binary ordered data pairs.

[0008] Optionally, step three specifically includes: The excitation start time is the pulse start time index, which is the sampling point index in the thermal excitation mark sequence where the excitation mark value changes from 0 to 1; Obtain the number of sampling points between two adjacent excitation start times; 30% of the sampling point interval is determined as the number of sampling points selected before or after the corresponding sampling point at the excitation start time, and together with the excitation start time as the center, they form a time window; When the excitation start time is the first excitation start time, the number of sampling points selected forward is the same as the number of sampling points selected backward; When the excitation start time is the last excitation start time, the number of sampling points selected backward is the same as the number of sampling points selected forward; The corresponding excitation-aligned temperature sequence within the time window is taken as an excitation response segment, and multiple excitation response segments are constructed sequentially according to the start time of each excitation, so that there is no overlap of sampling points between adjacent excitation response segments.

[0009] Optionally, step four specifically includes: Each excitation response fragment in the set of excitation response fragments is input into the improved RetNet model. The excitation response fragment is a sequence of binary ordered data pairs consisting of temperature sample values ​​and corresponding excitation label values. The fast hidden state channel includes a transient phase retention unit and a recovery phase retention unit. The transient phase retention unit processes the excitation response segment according to the sampling order. At the first sampling point, the transient hidden state is initialized to a zero vector. At each subsequent sampling point, the difference between the temperature value of the current sampling point and the temperature value of the previous sampling point is calculated. The difference and the current excitation flag value are input into the Tanh function to obtain the transient write vector, which is then superimposed with the transient hidden state saved at the previous sampling point to generate the first transient vector of the current sampling point. After detecting a sampling point where the excitation flag value changes from 1 to 0, the recovery phase retention unit starts to sequentially accumulate the temperature difference values ​​of subsequent consecutive sampling points to form a recovery accumulation amount. The recovery accumulation amount is then input into the Tanh function to obtain a recovery write vector, which is linearly combined with the first transient vector of the corresponding sampling point to generate a first recovery vector. The first transient vector and the first recovery vector are then concatenated to form the first stage fast concealment state. The slow hidden state channel includes a hysteresis phase retention unit and an accumulation phase retention unit. The hysteresis phase retention unit processes the excitation response segments according to the sampling order. At the first sampling point, the hysteresis hidden state is initialized to a zero vector. At each subsequent sampling point, the delay difference between the temperature value of the current sampling point and the temperature values ​​of a set number of previous sampling points is calculated. Only when the excitation flag value of the sampling point is 1, the delay difference is input into the Tanh function to obtain the hysteresis write vector, which is then superimposed with the hysteresis hidden state saved at the previous sampling point to generate the first hysteresis vector of the current sampling point. When the excitation flag value of the sampling point is 0, the hysteresis hidden state saved at the previous sampling point remains unchanged. Before processing the first stimulus response segment, the cumulative phase preservation unit initializes the cumulative vector to a zero vector. After each stimulus response segment is processed, the first hysteresis vector corresponding to the last sampling point of the stimulus response segment is superimposed and updated with the currently saved cumulative vector, and the first hysteresis vector and the updated cumulative vector are concatenated to form the first stage slow concealment state. The memory cross-reentry module is used to perform memory-state cross-modulation between the fast concealment state channel and the slow concealment state channel, and after completing the memory cross-modulation, it performs a reentry propagation on the excitation response segment to form a phase reentry closed-loop mechanism, generating the second-stage fast concealment state and the second-stage slow concealment state. The output module selects the second-stage fast-concealing state and the second-stage slow-concealing state corresponding to the last sampling point of each stimulus response segment, and outputs them as the fast-concealing state and slow-concealing state of the stimulus response segment, respectively.

[0010] Optionally, the phase reentry closed-loop mechanism specifically includes: Memory-state cross-modulation is performed between the fast and slow blanking states. The first transient vector in the fast blanking state is written into the slow blanking state channel, and the first transient vector and the hysteresis write vector are superimposed at the same sampling point to generate the modulated hysteresis vector. At the same time, the first hysteresis vector in the slow blanking state is written into the fast blanking state channel, and the first hysteresis vector and the transient write vector are superimposed at the same sampling point to generate the modulated transient vector. After completing the memory-state cross-modulation, a reentrancy propagation is performed on the excitation response segment. The modulated transient vector serves as the initial transient hidden state of the transient phase retention unit during the second round of traversal, and the modulated hysteresis vector serves as the initial hysteresis hidden state of the hysteresis phase retention unit during the second round of traversal. For the same excitation response segment, the update process of the transient phase retention unit, the recovery phase retention unit, the hysteresis phase retention unit, and the cumulative phase retention unit is executed again in the sampling order to generate the second-stage fast concealment state and the second-stage slow concealment state.

[0011] Optionally, step five specifically includes: A counterfactual fragment set is constructed based on the stimulus response fragment set. The counterfactual fragment set is obtained by copying each stimulus response fragment in the stimulus response fragment set and replacing all the stimulus marker values ​​of each sampling point in the stimulus response fragment with 0, while keeping the temperature sampling values ​​of each sampling point unchanged. The set of counterfactual fragments is input into the improved RetNet model to obtain the fast counterfactual hidden state and the slow counterfactual hidden state. The short-time response difference vector is obtained by subtracting the fast hidden state of the stimulus response segment from the fast hidden state of the corresponding counterfactual segment element by element. The long-time response difference vector is obtained by subtracting the slow hidden state of the stimulus response segment from the slow hidden state of the corresponding counterfactual segment element by element.

[0012] Optionally, step six specifically includes: Initialize both the transient error parameter and the self-heating hysteresis parameter to 0; The short-time response difference vectors in the set of short-time response difference vectors are accumulated element by element according to the vector dimension and averaged to obtain the short-time average difference vector; the short-time average difference vector is averaged element by element to obtain the short-time correction scalar, and the short-time correction scalar is added to the current transient error parameter to update the transient error parameter. The long-term response difference vectors in the set of long-term response difference vectors are accumulated element by element along the vector dimension and averaged to obtain the long-term average difference vector. The long-term average difference vector is then averaged element by element to obtain the long-term correction scalar. The long-term correction scalar is then added to the current self-heating hysteresis parameter to update the parameter.

[0013] Optionally, step seven specifically includes: Set the transient allowable range for the updated transient error parameters, and set the hysteresis allowable range for the updated self-heating hysteresis parameters; When the updated transient error parameter is greater than the upper limit of the transient allowable interval, the updated transient error parameter is limited to the upper limit of the transient allowable interval; when the updated transient error parameter is less than the lower limit of the transient allowable interval, the updated transient error parameter is limited to the lower limit of the transient allowable interval; otherwise, the updated transient error parameter remains unchanged, and the final transient error parameter is obtained. When the updated autothermal hysteresis parameter is greater than the upper limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the upper limit of the allowable hysteresis interval; when the updated autothermal hysteresis parameter is less than the lower limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the lower limit of the allowable hysteresis interval; otherwise, the updated autothermal hysteresis parameter remains unchanged, and the final autothermal hysteresis parameter is obtained.

[0014] The embedded temperature sensor parameter optimization system based on deep learning according to an embodiment of the present invention includes the following modules: The temperature acquisition module is used to acquire temperature sampling sequences and generate thermal excitation marker sequences by applying load pulses to the embedded processor. The sequence combination module is used to combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence according to the sampling order to construct an excitation-aligned temperature sequence. The fragment construction module is used to extract excitation response fragments from the excitation-aligned temperature sequence, centered on the excitation start time, and construct an excitation response fragment set. The modeling module is used to input the set of stimulus response fragments into the improved RetNet model. The memory cross-entry module performs memory cross-modulation between the fast hidden state channel and the slow hidden state channel and introduces a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state. The counterfact construction module is used to construct a counterfact set based on the stimulus response fragment set. The counterfact set is input into the improved RetNet model to obtain the counterfact fast hidden state and the counterfact slow hidden state. The counterfact set is then compared with the fast hidden state and the slow hidden state to obtain the short-time response difference vector set and the long-time response difference vector set. The parameter update module is used to update the transient error parameters based on the short-time response difference vector set to obtain the updated transient error parameters; and to update the self-heating hysteresis parameters based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters. The range constraint module is used to apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.

[0015] The beneficial effects of this invention are: This invention addresses the difficulty in separating transient temperature rise errors and self-heating hysteresis effects during on-chip temperature measurement by constructing a controllable load pulse to generate a thermal excitation marker sequence within an embedded processor. It employs an excitation-aligned temperature sequence and excitation response fragment set construction method to achieve strict synchronization between temperature sample values ​​and excitation marker values ​​under a unified sampling point index, ensuring structural consistency in thermal response modeling during data preprocessing. In the modeling stage, an improved RetNet model is introduced, constructing a dual-channel phase-splitting structure with fast and slow hidden state channels. Transient phase preservation units, recovery phase preservation units, hysteresis phase preservation units, and cumulative phase preservation units independently model thermal features at different time scales. A memory-based cross-entry module is utilized in the fast and slow hidden state channels. Memory-state cross-modulation is performed between state channels, and a phase reentry closed-loop mechanism is introduced, enabling the first-stage fast concealment state and the first-stage slow concealment state to complete secondary coupling and reconstruction within the same excitation response segment. To address environmental temperature drift and background disturbance interference, this invention constructs a counterfactual segment set and compares each element of the counterfactual fast and slow concealment states with the original fast and slow concealment states to obtain short-time response difference vector sets and long-time response difference vector sets, structurally separating the excitation-driven thermal response from the non-excitation background changes. During the parameter update stage, transient error parameters are updated based on the short-time response difference vector set, and self-thermal hysteresis parameters are updated based on the long-time response difference vector set. A range constraint module limits the range of transient error parameters and self-thermal hysteresis parameters to prevent parameter divergence. Ultimately, this achieves structured, layered compensation for transient and self-thermal hysteresis errors in embedded temperature sensors, improving temperature measurement stability, online optimization accuracy, and long-term operational robustness. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is an overall flowchart of the deep learning-based embedded temperature sensor parameter optimization method proposed in this invention. Figure 2 This is a schematic diagram of the improved RetNet model structure of the deep learning-based embedded temperature sensor parameter optimization method proposed in this invention. Detailed Implementation

[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0018] refer to Figure 1 A deep learning-based method for optimizing parameters of embedded temperature sensors includes the following steps: Step 1: Acquire the temperature sampling sequence and generate a thermal excitation marker sequence by applying a load pulse to the embedded processor; Step 2: According to the sampling order, combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence to construct an excitation-aligned temperature sequence; Step 3: Using the excitation start time in the thermal excitation marker sequence as the center, extract the excitation response segments from the excitation aligned temperature sequence to construct an excitation response segment set; Step 4: Input the set of stimulus response fragments into the improved RetNet model. The improved RetNet model includes a fast hidden state channel, a slow hidden state channel, a memory crossover re-entry module, and an output module. The memory crossover re-entry module is used to perform memory cross-modulation between the fast hidden state channel and the slow hidden state channel and introduce a phase re-entry closed-loop mechanism, outputting the fast hidden state and the slow hidden state. Step 5: Construct a counterfactual fragment set based on the stimulus response fragment set. Input the counterfactual fragment set into the improved RetNet model to obtain the counterfactual fast hidden state and the counterfactual slow hidden state. Compare these with the fast hidden state and the slow hidden state respectively to obtain the short-time response difference vector set and the long-time response difference vector set. Step 6: Update the transient error parameters based on the short-time response difference vector set to obtain the updated transient error parameters; update the self-heating hysteresis parameters based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters; Step 7: Apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.

[0019] In this embodiment, step one specifically includes: The embedded temperature sensor performs periodic sampling under the timer interrupt control of the embedded processor. The embedded processor reads the temperature sampling value output by the embedded temperature sensor each time the timer interrupt arrives and stores it as a temperature sampling sequence in chronological order. A load pulse schedule is set inside the embedded processor. The load pulse schedule includes the pulse start time index and the corresponding number of pulse duration sampling points. When the current sampling point index of the temperature sampling sequence is equal to the pulse start time index, the embedded processor continuously executes the no-wait loop operation instruction within the sampling period corresponding to the number of subsequent pulse continuous sampling points. The no-wait loop operation instruction is a set of continuous arithmetic operation instructions and does not enter a sleep state during execution, so that the embedded processor maintains a continuous operation state within the corresponding sampling period. During the execution of the no-wait loop operation instruction, the excitation flag value of the corresponding sampling point is set to 1, and the excitation flag value of the sampling point that has not executed the no-wait loop operation instruction is set to 0; Following the same sampling order as the temperature sampling sequence, the excitation marker values ​​are assembled into a thermal excitation marker sequence of the same length as the temperature sampling sequence; In this invention, the wait-free loop operation instruction is a set of operation instructions that are executed continuously inside the embedded processor and do not contain sleep instructions, interrupt waiting instructions, or peripheral blocking instructions, used to improve the processor core power consumption within a limited time window. Specifically, the wait-free loop operation instruction includes: first, a continuous integer multiplication and addition operation loop, such as performing repeated iterative calculations of multiplication and addition on integer data in a register; second, a floating-point matrix multiplication loop, such as performing small-scale matrix multiplications on pre-stored matrix data and cyclically overwriting and writing to the cache; third, a cyclic redundancy check operation, such as repeatedly performing cyclic redundancy check calculations on data in the memory buffer and writing the result back to the register. All of the above operations are executed in a single-threaded high-priority state to ensure that the processor is continuously in a high-operational-occupancy state within the sampling period corresponding to the number of pulse continuous sampling points.

[0020] By applying a controllable load pulse to the embedded processor, the processor's power consumption can be repeatedly subjected to thermal perturbations within a preset time period, thereby forming a thermal response feature with a clear time stamp in the temperature sampling sequence. This method does not require an external heater or additional hardware structure, and can generate identifiable thermal excitations relying only on existing processor resources, thus improving system integration. Using this controllable thermal perturbation, the sensor's self-heating hysteresis effect and transient error can be separated without an external reference temperature source, improving parameter identification stability and online optimization accuracy, while reducing hardware costs and enhancing the feasibility of the method.

[0021] In this embodiment, step two specifically involves: According to the sampling order of the temperature sampling sequence, determine the corresponding sampling point index for each temperature sampling value in the temperature sampling sequence; Under the sampling point index, read the excitation tag value that matches the sampling point index from the thermal excitation tag sequence; Temperature sample values ​​and excitation marker values ​​are matched one-to-one according to the same sampling point index to form binary ordered data pairs, and then arranged in ascending order of sampling point index to form an excitation aligned temperature sequence composed of multiple binary ordered data pairs. In this invention, the temperature sampling sequence and the thermal excitation marker sequence are combined in a one-to-one correspondence based on a unified sampling point index, avoiding the use of independent timestamp matching or post-time correction processing. This ensures strict synchronization between the temperature sampling value and the corresponding load pulse state from the data structure level. By constructing an excitation-aligned temperature sequence composed of binary ordered data pairs, each sampling point simultaneously contains temperature information and excitation state information. This provides a clear data boundary for improving the RetNet model to distinguish between the excitation stage and the non-excitation stage within the same input sequence, thereby improving the accuracy and stability of separating self-thermal hysteresis and transient error.

[0022] In this embodiment, step three specifically includes: The excitation start time is the pulse start time index, which is the sampling point index in the thermal excitation mark sequence where the excitation mark value changes from 0 to 1; Obtain the number of sampling points between two adjacent excitation start times; 30% of the sampling point interval is determined as the number of sampling points selected before or after the corresponding sampling point at the excitation start time, and together with the excitation start time as the center, they form a time window; When the excitation start time is the first excitation start time, the number of sampling points selected forward is the same as the number of sampling points selected backward, and the number of consistent sampling points is based on the smaller of the number of sampling points that can be obtained before and after the excitation start time. When the excitation start time is the last excitation start time, the number of sampling points selected backward is the same as the number of sampling points selected forward, and the number of consistent sampling points is the smaller of the number of sampling points that can be obtained before and after the excitation start time. The corresponding excitation-aligned temperature sequence within the time window is taken as an excitation response segment, and multiple excitation response segments are constructed sequentially according to the start time of each excitation, so that there is no overlap of sampling points between adjacent excitation response segments; This invention determines the time window length by using the number of sampling points between two adjacent excitation start times as a benchmark and a fixed ratio. This allows the truncation range of the excitation response segment to adaptively adjust with the pulse interval, thereby ensuring that the excitation response segments constructed under different load pulse intervals have consistent time scale characteristics. By using 30% of the number of sampling points between the sampling points as the number of sampling points selected forward and backward, the time window length is always smaller than the interval between adjacent excitation start times, avoiding overlap between segments and improving sample independence and data validity. At the same time, symmetrical selection is performed at the first or last excitation start time using the smaller of the number of available sampling points before and after, ensuring the integrity and stability of window construction in boundary cases, avoiding out-of-bounds truncation or abnormal sample lengths, thereby improving the structural consistency of the input data of the improved RetNet model and the stability of model training.

[0023] In this embodiment, step four specifically includes: Each excitation response fragment in the excitation response fragment set is input into the improved RetNet model. The excitation response fragment is a sequence of binary ordered data pairs consisting of temperature sample values ​​and corresponding excitation label values. The fast hidden state channel includes a transient phase retention unit and a recovery phase retention unit. The transient phase retention unit processes the excitation response segment according to the sampling order. At the first sampling point, the transient hidden state is initialized to a zero vector. At each subsequent sampling point, the difference between the temperature value of the current sampling point and the temperature value of the previous sampling point is calculated. The difference and the current excitation flag value are input together into the Tanh function to obtain the transient write vector, which is superimposed with the transient hidden state saved at the previous sampling point to generate the first transient vector of the current sampling point. After detecting a sampling point where the excitation flag value changes from 1 to 0, the phase recovery retention unit starts to sequentially accumulate the temperature difference values ​​of subsequent consecutive sampling points to form a recovery accumulation amount. The recovery accumulation amount is then input into the Tanh function to obtain the recovery write vector, which is linearly combined with the first transient vector of the corresponding sampling point to generate the first recovery vector. The first transient vector and the first recovery vector are then concatenated to form the first stage fast concealment state. The slow hidden state channel includes a hysteresis phase retention unit and a cumulative phase retention unit. The hysteresis phase retention unit processes the excitation response segments according to the sampling order. At the first sampling point, the hysteresis hidden state is initialized to a zero vector. At each subsequent sampling point, the delay difference between the temperature value of the current sampling point and the temperature values ​​of a set number of previous sampling points is calculated. Only when the excitation flag value of the sampling point is 1, the delay difference is input into the Tanh function to obtain the hysteresis write vector, which is then superimposed with the hysteresis hidden state saved at the previous sampling point to generate the first hysteresis vector of the current sampling point. When the excitation flag value of the sampling point is 0, the hysteresis hidden state saved at the previous sampling point remains unchanged. Before processing the first excitation response segment, the cumulative phase preservation unit initializes the cumulative vector to a zero vector. After each excitation response segment is processed, the first hysteresis vector corresponding to the last sampling point of the excitation response segment is superimposed and updated with the currently saved cumulative vector, and the first hysteresis vector and the updated cumulative vector are concatenated to form the first stage slow concealment state. The memory crossover reentrancy module is used to perform memory crossover modulation between the fast concealment state channel and the slow concealment state channel, and after completing the memory crossover modulation, it performs a reentrancy propagation on the excitation response segment to form a phase reentrancy closed-loop mechanism, generating the second-stage fast concealment state and the second-stage slow concealment state. The output module selects the second-stage fast concealment state and the second-stage slow concealment state corresponding to the last sampling point of each stimulus response segment, and outputs them as the fast concealment state and slow concealment state of the stimulus response segment, respectively. In this invention, the improved RetNet model introduces a dual-channel phase splitting structure and a phase re-entry closed-loop mechanism on the basis of the traditional Retention structure. The fast hidden state channel is split into a transient phase preservation unit and a recovery phase preservation unit. The transient phase preservation unit models the temperature change between adjacent sampling points, with a sampling frequency of 1000Hz and a fixed 32-dimensional dimension. The recovery phase preservation unit, after the excitation marker value changes from 1 to 0, sequentially accumulates the temperature difference of 20 consecutive sampling points and maps it to a 32-dimensional recovery write vector through the Tanh function, thus forming a 64-dimensional first-stage fast hidden state. The slow hidden state channel includes a hysteresis phase preservation unit and a cumulative phase preservation unit. The hysteresis phase preservation unit uses a fixed number of preceding sampling points of 8 for delay difference calculation, and the hysteresis hidden state dimension is set to 32 dimensions. The cumulative phase preservation unit updates the first hysteresis vector of the last sampling point of each excitation response segment by cross-segment superposition, and the cumulative vector dimension is also set to 32 dimensions. After concatenation, a 64-dimensional first-stage slow hidden state is formed. The first improvement of the model is that it transforms the single R... The retention memory structure is split into four phase-preserving units: transient, recovery, hysteresis, and accumulation. This allows thermal transient response, self-heating recovery process, cross-sampling delay effect, and cross-segment cumulative drift to be modeled in independent memory spaces, improving thermal dynamic separation capability. The second improvement is the introduction of a memory-state cross-reentrancy module. The first transient vector in the fast hidden state of the first stage is directly written into the slow hidden state channel, and the first hysteresis vector in the slow hidden state of the first stage is written into the fast hidden state channel. Reentrancy propagation is performed once for the same stimulus response segment, forming a closed-loop memory reconstruction structure. This achieves dual-scale coupling correction driven by thermal stimulus while maintaining linear growth in computational complexity. The third improvement is stimulus-driven freezing. When the stimulus flag value is 0, the updates of the hysteresis phase-preserving unit and the accumulation phase-preserving unit are stopped, and only the fast hidden state update is retained. This suppresses the interference of environmental temperature drift on self-heating parameter modeling from a structural level. Through these improvements, the model can complete thermal response modeling on an embedded low-computing-power platform with a hidden state scale of no more than 128 dimensions, significantly improving the separation accuracy and convergence stability of transient error parameters and self-heating hysteresis parameters.

[0024] In this embodiment, the phase reentry closed-loop mechanism is specifically as follows: Memory-state cross-modulation is performed between the fast and slow blanking states. The first transient vector in the fast blanking state is written into the slow blanking state channel, and the first transient vector and the hysteresis write vector are superimposed at the same sampling point to generate the modulated hysteresis vector. At the same time, the first hysteresis vector in the slow blanking state is written into the fast blanking state channel, and the first hysteresis vector and the transient write vector are superimposed at the same sampling point to generate the modulated transient vector. After completing the memory-state cross-modulation, a reentrancy propagation is performed on the excitation response segment. The modulated transient vector serves as the initial transient hidden state of the transient phase-preserving unit during the second round of traversal, and the modulated hysteresis vector serves as the initial hysteresis hidden state of the hysteresis phase-preserving unit during the second round of traversal. For the same excitation response segment, the update process of the transient phase retention unit, the recovery phase retention unit, the hysteresis phase retention unit and the cumulative phase retention unit are executed again in the sampling order to generate the second-stage fast concealment state and the second-stage slow concealment state. The phase reentrancy closed-loop mechanism performs memory-state cross-modulation between the fast and slow hidden states in the first stage and performs a reentrancy propagation on the same excitation response segment, enabling the transient thermal response and hysteresis thermal response, which were originally modeled independently, to be re-coupled and reconstructed within the same segment. The first-stage propagation only reflects the unidirectional recursive result, which is difficult to fully characterize the reverse effect of self-heating accumulation on the transient temperature rise. By writing the first transient vector into the slow hidden state channel and participating in the hysteresis writing superposition, and simultaneously writing the first hysteresis vector into the fast hidden state channel and participating in the transient superposition, dual-channel information backflow can be achieved without increasing the number of model layers, thereby enhancing the correlation strength between thermal features at different time scales from a structural level. The reentrancy propagation is only executed once, avoiding the computational instability and overfitting risks caused by multiple rounds of loops, and improving the sufficiency of feature representation while maintaining linear time complexity. The phase reentrancy closed-loop mechanism can improve the distinguishability between short-time response difference and long-time response difference, making the estimation of transient error parameters and self-heating hysteresis parameters more stable, reducing the impact of temperature drift interference on parameter optimization results, thereby improving the accuracy and robustness of embedded temperature sensor parameter optimization.

[0025] In this embodiment, step five specifically includes: The counterfactual fragment set is constructed based on the stimulus response fragment set. The counterfactual fragment set is obtained by copying each stimulus response fragment in the stimulus response fragment set and replacing all the stimulus marker values ​​of each sampling point in the stimulus response fragment with 0, while keeping the temperature sampling values ​​of each sampling point unchanged. By inputting the set of counterfactual fragments into the improved RetNet model, we obtain the fast counterfactual hidden state and the slow counterfactual hidden state. The short-time response difference vector is obtained by subtracting the fast hidden state of the stimulus response segment from the fast hidden state of the corresponding counterfactual segment element by element. The long-time response difference vector is obtained by subtracting the slow hidden state of the stimulus response segment from the slow hidden state of the corresponding counterfactual segment element by element. In step five, this invention constructs a set of counterfactual fragments to achieve a structured separation of the excitation-driven thermal response from environmental background changes. Specifically, for each excitation response fragment, while maintaining complete consistency in the temperature sampling value sequence, the excitation marker values ​​of all sampling points are replaced with 0, forming a counterfactual fragment that is identical to the original fragment in terms of temperature trajectory but suppressed in terms of excitation conditions. Since the slow hidden state channel in the improved RetNet model only performs hysteresis writing and cumulative updates when the excitation marker value is 1, the counterfactual fragment does not generate excitation-driven hysteresis memory in the slow hidden state channel, thus forming a baseline state that can be compared with the original excitation path. The corresponding counterfactual fragments are input into the improved RetNet model to obtain paired counterfactual fast hidden states and counterfactual slow hidden states, and the short-time response difference vector and long-time response difference vector are calculated. Through vector-level comparison operations, the transient changes and hysteresis cumulative changes caused by the excitation can be accurately extracted while maintaining the consistency of the internal structure of the model, providing a stable differential feature basis for updating transient error parameters and self-thermal hysteresis parameters.

[0026] In this embodiment, step six specifically includes: Initialize both the transient error parameter and the self-heating hysteresis parameter to 0; The short-time response difference vectors in the short-time response difference vector set are accumulated element by element according to the vector dimension and averaged to obtain the short-time average difference vector; the short-time correction scalar is obtained by averaging the short-time average difference vector element by element, and the short-time correction scalar is added to the current transient error parameter to update the transient error parameter. The long-term response difference vectors in the long-term response difference vector set are summed element by element along the vector dimension and averaged to obtain the long-term average difference vector. The long-term average difference vector is then averaged element by element to obtain the long-term correction scalar. The long-term correction scalar is then added to the current self-heating hysteresis parameter to update the parameter. In this invention, the transient error parameter is a scalar compensation coefficient used to correct the rapid temperature rise offset generated by the embedded temperature sensor at the moment of load pulse excitation. Its mathematical form is a bias parameter that additively corrects the temperature measurement output. The self-thermal hysteresis parameter is a scalar adjustment coefficient used to characterize the heat accumulation and heat dissipation hysteresis effect caused by the continuous operation of the processor. Its mathematical form is a hysteresis weight parameter that proportionally adjusts the change amplitude of the temperature response with time delay. Specifically, in the temperature output calculation process, the transient error parameter is first additively corrected on the temperature sampling value of the current sampling point to obtain the transient corrected temperature value. Then, based on the transient corrected temperature value, the difference between it and the average temperature of the previous 5 sampling points is calculated. This difference is then multiplied by the self-thermal hysteresis parameter and superimposed on the transient corrected temperature value to obtain the final corrected temperature value, thereby realizing the hierarchical compensation for transient offset and heat accumulation hysteresis effect. By aggregating the short-time response difference vector and the long-time response difference vector and converting them into correction scalars, the two parameters mentioned above are updated respectively. This allows the transient error parameter to mainly reflect the rapid deviation in the initial stage of excitation, and the self-heating hysteresis parameter to mainly reflect the heat accumulation trend across segments. This separates and optimizes the transient error and the long-term self-heating effect at the parameter level. This update method avoids directly correcting the original temperature sequence. Instead, it performs reverse parameter correction based on the differential representation extracted from the deep model. This makes the measurement results of the embedded temperature sensor under different load conditions closer to the actual chip junction temperature, realizing structured compensation for transient error and self-heating hysteresis error, and improving the stability and long-term accuracy of temperature measurement.

[0027] In this embodiment, step seven specifically includes: Set the transient allowable range for the updated transient error parameters, and set the hysteresis allowable range for the updated self-heating hysteresis parameters; When the updated transient error parameter is greater than the upper limit of the transient allowable interval, the updated transient error parameter is limited to the upper limit of the transient allowable interval; when the updated transient error parameter is less than the lower limit of the transient allowable interval, the updated transient error parameter is limited to the lower limit of the transient allowable interval; otherwise, the updated transient error parameter remains unchanged, and the final transient error parameter is obtained. When the updated autothermal hysteresis parameter is greater than the upper limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the upper limit of the allowable hysteresis interval; when the updated autothermal hysteresis parameter is less than the lower limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the lower limit of the allowable hysteresis interval; otherwise, the updated autothermal hysteresis parameter remains unchanged, and the final autothermal hysteresis parameter is obtained. In this invention, the transient allowable range is set to -0.50℃ to 0.50℃, and the hysteresis allowable range is set to 0 to 0.50℃. The transient allowable range is used to limit the compensation amplitude of the transient error parameter during the rapid temperature transition process induced by the processor load pulse, so that the transient correction amount generated by a single excitation does not exceed the typical dynamic error range of the embedded temperature sensor. The hysteresis allowable range is used to limit the compensation intensity of the self-heating hysteresis parameter under the condition of multiple excitation accumulation, so that the hysteresis correction ratio does not exceed the engineering upper limit of the influence of on-chip self-heating on the temperature measurement result. By limiting the parameters within the range, the parameter divergence caused by multiple iterations is prevented, and the final transient error parameter and the final self-heating hysteresis parameter are within the physical adjustment range that the embedded temperature sensor can achieve.

[0028] refer to Figure 1 A deep learning-based embedded temperature sensor parameter optimization system includes the following modules: The temperature acquisition module is used to acquire temperature sampling sequences and generate thermal excitation marker sequences by applying load pulses to the embedded processor. The sequence combination module is used to combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence according to the sampling order to construct an excitation-aligned temperature sequence. The fragment construction module is used to extract excitation response fragments from the excitation-aligned temperature sequence, centered on the excitation start time, and construct an excitation response fragment set. The modeling module is used to input the set of stimulus response fragments into the improved RetNet model. The memory cross-entry module performs memory cross-modulation between the fast hidden state channel and the slow hidden state channel and introduces a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state. The counterfact construction module is used to construct a counterfact set based on the stimulus response fragment set. The counterfact set is input into the improved RetNet model to obtain the counterfact fast hidden state and the counterfact slow hidden state. The counterfact set is then compared with the fast hidden state and the slow hidden state to obtain the short-time response difference vector set and the long-time response difference vector set. The parameter update module is used to update the transient error parameters based on the short-time response difference vector set to obtain the updated transient error parameters; and to update the self-heating hysteresis parameters based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters. The range constraint module is used to apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.

[0029] Example 1: To verify the feasibility of this invention in practice, an embedded edge computing terminal was selected as the application scenario. This terminal integrates a processor core, an on-chip embedded temperature sensor, and a power management unit. During long-term operation, the device needs to dynamically adjust the main frequency and power supply voltage according to the chip temperature to avoid overheating that could lead to performance degradation or reduced reliability. In practical applications, this terminal experiences significant load fluctuations, such as periodically performing data compression, matrix calculations, or cache verification tasks. When the processor enters a high-load operating state, the core power consumption rises rapidly, and the chip junction temperature increases accordingly. However, due to the influence of structural thermal resistance and sampling delay, the temperature measured by the embedded temperature sensor exhibits transient deviations and self-thermal hysteresis compared to the actual junction temperature. This leads to misjudgments in the temperature control strategy, frequently triggering frequency reduction or delayed frequency reduction, affecting the overall performance and stability of the device.

[0030] In traditional solutions, this terminal uses a fixed linear compensation method to calibrate the temperature sampling values. This involves obtaining a constant bias and a fixed hysteresis coefficient through factory calibration to simply correct the real-time temperature value. However, under continuous load pulse scenarios, the actual temperature error exhibits significant nonlinearity and multi-timescale coupling characteristics. For example, in one test, within the first 50 milliseconds after the processor transitioned from idle to continuous computing, the actual junction temperature rose by 2.8°C, while the embedded temperature sensor reading only rose by 2.1°C, resulting in a transient error of 0.7°C. Within 200 milliseconds after the load ended, the actual junction temperature returned to near its initial value, while the sensor reading still lagged by approximately 0.4°C. Traditional linear compensation methods cannot simultaneously correct both types of errors, causing frequent oscillations in the temperature control logic.

[0031] The method of this invention is embedded in the terminal and fully trained and verified. The experimental environment is a normal room temperature, the equipment runs continuously, no external reference temperature source is used, and training samples are constructed only by on-chip temperature sensor and load pulse.

[0032] In this embodiment, the temperature sampling sequence is first acquired through the temperature acquisition module. The embedded temperature sensor performs periodic sampling at a sampling frequency of 1000Hz under the control of the processor's timer interrupt, acquiring 1000 temperature sampling values ​​per second. Subsequently, a load pulse schedule is set inside the processor, triggering a non-waiting loop operation instruction for 100 sampling points every 2000 sampling points to form a controllable thermal excitation. After running continuously for 60 seconds, a total of 30 load pulses are generated, obtaining 60,000 temperature sampling values, forming a temperature sampling sequence and an equal-length thermal excitation marker sequence.

[0033] Subsequently, the sequence combination module constructs an excitation-aligned temperature sequence, combining each temperature sample value with its corresponding excitation marker value according to the sampling point index. The segment construction module extracts excitation response segments based on the excitation start time; it selects sampling points before and after the excitation start time according to 30% of the interval between adjacent excitation start times to form excitation response segments; a total of 30 excitation response segments are constructed from 30 pulses, forming an excitation response segment set.

[0034] During the modeling phase, the set of stimulus response segments is input into the improved RetNet model. The transient phase preservation unit in the fast hidden state channel performs Tanh mapping on the temperature difference between adjacent sampling points and updates it by superposition. The recovery phase preservation unit accumulates and maps the temperature difference between consecutive sampling points after the stimulus flag value changes from 1 to 0. The hysteresis phase preservation unit in the slow hidden state channel performs delayed differential writing when the stimulus flag value is 1. The cumulative phase preservation unit performs cross-segment superposition on the first hysteresis vector of the last sampling point of each segment. The memory cross-reentry module performs memory-state cross-modulation between the first stage fast hidden state and the first stage slow hidden state, and performs a reentry propagation once on the same stimulus response segment to generate the second stage fast hidden state and the second stage slow hidden state. The output module selects the second stage fast hidden state and the second stage slow hidden state corresponding to the last sampling point of each stimulus response segment as the segment feature output.

[0035] Subsequently, a set of counterfactual fragments is constructed, and the excitation marker values ​​of each excitation response fragment are all replaced with 0, while the temperature sampling values ​​remain unchanged. The set of counterfactual fragments is then input into the improved RetNet model to obtain the counterfactual fast hidden state and the counterfactual slow hidden state. The short-time response difference vector set and the long-time response difference vector set are obtained by subtracting them element by element.

[0036] During the parameter update phase, the transient error parameter and the self-heating hysteresis parameter are initialized to 0. The 30 short-time response difference vectors are then summed element-wise and averaged, and the average vector is then averaged element-wise to obtain a short-time correction scalar of 0.43℃. The same process is applied to the 30 long-time response difference vectors to obtain a long-time correction scalar of 0.18. The updated transient error parameter is 0.43℃, and the updated self-heating hysteresis parameter is 0.18. Constrained by the range constraint module, the transient error parameter remains between -0.50℃ and 0.50℃, and the self-heating hysteresis parameter remains between 0 and 0.50℃, with the final parameters being 0.43℃ and 0.18, respectively.

[0037] To verify the compensation effect, the equipment was run for another 30 minutes after training, and the error between the actual junction temperature and the corrected temperature measurement was recorded. The actual junction temperature was measured using a high-precision internal reference thermistor, with an error range of less than ±0.05℃. The comparison data are as follows: In continuous load switching scenarios, the average transient error of the traditional linear compensation method is 0.62℃, the maximum transient error is 0.81℃, and the average steady-state hysteresis error is 0.37℃. After adopting the method of the present invention, the average transient error is reduced to 0.21℃, the maximum transient error is 0.34℃, and the average steady-state hysteresis error is 0.12℃.

[0038] In a scenario where calculations are performed continuously for 10 minutes, the standard deviation of temperature reading fluctuation using the traditional method is 0.28℃, while the standard deviation of fluctuation using the method of this invention is 0.09℃, representing a reduction of approximately 67.9%.

[0039] As can be seen from the above embodiments, this invention constructs an excitation-aligned temperature sequence, an excitation-response fragment set, and a counterfactual fragment set, and utilizes an improved RetNet model for dual-channel phase modeling and a phase reentry closed-loop mechanism. This achieves structured separation and online parameter optimization of transient errors and self-thermal hysteresis effects, enabling dynamic compensation of embedded temperature sensors without the need for an external reference temperature source, making temperature measurement results closer to the true junction temperature. Therefore, this embodiment fully demonstrates that this invention can effectively reduce transient and self-thermal hysteresis errors under complex load pulse environments, improve temperature measurement accuracy and stability, solve the problem that traditional fixed compensation methods cannot cope with nonlinear multi-timescale thermal dynamics, and verify the feasibility and engineering application value of this invention on embedded low-computing-power platforms.

[0040] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for optimizing parameters of an embedded temperature sensor based on deep learning, characterized in that, Includes the following steps: Step 1: Acquire the temperature sampling sequence and generate a thermal excitation marker sequence by applying a load pulse to the embedded processor; Step 2: According to the sampling order, combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence to construct an excitation-aligned temperature sequence; Step 3: Using the excitation start time in the thermal excitation mark sequence as the center, extract the excitation response segment from the excitation alignment temperature sequence to construct an excitation response segment set; Step 4: Input the set of stimulus response fragments into the improved RetNet model. The improved RetNet model includes a fast hidden state channel, a slow hidden state channel, a memory crossover re-entry module, and an output module. The memory crossover re-entry module is used to perform memory crossover modulation between the fast hidden state channel and the slow hidden state channel and introduce a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state. Step 5: Construct a counterfactual fragment set based on the stimulus response fragment set, input the counterfactual fragment set into the improved RetNet model to obtain the counterfactual fast hidden state and the counterfactual slow hidden state, and compare them with the fast hidden state and the slow hidden state respectively to obtain the short-time response difference vector set and the long-time response difference vector set. Step 6: Update the transient error parameters based on the short-time response difference vector set to obtain the updated transient error parameters; The self-heating hysteresis parameters are updated based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters; Step 7: Apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.

2. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step one specifically involves: The embedded temperature sensor performs periodic sampling under the timer interrupt control of the embedded processor. The embedded processor reads the temperature sampling value output by the embedded temperature sensor each time the timer interrupt arrives and stores it as a temperature sampling sequence in chronological order. A load pulse schedule is set inside the embedded processor. The load pulse schedule includes a pulse start time index and the corresponding number of pulse duration sampling points. When the current sampling point index of the temperature sampling sequence is equal to the pulse start time index, the embedded processor continuously executes the no-wait loop operation instruction within the sampling period corresponding to the number of subsequent pulse continuous sampling points. The no-wait loop operation instruction is a set of continuous arithmetic operation instructions and does not enter a sleep state during execution, so that the embedded processor maintains a continuous operation state within the corresponding sampling period. During the execution of the no-wait loop operation instruction, the excitation flag value of the corresponding sampling point is set to 1, and the excitation flag value of the sampling point that has not executed the no-wait loop operation instruction is set to 0. Following the same sampling order as the temperature sampling sequence, the excitation marker values ​​are combined into a thermal excitation marker sequence of the same length as the temperature sampling sequence.

3. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step two specifically involves: According to the sampling order of the temperature sampling sequence, determine the corresponding sampling point index for each temperature sampling value in the temperature sampling sequence; Under the sampling point index, read the excitation tag value that matches the sampling point index from the thermal excitation tag sequence; The temperature sample values ​​and excitation marker values ​​are combined one-to-one according to the same sampling point index to form binary ordered data pairs, and arranged sequentially according to the ascending order of the sampling point index to form an excitation aligned temperature sequence composed of multiple binary ordered data pairs.

4. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step three specifically involves: The excitation start time is the pulse start time index, which is the sampling point index in the thermal excitation mark sequence where the excitation mark value changes from 0 to 1; Obtain the number of sampling points between two adjacent excitation start times; 30% of the sampling point interval is determined as the number of sampling points selected before or after the corresponding sampling point at the excitation start time, and together they form a time window with the excitation start time as the center. When the excitation start time is the first excitation start time, the number of sampling points selected forward is the same as the number of sampling points selected backward; When the excitation start time is the last excitation start time, the number of sampling points selected backward is the same as the number of sampling points selected forward; The corresponding excitation-aligned temperature sequence within the time window is taken as an excitation response segment, and multiple excitation response segments are constructed sequentially according to the start time of each excitation, so that there is no overlap of sampling points between adjacent excitation response segments.

5. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step four specifically involves: Each excitation response fragment in the set of excitation response fragments is input into the improved RetNet model. The excitation response fragment is a sequence of binary ordered data pairs consisting of temperature sample values ​​and corresponding excitation label values. The fast hidden state channel includes a transient phase retention unit and a recovery phase retention unit. The transient phase retention unit processes the excitation response segment according to the sampling order. At the first sampling point, the transient hidden state is initialized to a zero vector. At each subsequent sampling point, the difference between the temperature value of the current sampling point and the temperature value of the previous sampling point is calculated. The difference and the current excitation flag value are input into the Tanh function to obtain the transient write vector, which is then superimposed with the transient hidden state saved at the previous sampling point to generate the first transient vector of the current sampling point. After detecting a sampling point where the excitation flag value changes from 1 to 0, the recovery phase retention unit starts to sequentially accumulate the temperature difference values ​​of subsequent consecutive sampling points to form a recovery accumulation amount. The recovery accumulation amount is then input into the Tanh function to obtain a recovery write vector, which is linearly combined with the first transient vector of the corresponding sampling point to generate a first recovery vector. The first transient vector and the first recovery vector are then concatenated to form the first stage fast concealment state. The slow hidden state channel includes a hysteresis phase retention unit and an accumulation phase retention unit. The hysteresis phase retention unit processes the excitation response segments according to the sampling order. At the first sampling point, the hysteresis hidden state is initialized to a zero vector. At each subsequent sampling point, the delay difference between the temperature value of the current sampling point and the temperature values ​​of a set number of previous sampling points is calculated. Only when the excitation flag value of the sampling point is 1, the delay difference is input into the Tanh function to obtain the hysteresis write vector, which is then superimposed with the hysteresis hidden state saved at the previous sampling point to generate the first hysteresis vector of the current sampling point. When the excitation flag value of the sampling point is 0, the hysteresis hidden state saved at the previous sampling point remains unchanged. Before processing the first stimulus response segment, the cumulative phase preservation unit initializes the cumulative vector to a zero vector. After each stimulus response segment is processed, the first hysteresis vector corresponding to the last sampling point of the stimulus response segment is superimposed and updated with the currently saved cumulative vector, and the first hysteresis vector and the updated cumulative vector are concatenated to form the first stage slow concealment state. The memory cross-reentry module is used to perform memory-state cross-modulation between the fast concealment state channel and the slow concealment state channel, and after completing the memory cross-modulation, it performs a reentry propagation on the excitation response segment to form a phase reentry closed-loop mechanism, generating the second-stage fast concealment state and the second-stage slow concealment state. The output module selects the second-stage fast-concealing state and the second-stage slow-concealing state corresponding to the last sampling point of each stimulus response segment, and outputs them as the fast-concealing state and slow-concealing state of the stimulus response segment, respectively.

6. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 5, characterized in that, The phase reentry closed-loop mechanism is specifically as follows: Memory-state cross-modulation is performed between the fast and slow blanking states. The first transient vector in the fast blanking state is written into the slow blanking state channel, and the first transient vector and the hysteresis write vector are superimposed at the same sampling point to generate the modulated hysteresis vector. At the same time, the first hysteresis vector in the slow blanking state is written into the fast blanking state channel, and the first hysteresis vector and the transient write vector are superimposed at the same sampling point to generate the modulated transient vector. After completing the memory-state cross-modulation, a reentrancy propagation is performed on the excitation response segment. The modulated transient vector serves as the initial transient hidden state of the transient phase retention unit during the second round of traversal, and the modulated hysteresis vector serves as the initial hysteresis hidden state of the hysteresis phase retention unit during the second round of traversal. For the same excitation response segment, the update process of the transient phase retention unit, the recovery phase retention unit, the hysteresis phase retention unit, and the cumulative phase retention unit is executed again in the sampling order to generate the second-stage fast concealment state and the second-stage slow concealment state.

7. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step five specifically involves: A counterfactual fragment set is constructed based on the stimulus response fragment set. The counterfactual fragment set is obtained by copying each stimulus response fragment in the stimulus response fragment set and replacing all the stimulus marker values ​​of each sampling point in the stimulus response fragment with 0, while keeping the temperature sampling values ​​of each sampling point unchanged. The set of counterfactual fragments is input into the improved RetNet model to obtain the fast counterfactual hidden state and the slow counterfactual hidden state. The short-time response difference vector is obtained by subtracting the fast hidden state of the stimulus response segment from the fast hidden state of the corresponding counterfactual segment element by element. The long-time response difference vector is obtained by subtracting the slow hidden state of the stimulus response segment from the slow hidden state of the corresponding counterfactual segment element by element.

8. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step six specifically involves: Initialize both the transient error parameter and the self-heating hysteresis parameter to 0; The short-time response difference vectors in the set of short-time response difference vectors are accumulated element by element according to the vector dimension and averaged to obtain the short-time average difference vector; the short-time average difference vector is averaged element by element to obtain the short-time correction scalar, and the short-time correction scalar is added to the current transient error parameter to update the transient error parameter. The long-term response difference vectors in the set of long-term response difference vectors are accumulated element by element along the vector dimension and averaged to obtain the long-term average difference vector. The long-term average difference vector is then averaged element by element to obtain the long-term correction scalar. The long-term correction scalar is then added to the current self-heating hysteresis parameter to update the parameter.

9. The method for optimizing embedded temperature sensor parameters based on deep learning according to claim 1, characterized in that, Step seven specifically involves: Set the transient allowable range for the updated transient error parameters, and set the hysteresis allowable range for the updated self-heating hysteresis parameters; When the updated transient error parameter is greater than the upper limit of the transient allowable interval, the updated transient error parameter is limited to the upper limit of the transient allowable interval; when the updated transient error parameter is less than the lower limit of the transient allowable interval, the updated transient error parameter is limited to the lower limit of the transient allowable interval; otherwise, the updated transient error parameter remains unchanged, and the final transient error parameter is obtained. When the updated autothermal hysteresis parameter is greater than the upper limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the upper limit of the allowable hysteresis interval; when the updated autothermal hysteresis parameter is less than the lower limit of the allowable hysteresis interval, the updated autothermal hysteresis parameter is limited to the lower limit of the allowable hysteresis interval; otherwise, the updated autothermal hysteresis parameter remains unchanged, and the final autothermal hysteresis parameter is obtained.

10. A deep learning-based method for optimizing embedded temperature sensor parameters, comprising the deep learning-based method for optimizing embedded temperature sensor parameters as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The temperature acquisition module is used to acquire temperature sampling sequences and generate thermal excitation marker sequences by applying load pulses to the embedded processor. The sequence combination module is used to combine each temperature sample value in the temperature sampling sequence with the corresponding excitation mark value in the thermal excitation mark sequence according to the sampling order to construct an excitation-aligned temperature sequence. The fragment construction module is used to extract excitation response fragments from the excitation-aligned temperature sequence, centered on the excitation start time, and construct an excitation response fragment set. The modeling module is used to input the set of stimulus response fragments into the improved RetNet model. The memory cross-entry module performs memory cross-modulation between the fast hidden state channel and the slow hidden state channel and introduces a phase re-entry closed-loop mechanism to output the fast hidden state and the slow hidden state. The counterfact construction module is used to construct a counterfact set based on the stimulus response fragment set. The counterfact set is input into the improved RetNet model to obtain the counterfact fast hidden state and the counterfact slow hidden state. The counterfact set is then compared with the fast hidden state and the slow hidden state to obtain the short-time response difference vector set and the long-time response difference vector set. The parameter update module is used to update the transient error parameters based on the short-time response difference vector set, and obtain the updated transient error parameters. The self-heating hysteresis parameters are updated based on the long-time response difference vector set to obtain the updated self-heating hysteresis parameters; The range constraint module is used to apply range constraints to the updated transient error parameters and the updated self-heating hysteresis parameters to obtain the final transient error parameters and the final self-heating hysteresis parameters.