A method and system for verifying an embedded software full link based on a domestic MCU
By adopting an embedded software full-link verification method based on domestic MCUs, the performance changes and propagation effects of the target controller are quantified. Combined with coupling density, the problem of insufficient credibility of multi-machine collaborative verification in the existing technology is solved, and more accurate full-link verification results are achieved.
Patent Information
- Application Number
- CN202611714857.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-11-02
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies only verify a single controller, which cannot truly reflect its performance in a multi-machine collaborative environment. This results in insufficient credibility of the end-to-end verification conclusions in actual joint debugging scenarios, and makes it impossible to identify the risk of multi-machine instability caused by performance changes.
This paper presents a full-link verification method for embedded software based on domestic MCUs. By acquiring historical and updated operating data of the target controller, the method quantifies the degree of performance change and propagation impact, combines coupling density, determines the credibility of the entire link and performs anomaly localization, and extends the verification dimension to the multi-machine collaboration level.
It improves the accuracy and reliability of end-to-end verification results for embedded software in multi-controller collaborative scenarios, and identifies potential risks of multi-machine collaboration instability caused by performance changes even though single-machine verification is successful.
Smart Images

Figure CN123178231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing and verification, in particular to a full-link verification method and system for embedded software based on domestic micro control units (MCUs). Background Art
[0002] Against the backdrop of in-depth advancement of domestic substitution in the industrial field, domestic micro control units (MCUs) have gradually replaced imported chips in key industrial scenarios such as hydropower and new energy power stations. As the core driving the operation of MCUs, the operational reliability of embedded software directly affects the stability and safety of the entire industrial system. Therefore, conducting full-link verification of embedded software covering the complete development process from code writing, compilation and construction to burning execution and functional verification has become a basic requirement for ensuring the safe operation of the system.
[0003] In typical application scenarios such as new energy power stations, the control functions of the system are not completed independently by a single controller, but are jointly realized through frequent data interaction and close task coordination among multiple controllers (such as energy storage controllers, converter controllers, protection controllers, etc.). Each controller operates according to a unified coordination beat, and a timing deviation in any link may affect the overall control effect, which puts forward a comprehensive requirement for the embedded software verification method to take into account both the single-machine state and the multi-machine coordination effect.
[0004] Current verification technologies usually take a single controller as the object, focusing on detecting whether its code can be normally compiled and burned, and whether the single-machine function meets the standards. However, when a controller's own operating performance changes due to software update, the passing of such single-machine level verification often cannot truly reflect its actual performance in a multi-machine coordination environment. The updated controller is very likely to disrupt the existing data interaction rhythm between controllers due to performance fluctuations, leading to fluctuations or even misalignment in the overall linkage control. This makes the full-link verification conclusion face the dilemma of insufficient credibility in the actual joint debugging scenario, which seriously restricts the state detection accuracy of embedded software in multi-machine coordination scenarios. Summary of the Invention
[0005] In order to solve the technical problem that the existing technology only takes a single controller as the verification object, leading to a detection blind spot where the single machine meets the standards but the coordination is unstable in the full-link verification process, the purpose of the present invention is to provide a full-link verification method and system for embedded software based on domestic MCUs. The adopted technical solutions are as follows: Firstly, a method for end-to-end verification of embedded software based on a domestically produced MCU is provided, comprising: acquiring historical running data and running status detection records of the target controller executing the target task before the software update, and updated running data of the target task after the software update; determining the degree of change in the running performance of the target controller before and after the software update based on the difference between the historical running data and the updated running data; determining the degree of propagation impact of the software update on the operation of the cooperating controller based on the degree of change in the state and the correlation between the target controller and the cooperating controller; determining the end-to-end reliability of the target controller based on the degree of propagation impact, the running status detection records, and the coupling density of the target controller in the controller network, and performing anomaly localization based on the end-to-end reliability.
[0006] Based on the above technical solution, in the embedded software full-link verification method based on domestic MCU provided by the present invention, by comprehensively acquiring the running data before and after the target controller update and the historical running status detection records, and sequentially quantifying the degree of performance change of the controller itself after the software update, the degree of influence of the change on the cooperating controller, and combining the coupling density of the controller in the network, the final determination can reflect the full-link credibility in the multi-controller collaborative verification scenario and perform anomaly localization accordingly. This expands the verification dimension from the single-machine level to the multi-machine collaborative level, effectively identifying the potential risk of multi-machine collaboration instability caused by single-machine verification passing but performance changes, and improving the accuracy and credibility of the full-link verification results of embedded software in the multi-controller collaborative scenario.
[0007] In conjunction with the first aspect above, in one possible implementation, the method for determining the degree of change in the target controller's performance state before and after a software update based on the difference between historical operating data and updated operating data specifically includes: determining the value offset of each type of operating data before and after the software update based on the difference between the mean of historical operating data and the mean of updated operating data corresponding to each type of operating data; determining the stability change of each type of operating data before and after the software update based on the difference between the dispersion of historical operating data and the dispersion of updated operating data corresponding to each type of operating data; determining the individual change amount of each type of operating data before and after the software update based on the value offset amount and the stability change amount; and determining the degree of state change based on the dispersion of the individual changes of various operating data of the target controller.
[0008] In conjunction with the first aspect above, in one possible implementation, the method for determining the degree of propagation impact of software updates on the operation of the collaborative controller based on the degree of state change and the correlation between the target controller and the collaborative controller specifically includes: performing correlation analysis on the historical operating data of the target controller and the historical operating data of the collaborative controller, and taking the operating data types whose correlation meets a preset threshold as the associated data types; analyzing the degree of data synchronization change and the data synchronization change trend between the target controller and the collaborative controller based on the updated operating data of the target controller and the updated operating data of the collaborative controller corresponding to the associated data types; and determining the degree of propagation impact based on the degree of state change, the degree of data synchronization change, and the data synchronization change trend.
[0009] In conjunction with the first aspect above, in one possible implementation, the method for analyzing the degree and trend of data synchronization between the target controller and the coordinating controller based on the updated operating data of the target controller and the updated operating data of the coordinating controller corresponding to the associated data type specifically includes: obtaining the first-order difference sequence of the updated operating data of the target controller corresponding to the associated data type and the first-order difference sequence of the updated operating data of the coordinating controller corresponding to the associated data type, respectively; determining the degree of data synchronization based on the ratio of the corresponding positional elements in the first-order difference sequence of the coordinating controller and the first-order difference sequence of the target controller; extracting positive ratio results from the ratio of the corresponding positional elements and performing linear fitting; and determining the trend of data synchronization based on the slope of the fitted line.
[0010] In conjunction with the first aspect above, in one possible implementation, the method for determining the end-to-end reliability of the target controller based on the degree of propagation impact, operational status detection records, and the coupling density of the target controller in the controller network specifically includes: determining the coupling density based on the proportion of the number of collaborative controllers that have data interaction with the target controller to the total number of controllers in the controller network excluding the target controller; determining the historical reliability parameter of the target controller based on the historical pass rate in the operational status detection records; and determining the end-to-end reliability based on the degree of propagation impact, coupling density, and historical reliability parameter.
[0011] In conjunction with the first aspect mentioned above, in one possible implementation, the method for determining the end-to-end credibility based on the degree of propagation impact, coupling density, and historical reliability parameters specifically includes: determining the baseline credibility based on historical reliability parameters; determining the weight of the degree of propagation impact based on coupling density; determining the adjustment coefficient based on the product of the degree of propagation impact and the weight; and adjusting the baseline credibility based on the adjustment coefficient to obtain the end-to-end credibility.
[0012] In conjunction with the first aspect above, in one possible implementation, the method for obtaining the operation status detection record specifically includes: performing multiple detection items on the target controller during the historical verification process; the detection items include input / output response testing, program burning testing, serial communication testing, and serial peripheral interface testing; determining the pass rate of each detection item based on the total number of executions and the number of passes during the historical verification process; and determining the average of the pass rates of all detection items as the historical pass rate in the operation status detection record.
[0013] In conjunction with the first aspect above, in one possible implementation, the method for anomaly localization based on end-to-end reliability specifically includes: obtaining the end-to-end reliability distribution of controllers of the same type in historical test tasks, and determining the warning lower limit based on the end-to-end reliability distribution; if the end-to-end reliability of the target controller is less than the warning lower limit, then the target controller is determined to be an abnormal controller.
[0014] In conjunction with the first aspect above, in one possible implementation, the method for obtaining historical running data of the target controller executing the target task before the software update and updated running data of the target task after the software update specifically includes: extracting the original historical running data of the target task executed multiple times consecutively from the task records completed by the target controller before the software update; extracting the original updated running data of the target task executed multiple times consecutively from the task records completed by the target controller after the software update; and standardizing the original historical running data and the original updated running data to obtain the historical running data and the updated running data.
[0015] Secondly, an embedded software end-to-end verification system based on a domestically produced MCU is provided, comprising: a data acquisition module for acquiring historical running data and running status detection records of the target controller executing the target task before the software update, and updated running data of the target task after the software update; a state change assessment module for determining the degree of state change of the target controller's running performance before and after the software update based on the difference between historical running data and updated running data; an impact propagation assessment module for determining the degree of propagation impact of the target controller on the operation of the collaborative controller due to the software update based on the degree of state change and the correlation between the target controller and the collaborative controller; and an end-to-end verification module for determining the end-to-end reliability of the target controller based on the degree of propagation impact, running status detection records, and the coupling density of the target controller in the controller network, and for anomaly localization based on the end-to-end reliability.
[0016] The present invention has the following beneficial effects: By comprehensively acquiring the operational data before and after the target controller update, as well as historical operational status detection records, and sequentially quantifying the degree of performance change of the controller itself after the software update, the degree of impact of this change on the cooperating controller, and combining the coupling density of the controller in the network, the end-to-end reliability that can reflect the multi-controller collaborative verification scenario is finally determined, and anomaly localization is performed accordingly. This expands the verification dimension from the single-machine level to the multi-machine collaborative level, effectively identifying the potential risk of multi-machine collaboration instability caused by single-machine verification passing but performance changes, and improving the accuracy and reliability of the end-to-end verification results of embedded software in multi-controller collaborative scenarios. Attached Figure Description
[0017] Figure 1 A system architecture diagram of an embedded software end-to-end verification system based on a domestically produced MCU is provided as an embodiment of the present invention; Figure 2 The present invention provides a flowchart of a method for full-link verification of embedded software based on a domestically produced MCU. Detailed Implementation
[0018] The following description, in conjunction with the accompanying drawings, details the specific scheme of the embedded software full-link verification method and system based on a domestically produced MCU provided by this invention.
[0019] Please see Figure 1 The diagram illustrates a system architecture of an embedded software end-to-end verification system based on a domestically produced MCU, according to an embodiment of the present invention. The embedded software end-to-end verification system based on a domestically produced MCU includes: a data acquisition module 1, a state change evaluation module 2, an impact propagation evaluation module 3, and an end-to-end verification module 4.
[0020] The data acquisition module 1 acquires historical runtime data and runtime status detection records of the target controller executing the target task before the software update, as well as updated runtime data of the target task after the software update. This module reads runtime data from the controller's internal registers via a serial wire debug (SWD) interface, including task execution time, interrupt latency, task switching count, and processor utilization. It constructs historical runtime sequences and updated runtime sequences for each type of runtime data according to the execution time sequence and performs standardization. This module also calculates the average pass rate of multiple detection items during the historical verification process for the target controller, using this as the historical pass rate in the runtime status detection records. The data acquisition module 1 outputs the standardized runtime sequences to the status change evaluation module 2 and the historical pass rate to the end-to-end verification module 4.
[0021] The State Change Assessment Module 2 is used to determine the degree of state change in the target controller's performance before and after a software update, based on the differences between the historical and updated operating sequences provided by the Data Acquisition Module 1. For each type of operating data, this module compares the mean of the historical operating sequence with the mean of the updated operating sequence to determine the value offset, compares the dispersion of the two to determine the stability change, summarizes the two types of magnitudes to obtain the individual change quantity for that type of operating data, and then comprehensively determines the degree of state change based on the dispersion of the individual change quantities for all types of operating data. This module is implemented through a data processing unit deployed in the host computer. The State Change Assessment Module 2 outputs the state change degree to the Impact Propagation Assessment Module 3.
[0022] The impact propagation assessment module 3 determines the degree of propagation impact based on the degree of state change and the correlation between the target controller and the coordinating controller. This module performs correlation analysis on the historical operational data of the target controller and the coordinating controller, filtering operational data types whose correlation meets a preset threshold as correlated data types. For each set of correlated data, the first-order difference sequence of the updated operational data of both controllers is obtained. The degree of data synchronization change is determined based on the ratio of corresponding positional elements. A straight line is extracted from the positive ratio and fitted. The trend of data synchronization change is determined based on the fitting slope. The two parameters are summarized to obtain the degree of correlation impact. The degree of correlation impact of all sets of correlation relationships is then summarized to obtain the comprehensive degree of correlation impact of the target controller on the coordinating controller. Finally, the degree of state change is multiplied by the average degree of correlation impact of the target controller on all coordinating controllers to obtain the degree of propagation impact. The impact propagation assessment module 3 outputs the degree of propagation impact to the end-to-end verification module 4.
[0023] The end-to-end verification module 4 is used to determine the end-to-end reliability and locate anomalies based on the degree of propagation impact, operational status detection records, and coupling density. This module determines the coupling density based on the proportion of collaborative controllers interacting with the target controller to the total number of controllers in the controller network excluding the target controller, and determines historical reliability parameters based on historical pass rates. Using the positive correlation function of the historical reliability parameters as the baseline reliability term, and the increasing function of the propagation impact degree and coupling density as the risk adjustment term, the end-to-end reliability is obtained by dividing the baseline reliability term by the risk adjustment term. This module obtains the end-to-end reliability distribution of controllers of the same type in historical test tasks, and uses its lower quartile as the warning lower limit. When the end-to-end reliability of the target controller is less than this warning lower limit, it is determined to be an abnormal controller, and the determination result is output to the monitoring interface or remote alarm platform.
[0024] Please see Figure 2The diagram illustrates a flowchart of an embedded software end-to-end verification method based on a domestically produced MCU, according to an embodiment of the present invention. This embedded software end-to-end verification method based on a domestically produced MCU includes: S1. Obtain historical running data and running status detection records of the target controller before the software update, as well as updated running data of the target controller after the software update.
[0025] The target controller refers to the embedded controller based on a domestically produced MCU in a new energy power station, such as an energy storage controller, converter controller, or protection controller. The target task refers to any type of task that the target controller has completed, serving as the object for comparative analysis of operational performance.
[0026] Historical operational data refers to records of various runtime performance parameters read from registers when the target controller performed the target task before the software update, used to characterize the controller's baseline operating state before the software update. Updated operational data refers to records of similar runtime performance parameters read from registers when the target controller performed the same target task after the software update, used to characterize the controller's current operating state after the software update. By acquiring operational data before and after the software update, a data foundation is provided for quantifying changes in the controller's own performance.
[0027] In some implementations, an arbitrary task type is selected as the target task from the task records completed by the target controller before the software update, and the original historical running data of the target task executed multiple times consecutively is extracted. Similarly, the original updated running data of the target task executed multiple times consecutively is extracted from the task records completed by the target controller after the software update. Specifically, before and after the software update, the debug access port inside the controller is connected via the debug interface reserved on the target controller board to read the original running data from the target controller's internal registers. The original running data includes, but is not limited to, task execution time, interrupt latency, task switching count, and CPU utilization, collecting multiple types of original running data. Following the chronological order of multiple test tasks, and based on the various running data corresponding to each test task, running data sequences of multiple original historical running data and original updated running data of the target controller are constructed. To eliminate timing misalignment caused by local clock drift of the distributed controller, before constructing the running data sequence, the task trigger broadcast message issued by the master control station is used as a unified time reference. Within the execution cycle of each task trigger message, each controller uses the signal as the trigger condition to intercept and record the original running data within the time window, thereby ensuring that the task execution records extracted by each controller belong to the same collaborative work cycle in terms of physical timing.
[0028] To eliminate the influence of dimensions between various data during subsequent analysis, the original historical running data and the original updated running data are standardized to obtain historical running data and updated running data. Specifically, each type of original historical running data sequence and original updated running data sequence obtained above is input into a preset standardization processing method for processing. For example, this preset standardization processing method is maximum-minimum (max-min) linear normalization. For any running data sequence, the global maximum and minimum values after merging the original historical running data sequence and the original updated running data sequence are obtained. The minimum value is subtracted from each element, and then divided by the difference between the maximum and minimum values to obtain the processed standardized value. In particular, if the difference between the maximum and minimum values after merging the two original sequences is equal to zero, it indicates that the data has not changed within the acquisition window, and all elements are set to zero. Through this standardization processing, both historical running data and updated running data are converted into a dimensionless form.
[0029] Operational status detection records refer to the summary information of pass rates recorded by the target controller during the historical verification process for various detection items performed on the hardware level and basic communication interface. This information is used to characterize the reliability level of the target controller during historical operation.
[0030] In some implementations, multiple tests are performed on the target controller during historical verification. These tests include input / output response testing, program programming testing, serial communication testing, and serial peripheral interface testing. Input / output response testing verifies the controller's responsiveness to external signals and the correctness of its timing. Program programming testing verifies the stability and success rate of the controller's program upgrade process. Serial communication testing verifies the reliability of data transmission through the serial communication interface. Serial peripheral interface testing verifies the correctness of data exchange between the controller and external devices through the serial peripheral interface.
[0031] The pass rate for each test item is determined based on the total number of executions and the number of successful executions during the historical verification process. Specifically, taking the program burning test as an example, the total number of times the target controller has performed the program burning operation and the number of successful burnings are counted. The ratio of successful burnings to the total number of burnings is recorded as the pass rate for the program burning test item. This pass rate reflects the stability of historical burning and upgrade behavior. The pass rates for input / output response tests, serial communication tests, and serial peripheral interface tests are calculated in the same manner.
[0032] The average pass rate of each individual test item is used to determine the historical pass rate in the operational status test record. A higher historical pass rate indicates a lower probability of problems occurring in the target controller during historical verification, and thus higher operational reliability.
[0033] S2. Based on the differences between historical operating data and updated operating data, determine the degree of change in the target controller's operating performance before and after the software update.
[0034] The degree of state change refers to a quantitative parameter that comprehensively reflects the overall deviation level of various operational performance indicators of the target controller after a software update, as well as the dispersion of the changes among the indicators. The purpose of determining the degree of state change is to preliminarily assess, from the perspective of the target controller itself, whether the software update has caused a significant deviation in operational performance. The greater the degree of state change, the more significant the overall performance deviation of the target controller after the update, and the more uneven the changes among the indicators, resulting in a greater potential impact on collaborative operation.
[0035] In some implementations, the deviation of each type of operating data before and after the software update is determined based on the difference between the mean of the historical operating data and the mean of the updated operating data. Specifically, the impact of a software update on controller performance depends not only on the absolute change in performance parameters but also on the proportion of that change relative to the original performance level. When an operating data point experiences the same absolute change at a low baseline level as it does at a high baseline level, the former represents a more drastic relative change in performance, and its potential impact on the stability of the control system is more significant. Since various types of operating data have been standardized to eliminate dimensional differences, using relative deviations allows performance changes at different baseline levels to be compared on the same scale, thus more accurately reflecting the actual impact of the software update on the target controller's various operating performance indicators. Based on the above analysis, the absolute difference between the mean of each type of operating data in the historical operating data and the mean of the same type of operating data in the updated operating data is calculated, and the ratio of this absolute difference to the mean of that type of operating data in the historical operating data is used as the deviation. To avoid calculation anomalies caused by a zero denominator, a preset robustness factor is added to the denominator. Since historical and updated operating data have been globally normalized to the [0, 1] interval, setting the preset robustness factor to 1 ensures that the calculated results of the value offset amplitude and stability change amplitude naturally fall within the [0, 1] range, ensuring that the degree of state change characterizes the controller's performance changes under a unified metric. The value offset amplitude reflects the degree of performance change of the target controller for each type of operating data after the update. The larger the value, the more significant the change in the performance parameters corresponding to each type of operating data, and the higher the possibility of disturbing the data transmission rhythm.
[0036] Based on the difference between the dispersion of historical operating data and the dispersion of updated operating data for each type of operating data, the stability change magnitude of each type of operating data before and after the software update is determined. Specifically, the dispersion of updated operating data and historical operating data are calculated separately, and the ratio of the absolute difference between the dispersion of updated operating data and historical operating data to the dispersion of historical operating data is taken as the stability change magnitude. Dispersion can be either standard deviation or variance. To avoid calculation anomalies caused by a zero denominator, the same preset robustness factor (with a value of 1) is added to the denominator. The stability change magnitude reflects the change in the fluctuation magnitude of the target controller's operating data after the update relative to before the update. The larger the value, the more significant the decrease in the stability of the data after the update, and the greater the possibility that insufficient stability will affect the coordination rhythm.
[0037] Based on the magnitude of value offset and the magnitude of stability change, the individual change of each type of operational data before and after the software update is determined. Specifically, the magnitude of value offset reflects the relative change ratio of the mean, and the magnitude of stability change reflects the relative change ratio of the dispersion. The average of the magnitude of value offset and the magnitude of stability change is used as the individual change of each type of operational data, comprehensively reflecting the overall degree of change of each type of operational data in both the dimensions of mean offset and stability change.
[0038] The degree of state change is determined based on the dispersion of individual changes in various operational data of the target controller. Specifically, the range between all individual changes is calculated, which reflects the dispersion of the variation amplitude between different performance indicators. The sum of the range and a preset robustness factor is multiplied by the mean of all individual changes to obtain the degree of state change. The sum of the range and the preset robustness factor is used as a multiplier to avoid the problem that the calculation result is always zero when the range is zero. The degree of state change reflects the overall deviation of various performance indicators after the controller update through the mean of all individual changes, and reflects the dispersion of the variation amplitude between different performance indicators through the range. When the overall variation amplitude is large, the increase of the range will accelerate the increase of the degree of state change; if the overall variation amplitude itself is small, even if there are certain differences between the indicators, the overall degree of state change will remain at a low level. Therefore, a multiplicative form is used for calculation to reflect the coupling relationship between the two parameters.
[0039] S3. Based on the degree of state change and the relationship between the target controller and the cooperating controller, determine the degree of propagation impact of the software update on the operation of the cooperating controller.
[0040] The degree of propagation impact refers to a quantitative parameter that comprehensively reflects the propagation impact of the updated target controller's state changes on the operational rhythm of the collaborative controllers. The purpose of determining the degree of propagation impact is to overcome the limitations of single-machine verification and analyze whether the target controller's own performance deviations will indirectly affect other collaborative controllers through data interaction and task linkage, thereby identifying whether the updated controller truly poses a collaborative propagation risk. A greater degree of propagation impact indicates that the updated target controller not only experiences significant changes in its own operational state but also exerts a stronger pull on the rhythm of the collaborative controllers, thus increasing the risk of propagation instability in the overall collaborative control rhythm.
[0041] In some implementations, correlation analysis is performed on the historical operating data of the target controller and the historical operating data of the coordinating controller. Operating data types whose correlation meets a preset threshold are designated as associated data types. Specifically, during the execution of the target task by the target controller, controllers that have transmitted data with the target controller are referred to as coordinating controllers. Since not all data within the coordinating controller is affected by other controllers, it is necessary to filter the operating data types that will be affected. Taking a certain type of operating data from the target controller and a certain type of operating data from the coordinating controller as an example, the two types of historical operating data are used as inputs to a preset correlation algorithm to calculate the correlation. The preset correlation algorithm measures the degree of linear correlation between two data sequences. The preset correlation algorithm can use the Pearson correlation coefficient algorithm, which calculates the ratio of the product of the covariance and standard deviation of the two sequences to obtain a correlation coefficient between -1 and 1. If the absolute value of the output correlation coefficient is greater than or equal to the preset threshold, it indicates that this type of operating data from the target controller will have a rhythmic propagation effect on this type of operating data from the coordinating controller, and this type of operating data from the coordinating controller is designated as the associated data type of this type of operating data from the target controller. The preset threshold is taken from an empirical range, for example, 0.4. The process of identifying associated data types is completed offline based on historical stable operation phases, thereby avoiding frequent correlation analysis during real-time operation of the controller and reducing the computational burden during online joint debugging.
[0042] Considering that if the target controller only experiences random fluctuations, although it will cause short-term synchronization changes, it will not truly affect the overall coordination rhythm. However, if the target controller's operating rhythm continues to deviate, it will cause the data reception time of the coordination controller to gradually deviate from the original control cycle, ultimately resulting in coordination loss of rhythm. Therefore, it is necessary to analyze the degree and trend of data synchronization changes between the target controller and the coordination controller based on the updated operating data of the target controller and the updated operating data of the coordination controller corresponding to the associated data types.
[0043] Specifically, the first-order difference sequence of the updated running data of the target controller corresponding to the associated data type and the first-order difference sequence of the updated running data of the cooperative controller corresponding to the associated data type are obtained respectively. For adjacent elements in the updated running sequence, the element of the previous time step is subtracted from the element of the later time step to obtain the first-order difference sequence, which is used to reflect the changing trend of the data at adjacent time steps and eliminate the baseline difference of the original data.
[0044] The degree of data synchronization is determined by the ratio of corresponding positional elements in the first-order difference sequence of the collaborative controller and the first-order difference sequence of the target controller. Specifically, the corresponding positional elements within the first-order difference sequence of the collaborative controller are used as the numerator, and the elements within the first-order difference sequence of the target controller are used as the denominator. A positive ratio indicates that the corresponding positional elements in the two first-order difference sequences have the same sign and the direction of change is consistent. The percentage of positive ratios is used to represent the degree of data synchronization. This degree of synchronization reflects whether the changes after the target controller's update are driving synchronous changes in the associated data; a larger value indicates a more significant influence of the target controller on the propagation of the collaborative controller's operating rhythm. Notably, if the denominator is zero during the ratio calculation, the ratio is set to zero.
[0045] Positive ratios are extracted from the ratios of corresponding positional elements and fitted with a straight line. The slope of the fitted line is used to determine the synchronous change trend of the data. Specifically, positive numbers are extracted from the ratios of all corresponding positional elements. The extracted positive ratios are used as the dependent variable, and the original time position of the positive ratios in the original first-order difference sequence is used as the independent variable. A straight line is fitted to all positive ratios to obtain the slope of the fitted line, which is then converted into the angle between the fitted line and the horizontal axis. The conversion rule is as follows: the arctangent value is calculated based on the slope to obtain the original angle value, which naturally falls within the range of -90 degrees to 90 degrees. The angle is then normalized to its maximum and minimum values. The normalization rule is as follows: with -90 degrees as the minimum value and 90 degrees as the maximum value, the original angle value is added to 90 degrees and then divided by 180 degrees to obtain a normalized result with a value between 0 and 1. This normalized result is used as the synchronous change trend of the data. The data synchronization trend reflects the change in the degree of influence, that is, the degree to which the collaborative controller's data follows the change when the target controller's data changes by a unit. The larger the data synchronization trend, the closer the slope of the fitted line is to 90 degrees, indicating that the collaborative controller's response to the target controller is stronger; the smaller the value, the weaker the response is. If there are fewer than two positive values, it indicates that the influence is not continuous, and in this case, the data synchronization trend is set to zero.
[0046] The degree of propagation impact is determined based on the degree of state change, the degree of data synchronization change, and the trend of data synchronization change. Specifically, the sum of the degree of data synchronization change and the trend of data synchronization change for each type of associated data is used as the degree of association impact between the target controller and the cooperating controller for each type of associated data. The average degree of association impact for all associated data types is calculated as the comprehensive degree of association impact between the target controller and the cooperating controller. The degree of state change is multiplied by the average of the comprehensive degree of association impact between the target controller and all associated cooperating controllers to obtain the degree of propagation impact. If there is no associated data type between the target controller and the cooperating controller, it means that the target controller will not affect the cooperating controller, and the comprehensive degree of association impact and the degree of propagation impact are set to zero. The degree of state change and the comprehensive degree of association impact have a progressive coupling relationship. Only when the target controller's own operating state changes significantly and this change affects the cooperating controller is it stated that the updated controller truly has a risk of collaborative propagation. If the controller itself changes but the change is limited to the controller itself and does not affect other cooperating controllers, the result of the degree of association impact is set to zero, indicating that the current operating change will not disrupt the original collaborative control cycle.
[0047] S4. Based on the degree of propagation impact, operational status detection records, and the coupling density of the target controller in the controller network, determine the end-to-end reliability of the target controller, and locate the anomaly based on the end-to-end reliability.
[0048] End-to-end reliability refers to a quantitative parameter that comprehensively reflects the reliability of the target controller's verification after considering its own state changes and their impact on the cooperating controllers. The purpose of determining end-to-end reliability is to extend the performance verification conclusions at the single-machine level to a reliability assessment at the end-to-end level, thereby identifying potential risks of cooperating impacts after controller updates and improving the accuracy of embedded software end-to-end verification results. A lower end-to-end reliability indicates a greater likelihood of problems with the target controller during end-to-end verification, a higher probability of end-to-end verification failure, and a greater need for further on-site verification and troubleshooting.
[0049] In some implementations, coupling density is determined by the ratio of the number of cooperating controllers that interact with the target controller to the total number of controllers in the controller network (excluding the target controller). Specifically, the coupling density is the ratio obtained by dividing the number of cooperating controllers by the total number of controllers in the network minus one. Coupling density characterizes the density of connections to the target controller in the controller network; a higher value indicates a denser connection to the target controller in the network, and a greater likelihood that changes in its operating status will affect other controllers through multiple links. Therefore, when verifying the controller's operating status, the weight of link collaboration analysis needs to be increased; a lower value indicates that effective verification and evaluation can be completed using only the controller's own operating data.
[0050] Based on the historical pass rates in the operational status monitoring records, the historical reliability parameters of the target controller are determined. These parameters characterize the operational reliability of the target controller during historical verification. A higher historical reliability parameter indicates a lower probability of problems occurring during historical verification, and thus higher operational reliability. The historical pass rate is the average pass rate of all individual monitoring items during historical verification and can be directly used as the historical reliability parameter. Alternatively, a preset mapping function can be used to nonlinearly transform the historical pass rate to obtain the historical reliability parameter. For example, an exponential mapping function can be used, with the natural constant e as the base and the scaled historical pass rate as the exponent. The exponent is the product of the historical pass rate minus a preset benchmark value and a preset amplification factor. The calculated result is used as the historical reliability parameter, ensuring that the historical reliability parameter is 1 when the historical pass rate is near the preset benchmark value, greater than 1 with a gradually accelerating increase when the historical pass rate is above the preset benchmark value, and less than 1 with a gradually accelerating decrease when the historical pass rate is below the preset benchmark value. This nonlinear mapping method amplifies the differences in reliability characterization between high and low pass rates, making historical reliability parameters more sensitive to changes in historical verification results. A preset benchmark value is pre-calibrated based on the minimum acceptable reliability requirements of the target controller's application scenario. For example, in a new energy power plant control scenario, the preset benchmark value is set to 0.8; if the application scenario has more stringent reliability requirements (e.g., nuclear power plant control scenario), the preset benchmark value is set to 0.9. A preset amplification factor is pre-calibrated based on the impact of historical pass rate fluctuations on the end-to-end reliability assessment results, typically ranging from 2 to 5.
[0051] The overall reliability is determined based on the degree of propagation impact, coupling density, and historical reliability parameters. Specifically, a baseline reliability is determined based on historical reliability parameters. An exponential function is performed with the historical reliability parameter as the exponent and the natural constant e as the base. The result is used as the baseline reliability term, which characterizes the initial reliability level of the target controller when only its own historical reliability is considered. The higher the historical reliability parameter, the larger the baseline reliability term. Simultaneously, the weight of the propagation impact degree is determined based on the coupling density. The coupling density is used as an amplification operator, and a constant 1 is added to obtain the amplification weight, making the adjustment range of the propagation impact degree 1 to 2 times. The product of the propagation impact degree and the weight is used as the adjustment coefficient. Then, the baseline reliability is adjusted based on the adjustment coefficient to obtain the overall reliability. Specifically, an exponential function is performed with the adjustment coefficient as the exponent and the natural constant e as the base. The result is used as the risk adjustment term. The baseline reliability term is divided by the risk adjustment term, and the resulting ratio is used as the overall reliability of the target controller. The formula for calculating the overall reliability is expressed as: In the formula, Let be the end-to-end reliability of the i-th controller; Here are the historical reliability parameters for the i-th controller; Let be the coupling density of the i-th controller; Let be the propagation influence of the i-th controller; exp is an exponential function with the natural constant e as the base.
[0052] An exponential function of the historical reliability parameter is used as the numerator to characterize the historical reliability benchmark of the controller. The numerator is positively correlated with the overall reliability. The larger the historical reliability parameter, the larger the numerator value, and the higher the overall reliability.
[0053] The denominator uses an exponential function of the product of the propagation impact and the weights as an adjustment coefficient to characterize the level of collaborative propagation risk of the controller. The denominator is negatively correlated with the overall reliability. The larger the denominator value, the lower the overall reliability.
[0054] Based on the above calculations, the higher the coupling density of the target controller, the denser its connections in the controller network. Once the controller generates an outward propagation effect, this propagation effect will be significantly amplified by the amplification factor, resulting in a sharp increase in the risk adjustment item, which in turn causes the overall trustworthiness to degrade rapidly. If the target controller operates smoothly and there is no propagation effect, the adjustment factor is zero, the risk adjustment item is 1, and no additional penalty points will be imposed on the core position of the network.
[0055] In some implementations, the end-to-end reliability distribution of controllers of the same type in historical test tasks is obtained, and a warning lower limit is determined based on this distribution. Specifically, the end-to-end reliability values of multiple controllers of the same type as the target controller in historical test tasks are obtained to form an end-to-end reliability set. This set is then sorted in ascending order of values, and the value at the lower quartile of the sorted set is used as the warning lower limit. The lower quartile refers to the value located at the first quartile when the sorted data set is divided into four equal parts; that is, at least 25% of the data must be less than or equal to this value. If the end-to-end reliability of the target controller is less than the warning lower limit, the target controller is identified as an abnormal controller. By comparing the end-to-end reliability of the current controller with the warning lower limit determined from historical data of the same type, target controllers with significantly low reliability can be objectively identified, providing a clear basis for on-site secondary verification and maintenance.
[0056] Secondary verification methods include, but are not limited to, re-executing the complete compilation, burning, and running process; conducting multi-device linkage tests in a joint debugging environment; and checking for issues such as poor contact or aging interfaces in the controller hardware. Through on-site secondary verification, the specific cause of the abnormal controller failure can be further confirmed, and targeted repairs can be performed, thereby ensuring the stability and reliability of the upgraded domestically produced microcontroller controller software in new energy power plants.
[0057] Based on the above technical solution, by comprehensively acquiring the operating data before and after the target controller update, as well as historical operating status detection records, and sequentially quantifying the degree of performance change of the controller itself after the software update, the degree of impact of this change on the cooperating controller, and combining the coupling density of the controller in the network, the end-to-end reliability that can reflect the multi-controller collaborative verification scenario is finally determined, and anomaly localization is performed accordingly. This expands the verification dimension from the single-machine level to the multi-machine collaborative level, effectively identifying the potential risk of multi-machine collaboration instability caused by single-machine verification passing but performance changes, and improving the accuracy and reliability of the end-to-end verification results of embedded software in multi-controller collaborative scenarios.
Claims
1. A method for end-to-end verification of embedded software based on a domestically produced MCU, characterized in that, include: Acquire historical running data and running status detection records of the target controller executing the target task before the software update, as well as updated running data of the target task executed after the software update; Based on the difference between the historical operating data and the updated operating data, determine the degree of change in the operating performance of the target controller before and after the software update; Based on the degree of state change and the correlation between the target controller and the cooperating controller, determine the degree of propagation impact of the software update on the operation of the cooperating controller. Based on the degree of propagation impact, the operational status detection records, and the coupling density of the target controller in the controller network, the end-to-end reliability of the target controller is determined, and anomaly localization is performed based on the end-to-end reliability.
2. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 1, characterized in that, Based on the differences between the historical operating data and the updated operating data, determine the degree of change in the target controller's operating performance before and after the software update, including: Based on the difference between the mean of historical running data and the mean of updated running data for each type of running data, determine the value deviation of each type of running data before and after the software update; Based on the difference between the dispersion of historical running data and the dispersion of updated running data corresponding to each type of running data, the stability change range of each type of running data before and after the software update is determined. Based on the value offset range and the stability change range, determine the individual change amount of each type of running data before and after the software update; The degree of state change is determined based on the dispersion of individual changes in various operational data of the target controller.
3. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 1, characterized in that, Based on the degree of state change and the correlation between the target controller and the cooperating controller, determine the extent of the propagation impact of the software update on the operation of the cooperating controller, including: A correlation analysis is performed on the historical operating data of the target controller and the historical operating data of the collaborative controller, and the operating data types whose correlation meets a preset threshold are used as the associated data types. Based on the updated operating data of the target controller and the updated operating data of the coordinating controller corresponding to the associated data type, analyze the degree and trend of data synchronization changes between the target controller and the coordinating controller; The degree of propagation impact is determined based on the degree of state change, the degree of data synchronization change, and the trend of data synchronization change.
4. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 3, characterized in that, Based on the updated operational data of the target controller and the updated operational data of the coordinating controller corresponding to the associated data type, analyze the degree and trend of data synchronization changes between the target controller and the coordinating controller, including: Obtain the first-order difference sequence of the updated running data of the target controller corresponding to the associated data type, and the first-order difference sequence of the updated running data of the cooperative controller corresponding to the associated data type, respectively. The degree of data synchronization change is determined based on the ratio of the corresponding positional elements in the first-order difference sequence of the cooperative controller to the first-order difference sequence of the target controller. Extract positive ratio results from the ratios of the corresponding positional elements and perform linear fitting. Determine the synchronous change trend of the data based on the slope of the fitted line.
5. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 1, characterized in that, Based on the degree of propagation impact, the operational status detection records, and the coupling density of the target controller in the controller network, the end-to-end reliability of the target controller is determined, including: The coupling density is determined based on the proportion of the number of collaborative controllers that have data interaction with the target controller to the total number of controllers in the controller network excluding the target controller. Based on the historical pass rate in the operation status detection record, the historical reliability parameters of the target controller are determined; The end-to-end reliability is determined based on the degree of propagation impact, the coupling density, and the historical reliability parameters.
6. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 5, characterized in that, The end-to-end reliability is determined based on the degree of propagation impact, the coupling density, and the historical reliability parameters, including: The baseline reliability is determined based on the historical reliability parameters. The weight of the propagation influence degree is determined based on the coupling density, and the adjustment coefficient is determined based on the product of the propagation influence degree and the weight. The end-to-end credibility is obtained by adjusting the baseline credibility based on the adjustment coefficient.
7. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 5, characterized in that, Obtain runtime status monitoring records, including: During the historical verification process, the target controller undergoes multiple testing items, including input / output response testing, program burning testing, serial communication testing, and serial peripheral interface testing. The pass rate for each test item is determined based on the total number of times it is executed and the number of times it passes in the historical verification process. The average pass rate of each individual test item is used as the historical pass rate in the operational status test record.
8. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 1, characterized in that, Anomaly localization based on the aforementioned end-to-end credibility includes: Obtain the end-to-end reliability distribution of controllers of the same type in historical test tasks, and determine the warning lower limit value based on the end-to-end reliability distribution; If the end-to-end reliability of the target controller is less than the warning threshold, the target controller will be identified as an abnormal controller.
9. The embedded software end-to-end verification method based on domestically produced MCUs according to claim 1, characterized in that, Acquire historical execution data of the target controller performing the target task before the software update, and updated execution data of the target task after the software update, including: Extract the original historical running data of the target task when the target controller has executed the task in a continuous series from the task record that was completed before the software update. Extract the original update execution data from the task records that the target controller has completed after the software update, and extract the original update execution data of the target task that was executed multiple times consecutively. The original historical running data and the original updated running data are standardized to obtain the historical running data and the updated running data.
10. An embedded software end-to-end verification system based on a domestically produced MCU, characterized in that, include: The data acquisition module is used to acquire historical running data and running status detection records of the target controller executing the target task before the software update, as well as updated running data of the target task after the software update. The state change assessment module is used to determine the degree of state change in the target controller's operating performance before and after the software update based on the difference between the historical operating data and the updated operating data. The impact propagation assessment module is used to determine the degree of propagation impact of the software update on the operation of the collaborative controller based on the degree of state change and the correlation between the target controller and the collaborative controller; The end-to-end verification module is used to determine the end-to-end credibility of the target controller based on the degree of propagation impact, the operation status detection records, and the coupling density of the target controller in the controller network, and to perform anomaly localization based on the end-to-end credibility.
