Processor operation state determination method, device, electronic device and storage medium
By generating monitoring applications to monitor the kernel information and task execution information of the processor in the vehicle, the problem of processor exceptions cannot be located is solved, the timely discovery and positioning of exceptions is achieved, and the software development efficiency and the stability of the vehicle system are improved.
Patent Information
- Application Number
- CN202410367067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-03-28
AI Technical Summary
When the processor performs business functions and logic abnormalities in the vehicle, it cannot locate the abnormalities, affecting the efficiency of software development.
By determining the instance tasks corresponding to the processor in the vehicle, generating a configuration file, generating a monitoring application based on the configuration file, monitoring the processor's kernel information and task execution information, and receiving and analyzing this information to determine the operating status of the processor.
It realizes monitoring of kernel information and execution information when the processor in the vehicle controller performs instance tasks, and can promptly detect and locate abnormalities, improving software development efficiency and the stability and reliability of the vehicle system.
Smart Images

Figure CN118409924B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle abnormality processing, and in particular to a method, device, electronic device and storage medium for determining the operating state of a processor. Background Art
[0002] With the rapid development of new energy vehicles, the software of vehicle controllers has gradually developed from simple logic control to complex system software. In order to improve the quality of software while ensuring the safety of software in vehicles, the relevant technology adopts a model-based software development method to achieve the above effect. In terms of the vehicle operating system, the ClassicAutoSAR Planform (CP) standard is adopted. Since CP is developed in a configuration-based manner, and the model software is also based on highly abstract logic for business deployment, the vehicle controller processor (MCU) often lacks a monitoring method to observe the health status of MCU operation, and cannot confirm the actual operation of the task (TASK) running on the MCU, etc., which leads to the processor being unable to locate the abnormality when executing business functions and logic abnormalities, affecting the efficiency of software development. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for determining the operating status of a processor to solve the problem in the prior art that when an abnormality occurs in the execution of business functions and logic by the processor in the vehicle, the abnormality cannot be located, thereby affecting the efficiency of software development.
[0004] In a first aspect of an embodiment of the present application, a method for determining the operating status of a processor is provided, the method comprising: determining an instance task corresponding to a processor in a vehicle, and generating a corresponding configuration file based on the instance task; generating a monitoring application corresponding to the processor and the instance task based on the configuration file, the monitoring application being used to monitor kernel information of the processor and task execution information corresponding to the instance task; receiving kernel information and task execution information returned by the monitoring application, and determining the operating status of the processor based on the kernel information and the task execution information.
[0005] According to a second aspect of an embodiment of the present application, a device for determining the operating status of a processor is provided, the device comprising: a configuration module for determining an instance task corresponding to a processor in a vehicle, and generating a corresponding configuration file based on the instance task; a monitoring module for generating a monitoring application corresponding to the processor and the instance task based on the configuration file, the monitoring application being used to monitor kernel information of the processor and task execution information corresponding to the instance task; and a status module for receiving kernel information and task execution information returned by the monitoring application, and determining the operating status of the processor based on the kernel information and the task execution information.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the method in the embodiments of the present application determines the instance task corresponding to the processor in the vehicle, and generates a corresponding configuration file according to the instance task; generates a monitoring application corresponding to the processor and the instance task according to the configuration file, and the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; receives the kernel information and task execution information returned by the monitoring application, and determines the running state of the processor according to the kernel information and the task execution information, and monitors the kernel information and execution information of the processor in the vehicle controller when executing the instance task through the monitoring application, so that in the process of software development, when the processor executes the instance task abnormally, the abnormality can be discovered in time and the cause of the abnormality can be located, thereby improving the software development efficiency; when the processor executes the instance task abnormally during vehicle use, the abnormality can be discovered in time and the cause of the abnormality can be located, and the above-mentioned abnormality can be repaired, thereby improving the stability and reliability of the vehicle system, and avoiding the problem that the processor in the vehicle cannot locate the abnormality when executing business functions and logic abnormally, thereby affecting the software development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flowchart of a method for determining the operating state of a processor provided in an embodiment of the present application;
[0011] Figure 2 This is a basic schematic diagram of generating a target file provided by an embodiment of the present application;
[0012] Figure 3 is a flowchart of another method for determining the operating state of a processor provided in an embodiment of the present application;
[0013] Figure 4This is another basic schematic diagram for generating a target file provided by an embodiment of the present application;
[0014] Figure 5 It is a flowchart of another method for determining the operating state of a processor provided in an embodiment of the present application;
[0015] Figure 6 is a flowchart of another method for determining the operating state of a processor provided in an embodiment of the present application;
[0016] Figure 7 It is a basic schematic diagram of a CP software architecture provided by an embodiment of the present application;
[0017] Figure 8 It is a flowchart of another optional method for determining the operating state of a processor provided in an embodiment of the present application;
[0018] Fig. 9 It is a basic schematic diagram of a data structure provided in an embodiment of the present application;
[0019] Fig.10 It is a flowchart of another optional method for determining the operating state of a processor provided in an embodiment of the present application;
[0020] Fig.11 It is a flowchart of another optional method for determining the operating state of a processor provided in an embodiment of the present application;
[0021] Fig.12 It is a structural diagram of a device for determining the operating state of a processor provided in an embodiment of the present application;
[0022] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0024] A method and device for determining the operating state of a processor according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0025] Figure 1 A method for determining the operating state of a processor provided in an embodiment of the present application is as follows: Figure 1 As shown, the method includes:
[0026] S101, determining an instance task corresponding to a processor in a vehicle, and generating a corresponding configuration file according to the instance task;
[0027] S102, generating a monitoring application corresponding to the processor and the instance task according to the configuration file;
[0028] S103: Receive kernel information and task execution information returned by the monitoring application, and determine the running state of the processor according to the kernel information and the task execution information.
[0029] It can be understood that the above-mentioned vehicles include vehicles with automatic driving or intelligent driving (including vehicles with passenger functions (such as cars, buses, large buses, minibuses, etc.), vehicles with cargo functions (such as ordinary trucks, vans, trailers, closed trucks, tank trucks, flatbed trucks, container trucks, dump trucks, trucks with special structures), special vehicles (such as logistics distribution vehicles, automatic guided transport vehicles AGV, patrol cars, cranes, cranes, excavators, bulldozers, forklifts, rollers, loaders, off-road engineering vehicles, armored engineering vehicles, sewage treatment vehicles, sanitation vehicles, vacuum trucks, floor washing vehicles, sprinkler trucks, sweeping robots, food delivery robots, shopping guide robots, lawn mowers, golf carts, etc.), vehicles with entertainment functions (such as entertainment vehicles, amusement park automatic driving devices, balance cars, etc.), rescue vehicles (such as fire trucks, ambulances, power repair vehicles, engineering rescue vehicles, etc.)), etc. The method for determining the operating status of the above-mentioned processor provided in this example is applied to at least one of a vehicle, a server, and a terminal. For better explanation, the following description will take the application of the method for determining the operating status of the processor provided in this example to the terminal as an example.
[0030] It can be understood that the vehicle operating system adopts the Classic AutoSAR Platform (CP) standard, and the software in the vehicle adopts the AUTOSAR software architecture. In the AUTOSAR software architecture, it is divided into three layers, as follows: Application layer (SWC), interface layer (RTE), and basic software layer (BSW). Among them, SWC is used to define the functions of the software, mainly using the model development method, focusing on logic; RTE is used to provide the communication interface between SWC and BSW; BSW has a module dedicated to system log information collection, DLT (Diagnostic Log and Trace) module, which collects system log messages (logmessage), and then converts them into a standard data format for transmission to PDUR (Protocol Data Units Router) for message routing and forwarding, and forwarding to the corresponding message bus (communication bus) for transmission. The information that needs to be transmitted is defined by AUTOSAR, and users cannot customize log messages according to actual application scenarios, making it impossible to obtain kernel information and task execution information when the processor executes instance tasks.
[0031] In some examples, an instance task corresponding to a processor in a vehicle is determined. It can be understood that in a vehicle, a processor of a vehicle controller usually runs multiple tasks, each task is responsible for performing a specific function or processing specific data. An instance task refers to a specific instance of these tasks, that is, a specific execution entity of a task.
[0032] Following the above example, after determining the example task, this example further generates a corresponding configuration file according to the example task. The configuration file is usually generated and stored in a preset format (e.g., text format), so that relevant personnel can edit and view the configuration file through an editor corresponding to the preset format. The above configuration file includes information such as the kernel required by the processor to execute the above example task, the scheduling time of the task, etc.
[0033] In some examples, after obtaining the configuration file, this example further generates a monitoring application corresponding to the processor and the instance task according to the configuration file, wherein the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; specifically, this example develops a corresponding monitoring application according to the kernel, task scheduling time and other information in the configuration file, and the above monitoring application is used to monitor the kernel information of the processor (such as CPU usage, memory usage, etc.) and the execution information of the instance task (such as task execution time, task status, etc.) according to the configuration information. It can be understood that the monitoring application can obtain real-time kernel information and then task execution information by polling the processor and task status.
[0034] It can be understood that the monitoring application can be executed by the processor of the vehicle controller, that is, the storage format of the monitoring application corresponds to the format that the processor can run; for example, the program executed by the processor of the vehicle controller is an application under the AUTOSAR software architecture, such as Figure 2 As shown, first, the corresponding configuration file is configured according to the instance task executed by the processor, and then the configuration file is processed by the configuration tool to generate ".c" and ".h" files. Then, through the AUTOSAR configuration tool, the generated files need to be included to generate a monitoring application and compile it to finally generate an executable hex file. Finally, the executable hex file is burned into the corresponding processor through the burning tool to run, so that the processor executes the above monitoring application.
[0035] It can be understood that a monitoring application is generated through the above method and burned into the processor for execution, so that the processor can execute the above monitoring application, and the monitoring application can accurately obtain the kernel information and task execution information when the processor executes the instance task, avoiding the problem that the processor (MCU) lacks a monitoring method to observe the health status of the processor operation, and cannot confirm the actual operation status of the tasks running on the processor, which leads to the inability to locate the anomaly when the processor executes business functions and logic abnormalities, affecting the efficiency of software development.
[0036] In some examples, kernel information and task execution information returned by a monitoring application are received, and the operating status of the processor is determined based on the kernel information and task execution information, thereby enabling monitoring of the kernel information and execution information of the processor in the vehicle controller when executing an instance task. During the software development process, when an exception occurs when the processor executes an instance task, the exception can be discovered in a timely manner and the cause of the exception can be located, thereby improving software development efficiency. During vehicle use, when an exception occurs when the processor executes an instance task, the exception can be discovered in a timely manner, the cause of the exception can be located, and the above exception can be repaired, thereby improving the stability and reliability of the vehicle system.
[0037] According to the technical solution provided in the embodiment of the present application, the above method determines the instance task corresponding to the processor in the vehicle, and generates a corresponding configuration file according to the instance task; generates a monitoring application corresponding to the processor and the instance task according to the configuration file, and the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; receives the kernel information and task execution information returned by the monitoring application, and determines the running state of the processor according to the kernel information and the task execution information, and realizes the monitoring of the kernel information and execution information of the processor in the vehicle controller when executing the instance task through the monitoring application, so that in the process of software development, when the processor executes the instance task abnormally, the abnormality can be discovered in time and the cause of the abnormality can be located, thereby improving the software development efficiency; when the processor executes the instance task abnormally during vehicle use, the abnormality can be discovered in time and the cause of the abnormality can be located, and the above abnormality can be repaired, thereby improving the stability and reliability of the vehicle system, and avoiding the problem that the processor in the vehicle cannot locate the abnormality when executing business functions and logic abnormally, thereby affecting the software development efficiency.
[0038] In some embodiments, the configuration file includes: a processor configuration file and a task configuration file, such as Figure 3 As shown, the corresponding configuration file is generated according to the instance task, including:
[0039] S301, determining the task identifier, task quantity and task scheduling time corresponding to the instance task, and generating a task configuration file according to the task identifier, task quantity and task scheduling time;
[0040] S302: Determine a processor identifier and a core usage rate corresponding to the instance task, and generate a processor configuration file according to the processor identifier and the core usage rate.
[0041] Specifically, when the monitoring application is monitoring the core information of the processor and the task execution information corresponding to the instance task, it is necessary to clearly define the monitoring object in order to accurately obtain the core information and task execution information.
[0042] Continuing with the above example, when the processor is executing an instance task, the task identifier, task quantity and task scheduling time corresponding to the instance task should have a certain regularity. If the above task identifier, task quantity and task scheduling time are abnormal, it can be determined that the processor has executed the instance task abnormally. Therefore, this example determines the above task configuration file based on the task identifier, task quantity and task scheduling time, and then provides the necessary monitoring information for the monitoring application.
[0043] Similarly, when the processor is executing an instance task, the processor performance and load conditions should have certain regularities. The core usage rate is used to characterize the processor performance and load conditions. If the core usage rate is abnormal, it indicates that the processor is abnormal in executing the instance task. Therefore, this example generates a processor profile based on the processor identification and core usage rate.
[0044] It is understandable that relevant technical personnel can define the important information of the processor and the important information of the task to be executed according to actual needs, such as Figure 4 As shown, Figure 4 Cpu_i nfo is an example of a processor configuration file provided in this embodiment, which includes "+name: string (get content); + Core I d: int (processor identifier); + CpuLoad: int (core usage rate)". It can be understood that, if Figure 4 As shown, the processor profile needs to rely on the standard interface of the CP's OS (operating system); Figure 4 Task_i nfo is an example of a task configuration file provided in this example, which includes "+name: string (get content); + Runtime: int (task scheduling time); + StackUsage: int (stack usage); + Task ID: int (task ID)". It can be understood that, for example Figure 4 As shown, the kernel configuration file needs to rely on the interface corresponding to the instance task.
[0045] According to the technical solution provided in the embodiment of the present application, the task identifier, task quantity and task scheduling time corresponding to the instance task are determined, and a task configuration file is generated based on the task identifier, task quantity and task scheduling time; the processor identifier and core usage rate corresponding to the instance task are determined, and a processor configuration file is generated based on the processor identifier and core usage rate, wherein the specific monitoring objects are clarified through the above-mentioned processor configuration file and task configuration file, so that the monitoring application can accurately obtain the above-mentioned kernel information and task execution information according to the processor configuration file and task configuration.
[0046] In some embodiments, Figure 5 As shown, a monitoring application corresponding to the processor and instance task is generated according to the configuration file, including:
[0047] S501, determining a monitoring object according to a task configuration file and a processor configuration file, and determining a monitoring period according to an instance task;
[0048] S502: Construct a monitoring application according to the monitoring cycle and the monitoring object.
[0049] Specifically, this example determines the objects to be monitored through the task configuration file and the processor configuration file, that is, the above-mentioned task identification, task quantity, task scheduling time, core usage rate and other information.
[0050] In some examples, determining the monitoring period based on the instance task includes: obtaining the importance of the instance task, and determining the corresponding monitoring period based on the degree of importance of the instance task; specifically, if the degree of importance of the instance task is high, determining the monitoring period to be the first monitoring period; if the importance of the instance task is low, determining the monitoring period to be the second monitoring period, wherein the duration of the first monitoring period is shorter than the duration of the second monitoring period; for example, the first monitoring period is 1 second, and the second monitoring period is 3S.
[0051] After determining the monitoring cycle and the monitoring object, this example further constructs a monitoring application according to the monitoring cycle and the monitoring object, so that the monitoring application obtains the information of the monitoring object according to the above monitoring cycle. For example, taking the monitoring cycle as 1 second, the monitoring application obtains the information of the monitoring object every 1 second.
[0052] In order to better understand the above steps, this embodiment provides a more specific example for illustration. Figure 4 As shown, after determining the task profile and the processor profile, this example further provides the interfaces of the task profile and the processor profile to the basic software layer (Basic Software, BSW) module for integration, and sets a fixed monitoring cycle to obtain the monitoring application Vdms_swc, thereby achieving the acquisition of CPU information and task information (task identification, number of tasks, task scheduling time, core utilization) through a fixed monitoring cycle.
[0053] According to the technical solution provided in the embodiment of the present application, the monitoring object is determined according to the task configuration file and the processor configuration file, and the monitoring period is determined according to the instance task; a monitoring application is constructed according to the monitoring period and the monitoring object, so that the monitoring application can obtain the information of the monitoring object according to the monitoring period.
[0054] In some embodiments, Figure 6 As shown, before receiving the kernel information and task execution information returned by the monitoring application, the method also includes:
[0055] S601, determining an information acquisition interface and a communication link interface;
[0056] S602: Generate a target file according to the information acquisition interface, the communication link interface and the monitoring application, and write the target file into the processor so that the processor runs the monitoring application.
[0057] Specifically, this example determines an information acquisition interface and a communication link interface through a basic software module (bsw_module), wherein the information acquisition interface is used for the monitoring application to obtain kernel information and task execution information, and the communication link interface is used for the monitoring application to perform data transmission, and the above-mentioned communication link interface transmits messages through a controller area network bus (Controller Area Network, CAN) or an in-vehicle Ethernet (Ethernet, ETH); specifically, taking the kernel information and task execution information including task identification, task quantity, task scheduling time and kernel utilization rate as an example, the above-mentioned monitoring application obtains the task identification, task quantity, task scheduling time and kernel utilization rate through the information acquisition interface, and then sends the obtained task identification, task quantity, task scheduling time and kernel utilization rate through the above-mentioned communication link interface to the vehicle gateway, and the vehicle gateway further sends the above-mentioned task identification, task quantity, task scheduling time and kernel utilization rate and other data to the terminal, so that the terminal can receive the above-mentioned task identification, task quantity, task scheduling time and kernel utilization rate and other information.
[0058] In some examples, a target file is generated according to the information acquisition interface, the communication link interface, and the monitoring application, and the target file is written into the processor so that the processor runs the monitoring application, specifically, Figure 4 As shown, through the AUTOSAR configuration tool, the information acquisition interface and communication link interface files provided by the above monitoring application and the basic software module (bsw_module) are included, the monitoring application is generated, and compiled, and finally an executable target file (hex file) is generated. Finally, the executable hex file is burned into the corresponding processor through the burning tool, so that the processor executes the above monitoring application.
[0059] It can be understood that the above-mentioned monitoring application calls the information acquisition interface (for example: GetCpuLoad) provided by (bsw_module) during its scheduling cycle to obtain kernel information and execution task information, and synchronizes it to the storage area (the storage area can be defined by relevant technical personnel) to cache the data, and after the synchronization is completed, use the communication link interface (CAN / ETH) provided by (bsw_module) to send data.
[0060] It is understandable that if Figure 7 As shown, Figure 7Shown is a basic schematic diagram of the CP software architecture, which includes functional modules such as environment and support (Runtime Environment, RTE), services layer (Services Layer) and complex device module (Complete Drivers, CDD). Among them, this example also provides a vehicle diagnostics and monitoring system (VDMS). The VDMS module is integrated in the CDD module, and the monitoring application directly calls the interface of the vdms module. At the same time, the vdms module needs to use the OS (module in the Servers Layer) interface and communication-related interfaces.
[0061] According to the technical solution provided in the embodiment of the present application, an information acquisition interface and a communication link interface are determined; a target file is generated based on the information acquisition interface, the communication link interface and the monitoring application, and the target file is written into the processor, so that the processor runs the monitoring application, so that the monitoring application can obtain the processor's kernel information and the task execution information corresponding to the instance task through the information acquisition interface, and send the processor's kernel information and the task execution information corresponding to the instance task through the communication link interface.
[0062] In some embodiments, Figure 8 As shown, before determining the running state of the processor according to the kernel information and the task execution information, the method further includes:
[0063] S801, determining a corresponding message content format according to the kernel information and the task execution information, and determining a corresponding message header format according to the information acquisition interface and the communication link interface;
[0064] S802. Define the data structure of the data transmitted by the monitoring application according to the message content format and the message header format.
[0065] Specifically, in order to ensure that the kernel information and task execution information sent by the monitoring application can be correctly received and parsed, this example needs to further define the data structure of the data transmitted by the monitoring application, so that the above kernel information and task execution information can be obtained based on the subsequent data parsing transmitted by the monitoring application.
[0066] In some examples, the corresponding message content format is determined based on the kernel information and the task execution information, wherein the message content format is determined by determining the degree of matching between the kernel information and the task execution information and the content forms such as structure, JSON, and XML; exemplarily, if the XML format can clearly and completely express the above-mentioned kernel information and task execution information, and the data volume of the kernel information and the task execution information in the XML format is small, then it is determined that the degree of matching between the XML format and the kernel information and the task execution information is high; if the JSON format can clearly and completely express the above-mentioned kernel information and task execution information, but the data volume of the kernel information and the task execution information in the JSON format is large, then it is determined that the degree of matching between the JSON format and the kernel information and the task execution information is average.
[0067] In some examples, the corresponding packet header format is determined according to the information acquisition interface and the communication link interface, and the packet header format includes information such as an identifier, a counter, a length, a timestamp, and data content. It can be understood that the packet header format may vary with the transmission protocol supported by the information acquisition interface and the communication link interface.
[0068] It is understandable that after obtaining the kernel information and the task execution information, the monitoring application can put the kernel information and the task execution information in one piece of data, or can put the kernel information and the task execution information in different pieces of data; for example, Fig. 9 As shown, Fig. 9 It is defined in the data packet header of the monitoring application that includes an identifier (ID), a counter (CNT), a length (LEN), and a timestamp (Len), and a piece of data also includes kernel information (CPUData) and task execution information (Task Data).
[0069] According to the technical solution provided in the embodiment of the present application, the corresponding message content format is determined according to the kernel information and the task execution information, and the corresponding message header format is determined according to the information acquisition interface and the communication link interface; the data structure of the monitoring application transmission data is defined according to the message content format and the message header format, thereby ensuring that the kernel information and task execution information sent by the monitoring application can be correctly received and parsed.
[0070] In some examples, such as Fig.10 As shown, the operating state of the processor is determined according to the kernel information and the task execution information, including:
[0071] S1001, comparing the kernel information with the preset target kernel information to obtain a first comparison result; comparing the task execution information with the preset target task execution information to obtain a second comparison result;
[0072] S1002: If the first comparison result indicates that the kernel is running abnormally or the second comparison result indicates that the task is executed abnormally, determine that the running state of the processor is abnormal.
[0073] Specifically, when the processor is executing an instance task, the kernel information and the task execution information should have certain regularities. Therefore, the preset target kernel information and the preset target task execution information can be obtained based on the above regularities.
[0074] Continuing with the above example, the kernel information is compared with the preset target kernel information to obtain a first comparison result; if the kernel information is different from the target kernel information, the first comparison result indicates that the kernel operation is abnormal; if the kernel information is the same as the target kernel information, the first comparison result indicates that the kernel operation is normal; the task execution information is compared with the preset target task execution information; if the task execution information is different from the target task execution information, the second comparison result indicates that the processor executes the instance task abnormally; if the task execution information is the same as the target task execution information, the second comparison result indicates that the processor executes the instance task normally.
[0075] Among them, if the first comparison result indicates that the kernel runs abnormally or the second comparison result indicates that the task is executed abnormally, the operating state of the processor is determined to be abnormal; if the first comparison result indicates that the kernel runs normally and the second comparison result indicates that the task is executed normally, the operating state of the processor is determined to be normal.
[0076] According to the technical solution provided in the embodiment of the present application, the kernel information is compared with the preset target kernel information to obtain a first comparison result; the task execution information is compared with the preset target task execution information to obtain a second comparison result; if the first comparison result represents a kernel operation abnormality or the second comparison result represents a task execution abnormality, the operating state of the processor is determined to be abnormal, thereby achieving accurate determination of the operating state of the processor when executing an instance task.
[0077] In some examples, such as Fig.11 As shown, after determining the operating state of the processor according to the kernel information and the task execution information, the method further includes:
[0078] S1101, if the running state of the processor is abnormal, control the processor to stop running the instance task;
[0079] S1102: Generate an abnormal warning prompt, and display the abnormal warning prompt through a display method provided by the vehicle.
[0080] Specifically, if the processor's operating state is abnormal, continuing to run the instance task may cause security vulnerabilities, data leakage, data corruption, and system crashes, and other security issues. Therefore, if the processor's operating state is abnormal, the processor is controlled to stop running the instance task to avoid causing more serious security issues.
[0081] In some examples, this example will generate an abnormal warning prompt and display the abnormal warning prompt through the display method provided by the vehicle, thereby prompting relevant personnel to repair the abnormality.
[0082] According to the technical solution provided in the embodiment of the present application, if the operating state of the processor is abnormal, the processor is controlled to stop running the instance task; an abnormal alarm prompt is generated, and the abnormal alarm prompt is displayed through the display method provided by the vehicle, thereby avoiding causing more serious safety problems, and the abnormal alarm prompt is displayed through the display method provided by the vehicle to prompt relevant personnel to repair the abnormality and ensure the stability of the vehicle.
[0083] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0084] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0085] This embodiment also provides a device for determining the operating state of a processor, such as Fig.12 As shown, the device comprises:
[0086] Configuration module 1201, used to determine the instance task corresponding to the processor in the vehicle, and generate a corresponding configuration file according to the instance task;
[0087] A monitoring module 1202, used to generate a monitoring application corresponding to the processor and the instance task according to the configuration file, the monitoring application being used to monitor the kernel information of the processor and the task execution information corresponding to the instance task;
[0088] The state module 1203 is used to receive the kernel information and task execution information returned by the monitoring application, and determine the running state of the processor according to the kernel information and the task execution information.
[0089] In some examples, the configuration file includes: a processor configuration file and a task configuration file. The root configuration module 1201 is also used to determine the task identifier, task quantity and task scheduling time corresponding to the instance task, and generate the task configuration file based on the task identifier, task quantity and task scheduling time; determine the processor identifier and core utilization rate corresponding to the instance task, and generate the processor configuration file based on the processor identifier and core utilization rate.
[0090] In some examples, the monitoring module 1202 determines the monitoring object according to the task configuration file and the processor configuration file, and determines the monitoring period according to the instance task; and builds a monitoring application according to the monitoring period and the monitoring object.
[0091] In some examples, the status module 1203 is also used to determine an information acquisition interface and a communication link interface, the information acquisition interface is used for the monitoring application to obtain kernel information and task execution information, and the communication link interface is used for the monitoring application to perform data transmission; a target file is generated based on the information acquisition interface, the communication link interface, and the monitoring application, and the target file is written into the processor so that the processor runs the monitoring application.
[0092] In some examples, the status module 1203 is also used to determine the corresponding message content format based on kernel information and task execution information, and determine the corresponding message header format based on the information acquisition interface and the communication link interface; and define the data structure of the monitoring application transmission data based on the message content format and the message header format.
[0093] In some examples, the status module 1203 is also used to compare the kernel information with the preset target kernel information to obtain a first comparison result; compare the task execution information with the preset target task execution information to obtain a second comparison result; if the first comparison result indicates that the kernel operation is abnormal or the second comparison result indicates that the task execution is abnormal, then the operating state of the processor is determined to be abnormal.
[0094] In some examples, the status module 1203 is also used to control the processor to stop running the instance task if the operating status of the processor is abnormal; generate an abnormal alarm prompt, and display the abnormal alarm prompt through a display method provided by the vehicle.
[0095] According to the technical solution provided in the embodiment of the present application, the device provided in the embodiment determines the instance task corresponding to the processor in the vehicle, and generates a corresponding configuration file according to the instance task; generates a monitoring application corresponding to the processor and the instance task according to the configuration file, and the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; receives the kernel information and task execution information returned by the monitoring application, and determines the running state of the processor according to the kernel information and the task execution information, and realizes the monitoring of the kernel information and execution information of the processor in the vehicle controller when executing the instance task through the monitoring application, so that in the process of software development, when the processor executes the instance task abnormally, the abnormality can be discovered in time and the cause of the abnormality can be located, thereby improving the software development efficiency; when the processor executes the instance task abnormally during vehicle use, the abnormality can be discovered in time and the cause of the abnormality can be located, and the above-mentioned abnormality can be repaired, thereby improving the stability and reliability of the vehicle system.
[0096] Fig.13 Schematic diagram of an electronic device 13 provided in an embodiment of the present application. Fig.13 As shown, the electronic device 13 of this embodiment includes: a processor 1301, a memory 1302, and a computer program 1303 stored in the memory 1302 and executable on the processor 1301. When the processor 1301 executes the computer program 1303, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1301 executes the computer program 1303, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0097] The electronic device 13 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 13 may include, but is not limited to, a processor 1301 and a memory 1302. Those skilled in the art will appreciate that Fig.13 The electronic device 13 is merely an example and does not limit the electronic device 13 , and may include more or fewer components than those shown in the figure, or different components.
[0098] The processor 1301 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0099] The memory 1302 may be an internal storage unit of the electronic device 13, for example, a hard disk or memory of the electronic device 13. The memory 1302 may also be an external storage device of the electronic device 13, for example, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 13. The memory 1302 may also include both an internal storage unit of the electronic device 13 and an external storage device. The memory 1302 is used to store computer programs and other programs and data required by the electronic device.
[0100] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0101] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of regional requirements and patent practice. For example, in some areas, according to regional requirements and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0102] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining the operating state of a processor, characterized in that: The method comprises: Determine an instance task corresponding to a processor in a vehicle, and generate a corresponding configuration file according to the instance task, wherein the instance task is a specific execution entity of the task; Generate a monitoring application corresponding to the processor and the instance task according to the configuration file, wherein the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; The kernel information and the task execution information returned by the monitoring application are received, and the running state of the processor is determined according to the kernel information and the task execution information.
2. The method according to claim 1, characterized in that: The configuration files include: a processor configuration file and a task configuration file. The corresponding configuration files are generated according to the instance tasks, including: Determine the task identifier, task quantity and task scheduling time corresponding to the instance task, and generate the task configuration file according to the task identifier, task quantity and task scheduling time; Determine a processor identifier and a core usage rate corresponding to the instance task, and generate the processor configuration file according to the processor identifier and the core usage rate.
3. The method according to claim 2, characterized in that Generating a monitoring application corresponding to the processor and the instance task according to the configuration file includes: Determine a monitoring object according to the task configuration file and the processor configuration file, and determine a monitoring period according to the instance task; The monitoring application is constructed according to the monitoring cycle and the monitoring object.
4. The method according to claim 1, characterized in that Before receiving the kernel information and the task execution information returned by the monitoring application, the method further includes: Determine an information acquisition interface and a communication link interface, wherein the information acquisition interface is used by the monitoring application to acquire the kernel information and the task execution information, and the communication link interface is used by the monitoring application to perform data transmission; A target file is generated according to the information acquisition interface, the communication link interface and the monitoring application, and the target file is written into the processor so that the processor runs the monitoring application.
5. The method according to claim 4, characterized in that Before determining the operating state of the processor according to the kernel information and the task execution information, the method further includes: Determine a corresponding message content format according to the kernel information and the task execution information, and determine a corresponding message header format according to the information acquisition interface and the communication link interface; The data structure of the monitoring application transmission data is defined according to the message content format and the message header format.
6. The method according to claim 1, characterized in that Determining the operating state of the processor according to the kernel information and the task execution information includes: Comparing the kernel information with preset target kernel information to obtain a first comparison result; comparing the task execution information with preset target task execution information to obtain a second comparison result; If the first comparison result indicates that the kernel is running abnormally or the second comparison result indicates that the task is executed abnormally, it is determined that the running state of the processor is abnormal.
7. The method according to claim 6, characterized in that After determining the operating state of the processor according to the kernel information and the task execution information, the method further includes: If the running state of the processor is abnormal, controlling the processor to stop running the instance task; Generate an abnormal warning prompt, and display the abnormal warning prompt through a display method provided by the vehicle.
8. A device for determining the operating state of a processor, characterized in that: The device comprises: A configuration module, used to determine an instance task corresponding to a processor in a vehicle, and generate a corresponding configuration file according to the instance task, wherein the instance task is a specific execution entity of the task; A monitoring module, used to generate a monitoring application corresponding to the processor and the instance task according to the configuration file, wherein the monitoring application is used to monitor the kernel information of the processor and the task execution information corresponding to the instance task; The status module is used to receive the kernel information and the task execution information returned by the monitoring application, and determine the running status of the processor according to the kernel information and the task execution information.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Task scheduling method and device, equipment and storage medium
CN116414542A
Method of scheduling cache budget in multi-core processing device and device performing same
CN116414555A