Program monitoring method and device based on program monitoring system and storage medium

By introducing a security service module based on program monitoring system on the AP AUTOSAR platform, loading preset configuration files and handling abnormal requests, the problems of incomplete monitoring and inflexible configuration in the existing technology are solved, and comprehensive monitoring of automotive software is achieved and Exception handling improves security and stability.

CN119025320APending Publication Date: 2024-11-26CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411180838.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing AP AUTOSAR platform monitoring strategy has problems such as incomplete program monitoring methods, limited monitoring range, inflexible configuration, and inability to view abnormal information, which makes it difficult to effectively ensure the safety and stability of automotive software.

Method used

Provide a method based on a program monitoring system, loading preset configuration files when the vehicle system is started through a security service module, receiving registration and exception processing requests for target programs, determining processing strategies based on exception information and configuration files, and performing exception processing, including Restart, logging and other operations to ensure the security and stability of the program.

Benefits of technology

It realizes comprehensive monitoring and exception handling of program operation status, improves the safety and stability of automotive software, and enhances the flexibility and scalability of monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025320A_ABST
    Figure CN119025320A_ABST
Patent Text Reader

Abstract

The invention discloses a program monitoring method and device based on a program monitoring system and a storage medium, the program monitoring system comprises a safety service module, the method is applied to the safety service module, and the method comprises the steps that when it is detected that a vehicle-mounted system is started, a preset configuration file is loaded; receiving a registration request sent by a target program in the vehicle-mounted system; according to the target identification information and preset identification information corresponding to a plurality of preset programs in a preset configuration file, registering the target program; receiving an exception handling request sent by the target program; the exception handling request carries exception information; and determining a target exception handling strategy of the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy. According to the application, the running of the program can be monitored, the abnormal information during the running of the program is acquired and processed, and the safety and the stability of the running of the program are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a program monitoring method, device and storage medium based on a program monitoring system. Background Art

[0002] With the rapid development of automotive electronic and electrical technology, automotive intelligence and networking have become the main development direction of the automotive field now and in the future. The demand for software applications in cars has also flourished. In order to cope with the mainstream trend of future cars, the Adaptive Autosar platform provides runtime system architecture, platform composition, and various functions and interfaces. In the process of running many software, it is necessary to promptly discover potential faults or problems and take corresponding measures to improve the safety performance and reliability of the vehicle. It is a necessary guarantee for the functional safety of the car.

[0003] The AP AUTOSAR standard solution provides PHM, EM and SM to monitor the software process.

[0004] EM (Execution Management): Responsible for all aspects of system execution management, including platform initialization and starting / shutting down applications.

[0005] SM (State Management): Responsible for functions including handling events, event / request priorities, etc. to set the corresponding internal states.

[0006] PHM (Platform Health Management): performs health management on adaptive platform applications (adaptive APP), mainly including four types of detection functions: Alive Supervision, Deadline Supervision, Logical Supervision, and Health Status, and can trigger corresponding recovery actions for discovered errors.

[0007] Alive Supervision: Periodically checks whether the checkpoint of the supervised entity is reached within a given range; Deadline Supervision: Non-periodic or sporadic supervised entities have separate constraints on the time between two checkpoints; Logical Supervision: Logical supervision is used to check whether the software is executed in the correct logical order; Health Status: Health status report, which is related to the watchdog and hardware status; The current AP AUTOSAR monitoring strategy has the following problems: (1) The program monitoring method is not perfect. The four monitoring methods currently available in PHM cannot fully reflect the operating status of the program; (2) The programs that can be monitored are limited. Currently, PHM is only suitable for monitoring the application of AP AUTOSAR adaptive platform; (3) The monitoring configuration is not flexible enough. Currently, monitoring requires the cooperation of multiple programs, and each program needs to be configured. When new abnormal information needs to be added, it is troublesome. (4) The monitored exception information cannot be viewed, and the current program exception and recovery processing actions cannot be reported, which is inconvenient for subsequent error analysis and debugging. Summary of the invention

[0008] The present application provides a program monitoring method, device and storage medium based on a program monitoring system, which can monitor the operation of the program, obtain and process abnormal information during the operation of the program, and ensure the security and stability of the program operation.

[0009] On the one hand, the present application provides a program monitoring method based on a program monitoring system, wherein the program monitoring system includes a security service module, and the method is applied to the security service module, and the method includes: When it is detected that the vehicle-mounted system is started, a preset configuration file is loaded; the vehicle-mounted system includes a plurality of preset programs, the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs; Receiving a registration request sent by a target program in the vehicle-mounted system; the registration request carries target identification information of the target program; registering the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file; receiving an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation state of the target program; A target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

[0010] In an exemplary embodiment, obtaining preset abnormal information when a plurality of the preset programs are running; Performing hierarchical processing on the preset exception information, determining level information of the preset exception information, and obtaining preset exception processing strategies of a plurality of the preset programs according to the level information; The preset configuration file is obtained according to the corresponding relationship between the level information and the preset exception handling strategy.

[0011] In an exemplary embodiment, the step of performing hierarchical processing on the preset exception information, determining level information of the preset exception information, and obtaining preset exception handling strategies of a plurality of the preset programs according to the level information includes: When the preset abnormal information is at least one of the CPU abnormal information and the memory abnormal information, the level of the preset abnormal information is determined to be the first level, and a first preset abnormal processing strategy corresponding to the first level is determined to be restarting the vehicle system; When the preset exception information is at least one of loading exception information and initialization exception information, determining the level of the preset exception information as a second level, and determining that a second preset exception handling strategy corresponding to the second level is to restart the target program; When the preset program can be run and the preset exception information exists, the level of the preset exception information is determined to be the third level, and a third preset exception handling strategy corresponding to the third level is determined to be recording the preset exception information in a log.

[0012] In an exemplary embodiment, determining a target exception handling strategy of the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy includes: Performing graded processing on the abnormal information to determine a target grade of the abnormal information; Determining a target exception handling strategy for the target program according to the target level and the preset configuration file; The target program is processed according to the target exception handling strategy.

[0013] In an exemplary embodiment, the program monitoring system further includes an execution management module, and the processing of the target program according to the target exception handling strategy includes: When the target exception policy of the target program is to restart the target program, sending a policy execution request to the execution management module; so that the execution management module restarts the target program according to the target exception handling policy; The policy execution request carries the target exception handling policy.

[0014] In an exemplary embodiment, the exception handling request also carries the target identification information of the target program, and the target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy, including: Based on the exception handling request, obtaining registration status information of the target program; When the registration status information indicates that the registration status of the target program is a registered status, a target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

[0015] In an exemplary embodiment, determining a target exception handling strategy of the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy includes: Parsing the exception information to obtain exception code information, timestamp information and exception description information of the exception information; Determine target exception information according to the exception code information, the timestamp information and the exception description information, A target exception handling strategy for the target program is determined according to the target exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

[0016] On the other hand, a program monitoring device based on a program monitoring system is provided, which is applied to a security service module in the program monitoring system, and the device includes: A preset configuration file loading module is used to load a preset configuration file when detecting that the vehicle-mounted system is started; the vehicle-mounted system includes a plurality of preset programs, the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs; A registration request receiving module, used to receive a registration request sent by a target program in the vehicle-mounted system; the registration request carries target identification information of the target program; A target program registration module, used to register the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file; An exception handling request receiving module, used to receive an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation status of the target program; The exception handling module is used to determine a target exception handling strategy of the target program according to the exception information and the preset configuration file, and to handle the target program according to the target exception handling strategy.

[0017] Another aspect provides a program monitoring system, the program monitoring system comprising a security service module and an execution management module; The security service module is used to load a preset configuration file when detecting that the vehicle system is started; the vehicle system includes multiple preset programs, and the multiple preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the multiple preset programs; receive a registration request sent by the target program in the vehicle system; the registration request carries the target identification information of the target program; register the target program according to the target identification information and the preset identification information corresponding to each of the multiple preset programs in the preset configuration file; receive an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the running state of the target program; determine the target exception handling strategy of the target program according to the exception information and the preset configuration file, and process the target program according to the target exception handling strategy; The execution management module is used to receive a policy execution request and restart the target program according to the target exception handling policy; the policy execution request is sent by the target program when the target exception policy of the target program is to restart the target program; wherein the policy execution request carries the target exception handling policy.

[0018] On the other hand, an electronic device is provided, including a processor and a memory, wherein the processor is used to store the memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the program monitoring method based on the program monitoring system as described above.

[0019] On the other hand, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium contains at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the program monitoring method based on the program monitoring system as described above.

[0020] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the program monitoring method based on the program monitoring system as described above.

[0021] The program monitoring method, device and storage medium based on the program monitoring system provided by the present application have the following technical effects: The present application loads a preset configuration file when detecting that the vehicle system is started; the vehicle system includes multiple preset programs, and the multiple preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the multiple preset programs; receives a registration request sent by the target program in the vehicle system; the registration request carries the target identification information of the target program; registers the target program according to the target identification information and the preset identification information corresponding to each of the multiple preset programs in the preset configuration file; receives an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation status of the target program; determines the target exception handling strategy of the target program according to the exception information and the preset configuration file, and processes the target program according to the target exception handling strategy. The present application can monitor the operation of the program, obtain the exception information when the operation of the program is abnormal, determine the target exception handling strategy after classifying the exception information, and perform exception handling according to the target exception handling strategy, which can effectively ensure the security and stability of the program operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions and advantages of the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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 creative work.

[0023] Figure 1 It is a flowchart of a program monitoring method based on a program monitoring system provided in an embodiment of this specification; Figure 2 It is a flow chart of obtaining a preset configuration file according to preset abnormal information provided by an embodiment of this specification; Figure 3 It is a flowchart of determining a preset exception handling strategy according to level information provided by an embodiment of this specification; Figure 4is a schematic diagram of a security service module provided in an embodiment of this specification; Figure 5 It is a schematic diagram of program monitoring under an AP AUTOSAR architecture provided in an embodiment of this specification; Figure 6 It is a schematic diagram of the operation of a program detection system provided in an embodiment of this specification; Figure 7 is a schematic diagram of the operation of another program detection system provided in an embodiment of this specification; Figure 8 It is a flowchart of determining the registration status of a target program provided by an embodiment of this specification; Fig. 9 This is a schematic diagram of a process for analyzing abnormal information provided by an embodiment of this specification; Fig.10 It is a flowchart of processing a target program according to abnormal information provided by an embodiment of this specification; Fig.11 It is a structural diagram of a server provided in an embodiment of this specification. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] An embodiment of the present application provides a program monitoring system, which may include at least a security service module and an execution management module.

[0027] Specifically, in an embodiment of the present application, the security service module can be used to load a preset configuration file when it is detected that the vehicle system is started; the vehicle system includes multiple preset programs, and the multiple preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the multiple preset programs; a registration request sent by the target program in the vehicle system is received; the registration request carries the target identification information of the target program; the target program is registered according to the target identification information and the preset identification information corresponding to each of the multiple preset programs in the preset configuration file; an exception handling request sent by the target program is received; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the running state of the target program; a target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

[0028] Specifically, in an embodiment of the present application, the execution management module can be used to receive a policy execution request sent by the target program, and restart the target program according to a target exception handling policy; the policy execution request is sent by the target program when the target exception policy of the target program is to restart the target program; wherein, the policy execution request carries the target exception handling policy.

[0029] Specifically, in an embodiment of the present application, the above-mentioned program monitoring system may further include a status management module and a platform health management module. Based on the above-mentioned program monitoring system, monitoring of adaptive applications, third-party applications, system services and kernels can be realized. The adaptive application is under the execution management module. When the execution management module is started, the adaptive application as well as the status management module and the platform health management module are started. When an abnormality occurs in the operation of the adaptive application, abnormal information is generated. The abnormal information can be reported to the security service module or to the platform health management module. After being reported to the platform health management module, the platform health management module checks the abnormal information according to the configuration and reports the relevant results to the status management module. The status management module then performs corresponding operations according to the processing strategy in the configuration, such as notifying the execution management module to perform a restart operation.

[0030] The following describes a program monitoring method based on a program monitoring system of the present application. Figure 1It is a flowchart of a program monitoring method based on a program monitoring system provided in an embodiment of the present application. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The sequence of steps listed in the embodiment is only one way of executing the steps among many sequences, and does not represent the only execution sequence. When the actual system or the fourth server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 1 As shown, the program monitoring system includes a security service module, and the method is applied in the security service module. The method may include: S1: When it is detected that the vehicle-mounted system is started, a preset configuration file is loaded; the vehicle-mounted system includes a plurality of preset programs, the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs.

[0031] In an embodiment of the present application, when the vehicle-mounted system is started, the security service module is started first, and the security service module loads a preset configuration file. Since the vehicle-mounted system includes multiple programs, the preset configuration file includes identification information of multiple programs, that is, program names and other information. In addition, the preset configuration file may also include a heartbeat function switch, heartbeat timeout information, application restart commands, application environment variables, the maximum number of application restarts, an application error code list, and corresponding processing strategies. For different needs, the preset configuration file may also include other related content, which is not limited to the above content.

[0032] In an exemplary embodiment, if Figure 2 As shown, the method may also include: S11: Acquire preset abnormal information when a plurality of preset programs are running; S12: performing hierarchical processing on the preset exception information, determining level information of the preset exception information, and obtaining preset exception processing strategies of a plurality of the preset programs according to the level information; S13: Obtaining the preset configuration file according to the correspondence between the level information and the preset exception handling strategy.

[0033] In an embodiment of the present application, all exception information that may be encountered by each preset program during operation is obtained, all exception information is graded, and the exception handling strategies corresponding to the exception information at different levels are determined based on the level information of the exception information. Then, based on each level and the exception handling strategies corresponding to each level, the processing strategies in the preset configuration file are obtained.

[0034] The embodiment of the present application obtains all exception information encountered during the operation of each preset program, processes it in a classified manner, and constructs an exception handling strategy, which can effectively improve the richness and reliability of the content in the preset configuration file, so that when the operation of the target program encounters an exception, it can obtain a suitable and effective processing strategy based on the content in the preset configuration file to ensure that the program resumes normal operation.

[0035] In an exemplary embodiment, if Figure 3 As shown, the preset exception information is graded to determine the level information of the preset exception information, and a plurality of preset exception handling strategies of the preset programs are obtained according to the level information, including: S121: When the preset abnormal information is at least one of the CPU abnormal information and the memory abnormal information, determining the level of the preset abnormal information as the first level, and determining that the first preset abnormality handling strategy corresponding to the first level is to restart the vehicle system; S122: When the preset exception information is at least one of loading exception information and initialization exception information, determining the level of the preset exception information as a second level, and determining that a second preset exception handling strategy corresponding to the second level is to restart the target program; S123: When the preset program can be run and the preset exception information exists, the level of the preset exception information is determined to be the third level, and a third preset exception handling strategy corresponding to the third level is determined to be recording the preset exception information in a log.

[0036] In the embodiment of the present application, all the abnormal information obtained is graded. For some fatal abnormalities, such as CPU abnormalities, memory abnormalities, etc., when at least one of them is in the abnormal information, the level of these abnormal information can be determined as the first level, and the corresponding processing strategy is to restart the entire vehicle system; for some serious abnormalities, such as file loading abnormalities, initialization failures, etc., the level of these abnormal information can be determined as the second level, and the corresponding processing strategy is to restart the target program that generates the abnormality; for some general abnormalities, that is, although there are some abnormalities, the target program can still run, so as to determine the level of these abnormal information as the third level, and the corresponding processing strategy is to record these abnormal information in the log. In addition, other classification methods can also be used for abnormal information, and more corresponding processing strategies can also be used. The specific content can be adapted according to specific programs and business needs.

[0037] In an embodiment of the present application, the security service module can restart the entire system through a watchdog or IPC communication to resolve serious anomalies from the kernel or application.

[0038] The embodiment of the present application constructs a preset exception handling strategy by classifying exception information and then corresponding appropriate processing strategies according to the levels. When an exception occurs during the operation of the target program, the exception information can be reasonably classified, and a reasonable exception handling strategy can be adapted for the target program to effectively handle the abnormal situation of the target program and ensure the safe and stable operation of the target program.

[0039] In the embodiments of the present application, Figure 4 As shown in the figure, the security service module can include a heartbeat unit (HeartBeatservice), an application processing unit (APP Handle) and a kernel processing unit (Kernel Handle). These units can be freely turned on or off according to specific needs and are independent of each other. The security service module can complete the functional configuration of each application through a preset configuration file, including the heartbeat detection function, the maximum number of restarts, the error code list and the corresponding processing strategy.

[0040] In the embodiment of the present application, the heartbeat unit is a function configuration unit for each application program. When the program is performing function configuration, the program's running status information is obtained. If the program's running status information indicates that the program is not in a running state within the configuration time, the program is controlled to run. Different programs may correspond to different configuration times and related setting information, and the function configuration information of each program may be set in a preset configuration file.

[0041] In an embodiment of the present application, the application processing unit can process various information sent by the program, such as registration information, exception information, etc.; the kernel processing unit can process the information sent by the kernel to the security service module. In the Linux system, when an exception occurs in the kernel, the exception information is sent to the security service module in a custom format through a netlink message, and then processed by the kernel processing unit in the security service module, thereby realizing kernel monitoring; wherein, the processing method for kernel exceptions is similar to the processing method for application exceptions.

[0042] In the embodiment of the present application, the preset configuration file adopts the format of json file to support subsequent function expansion. The configuration of each application is completed in the configuration file of the security service, which is convenient for adding new error codes and new applications. Compared with the original AP AUTOSAR program monitoring process (such as Figure 5 As shown in the figure), this method can more flexibly manage the applications that need to be monitored, and the method of adding error codes can more conveniently and flexibly manage abnormal applications and can carry more relevant information.

[0043] In the embodiments of the present application, Figure 5 It is a monitoring process diagram for adaptive APP (adaptive platform application) provided by the AP AUTOSAR standard solution. In the AP AUTOSAR standard solution, PHM (platform health management), EM (execution management) and SM (state management) are provided to realize the monitoring of software processes. The software monitoring process is: when the system is started, all APPs that need to be monitored are started through execution management and state management configuration, including platform health management and state management; APP reports checkpoints to platform health management; platform health management checks the reported checkpoints according to the configuration information. If the reported checkpoint information does not meet the conditions in the configuration information, the recovery action is executed and reported to the state management. The state management then performs corresponding operations according to the strategy in the configuration information. For example, when the program needs to be restarted, the state management notifies the execution management to perform the corresponding restart operation.

[0044] In an embodiment of the present application, the security service module also integrates a log recording function, which can perform corresponding log recording and statistics for the exception information sent by each program, and also supports compression and log refresh functions, which is convenient for the target object to view the relevant information of each program during execution, and also helps the target object to analyze and debug according to the information recorded in the log, thereby ensuring the security and stability of the program operation.

[0045] The embodiment of the present application adds a security service module to the original AP AUTOSAR architecture to obtain a new program detection system, such as Figure 6 and Figure 7 As shown, the program detection system can not only monitor the adaptive APP, but also monitor third-party applications (other APP), system services (system service) and the kernel (kernel). It can also adapt to the different requirements of different programs at runtime without affecting each other. In addition, each module in the program detection system in the embodiment of the present application can be loaded in a modular form at runtime, so that it can be started and stopped at any time.

[0046] S2: Receive a registration request sent by the target program in the vehicle-mounted system; the registration request carries the target identification information of the target program.

[0047] In the embodiment of the present application, the program monitoring system also includes an execution management module, a state management module and a platform health management module. After the security service is started, the system service, the third-party application, the execution management module, the adaptive APP, the state management module and the platform health management module are started, that is, all the relevant programs that need to be monitored will be started, and each module in the program monitoring system will also be started. When each target program in the vehicle system is started, a registration request will be sent to the security service module, and the registration request carries the identification information of each target program. The security service module receives the registration request sent by the target program.

[0048] The embodiment of the present application can enable the security service module to complete the registration of each target program by receiving a request sent by the target program.

[0049] S3: registering the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file.

[0050] In the embodiment of the present application, the security service module completes the registration of each target program that needs to be monitored according to the target identification information of the target program carried in the registration request and the preset identification information of each program in the preset configuration file.

[0051] The embodiment of the present application registers with the security service module before each program starts normal operation. When an exception occurs in the registered program and reports the exception information, the corresponding processing strategy can be quickly and efficiently matched according to the preset configuration file in the security service module.

[0052] S4: receiving an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the running state of the target program.

[0053] In an embodiment of the present application, when an exception occurs in the operation of the target program, the target program generates exception information of the target program based on the running status data when the exception occurs, as well as the running status data before and after the exception occurs, and sends the exception information to the security management module, so that the security service module performs subsequent exception processing based on the exception information.

[0054] In the embodiment of the present application, the security service module also supports communication with the Linux kernel, and the collection of kernel errors and exception information can be realized through the netlink communication method. The processing method for kernel exceptions is similar to the processing method of the program. The exception information of the kernel can be sent to the security service module in a preset format. The form of the format is not limited in this application, and the format can be adapted and adjusted according to specific needs. In addition, since the kernel is strongly related to the operating system, relevant settings can be made according to actual needs, and the specific exception information details can be designed and adjusted according to the operating system and platform.

[0055] S5: Determine a target exception handling strategy for the target program according to the exception information and the preset configuration file, and process the target program according to the target exception handling strategy.

[0056] In an exemplary embodiment, if Figure 8 As shown, the exception handling request also carries the target identification information of the target program, and the target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy, which may include: S501: Based on the exception handling request, obtaining registration status information of the target program; S502: When the registration status information indicates that the registration status of the target program is a registered status, a target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

[0057] In an embodiment of the present application, after receiving an exception handling request issued by a target program, the registration status information of the target program is first obtained, and the security service module will only perform subsequent processing on the registered program. When the security service module determines that the registration status of the target program that sends the exception handling request is a registered status, the security service module determines the target exception handling strategy of the target program based on the exception information and a preset configuration file, and thereby processes the target program according to the target exception handling strategy.

[0058] The embodiment of the present application determines that the registration status of the target program that sends the exception handling request is a registered status, so that the security service module continues to perform exception handling on the target program, thereby improving the security of the program monitoring system operation and avoiding the intrusion of illegal information.

[0059] In an exemplary embodiment, if Fig. 9As shown, the determining the target exception handling strategy of the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy may also include: S511: parse the exception information to obtain exception code information, timestamp information and exception description information of the exception information; S512: Determine target exception information according to the exception code information, the timestamp information and the exception description information; S513: Determine a target exception handling strategy for the target program according to the target exception information and the preset configuration file, and process the target program according to the target exception handling strategy.

[0060] In the embodiment of the present application, the security service module will parse and process the exception information sent by the target program, obtain the exception code information, timestamp information and exception description information of the exception information, obtain the target exception information, and then process the target exception information, and obtain the corresponding target exception handling strategy according to the preset configuration file, and these related information will be recorded in detail in the security service module, which is convenient for analyzing and debugging the exception problem. In addition, the parsing and processing of the exception information may not be limited to the above content, and can be adjusted and set according to actual needs.

[0061] The embodiment of the present application parses and processes the exception information, and can more efficiently obtain the corresponding target exception handling strategy based on the exception information, and records the exception code information, timestamp information, and exception description information in detail, which can effectively help the target object analyze and locate the cause of the program exception, facilitate further debugging, and effectively improve the stability and security of program operation.

[0062] In an exemplary embodiment, if Fig.10 As shown, the determining the target exception handling strategy of the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy may also include: S521: performing classification processing on the abnormal information to determine a target level of the abnormal information; S522: Determine a target exception handling strategy for the target program according to the target level and the preset configuration file; S523: Process the target program according to the target exception handling strategy.

[0063] In an embodiment of the present application, when an exception handling request is received from a registered target program, the exception information is graded to obtain the level information of the exception information, and then the exception handling strategy corresponding to the level of the exception information is determined according to the preset exception handling strategy in the preset configuration file, that is, the target exception handling strategy. The security service module then performs corresponding exception handling according to the target exception handling strategy, thereby solving the exception problem of the program.

[0064] The embodiment of the present application can quickly and efficiently obtain the best processing strategy adapted to the current exception based on the content in the preset configuration file, thereby improving the efficiency of handling exception problems, by grading the received exception information according to the preset exception handling strategy in the preset configuration file, and then determining the corresponding target exception handling strategy according to the level information of the exception information.

[0065] In an exemplary embodiment, the program monitoring system further includes an execution management module, and the processing of the target program according to the target exception handling strategy includes: When the target exception policy of the target program is to restart the target program, sending a policy execution request to the execution management module; so that the execution management module restarts the target program according to the target exception handling policy; The policy execution request carries the target exception handling policy.

[0066] In an embodiment of the present application, for an adaptive application managed by an execution management module, when an abnormality occurs in the adaptive APP and a program restart is required, the communication function between the security service module and the execution management module can be implemented through an interface, and the security service module sends the restart strategy to the execution management module, which then restarts the adaptive APP.

[0067] In the embodiment of the present application, there is a communication interface between the security service module and the execution management module, so that the security service module can also perform corresponding management on the adaptive APP under the management of the execution management module. Improvements have been made to the original AP AUTOSAR architecture. Without affecting the operation of the monitoring system of the original AP AUTOSAR architecture, the newly added security service module can also communicate with the execution management module, thereby improving the applicability of the program monitoring system in the embodiment of the present application.

[0068] The embodiment of the present application adds a security service module to the original AP AUTOSAR monitoring architecture, and sets preset configuration files for various programs in the security service module, which can monitor adaptive APP, third-party applications, system services and kernels, solving the limitation that the original program monitoring system can only monitor adaptive APP; the security service module is also adapted to the communication function between each module, so that when an exception occurs in the operation of each program, the security service module can effectively collect the exception information of each program during operation, and classify the exception information according to the processing strategy in the preset configuration file, adapt to reasonable solutions, and quickly and efficiently solve the problem of program operation exceptions; in addition, the security service module also integrates the log recording function, which can record the various collected information in detail and completely, facilitate viewing, and perform corresponding analysis and debugging, effectively improving the security and stability of program operation.

[0069] The embodiment of the present application further provides a program monitoring device based on a program monitoring system, which is applied to a security service module in the program monitoring system. The device may include: A preset configuration file loading module is used to load a preset configuration file when detecting that the vehicle-mounted system is started; the vehicle-mounted system includes a plurality of preset programs, the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs; A registration request receiving module, used to receive a registration request sent by a target program in the vehicle-mounted system; the registration request carries target identification information of the target program; A target program registration module, used to register the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file; An exception handling request receiving module, used to receive an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation status of the target program; The exception handling module is used to determine a target exception handling strategy of the target program according to the exception information and the preset configuration file, and to handle the target program according to the target exception handling strategy.

[0070] In an exemplary embodiment, the apparatus may further include: A preset abnormal information acquisition module, used to acquire preset abnormal information when a plurality of preset programs are running; A preset exception handling strategy acquisition module, used to perform hierarchical processing on the preset exception information, determine the level information of the preset exception information, and obtain preset exception handling strategies of a plurality of the preset programs according to the level information; The preset configuration file acquisition module is used to obtain the preset configuration file according to the corresponding relationship between the level information and the preset exception handling strategy.

[0071] In an exemplary embodiment, the preset exception handling strategy acquisition module may include: a first preset exception handling strategy acquisition unit, configured to, when the preset exception information is at least one of a CPU exception information and a memory exception information, determine the level of the preset exception information to be a first level, and determine that a first preset exception handling strategy corresponding to the first level is to restart the vehicle-mounted system; a second preset exception handling strategy acquisition unit, configured to, when the preset exception information is at least one of loading exception information and initialization exception information, determine the level of the preset exception information to be a second level, and determine that a second preset exception handling strategy corresponding to the second level is to restart the target program; The third preset exception handling strategy acquisition unit is used to determine the level of the preset exception information as the third level when the preset program can be run and the preset exception information exists, and determine that the third preset exception handling strategy corresponding to the third level is to record the preset exception information in a log.

[0072] In an exemplary embodiment, the exception handling module may include: a target level determination unit, configured to perform classification processing on the abnormal information and determine a target level of the abnormal information; a target exception handling strategy determining unit, configured to determine a target exception handling strategy for the target program according to the target level and the preset configuration file; A processing unit is used to process the target program according to the target exception handling strategy.

[0073] In an exemplary embodiment, the program monitoring system further includes an execution management module, and the processing unit may include: A policy execution request sending subunit is used to send a policy execution request to the execution management module when the target exception policy of the target program is to restart the target program; so that the execution management module restarts the target program according to the target exception handling policy; wherein the policy execution request carries the target exception handling policy.

[0074] In an exemplary embodiment, the exception handling request also carries the target identification information of the target program, and the exception handling module may further include: A registration status information acquisition unit, configured to acquire the registration status information of the target program based on the exception handling request; A registration status judgment unit is used to determine a target exception handling strategy of the target program according to the exception information and the preset configuration file when the registration status information indicates that the registration status of the target program is a registered state, and process the target program according to the target exception handling strategy.

[0075] In an exemplary embodiment, the exception handling module may further include: A parsing unit, used to parse the exception information to obtain exception code information, timestamp information and exception description information of the exception information; a target abnormality information determining unit, configured to determine target abnormality information according to the abnormality code information, the timestamp information and the abnormality description information; The target exception information processing unit is used to determine the target exception processing strategy of the target program according to the target exception information and the preset configuration file, and process the target program according to the target exception processing strategy.

[0076] The device and method embodiments in the device embodiments described in this specification are based on the same inventive concept.

[0077] An embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a program monitoring method based on a program monitoring system as provided in the above method embodiment.

[0078] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a terminal to store at least one instruction or at least one program related to the program monitoring method based on the program monitoring system in the method embodiment, and the at least one instruction or at least one program is loaded and executed by the processor to implement the program monitoring method based on the program monitoring system provided in the above method embodiment.

[0079] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes to implement the program monitoring method based on the program monitoring system provided in the above method embodiment.

[0080] Optionally, in the embodiments of this specification, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0081] The memory described in the embodiments of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0082] The program monitoring method embodiment based on the program monitoring system provided in the embodiments of this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig.11 1 is a hardware structure block diagram of a server of a program monitoring method based on a program monitoring system provided in an embodiment of this specification. Fig.11As shown, the server 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1110 (the central processing unit 1110 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (such as one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 can be short-term storage or permanent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1110 may be configured to communicate with the storage medium 1120 and execute a series of instruction operations in the storage medium 1120 on the server 1100. The server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1140, and / or one or more operating systems 1121, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0083] The input / output interface 1140 may be used to receive or send data via a network. A specific example of the network may include a wireless network provided by a communication provider of the server 1100. In one example, the input / output interface 1140 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1140 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0084] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.

[0085] It can be seen from the embodiments of the program monitoring method, device and storage medium based on the program monitoring system provided by the above application that the application loads a preset configuration file when detecting that the vehicle system is started; the vehicle system includes multiple preset programs, and the multiple preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the multiple preset programs; receiving a registration request sent by the target program in the vehicle system; the registration request carries the target identification information of the target program; registering the target program according to the target identification information and the preset identification information corresponding to each of the multiple preset programs in the preset configuration file; receiving an exception handling request sent by the target program; the exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation status of the target program; according to the exception information and the preset configuration file, the target exception handling strategy of the target program is determined, and the target program is processed according to the target exception handling strategy. The application can monitor the operation of the program, obtain the exception information when the operation of the program is abnormal, determine the target exception handling strategy after the abnormal information is graded, and perform exception handling according to the target exception handling strategy, which can effectively ensure the safety and stability of the program operation.

[0086] It should be noted that the above sequence of the embodiments of this specification is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0087] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0088] A person skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0089] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A program monitoring method based on a program monitoring system, wherein the program monitoring system includes a security service module, and the method is applied to the security service module, and the method includes: When the vehicle system is detected to be started, the preset configuration file is loaded; The vehicle-mounted system includes a plurality of preset programs, wherein the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs; Receiving a registration request sent by a target program in the vehicle system; The registration request carries the target identification information of the target program; registering the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file; Receiving an exception handling request sent by the target program; The exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation state of the target program; A target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

2. The method according to claim 1, characterized in that The method further comprises: Acquire preset abnormal information when a plurality of preset programs are running; Performing hierarchical processing on the preset exception information, determining level information of the preset exception information, and obtaining preset exception processing strategies of a plurality of the preset programs according to the level information; The preset configuration file is obtained according to the corresponding relationship between the level information and the preset exception handling strategy.

3. The method according to claim 2, characterized in that The step of performing hierarchical processing on the preset exception information, determining level information of the preset exception information, and obtaining preset exception processing strategies of a plurality of preset programs according to the level information includes: When the preset abnormal information is at least one of the CPU abnormal information and the memory abnormal information, the level of the preset abnormal information is determined to be the first level, and a first preset abnormal processing strategy corresponding to the first level is determined to be restarting the vehicle system; When the preset exception information is at least one of loading exception information and initialization exception information, determining the level of the preset exception information as a second level, and determining that a second preset exception handling strategy corresponding to the second level is to restart the target program; When the preset program can be run and the preset exception information exists, the level of the preset exception information is determined to be the third level, and a third preset exception handling strategy corresponding to the third level is determined to be recording the preset exception information in a log.

4. The method according to claim 3, characterized in that: The step of determining a target exception handling strategy for the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy, includes: Performing graded processing on the abnormal information to determine a target grade of the abnormal information; Determining a target exception handling strategy for the target program according to the target level and the preset configuration file; The target program is processed according to the target exception handling strategy.

5. The method according to claim 4, characterized in that The program monitoring system further includes an execution management module, and the processing of the target program according to the target exception handling strategy includes: When the target exception policy of the target program is to restart the target program, sending a policy execution request to the execution management module; so that the execution management module restarts the target program according to the target exception handling policy; The policy execution request carries the target exception handling policy.

6. The method according to claim 1, characterized in that The exception handling request also carries the target identification information of the target program, and the target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy, including: Based on the exception handling request, obtaining registration status information of the target program; When the registration status information indicates that the registration status of the target program is a registered status, a target exception handling strategy of the target program is determined according to the exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

7. The method according to claim 1, characterized in that The step of determining a target exception handling strategy for the target program according to the exception information and the preset configuration file, and processing the target program according to the target exception handling strategy, includes: Parsing the exception information to obtain exception code information, timestamp information and exception description information of the exception information; Determine target exception information according to the exception code information, the timestamp information and the exception description information; A target exception handling strategy for the target program is determined according to the target exception information and the preset configuration file, and the target program is processed according to the target exception handling strategy.

8. A program monitoring device based on a program monitoring system, applied to a security service module in the program monitoring system, the device comprising: A preset configuration file loading module is used to load a preset configuration file when detecting that the vehicle system is started; The vehicle-mounted system includes a plurality of preset programs, wherein the plurality of preset programs include a target program; the preset configuration file includes preset identification information corresponding to each of the plurality of preset programs; A registration request receiving module, used to receive a registration request sent by a target program in the vehicle system; The registration request carries the target identification information of the target program; A target program registration module, used for registering the target program according to the target identification information and the preset identification information corresponding to each of the plurality of preset programs in the preset configuration file; An exception handling request receiving module, used for receiving an exception handling request sent by the target program; The exception handling request carries exception information; the exception handling request is sent by the target program when an exception occurs in the operation of the target program and the target program generates exception information according to the operation state of the target program; The exception handling module is used to determine a target exception handling strategy of the target program according to the exception information and the preset configuration file, and to handle the target program according to the target exception handling strategy.

9. An electronic device comprising a processor and a memory, wherein the processor is used to store the memory for storing instructions executable by the processor; wherein: The processor is configured to execute the instructions to implement the program monitoring method based on the program monitoring system as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the program monitoring method based on the program monitoring system as described in any one of claims 1-7.