CN115408230A - Application management device, method, vehicle, and storage medium - Google Patents
Application management device, method, vehicle, and storage medium Download PDFInfo
- Publication number
- CN115408230A CN115408230A CN202210701618.5A CN202210701618A CN115408230A CN 115408230 A CN115408230 A CN 115408230A CN 202210701618 A CN202210701618 A CN 202210701618A CN 115408230 A CN115408230 A CN 115408230A
- Authority
- CN
- China
- Prior art keywords
- application program
- sub
- fault
- module
- heartbeat
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 238000012544 monitoring process Methods 0.000 claims abstract description 115
- 230000008569 process Effects 0.000 claims abstract description 46
- 238000012545 processing Methods 0.000 claims abstract description 36
- 238000007726 management method Methods 0.000 claims description 93
- 238000004891 communication Methods 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 9
- 230000003287 optical effect Effects 0.000 claims description 7
- 230000006870 function Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 15
- 238000004458 analytical method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 239000012792 core layer Substances 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present disclosure relates to an application management apparatus, method, vehicle, and storage medium, the application including a plurality of sub-function modules, the apparatus including: a subfunction monitoring module and a system monitoring module; the sub-function monitoring module is used for monitoring the running state of each sub-function module in real time, and when any one sub-function module is in a fault state, corresponding fault processing operation is executed based on the fault state; and the system monitoring module is used for receiving the heartbeat message of the application program and managing the application program based on the heartbeat message. According to the technical scheme, the subfunction monitoring module monitors and processes faults of the subfunction module in the application program, the system monitoring module manages the whole application program, and the stability and the reliability of the application program are guaranteed through monitoring and management of the two modules.
Description
Technical Field
The present disclosure relates to the field of vehicle intelligence technologies, and in particular, to an application management apparatus and method, a vehicle, and a storage medium.
Background
With the development of vehicle intellectualization and networking, the demand of intelligent automobiles on software systems is higher and higher, and industrial-grade embedded Linux systems are introduced into the field of intelligent automobiles.
The Linux system is composed of a plurality of subsystems, an application program running on the Linux system can interact with peripheral hardware only through an inner core layer, and data interaction needs to be processed through the plurality of subsystems of the inner core, such as process thread management, memory management, IO management, a file system, a protocol stack and the like. Therefore, the reliability of the application program in the Linux system is low.
However, as the automobile is rapidly developed to be intelligent, the requirements on the reliability and stability of the application program in the software system are higher and higher as the vehicle control to the intelligent cabin, the voice recognition, the automatic driving, the vehicle functions are more and more, the data processing amount is more and more, and the requirements are higher and more. Therefore, how to improve the reliability and stability of the application is an urgent problem to be solved.
Disclosure of Invention
The utility model provides an application program management device, method, vehicle and storage medium, carry out fault handling to the subfunction module in the application program through subfunction monitoring module, system monitoring module manages whole application program, through the monitoring and the management of two modules, guarantees application program's stability, reliability.
In a first aspect, an embodiment of the present disclosure provides an application management apparatus, where the application includes a plurality of sub-function modules, and the apparatus includes: a subfunction monitoring module and a system monitoring module;
the sub-function monitoring module is used for monitoring the running state of each sub-function module in real time and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state;
and the system monitoring module is used for receiving the heartbeat message of the application program and managing the application program based on the heartbeat message.
In a second aspect, the disclosed embodiments provide an application management method, where the application includes a plurality of sub-function modules, and the method is applied to the application management apparatus, where the apparatus includes: a subfunction monitoring module and a system monitoring module; the method comprises the following steps:
monitoring the running state of each sub-function module in real time through a sub-function monitoring module, and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state;
and receiving heartbeat messages of the application program through a system monitoring module, and managing the application program based on the heartbeat messages.
In a third aspect, embodiments of the present disclosure provide a vehicle comprising a method as set forth in any of the first aspects.
In a third aspect, the disclosed embodiments provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in the second aspect above.
An embodiment of the present disclosure provides an application management apparatus, method, vehicle, and storage medium, where the application includes a plurality of sub-function modules, the apparatus including: a subfunction monitoring module and a system monitoring module; the sub-function monitoring module is used for monitoring the running state of each sub-function module in real time and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state; and the system monitoring module is used for receiving the heartbeat messages of the application program and managing the application program based on the heartbeat messages. According to the technical scheme, the sub-function monitoring module carries out fault processing on the sub-function module in the application program, the system monitoring module manages the whole application program, and the stability and the reliability of the application service are guaranteed through monitoring and management of the two modules.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of an application management apparatus according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a sub-function monitoring module according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a system monitoring module according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a resource management submodule provided in an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating an application management method according to an embodiment of the disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a schematic structural diagram of an application management apparatus according to an embodiment of the present disclosure, where the application management apparatus according to the embodiment of the present disclosure is applicable to a case of managing an application, and the application management apparatus may be implemented in a software and/or hardware manner. The application management device can be configured in the electronic equipment. The electronic equipment is equipment for installing a Linux system and comprises: smart phones, notebook computers, tablet computers, digital cameras/camcorders, gaming devices, central control devices in automobiles, and the like.
As shown in fig. 1, an application management device 10 provided in the embodiment of the present disclosure mainly includes: a sub-function monitoring module 11 and a system monitoring module 12, and the application 20 includes a plurality of sub-function modules 21.
The sub-function monitoring module 11 is connected to each sub-function module 21, and is configured to monitor an operation state of each sub-function module 21 in real time, and when any one sub-function module 21 is in a fault state, execute a corresponding fault handling operation based on the fault state; the system monitoring module 12 is connected to the application 20, and configured to receive a heartbeat message of the application 20, and manage the application based on the heartbeat message.
The application program may be an APP program installed in a Linux system, for example: map type application programs, sound and image type application programs, instant messaging type application programs, shopping type application programs and the like.
In one embodiment of the present disclosure, each function in the application is designed in a modular manner according to specific business logic, and each sub-function is independently designed into a sub-module, i.e., a sub-function module, according to the function logic. And coupling among all the sub-function modules is reduced as much as possible, data interaction is carried out by using a message communication mechanism, and all the sub-function modules are realized by using asynchronous IO of a linux system.
Specifically, as shown in fig. 1, the sub-function module 21 is a business logic module in an application program, each sub-function module 21 completes a sub-function logic, and a plurality of sub-function logics are combined to form a function of the whole application program. For example: in the map application, the method comprises the following steps: the system comprises a sub-function module for realizing a positioning function, a sub-function module for realizing a navigation function, a sub-function module for realizing path planning, a sub-function module for realizing message reminding and the like.
In an embodiment of the present disclosure, as shown in fig. 1, the sub-function monitoring module 11 is connected to each sub-function module 21, and is configured to monitor an operation state of each sub-function module 21 in real time, and when it is monitored that any one sub-function module 21 is in a fault state, execute a corresponding fault handling operation based on the fault state.
Specifically, executing the corresponding fault handling operation may include: restarting the sub-function module in the fault state, closing the sub-function module in the fault state, and closing and restarting the whole application program.
In this embodiment, when monitoring that the sub-function module is in a failure state, the sub-function monitoring module may only perform corresponding processing on the sub-function module in the failure state, and since each sub-function module is independent, normal operation of other sub-function modules in the application program may be ensured, so as to ensure continuous availability of the application program functional service.
The heartbeat message refers to a periodic or repeated message which is sent from the time when the application program is started until the application program is closed and is sent uninterruptedly during the running of the application program. When the system monitoring module does not receive the heartbeat message in a certain heartbeat message receiving period, the system monitoring module may consider that the application program is in a failure state or is currently in an unavailable state.
In this embodiment, the managing, by the system monitoring module, the application program based on the heartbeat message mainly includes: when the system monitoring module does not receive the heartbeat message in a certain heartbeat message receiving period, the failure of the application program is indicated, and at the moment, the system monitoring module controls the restart of the application program so as to ensure the reliability of the application program.
An embodiment of the present disclosure provides an application management apparatus, including: a subfunction monitoring module and a system monitoring module; the sub-function monitoring module is used for monitoring the running state of each sub-function module in real time and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state; and the system monitoring module is used for receiving the heartbeat message of the application program and managing the application program based on the heartbeat message. According to the technical scheme, the subfunction monitoring module monitors and processes faults of the subfunction module in the application program, the system monitoring module manages the whole application program, and the stability and the reliability of the application service are guaranteed through monitoring and management of the two modules.
On the basis of the above embodiments, the sub-function monitoring module is further optimized in the embodiments of the present disclosure. Fig. 2 is a schematic structural diagram of a sub-function monitoring module according to an embodiment of the present disclosure, and as shown in fig. 2, the sub-function monitoring module 11 includes: a sentinel submodule 13 and a fault handling submodule 14.
The sentinel submodule 13 is configured to determine a fault level corresponding to the fault state based on the fault state and a preset corresponding relationship between the fault state and the fault level; and the fault processing submodule 14 is configured to determine a fault processing operation corresponding to a fault state based on the fault level, and execute the fault processing operation.
In one embodiment of the present disclosure, the sentinel submodule 13 is mainly responsible for fault tolerance processing of the application program, monitoring fault conditions of all the subfunction modules in the application program, and if a fault condition occurs, determining a fault level corresponding to the fault condition. The sentinel submodule 13 stores a corresponding relationship between a fault state and a fault level in advance, and when the fault state of the sub-function module is monitored, queries are performed in the corresponding relationship, and the queried fault level is determined as the fault level corresponding to the fault state.
Further, the fault processing submodule 14 is connected to the sentinel submodule 13, receives the fault level sent by the sentinel submodule 13, and determines whether to restart the sub-function module, close the sub-function module, or report the fault state to the previous stage based on the processing logic corresponding to the fault level.
On the basis of the above embodiment, the sub-function monitoring module further includes: the management submodule 15 is operated. When the whole application program runs, the operation management submodule 15 is responsible for the core functions of resource management, subfunction module management, error management and the like of the whole application program.
In this embodiment, by setting corresponding failure levels for all failure states, different failure processing operations are performed based on the failure levels corresponding to the failure states, so as to further ensure the continuous availability of the application program.
In one embodiment of the present disclosure, the fault handling sub-module 14 includes: a subfunction restarting unit, a subfunction closing unit and a heartbeat stopping unit; the sub-function restarting unit is used for controlling the sub-function module to restart when the fault level is a first-level fault; the sub-function closing unit is used for controlling the sub-function module to close operation when the fault level is a second-level fault; and the heartbeat stopping unit is used for controlling the application program corresponding to the sub-function module to stop heartbeat when the fault level is a third-level fault, wherein the severity of the third-level fault is greater than that of the second fault, and the severity of the second fault is greater than that of the first fault.
In this embodiment, the fault handling of each sub-module needs to implement a standard fault handling interface. Namely, the sub-function restarting unit, the sub-function shutdown unit and the heartbeat stopping unit can be respectively realized through standard fault processing interfaces.
In this embodiment, the first level failure may be understood as a failure in which the sub-function module restarts, i.e., can be resolved. And when the fault level is the first-level fault, indicating that the corresponding sub-function module has abnormal restart, and controlling the sub-function module to restart through the sub-function restart unit so as to quickly restore the sub-function module to an available state. The monitoring and restarting operation can be realized in real time and is fast.
Specifically, the sub-function restart unit may be implemented by an OnRstart function callback interface.
In this embodiment, the second-level fault may be understood as a fault that the sub-function module still cannot be used normally after being restarted, and even that the normal use of other sub-function modules is affected, at this time, the sub-function module needs to be closed, and the use of the corresponding function of the sub-function module is stopped, so as to ensure the normal use of other sub-function modules in the application program. And when the fault level is a second-level fault, indicating that an abnormality needing to close the sub-function module occurs in the corresponding sub-function module, and controlling the sub-function module to be closed through the sub-function closing unit, namely deleting the sub-function module in the task queue without scheduling and operating the sub-function module.
Specifically, the sub-function restart unit may be implemented by an onsop function callback interface.
In this embodiment, the third-level failure may be understood as a very serious failure occurring inside the sub-function module, and the application program corresponding to the sub-function module needs to be restarted to solve the failure. And when the fault level is a third-level fault, controlling the application program corresponding to the sub-function module to stop heartbeat through a heartbeat stopping unit. Namely, the heartbeat of the application program is immediately stopped, and the whole application program is exited. And restarting and recovering the application program through an application restarting submodule in the system monitoring module.
In this embodiment, for the faults of different levels, three different processing measures, namely restarting the sub-function module, stopping the sub-function module and stopping the application program, are performed, and fault processing is realized in the form of an interface, so that the advantages of high monitoring speed and high restart recovery speed after the program is in error can be realized.
On the basis of the above embodiments, the embodiments of the present disclosure further optimize the system monitoring module. Fig. 3 is a schematic structural diagram of a system monitoring module according to an embodiment of the present disclosure, and as shown in fig. 3, the system monitoring module 12 includes: a communication sub-module 16, a heartbeat message monitoring sub-module 17 and an application restart sub-module 18.
The communication submodule 16 is configured to receive a heartbeat message of the application program and periodically send the heartbeat message to a heartbeat message monitoring submodule, and the heartbeat message monitoring submodule 17 is configured to monitor the heartbeat message periodically sent by the communication submodule, and if the heartbeat message is not monitored in a set period, determine that the heartbeat message is lost and generate a heartbeat lost message; and the application restarting submodule 18 is configured to receive the heartbeat loss message and control restarting of an application program corresponding to the heartbeat loss message.
In this embodiment, the communication sub-module 16 is responsible for communication between the entire system monitoring module 12 and the outside, and is implemented based on a Data Distribution Service (DDS) communication protocol. The application 20 periodically sends heartbeat messages to the communication sub-module 16, and the communication sub-module 16 forwards the periodically received heartbeat messages to the heartbeat message monitoring sub-module 17.
In this embodiment, the heartbeat message monitoring sub-module 17 is responsible for monitoring heartbeat messages periodically sent by the application program through the communication sub-module 16. If the heartbeat message is not received in the set period, the heartbeat message monitoring sub-module 17 considers that the corresponding application program may be jammed, crashed and the like, and needs to be restarted, and then a heartbeat loss message is generated. And sending the heartbeat loss message to the application restart submodule 18, and after receiving the heartbeat loss message, the application restart submodule 18 determines an application program corresponding to the heartbeat loss message and controls the application program to restart.
The heartbeat message monitoring submodule 17 generates a heartbeat loss message, adds an application program corresponding to the heartbeat loss message, and the application restarting submodule 18 analyzes the heartbeat loss message after receiving the heartbeat loss message to obtain the application program corresponding to the heartbeat loss message. The application program corresponding to the heartbeat loss message refers to an application program losing the heartbeat message, that is, an application program which does not send the heartbeat message on time in a period.
Specifically, the application restart sub-module 18 is responsible for starting management of the application program, and the process of controlling the restart of the application program by the application restart sub-module 18 mainly includes: the system configuration file is read through the configuration file submodule 110, the configuration information of the application program is analyzed through the configuration analysis submodule 111, and the starting mode and the starting parameters of the application program are determined through the configuration information obtained through analysis of the configuration analysis submodule 111.
In this embodiment, the system monitoring module 12 implements a crash restart of the application program, and ensures the reliability of the application program.
On the basis of the above embodiment, the system monitoring module 12 further includes: a resource management submodule 19; the resource management submodule 19 is configured to receive the heartbeat message, acquire process information included in the heartbeat message, and manage a resource corresponding to the application program based on the process information.
In this embodiment, the resource management sub-module 19 implements management of resources and permissions used by the application, analyzes the process information in the heartbeat message packet in real time, obtains corresponding resources according to the process information, and manages the resources of the application. Wherein the application uses the resources including: CPU occupancy rate, memory utilization rate, disk occupation space and the like.
On the basis of the above embodiment, the system monitoring module 12 further includes: a power management submodule 112; the power management submodule 112 is responsible for power management of the whole system monitoring module 12, receives power information of the whole vehicle through the communication submodule 16, and maintains a power system state machine inside, so as to realize unified management and control of all programs of the whole system by different power states. The starting and stopping of the application is also performed by the application restart submodule 18.
On the basis of the above embodiments, the embodiments of the present disclosure further optimize the resource management submodule. Fig. 4 is a schematic structural diagram of a resource management submodule provided in the embodiment of the present disclosure, and as shown in fig. 4, the resource management submodule 19 includes: a CPU management unit 191, a memory management unit 192, and a disk management unit 193.
The CPU management unit 191 is configured to obtain a CPU utilization rate corresponding to the application program based on the process information, and send the CPU utilization rate to a log system for storage, so that a user views the CPU utilization rate; and simultaneously reading the application program configuration file, acquiring a CPU configuration threshold corresponding to the application program from the configuration file, and controlling the CPU utilization rate corresponding to the application program to be smaller than the CPU configuration threshold.
Specifically, the CPU management unit 191 manages the CPU resource of the application, the application adds its own process information to the heartbeat message, and the heartbeat message monitoring sub-module 17 forwards the process information to the resource management sub-module 19 as the heartbeat message is sent to the heartbeat message monitoring sub-module 17 through the communication sub-module 16 in the period of the heartbeat message. The CPU management unit 191 obtains the CPU utilization rate corresponding to the process information from the system according to the process information, and outputs the CPU utilization rate to a log system for recording for a user to inquire. Meanwhile, the CPU management unit 191 reads the configuration file, obtains the CPU configuration threshold corresponding to the application program, notifies the Cgroup system of the kernel 30, and sets a CPU limit value for the application program corresponding to the process information. After the Cgroup system is set, the maximum CPU utilization of the application program corresponding to the process information will be limited below the CPU configuration threshold. Wherein the process information may be a process number.
Further, the memory management unit 192 is configured to obtain a memory usage rate corresponding to the application program based on the process information, and send the memory usage rate to a log system for storage, so that a user views the memory usage rate; and simultaneously reading the application program configuration file, acquiring a memory configuration threshold corresponding to the application program from the configuration file, controlling the application program to exit when the memory utilization rate corresponding to the application program is greater than the memory configuration threshold, and releasing memory resources occupied by the application program.
Specifically, the memory management unit 192 implements management on memory resources of the application program, the application program adds process information to the heartbeat message, and the heartbeat message is sent to the heartbeat message monitoring submodule 17 through the communication submodule 16 in a heartbeat message period, and the heartbeat message monitoring submodule 17 forwards the process information to the resource management submodule 19. The memory management unit 192 obtains the memory usage rate corresponding to the process information from the system according to the process information, and outputs the memory usage rate to the log system for recording, so as to be queried by the user. Meanwhile, the memory management unit 192 reads the configuration file, obtains the memory configuration threshold corresponding to the application program, and notifies the Cgroup system of the kernel 30 to set the maximum usable memory limit value for the application program corresponding to the process. After the Cgroup system is set, if the memory utilization rate of the application program corresponding to the process exceeds the memory configuration threshold, the kernel kills the application program through oom, and memory resources occupied by the application program are released.
Further, the disk management unit 193 is configured to obtain, by the process information, a disk occupied space corresponding to the application program, and send the disk occupied space to a log system for storage, so that a user can view the disk occupied space; and simultaneously reading the application program configuration file, acquiring a disk space configuration threshold corresponding to the application program from the configuration file, and controlling the application program to exit and delete the content on the disk when the occupied space of the disk directory corresponding to the application program is larger than the disk space configuration threshold.
Specifically, the disk management unit 193 manages the disk resources of the application program, the application program adds the process information of the application program to the heartbeat message, and the heartbeat message monitoring submodule 17 forwards the process information to the resource management submodule 19 as the heartbeat message is sent to the heartbeat message monitoring submodule 17 through the communication submodule 16 in the period of the heartbeat message. The disk management unit 193 obtains the disk occupation space corresponding to the process information from the system according to the process information, and outputs the disk occupation space to the log system for recording, so that the user can inquire the disk occupation space. Meanwhile, the disk management unit 193 reads the configuration file, obtains the disk space configuration threshold corresponding to the application program, notifies the Cgroup system of the kernel 30, and sets the maximum available disk space limit value for the application program corresponding to the process. After the Cgroup system is set, if the disk occupation space of the application program corresponding to the process exceeds the disk space configuration threshold, the application restart submodule 18 is notified to kill the application program, and the disk content is deleted at the same time.
In this embodiment, the resource management submodule may implement accurate management and control of the CPU, the memory, and the disk occupancy of each application, prevent resources from exceeding a use condition, ensure that the resources used by the application are within a set quota, and ensure the stability of the entire system.
Fig. 5 is a flowchart of an application management method provided by an embodiment of the present disclosure, where the application management method provided by the embodiment of the present disclosure is applicable to a case of managing an application, and the application management method is applicable to an electronic device. The electronic equipment is equipment for installing a Linux system and comprises: smart phones, notebook computers, tablet computers, digital cameras/camcorders, gaming devices, central control devices in automobiles, and the like. The application program comprises a plurality of sub-function modules, the method is applied to the application program management device, and the device comprises the following steps: a subfunction monitoring module and a system monitoring module.
As shown in fig. 5, the application management method provided in the embodiment of the present disclosure mainly includes the following steps:
s51, monitoring the running state of each sub-function module in real time through the sub-function monitoring module, and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state.
S52, receiving the heartbeat message of the application program through a system monitoring module, and managing the application program based on the heartbeat message.
The embodiment of the disclosure provides an application program management method, which includes: the method comprises the steps that the running state of each sub-function module is monitored in real time through a sub-function monitoring module, when any sub-function module is in a fault state, corresponding fault processing operation is executed based on the fault state, a heartbeat message of an application program is received through a system monitoring module, and the application program is managed based on the heartbeat message. According to the technical scheme, the sub-function monitoring module carries out fault processing on the sub-function module in the application program, the system monitoring module manages the whole application program, and the stability and the reliability of the application service are guaranteed through monitoring and management of the two modules.
In one possible embodiment, the sub-function monitoring module comprises: the sentinel submodule and the fault processing submodule; the method comprises the following steps: determining a fault level corresponding to the fault state through the sentinel submodule based on the fault state and a preset corresponding relation between the fault state and the fault level; and determining a fault processing operation corresponding to the fault state based on the fault level through the fault processing submodule, and executing the fault processing operation.
In one possible embodiment, the fault handling sub-module includes: a subfunction restarting unit, a subfunction closing unit and a heartbeat stopping unit; determining, by the fault handling sub-module, a fault handling operation corresponding to a fault state based on the fault level, including: controlling the sub-function module to restart through the sub-function restarting unit when the fault level is a first-level fault; controlling the sub-function module to close operation when the fault level is a second-stage fault through a sub-function closing unit; and controlling the application program corresponding to the sub-function module to stop heartbeat when the fault level is a third-level fault through the heartbeat stopping unit, wherein the severity of the third-level fault is greater than that of the second fault, and the severity of the second fault is greater than that of the first fault.
In one possible embodiment, the system monitoring module comprises: the system comprises a communication sub-module, a heartbeat message monitoring sub-module and an application restarting sub-module; the method comprises the following steps: receiving heartbeat messages of the application program through the communication submodule and periodically sending the heartbeat messages to a heartbeat message monitoring submodule, monitoring the heartbeat messages periodically sent by the communication submodule through the heartbeat message monitoring submodule, and if the heartbeat messages are not monitored in a set period, determining that the heartbeat messages are lost and generating heartbeat lost messages; and receiving the heartbeat loss message through an application restarting submodule, and controlling the restarting of an application program corresponding to the heartbeat loss message.
In one possible embodiment, the system monitoring module further comprises: a resource management submodule; the method further comprises the following steps: and receiving the heartbeat message through the resource management submodule, acquiring process information included in the heartbeat message, and managing the resources corresponding to the application program based on the process information.
In one possible embodiment, the resource management submodule includes: a CPU management unit; managing the resources corresponding to the application program based on the process information, including: acquiring the CPU utilization rate corresponding to the application program based on the process information through the CPU management unit, and sending the CPU utilization rate to a log system for storage; and simultaneously reading the application program configuration file, acquiring a CPU configuration threshold corresponding to the application program from the configuration file, and controlling the CPU utilization rate corresponding to the application program to be smaller than the CPU configuration threshold.
In one possible embodiment, the resource management submodule includes: a memory management unit; managing the resources corresponding to the application program based on the process information, including: the memory management unit is used for acquiring the memory utilization rate corresponding to the application program based on the process information and sending the memory utilization rate to a log system for storage; and simultaneously reading the application program configuration file, acquiring a memory configuration threshold corresponding to the application program from the configuration file, controlling the application program to exit when the memory utilization rate corresponding to the application program is greater than the memory configuration threshold, and releasing memory resources occupied by the application program.
In one possible embodiment, the resource management submodule includes: the disk management unit manages resources corresponding to the application program based on the process information, and comprises the following steps: acquiring a disk occupation space corresponding to the application program based on the process information through the disk management unit, and sending the disk occupation space to a log system for storage; and simultaneously reading the application program configuration file, acquiring a disk space configuration threshold corresponding to the application program from the configuration file, and controlling the application program to exit and delete the content on the disk when the occupied space of the disk directory corresponding to the application program is larger than the disk space configuration threshold.
The application management method of the embodiment shown in fig. 5 can be performed by the application management apparatus, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. The electronic device may be a vehicle. Referring now specifically to fig. 6, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 600 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), a wearable terminal device, and the like, and fixed terminals such as a digital TV, a desktop computer, a smart home device, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603 to implement the application management method of the embodiments as described in the present disclosure. In the RAM 603, various programs and data necessary for the operation of the terminal apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 604. The communication means 604 may allow the terminal device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates a terminal apparatus 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart, thereby implementing the application management method as described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 604, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to carry out the method as described in any of the embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, including conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims (11)
1. An application management apparatus, wherein the application includes a plurality of sub-function modules, the apparatus comprising: a subfunction monitoring module and a system monitoring module;
the sub-function monitoring module is connected with each sub-function module and is used for monitoring the running state of each sub-function module in real time and executing corresponding fault processing operation based on the fault state when any one sub-function module is in the fault state;
the system monitoring module is connected with the application program and used for receiving heartbeat messages of the application program and managing the application program based on the heartbeat messages.
2. The apparatus of claim 1, wherein the sub-function monitoring module comprises: the sentinel submodule and the fault processing submodule;
the sentinel submodule is used for determining a fault level corresponding to the fault state based on the fault state and a preset corresponding relation between the fault state and the fault level;
and the fault processing submodule is used for determining the fault processing operation corresponding to the fault state based on the fault level and executing the fault processing operation.
3. The apparatus of claim 2, wherein the fault handling sub-module comprises: a subfunction restarting unit, a subfunction closing unit and a heartbeat stopping unit;
the sub-function restarting unit is used for controlling the sub-function module to restart when the fault level is a first-level fault;
the sub-function closing unit is used for controlling the sub-function module to close operation when the fault level is a second-level fault;
and the heartbeat stopping unit is used for controlling the application program corresponding to the sub-function module to stop heartbeat when the fault level is a third-level fault, wherein the severity of the third-level fault is greater than that of the second fault, and the severity of the second fault is greater than that of the first fault.
4. The apparatus of claim 1, wherein the system monitoring module comprises: the system comprises a communication sub-module, a heartbeat message monitoring sub-module and an application restarting sub-module;
the communication submodule is used for receiving heartbeat messages of the application program and periodically sending the heartbeat messages to the heartbeat message monitoring submodule;
the heartbeat message monitoring submodule is used for monitoring the heartbeat messages periodically sent by the communication submodule, if the heartbeat messages are not monitored in a set period, determining that the heartbeat messages are lost, and generating heartbeat loss messages;
and the application restarting submodule is used for receiving the heartbeat loss message and controlling the restarting of the application program corresponding to the heartbeat loss message.
5. The apparatus of claim 4, wherein the system monitoring module further comprises: a resource management submodule;
and the resource management submodule is used for receiving the heartbeat message, acquiring process information included in the heartbeat message, and managing the resources corresponding to the application program based on the process information.
6. The apparatus of claim 5, wherein the resource management submodule comprises: a CPU management unit;
the CPU management unit is used for acquiring the CPU utilization rate of the application program based on the process information and sending the CPU utilization rate to a log system for storage; and simultaneously reading the configuration file of the application program, acquiring a CPU configuration threshold corresponding to the application program from the configuration file, and controlling the CPU utilization rate of the application program to be smaller than the CPU configuration threshold.
7. The apparatus of claim 5, wherein the resource management submodule further comprises: a memory management unit;
the memory management unit is used for acquiring the memory utilization rate corresponding to the application program based on the process information and sending the memory utilization rate to a log system for storage; and simultaneously reading a configuration file of the application program, acquiring a memory configuration threshold corresponding to the application program from the configuration file, controlling the application program to exit when the memory utilization rate corresponding to the application program is greater than the memory configuration threshold, and releasing memory resources occupied by the application program.
8. The apparatus of claim 5, wherein the resource management submodule further comprises: a disk management unit for managing the disk of the optical disk,
the disk management unit is used for acquiring a disk occupation space corresponding to the application program based on the process information and sending the disk occupation space to a log system for storage; and simultaneously reading a configuration file of the application program, acquiring a disk space configuration threshold corresponding to the application program from the configuration file, and controlling the application program to exit and delete the content on the disk when the occupied space of the disk directory corresponding to the application program is larger than the disk space configuration threshold.
9. An application management method, wherein the application includes a plurality of sub-function modules, the method being applied to an application management apparatus including: a subfunction monitoring module and a system monitoring module; the method comprises the following steps:
monitoring the running state of each sub-function module in real time through a sub-function monitoring module, and executing corresponding fault processing operation based on the fault state when any sub-function module is in the fault state;
and receiving heartbeat messages of the application program through a system monitoring module, and managing the application program based on the heartbeat messages.
10. A vehicle, characterized in that the vehicle comprises a device according to any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method as claimed in claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210701618.5A CN115408230A (en) | 2022-06-20 | 2022-06-20 | Application management device, method, vehicle, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210701618.5A CN115408230A (en) | 2022-06-20 | 2022-06-20 | Application management device, method, vehicle, and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115408230A true CN115408230A (en) | 2022-11-29 |
Family
ID=84157267
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210701618.5A Pending CN115408230A (en) | 2022-06-20 | 2022-06-20 | Application management device, method, vehicle, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115408230A (en) |
-
2022
- 2022-06-20 CN CN202210701618.5A patent/CN115408230A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7406010B2 (en) | Baseline monitoring methods, devices, readable media, and electronic equipment | |
CN111950988A (en) | Distributed workflow scheduling method and device, storage medium and electronic equipment | |
CN112579148B (en) | Service message processing method and device based on service agent and electronic equipment | |
CN111274503B (en) | Data processing method, device, electronic equipment and computer readable medium | |
CN110881224B (en) | Network long connection method, device, equipment and storage medium | |
CN115328741A (en) | Exception handling method, device, equipment and storage medium | |
CN112463514A (en) | Monitoring method and device for distributed cache cluster | |
CN115408230A (en) | Application management device, method, vehicle, and storage medium | |
CN114095907B (en) | Bluetooth connection control method, device and equipment | |
CN115914375A (en) | Disaster tolerance processing method and device for distributed message platform | |
CN112596761B (en) | Service update release method and device and related equipment | |
CN113138883B (en) | Message processing method and device, storage medium and electronic equipment | |
CN111324386B (en) | Method and device for starting split application program, electronic equipment and storage medium | |
CN111538721A (en) | Account processing method and device, electronic equipment and computer readable storage medium | |
CN112860439A (en) | Application starting method and device, terminal and storage medium | |
CN111984496A (en) | Method, device, medium and electronic equipment for monitoring stack memory leakage | |
CN112162682A (en) | Content display method and device, electronic equipment and computer readable storage medium | |
CN106484536B (en) | IO scheduling method, device and equipment | |
CN110955583A (en) | Notification method and device, electronic equipment and storage medium | |
CN115174587B (en) | Data transmission system, method and device, computer readable storage medium and electronic equipment | |
CN114710755B (en) | Message processing method, vehicle-mounted communication device, electronic equipment and storage medium | |
CN115957515A (en) | Application monitoring method and device in android system | |
CN113467883A (en) | Container management method and device in application development and computer-readable storage medium | |
CN117032951A (en) | Memory resource manager and method based on kanzi | |
CN116489116A (en) | Message sending request processing method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |