Engine oil quantity monitoring method, device and equipment
Patent Information
- Application Number
- CN202610939449.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]本申请实施例提供了一种发动机机油量监测方法、装置及设备,可以解决如何提高在嵌入式设备中机油量预测的准确性的技术问题
[0022] Compared with related technologies, this engine oil level monitoring device has at least the following beneficial effects: by obtaining the memory usage threshold corresponding to the pre-trained oil level prediction model and the target embedded device, the hardware resource constraints of model optimization can be clearly defined, and the accuracy, code data storage volume, and functional safety factor of the pre-trained model can be determined simultaneously. Based on these parameters, the model parameters can be optimized to generate the target oil level prediction model. This can simultaneously take into account the model recognition accuracy, vehicle hardware storage limitations, and vehicle operation safety requirements, reduce the occurrence of storage overruns or insufficient anti-interference capabilities after model deployment, and improve the accuracy of oil level prediction in embedded devices.
Smart Images

Figure CN122594865A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of engine technology, and in particular to methods, devices and equipment for monitoring engine oil levels. Background Technology
[0002] Among related technologies, oil level monitoring solutions mainly include three categories: manual dipstick detection, installation of physical oil level sensors, and machine learning prediction based on engine operating parameters. Among these, machine learning prediction solutions typically train classification or regression models based on labeled datasets of engine operating parameters, and optimize model performance through feature selection, model structure pruning, and other methods.
[0003] However, the accuracy of related machine learning prediction models is prone to decay when deployed to resource-constrained embedded devices. Therefore, how to improve the accuracy of oil level prediction in embedded devices has become a problem to be solved. Summary of the Invention
[0004] This application provides an engine oil level monitoring method, device, and equipment, which can solve the technical problem of how to improve the accuracy of oil level prediction in embedded devices.
[0005] Firstly, this application proposes an engine oil level monitoring method, which includes: Obtain the pre-trained oil level prediction model and the memory usage threshold of the target embedded device; Determine the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor; Based on memory usage threshold, accuracy, code data storage volume and functional safety factor, the oil level prediction model is optimized to obtain the target oil level prediction model. Engine oil level is monitored using a target oil level prediction model.
[0006] Compared with related technologies, this engine oil level monitoring method has at least the following beneficial effects: by obtaining the memory usage threshold corresponding to the pre-trained oil level prediction model and the target embedded device, the hardware resource constraints of model optimization can be clearly defined, and the accuracy, code data storage volume, and functional safety factor of the pre-trained model can be determined simultaneously. Based on these parameters, the model parameters can be optimized to generate the target oil level prediction model. This method can simultaneously take into account the model recognition accuracy, vehicle hardware storage limitations, and vehicle operation safety requirements, reducing the occurrence of storage overruns or insufficient anti-interference capabilities after model deployment, and improving the accuracy of oil level prediction in embedded devices.
[0007] In the first possible implementation of the first aspect, the steps of optimizing the model parameters of the oil level prediction model based on memory usage threshold, accuracy, code data storage volume, and functional safety factor to obtain the target oil level prediction model include: An optimization objective function is constructed based on memory usage threshold, accuracy, data storage volume, and functional safety factor; The oil quantity prediction model is optimized by optimizing the model parameters based on the objective function, and the target oil quantity prediction model is obtained.
[0008] In the first possible implementation of the first aspect, by integrating accuracy, code data storage volume, memory usage threshold and functional safety factor to construct an optimization objective function, the parameters of the oil level prediction model are optimized. This allows for the search of hyperparameter combinations that balance multi-dimensional constraints across the entire domain, enabling the generated target oil level prediction model to be adapted to vehicle hardware carriers with limited resources, while maintaining prediction accuracy and safe operation capabilities that meet usage requirements.
[0009] In the second possible implementation of the first aspect, the steps of constructing the optimization objective function based on memory usage threshold, accuracy, data storage volume, and functional safety factor include: Construct a model accuracy loss term based on the accuracy rate; Construct resource usage items based on data storage volume and memory usage thresholds; Construct safety loss terms based on functional safety factors; The objective function is obtained by weighted summation of the model's accuracy loss term, resource consumption term, and security loss term.
[0010] In the second possible implementation of the first aspect, the optimization objective function is generated by merging the model accuracy loss term, resource consumption term, and safety loss term through weighted summation. This allows the optimization objective function to simultaneously take into account the constraints of model prediction accuracy, hardware storage limit, and vehicle operation safety, providing a comprehensive quantitative evaluation basis for parameter optimization.
[0011] In the third possible implementation of the first aspect, the steps of optimizing the model parameters of the oil quantity prediction model according to the objective function to obtain the target oil quantity prediction model include: Initialize the particle swarm by setting the hyperparameter combination of the oil level prediction model to the particle position information of the particle swarm. The function value corresponding to the objective function is calculated based on the particle position information, and the function value is used as the fitness. Update particle position information based on fitness; Return the function value corresponding to the optimization objective function based on the particle position information, and use the function value as the fitness step until the preset number of iterations is reached to obtain the global target position information; The hyperparameter combination corresponding to the global target location information is determined as the target hyperparameter combination; Based on the target hyperparameter combination, configure the oil quantity prediction model to obtain the target oil quantity prediction model.
[0012] In the third possible implementation of the first aspect, the target oil quantity prediction model obtained by optimizing the model parameters can control the storage volume of the converted code to not exceed the hardware memory limit while ensuring the accuracy of oil quantity classification and recognition. At the same time, it can maintain the functional safety performance that meets the complex working conditions of hybrid vehicles, reduce the situation of memory overrun and insufficient anti-interference ability after the model is deployed to the embedded hardware carrier, and realize the lightweight adaptation and optimization of the machine learning model for vehicle hardware.
[0013] In the fourth possible implementation of the first aspect, the steps of monitoring engine oil quantity using a target oil quantity prediction model include: Determine the target sliding window and target attenuation coefficient based on the current operating condition information; Input the multi-dimensional operating parameters of the engine into the target oil quantity prediction model to obtain the predicted oil quantity level; The target sliding window is used to obtain multiple predicted oil level grades and their corresponding time series numbers. The time series numbers are used to mark the time series of the historical predicted oil level grades within the target sliding window. The current oil level is determined from multiple predicted oil level levels based on the time series number and the target decay coefficient to complete engine oil level monitoring.
[0014] In the fourth possible implementation of the first aspect, the target oil quantity prediction model analyzes the multi-dimensional operating parameters of the engine in real time to obtain the single predicted oil quantity level. The target sliding window caches the time-series prediction results and binds the time series labels. The time series labels and the target attenuation coefficient are combined to complete the weighted statistical screening of the current oil quantity level. This can reduce the single prediction deviation caused by instantaneous operating condition disturbances and reduce the frequency of false alarms of abnormal oil quantity.
[0015] In the fifth possible implementation of the first aspect, the steps of determining the target sliding window and the target attenuation coefficient based on the current operating condition information include: Obtain the preset sliding window and preset attenuation coefficient; Determine the number of engine start-stop cycles and the standard deviation of engine speed based on current operating condition information; The intensity of the operating condition disturbance is calculated based on the number of engine start-stop cycles and the standard deviation of engine speed. When the operating condition disturbance intensity is not within the preset disturbance range, the preset sliding window and preset attenuation coefficient are adjusted based on the operating condition disturbance intensity to obtain the target sliding window and target attenuation coefficient.
[0016] In the fifth possible implementation of the first aspect, by dynamically matching the target sliding window and target attenuation coefficient of the adapted scenario with the current operating condition information, the post-processing logic can be adjusted for the high-disturbance operating conditions caused by the frequent start-stop of hybrid vehicles, thereby enhancing the stability of result determination under complex operating conditions.
[0017] In the sixth possible implementation of the first aspect, the current oil level is determined from multiple predicted oil level levels based on a timing index and a target decay coefficient to complete the engine oil level monitoring step, including: The prediction weights for multiple predicted oil level grades are calculated based on the time series number and the target decay coefficient. The weighted score for each oil level category in the target sliding window is calculated based on the predicted weights. The current oil level is determined from multiple predicted oil level levels based on a weighted score to complete engine oil level monitoring.
[0018] In the sixth possible implementation of the first aspect, the generation time of the prediction results is distinguished by the time sequence number, and the prediction weight of each predicted oil level is calculated by combining the target attenuation coefficient adapted to the real-time operating conditions. This can amplify the reference role of recent model inference results, fit the operating characteristics of the dynamic changes in oil distribution of hybrid vehicles, and accumulate the corresponding prediction weights according to the oil level category to obtain a weighted score. By comparing the weighted scores to filter the current oil level, the false alarm caused by instantaneous operating condition disturbances can be reduced.
[0019] In the seventh possible implementation of the first aspect, the steps of determining the accuracy of the oil level prediction model, the code data storage size, and the functional safety factor include: Obtain the accuracy of the oil level prediction model on the test set; The oil level prediction model is converted into target code, the data storage size of the target code is obtained, and the code data storage size is obtained. Obtain the fault detection coverage, single-point fault metric, and prediction consistency of the oil level prediction model, and determine the functional safety factor based on the fault detection coverage, single-point fault metric, and prediction consistency.
[0020] In the seventh possible implementation of the first aspect, the basic classification and recognition capability of the model is measured by accuracy, the actual consumption of vehicle hardware storage space by the model deployment is quantified by code data storage volume, and the comprehensive safety performance of the model in dealing with various non-ideal working conditions is quantified by the functional safety factor that integrates three indicators: fault detection coverage, single point of failure measurement, and prediction consistency. This can provide a reliable quantitative basis for the subsequent construction of the optimization objective function.
[0021] Secondly, this application also proposes an engine oil level monitoring device, which includes: The data acquisition module is used to acquire the pre-trained oil level prediction model and the memory usage threshold of the target embedded device; The data acquisition module is also used to determine the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor. The model optimization module is used to optimize the model parameters of the oil level prediction model based on memory usage threshold, accuracy, code data storage volume and functional safety factor, so as to obtain the target oil level prediction model. The oil level monitoring module is used to monitor the engine oil level using a target oil level prediction model.
[0022] Compared with related technologies, this engine oil level monitoring device has at least the following beneficial effects: by obtaining the memory usage threshold corresponding to the pre-trained oil level prediction model and the target embedded device, the hardware resource constraints of model optimization can be clearly defined, and the accuracy, code data storage volume, and functional safety factor of the pre-trained model can be determined simultaneously. Based on these parameters, the model parameters can be optimized to generate the target oil level prediction model. This can simultaneously take into account the model recognition accuracy, vehicle hardware storage limitations, and vehicle operation safety requirements, reduce the occurrence of storage overruns or insufficient anti-interference capabilities after model deployment, and improve the accuracy of oil level prediction in embedded devices.
[0023] Thirdly, this application also proposes an engine oil level monitoring device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the engine oil level monitoring method described above.
[0024] Fourthly, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the engine oil level monitoring method described above.
[0025] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the engine oil level monitoring method described above. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0027] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart illustrating an embodiment of the engine oil level monitoring method of this application; Figure 2 This is a schematic diagram of the model parameter optimization process of an embodiment of the engine oil quantity monitoring method of this application; Figure 3 This is yet another flowchart illustrating an embodiment of the engine oil level monitoring method of this application; Figure 4 A simplified flowchart illustrating an engine oil level monitoring method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the module structure of the engine oil level monitoring device according to an embodiment of this application; Figure 6 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the engine oil level monitoring method in this application embodiment.
[0029] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0030] It should be understood that the specific embodiments described herein are used to explain the technical solutions of this application, but are not intended to limit this application.
[0031] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0032] The main solution of this application embodiment is: to obtain a pre-trained oil level prediction model and the memory usage threshold of the target embedded device; to determine the accuracy, code data storage volume, and functional safety factor of the oil level prediction model; to optimize the model parameters of the oil level prediction model based on the memory usage threshold, accuracy, code data storage volume, and functional safety factor to obtain the target oil level prediction model; and to monitor the engine oil level using the target oil level prediction model.
[0033] This application provides a solution that, by obtaining the memory usage threshold corresponding to the pre-trained oil level prediction model and the target embedded device, clarifies the hardware resource constraints of model optimization, simultaneously determines the accuracy, code data storage volume, and functional safety factor of the pre-trained model, and generates the target oil level prediction model based on these parameters through model parameter optimization. This solution can simultaneously consider model recognition accuracy, vehicle hardware storage limitations, and vehicle operation safety requirements, reducing the occurrence of storage overruns or insufficient anti-interference capabilities after model deployment, and improving the accuracy of oil level prediction in embedded devices.
[0034] The executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone; or an electronic device, engine oil level monitoring device, or vehicle-mounted device capable of performing the above functions. The following description uses a vehicle-mounted device as an example to illustrate this embodiment and the subsequent embodiments.
[0035] Based on this, embodiments of this application provide a method for monitoring engine oil level, referring to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the engine oil level monitoring method of this application.
[0036] In this embodiment, the engine oil level monitoring method includes steps S10 to S40.
[0037] Step S10: Obtain the pre-trained oil level prediction model and the memory usage threshold of the target embedded device.
[0038] In this embodiment, the pre-trained oil level prediction model can receive multi-dimensional engine operating parameters as input and output the corresponding oil level grades. Multiple oil level grades can be set in engine bench tests or real-vehicle road tests. At each oil level grade, multi-dimensional parameters during engine operation are continuously collected, such as the exhaust gas recirculation (EGR) valve pressure ratio, fuel consumption, actual engine torque, oil pressure, actual injector pulse width, throttle opening, and actual ignition angle. Each oil level grade is labeled with a corresponding oil level label, such as normal, low, or severely insufficient, thus constructing a supervised learning dataset. During the construction of the supervised learning dataset, the collected raw data can be preprocessed, such as removing outliers and missing values, to improve the dataset quality.
[0039] After obtaining the supervised learning dataset, it can be divided into a training set and a test set. Based on the training set, a machine learning model such as Extreme Gradient Boosting (XGBoost) is trained to obtain a pre-trained oil level prediction model. XGBoost is a gradient boosting machine learning model that relies on iteratively adding decision trees to reduce the prediction residual. Each tree in the XGBoost model learns the difference (residual) between the predicted value of the previous tree and the true value, and these trees are combined in a weighted manner to form the final prediction model. The objective function of the XGBoost model includes a loss function and a regularization term. The regularization term is used to constrain model complexity and avoid overfitting. During model training, all features are traversed to calculate the information gain, and the feature with the highest gain is selected to perform node splitting.
[0040] For example, the objective function of the XGBoost model is expressed as follows:
[0041] In the formula, This represents the objective function of the XGBoost model, used to comprehensively evaluate the model's training performance and constrain its complexity. This represents all learnable parameters of the XGBoost model; This represents the loss function, used to measure the difference between the model's predicted values and the actual oil level labels; Indicates the first The actual oil level labels corresponding to the group samples; Indicates the first The model's predicted oil level for each group of samples; This represents a regularization term used to control model complexity and prevent overfitting. In the XGBoost model, the first... A decision tree; This indicates the total number of decision trees contained in the XGBoost model.
[0042] Furthermore, the target embedded device is an in-vehicle hardware carrier mounted on the vehicle. Its internal storage space and running memory have fixed upper limits, and it can only support machine learning models whose size and computing power consumption meet the constraints. The memory usage threshold is the maximum allowed memory usage limit of the target embedded device. The storage capacity occupied by the model deployed on the target embedded device during runtime cannot exceed the value corresponding to the memory usage threshold.
[0043] The pre-trained oil level prediction model is retrieved, and the hardware parameter configuration file built into the target embedded device is read synchronously. The corresponding memory usage threshold is then extracted from the configuration file.
[0044] Step S20: Determine the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor.
[0045] In this embodiment, accuracy is defined as the proportion of samples whose predicted oil level matches the actual oil level after the test set is input into the pre-trained oil level prediction model. Code data storage capacity is the storage space occupied by all code files after the pre-trained oil level prediction model is converted into target language (e.g., C) code that can be directly run on the target embedded device using a code generation tool. Functional safety factor is a comprehensive evaluation index used to quantify the model's stable and reliable operation in an in-vehicle environment.
[0046] In some feasible implementations, step S20 may include steps S21 to S23: Step S21: Obtain the accuracy of the oil level prediction model on the test set.
[0047] In this embodiment, the test set is a dataset partitioned based on a supervised learning dataset to test the classification accuracy of the model. After inputting the test set into the pre-trained oil level prediction model and obtaining the prediction results, the accuracy is obtained by calculating the proportion of samples in the prediction results whose oil level labels are consistent with the actual oil level labels among all test samples in the test set.
[0048] Step S22: Convert the oil level prediction model into target code, obtain the data storage size of the target code, and get the code data storage size.
[0049] In this embodiment, the code generation tool is a compilation tool used to convert a pre-trained oil level prediction model, such as an XGBoost model, into a standardized code language program. The target code is a complete set of target language code files output by the code generation tool after converting the oil level prediction model. For the XGBoost model, the target code may include all decision tree branch rules, weight calculation logic, input-output mapping rules, etc.
[0050] The code conversion tool is used to convert the pre-trained oil level prediction model. For the XGBoost model, the conversion process will convert each decision tree and each set of weight parameters inside the model into corresponding executable code statements, generate a complete set of target code files, and read the storage capacity occupied by the converted code files to obtain the code data storage volume.
[0051] Step S23: Obtain the fault detection coverage, single-point fault metric, and prediction consistency of the oil level prediction model, and determine the functional safety factor based on the fault detection coverage, single-point fault metric, and prediction consistency.
[0052] In this embodiment, the fault detection coverage rate is the proportion of samples whose predicted oil level matches the actual oil level after a batch of engine multi-dimensional operating parameter samples with abnormal characteristics such as missing, abrupt changes, and out-of-range are input into the oil level prediction model. The higher the fault detection coverage rate, the stronger the model's ability to identify abnormal operating conditions, and the less likely it is to output incorrect oil level judgment results due to abnormal inputs.
[0053] Additionally, the single-point failure metric is used to simulate local component failure by modifying the weight values of a fixed number of decision trees within the oil level prediction model. After inputting the engine multidimensional operating parameters of the test samples into the oil level prediction model simulating local component failure, the single-point failure metric measures the proportion of samples whose predicted oil level matches the actual oil level among all test samples. The higher the single-point failure metric value, the stronger the model's ability to maintain correct output when local components malfunction.
[0054] Additionally, predictive consistency is the proportion of all test samples whose predicted oil level is consistent with the corresponding noise-free input after the engine multidimensional operating parameters with added small numerical noise are input into the oil level prediction model. Predictive consistency measures the model's ability to withstand minor external operating condition disturbances. The higher the predictive consistency value, the less affected the model is by instantaneous minor operating condition fluctuations, and the more stable the output results.
[0055] The pre-trained oil quantity prediction model was simulated and tested for three indicators: fault detection coverage, single-point fault metric, and prediction consistency. The functional safety factor was obtained by weighted summation of the three indicators.
[0056] In this embodiment, the basic classification and recognition capability of the model is measured by accuracy, the actual consumption of vehicle hardware storage space by the model deployment is quantified by code data storage volume, and the comprehensive safety performance of the model in dealing with various non-ideal working conditions is quantified by the functional safety factor that integrates three indicators: fault detection coverage, single point of failure measurement, and prediction consistency. This can provide a reliable quantitative basis for the subsequent construction of optimization objective function.
[0057] Step S30: Optimize the model parameters of the oil level prediction model based on memory usage threshold, accuracy, code data storage volume, and functional safety factor to obtain the target oil level prediction model.
[0058] In this embodiment, model parameter optimization is an optimization operation that iteratively adjusts the hyperparameters within the pre-trained oil quantity prediction model using an optimization algorithm. Particle Swarm Optimization (PSO) can be used as the optimization algorithm for performing model parameter optimization. PSO uses model hyperparameters as iterative adjustment variables and searches for the optimal hyperparameter combination that satisfies multiple constraints by simulating particle motion iteratively. The target oil quantity prediction model is the optimal model obtained after completing the parameter optimization iterations.
[0059] An optimization objective function can be constructed based on memory usage threshold, accuracy, data storage volume, and functional safety factor. The oil level prediction model can then be optimized by applying the optimization objective function to obtain the target oil level prediction model. This allows the oil level prediction model to be optimized towards higher accuracy, smaller code data storage volume, and a larger functional safety factor.
[0060] In some feasible implementations, step S30 may include steps S31 to S32: Step S31: Construct an optimization objective function based on memory usage threshold, accuracy, data storage volume, and functional safety factor.
[0061] In this embodiment, the optimization objective function is a quantitative evaluation standard that integrates three dimensions of constraints: model prediction accuracy, hardware storage resource consumption, and vehicle operation safety. This standard is used to determine the optimization direction of the oil level prediction model. The output value of the optimization objective function reflects the overall adaptation level of a set of model hyperparameters; a lower value indicates that the current model's overall performance in terms of accuracy, resources, and safety is more in line with the requirements of vehicle deployment.
[0062] In some feasible implementations, step S31 may include: Construct a model accuracy loss term based on the accuracy rate; Construct resource usage items based on data storage volume and memory usage thresholds; Construct safety loss terms based on functional safety factors; The objective function is obtained by weighted summation of the model's accuracy loss term, resource consumption term, and security loss term.
[0063] In this embodiment, the model accuracy loss term is a calculated component generated through accuracy conversion. It is used to quantify the overall prediction error level of the oil level prediction model. The higher the accuracy value, the lower the converted model accuracy loss term value, which means that the model has a smaller classification error for oil level grades.
[0064] Additionally, the resource occupancy item is a calculated component generated by combining the code data storage volume with the memory usage threshold. The resource occupancy item is used to quantify the degree of consumption of the target embedded device's storage space when the oil level prediction model is deployed. The higher the proportion of code data storage volume relative to the memory usage threshold, the higher the calculated resource occupancy item value, indicating that the model size places a greater burden on the hardware storage.
[0065] In addition, the safety loss term is a calculated component generated by converting the functional safety factor. The safety loss term is used to quantify the safety capability gap of the oil level prediction model in the vehicle operation scenario. The lower the value of the functional safety factor, the higher the value of the converted safety loss term, which means that the model is weaker in its ability to cope with abnormal input, failure of internal tree structure, and external noise disturbance.
[0066] Assign corresponding weight coefficients to the model accuracy loss term, resource consumption term, and security loss term respectively. Multiply each category of the term with the assigned weight coefficient. Add the results of the three sets of multiplication operations to obtain the optimization objective function.
[0067] For example, the formula for constructing the objective function is as follows:
[0068] In the formula, This represents the comprehensive optimization objective function, used for model parameter optimization. This represents the set of hyperparameters to be optimized in the oil level prediction model. This represents the preset weighting coefficient for the precision item. This represents the preset weighting coefficient for resource occupancy items. This represents the preset weighting coefficient for functional safety items. , , It can be dynamically configured according to different in-vehicle embedded device platforms; This represents the classification accuracy of the model on the test dataset, used to characterize the prediction accuracy of the oil level monitoring model; This represents the storage size of the model after it has been converted into C language code, and is used to characterize the model's usage of hardware storage resources; This indicates the maximum allowed memory usage limit for the target in-vehicle embedded device, and is a preset parameter for the device. The functional safety factor is calculated by weighting fault detection coverage, single point of failure metric, and prediction consistency, and is used to comprehensively evaluate the safety performance of the model operation.
[0069] In this embodiment, the model accuracy loss term, resource consumption term, and safety loss term are fused by weighted summation to generate the optimization objective function. This allows the optimization objective function to simultaneously take into account the constraints of model prediction accuracy, hardware storage limit, and vehicle operation safety, providing a comprehensive quantitative evaluation basis for parameter optimization.
[0070] Step S32: Optimize the model parameters of the oil quantity prediction model according to the optimization objective function to obtain the target oil quantity prediction model.
[0071] In this embodiment, the oil level prediction model is optimized by optimizing the model parameters according to the objective function to obtain the target oil level prediction model. This can optimize the oil level prediction model towards higher accuracy, smaller code data storage, and a larger functional safety factor.
[0072] In this embodiment, by integrating accuracy, code data storage volume, memory usage threshold, and functional safety factor to construct an optimization objective function, the parameters of the oil level prediction model are optimized. This allows for the search of hyperparameter combinations that balance multi-dimensional constraints across the entire domain, enabling the generated target oil level prediction model to be adapted to vehicle-mounted hardware with limited resources, while maintaining prediction accuracy and safe operation capabilities that meet usage requirements.
[0073] In some feasible implementations, step S32 may include: Initialize the particle swarm by setting the hyperparameter combination of the oil level prediction model to the particle position information of the particle swarm. The function value corresponding to the objective function is calculated based on the particle position information, and the function value is used as the fitness. Update particle position information based on fitness; Return the function value corresponding to the optimization objective function based on the particle position information, and use the function value as the fitness step until the preset number of iterations is reached to obtain the global target position information; The hyperparameter combination corresponding to the global target location information is determined as the target hyperparameter combination; Based on the target hyperparameter combination, configure the oil quantity prediction model to obtain the target oil quantity prediction model.
[0074] In this embodiment, the particle swarm optimization algorithm is an optimization algorithm that simulates the motion laws of a swarm of particles to achieve a multivariable global search. The particle swarm is a collection of all independent computational units in the particle swarm optimization algorithm. Each particle swarm contains a fixed number of particle units. During particle swarm initialization, basic control parameters related to particle motion are uniformly configured. These basic control parameters include inertia weight, individual learning factor, social learning factor, and the range of random coefficient values. The individual extreme value is the optimal fit position information recorded during the iteration of a single particle, while the global extreme value is the optimal fit position information uniformly recorded during the iteration of all particles. These two types of extreme values can constrain the search direction of particle iteration and narrow the search range for the optimal hyperparameter combination.
[0075] In addition, a particle is a computational unit in the particle swarm optimization algorithm that carries a set of hyperparameter combinations. A particle contains two core types of data: velocity information and position information. The position information corresponds to a complete set of model hyperparameter values, while the velocity information is used to control the magnitude of the particle position change in each iteration.
[0076] Additionally, hyperparameters are globally controllable parameters that can be manually adjusted within the oil level prediction model. The hyperparameters of the XGBoost model include learning rate, tree depth, subsampling rate, etc. Adjusting the values of different hyperparameters will simultaneously change the model's inference accuracy, code file size, and anti-interference performance. The hyperparameter combination is the set of values for all adjustable hyperparameters in the oil level prediction model.
[0077] Furthermore, particle position information is a complete hyperparameter combination bound to a single particle. Each particle position information uniquely corresponds to a set of hyperparameter configurations for the oil quantity prediction model, and the particle position information continuously changes its value with iterative calculations. Fitness is a quantitative indicator used to measure the quality of the hyperparameter combination corresponding to a single particle. In addition to particle position information, particles also store particle velocity information, which is used to constrain the adjustment range of particle position information during a single iteration.
[0078] Additionally, the preset number of iterations is a pre-defined numerical standard for terminating the particle swarm optimization loop, which can be flexibly adjusted based on the computing power of the vehicle-mounted embedded hardware and the model optimization accuracy requirements. The global target position information represents the particle position information corresponding to the global extremum after reaching the preset number of iterations, carrying the optimal hyperparameter combination with the best overall fit within the global search range. The target hyperparameter combination is the set of optimal hyperparameter values obtained after multiple rounds of global iteration filtering.
[0079] First, the basic operating parameters of the particle swarm are assigned to initialize the particle swarm. Then, a set of hyperparameters for the oil quantity prediction model is randomly generated for each particle in the swarm. The generated hyperparameters are stored as the particle position information of the corresponding particle. The complete hyperparameters carried in the particle position information are substituted into the oil quantity prediction model to complete the simulation calculation. The accuracy, code data storage volume, and functional safety factor of the model under the current configuration are calculated simultaneously. The three types of indicators are input into the optimization objective function to complete the calculation and obtain the corresponding function value. The function value is recorded as the fitness of the current particle.
[0080] Iterate through the fitness values of all particles in the particle swarm, compare the fitness of each particle in the current round with the fitness corresponding to its own historical individual extreme value, update the individual extreme value corresponding to each particle, compare the fitness corresponding to the individual extreme values of all particles, update the global extreme value uniformly recorded by the particle swarm, combine the original velocity information of the particles, the individual extreme value, and the global extreme value to complete the recalculation of the particle velocity information, and then adjust the original particle position information based on the updated particle velocity information.
[0081] After completing one round of particle position information update operation, jump to the fitness calculation operation to resolve the fitness values corresponding to the current positions of all particles. The fitness calculation, particle extreme value update, and particle position information update process are continuously executed in a loop. After each loop, the current iteration number is counted. When the iteration number is equal to the preset iteration number, the loop operation is terminated. The particle position information corresponding to the global extreme value at this time is extracted and recorded as the global target position information.
[0082] Read all hyperparameter values stored within the global target location information, extract the corresponding values of all adjustable model parameters such as learning rate, tree depth, and subsampling rate, and obtain the target hyperparameter combination. Replace the original hyperparameters of the pre-trained oil quantity prediction model with the corresponding values from the target hyperparameter combination to obtain the target oil quantity prediction model.
[0083] For example, the formula for updating particle velocity is as follows:
[0084] In the formula, Represents the first particle in the swarm. One particle; Indicates the current iteration number; Indicates the first The particle in the first The velocity of motion during the next iteration; This represents the inertia weight value, which is a preset parameter; Indicates the first The particle in the first The velocity of motion during the next iteration; This represents the individual learning factor, a pre-set parameter used to control the step size of a particle's learning towards its historical best position. , This represents a random number between 0 and 1, used to increase the randomness of the algorithm's search process; Let be the individual extreme value, representing the th The particle in the first The optimal position of the individual searched before the next iteration corresponds to a set of hyperparameter combinations of the oil quantity prediction model; Indicates the first The particle in the first The current position at the next iteration corresponds to a set of hyperparameter combinations for an oil quantity prediction model; This represents the social learning factor, a pre-set parameter used to control the step size of a particle's learning towards the global optimal position; The global extremum represents the value of all particles at the t-th... The globally optimal position found in the previous iteration corresponds to the current optimal combination of hyperparameters for the oil quantity prediction model.
[0085] For example, the formula for updating particle positions in the particle swarm optimization algorithm is as follows:
[0086] In the formula, the subscript Indicates the first One particle; superscript The particle swarm optimization algorithm is represented by the first... Next iteration; superscript The particle swarm optimization algorithm is represented by the first... The next iteration; Indicates the first The particle in the first The new position after the next iteration corresponds to the updated hyperparameters of the XGBoost model; Indicates the first The particle in the first The position at the next iteration; Indicates the first The particle in the first The velocity of motion during the next iteration.
[0087] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the model parameter optimization process for an embodiment of the engine oil level monitoring method of this application. Figure 2As shown, the initialization parameter operation is performed first to configure the basic running parameters of the algorithm. Then, the initialization particle operation is performed to assign initial position and velocity information to the particles in each particle subgroup. After the particle initialization is completed, the fitness value of all particles is calculated. After the initial fitness calculation is completed, the iteration loop is entered. In the loop, the particle velocity and position are updated first. After the particle state is updated, the particle fitness is recalculated. After the fitness calculation is completed, the globally optimal particle is found. After each iteration, it is determined whether the number of iterations has been reached. If the result is no, the step of updating particle velocity and position is returned to start the next round of iteration. If the result is yes, the iteration process is terminated, and the model parameter optimization is completed.
[0088] In this embodiment, the target oil quantity prediction model obtained by optimizing model parameters can control the storage volume of the converted code to not exceed the hardware memory limit while ensuring the accuracy of oil quantity classification and identification. At the same time, it maintains the functional safety performance that meets the complex working conditions of hybrid vehicles, reduces the possibility of memory overruns and insufficient anti-interference capabilities after the model is deployed to the embedded hardware carrier, and realizes the lightweight adaptation and optimization of machine learning models for vehicle hardware.
[0089] Step S40: Monitor engine oil level using the target oil level prediction model.
[0090] In this embodiment, after converting the target oil level prediction model into target code, the converted target oil level prediction model is deployed to the target embedded device. During vehicle operation, parameters such as the engine EGR valve pressure ratio, fuel consumption, actual engine torque, oil pressure, actual injector pulse width, throttle opening, and actual ignition angle are continuously collected to obtain multi-dimensional engine operating parameters. These multi-dimensional engine operating parameters are then input into the target oil level prediction model to obtain the predicted oil level grade. This predicted oil level grade can be used as the current oil level grade, or multiple consecutive predicted oil level grades can be corrected through post-prediction processing to obtain a stable and reliable current oil level grade.
[0091] After obtaining the current oil level, the system transmits the current oil level to the vehicle's instrument panel or smart cockpit via the Controller Area Network (CAN) bus for visual display. If the current oil level is lower than a preset threshold, such as being too low or severely insufficient, a warning signal is simultaneously triggered on the instrument panel and a text prompt is displayed in the cockpit. At the same time, the engine health data, including the oil level, is remotely transmitted back to the backend via Over-the-Air (OTA) technology for vehicle powertrain data management and fault warning, providing real-time reminders to the user for maintenance and completing the engine oil level monitoring.
[0092] This embodiment provides an engine oil level monitoring method. By obtaining the memory usage threshold corresponding to the pre-trained oil level prediction model and the target embedded device, the hardware resource constraints of model optimization can be clearly defined. The accuracy, code data storage volume, and functional safety factor of the pre-trained model can be determined simultaneously. Based on these parameters, the model parameters are optimized to generate the target oil level prediction model. This method can simultaneously take into account the model recognition accuracy, vehicle hardware storage limitations, and vehicle operation safety requirements, reducing the occurrence of storage overruns or insufficient anti-interference capabilities after model deployment, and improving the accuracy of oil level prediction in embedded devices.
[0093] In a feasible embodiment of this application, content that is the same as or similar to the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S40 may include steps S41 to S44: Step S41: Determine the target sliding window and target attenuation coefficient based on the current operating condition information.
[0094] In this embodiment, the current operating condition information records the engine's operation status during real-time vehicle driving, such as engine start-stop status and engine speed. The target sliding window is the current window length value used to temporarily cache multiple consecutive rounds of predicted oil level. The target decay coefficient is the current weight decay magnitude used to control the prediction results of different time series.
[0095] During vehicle operation, the engine start-stop frequency and speed data are continuously recorded to obtain current operating condition information. Based on the current operating condition information, the corresponding operating condition feature vector is extracted. The current operating condition type is determined according to the operating condition feature vector. If it is determined to be a high-disturbance operating condition, the length of the target sliding window is increased while the target attenuation coefficient is decreased. If it is determined to be a stable operating condition, the length of the target sliding window is decreased while the target attenuation coefficient is increased.
[0096] In some feasible implementations, step S41 may include steps S411 to S414: Step S411: Obtain the preset sliding window and preset attenuation coefficient.
[0097] In this embodiment, the preset sliding window is a pre-set basic window length value used to temporarily cache multiple consecutive rounds of predicted oil level. The preset decay coefficient is a pre-set basic coefficient value used to allocate the temporal weights of the prediction results, which controls the weight decay rate of different temporal prediction results. The larger the decay coefficient value, the slower the weight decay rate of historical prediction results.
[0098] Read the default parameter configuration file stored in the local storage area of the vehicle embedded device, extract the preset sliding window value and preset attenuation coefficient value stored in the configuration file, and obtain the preset sliding window and preset attenuation coefficient.
[0099] Step S412: Determine the number of engine start-stop cycles and the standard deviation of engine speed based on the current operating condition information.
[0100] In this embodiment, the number of engine start-stop operations is the total number of times the engine completes the start-up and shutdown operations within a fixed unit of running time. Hybrid vehicles will frequently start and stop the engine when driving at low speeds. The higher the number of engine start-stop operations, the more likely the oil distribution inside the oil pan will be uneven, indicating a greater probability of fluctuation in the single model prediction.
[0101] In addition, the standard deviation of engine speed is a quantitative indicator of the dispersion of all engine speed sampling values within a continuous collection period. The higher the standard deviation of engine speed, the more frequently the engine speed switches between high and low, and the worse the stability of the engine's operating state.
[0102] Extract complete engine start-stop trigger records within a fixed time interval from the current operating condition information, count the total number of start-stop switching in the records to obtain the engine start-stop count, and simultaneously extract all engine speed sampling data within the same time interval. Process the speed sampling data through dispersion calculation to obtain the engine speed standard deviation.
[0103] Step S413: Calculate the operating condition disturbance intensity based on the number of engine start-stop cycles and the standard deviation of engine speed.
[0104] In this embodiment, the operating condition disturbance intensity is a comprehensive quantitative value generated by integrating two indicators: the number of engine start-stop cycles and the standard deviation of engine speed. This value can uniformly quantify the overall interference caused by the current driving condition on oil distribution and model input characteristics. The higher the operating condition disturbance intensity value, the stronger the disturbance of the current operating condition.
[0105] A two-dimensional feature vector is constructed based on the number of engine start-stop cycles and the standard deviation of engine speed to obtain the engine operating condition feature vector.
[0106] For example, the formula for expressing the feature vector of engine operating conditions is as follows:
[0107] In the formula, This represents the characteristic vector of engine operating conditions, used to identify the disturbance intensity of the current driving condition; This indicates the number of times the engine starts and stops per unit of time; This represents the standard deviation of engine speed.
[0108] The magnitude of the characteristic vector of engine operating conditions is calculated by Euclidean norm operation, and the intensity of the quantified operating condition disturbance is obtained.
[0109] For example, the formula for expressing the magnitude of the feature vector of engine operating conditions is as follows:
[0110] In the formula, Represents the characteristic vector of the working condition The modulus is used to quantify the disturbance intensity of the current operating condition; This represents the characteristic vector of engine operating conditions; This indicates the number of times the engine starts and stops per unit of time; This represents the standard deviation of engine speed.
[0111] Step S414: When the operating condition disturbance intensity is not within the preset disturbance range, adjust the preset sliding window and preset attenuation coefficient based on the operating condition disturbance intensity to obtain the target sliding window and target attenuation coefficient.
[0112] In this embodiment, the preset disturbance range is a pre-set numerical range standard used to divide stable operating conditions and high disturbance operating conditions. When the disturbance intensity of the operating condition is greater than the upper limit of the preset disturbance range, it is determined to be a high disturbance operating condition, and when the disturbance intensity of the operating condition is less than the lower limit of the preset disturbance range, it is determined to be a stable operating condition.
[0113] In addition, adjusting the preset sliding window means increasing the window length according to the magnitude of the operating condition disturbance intensity. The higher the value of the operating condition disturbance intensity, the greater the increase in the length of the sliding window after adjustment, which can cache more rounds of historical prediction results and weaken the deviation caused by instantaneous interference.
[0114] In addition, adjusting the preset attenuation coefficient means reducing the attenuation coefficient value according to the magnitude of the operating condition disturbance intensity. The higher the operating condition disturbance intensity value, the greater the reduction in the attenuation coefficient, thereby reducing the weight ratio of early historical prediction results in the weighted calculation.
[0115] The operating condition disturbance intensity value is compared with the upper and lower limits of the preset disturbance interval. If the operating condition disturbance intensity falls within the range of the preset disturbance interval, the preset sliding window is used as the target sliding window, and the preset attenuation coefficient is used as the target attenuation coefficient. If the operating condition disturbance intensity is greater than the upper limit of the preset disturbance interval, the preset attenuation coefficient is increased to obtain the target attenuation coefficient, and the preset attenuation coefficient is decreased to obtain the target attenuation coefficient. If the operating condition disturbance intensity is less than the lower limit of the preset disturbance interval, the length of the preset sliding window is decreased to obtain the target sliding window, and the preset attenuation coefficient is increased to obtain the target attenuation coefficient.
[0116] In this embodiment, by dynamically matching the target sliding window and target attenuation coefficient of the current operating condition information to adapt to the scenario, the post-processing logic can be adjusted for the high-disturbance operating conditions caused by the frequent start-stop of hybrid vehicles, thereby enhancing the stability of result determination under complex operating conditions.
[0117] Step S42: Input the multi-dimensional operating parameters of the engine into the target oil quantity prediction model to obtain the predicted oil quantity level.
[0118] In this embodiment, the multi-dimensional operating parameters of the engine are multi-dimensional detection indicators corresponding to the real-time working state of the engine, including parameters such as the pressure ratio before and after the EGR valve, fuel consumption, actual engine torque, oil pressure, actual fuel injection pulse width of the injector, throttle opening, and actual ignition angle.
[0119] Additionally, the predicted oil level is the oil inventory classification label output by the target oil level prediction model in a single step.
[0120] During vehicle operation, all multi-dimensional engine operating parameters generated in real time are continuously collected. These parameters are then input into the target oil quantity prediction model to obtain the corresponding predicted oil quantity level. This predicted oil quantity level is then transmitted to the sliding window cache module for subsequent weighted processing.
[0121] Step S43: Obtain multiple predicted oil level grades and corresponding time sequence numbers based on the target sliding window. The time sequence number is used to mark the time sequence of the historical predicted oil level grades within the target sliding window.
[0122] In this embodiment, the target sliding window is a data cache area with dynamically adjustable length. The target sliding window will continuously store the predicted oil level generated by each round of model inference. When the total amount of cached data reaches the set length of the window, the earliest predicted data in the time series will be removed to maintain a stable amount of data in the window.
[0123] In addition, the time sequence number is a sequential identifier that is synchronously assigned with each round of prediction generation. The time sequence number increases sequentially according to the order of prediction generation. The smaller the time sequence number value, the earlier the corresponding predicted oil level is generated. The larger the time sequence number value, the closer the corresponding predicted oil level is to the current time. Each predicted oil level stored in the window will be bound to the corresponding time sequence number.
[0124] The latest predicted oil level and its corresponding time series number are stored in the target sliding window. At the same time, early prediction data that exceeds the storage capacity is cleaned up according to the window length rules. All data currently stored in the target sliding window are read, and all consecutive predicted oil level and the time series number bound to each data are extracted.
[0125] Step S44: Determine the current oil level from multiple predicted oil level levels based on the time sequence number and target decay coefficient to complete engine oil level monitoring.
[0126] In this embodiment, a differentiated calculation weight can be assigned to each predicted oil level by using the target attenuation coefficient and the time series number to obtain the target attenuation coefficient. The prediction result with a larger time series number value will be assigned a higher calculation weight, reflecting the higher reference value of the recent prediction result.
[0127] In addition, the current oil level grade is the oil level classification label with the highest score after comparing the weighted scores of all categories. The current oil level grade integrates the results of multiple rounds of time series prediction within the window, which can weaken the impact of single misjudgment caused by instantaneous interference.
[0128] In some feasible implementations, the final oil level category result can be determined using a sliding window mode prediction method. For example, the output calculation formula for sliding window mode prediction is as follows:
[0129] In the formula, This indicates the final oil level category result output by the single-wheel after-treatment mechanism; This represents the mode operation function, used to extract the most frequent prediction within the sliding window and filter out transient abnormal predictions; subscript Indicates the current sampling time; Indicates the current time The model's oil level prediction results; This indicates the model's predicted oil level at the previous moment; Indicates the first [number]th ... Model oil level prediction results for a historical moment; This indicates the length of the sliding window, used to limit the number of historical prediction results involved in the calculation.
[0130] In some feasible implementations, step S44 may include steps S441 to S443: Step S441: Calculate the prediction weights of multiple predicted oil level grades based on the time series number and the target attenuation coefficient.
[0131] In this embodiment, the prediction weight is the weight value assigned to a single predicted oil level. The prediction weight is used to characterize the reference priority of the prediction result in the comprehensive judgment process. The predicted oil level that is generated closer to the current time will have a higher prediction weight.
[0132] Iterate through all the multiple predicted oil level grades stored in the target sliding window, retrieve the time sequence number bound to each predicted oil level grade, retrieve the target attenuation coefficient that has been adjusted for the operating conditions, and calculate the prediction weight corresponding to each predicted oil level grade by combining the time sequence number with the attenuation rate controlled by the target attenuation coefficient.
[0133] For example, the formula for calculating the prediction weight of a single prediction result is as follows: ,
[0134] In the formula, Indicates the first [number]th ... The time decay weight corresponding to each prediction result is used to reflect the difference in the influence of the prediction results at different times; Indicates the sequence number of the prediction result within the sliding window; This represents the decay coefficient, a dynamically adjustable parameter used to control the rate at which the weight decreases over time. Indicates the length of the target sliding window.
[0135] Step S442: Calculate the weighted score of each oil level category in the target sliding window based on the prediction weight.
[0136] In this embodiment, the oil level category is a pre-defined three-category oil level determination label, which includes normal, low, and severely insufficient oil levels. All predicted oil levels within the window will be classified into any one of these categories.
[0137] Additionally, the weighted score is the total score obtained by summing the prediction weights of all matches under a single oil level category. The higher the weighted score, the higher the overall confidence level of that oil level category over a continuous operating period.
[0138] Establish independent scoring containers corresponding to the three oil level categories. Iterate through all predicted oil level categories with bound prediction weights in the window, identify the oil level category to which each predicted oil level belongs, and accumulate the prediction weight corresponding to the predicted oil level category into the scoring container of the corresponding category. After the iteration is completed, read the accumulated value in each scoring container. This value is the weighted score of the corresponding oil level category.
[0139] For example, the weighted total score calculation formula for each oil level category is as follows:
[0140] In the formula, Indicates the type of engine oil level The corresponding weighted total score is used to assess the overall confidence level of this category; This indicates the category of engine oil level, which can include levels such as normal, low, and severely insufficient. Indicates the first [number]th ... The sequence number of each prediction result; Indicates the first The time decay weight corresponding to the prediction result; Indicates the first The model's oil level prediction results; Indicates the indicator function, when the first The prediction result equals the category. The value is 1 if the condition is met, and 0 otherwise. t is the time index of the oldest prediction within the window, indicating that the summation starts from the earliest prediction within the window, where t is the current time, i.e., the time index of the latest prediction; and n is the sliding window length, i.e., the total number of predictions contained within the window.
[0141] Step S443: Determine the current oil level from multiple predicted oil level levels based on weighted scores to complete engine oil level monitoring.
[0142] By comparing the weighted scores of the three oil level categories, the oil level category with the highest weighted score is selected and labeled as the current oil level category to complete the engine oil level monitoring.
[0143] For example, the formula for calculating the final oil level category output by the weighted voting mechanism is as follows:
[0144] In the formula, This indicates the final oil level monitoring category output by the weighted voting mechanism; This represents the operation function that takes the maximum value of the independent variable, and is used to filter the oil quantity category with the highest weighted score; Indicates the type of engine oil level The corresponding total weighted score.
[0145] In this embodiment, the generation time of the prediction results is distinguished by the time sequence number, and the prediction weight of each predicted oil level is calculated by combining the target attenuation coefficient adapted to the real-time operating conditions. This can amplify the reference role of recent model inference results, fit the operating characteristics of the dynamic changes in oil distribution of hybrid vehicles, and accumulate the corresponding prediction weights according to the oil level category to obtain a weighted score. By comparing the weighted scores to filter the current oil level, the false alarm caused by instantaneous operating condition disturbances can be reduced.
[0146] This embodiment provides an engine oil level monitoring method. The method uses a target oil level prediction model to analyze multi-dimensional engine operating parameters in real time to obtain a single predicted oil level. The method uses a target sliding window to cache multiple rounds of time-series prediction results and binds them with time-series labels. The method combines the time-series labels with the target attenuation coefficient to perform weighted statistical filtering of the current oil level. This can reduce the single prediction deviation caused by instantaneous operating condition disturbances and reduce the frequency of false alarms for abnormal oil levels.
[0147] For example, to help understand the implementation process of the engine oil level monitoring method obtained in this embodiment combined with the above embodiment one, please refer to... Figure 4 , Figure 4 A simplified flowchart of an engine oil level monitoring method is provided, as exemplarily: First, data collection and cleaning are performed to collect multi-dimensional engine operating parameters and clean up outliers and missing values. After data processing, the model building and training phase begins. A machine learning model is trained based on the cleaned labeled dataset to obtain a pre-trained oil level prediction model. Once training is complete, a unified optimization evaluation standard is constructed by integrating prediction accuracy, hardware resource consumption, and functional safety dimensions, defining a comprehensive objective function, i.e., the optimization objective function. Based on the optimization objective function, parameter optimization is performed to obtain the optimized model. Post-processing of the prediction results improves the stability of the model's prediction results. After post-processing, the optimized model is deployed to an embedded device for oil level prediction, timely collection and recording of oil level data, and early warning.
[0148] The above examples are only for understanding this application and do not constitute a limitation on the engine oil level monitoring method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0149] This application also provides an engine oil level monitoring device; please refer to... Figure 5 The engine oil level monitoring device includes: The data acquisition module 10 is used to acquire the pre-trained oil level prediction model and the memory usage threshold of the target embedded device. The data acquisition module 10 is also used to determine the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor. Model optimization module 20 is used to optimize the model parameters of the oil quantity prediction model based on memory usage threshold, accuracy, code data storage volume and functional safety factor, so as to obtain the target oil quantity prediction model. The oil level monitoring module 30 is used to monitor the engine oil level using a target oil level prediction model.
[0150] In some feasible implementations, the model optimization module 20 is also used to construct an optimization objective function based on memory usage threshold, accuracy, data storage volume, and functional safety factor; The oil quantity prediction model is optimized by optimizing the model parameters based on the objective function, and the target oil quantity prediction model is obtained.
[0151] In some feasible implementations, the model optimization module 20 is also used to construct a model accuracy loss term based on the accuracy. Construct resource usage items based on data storage volume and memory usage thresholds; Construct safety loss terms based on functional safety factors; The objective function is obtained by weighted summation of the model's accuracy loss term, resource consumption term, and security loss term.
[0152] In some feasible implementations, the model optimization module 20 is also used to initialize the particle swarm and set the hyperparameter combination of the oil quantity prediction model as the particle position information of the particle swarm. The function value corresponding to the objective function is calculated based on the particle position information, and the function value is used as the fitness. Update particle position information based on fitness; Return the function value corresponding to the optimization objective function based on the particle position information, and use the function value as the fitness step until the preset number of iterations is reached to obtain the global target position information; The hyperparameter combination corresponding to the global target location information is determined as the target hyperparameter combination; Based on the target hyperparameter combination, configure the oil quantity prediction model to obtain the target oil quantity prediction model.
[0153] In some feasible implementations, the oil quantity monitoring module 30 is also used to determine the target sliding window and the target attenuation coefficient based on the current operating condition information; Input the multi-dimensional operating parameters of the engine into the target oil quantity prediction model to obtain the predicted oil quantity level; The target sliding window is used to obtain multiple predicted oil level grades and their corresponding time series numbers. The time series numbers are used to mark the time series of the historical predicted oil level grades within the target sliding window. The current oil level is determined from multiple predicted oil level levels based on the time series number and the target decay coefficient to complete engine oil level monitoring.
[0154] In some feasible implementations, the oil quantity monitoring module 30 is also used to obtain a preset sliding window and a preset attenuation coefficient; Determine the number of engine start-stop cycles and the standard deviation of engine speed based on current operating condition information; The intensity of the operating condition disturbance is calculated based on the number of engine start-stop cycles and the standard deviation of engine speed. When the operating condition disturbance intensity is not within the preset disturbance range, the preset sliding window and preset attenuation coefficient are adjusted based on the operating condition disturbance intensity to obtain the target sliding window and target attenuation coefficient.
[0155] In some feasible implementations, the oil level monitoring module 30 is also used to calculate the prediction weights of multiple predicted oil level grades based on the time series number and the target decay coefficient. The weighted score for each oil level category in the target sliding window is calculated based on the predicted weights. The current oil level is determined from multiple predicted oil level levels based on a weighted score to complete engine oil level monitoring.
[0156] In some feasible implementations, the data acquisition module 10 is also used to acquire the accuracy of the oil level prediction model on the test set; The oil level prediction model is converted into target code, the data storage size of the target code is obtained, and the code data storage size is obtained. Obtain the fault detection coverage, single-point fault metric, and prediction consistency of the oil level prediction model, and determine the functional safety factor based on the fault detection coverage, single-point fault metric, and prediction consistency.
[0157] The engine oil level monitoring device provided in this application, employing the engine oil level monitoring method described in the above embodiments, can solve the technical problem of how to improve the accuracy of oil level prediction in embedded devices. Compared with related technologies, the beneficial effects of the engine oil level monitoring device provided in this application are the same as those of the engine oil level monitoring method provided in the above embodiments, and other technical features in the engine oil level monitoring device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0158] This application provides an engine oil level monitoring device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the engine oil level monitoring method in the first embodiment described above.
[0159] The following is for reference. Figure 6 The diagram illustrates a structural schematic suitable for implementing an engine oil level monitoring device according to embodiments of this application. The engine oil level monitoring device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The engine oil level monitoring device shown is an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.
[0160] like Figure 6As shown, the engine oil level monitoring device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the engine oil level monitoring device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the engine oil level monitoring device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows engine oil level monitoring devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0161] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0162] The engine oil level monitoring device provided in this application, employing the engine oil level monitoring method described in the above embodiments, can solve the technical problem of how to improve the accuracy of oil level prediction in embedded devices. Compared with related technologies, the beneficial effects of the engine oil level monitoring device provided in this application are the same as those of the engine oil level monitoring method provided in the above embodiments, and other technical features of this engine oil level monitoring device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0163] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0164] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0165] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the engine oil level monitoring method in the above embodiments.
[0166] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory), or flash memory, optical fiber, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0167] The aforementioned computer-readable storage medium may be included in the engine oil level monitoring device; or it may exist independently and not be installed in the engine oil level monitoring device.
[0168] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by the engine oil level monitoring device, the engine oil level monitoring device: acquires a pre-trained oil level prediction model and the memory usage threshold of the target embedded device; determines the accuracy, code data storage size, and functional safety factor of the oil level prediction model; optimizes the model parameters of the oil level prediction model based on the memory usage threshold, accuracy, code data storage size, and functional safety factor to obtain a target oil level prediction model; and monitors the engine oil level using the target oil level prediction model.
[0169] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0170] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0171] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0172] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described engine oil level monitoring method, thereby solving the technical problem of how to improve the accuracy of oil level prediction in embedded devices. Compared with related technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the engine oil level monitoring method provided in the above embodiments, and will not be repeated here.
[0173] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the engine oil level monitoring method described above.
[0174] The computer program product provided in this application solves the technical problem of how to improve the accuracy of oil level prediction in embedded devices. Compared with related technologies, the beneficial effects of the computer program product provided in this application are the same as those of the engine oil level monitoring method provided in the above embodiments, and will not be repeated here.
[0175] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for monitoring engine oil level, characterized in that, The engine oil level monitoring method includes: Obtain the pre-trained oil level prediction model and the memory usage threshold of the target embedded device; Determine the accuracy, code data storage size, and functional safety factor of the oil level prediction model; Based on the memory usage threshold, the accuracy, the code data storage volume, and the functional safety factor, the model parameters of the oil level prediction model are optimized to obtain the target oil level prediction model. Engine oil level is monitored using the target oil level prediction model.
2. The method as described in claim 1, characterized in that, The step of optimizing the model parameters of the oil level prediction model based on the memory usage threshold, the accuracy, the code data storage volume, and the functional safety factor to obtain the target oil level prediction model includes: An optimization objective function is constructed based on the memory usage threshold, the accuracy, the data storage volume, and the functional safety factor; The oil quantity prediction model is optimized by performing model parameter optimization based on the objective function to obtain the target oil quantity prediction model.
3. The method as described in claim 2, characterized in that, The step of constructing the optimization objective function based on the memory usage threshold, the accuracy, the data storage volume, and the functional safety factor includes: Construct a model accuracy loss term based on the accuracy rate; Construct a resource usage item based on the data storage volume and the memory usage threshold; Construct a safety loss term based on the aforementioned functional safety factors; The model accuracy loss term, the resource consumption term, and the security loss term are weighted and summed to obtain the optimization objective function.
4. The method as described in claim 2, characterized in that, The step of optimizing the model parameters of the oil quantity prediction model according to the optimization objective function to obtain the target oil quantity prediction model includes: Initialize the particle swarm by setting the hyperparameter combination of the oil level prediction model to the particle position information of the particle swarm. The function value corresponding to the optimization objective function is calculated based on the particle position information, and the function value is used as the fitness. The particle position information is updated based on the fitness. Returning to the step of calculating the function value corresponding to the optimization objective function based on the particle position information, and using the function value as the fitness, until a preset number of iterations is reached to obtain the global target position information; The hyperparameter combination corresponding to the global target location information is determined as the target hyperparameter combination; The target oil quantity prediction model is obtained by configuring the oil quantity prediction model according to the target hyperparameter combination.
5. The method as described in claim 1, characterized in that, The step of monitoring engine oil level using the target oil level prediction model includes: Determine the target sliding window and target attenuation coefficient based on the current operating condition information; The engine's multi-dimensional operating parameters are input into the target oil quantity prediction model to obtain the predicted oil quantity level; According to the target sliding window, obtain multiple predicted oil level grades and corresponding time series numbers for continuous prediction, wherein the time series numbers are used to mark the time series of the historical predicted oil level grades within the target sliding window; The current oil level is determined from the plurality of predicted oil level levels based on the time sequence number and the target attenuation coefficient to complete engine oil level monitoring.
6. The method as described in claim 5, characterized in that, The steps of determining the target sliding window and target attenuation coefficient based on the current operating condition information include: Obtain the preset sliding window and preset attenuation coefficient; Determine the number of engine start-stop cycles and the standard deviation of engine speed based on current operating condition information; The operating condition disturbance intensity is calculated based on the number of engine start-stop cycles and the standard deviation of engine speed. When the operating condition disturbance intensity is not within the preset disturbance range, the preset sliding window and the preset attenuation coefficient are adjusted based on the operating condition disturbance intensity to obtain the target sliding window and the target attenuation coefficient.
7. The method as described in claim 5, characterized in that, The step of determining the current oil level from the plurality of predicted oil level levels based on the time sequence number and the target decay coefficient to complete engine oil level monitoring includes: The prediction weights of the multiple predicted oil level grades are calculated based on the time series number and the target attenuation coefficient. The weighted score of each oil level category in the target sliding window is calculated based on the predicted weights. The current oil level is determined from the plurality of predicted oil level levels based on the weighted score to complete engine oil level monitoring.
8. The method according to any one of claims 1 to 7, characterized in that, The steps for determining the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor include: Obtain the accuracy of the oil level prediction model on the test set; The oil level prediction model is converted into target code, and the data storage size of the target code is obtained to obtain the code data storage size. Obtain the fault detection coverage, single-point fault metric, and prediction consistency of the oil level prediction model, and determine the functional safety factor based on the fault detection coverage, the single-point fault metric, and the prediction consistency.
9. An engine oil level monitoring device, characterized in that, The device includes: The data acquisition module is used to acquire the pre-trained oil level prediction model and the memory usage threshold of the target embedded device; The data acquisition module is also used to determine the accuracy of the oil level prediction model, the amount of code data stored, and the functional safety factor. The model optimization module is used to optimize the model parameters of the oil level prediction model based on the memory usage threshold, the accuracy, the code data storage volume and the functional safety factor, so as to obtain the target oil level prediction model. The oil level monitoring module is used to monitor the engine oil level using the target oil level prediction model.
10. An engine oil level monitoring device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the engine oil level monitoring method as described in any one of claims 1 to 8.