Method and apparatus for controlling process initiation

By reading and analyzing process configuration information, abnormal processes are started and handled in order of priority, which solves the problem of low reliability of process startup in the existing technology and improves the reliability of process startup.

CN114489982BActive Publication Date: 2026-02-03BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210059423.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2026-02-03
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

Existing process management methods have low reliability in starting processes when facing complex scenarios and cannot effectively deal with the impact of abnormal processes on other processes.

Method used

By reading the process's configuration file, the startup priority, dog feed configuration, and process dependency configuration are obtained. Processes are started in priority order, and upon detecting an abnormal process, dependent processes are terminated and restarted to ensure that other processes can start normally.

Benefits of technology

It improves the reliability of process startup, effectively handles complex process startup scenarios, and ensures that other processes can run normally after an abnormal process restarts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114489982B_ABST
    Figure CN114489982B_ABST
Patent Text Reader

Abstract

The application discloses a process starting control method and device, which comprises the following steps: after detecting that a TBOX is started, reading configuration files of each process to obtain configuration information of each process; starting each process in turn according to the order from high to low of starting priority, and feeding each process into the starting parameter of each process; determining the running state of each process based on the dog feeding configuration of each process, and marking the process with an abnormal running state as an abnormal process; analyzing the process dependency configuration of the abnormal process to obtain other processes dependent on the abnormal process; ending the other processes, and restarting the other processes after restarting the abnormal process. The method can ensure that the other processes dependent on the abnormal process are ended in advance before the abnormal process is restarted, and the other processes dependent on the abnormal process are restarted after the abnormal process is restarted, so that the other processes can be normally started, thereby effectively improving the reliability of process starting.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a process starting control method and device. BACKGROUND

[0002] TBOX is one of the core devices of Internet of Vehicles, and needs to ensure that each application service in TBOX runs stably for a long time. The application services contained in TBOX mostly belong to Linux processes (referred to as processes).

[0003] The existing process management mode is mostly to directly use the service management thread of the Linux kernel to directly manage, when the mode finds that an exception occurs in a process, it only restarts the abnormal process, but ignores other processes dependent on the abnormal process, thereby affecting the start of other processes. Obviously, the existing process management mode has low reliability in the process starting process, and cannot cope with more complex process starting scenarios. SUMMARY

[0004] The present application provides a process starting control method and device, aiming to improve the reliability of process starting, so as to effectively cope with more complex process starting scenarios.

[0005] In order to achieve the above purpose, the present application provides the following technical solutions:

[0006] A process starting control method, comprising:

[0007] After detecting that the TBOX starts, reading the configuration file of each process to obtain the configuration information of each process, wherein the configuration information at least includes the starting priority, the dog feeding configuration, the starting parameter and the process dependency configuration of the process;

[0008] According to the order from high to low of the starting priority, the processes are started in turn, and the dog feeding configuration of each process is included in the starting parameter of each process;

[0009] Based on the dog feeding configuration of each process, the running state of each process is determined, and the process whose running state is abnormal is marked as an abnormal process;

[0010] The process dependency configuration of the abnormal process is parsed to obtain other processes dependent on the abnormal process;

[0011] The other processes dependent on the abnormal process are ended;

[0012] After restarting the abnormal process, the other processes dependent on the abnormal process are restarted.

[0013] Optionally, the configuration information further comprises a start interval time of the processes;

[0014] The processes are started in sequence according to the start priority from high to low, and the start time of each process is controlled, and the start interval time of each process is prolonged.

[0015] The processes are started in sequence according to the start priority from high to low, and the start time of each process is controlled, and the start interval time of each process is prolonged.

[0016] Optionally, the configuration information further comprises a group identifier of the processes;

[0017] Before the processes are started in sequence according to the start priority from high to low, the method further comprises:

[0018] According to the group identifier of each process, the group to which each process belongs is determined, and each process is allocated memory and CPU resources corresponding to the group to which the process belongs.

[0019] Optionally, the group identifier of the processes comprises at least a first group identifier, a second group identifier, a third group identifier, and a fourth group identifier.

[0020] According to the group identifier of each process, the group to which each process belongs is determined, and each process is allocated memory and CPU resources corresponding to the group to which the process belongs.

[0021] For each process, when the group identifier of the process is the first group identifier, the group to which the process belongs is determined to be the first group, wherein the first group is a group that does not limit the process to use memory and CPU resources.

[0022] When the group identifier of the process is the second group identifier, the group to which the process belongs is determined to be the second group, wherein the second group is a group that limits the process to use memory but does not limit the process to use CPU resources.

[0023] When the group identifier of the process is the third group identifier, the group to which the process belongs is determined to be the third group, wherein the third group is a group that limits the process to use memory and CPU resources.

[0024] When the group identifier of the process is the fourth group identifier, the group to which the process belongs is determined to be the fourth group, wherein the fourth group is a group that limits the process to use memory and CPU resources, and the memory corresponding to the third group and the fourth group is different, and the CPU resources corresponding to the third group and the fourth group is also different.

[0025] Optionally, the feeding dog configuration based on each process determines the running state of each process, and identifies the process with an abnormal running state as an abnormal process, comprising:

[0026] For each process, if it is detected that the process has been started, the feeding dog configuration of the process is parsed to obtain a target timestamp, wherein the target timestamp is the system running time when the process last wrote in a preset feeding dog file;

[0027] The current system running time of the TBOX is obtained, and the time difference between the target timestamp and the current system running time is calculated;

[0028] If the time difference is greater than a preset threshold, it is determined that the running state of the process is abnormal, and the process is identified as an abnormal process.

[0029] Optionally, it further comprises:

[0030] If it is detected that the process has not been started, the process is started.

[0031] Optionally, it further comprises:

[0032] If the time difference is not greater than the preset threshold, it is determined that the running state of the process is normal.

[0033] Optionally, the configuration information further comprises a process management identifier of the process; the type of the process management identifier comprises a first identifier and a third identifier; the first identifier is used to indicate a start-up period detection; and the third identifier is used to indicate a start-up non-detection.

[0034] The processes are started in turn according to the order from high to low of the start-up priority, and the feeding dog configuration of each process is included in the start-up parameter of each process, comprising:

[0035] The first process and the third process are both identified as target processes; the first process comprises a process with the process management identifier being the first identifier; and the third process comprises a process with the process management identifier being the third identifier.

[0036] The target processes are started in turn according to the order from high to low of the start-up priority, and the feeding dog configuration of each target process is included in the start-up parameter of each target process.

[0037] Optionally, the configuration information further comprises a process management identifier of the process; the type of the process management identifier comprises a first identifier, a second identifier, a third identifier and a fourth identifier; the first identifier is used to indicate a start-up period detection; the second identifier is used to indicate a start-up waiting period detection; the third identifier is used to indicate a start-up non-detection; and the fourth identifier is used to indicate a start-up non-detection.

[0038] After starting each of the processes in the order from high to low according to the start-up priority, the method further comprises:

[0039] Pre-initializing a data bus and establishing a communication connection of each of the processes;

[0040] In a case that a stop request sent by another process for the first process is received, ending the first process and changing the process management identifier of the first process to the second identifier;

[0041] In a case that a start-up request sent by another process for the second process is received, starting the second process and changing the process management identifier of the second process to the first identifier;

[0042] In a case that a start-up request sent by another process for the third process is received, starting the third process and keeping the process management identifier of the third process unchanged;

[0043] In a case that a start-up request sent by another process for the fourth process is received, starting the fourth process and keeping the process management identifier of the fourth process unchanged;

[0044] The first process comprises a process with the process management identifier being the first identifier; the second process comprises a process with the process management identifier being the second identifier; the third process comprises a process with the process management identifier being the third identifier; and the fourth process comprises a process with the process management identifier being the fourth identifier.

[0045] A control device for process start-up, comprising:

[0046] A configuration reading unit configured to read a configuration file of each process after detecting a TBOX start-up, and obtain configuration information of each of the processes, wherein the configuration information at least comprises a start-up priority of the process, a dog-feeding configuration, a start-up parameter and a process dependency configuration;

[0047] A process start-up unit configured to start each of the processes in the order from high to low according to the start-up priority, and incorporate the dog-feeding configuration of each of the processes into the start-up parameter of each of the processes;

[0048] Anomaly determining unit, configured to determine a running state of each process based on the dog-feeding configuration of each process, and identify a process with an abnormal running state as an abnormal process;

[0049] Dependency analyzing unit, configured to analyze process dependency configuration of the abnormal process to obtain other processes dependent on the abnormal process;

[0050] Process ending unit, configured to end the other processes dependent on the abnormal process;

[0051] Process restarting unit, configured to restart the other processes dependent on the abnormal process after restarting the abnormal process.

[0052] The technical scheme provided in the application comprises the following steps: after detecting that a TBOX is started, configuration files of processes are read to obtain configuration information of the processes, wherein the configuration information at least comprises a starting priority, a dog-feeding configuration, a starting parameter and process dependency configuration of each process; the processes are started in sequence according to the starting priority from high to low, and the dog-feeding configuration of each process is included in the starting parameter of each process; a running state of each process is determined based on the dog-feeding configuration of each process, and a process with an abnormal running state is identified as an abnormal process; process dependency configuration of the abnormal process is analyzed to obtain other processes dependent on the abnormal process; the other processes dependent on the abnormal process are ended; and the other processes dependent on the abnormal process are restarted after the abnormal process is restarted. The dog-feeding configuration and the process dependency configuration of the processes are used to ensure that the other processes dependent on the abnormal process are ended in advance before the abnormal process is restarted, and the other processes dependent on the abnormal process are restarted after the abnormal process is restarted, so that the other processes can be normally started, thereby effectively improving the reliability of process starting and effectively dealing with a relatively complex process starting scenario. BRIEF DESCRIPTION OF DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative effort.

[0054] Figure 1a A flowchart of a process starting control method provided by an embodiment of the present application;

[0055] Figure 1b A flowchart of a process starting control method provided by an embodiment of the present application;

[0056] Figure 1cA flowchart of another process startup control method provided by an embodiment of the present application is shown in FIG. 2.

[0057] Figure 2 A flowchart of another process startup control method provided by an embodiment of the present application is shown in FIG. 2.

[0058] Figure 3 An architecture diagram of a process startup control device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0060] As shown in FIG. 1, a flowchart of a process startup control method provided by an embodiment of the present application includes the following steps: Figure 1a Figure 1b As shown in FIG. 1, a flowchart of a process startup control method provided by an embodiment of the present application includes the following steps:

[0061] S101: Create configuration files of each process in advance.

[0062] The configuration file includes startup priority of the process, process name, startup parameter, monitoring usage name, grouping identifier, process management identifier, startup interval time, dog feeding configuration, and process dependency configuration.

[0063] The startup priority is used to indicate the startup order of the process. The higher the startup priority, the earlier the process is started.

[0064] The process name contains the file path of the process execution file and the process name, which are information items required for process startup. Of course, the process name generally needs to support a shell script (i.e., a public small program that can be used to start other processes).

[0065] The startup parameter is a parameter required for process startup, which is a well-known common knowledge for those skilled in the art.

[0066] The monitoring usage name is an alias of the process started in the shell script, i.e., used to support the process started by the shell script, that is, the monitoring usage name is an alias of the process in the calling logic when the process is called by other processes. In addition, in the case where it is determined that the process does not support the shell script startup, the monitoring usage name can be the same as the process name by default.

[0067] ​The so-called group identifier is used to indicate the group to which the process belongs. In the embodiment of the present application, the group identifier of the process at least includes a first group identifier, a second group identifier, a third group identifier and a fourth group identifier. In addition, the so-called group is a group divided for limiting the use of computing resources (i.e. memory and CPU resources), and in the embodiment of the present application, four groups are divided, which are respectively a first group, a second group, a third group and a fourth group.

[0068] The first group is a group in which the process is not limited to use memory and CPU resources. The purpose of formulating the first group is to facilitate the debugging of the process.

[0069] The second group is a group in which the process is limited to use memory, but not limited to use CPU resources. The size of the memory limited by the second group can be set by the technician according to the actual situation. The purpose of formulating the second group is to avoid the instability of the CPU resource consumption of the process. If the use of CPU resources of some processes (such as upgrade, can message processing and the like) is limited, it may have a great impact on the performance of these processes.

[0070] The third group is a group in which the process is limited to use memory and CPU resources. The size of the memory and the size of the CPU resources limited by the third group can be set by the technician according to the actual situation. The processes in the third group can be processes in the TBOX, including but not limited to network processes, power management processes and the like.

[0071] The fourth group is a group in which the process is limited to use memory and CPU resources. The processes in the fourth group can be processes integrated into the TBOX from the outside, including but not limited to application processes developed by the vehicle manufacturer, ota processes and the like.

[0072] It should be noted that the memory corresponding to the third group and the fourth group is different from each other, and the CPU resources corresponding to the third group and the fourth group are also different from each other. Specifically, the performance logic of the first group can be <Cgroup0 Nolimit / >, the performance logic of the second group can be <Cgroup1 MaxRam="30" / >, the performance logic of the third group can be <Cgroup2 MaxCpu="40" MaxRam="30" / >, and the performance logic of the fourth group can be <Cgroup3 MaxCpu="20" MaxRam="20" / >.

[0073] The so-called process management identifier is used to determine whether the process is started at boot and whether the process needs to be monitored in a loop. In the embodiment of the present application, the types of process management identifiers include a first identifier, a second identifier, a third identifier and a fourth identifier.

[0074] The first identifier is used to indicate the start-up period detection. It can be simply understood as follows: after the TBOX is started, the process is started immediately, and the subsequent period detection is performed on whether the process is normal. If it is detected that the process is abnormal, the process is restarted to ensure that the process is in a start-up state.

[0075] The second identifier is used to indicate the start-up waiting period detection. It can be simply understood as follows: after the TBOX is started, the process is not started, and the subsequent state of the process is not detected, but the process is allowed to be started in response to a process calling request. Generally, the process with the process management identifier being the second identifier can be started by being called by other processes.

[0076] The third identifier is used to indicate the start-up non-detection. It can be simply understood as follows: after the TBOX is started, the process is started immediately, and the subsequent state of the process is always not detected, but the process is allowed to be started or stopped in response to a process calling request.

[0077] The fourth identifier is used to indicate the start-up non-detection. It can be simply understood as follows: after the TBOX is started, the process is not started, and the subsequent state of the process is always not detected, but the process is allowed to be started or stopped in response to a process calling request.

[0078] The start-up interval time is counted in units of milliseconds, and is used to determine the time required for the current process to be started.

[0079] The dog feeding configuration includes a file path of a preset dog feeding file, a dog feeding time interval, and dog feeding logic. Generally, processes without long-time blocking in the business support dog feeding. If the dog feeding configuration is empty, it means that the process does not support dog feeding.

[0080] The process dependency configuration is used to indicate other processes that depend on the process, that is, to record the process names of other processes.

[0081] It should be noted that the configuration files of various processes can be seen from Table 1.

[0082] Table 1

[0083]

[0084]

[0085] The content shown in Table 1 is only used for example illustration.

[0086] S102: After detecting that the TBOX is started, a data bus (dbus) is initialized, and communication connections of various processes are established.

[0087] Part of the process calls other processes, so the dbus is initialized to enable part of the process to send requests to other processes.

[0088] S103: Read the configuration file of each process to obtain the configuration information of each process.

[0089] The configuration information includes the startup priority of the process, the process name, the startup parameter, the monitoring usage name, the group identifier, the process management identifier, the startup interval time, the dog feeding configuration, and the process dependency configuration.

[0090] S104: Determine the group to which each process belongs according to the group identifier of each process, and allocate memory and CPU resources corresponding to the group to which each process belongs to each process.

[0091] The allocation of memory and CPU resources corresponding to the group to which each process belongs to each process can realize the rational use of limited computing resources and ensure that important processes can obtain sufficient computing resources.

[0092] Optionally, the specific implementation process of determining the group to which each process belongs according to the group identifier of each process is as follows:

[0093] For each process, if the group identifier of the process is a first group identifier, the group to which the process belongs is determined to be a first group.

[0094] If the group identifier of the process is a second group identifier, the group to which the process belongs is determined to be a second group.

[0095] If the group identifier of the process is a third group identifier, the group to which the process belongs is determined to be a third group.

[0096] If the group identifier of the process is a fourth group identifier, the group to which the process belongs is determined to be a fourth group.

[0097] It should be noted that the specific form of the group identifier can be set by the technician according to the actual situation.

[0098] S105: Identify the first process and the third process as target processes.

[0099] The first process includes a process with a first process management identifier, and the third process includes a process with a third process management identifier.

[0100] S106: Start each target process in order from high to low according to the startup priority, control the startup time of each target process, extend the startup interval time of each target process, and include the dog feeding configuration of each target process in the startup parameter of each target process.

[0101] Each target process is configured with a startup interval to prevent other processes from preempting system resources and causing the process initialization to fail. If a target process is not configured with a startup interval or the configured startup interval is too small, the target process will start at 100ms by default.

[0102] In addition, the dog-feeding configuration for each target process is incorporated into the startup parameters of each target process. Specifically, assuming the startup parameter of the target process is / hirain_app / usr / bin / rild-dv, and the dog-feeding configuration of the target process is tmp / rild.dog-c 5 (tmp / rild.dog –c is the file path of the preset dog-feeding file, and 5 is the dog-feeding interval), the specific implementation of incorporating the dog-feeding configuration into the startup parameters is / hirain_app / usr / bin / rild-dvp / tmp / rild.dog-c5.

[0103] It should be noted that after the target process starts, since its startup parameters already include the dog feeding configuration, the target process will periodically write the TBOX system runtime into the dog feeding file (e.g., the / tmp / rild.dog file) according to the dog feeding interval shown in the dog feeding configuration.

[0104] S107: Determine whether the system to which TBOX belongs contains the process ID of the first process.

[0105] If the system to which TBOX belongs contains the process ID of the first process, then execute S108; otherwise, execute S115.

[0106] The process number is a number randomly generated by the system for the first process. Specifically, the process number can be set to: / proc / 1234.

[0107] Generally speaking, if the system to which the TBOX belongs contains the process ID of the first process, then the first process has been started. If the system to which the TBOX belongs does not contain the process ID of the first process, then the first process has not been started (which can also be understood as the first process having terminated).

[0108] S108: Parse the dog-feeding configuration of the first process to obtain the target timestamp.

[0109] The target timestamp includes: the system runtime last written by the first process to the preset dog-feeding file.

[0110] S109: Obtain the current system runtime of TBOX and calculate the time difference between the target timestamp and the current system runtime.

[0111] S110: Determine whether the time difference is greater than the preset threshold.

[0112] If the time difference is greater than the preset threshold, then execute S111; otherwise, execute S114.

[0113] If the time difference is greater than a preset threshold, the running state of the first process is determined to be abnormal, and S111 is executed.

[0114] S111: Identify the first process as an abnormal process, and parse the process dependency configuration of the abnormal process to obtain other processes that depend on the abnormal process.

[0115] S112: Terminate other processes that depend on the abnormal process.

[0116] S113: After restarting the abnormal process, restart other processes that depend on the abnormal process.

[0117] For example, in one embodiment, when process B depends on process A, if an anomaly is detected in process A and it needs to be restarted, process B will be terminated first, and then process A and process B will be started in sequence to ensure that the startup and running conditions of process B will not have problems.

[0118] In other words, restarting the abnormal process and then restarting other processes that depend on the abnormal process can ensure that the startup and running conditions of other processes will not be problematic, thus improving the reliability of starting other processes.

[0119] S114: Determine that the running status of the first process is normal.

[0120] S115: Start the first process.

[0121] S116: Upon receiving a stop request from another process for the first process, terminate the first process and change the process management identifier of the first process to the second identifier.

[0122] Among them, the stop request sent to the first process is a request to control the first process to stop.

[0123] S117: Upon receiving a start request from another process for the second process, start the second process and change the process management identifier of the second process to the first identifier.

[0124] The second process includes the process whose process management identifier is "second identifier". The start request sent to the second process is a request to control the start of the second process.

[0125] S118: Upon receiving a start request from another process for the third process, start the third process and keep the process management identifier of the third process unchanged.

[0126] Among them, the start request sent to the third process is a request to control the start of the third process.

[0127] Optionally, if a stop request is received from another process for the third process, the third process is terminated while keeping the process management identifier of the third process unchanged.

[0128] S119: Upon receiving a start request from another process for the fourth process, start the fourth process and keep the process management identifier of the fourth process unchanged.

[0129] The fourth process includes the process whose process management identifier is "fourth identifier". The start request sent to the fourth process is a request to control the start of the fourth process.

[0130] Optionally, if a stop request is received from another process for the fourth process, the fourth process is terminated while keeping its process management identifier unchanged.

[0131] It should be noted that the processes shown in S101-S119 above can be applied to Figure 1c The scene shown.

[0132] Specifically, with Figure 1c In the scenario shown, the method for controlling process startup includes the following steps:

[0133] 1. Initialize dbus: Initialize the data bus and establish communication connections between various processes.

[0134] 2. Read process startup configuration: After detecting that TBOX has started, read the configuration files of each process to obtain the configuration information of each process.

[0135] 3. Sort by priority: Sort the processes in descending order of startup priority.

[0136] 4. Traverse process states: Obtain the process management identifier of each process.

[0137] 5. Start unstarted processes in sequence according to configuration: Start each process in order of startup priority from high to low.

[0138] 6. Enable process monitoring: Incorporate the dog-feeding configuration for each process into the startup parameters of each process.

[0139] 7. Process termination: Check if a process has started.

[0140] 8. Process feeding anomaly: Based on the feeding configuration of each process, determine the running status of each process, and mark the processes with abnormal running status as abnormal processes.

[0141] 9. Terminate services that depend on the abnormal process: terminate other processes that depend on the abnormal process; restart other processes that depend on the abnormal process after restarting the abnormal process.

[0142] In summary, by utilizing process feeding and process dependency configurations, we can ensure that other processes that depend on the abnormal process are terminated before restarting the abnormal process, and that other processes that depend on the abnormal process are restarted after restarting the abnormal process, so that other processes can start normally. This effectively improves the reliability of process startup and can effectively cope with more complex process startup scenarios.

[0143] It should be noted that S101 mentioned in the above embodiments is an optional implementation of the process startup control method described in this application. Furthermore, S119 mentioned in the above embodiments is also an optional implementation of the process startup control method described in this application. Therefore, the process mentioned in the above embodiments can be summarized as follows: Figure 2 The method shown.

[0144] like Figure 2 The diagram shown is a flowchart illustrating another process startup control method provided in this application embodiment, including the following steps:

[0145] S201: After detecting that TBOX has started, read the configuration files of each process to obtain the configuration information of each process.

[0146] The configuration information includes at least the process startup priority, dog feeding configuration, startup parameters, and process dependency configuration.

[0147] S202: Start each process in descending order of startup priority, and incorporate the dog-feeding configuration of each process into the startup parameters of each process.

[0148] S203: Based on the dog-feeding configuration of each process, determine the running status of each process, and mark the processes with abnormal running status as abnormal processes.

[0149] S204: Parse the process dependency configuration of the abnormal process to obtain other processes that depend on the abnormal process.

[0150] S205: Terminate other processes that depend on the abnormal process.

[0151] S206: After restarting the abnormal process, restart other processes that depend on the abnormal process.

[0152] In summary, by utilizing process feeding and process dependency configurations, we can ensure that other processes that depend on the abnormal process are terminated before restarting the abnormal process, and that other processes that depend on the abnormal process are restarted after restarting the abnormal process, so that other processes can start normally. This effectively improves the reliability of process startup and can effectively cope with more complex process startup scenarios.

[0153] Corresponding to the process startup control method provided in the above embodiments of this application, the embodiments of this application also provide a process startup control device.

[0154] like Figure 3 The diagram shown is an architectural schematic of a process startup control device provided in an embodiment of this application, comprising:

[0155] The configuration reading unit 100 is used to read the configuration files of each process after the TBOX is detected to start, and obtain the configuration information of each process. The configuration information includes at least the process startup priority, dog feeding configuration, startup parameters, and process dependency configuration.

[0156] The configuration information also includes the process startup interval, group identifier, and process management identifier. The process management identifier includes a first identifier, a second identifier, a third identifier, and a fourth identifier; the first identifier is used to indicate the boot startup cycle detection; the second identifier is used to indicate the boot non-startup wait cycle detection; the third identifier is used to indicate that boot startup is not detected; and the fourth identifier is used to indicate that boot non-startup is not detected.

[0157] Resource allocation unit 200 is used to determine the group to which each process belongs based on the group identifier of each process, and to allocate memory and CPU resources to each process corresponding to its own group.

[0158] The process group identifiers include at least a first group identifier, a second group identifier, a third group identifier, and a fourth group identifier.

[0159] The resource allocation unit 200 is specifically used for: for each process, determining the process's group as the first group when the process's group identifier is the first group identifier, wherein the first group is a group that does not restrict the process's use of memory and CPU resources; determining the process's group as the second group when the process's group identifier is the second group identifier, wherein the second group is a group that restricts the memory used by the process but does not restrict the process's use of CPU resources; determining the process's group as the third group when the process's group identifier is the third group identifier, wherein the third group is a group that restricts the memory and CPU resources used by the process; determining the process's group as the fourth group when the process's group identifier is the fourth group, wherein the fourth group is a group that restricts the memory and CPU resources used by the process, wherein the memory corresponding to the third group and the fourth group are different from each other, and the CPU resources corresponding to each group are also different from each other.

[0160] Initialization unit 300 is used to pre-initialize the data bus and establish communication connections between various processes.

[0161] The process startup unit 400 is used to start each process in descending order of startup priority, and to incorporate the dog-feeding configuration of each process into the startup parameters of each process.

[0162] Specifically, the process startup unit 400 is used to: start each process in order of startup priority from high to low, control the startup time of each process, and extend the startup interval of each process.

[0163] The exception determination unit 500 is used to determine the running status of each process based on the dog-feeding configuration of each process, and to mark the processes with an abnormal running status as abnormal processes.

[0164] Specifically, the anomaly determination unit 500 is used to: for each process, when it is detected that the process has started, parse the process's dog-feeding configuration to obtain the target timestamp, where the target timestamp is the system running time last written by the process in the preset dog-feeding file; obtain the current system running time of TBOX and calculate the time difference between the target timestamp and the current system running time; if the time difference is greater than a preset threshold, determine that the running state of the process is abnormal and mark the process as an abnormal process.

[0165] The exception determination unit 500 is also used to: start the process if it is detected that the process has not yet started.

[0166] The anomaly determination unit 500 is also used to determine the running status of the process as normal when the time difference is not greater than a preset threshold.

[0167] The dependency analysis unit 600 is used to parse the process dependency configuration of the abnormal process and obtain other processes that depend on the abnormal process.

[0168] Process termination unit 700 is used to terminate other processes that depend on the abnormal process.

[0169] The process restart unit 800 is used to restart other processes that depend on the abnormal process after restarting the abnormal process.

[0170] The process control unit 900 is configured to: terminate the first process and change its process management identifier to a second identifier upon receiving a stop request from another process for the first process; start the second process and change its process management identifier to the first identifier upon receiving a start request from another process for the second process; start the third process and keep its process management identifier unchanged upon receiving a start request from another process for the third process; and start the fourth process and keep its process management identifier unchanged upon receiving a start request from another process for the fourth process. The first process includes a process with the first identifier; the second process includes a process with the second identifier; the third process includes a process with the third identifier; and the fourth process includes a process with the fourth identifier.

[0171] In summary, by utilizing process feeding and process dependency configurations, we can ensure that other processes that depend on the abnormal process are terminated before restarting the abnormal process, and that other processes that depend on the abnormal process are restarted after restarting the abnormal process, so that other processes can start normally. This effectively improves the reliability of process startup and can effectively cope with more complex process startup scenarios.

[0172] If the functions described in the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computing device readable storage medium. Based on this understanding, the parts of the embodiments of this application that contribute to the prior art or the technical solutions can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computing device (which may be a personal computer, server, mobile computing device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0173] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0174] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for controlling process startup, characterized in that, include: After the TBOX is detected to be starting, the configuration files of each process are read to obtain the configuration information of each process. The configuration information includes at least the process's startup priority, dog-feeding configuration, startup parameters, and process dependency configuration. According to the startup priority from high to low, each process is started sequentially, and the dog-feeding configuration of each process is included in the startup parameters of each process; Based on the watchdog configuration of each process, the running status of each process is determined, and processes with abnormal running status are identified as abnormal processes. The process of determining abnormal processes is as follows: For each process, when it is detected that the process has started, the watchdog configuration of the process is parsed to obtain a target timestamp, wherein the target timestamp is the system running time last written by the process in the preset watchdog file; the current system running time of the TBOX is obtained, and the time difference between the target timestamp and the current system running time is calculated; if the time difference is greater than a preset threshold, the running status of the process is determined to be abnormal, and the process is identified as an abnormal process. Parse the process dependency configuration of the abnormal process to obtain other processes that depend on the abnormal process; Terminate other processes that depend on the abnormal process; After restarting the abnormal process, restart other processes that depend on the abnormal process.

2. The method according to claim 1, characterized in that, The configuration information also includes the process startup interval; The step of starting each process sequentially according to its startup priority from high to low includes: The processes are started sequentially according to their startup priority from high to low, and the startup time of each process is controlled to extend the startup interval of each process.

3. The method according to claim 1, characterized in that, The configuration information also includes the group identifier of the process; Before starting each process sequentially according to its startup priority from high to low, the method further includes: Based on the group identifier of each process, the group to which each process belongs is determined, and memory and CPU resources corresponding to the group to which each process belongs are allocated to each process.

4. The method according to claim 3, characterized in that, The group identifier of the process includes at least a first group identifier, a second group identifier, a third group identifier, and a fourth group identifier; The step of determining the group to which each process belongs based on its group identifier includes: For each process, the group to which the process belongs is determined to be the first group, where the group identifier of the process is the first group identifier, and the first group is a group that does not restrict the process from using memory and CPU resources; If the group identifier of the process is the second group identifier, the group to which the process belongs is determined to be the second group, wherein the second group is a group that restricts the memory used by the process but does not restrict the CPU resources used by the process; If the group identifier of the process is a third group identifier, the group to which the process belongs is determined to be the third group, wherein the third group is a group that restricts the memory and CPU resources used by the process; The process is identified as a fourth group identifier, and the group to which the process belongs is determined to be the fourth group. The fourth group is a group that restricts the memory and CPU resources used by the process. The memory and CPU resources corresponding to the third group and the fourth group are different from each other.

5. The method according to claim 1, characterized in that, Also includes: If the process is not yet started, start the process.

6. The method according to claim 1, characterized in that, Also includes: If the time difference is not greater than the preset threshold, the running state of the process is determined to be normal operation.

7. The method according to claim 1, characterized in that, The configuration information also includes a process management identifier for the process; the process management identifier includes a first identifier and a third identifier; the first identifier is used to indicate boot cycle detection; the third identifier is used to indicate boot cycle non-detection; The process is started sequentially according to its startup priority from high to low, and the dog-feeding configuration of each process is incorporated into the startup parameters of each process, including: Both the first process and the third process are identified as target processes; the first process includes the process identified by the process management system as the first identifier; the third process includes the process identified by the process management system as the third identifier; According to the order of startup priority from high to low, each of the target processes is started sequentially, and the dog-feeding configuration of each target process is included in the startup parameters of each target process.

8. The method according to claim 1, characterized in that, The configuration information also includes a process management identifier for the process; the process management identifier includes a first identifier, a second identifier, a third identifier, and a fourth identifier; the first identifier is used to indicate a boot-up cycle detection; the second identifier is used to indicate a boot-up non-boot waiting cycle detection; the third identifier is used to indicate no boot-up detection; and the fourth identifier is used to indicate no boot-up detection. After starting each process sequentially according to its startup priority from high to low, the method further includes: The data bus is pre-initialized, and communication connections are established for each of the processes. Upon receiving a stop request from another process for the first process, terminate the first process and change the process management identifier of the first process to the second identifier; Upon receiving a start request from another process for the second process, start the second process and change the process management identifier of the second process to the first identifier; Upon receiving a start request from another process for the third process, start the third process while keeping its process management identifier unchanged; Upon receiving a start request from another process for the fourth process, start the fourth process while keeping its process management identifier unchanged; The first process includes the process whose process management identifier is the first identifier; the second process includes the process whose process management identifier is the second identifier; the third process includes the process whose process management identifier is the third identifier; and the fourth process includes the process whose process management identifier is the fourth identifier.

9. A process initiation control device, characterized in that, include: The configuration reading unit is used to read the configuration files of each process after the TBOX is detected to start, and obtain the configuration information of each process. The configuration information includes at least the startup priority, dog-feeding configuration, startup parameters, and process dependency configuration of the process. The process startup unit is used to start each process sequentially according to the startup priority from high to low, and to incorporate the dog-feeding configuration of each process into the startup parameters of each process. An anomaly determination unit is used to determine the running status of each process based on the watchdog configuration of each process, and to identify processes with an abnormal running status as abnormal processes. The process of determining abnormal processes is as follows: for each process, when it is detected that the process has started, the watchdog configuration of the process is parsed to obtain a target timestamp, wherein the target timestamp is the system running time last written by the process in a preset watchdog file; the current system running time of the TBOX is obtained, and the time difference between the target timestamp and the current system running time is calculated; if the time difference is greater than a preset threshold, the running status of the process is determined to be abnormal, and the process is identified as an abnormal process. The dependency analysis unit is used to parse the process dependency configuration of the abnormal process and obtain other processes that depend on the abnormal process. A process termination unit is used to terminate other processes that depend on the abnormal process. The process restart unit is used to restart other processes that depend on the abnormal process after restarting the abnormal process.

Citation Information

Patent Citations

  • Monitoring method and watchdog module for car body control system

    CN104142869A

  • Application priority management method, device and system, and storage medium

    CN107589994A