Method and device for monitoring process state, electronic equipment and storage medium

By collecting and parsing process startup step information, the problem of difficulty in monitoring the process startup status in the existing technology is solved, efficient acquisition and unified monitoring of process startup status is achieved, and the security and stability of the system are improved.

CN119883792APending Publication Date: 2025-04-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411761797.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-25

Smart Images

  • Figure CN119883792A_ABST
    Figure CN119883792A_ABST
Patent Text Reader

Abstract

The invention discloses a process state monitoring method and device, electronic equipment and a readable storage medium. The method comprises the steps that starting step information of all processes in a software system is collected; writing execution information of each starting step corresponding to each process into a starting state file according to a fixed format; the starting state file comprises at least one starting state sub-file; each process corresponds to one starting state sub-file; analyzing each starting state sub-file, and determining a starting state corresponding to each process; and summarizing the starting state corresponding to each process, and determining the overall running condition of the software system. The execution information of the starting step of the process is stored in the starting state file according to the fixed format, the starting state of the process is obtained from the starting state file, the starting states of different processes are monitored in a unified mode, and the obtaining efficiency of the starting state of the process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for monitoring process status. Background Art

[0002] A process is an instance of computer application software running. Monitoring and managing process status is an important aspect of computer software management.

[0003] In the prior art, the status of a process can be obtained through the process itself. When the process starts normally, the normal status of the process startup can be confirmed through the interface provided by the process; however, when the process startup status is abnormal, it may be due to the failure of the process startup or the blocking of the process startup step, resulting in the inability to obtain the startup status of the process through the process itself, such as calling the process network interface, querying the process system status, etc. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and readable storage medium for monitoring the startup status of a process, which can improve the efficiency of obtaining the startup status of a process.

[0005] In a first aspect, an embodiment of the present application discloses a method for monitoring a process status, the method comprising:

[0006] Collecting startup step information of each process in the software system; the startup step information includes at least one startup step of the process;

[0007] Writing the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile;

[0008] Parsing each of the startup status subfiles to determine the startup status corresponding to each process;

[0009] The startup status corresponding to each process is summarized to determine the overall operation status of the software system.

[0010] Optionally, the execution information of each startup step corresponding to each process is written into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile, including:

[0011] Converting the execution information of each of the startup steps corresponding to each process into a record in a fixed format;

[0012] Append each record to the startup status subfile corresponding to each process; one record for each startup step.

[0013] Optionally, parsing each of the startup status subfiles to determine the startup status corresponding to each process includes:

[0014] Sequentially parsing the contents stored in the fixed format in each of the startup status sub-files to determine the execution status of each of the startup steps;

[0015] When all the startup steps are successfully executed, determining that the process is successfully started;

[0016] In the case where at least one of the startup steps fails to be executed, it is determined that the process startup fails.

[0017] Optionally, the step of sequentially parsing the contents stored in the fixed format in each of the startup status sub-files to determine the execution status of each of the startup steps includes:

[0018] Determine the first startup step corresponding to each record according to the content stored in the first field of each record in the startup status subfile;

[0019] The content stored in the second field of each record is identified to determine the execution status of the first starting step.

[0020] Optionally, the method further comprises:

[0021] In a case where the execution status of the first startup step is failure, determining the exception type corresponding to the failure of execution of the first startup step according to the content stored in the third field of each record;

[0022] According to the content stored in the fourth field of each record, the abnormal information corresponding to the failure of executing the first starting step is determined.

[0023] Optionally, writing the execution information of each startup step corresponding to each process into the startup status file in a fixed format includes:

[0024] When each of the startup steps is successfully executed, the identifier and execution status corresponding to each of the startup steps are written into the startup status file according to the first fixed format;

[0025] When an exception occurs during the execution of each of the startup steps, the identifier, execution status, exception type, and exception information corresponding to each of the startup steps are written into the startup status file in a second fixed format.

[0026] Optionally, the summarizing the startup status corresponding to each process to determine the overall operation status of the software system includes:

[0027] When at least one process fails to start in the startup states corresponding to the processes, it is determined that the overall operation of the software system is abnormal.

[0028] In a second aspect, an embodiment of the present application discloses a device for monitoring process status, the device comprising:

[0029] A collection module, used to collect startup step information of each process in the software system; the startup step information includes at least one startup step of the process;

[0030] An output module, used for writing the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile;

[0031] A parsing module, used to parse each of the startup status sub-files to determine the startup status corresponding to each process;

[0032] The summary module summarizes the startup status corresponding to each process to determine the overall operation status of the software system.

[0033] In a third aspect, an embodiment of the present application discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned method for monitoring process status.

[0034] In a fourth aspect, an embodiment of the present application discloses a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the aforementioned method for monitoring process status is implemented.

[0035] The embodiments of the present application include the following advantages:

[0036] Collect the startup step information of each process in the software system; the startup step information includes at least one startup step of the process; write the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status sub-file; each process corresponds to a startup status sub-file; parse each startup status sub-file to determine the startup status corresponding to each process; summarize the startup status corresponding to each process to determine the overall operation status of the software system, be able to obtain the startup status of the process from the startup status file, and realize unified monitoring of the startup status of different processes, thereby improving the efficiency of obtaining the startup status of the process. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0038] Figure 1 is a flowchart of a method for monitoring process status according to an embodiment of the present invention;

[0039] Figure 2 It is a schematic diagram of monitoring three process states in the same software system of the present invention;

[0040] Figure 3 It is a structural block diagram of a device for monitoring process status of the present invention;

[0041] Figure 4 It is a structural block diagram of an electronic device provided by an example of the present invention. DETAILED DESCRIPTION

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

[0043] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0044] Method Embodiment

[0045] Reference Figure 1 , shows a flowchart of a method for monitoring the startup status of a process according to an embodiment of the present invention, the method comprising:

[0046] Step S101, collecting startup step information of each process in the software system; the startup step information includes at least one startup step of the process.

[0047] The method for monitoring process status proposed in the embodiment of the present application can be applied to the field of system security monitoring, software development and testing. Malware often performs malicious operations on the system by starting illegal processes. By monitoring the process startup status, the security system can promptly detect and block malicious processes, thereby protecting the system from attacks. In the process of developing software, automated testing tools need to monitor the process startup status of the program under test to ensure the correctness and stability of the test environment; developers can also evaluate the performance of the application by monitoring the process startup status. If a process starts slowly or takes up too many resources, developers can optimize these problems to improve the response speed and overall performance of the application.

[0048] It should be noted that the startup step information refers to the relevant information in which the operating system creates, initializes and runs a process. A script or program is added to the process to be monitored to monitor and record the startup step information. The script or program runs automatically when the process starts, and can capture the start and end time of each startup step in the process of process startup, the execution status of the startup step, and any detailed information related to the startup step. Exemplarily, an exception capture module can be built into the process to be monitored, and the exception type is pre-set in the exception capture module. When a pre-set exception is triggered during the execution of the startup step, the execution process of each startup step is captured.

[0049] The startup steps may include hardware self-check, loading the operating system kernel, starting system services, running user-level applications, etc. Different processes include different startup steps. Exemplarily, the startup process of a process may include the following steps:

[0050] Step 11: Create a process object for the process to be started and allocate system resources to the process, such as memory space, file descriptors, etc.

[0051] Step 12: Load the executable file into the address space of the process.

[0052] Step 13: Set the initial environment of the process, such as working directory, environment variables, file descriptor table, etc.

[0053] Step 14. Create a main thread for the process to execute the program.

[0054] Step 15: The main thread starts executing the program. During the execution, other threads can be created to perform concurrent tasks.

[0055] Step 16: When the program starts, it calls specific runtime library functions to perform initialization, such as setting global variables, initializing the heap and stack, loading dynamic link libraries, etc.

[0056] Step 17: After completing all initialization work, the program enters its main part and begins execution. The execution process includes processing user input, performing computing tasks, and interacting with the operating system or other programs.

[0057] Step S102: Write the execution information of each startup step corresponding to each process into a startup status file in a fixed format.

[0058] The startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile. The startup status file can be a text file or a record in a database. The startup status file is updated regularly or in real time according to actual needs. During the process startup, as each startup step is executed, new startup step information is continuously appended to the file.

[0059] It should be noted that the startup status file refers to the collection of startup status subfiles in the same directory, and each startup status subfile is in the same storage area. During the startup of each process, the execution information of each startup step in the process of process startup is collected by the status collection module, and the startup step information is output to the corresponding startup status subfile in the form of a file stream. According to the process identifier (PID) and the name of the startup status subfile, a mapping relationship between the process and the startup status subfile is established.

[0060] Among them, the execution information of the startup step may include: the startup step name, the startup step execution time, the startup step execution status, the exception type, the exception information, etc. Among them, the startup step execution time may include: the startup step start time, the startup step end time.

[0061] According to actual needs, a fixed format for storing the execution information of the startup steps is defined to accommodate detailed information corresponding to different startup steps. Specifically, the fixed format can adopt JSON (JavaScript Object Notation) format and Extensible Markup Language (XML) format. Among them, the JSON format specifically includes two data structures: object and array. An object is an unordered collection composed of key-value pairs, the key is a string, and the value can be any data type. An array can be used to store the startup step information of each process, and each array element corresponds to the execution information of a startup step.

[0062] Step S103: parse each of the startup status subfiles to determine the startup status corresponding to each process.

[0063] Among them, when parsing each startup status subfile, it is necessary to clarify the format of the startup status subfile and call the corresponding library function to read the file content. Parse each line of data in the file into a dictionary or object, where the key is the field name and the value is the corresponding data. For each line of data, parse the value of each field, and convert the value of the field into the appropriate data type as needed, and store the parsed process name and the startup status information corresponding to the process in a structured data for subsequent query and display. Structured data can store the startup status of each process and any related information, such as: the startup time of the process, the duration, and the error message during the process startup process. Exemplarily, structured data can be a dictionary, a list, or a database. According to actual needs, we can output the parsing results to the console, write to another file, or provide them to other systems through an interface.

[0064] Step S104: Summarize the startup status corresponding to each process to determine the overall operation status of the software system.

[0065] After summarizing the status of all processes, the overall operation of the software system is analyzed, which may include: checking the processes that have been successfully started, determining the processes that have failed to start, and checking the error messages or logs corresponding to the processes that have failed to start to determine the cause of the failure; and analyzing the dependencies between the various processes to determine whether the failure of a process will affect the stability of other processes or the entire system. If the failed process is a key component in the software system and other processes are highly dependent on it, it is determined that the overall operation of the software system has been abnormal; if the failed process is optional or has an alternative, it is determined that the overall operation of the software system is normal.

[0066] For example, Figure 2 As shown, the monitoring party monitors the startup status of three processes in the software system. During the startup of the three processes to be monitored, the state collection module is responsible for collecting the startup step information during the process startup process. The state output module is responsible for outputting the startup step information, and the fixed format startup step information corresponding to the three processes to be monitored is written into the same process startup file. The monitoring party reads the startup step information of the three processes to be monitored from the process startup file through the state identification module. Among them, the monitoring party can be any process, software system, monitoring tool, or electronic device that wants to obtain the process startup step information. The monitoring party can be on the same electronic device as the process to be monitored, or it can be on a different electronic device than the process to be monitored.

[0067] In an embodiment of the present application, the startup step information of each process in the software system is collected; the startup step information includes at least one startup step of the process; the execution information of each startup step corresponding to each process is written into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile; each startup status subfile is parsed to determine the startup status corresponding to each process; the startup status corresponding to each process is summarized to determine the overall operation status of the software system. By saving the startup step information of the process in a fixed format in the startup status file, obtaining the startup status of the process from the startup status file, and realizing unified monitoring of the startup status of different processes, the efficiency of obtaining the startup status of the process is improved.

[0068] Optionally, the execution information of each startup step corresponding to each process is written into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile, including:

[0069] Step 21: converting the execution information of each of the startup steps corresponding to each process into a record in a fixed format;

[0070] Step 22: append each record to the corresponding startup status subfile; each startup step corresponds to a row of records.

[0071] It should be noted that the fixed format may be a comma-separated values ​​(CSV) format, and the fixed format structure may specifically include the following fields: a timestamp field for storing the timestamp of the startup step execution; an identifier field for storing the unique identifier of the startup step, which may be a number or a short string; a name field for storing a descriptive name for the startup step; a status field for storing the execution status of the startup step, such as Success, Failure, Skipped, Running, etc.; a duration field for storing the duration of the startup step execution in milliseconds. If the step has not been completed, the duration field may be an empty field or set to a special value (such as -1); a message field for storing a detailed message or error description about the execution of the startup step. For a successful step, the message field may be an empty string or a confirmation message represented by a special value; for a failed step, the message field contains an error code and / or an error description.

[0072] Among them, the data type corresponding to the timestamp field is a string, in the format of YYYY-MM-DDHH:MM:SS (year-month-day hour: minute: second), for example: 2024-11-18 15:45:00. The timestamp can be accurate to seconds and should be the world coordinated time or the local time of the software system. The data type corresponding to the identifier field can be an integer or a string, for example: 1, Step001, where the identifier field should remain unique throughout the entire startup process of the process to facilitate identification and tracking of steps. The data type corresponding to the name field is a string, for example: LoadKernel, InitFilesystem; the data type of the status field is a string, which can be: Success, Failure, where Success means that the startup step is executed successfully, and Failure means that the startup step fails to execute. The duration field indicates the duration of the step execution in milliseconds, and the corresponding data type is an integer, for example: 500 (representing 500 milliseconds). The duration field can use a special value: -1, indicating that the startup step has not been completed or the duration is unknown. The data type of the message field is string, for example: Servicenetworkfailedtostart:Configuration error.

[0073] In the startup status subfile, each line represents the execution information of a startup step. Columns in the same line are separated by commas, and there is no comma after the last field in each line.

[0074] It should be noted that before appending each record to the corresponding startup status subfile, it is necessary to determine whether the startup status subfile corresponding to the process exists. Specifically, the name of each startup status subfile in the startup status file is traversed. If the startup status subfile does not exist, create the startup status subfile corresponding to the process; if the startup status subfile already exists, append the new record to the end of the startup status subfile.

[0075] Appending means adding a new record at the end of the startup status subfile without deleting, replacing or modifying the content in the startup status subfile.

[0076] In an embodiment of the present application, by converting the execution information of each startup step corresponding to each process into a unified fixed format and using the same parsing method for the unified fixed format, the startup step information of different processes can be obtained, thereby achieving unified monitoring of different processes; each record is appended to the corresponding startup status subfile without affecting the original content of the startup status subfile.

[0077] Optionally, parsing each of the startup status subfiles to determine the startup status corresponding to each process includes:

[0078] Step 31, parsing the contents stored in the fixed format in each of the startup status sub-files in turn to determine the execution status of each of the startup steps;

[0079] Step 32: If all the startup steps are successfully executed, determine that the process is successfully started;

[0080] Step 33: When at least one of the startup steps fails to execute, determine that the process startup fails.

[0081] The execution information of each startup step stored in the startup status subfile is parsed in sequence to obtain the execution status of each startup step, and the startup status of the process is determined according to the execution status of each startup step.

[0082] For example, the startup status subfile A.setup corresponding to process A includes three records, the first record is: [step1]-[success], the second record is: [step2]-[success], and the third record is: [step3]-[fail]-[netWork]-[connection failed]. Each line of records stores the execution information of a startup step. According to the mapping relationship between each field and the execution information of the startup step, each line of records is parsed in turn. Among them, the first record indicates that step1 is executed successfully, the second record indicates that step2 is executed successfully, and the third record indicates that step3 fails to execute. Since one of the three startup steps fails to execute, it is determined that process A fails to start.

[0083] The startup status subfile corresponding to process B is B.setup, which includes two records. The first record is: [step1]-[success], and the second record is: [step2]-[success]. After parsing each record in turn, according to the parsing results, it can be known that step1 is executed successfully and step2 is executed successfully. Since both step1 and step2 are executed successfully, it is determined that process B is started successfully.

[0084] In the embodiment of the present application, the contents stored in a fixed format in each startup status subfile are parsed in sequence to determine the execution status of each startup step; if all startup steps are successfully executed, the process startup is determined to be successful; if at least one startup step in each startup step fails to execute, the process startup is determined to be unsuccessful. Regardless of whether the process itself is successfully or unsuccessfully started, the startup status information of the process can be obtained, thereby improving the efficiency of obtaining the startup status information of the process.

[0085] Optionally, the step of sequentially parsing the contents stored in the fixed format in each of the startup status sub-files to determine the execution status of each of the startup steps includes:

[0086] Step 41, determining the first startup step corresponding to each record in the startup status subfile according to the content stored in the first field of each record;

[0087] Step 42: Identify the content stored in the second field of each record and determine the execution status of the first startup step.

[0088] In an embodiment of the present application, each record includes at least two fields, and the first field is used to save the name or identifier of the startup step, and establish a mapping relationship between the name, identifier and startup step. The second field is used to save the execution status of the startup step, wherein the execution status of the startup step includes at least two types: successful execution and failed execution. The value of the second field can use a string or integer data type to represent the two execution states of the startup state. When the value is an integer, 0 and 1 can be used to represent success and failure respectively; when the value is a string, success and failed can be used to represent success and failure respectively.

[0089] Use the file reading function to open the startup status subfile and read the records line by line; for each record, use the string segmentation method to split it into fields. According to the mapping relationship between the name, identifier and startup step, determine the startup step corresponding to the name or identifier. Read the value of the second field to determine the execution status of the first startup step, and determine the execution status of the startup step according to the corresponding relationship between the value of the second field and the execution status.

[0090] For example, the name of the startup status subfile corresponding to process A is A.setup, and A.setup includes two records, the first record is: [step1]-[success], and the second record is: [step2]-[fail]. Each record includes at least two fields, the first field is used to indicate the startup step, and the second field is used to indicate the execution status of the startup step. The first record indicates that the startup step with identifier 1 is executed successfully; the second record indicates that the startup step with identifier 2 fails to execute.

[0091] In the embodiment of the present application, the first startup step corresponding to each record is determined according to the content stored in the first field of each record in the startup status subfile; the content stored in the second field of each record is identified to determine the execution status of the first startup step. By using a fixed format of two fields to store the execution information of each startup step, unified monitoring of the startup status of different processes is achieved.

[0092] Optionally, the method further comprises:

[0093] Step 51: when the execution status of the first startup step is failure, determine the exception type corresponding to the failure of the execution of the first startup step according to the content stored in the third field of each record;

[0094] Step 52: Determine the exception information corresponding to the failure of executing the first startup step according to the content stored in the fourth field of each record.

[0095] Among them, the exception types may include: file or resource access exceptions, memory allocation exceptions, dependent services not started, network connection exceptions, configuration errors, hardware failures, and operating system limitations.

[0096] It should be noted that each record in the embodiment of the present application includes at least four fields, [stepID]-[status]-[error type]-[error message], where the first field is used to save the name or identifier of the startup step, the second field is used to save the execution status of the startup step, the third field is used to save the exception type when an exception occurs in the startup step, and the fourth field is used to save the exception information, where the exception information can explain the specific cause of the exception.

[0097] Exemplarily, the startup status subfile A.setup corresponding to process A includes three records, the first record is: [step1]-[success], the second record is: [step2]-[success], and the third record is: [step3]-[fail]-[netWork]-[connection failed]. The records in the startup status subfile A.setup are parsed line by line. The startup step with identifier 1 in the first record has a corresponding status of success, indicating that the startup step with identifier 1 is successfully executed; the startup step with identifier 2 in the second record has a corresponding status of success, indicating that the startup step with identifier 2 is successfully executed; the first two fields in the third record are parsed to determine that the startup step with identifier 3 has a status of fail; the last two fields in the third record are parsed in turn to determine that the startup step with identifier 3 fails to execute, the exception type is a network exception, and the exception information is a connection failure.

[0098] In an embodiment of the present application, when the execution status of the first startup step is failure, the exception type corresponding to the failure to execute the first startup step is determined according to the content stored in the third field of each record; the exception information corresponding to the failure to execute the first startup step is determined according to the content stored in the fourth field of each record, so as to facilitate the processing of the exception according to the type and information.

[0099] Optionally, writing the execution information of each startup step corresponding to each process into the startup status file in a fixed format includes:

[0100] Step 61: When each of the startup steps is successfully executed, write the identifier and execution status corresponding to each of the startup steps into a startup status file according to a first fixed format;

[0101] Step 62: When an exception occurs during the execution of each of the startup steps, the identifier, execution status, exception type, and exception information corresponding to each of the startup steps are written into the startup status file in a second fixed format.

[0102] Among them, the fixed formats used when the startup step is executed successfully and when it fails are different. When the startup step is executed successfully, two fields are used to represent the name or identifier of the startup step and the execution status of the startup step; when the startup step fails, two fields are used to represent the name or identifier of the startup step, the execution status of the startup step, the exception type, and the exception information. The execution status of the corresponding startup step is determined according to the first two fields. When the execution status is a failure, two fields are expanded on the basis of the first two fields to respectively save the exception type and exception information of the failure to execute the startup step. Exemplarily, when the startup step is executed successfully, the first fixed format is [stepID]-[status], and when the startup step fails, the second fixed format is [stepID]-[status]-[error type]-[error message].

[0103] In the embodiment of the present application, when each startup step is successfully executed, the identifier and execution status corresponding to each startup step are written into the startup status file in accordance with the first fixed format; when an exception occurs during the execution of each startup step, the identifier, execution status, exception type, and exception information corresponding to each startup step are written into the startup status file in accordance with the second fixed format. Different fixed formats are used to adapt startup steps with different execution statuses, which can save memory space.

[0104] Optionally, the summarizing the startup status corresponding to each process to determine the overall operation status of the software system includes:

[0105] When at least one process fails to start in the startup states corresponding to the processes, it is determined that the overall operation of the software system is abnormal.

[0106] Among them, the software system is usually composed of multiple processes, and multiple processes work together to realize various functions of the software. The startup status of each process is crucial to the overall operation of the software system. If at least one process fails to start, the function undertaken by the process will not be able to operate normally. Since the software system is a whole, the failure of any part may affect the stability and functional integrity of the entire system. Under normal circumstances, the software system expects all processes to start successfully and operate normally. When at least one process fails to start, it is judged that the overall operation of the software system has an abnormality.

[0107] For example, suppose there are two processes A and B in a software system, and both processes need to be started successfully to be considered successful. The startup steps of process A are divided into step1, step2, and step3. The execution information of the three startup steps is collected as follows: step1 is executed successfully, step2 is executed successfully, step3 is executed failed, the exception type is network, and the exception information is network connection failure; the execution information of each startup step is converted into a fixed format, the execution status field corresponding to step1 is success, the execution status field corresponding to step2 is success, the execution status field corresponding to step3 is fail, the exception type field is network, and the exception information field is connection failed. The startup status subfile A.setup corresponding to process A is appended with three records: [step1]-[success], [step2]-[success], [step3]-[fail]-[netWork]-[connection failed]. The process B startup steps are divided into step 1. The execution information collected for step 1 indicates that step 1 is successfully executed, and its corresponding status is success. The status output module appends the following to the B process startup status file B.setup: [step1]-[success]

[0108] By reading the startup status subfile A.setup and reading the above three records in sequence, it can be known that process A failed to start in step 3 due to abnormal network connection. This monitoring process does not depend on whether process A is still running; the process of monitoring the startup status of process B is the same as the process of monitoring the startup status of process A. In summary, in the above software system, step 3 failed during the startup of process A, and step 1 succeeded during the startup of process B. The two states are combined into a failed state, and it is determined that the overall running state of the above software system is abnormal.

[0109] In the embodiment of the present application, the startup status of each process in the environment where multiple processes work together can be uniformly monitored, and there is no need to obtain the startup status of different processes separately, analyze each process separately, and then process each process status separately to determine the working status of the overall environment, which makes the analysis and processing work more complicated. In the case that at least one process fails to start in the startup status corresponding to each process, it is determined that the overall operation of the software system is abnormal, thereby improving the efficiency of determining the working status of the overall operating environment of the software system.

[0110] In summary, the method for monitoring process status provided by the present application can collect the startup step information of each process in the software system; the startup step information includes at least one startup step of the process; the execution information of each startup step corresponding to each process is written into the startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile; each startup status subfile is parsed to determine the startup status corresponding to each process; the startup status corresponding to each process is summarized to determine the overall operation status of the software system. By saving the startup step information of the process in a fixed format in the startup status file, obtaining the startup status of the process from the startup status file, and realizing unified monitoring of the startup status of different processes, the efficiency of obtaining the startup status of the process is improved.

[0111] Device Embodiment

[0112] Reference Figure 3 , shows a structural block diagram of a device for monitoring process status of the present invention, the device comprising:

[0113] The collecting module 310 is used to collect the startup step information of each process in the software system; the startup step information includes at least one startup step of the process;

[0114] An output module 320 is used to write the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile;

[0115] The parsing module 330 is used to parse each of the startup status sub-files to determine the startup status corresponding to each process;

[0116] The summarizing module 340 is used to summarize the startup status corresponding to each process to determine the overall operation status of the software system.

[0117] Optionally, the output module includes:

[0118] A conversion module, used for converting the execution information of each of the startup steps corresponding to each process into a record in a fixed format;

[0119] The append module is used to append each line of records to the corresponding startup status subfile; each startup step corresponds to a line of records.

[0120] Optionally, the parsing module includes:

[0121] A parsing submodule, used to parse the contents stored in the fixed format in each of the startup status subfiles in turn to determine the execution status of each of the startup steps;

[0122] A first determination module, used to determine that the process is successfully started if all the startup steps are successfully executed;

[0123] The second determining module is used to determine that the process startup fails when at least one startup step among the startup steps fails to execute.

[0124] Optionally, the parsing submodule includes:

[0125] A third determining module, configured to determine the first startup step corresponding to each record according to the content stored in the first field of each record in the startup status subfile;

[0126] The identification module is used to identify the content stored in the second field of each record and determine the execution status of the first startup step.

[0127] Optionally, the device further comprises:

[0128] a fourth determination module, configured to determine, when the execution status of the first startup step is failure, the exception type corresponding to the failure of execution of the first startup step according to the content stored in the third field of each record;

[0129] The fifth determination module is used to determine the abnormal information corresponding to the failure of the first startup step according to the content stored in the fourth field of each record.

[0130] Optionally, the output module includes:

[0131] A first writing module is used to write the identifier and execution status corresponding to each of the startup steps into a startup status file in a first fixed format when each of the startup steps is successfully executed;

[0132] The second writing module is used to write the identification, execution status, exception type and exception information corresponding to each of the startup steps into the startup status file in a second fixed format when an exception occurs during the execution of each of the startup steps.

[0133] Optionally, the aggregation module includes:

[0134] The abnormality determination module is used to determine that the overall operation of the software system is abnormal when at least one process fails to start in the startup states corresponding to the various processes.

[0135] In summary, the device for monitoring process status provided by the present application can collect the startup step information of each process in the software system; the startup step information includes at least one startup step of the process; the execution information of each startup step corresponding to each process is written into the startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile; each startup status subfile is parsed to determine the startup status corresponding to each process; the startup status corresponding to each process is summarized to determine the overall operation status of the software system. By saving the execution information of the startup step of the process in a fixed format in the startup status file, obtaining the startup status of the process from the startup status file, and realizing unified monitoring of the startup status of different processes, the efficiency of obtaining the startup status of the process is improved.

[0136] The monitoring process state device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0137] The process status monitoring device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0138] Alternatively, if Figure 4 As shown, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a program or instruction that can be executed on the processor, and when the program or instruction is executed by the processor, the various steps of the above-mentioned embodiment of the method for monitoring the process status are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0139] In an embodiment of the present application, the memory may be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0140] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0141] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned monitoring process status method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0142] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0143] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned process status monitoring method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0146] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for monitoring process status, characterized in that: The method comprises: Collecting startup step information of each process in the software system; the startup step information includes at least one startup step of the process; Writing the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; and each process corresponds to a startup status subfile; Parsing each of the startup status subfiles to determine the startup status corresponding to each process; The startup status corresponding to each process is summarized to determine the overall operation status of the software system.

2. The method according to claim 1, characterized in that Writing the execution information of each startup step corresponding to each process into the startup status file in a fixed format; The startup status file includes at least one startup status subfile; Each process corresponds to a startup status subfile, including: Converting the execution information of each of the startup steps corresponding to each process into a record in a fixed format; Append each record to the startup status subfile corresponding to each process; one record for each startup step.

3. The method according to claim 1, characterized in that The parsing of each of the startup status subfiles to determine the startup status corresponding to each process includes: Sequentially parsing the contents stored in the fixed format in each of the startup status sub-files to determine the execution status of each of the startup steps; When all the startup steps are successfully executed, determining that the process is successfully started; In the case where at least one of the startup steps fails to be executed, it is determined that the process startup fails.

4. The method according to claim 3, characterized in that The step of sequentially parsing the contents stored in the fixed format in each of the startup status sub-files to determine the execution status of each of the startup steps includes: Determine the first startup step corresponding to each record according to the content stored in the first field of each record in the startup status subfile; The content stored in the second field of each record is identified to determine the execution status of the first starting step.

5. The method according to claim 4, characterized in that The method further comprises: In a case where the execution status of the first startup step is failure, determining the exception type corresponding to the failure of execution of the first startup step according to the content stored in the third field of each record; According to the content stored in the fourth field of each record, the abnormal information corresponding to the failure of executing the first starting step is determined.

6. The method according to claim 1, characterized in that Writing the execution information of each startup step corresponding to each process into the startup status file in a fixed format includes: When each of the startup steps is successfully executed, the identifier and execution status corresponding to each of the startup steps are written into the startup status file according to the first fixed format; When an exception occurs during the execution of each of the startup steps, the identifier, execution status, exception type, and exception information corresponding to each of the startup steps are written into the startup status file in a second fixed format.

7. The method according to claim 1, characterized in that The step of summarizing the startup status corresponding to each process to determine the overall operation status of the software system includes: When at least one process fails to start in the startup states corresponding to the processes, it is determined that the overall operation of the software system is abnormal.

8. A device for monitoring process status, characterized in that: The device comprises: A collection module, used to collect startup step information of each process in the software system; the startup step information includes at least one startup step of the process; An output module, used for writing the execution information of each startup step corresponding to each process into a startup status file in a fixed format; the startup status file includes at least one startup status subfile; each process corresponds to a startup status subfile; A parsing module, used to parse each of the startup status sub-files to determine the startup status corresponding to each process; The summary module summarizes the startup status corresponding to each process to determine the overall operation status of the software system.

9. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the method for monitoring process status as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the method for monitoring the process status according to any one of claims 1 to 7 is implemented.