A method and system for automatic testing of automobile MCU

By simulating the real operating environment and machine learning model evaluation, identifying and processing the timing problems of automotive MCUs, the problem of insufficient stability in complex environments is solved, and testing efficiency and safety are improved.

CN118760143BActive Publication Date: 2024-11-19深圳市利和兴股份有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411219998.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-11-19
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

In the automatic testing of existing automotive MCUs, the operating timing of the MCU is not fully tested in complex multi-task environments, which may lead to race conditions or deadlocks, affecting the stability of the vehicle performance and increasing the risk of accidents.

Method used

Simulate the real operating environment through the emulator and test equipment, record the real-time operation timing data of the MCU, perform preprocessing and comparative analysis, evaluate the risk of timing problems, use machine learning models to predict risks of under-tested, divide risk levels and adopt corresponding measures. measure.

Benefits of technology

Ensure the stability and reliability of the MCU in complex multitasking environments, improve testing efficiency and accuracy, and reduce unpredictable behavior and accident risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760143B_ABST
    Figure CN118760143B_ABST
Patent Text Reader

Abstract

The present invention discloses an automobile MCU automatic testing method and system, and specifically relates to the technical field of automobile MCU. By determining a timing benchmark, simulating a real operating environment, recording and analyzing real-time operation timing data, evaluating and classifying the risk level of timing problems, and predicting and optimizing medium-risk problems, the present invention can effectively identify and solve potential timing problems, improve the overall performance of the MCU, and reduce the possibility of system failure, thereby improving the safety and operating efficiency of the vehicle. Through automated testing and intelligent analysis, the cost of manual intervention and testing is greatly reduced, the test efficiency and accuracy are improved, and finally the precise positioning and optimization of MCU timing problems are achieved, thereby ensuring the stability and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile MCU, and in particular to an automobile MCU automatic testing method and system. Background Art

[0002] The automotive MCU (Microcontroller Unit) is a microcontroller unit designed for automotive applications. It integrates a central processing unit (CPU), memory, input / output interface and other dedicated functions to control various electronic systems inside the car. In the car, the MCU is responsible for processing information, executing control instructions, and implementing functions such as engine management, transmission control, body electronics, driver assistance systems, etc. They play a vital role in automotive electronic systems, providing high-performance, low-power and high-reliability solutions.

[0003] Automotive MCU automated testing refers to the functional, performance, and reliability testing of automotive microcontroller units (MCUs) through automated tools and programs to ensure their stability and safety in actual applications. The testing process includes writing and running automated test scripts, simulating various working conditions and failure scenarios through simulators and test equipment, and checking the response and behavior of the MCU. Automated testing usually covers methods such as hardware-in-the-loop (HIL) and software-in-the-loop (SIL) to ensure that the MCU can correctly perform its intended functions in different environments, thereby improving test efficiency and accuracy.

[0004] The prior art has the following disadvantages:

[0005] In the prior art, when performing automatic testing of automotive MCUs, when simulating various working conditions and fault scenarios through simulators and test equipment to check the response and behavior of the MCU, the operating timing of the MCU may not be fully tested in the automatic testing, especially the timing problems in complex multi-tasking environments. Timing problems may cause race conditions or deadlocks in the MCU during multi-tasking. At the same time, timing problems may make it impossible for the MCU to stably control various performance of the vehicle, such as engine output, gearbox shifting, suspension system adjustment, etc. Unstable performance can lead to unpredictable behavior of the vehicle during driving, such as sudden acceleration or deceleration, gear shift shock, incoordination of the suspension system, etc., all of which may affect the driver's control ability and increase the risk of accidents. Summary of the invention

[0006] The purpose of the present invention is to provide an automobile MCU automatic testing method and system to solve the deficiencies in the background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solution: an automatic testing method for an automobile MCU, comprising the following steps:

[0008] S1: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU;

[0009] S2: preprocessing the recorded real-time operation timing data of the MCU, comparing and analyzing the preprocessed real-time operation timing data of the MCU with a predefined timing benchmark, and determining whether the operation timing of the MCU is fully tested according to the analysis result;

[0010] S3: When the operation timing of the MCU is not fully tested, check the log files and error reports generated during the test, extract the multi-task access resource conflict characteristics and CPU usage fluctuation characteristics in the infinite loop during the test, and conduct a comprehensive analysis to evaluate the risk of timing problems when the test is not fully tested;

[0011] S4: Based on the evaluation results, the risk level of timing problems that occur when insufficient testing is performed is divided into high-risk timing problem level, medium-risk timing problem level, and low-risk timing problem level, and the risk levels are handled accordingly;

[0012] S5: For medium-risk timing problem levels, predict the stability of the MCU controlling the vehicle within a fixed time period, and determine whether to retest and optimize based on the prediction results.

[0013] Preferably, in S2, according to the target timing requirements of all operations in the automotive MCU, the timing benchmark of each operation is determined, the target timing requirements of each operation are collected, the timing benchmark of each operation is set, and a benchmark data set B = {B1, B2, ..., Bm} is formed;

[0014] Compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark to identify the deviation, ensure that the real-time operation timing data and the timing benchmark are aligned on the same time axis, and calculate the deviation between each operation timing data and the benchmark. The expression is: △Ti=Ti-Bi; where △Ti is the deviation between the i-th operation timing data and the benchmark, Ti is the real-time timing data of the i-th operation, and Bi is the timing benchmark of the i-th operation;

[0015] Set the tolerance range ΔTthreshold of the timing benchmark deviation. If |ΔTi|≤ΔTthreshold, the i-th operation is considered to have been fully tested, and the operations that meet the benchmark requirements are confirmed to have been fully tested and recorded; if |ΔTi|≤ΔTthreshold, the i-th operation is considered to have not been fully tested.

[0016] Preferably, in S3, a resource contention frequency fluctuation index is generated according to the extracted multi-task resource access conflict characteristics during the test process, and the method for obtaining the resource contention frequency fluctuation index is:

[0017] Obtain the frequency of multiple tasks trying to access the same resource at the same time within the time period s, preprocess the resource contention frequency signal, and represent the preprocessed signal data as a time series x[n], where n represents a discrete time point. Calculate the discrete Fourier transform X[k], which is expressed as: Where X[k] is the value of the frequency signal at the kth frequency point, x[n] is the value of the time domain signal at the nth sample point, N is the total number of signal sample points, and e[k] is the value of the time domain signal at the nth sample point. -j2πkn / N is the kernel function of Fourier transform, where j is an imaginary unit, and the spectrum amplitude |X[k]| is calculated using the expression: Among them, Re(X(k)) 2 is the real part of X(k), IM(X(k)) 2 is the imaginary part of X(k). According to the spectrum amplitude, the total spectrum energy E is calculated. The expression is: Calculate the high frequency component energy E h , the expression is: Among them, k L It is the lower limit index of the high-frequency component, which is the part of the signal spectrum that is greater than or equal to the average frequency. It calculates the resource contention frequency fluctuation index, and the expression is: Where AD is the resource contention frequency fluctuation index.

[0018] Preferably, in S3, a CPU usage fluctuation index is generated according to the extracted CPU usage fluctuation characteristics in the infinite loop, and the method for obtaining the CPU usage fluctuation index is:

[0019] Get the CPU usage data within the time period t to form a time series x[t], where t represents the time point. Determine the window size W and define a sliding window on the time series x[t]. Each window contains W data points. Starting from the time point t=0, move one data point at a time until the entire time series is covered. Calculate the mean μ in each window w and standard deviation σ w , average the standard deviations of all windows and calculate the CPU usage fluctuation index, the expression is: Where ER is the CPU usage fluctuation index, and N is the total number of data points in the time series x[t].

[0020] Preferably, in S3, the resource contention frequency fluctuation index and the CPU usage fluctuation index are converted into a first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model uses each group of first eigenvectors to predict the risk value label of timing problems that occur when not fully tested as the prediction target, and takes minimizing the sum of prediction errors of all risk value labels of timing problems that occur when not fully tested as the training target. The machine learning model is trained until the sum of prediction errors converges and the model training is stopped. The risk value of timing problems that occur when not fully tested is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0021] Preferably, in S4, the risk level of the timing problem that occurs when the test is not fully completed is divided, specifically: the acquired risk value is compared with the gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the risk value is compared with the first standard threshold and the second standard threshold respectively;

[0022] If the risk value is greater than the second standard threshold, it is classified as a high-risk timing problem level, and a first-level warning signal is generated; high-risk problems are given priority, and measures are taken immediately to investigate and repair them; if the risk value is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it is classified as a medium-risk timing problem level, and a second-level warning signal is generated; further testing and monitoring are carried out to determine the specific problem and the scope of impact; if the risk value is less than the first standard threshold, it is classified as a low-risk timing problem level, and a third-level warning signal is generated, and normal monitoring and regular inspections are carried out.

[0023] Preferably, in S5, for a medium-risk timing problem level, the stability of the MCU controlling the vehicle within a fixed time period is predicted, specifically:

[0024] When the risk level of timing problems that occur when not fully tested is a medium-risk timing problem level, that is, the risk value generated within a fixed time period is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the risk values ​​generated in subsequent fixed time periods that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and a data set is established, the mean and standard deviation of the data set are calculated, and after analysis, the stability of the MCU controlling the vehicle within the fixed time period is predicted based on the analysis results.

[0025] Preferably, if the mean value of the risk value in the data set is greater than or equal to the reference threshold value of the mean value of the risk value, and the standard deviation of the risk value is less than the reference threshold value of the standard deviation of the risk value, an unstable signal is generated at this time, and the overall risk of the MCU controlling the vehicle within a fixed time period is high but the fluctuation is small, and a retest is performed;

[0026] If the mean value of the risk value is greater than or equal to the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated at this time, and the overall risk of the MCU controlling the vehicle within a fixed time period is high and fluctuates greatly, and it is necessary to retest and optimize the task scheduling strategy and resource management;

[0027] If the mean value of the risk value is less than the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated at this time. The overall risk of the MCU controlling the vehicle within a fixed time period is low but the fluctuation is large, and it needs to be optimized;

[0028] If the mean risk value is less than the reference threshold of the mean risk value, and the standard deviation of the risk value is less than the reference threshold of the standard deviation of the risk value, a stable signal is generated at this time, and the overall risk of the MCU controlling the vehicle within a fixed time period is low and the fluctuation is small, and the existing test results and optimization measures are maintained.

[0029] The present invention also provides an automotive MCU automatic testing system, including a simulation test module, a comparison analysis module, a risk assessment module, a risk level classification module and a stability prediction module;

[0030] Simulation test module: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU;

[0031] Comparative analysis module: pre-process the recorded real-time operation timing data of the MCU, compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark, and determine whether the operation timing of the MCU is fully tested based on the analysis results;

[0032] Risk assessment module: When the operation timing of the MCU is not fully tested, the log files and error reports generated during the test are checked, the multi-task access resource conflict characteristics and the CPU usage fluctuation characteristics in the infinite loop are extracted, and after comprehensive analysis, the risk of timing problems when the test is not fully tested is evaluated;

[0033] Risk level classification module: Based on the assessment results, the risk level of timing problems that occur when the test is not fully completed is classified into high-risk timing problem level, medium-risk timing problem level and low-risk timing problem level, and the corresponding treatment is carried out;

[0034] Stability prediction module: For medium-risk timing problem levels, the stability of the MCU controlling the vehicle within a fixed time period is predicted, and based on the prediction results, it is determined whether to retest and optimize.

[0035] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0036] 1. The present invention ensures the comprehensiveness and accuracy of the test by defining a clear timing benchmark, simulating the real operating environment with simulators and test equipment, automatically performing multi-task load and environment simulation, and recording and preprocessing the real-time operation timing data of the MCU. At the same time, advanced algorithms such as Z-score anomaly detection, Fourier transform, and sliding window statistical analysis are used to conduct in-depth analysis and evaluation of the data, generate resource contention frequency fluctuation index and CPU usage fluctuation index, and predict the risk value when the test is not fully tested through a machine learning model to ensure timely identification and processing of potential timing problems.

[0037] 2. The present invention can effectively distinguish high, medium and low risks through risk level classification and corresponding early warning signals, and take targeted testing and optimization measures, especially further predicting and optimizing medium-risk timing problems, to ensure the stability and reliability of MCU in complex multi-tasking environments. It not only improves test efficiency and accuracy, reduces manual intervention and testing costs, but also significantly improves the performance and safety of automotive MCUs, and reduces the risk of unpredictable behaviors and accidents during vehicle driving. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0039] Figure 1 The present invention is a flow chart of the method.

[0040] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Example 1, please refer to Figure 1 As shown, the automotive MCU automatic testing method described in this embodiment includes the following steps:

[0043] S1: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU;

[0044] S2: preprocessing the recorded real-time operation timing data of the MCU, comparing and analyzing the preprocessed real-time operation timing data of the MCU with a predefined timing benchmark, and determining whether the operation timing of the MCU is fully tested according to the analysis result;

[0045] S3: When the operation timing of the MCU is not fully tested, check the log files and error reports generated during the test, extract the multi-task access resource conflict characteristics and CPU usage fluctuation characteristics in the infinite loop during the test, and conduct a comprehensive analysis to evaluate the risk of timing problems when the test is not fully tested;

[0046] S4: Based on the evaluation results, the risk level of timing problems that occur when insufficient testing is performed is divided into high-risk timing problem level, medium-risk timing problem level, and low-risk timing problem level, and the risk levels are handled accordingly;

[0047] S5: For medium-risk timing problem levels, predict the stability of the MCU controlling the vehicle within a fixed time period, and determine whether to retest and optimize based on the prediction results.

[0048] Among them, in S1, according to the target timing requirements of all operations in the automotive MCU, the timing benchmark of each operation is determined, the real operating environment is simulated through the simulator and test equipment, the preset multi-task load and environment simulation are executed through the automatic test script, and the real-time operation timing data of the MCU is recorded, specifically:

[0049] Collect all operations and their functional requirements of the automotive MCU, including engine control, transmission shifting, suspension system adjustment, etc. Determine the specific time requirements for each operation, such as maximum response time, minimum processing time, task switching time, etc.

[0050] Based on the collected requirements, establish the timing benchmarks for each operation. Record these benchmark values ​​as a reference standard to ensure that subsequent test data can be compared with the benchmark values.

[0051] Select an emulator suitable for automotive MCU testing, ensuring that it can accurately simulate the actual operating environment and multitasking. Configure the emulator to support testing of target timing requirements. Configure test equipment such as oscilloscopes, logic analyzers, etc. for recording and analyzing MCU operation timing. Calibrate the equipment to ensure its accuracy and reliability.

[0052] Create test scenarios that cover all operations and expected working conditions, including normal operation and fault conditions. Design multi-task loads to test the timing performance of the MCU under high load and complex environments. Write automatic test scripts to ensure that they can execute all preset test scenarios and task loads. The script should include steps such as initialization, task execution, data logging, and result analysis.

[0053] Set environmental parameters such as temperature, humidity, and electromagnetic interference through the simulator to ensure that they are consistent with the actual operating environment. Introduce various failure scenarios, such as sensor failure, communication interruption, power supply fluctuation, etc., to test the fault tolerance of the MCU. Run the simulator to simulate the preset real operating environment. Ensure that the environmental settings meet the target timing requirements and actual usage conditions.

[0054] Start the automatic test script to execute the preset multi-task load and environment simulation. Ensure that the test script covers all key operations and timing requirements. Use the test equipment to record the real-time operation timing data of the MCU, including task execution time, task switching time, interrupt processing time, etc. Ensure the integrity and accuracy of the data for subsequent analysis.

[0055] S2: preprocessing the recorded real-time operation timing data of the MCU, comparing and analyzing the preprocessed real-time operation timing data of the MCU with a predefined timing benchmark, and determining whether the operation timing of the MCU is fully tested according to the analysis result.

[0056] Export all recorded real-time operation timing data from the test equipment, including details such as task execution time, task switching time, interrupt processing time, etc. Ensure the integrity and consistency of the data to avoid data loss or recording errors. Arrange the data in chronological order and ensure that each record has an accurate timestamp. Classify the data by task type, priority, execution environment, etc. for subsequent analysis. Use filtering algorithms to remove noise and outliers in the data to ensure data accuracy. Smooth the data to reduce fluctuations and errors. Convert the data to a unified format to ensure that all recorded fields are consistent, such as unified time units (milliseconds or microseconds), standardized task identifiers, etc. Normalize the data to facilitate comparative analysis of data of different dimensions. Check the integrity and consistency of the data to ensure that each record has a complete timestamp and task identifier. Identify and correct any missing values ​​or erroneous records in the data.

[0057] According to the target timing requirements of all operations in the automotive MCU, determine the timing benchmark of each operation, collect the target timing requirements of each operation, set the timing benchmark of each operation, and form a benchmark data set B = {B1, B2, ..., Bm};

[0058] Compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark to identify the deviation, ensure that the real-time operation timing data and the timing benchmark are aligned on the same time axis, and calculate the deviation between each operation timing data and the benchmark. The expression is: △Ti=Ti-Bi; where △Ti is the deviation between the i-th operation timing data and the benchmark, Ti is the real-time timing data of the i-th operation, and Bi is the timing benchmark of the i-th operation;

[0059] Set the tolerance range ΔTthreshold of the timing benchmark deviation. If |ΔTi|≤ΔTthreshold, the i-th operation is considered to have been fully tested, and the operations that meet the benchmark requirements are confirmed to have been fully tested and recorded; if |ΔTi|≤ΔTthreshold, the i-th operation is considered to have not been fully tested, and the specific reasons for not meeting the benchmark are determined, such as resource contention, task priority issues, hardware limitations, etc. Take optimization measures for specific problems, such as adjusting task scheduling strategies, optimizing codes, and increasing hardware resources.

[0060] S3: When the operation timing of the MCU is not fully tested, check the log files and error reports generated during the test process, extract the multi-task access resource conflict characteristics and CPU usage fluctuation characteristics in the infinite loop during the test, and conduct a comprehensive analysis to evaluate the risk of timing problems when the test is not fully tested.

[0061] When the operation timing of the MCU is not fully tested, it is necessary to carefully check the log files and error reports generated during the test process to find abnormal phenomena such as multi-task access resource conflicts, CPU usage fluctuations in infinite loops, and system unresponsiveness, dead loops, and abnormal restarts. By analyzing these logs and error reports, the root causes of timing problems such as race conditions or deadlocks can be identified, thereby evaluating the stability and reliability of the MCU during multi-tasking and taking corresponding optimization measures.

[0062] The resource contention frequency fluctuation index is generated according to the extracted multi-task access resource conflict characteristics during the test process. The method for obtaining the resource contention frequency fluctuation index is:

[0063] Get the frequency of multiple tasks trying to access the same resource at the same time in the s time period, preprocess the resource contention frequency signal, remove noise and outliers, and represent the preprocessed signal data as a time series x[n], where n represents a discrete time point. Calculate the discrete Fourier transform X[k], which is expressed as: Where X[k] is the value of the frequency signal at the kth frequency point, x[n] is the value of the time domain signal at the nth sample point, N is the total number of signal sample points, and e[k] is the value of the time domain signal at the nth sample point. -j2πkn / Nis the kernel function of Fourier transform, where j is an imaginary unit, and the spectrum amplitude X[k]| is calculated. The calculation expression is: Where Re(X(k)) 2 is the real part of X(k), IM(X(k)) 2 It is the imaginary part of X(k). According to the spectrum amplitude, the fluctuation degree of the quantified signal is calculated, and the total spectrum energy E is calculated. The expression is: Calculate the high frequency component energy E h , the expression is: Among them, k L It is the lower limit index of the high-frequency component, which is the part of the signal spectrum that is greater than or equal to the average frequency. It calculates the resource contention frequency fluctuation index, and the expression is: Where AD is the resource contention frequency fluctuation index.

[0064] The greater the resource contention frequency fluctuation index, the higher the risk of timing problems when not fully tested. Specifically, a higher anomaly index indicates a higher frequency of resource contention in the system, which usually means more resource conflicts and contention during multitasking. Frequent resource contention leads to unpredictable task execution, which increases the probability of timing problems in the system under high load or complex environments.

[0065] A high anomaly index also means that the system may encounter more race conditions when switching between different tasks. Race conditions can cause tasks to fail to execute as expected, and may cause serious timing problems such as task priority inversion and deadlock. These problems not only affect the real-time and stability of the system, but may also cause delays or failures of key tasks, and in severe cases even cause system crashes or failures.

[0066] Therefore, when the resource contention frequency fluctuation index is large, special attention should be paid to the MCU's multi-task scheduling strategy and resource management mechanism. By optimizing these aspects, the frequency and fluctuation of resource contention can be reduced, thereby reducing the risk of timing problems, improving the stability and reliability of the system, and ensuring safe operation in a complex multi-task environment.

[0067] The CPU usage fluctuation index is generated according to the extracted CPU usage fluctuation characteristics in the infinite loop. The method for obtaining the CPU usage fluctuation index is as follows:

[0068] Get the CPU usage data within the time period t to form a time series x[t], where t represents the time point. Determine the window size W and define a sliding window on the time series x[t]. Each window contains W data points. Starting from the time point t=0, move one data point at a time until the entire time series is covered. Calculate the mean μ in each window w and standard deviation σ w, average the standard deviations of all windows and calculate the CPU usage fluctuation index, the expression is: Where ER is the CPU usage fluctuation index, and N is the total number of data points in the time series x[t].

[0069] The larger the CPU usage fluctuation index, the higher the risk of timing problems when not fully tested. A larger fluctuation index indicates that the CPU usage fluctuates significantly at different time points, reflecting frequent resource contention and task switching in the system during multitasking. These fluctuations can lead to unpredictable task execution and unstable timing, increasing the risk of serious timing problems such as race conditions and deadlocks in the system.

[0070] A high volatility index also means that the system may encounter performance bottlenecks under high load or complex task environments. Frequent resource contention and task switching will not only cause task execution delays, but may also lead to task priority inversion, and critical tasks will not be processed in a timely manner. In this case, the real-time performance and responsiveness of the system will be affected, resulting in the inability to execute control instructions as expected, which in turn affects the safety and stability of the vehicle.

[0071] Therefore, when the CPU usage fluctuation index is large, special attention should be paid to the MCU's scheduling strategy and resource management mechanism. By optimizing these aspects, the frequency and amplitude of resource contention can be reduced, the system's timing stability can be improved, and the risk of timing problems can be reduced, thereby ensuring reliable operation in a complex multi-tasking environment.

[0072] The resource contention frequency fluctuation index and the CPU usage fluctuation index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model uses each group of first eigenvectors to predict the risk value label of timing problems that occur when not fully tested as the prediction target, and takes minimizing the sum of prediction errors of all risk value labels of timing problems that occur when not fully tested as the training target. The machine learning model is trained until the sum of prediction errors converges, and the model training is stopped. The risk value of timing problems that occur when not fully tested is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0073] The method for obtaining the risk value of timing problems that occur when not fully tested is: from the first eigenvector training data of the trained machine learning model, obtain the corresponding function expression: CR=f1(AD, ER); where f1 is the output function of the model, AD is the resource contention frequency fluctuation index, ER is the CPU usage fluctuation index, and CR is the risk value of timing problems that occur when not fully tested.

[0074] S4: Based on the evaluation results, the risk levels of timing problems that occur when insufficient testing is performed are divided into high-risk timing problem levels, medium-risk timing problem levels, and low-risk timing problem levels, and they are handled accordingly.

[0075] The acquired risk value is compared with a gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the risk value is compared with the first standard threshold and the second standard threshold respectively;

[0076] If the risk value is greater than the second standard threshold, it is classified as a high-risk timing problem level, and a first-level warning signal is generated; high-risk problems are handled first, and measures are taken immediately for detailed investigation and repair. A comprehensive system inspection is conducted to find out the root cause of high-risk problems and optimize task scheduling strategies and resource management mechanisms.

[0077] If the risk value is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it is classified as a medium-risk timing problem level, and a second-level warning signal is generated; further testing and monitoring are carried out to determine the specific problem and the scope of impact. The scheduling algorithm is optimized, and necessary code and hardware adjustments are made to prevent the problem from deteriorating into a high risk level.

[0078] If the risk value is less than the first standard threshold, it is classified as a low-risk timing problem level, and a third-level warning signal is generated. Regular monitoring and regular inspections ensure that the problem does not escalate. Low-risk problems are recorded as a reference for system optimization.

[0079] It should be noted here that the management level of the first-level warning signal is higher than that of the second-level warning signal, and the management level of the second-level warning signal is higher than that of the third-level warning signal. Relevant personnel can carry out corresponding management according to the levels of different warning signals.

[0080] S5: For medium-risk timing problem levels, predict the stability of the MCU controlling the vehicle within a fixed time period, and determine whether to retest and optimize based on the prediction results.

[0081] When the risk level of timing problems that occur when not fully tested is a medium-risk timing problem level, that is, the risk value generated within a fixed time period is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the risk values ​​generated in subsequent fixed time periods that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and a data set is established, the mean and standard deviation of the data set are calculated, and after analysis, the stability of the MCU controlling the vehicle within the fixed time period is predicted based on the analysis results.

[0082] If the mean of the risk values ​​in the data set is greater than or equal to the reference threshold of the mean of the risk values, and the standard deviation of the risk values ​​is less than the reference threshold of the standard deviation of the risk values, an unstable signal is generated, indicating that the overall risk of the MCU controlling the vehicle is high but the fluctuation is small within a fixed time period, that is, the MCU is stable under certain specific tasks or working conditions, but there is a high risk overall. Retesting is carried out, and detailed analysis and optimization are carried out for high-risk tasks or working conditions;

[0083] If the mean value of the risk value is greater than or equal to the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated, indicating that the overall risk of the MCU controlling the vehicle is high and fluctuates greatly within a fixed time period, that is, the timing problem of the MCU is inconsistent under different working conditions, and there is a large uncertainty. Retesting and optimization are required, focusing on the stability and consistency of the system under various working conditions, and optimizing task scheduling strategies and resource management;

[0084] If the mean value of the risk value is less than the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated, indicating that the overall risk of the MCU controlling the vehicle is low but the fluctuation is large within a fixed time period, that is, the system may have large fluctuations under certain specific conditions. Optimization is required, with special attention paid to the specific conditions and tasks that cause fluctuations, and these parts are optimized to improve system stability;

[0085] If the mean risk value is less than the reference threshold of the mean risk value, and the standard deviation of the risk value is less than the reference threshold of the standard deviation of the risk value, a stable signal is generated, indicating that the overall risk of the MCU controlling the vehicle is low and the fluctuation is small within a fixed time period, that is, the system is relatively stable. You can maintain the existing test results and optimization measures, monitor the system performance regularly, and ensure stability.

[0086] In this embodiment, the timing benchmark of each operation is determined according to the target timing requirements of all operations in the automotive MCU, the real operating environment is simulated by the simulator and the test equipment, the preset multi-task load and environment simulation are executed by the automatic test script, and the real-time operation timing data of the MCU is recorded; the recorded real-time operation timing data of the MCU is preprocessed, and the preprocessed real-time operation timing data of the MCU is compared and analyzed with the pre-defined timing benchmark, and it is determined whether the operation timing of the MCU is fully tested according to the analysis result; when the operation timing of the MCU is not fully tested, the log file and error report generated during the test process are checked, and the multi-task access resource conflict features during the test process are extracted. The CPU usage fluctuation characteristics in the infinite loop and the infinite loop are analyzed comprehensively to evaluate the risk of timing problems when not fully tested; based on the evaluation results, the risk level of timing problems when not fully tested is divided into high-risk timing problem level, medium-risk timing problem level and low-risk timing problem level, and they are handled accordingly; for the medium-risk timing problem level, the stability of the MCU controlling the vehicle within a fixed time period is predicted, and based on the prediction results, it is determined whether to retest and optimize, which can effectively identify and solve potential timing problems, improve the overall performance of the MCU, reduce the possibility of system failure, and thus improve the safety and operation efficiency of the vehicle.

[0087] Example 2, please refer to Figure 2 As shown, an automotive MCU automatic testing system described in this embodiment includes a simulation test module, a comparison analysis module, a risk assessment module, a risk level classification module and a stability prediction module;

[0088] Simulation test module: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU;

[0089] Comparative analysis module: pre-process the recorded real-time operation timing data of the MCU, compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark, and determine whether the operation timing of the MCU is fully tested based on the analysis results;

[0090] Risk assessment module: When the operation timing of the MCU is not fully tested, the log files and error reports generated during the test are checked, the multi-task access resource conflict characteristics and the CPU usage fluctuation characteristics in the infinite loop are extracted, and after comprehensive analysis, the risk of timing problems when the test is not fully tested is evaluated;

[0091] Risk level classification module: Based on the assessment results, the risk level of timing problems that occur when the test is not fully completed is classified into high-risk timing problem level, medium-risk timing problem level and low-risk timing problem level, and the corresponding treatment is carried out;

[0092] Stability prediction module: For medium-risk timing problem levels, the stability of the MCU controlling the vehicle within a fixed time period is predicted, and based on the prediction results, it is determined whether to retest and optimize.

[0093] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0094] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0095] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0096] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0097] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0098] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An automatic testing method for an automobile MCU, characterized in that: The steps include: S1: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU; S2: preprocessing the recorded real-time operation timing data of the MCU, comparing and analyzing the preprocessed real-time operation timing data of the MCU with a predefined timing benchmark, and determining whether the operation timing of the MCU is fully tested according to the analysis result; Step S2 specifically includes: determining the timing benchmark of each operation according to the target timing requirements of all operations in the automotive MCU, collecting the target timing requirements of each operation, setting the timing benchmark of each operation, and forming a benchmark data set B = {B1, B2, ..., Bm}; Compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark to identify the deviation, ensure that the real-time operation timing data and the timing benchmark are aligned on the same time axis, and calculate the deviation between each operation timing data and the benchmark. The expression is: ΔTi = Ti-Bi; where ΔTi is the deviation between the i-th operation timing data and the benchmark, Ti is the real-time timing data of the i-th operation, and Bi is the timing benchmark of the i-th operation; Set the tolerance range ΔTthreshold of the timing benchmark deviation. If |ΔTi|≤ΔTthreshold, the i-th operation is considered to have been fully tested. The operations that meet the benchmark requirements are confirmed to have been fully tested and recorded. If |ΔTi|≤ΔTthreshold, the i-th operation is considered to have not been fully tested. S3: When the operation timing of the MCU is not fully tested, check the log files and error reports generated during the test, extract the multi-task access resource conflict characteristics and CPU usage fluctuation characteristics in the infinite loop during the test, and conduct a comprehensive analysis to evaluate the risk of timing problems when the test is not fully tested; Step S3 specifically includes: generating a resource contention frequency fluctuation index according to the extracted multi-task resource access conflict characteristics during the test process, and the method for obtaining the resource contention frequency fluctuation index is: Obtain the frequency of multiple tasks trying to access the same resource at the same time within the time period s, preprocess the resource contention frequency signal, and represent the preprocessed signal data as a time series x[n], where n represents a discrete time point. Calculate the discrete Fourier transform X[k], which is expressed as: Where X[k] is the value of the frequency signal at the kth frequency point, x[n] is the value of the time domain signal at the nth sample point, N is the total number of signal sample points, and e[k] is the value of the time domain signal at the nth sample point. -j2πkn / N is the kernel function of Fourier transform, where j is an imaginary unit, and the spectrum amplitude |X[k]| is calculated using the expression: Where Re(X(k)) 2 is the real part of X(k), IM(X(k)) 2 is the imaginary part of X(k). According to the spectrum amplitude, the total spectrum energy E is calculated. The expression is: Calculate the high frequency component energy E h , the expression is: Among them, k L It is the lower limit index of the high-frequency component, which is the part of the signal spectrum that is greater than or equal to the average frequency. It calculates the resource contention frequency fluctuation index, and the expression is: In the formula, AD is the resource contention frequency fluctuation index; The CPU usage fluctuation index is generated according to the extracted CPU usage fluctuation characteristics in the infinite loop. The method for obtaining the CPU usage fluctuation index is as follows: Get the CPU usage data within the time period t to form a time series x[t], where t represents the time point. Determine the window size W and define a sliding window on the time series x[t]. Each window contains W data points. Starting from the time point t=0, move one data point at a time until the entire time series is covered. Calculate the mean μ in each window w and standard deviation σ W , average the standard deviations of all windows and calculate the CPU usage fluctuation index, the expression is: Where ER is the CPU usage fluctuation index, N is the total number of data points in the time series x[t]; The resource contention frequency fluctuation index and the CPU usage fluctuation index are converted into a first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model uses the risk value label of the timing problem when the first eigenvector is not fully tested as the prediction target, and minimizes the sum of the prediction errors of all risk value labels of the timing problem when the timing problem is not fully tested as the training target. The machine learning model is trained until the sum of the prediction errors reaches convergence, and the model training is stopped. The risk value of the timing problem when the timing problem is not fully tested is determined according to the model output result, wherein the machine learning model is a polynomial regression model; S4: Based on the evaluation results, the risk level of timing problems that occur when insufficient testing is performed is divided into high-risk timing problem level, medium-risk timing problem level, and low-risk timing problem level, and the risk levels are handled accordingly; S5: For medium-risk timing problem levels, predict the stability of the MCU controlling the vehicle within a fixed time period, and determine whether to retest and optimize based on the prediction results.

2. The method for automatically testing an automotive MCU according to claim 1, characterized in that: In S4, the risk level of timing problems that occur when insufficient testing is performed is divided into: The acquired risk value is compared with a gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the risk value is compared with the first standard threshold and the second standard threshold respectively; If the risk value is greater than the second standard threshold, it is classified as a high-risk timing problem level, and a first-level warning signal is generated; Prioritize high-risk issues and take immediate measures to investigate and repair them; if the risk value is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it is classified as a medium-risk timing problem level, and a second-level warning signal is generated; further testing and monitoring are carried out to determine the specific problem and the scope of impact; if the risk value is less than the first standard threshold, it is classified as a low-risk timing problem level, and a third-level warning signal is generated, and normal monitoring and regular inspections are carried out.

3. The method for automatically testing an automotive MCU according to claim 1, characterized in that: In S5, for the medium-risk timing problem level, the stability of the MCU controlling the vehicle within a fixed time period is predicted, specifically: When the risk level of timing problems that occur when not fully tested is a medium-risk timing problem level, that is, the risk value generated within a fixed time period is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the risk values ​​generated in subsequent fixed time periods that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and a data set is established, the mean and standard deviation of the data set are calculated, and after analysis, the stability of the MCU controlling the vehicle within the fixed time period is predicted based on the analysis results.

4. The method for automatically testing an automotive MCU according to claim 3, characterized in that: If the mean value of the risk value in the data set is greater than or equal to the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is less than the reference threshold of the standard deviation of the risk value, an unstable signal is generated at this time, and the overall risk of the MCU controlling the vehicle is high but the fluctuation is small within a fixed time period, and a retest is performed; If the mean value of the risk value is greater than or equal to the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated at this time, and the overall risk of the MCU controlling the vehicle within a fixed time period is high and fluctuates greatly, and it is necessary to retest and optimize the task scheduling strategy and resource management; If the mean value of the risk value is less than the reference threshold of the mean value of the risk value, and the standard deviation of the risk value is greater than or equal to the reference threshold of the standard deviation of the risk value, an unstable signal is generated at this time. The overall risk of the MCU controlling the vehicle within a fixed time period is low but the fluctuation is large, and it needs to be optimized; If the mean risk value is less than the reference threshold of the mean risk value, and the standard deviation of the risk value is less than the reference threshold of the standard deviation of the risk value, a stable signal is generated at this time, and the overall risk of the MCU controlling the vehicle within a fixed time period is low and the fluctuation is small, and the existing test results and optimization measures are maintained.

5. An automotive MCU automatic testing system, used to implement an automotive MCU automatic testing method according to any one of claims 1 to 4, characterized in that: It includes simulation test module, comparative analysis module, risk assessment module, risk level classification module and stability prediction module; Simulation test module: Determine the timing benchmark for each operation based on the target timing requirements of all operations in the automotive MCU, simulate the real operating environment through simulators and test equipment, execute preset multi-task loads and environment simulations through automatic test scripts, and record the real-time operation timing data of the MCU; Comparative analysis module: pre-process the recorded real-time operation timing data of the MCU, compare and analyze the pre-processed real-time operation timing data of the MCU with the pre-defined timing benchmark, and determine whether the operation timing of the MCU is fully tested based on the analysis results; Risk assessment module: When the operation timing of the MCU is not fully tested, the log files and error reports generated during the test are checked, the multi-task access resource conflict characteristics and the CPU usage fluctuation characteristics in the infinite loop are extracted, and after comprehensive analysis, the risk of timing problems when the test is not fully tested is evaluated; Risk level classification module: Based on the assessment results, the risk level of timing problems that occur when the test is not fully completed is classified into high-risk timing problem level, medium-risk timing problem level and low-risk timing problem level, and the corresponding treatment is carried out; Stability prediction module: For medium-risk timing problem levels, the stability of the MCU controlling the vehicle within a fixed time period is predicted, and based on the prediction results, it is determined whether to retest and optimize.

Citation Information

Patent Citations

  • Oxygen generator switching time sequence control method based on pressure control

    CN110320836A

  • Microcontrol unit function test method and device

    CN115562250A

  • Time sequence detection method, system and equipment for vehicle-mounted screen and medium

    CN117612463A

  • Expressway bridge construction management system and method

    CN118509821A

  • Data processing method and data processor

    JP2004336389A