CN110308943B - Program running method and device, computing equipment and storage medium - Google Patents

Program running method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN110308943B
CN110308943B CN201810229662.4A CN201810229662A CN110308943B CN 110308943 B CN110308943 B CN 110308943B CN 201810229662 A CN201810229662 A CN 201810229662A CN 110308943 B CN110308943 B CN 110308943B
Authority
CN
China
Prior art keywords
program
live
live broadcast
operating system
running
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810229662.4A
Other languages
Chinese (zh)
Other versions
CN110308943A (en
Inventor
罗巧龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810229662.4A priority Critical patent/CN110308943B/en
Publication of CN110308943A publication Critical patent/CN110308943A/en
Application granted granted Critical
Publication of CN110308943B publication Critical patent/CN110308943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Abstract

The application provides a program running method, which comprises the following steps: running a first program to obtain configuration parameters of the first program; running a second program and sending the configuration parameters to the second program so that the second program executes the step of running the first program according to the configuration parameters when detecting that the first program is finished; when detecting that the second program is ended, executing the step of running the second program and sending the configuration parameters to the second program; when receiving an instruction to end the first program, ending the second program; and after finishing the second program, finishing the first program.

Description

Program running method and device, computing equipment and storage medium
Technical Field
The present application relates to the field of information technology, and in particular, to a program running method and apparatus, a computing device, and a storage medium.
Background
With the development of information network technology, in order to better match the development of information network technology, hardware devices also undergo multiple update iterations, so that a higher requirement is put on the stability of program software running on the hardware devices, however, when the program software which needs to keep a running state for a long time is suddenly run down due to objective factors, a function which depends on the realization of the program software is interrupted, and how to reduce the influence caused by the interruption is the key for solving the problem.
Disclosure of Invention
The application provides the following technical scheme, and the influence caused by sudden operation interruption of the program software can be quickly, quickly and conveniently reduced.
The application example provides a program running method, which comprises the following steps: running a first program to obtain configuration parameters of the first program; running a second program and sending the configuration parameters to the second program so that the second program executes the step of running the first program according to the configuration parameters when detecting that the first program is finished; when detecting that the second program is ended, executing the step of running the second program and sending the configuration parameters to the second program; when receiving an instruction to end the first program, ending the second program; and after finishing the second program, finishing the first program.
The application example provides a program running method, which comprises the following steps: receiving configuration parameters of a first program sent by the first program; when the first program is detected to be finished, starting the first program through an operating system and operating the first program according to the configuration parameters; and when a second program ending instruction sent by the first program is received, ending the second program through the operating system.
The example of the present application also provides a data processing apparatus, the apparatus including: the running module runs a first program and acquires configuration parameters of the first program; the operation module is used for operating a second program and sending the configuration parameters to the second program so as to enable the second program to execute the step of operating the first program according to the configuration parameters when the second program detects that the first program is finished; the detection module is used for enabling the operation module to execute the step of operating the second program and sending the configuration parameters to the second program when the second program is detected to be finished; an end module configured to end the second program when receiving an instruction to end the first program; and the ending module is used for ending the first program after the second program is ended.
In some examples, the device further comprises: the response module is used for responding to the received instruction for operating the first program, executing the operation module and operating the first program; a response module, responsive to the received configuration parameters, storing the configuration parameters; wherein, the operation module includes: an operation unit that operates the second program; and the reading unit is used for reading the stored configuration parameters of the first program and sending the configuration parameters to the second program.
In some examples, the device further comprises: the receiving module is used for receiving second program running information sent by the second program after the second program runs; the acquisition module is used for sending a message for acquiring program running information to the operating system; the receiving module is used for receiving the program running information sent by the operating system; and the detection module detects that the second program abnormally ends when the second program running information does not exist in the program running information.
In some examples, the detection module detects that the second program operates normally when the second program operation information exists in the program operation information.
In some examples, the device further comprises: the sending module is used for sending a message for acquiring the running information of the first program to an operating system after the first program runs; the receiving module is used for receiving the first program running information sent by the operating system; and the sending module is used for sending the first program running information to the second program so as to enable the second program to detect the running state of the first program according to the first program running information.
In some examples, the end module sends an end message to the second program to cause the second program to end the second program via an operating system; and the ending module is used for sending an ending message to the operating system after detecting that the second program is ended so as to enable the operating system to end the first program.
The example of the present application further provides a program running apparatus, including: the receiving module is used for receiving the configuration parameters of the first program sent by the first program; the detection module starts the first program through an operating system and operates the first program according to the configuration parameters when detecting that the first program is finished; and the ending module is used for ending the second program through the operating system when receiving a second program ending instruction sent by the first program.
In some examples, the device further comprises: and the operation module is used for operating the second program according to the first program, executing the receiving module after the second program is operated, and receiving the configuration parameters of the first program sent by the first program.
In some examples, the receiving module receives first program running information sent by a first program; the apparatus further comprises: the sending module is used for sending a message for acquiring program running information to the operating system; the receiving module is used for receiving the program running information sent by the operating system; and the detection module detects that the first program abnormally ends when the first program running information does not exist in the program running information.
In some examples, the detection module includes: the sending unit is used for sending a message for starting the first program to the operating system so as to enable the operating system to start the first program; and the detection unit is used for sending the configuration parameters to the first program after detecting that the first program is started so as to enable the first program to maintain running according to the configuration parameters.
In some examples, the end module sends an end message to the operating system to cause the operating system to end the second program.
In some examples, the sending module sends a message for acquiring running information of the second program to the operating system; the receiving module is used for receiving the second program running information sent by the operating system; and the sending module is used for sending the second program running information to the first program so as to enable the first program to detect the running state of the second program according to the second program running information.
The examples of this application also provide a computing device comprising a memory, a processor, and a computer program stored on the memory and run on the processor; the processor, when executing the computer program, implements the method described above.
The present examples also provide a storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the above-described method.
By applying the technical scheme of the invention, the mutual daemon relation between the daemon program and the daemon program can be realized, when the current daemon program is interrupted due to burst factors (such as the exhaustion of the internal memory of an operating system), the daemon program can not only quickly detect the interruption condition of the current daemon program, but also quickly and conveniently pull up the daemon program, so that the daemon program can be operated again, and the loss caused by the interruption of the current daemon program is reduced; when the daemon is interrupted due to a burst factor (e.g., the memory of the operating system is exhausted), the daemon can also quickly detect the interruption condition of the daemon, and can also quickly and conveniently pull up the daemon, so that the daemon can be operated again, and the occurrence of the situation that the daemon cannot be continuously maintained due to the interruption of the operation of the daemon is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of a system architecture for an example program execution method;
FIG. 2 is a flow chart of a method of program execution according to an embodiment of the present application;
FIG. 3 is an interactive flow chart of a method for program execution according to an embodiment of the present application;
FIG. 4A is a diagram illustrating relationships between programs in an example of the present application;
FIG. 4B is a diagram illustrating relationships between programs in an example of the present application;
FIG. 5 is a flow chart of a method of program execution according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a program execution device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a program execution device according to an embodiment of the present application;
fig. 8 is a schematic diagram of the hardware of a computing device according to an example of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For simplicity and clarity of description, the invention will be described below by describing several representative embodiments. The numerous details of the examples are merely provided to assist in understanding the inventive arrangements. It will be apparent, however, that the invention may be practiced without these specific details. Some embodiments are not described in detail, but rather are merely provided as frameworks, in order to avoid unnecessarily obscuring aspects of the invention. Hereinafter, "including" means "including but not limited to", "according to … …" means "at least according to … …, but not limited to … … only". When the number of one component is not particularly specified hereinafter, it means that the component may be one or more, or may be understood as at least one.
Fig. 1 shows a schematic structural diagram of a system 100 to which the program running method of the present application is applied. The system 100 may include a terminal device 101, a server 102, and a network 103.
The terminal device 101 refers to a device having a data calculation processing function, and includes but is not limited to a smart phone (equipped with a communication module), a palm computer, a tablet computer, and the like. The terminal device 101 has an operating system installed thereon, including but not limited to: the Android operating system, the Symbian operating system, the Windows mobile operating system, and the apple iPhone OS operating system, among others.
The terminal device 101 may be installed with a client (e.g., a live APP or a live PC client), where the client may include a daemon (e.g., a live program) and a daemon (e.g., a monitor of the live program), and when the daemon is interrupted due to a non-user-end instruction (e.g., the interruption of operation is caused by the exhaustion of a memory), the daemon may pull up the daemon again so that the daemon may restart and operate; in addition, when the daemon breaks down (for example, the running is interrupted due to the end instruction of the non-daemon program, the memory is exhausted), the daemon program can be pulled up again, so that the daemon program can be restarted and run.
The server 102 may be installed with a monitoring service program (i.e., a daemon program, e.g., a manager of an application server program) and an application server program (i.e., a daemon program, e.g., a live application server program), and when the daemon program is interrupted due to a non-user end instruction (e.g., interruption of operation caused by memory exhaustion), the daemon program may pull up the daemon program again so that the daemon program may be restarted and operated; in addition, when the daemon breaks down for a reason other than the end instruction of the daemon (for example, the interruption occurs due to the exhaustion of the memory), the daemon can be pulled up again by the daemon, so that the daemon can be restarted and run.
A client (e.g., a live APP) in the terminal device 101 may perform information interaction of live video with an application server program (e.g., a live application server program) installed in the server 102 through the network 103.
The network 105 may be a wired network or a wireless network.
Based on the system 100, the example of the present application proposes a program running method, which is applied to a processing module in a computing device, where the computing device may include a terminal device or a server, and the processing module is used for running a program in the computing device. An example of the present application is described below with reference to fig. 2 and 3, and the present application is applied to a processing module running a daemon program, in the present example, the daemon program is referred to as a first program, and the daemon program is referred to as a second program. As shown in fig. 2, the method 200 includes the steps of:
step 201: and operating a first program to obtain configuration parameters of the first program.
The configuration parameter may be a parameter corresponding to the configuration parameter list of the user, such as a configuration parameter "admin" corresponding to the account ", a configuration parameter" 123456 "corresponding to the password" and a configuration parameter "test" corresponding to the password "pin".
In some examples, the method 200 further comprises: step 301: receiving an operation instruction, and executing step 302 in response to the received instruction for operating the first program: running a first program (e.g., live APP); storing the configuration parameters in response to receiving the configuration parameters. For example, a user triggers a live APP icon on a display interface of a mobile terminal, an operating system of the mobile terminal receives a trigger event of the user triggering an application icon, the operating system responds to the trigger event, loads a live program of the live APP into a memory of the operating system, and simultaneously, the operating system establishes a process of the live APP, determines information such as a process ID, when the process is scheduled by the operating system, the live APP starts to run its live program, after the live APP starts to run, a login interface is displayed to the user, the user performs account login through the login interface, when the live APP receives an account login instruction of the user, configuration parameters such as an account name and a password of the user are obtained from the account login instruction, that is, step 303: and receiving the configuration parameters, and storing the configuration parameters in a local storage area of the live broadcast APP, namely acquiring the configuration parameters.
It should be noted that the present example can be applied not only to the program in each client or server, but also to any other program with long-time operation requirement, such as the program in the operating system.
Step 202: and running a second program and sending the configuration parameters to the second program so that the second program executes the step of running the first program according to the configuration parameters when detecting that the first program is finished.
The above-mentioned manner of running the second program may include: when a second program (e.g., a live broadcast monitoring program) is embedded in a first program (e.g., a live broadcast APP), the first program can directly run a program code of the second program to run the second program; or when the second program is implanted in the same native program as the first program, the first program operates the second program through a calling method in the native program; or, when the second program and the first program are respectively set in different native programs, the first program calls or pulls up the second program in a manner called by an information interaction component of the operating system (for example, the first program pulls or calls the second program by an intent component of the Android operating system). Fig. 4A shows an example of a relationship 400A between programs, in which a first program 401 and a second program 402 are respectively provided in a native program a403 (e.g., live APP) and a native program B404 (e.g., live management APP), and the native program a403 and the native program B404 are provided with execution resources by an operating system 405; fig. 4B illustrates an example relationship 400B between programs, where the first program 401 and the second program 402 are both provided in a native program 406 (e.g., a live APP), and the native program 406 is provided with run resources by the operating system 405.
In some examples, the running a second program and sending the configuration parameters to the second program includes: running the second program; reading the stored configuration parameters of the first program and sending them to the second program.
For example, according to the above, after the first program "live APP" runs, step 304: live broadcast APP continues to operate the live broadcast monitoring program in the live broadcast APP program, or pull up the independent live broadcast monitoring program, and after the live broadcast monitoring program is operated, the first program live broadcast APP reads the configuration parameters stored in the local client of the first program live broadcast APP, such as login account and login password, step 304: and sending the read configuration parameters to the live broadcast monitoring program in a message form, wherein the message also carries message source information such as a program ID of the live broadcast APP.
It should be understood that the second application program may be in the same native program (e.g., live APP) as the first application program, or may be separately provided in different native programs (e.g., live APP and live management APP).
In some examples, the method 200 further comprises: after the second program runs, receiving second program running information sent by the second program; step 312: sending a message for acquiring program running information to an operating system; step 314: receiving the program running information sent by the operating system; step 316: and when the second program running information does not exist in the program running information, detecting that the second program is abnormally ended. And when the second program running information exists in the program running information, detecting that the second program runs normally.
Wherein the operation information includes but is not limited to: process ID, etc.
For example, as described above, when the live APP runs the live monitoring program, the operating system also needs to load the second program and create a process for the second program, set the process ID, after the live monitoring program runs, the live APP receives the live monitoring program process ID sent by the live monitoring program (the live monitoring program process ID is obtained from the operating system by the live monitoring program), after the live APP receives the live monitoring program process ID sent by the live monitoring program, the live APP regularly (e.g., for 1 minute) sends a message for obtaining the currently running program process ID to the operating system, where the message may carry message source information such as the program ID of the live APP, receives the currently running program process ID returned by the operating system in response to the message, and the live APP searches for the live monitoring program process ID among the currently running program process IDs, and when the process ID of the live broadcast monitoring program is found, the live broadcast monitoring program is normally operated, and when the process ID of the live broadcast monitoring program is not found, the live broadcast monitoring program is judged to be abnormally ended when the live broadcast monitoring program is ended to be operated.
Step 203: and when the second program is detected to be finished, executing the step of running the second program and sending the configuration parameters to the second program.
For example, according to the foregoing, when the live monitor process ID is not found, step 202 is repeatedly executed, and since the specific implementation manner of step 202 has been described in detail in the foregoing, it is not described here again.
Step 204: when an instruction to end the first program is received, the second program is ended.
In some examples, said ending the second program when an instruction to end the first program is received comprises: step 320: when receiving an instruction to end the first program, step 321: and sending an end message to the second program so that the second program ends the second program through an operating system.
For example, according to the foregoing, when the user triggers a quit operation (i.e., an end operation) of a live APP display interface displayed on the mobile terminal, and when the live APP receives a quit instruction (i.e., an end instruction) of the user, end information is sent to the live APP monitoring program, where the end information may be sent in a form of a message, and the message may also carry source information such as a program ID of the live APP, and after the live APP monitoring program receives the end information, step 322: and sending an end message to the operating system, wherein the end message can carry source information such as a program ID of the live broadcast monitoring program, so that the operating system ends the process of the live broadcast monitoring program according to the end message, releases memory resources and the like, and ends the live broadcast monitoring program.
Step 205: after the second program is ended, the first program is ended.
In some examples, said ending the first procedure after ending the second procedure comprises: and when the second program is detected to be finished, sending a finishing message to the operating system so as to enable the operating system to finish the first program.
For example, as described above, a live APP sends a message for acquiring a currently running program process ID to an operating system at a regular time (e.g., 1 minute), where the message may carry message source information such as the program ID of the live APP, receives the currently running program process ID returned by the operating system in response to the message, the live APP searches for the live monitoring program process ID in the currently running program process IDs, and when the live monitoring program process ID is not found, it indicates that the live monitoring program has finished running, step 323: the live broadcast APP sends an end message to the operating system, the end message can carry source information such as a program ID of the live broadcast APP, the operating system ends the process of the live broadcast APP according to the program ID after receiving the end message, and releases memory resources and the like to end the program of the live broadcast APP.
In some examples, the method 200 further comprises: after the first program is run, step 306: sending a message for acquiring the running information of the first program to an operating system; step 308: receiving the first program running information sent by the operating system; step 310: and sending the first program running information to the second program so that the second program detects the running state of the first program according to the first program running information.
For example, according to the foregoing, after the live APP runs, the live APP sends a message for acquiring a process ID of the live APP to the operating system, where the message may carry message source information such as a program ID of the live APP, and receives a process ID of the live APP returned by the operating system in response to the message, and after receiving the process ID of the live APP, the live APP can send the process ID of the live APP to the live monitoring program in the form of a message, so that the live monitoring program detects the running condition of the live APP according to the process ID of the live APP.
It should be noted that, when the condition allows, a relevant detection person may be arranged to replace the second program in the present application, and the relevant detection person may monitor the operation condition of the first program at any time, and if the first program has an unexpected crash condition, the first program may be actively restarted in a manual manner; in addition, a mode of setting timed automatic restart can be set to simplify the function realized by the second program, namely, the first program is restarted once every a period of time, and the first program can be restarted once the set restart time comes, regardless of whether the running condition of the first program is normal or not.
Above-mentioned scheme of restarting first procedure through manual mode has improved the human cost to because the running state of the first procedure of manpower real time monitoring needs, be difficult to guarantee the real-time of monitoring effect, if the running time of first procedure needs to exceed 24 hours simultaneously, singly lean on the human cost condition under, the difficult condition of in time discovering first procedure breakdown.
In the above manner of restarting the first program by setting the restart time, if the restart time interval is set to be too long, and the first program has a running crash in a short time within the long interval time, a blank period in which a part of the time is not running occurs when the long interval time comes in the future; if the restart duration interval is set to be too short and the first program is in a state of normal operation for a long time, unnecessary restart operations may occur; the security of the first program is difficult to guarantee, and if the first program also needs operations such as secure login, the account may have login risks due to the regular restart.
Because continuous running and operation of the program cause more or less loss to resources of an operating system, the running time of the program is long, some unexpected problems can be generated to cause program crash, the running condition of the program needs to be monitored aiming at the program with a long-time running state, and the program can be pulled up in time to ensure normal running of the program when the program is abnormally finished; according to the technical scheme, the first program can be automatically guarded according to the real-time running state of the first program, and the first program starts the guard of the daemon program when the first program is guarded by the daemon program (namely, the second program) to run, so that mutual guard is formed, and the normal running state between the first program and the daemon program is ensured and maintained. In addition, when the daemon is pulled up by the first program, the first program can transmit the configurable parameters to the daemon, and in the daemon process, the daemon maintains the running configuration parameters and transmits the configuration parameters to the first program to maintain the normal running of the first program when the first program needs to be pulled up.
Based on the foregoing example, the present application provides a program running method, applied to a processing module in a computing device, where the computing device may include a terminal device or a server, and the processing module is used to run a program in the computing device; an example of the present application is described below with reference to fig. 5 and 3, and the present application is applied to a processing module running a daemon program, in the present example, a daemon program is referred to as a first program, and a daemon program is referred to as a second program. As shown in fig. 5, the method 500 includes the steps of:
step 501: and receiving the configuration parameters of the first program sent by the first program.
In some examples, the method 500 further comprises: and running the second program according to the first program, and after the second program is run, executing the step of receiving the configuration parameters of the first program sent by the first program.
In some examples, the method 500 further comprises: step 307: sending a message for acquiring running information of a second program to the operating system; step 309: receiving the second program running information sent by the operating system; step 311: and sending the second program running information to the first program so that the first program detects the running state of the second program according to the second program running information.
For example, according to the foregoing, a live broadcast monitoring program is run through a live broadcast APP, and after the live broadcast monitoring program runs, the live broadcast monitoring program receives configuration parameters of the live broadcast APP sent by the live broadcast APP, and after the live broadcast monitoring program receives the configuration parameters, step 305: and analyzing the configuration parameters, determining the content of each configuration parameter, and storing the analyzed configuration parameters in a process memory created by the operating system for the live broadcast monitoring program. After the live broadcast monitoring program operates, the live broadcast monitoring program sends a message for acquiring a process ID of the live broadcast monitoring program to an operating system, the message can carry message source information such as a program ID of the live broadcast monitoring program, the process ID of the live broadcast monitoring program returned by the operating system in response to the message is received, and the live broadcast monitoring program can send the process ID of the live broadcast monitoring program to a live broadcast APP in a message form after receiving the process ID of the live broadcast monitoring program, so that the live broadcast APP detects the operation condition of the live broadcast monitoring program according to the process ID of the live broadcast monitoring program.
Step 502: and when the first program is detected to be finished, starting the first program through an operating system and operating the first program according to the configuration parameters.
In some examples, the method 500 further comprises: receiving first program running information sent by a first program; step 313: sending a message for acquiring program running information to an operating system; step 315: receiving the program running information sent by the operating system; step 318: and when the first program running information does not exist in the program running information, detecting that the first program is abnormally ended, and starting the first program through an operating system.
In some examples, said launching, by an operating system, the first program and said running the first program according to the configuration parameters includes: sending a message for starting the first program to the operating system so that the operating system starts the first program; step 319: and when the first program is detected to be started, sending the configuration parameters to the first program so as to enable the first program to maintain running according to the configuration parameters.
For example, according to the foregoing, the live broadcast monitoring program receives the process ID of the live broadcast APP sent by the live broadcast APP, the live broadcast monitoring program sends, to the operating system at regular time (e.g., 1 minute), a message for acquiring the process ID of the currently running program, where the message may carry message source information such as the program ID of the live broadcast monitoring program, receives the process ID of the currently running program returned by the operating system in response to the message, the live broadcast monitoring program searches for the process ID of the live broadcast APP in the process IDs of the currently running program, when the process ID of the live broadcast APP is not found, it is indicated that the live broadcast APP has ended abnormally, and when the process ID of the live broadcast APP is found, it is indicated that the live broadcast APP is in a normal operating state. When the live APP is detected to be abnormally finished, the live APP is sent to the operating system by the live monitoring program, after the operating system receives the message, the live APP is loaded into a memory of the operating system, a process of the live APP is created, the process ID is set, and when the process is scheduled by the operating system, the live APP can start to run the own program; and after the live broadcast monitoring program searches the process ID of the live broadcast APP in the currently running program process ID, sending the configuration parameters to the live broadcast APP so that the live broadcast APP performs login operation and the like according to the configuration parameters, and thus, the running state of the live broadcast APP is maintained.
Step 503: and when a second program ending instruction sent by the first program is received, ending the second program through the operating system.
In some examples, said ending, by the operating system, the second program comprises: step 322: and sending an end message to the operating system so that the operating system ends the second program.
For example, according to the foregoing, the live broadcast monitoring program sends an end message to the operating system, where the message may also carry source information such as a program ID of the live broadcast monitoring program, and after receiving the end message, the operating system ends the process of the live broadcast monitoring program, and releases the memory resource, so as to end the live broadcast monitoring program.
It should be understood that the second application program may be in the same native program (e.g., live APP) as the first application program, or may be separately provided in different native programs (e.g., live APP and live management APP).
Based on the foregoing example, the present application provides a program running apparatus, which is applied to a processing module in a computing device, where the computing device may include a terminal device or a server, and the processing module is used to run a program in the computing device; the example is applied to a processing module for running a daemon program, wherein the daemon program is called a first program, and the daemon program is called a second program. As shown in fig. 6, the apparatus 600 includes: the system comprises an operation module 601, a detection module 602 and an end module 603, and the functions of the modules are as follows:
the running module 601 runs a first program, and obtains configuration parameters of the first program.
The running module 601 runs a second program and sends the configuration parameters to the second program, so that the second program executes the step of running the first program according to the configuration parameters when detecting that the first program is finished.
The detecting module 602, when detecting that the second program is ended, executes the running module 601, runs the second program, and sends the configuration parameter to the second program.
An end module 603 configured to end the second program when receiving an instruction to end the first program; after the second program is ended, the first program is ended.
In some examples, the device 600 further comprises: a response module, which responds to the received instruction for running the first program, and causes the running module 601 to execute the step of running the first program; a response module to store the configuration parameters in response to the received configuration parameters.
Wherein, the operation module 601 includes: an operation unit that operates the second program; and the reading unit is used for reading the stored configuration parameters of the first program and sending the configuration parameters to the second program.
In some examples, the device 600 further comprises: the receiving module is used for receiving second program running information sent by the second program after the second program runs; the acquisition module is used for sending a message for acquiring program running information to the operating system; the receiving module is used for receiving the program running information sent by the operating system; the detecting module 602, configured to detect that the second program abnormally ends when the second program running information does not exist in the program running information.
In some examples, the detecting module 602 detects that the second program operates normally when the second program operation information exists in the program operation information.
In some examples, the device 600 further comprises: the sending module is used for sending a message for acquiring the running information of the first program to an operating system after the first program runs; the receiving module is used for receiving the first program running information sent by the operating system; and the sending module is used for sending the first program running information to the second program so as to enable the second program to detect the running state of the first program according to the first program running information.
In some examples, the ending module 603 sends an ending message to the second program to enable the second program to end the second program through the operating system; the ending module 603, when detecting that the second program is ended, sends an ending message to the operating system, so that the operating system ends the first program.
Based on the foregoing example, the present application provides a program running apparatus, which is applied to a processing module in a computing device, where the computing device may include a terminal device or a server, and the processing module is used to run a program in the computing device; the present example is applied to a processing module running a daemon program, and in the present example, the daemon program is referred to as a first program, and the daemon program is referred to as a second program. As shown in fig. 7, the apparatus 700 includes: the function of the receiving module 701, the detecting module 702, and the ending module 703 is as follows:
the receiving module 701 receives a configuration parameter of a first program sent by the first program.
A detecting module 702, configured to start the first program through an operating system and run the first program according to the configuration parameters when detecting that the first program is ended.
The ending module 703, when receiving a second program ending instruction sent by the first program, ends the second program through the operating system.
In some examples, the device 700 further comprises: an operation module, configured to operate the second program according to the first program, and after the second program is operated, execute the receiving module 701 to receive the configuration parameter of the first program sent by the first program.
In some examples, the receiving module 701 receives first program running information sent by a first program; the apparatus further comprises: the sending module is used for sending a message for acquiring program running information to the operating system; a receiving module 701, configured to receive the program running information sent by the operating system; a detecting module 702, configured to detect that the first program abnormally ends when the first program running information does not exist in the program running information.
In some examples, the detection module 702 includes: the sending unit is used for sending a message for starting the first program to the operating system so as to enable the operating system to start the first program; and the detection unit is used for sending the configuration parameters to the first program after detecting that the first program is started so as to enable the first program to maintain running according to the configuration parameters.
In some examples, the end module 703 sends an end message to the operating system to cause the operating system to end the second program.
In some examples, the sending module sends a message for acquiring running information of the second program to the operating system; a receiving module 701, configured to receive the second program running information sent by the operating system; and the sending module is used for sending the second program running information to the first program so as to enable the first program to detect the running state of the second program according to the second program running information.
FIG. 8 illustrates a block diagram of a computing device 800 in which the operations apparatus 600 and 700 are located. This computing device 800 may be a server. As shown in fig. 8, the computing device includes one or more processors (CPUs) 802, a communication module 804, a memory 806, a user interface 810, and a communication bus 808 for interconnecting these components.
The processor 802 may receive and transmit data via the communication module 804 to enable network communications and/or local communications.
User interface 810 includes one or more output devices 812 including one or more speakers and/or one or more visual displays. The user interface 810 also includes one or more input devices 814, including, for example, a keyboard, a mouse, a voice command input unit or microphone, a touch screen display, a touch sensitive tablet, a gesture capture camera or other input buttons or controls, and the like.
The memory 806 may be high-speed random access memory, such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 806 stores a set of instructions executable by the processor 802, including:
an operating system 816, including programs for handling various basic system services and for performing hardware-related tasks;
the application 818 includes various application programs for video playing, and such application programs can implement the processing flows in the above examples, for example, the application programs may include part or all of the modules in the running device 600 shown in fig. 6, at least one of the modules 601 and 603 may store machine executable instructions, and the processor 802 can implement the functions of at least one of the modules 601 and 603 by executing the machine executable instructions in at least one of the modules 601 and 603 in the memory 806.
For example, the system may include part or all of the modules in the operation device 700 shown in fig. 7, at least one of the modules 701 and 703 may store machine executable instructions, and the processor 802 may further implement the functions of at least one of the modules 701 and 703 by executing the machine executable instructions in at least one of the modules 701 and 703 in the memory 806.
It should be noted that not all steps and modules in the above flows and structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The division of each module is only for convenience of describing adopted functional division, and in actual implementation, one module may be divided into multiple modules, and the functions of multiple modules may also be implemented by the same module, and these modules may be located in the same device or in different devices.
The hardware modules in the embodiments may be implemented in hardware or a hardware platform plus software. The software includes machine-readable instructions stored on a non-volatile storage medium. Thus, embodiments may also be embodied as software products.
In various examples, the hardware may be implemented by specialized hardware or hardware executing machine-readable instructions. For example, the hardware may be specially designed permanent circuits or logic devices (e.g., special purpose processors, such as FPGAs or ASICs) for performing the specified operations. Hardware may also include programmable logic devices or circuits temporarily configured by software (e.g., including a general purpose processor or other programmable processor) to perform certain operations.
In addition, each example of the present application can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that a data processing program constitutes the present application. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present application, which also provides a non-volatile storage medium in which a data processing program is stored, which data processing program can be used to carry out any one of the above-mentioned method examples of the present application.
Machine-readable instructions corresponding to the modules in fig. 6-7 may cause an operating system or the like operating on the computer to perform some or all of the operations described herein. The nonvolatile computer-readable storage medium may be a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer. A CPU or the like mounted on the expansion board or the expansion unit may perform part or all of the actual operations according to the instructions.
In addition, the devices and modules in the examples of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more devices or modules may be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (14)

1. A program running method applied to a live program, the method comprising:
running the live program to obtain configuration parameters of the live program;
when a live broadcast monitoring program is implanted in the live broadcast program, running the live broadcast monitoring program, wherein an operating system creates a process for the live broadcast monitoring program and sets a process identifier of the live broadcast monitoring program;
sending the configuration parameters to the live broadcast monitoring program, so that the live broadcast monitoring program operates the live broadcast program according to the configuration parameters when detecting that the live broadcast program is finished;
receiving the process identification of the live broadcast monitoring program acquired by the live broadcast monitoring program from the operating system, regularly sending a message for acquiring the process identification of the currently running program to the operating system, and receiving the process identification of the currently running program returned by the operating system;
when the process identification of the live broadcast monitoring program is not found from the currently running program process identification, detecting that the live broadcast monitoring program is finished, running the live broadcast monitoring program, and sending the configuration parameters to the live broadcast monitoring program;
when receiving an instruction of ending the live program, including: when the process identification of the live broadcast monitoring program is not found from the currently running program process identification, determining that the live broadcast monitoring program is finished running;
and after finishing the live broadcast monitoring program, finishing the live broadcast program.
2. The method of claim 1, wherein the running the live program comprises:
responding to a received instruction for running the live program, and executing the step of running the live program;
the acquiring the configuration parameters of the live program includes:
in response to receiving the configuration parameters, storing the configuration parameters in a local storage area of the live program;
the sending the configuration parameters to the live broadcast monitoring program includes:
and reading the stored configuration parameters of the live program and sending the configuration parameters to the live monitoring program.
3. The method of claim 1, wherein the ending the live monitoring program when receiving an instruction to end the live program comprises:
when an instruction for finishing the live program is received, a finishing message is sent to the live program monitoring program, so that the live program monitoring program sends the finishing message to the operating system, the operating system finishes the process of the live program monitoring program, and memory resources are released.
4. The method of claim 1, further comprising:
and when the process identification of the live broadcast monitoring program is searched from the currently running program process identification, detecting that the live broadcast monitoring program normally runs.
5. The method of claim 1, further comprising:
after the live program runs, sending a message for acquiring a live program process identifier to the operating system;
receiving the live program process identification sent by the operating system; and
and sending the live program process identification to the live program monitoring program so that the live program monitoring program detects the running state of the live program according to the live program process identification.
6. The method of claim 1, wherein the ending the live program comprises:
and sending an end message to the operating system so that the operating system ends the live program.
7. A program running method is applied to a live broadcast monitoring program, and the method comprises the following steps:
when the live broadcast monitoring program is implanted into a live broadcast program, operating the live broadcast monitoring program through the live broadcast program;
receiving configuration parameters of the live program sent by the live program;
sending a message for acquiring a live broadcast monitoring program process identifier to an operating system, receiving the live broadcast monitoring program process identifier sent by the operating system, and sending the live broadcast monitoring program process identifier to a live broadcast program;
receiving a live program process identifier sent by the live program, sending a message for acquiring a currently running program process identifier to the operating system, and receiving the currently running program process identifier sent by the operating system;
when the live program process identification is not found from the currently running program process identification, detecting that the live program is ended, starting the live program through the operating system, and running the live program according to the configuration parameters; and
and when a live broadcast monitoring program ending instruction sent by the live broadcast program is received, ending the live broadcast monitoring program through the operating system, wherein when the live broadcast program does not find the process identification of the live broadcast monitoring program from the currently running program process identification, the live broadcast monitoring program is determined to be ended to run.
8. The method of claim 7, wherein the configuration parameters are stored in a local storage area of the live program.
9. The method of claim 7, wherein the starting the live program by the operating system and running the live program according to the configuration parameters comprises:
sending a message for starting the live program to the operating system so that the operating system starts the live program; and
and when the live program is detected to be started, sending the configuration parameters to the live program so as to enable the live program to maintain running according to the configuration parameters.
10. The method according to claim 7, wherein the ending, by the operating system, the live monitoring program when receiving a live monitoring program ending instruction sent by the live monitoring program comprises:
and sending an end message to the operating system so that the operating system ends the live monitoring program.
11. A program execution device, comprising:
the operation module is used for operating the live program and acquiring the configuration parameters of the live program; when a live broadcast monitoring program is implanted in the live broadcast program, running the live broadcast monitoring program, wherein an operating system creates a process for the live broadcast monitoring program and sets a process identifier of the live broadcast monitoring program; sending the configuration parameters to the live broadcast monitoring program, so that the live broadcast monitoring program operates the live broadcast program according to the configuration parameters when detecting that the live broadcast program is finished; receiving the process identification of the live broadcast monitoring program acquired by the live broadcast monitoring program from the operating system, regularly sending a message for acquiring the process identification of the currently running program to the operating system, and receiving the process identification of the currently running program returned by the operating system;
the detection module is used for detecting that the live broadcast monitoring program is finished when the process identification of the live broadcast monitoring program is not searched from the currently running program process identification, running the live broadcast monitoring program and sending the configuration parameters to the live broadcast monitoring program;
and the ending module is used for ending the live broadcast monitoring program when receiving an instruction of ending the live broadcast program, and comprises: when the process identification of the live broadcast monitoring program is not found from the currently running program process identification, determining that the live broadcast monitoring program is finished running; and after finishing the live broadcast monitoring program, finishing the live broadcast program.
12. A program execution device, comprising:
the receiving module is used for operating the live broadcast monitoring program through the live broadcast program when the live broadcast monitoring program is implanted into the live broadcast program; receiving configuration parameters of the live program sent by the live program; sending a message for acquiring a live broadcast monitoring program process identifier to an operating system, receiving the live broadcast monitoring program process identifier sent by the operating system, and sending the live broadcast monitoring program process identifier to a live broadcast program; receiving a live program process identifier sent by the live program, sending a message for acquiring a currently running program process identifier to the operating system, and receiving the currently running program process identifier sent by the operating system;
the detection module is used for detecting that the live program is ended when the live program process identification is not found from the currently running program process identification, starting the live program through the operating system and running the live program according to the configuration parameters;
and the ending module is used for ending the live broadcast monitoring program through the operating system when a live broadcast monitoring program ending instruction sent by the live broadcast program is received, wherein when the live broadcast program does not find the process identifier of the live broadcast monitoring program from the currently running program process identifier, the live broadcast monitoring program is determined to be ended to run.
13. A computer readable storage medium, storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the method of any of claims 1-10.
14. A computing device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, implement the method of any of claims 1 to 10.
CN201810229662.4A 2018-03-20 2018-03-20 Program running method and device, computing equipment and storage medium Active CN110308943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810229662.4A CN110308943B (en) 2018-03-20 2018-03-20 Program running method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810229662.4A CN110308943B (en) 2018-03-20 2018-03-20 Program running method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110308943A CN110308943A (en) 2019-10-08
CN110308943B true CN110308943B (en) 2021-10-19

Family

ID=68073430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810229662.4A Active CN110308943B (en) 2018-03-20 2018-03-20 Program running method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110308943B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227630A (en) * 2008-01-29 2008-07-23 中兴通讯股份有限公司 Method for monitoring application program based on window platform
CN101268447A (en) * 2005-05-26 2008-09-17 美国联合包裹服务公司 Software process monitor
CN101354677A (en) * 2008-09-11 2009-01-28 青岛海信移动通信技术股份有限公司 Method for detecting and restoring application program running state and restoring device thereof
CN101771563A (en) * 2008-12-30 2010-07-07 北大方正集团有限公司 Method for monitoring network service program
CN101996106A (en) * 2010-12-17 2011-03-30 南京中兴力维软件有限公司 Method for monitoring software running state
CN103034552A (en) * 2012-12-11 2013-04-10 太仓市同维电子有限公司 Method for implementing software watchdog in software system
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN106709325A (en) * 2016-11-11 2017-05-24 腾讯科技(深圳)有限公司 Method and device for monitoring program
CN106708643A (en) * 2016-11-14 2017-05-24 武汉斗鱼网络科技有限公司 Abnormal information processing method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9251026B2 (en) * 2012-03-31 2016-02-02 Bmc Software, Inc. Application instrumentation code extension

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101268447A (en) * 2005-05-26 2008-09-17 美国联合包裹服务公司 Software process monitor
CN101227630A (en) * 2008-01-29 2008-07-23 中兴通讯股份有限公司 Method for monitoring application program based on window platform
CN101354677A (en) * 2008-09-11 2009-01-28 青岛海信移动通信技术股份有限公司 Method for detecting and restoring application program running state and restoring device thereof
CN101771563A (en) * 2008-12-30 2010-07-07 北大方正集团有限公司 Method for monitoring network service program
CN101996106A (en) * 2010-12-17 2011-03-30 南京中兴力维软件有限公司 Method for monitoring software running state
CN103034552A (en) * 2012-12-11 2013-04-10 太仓市同维电子有限公司 Method for implementing software watchdog in software system
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN106709325A (en) * 2016-11-11 2017-05-24 腾讯科技(深圳)有限公司 Method and device for monitoring program
CN106708643A (en) * 2016-11-14 2017-05-24 武汉斗鱼网络科技有限公司 Abnormal information processing method and apparatus

Also Published As

Publication number Publication date
CN110308943A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
US10838838B2 (en) Method and apparatus for dealing with abnormality of application program and storage medium
US11016641B2 (en) Method and apparatus for taking screenshot of screen of application in mobile terminal
CN109542744B (en) Method, device, storage medium and terminal for detecting abnormal starting problem of terminal
CN109522147A (en) A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN107491346B (en) Application task processing method, device and system
CN106201574B (en) Application interface starting method and device
CN108959064B (en) Popup window processing method and device for automatic test
CN113407383B (en) Main and standby system switching method and device, server and main and standby system
CN104881283A (en) Method and system for obtaining root privilege of terminal device based on android
US9727351B2 (en) Method and device for setting status of application
CN108563472B (en) Service plug-in loading method and device based on multi-open application
CN110691120A (en) Timing task state detection method, server and detection system
CN111949368A (en) Application program control method and device
CN113542256B (en) Method, device, equipment and storage medium for updating login credentials in client
CN107861827B (en) Card screen detection method, mobile terminal and computer readable storage medium
CN106686627B (en) WiFi/hotspot starting method and device
CN106603526B (en) WiFi/hotspot starting method and device
CN110308943B (en) Program running method and device, computing equipment and storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN110928787A (en) Automatic test script recording and playback method, device, equipment and storage medium
CN110018918B (en) Method and device for repairing terminal abnormity, mobile terminal and storage medium
CN112463348B (en) Timed task processing method and device
CN110740382B (en) Method, device, television and medium for avoiding undesired automatic restart of television
CN114184885A (en) Fault detection method, device and storage medium
CN104850551B (en) Data processing method and device and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant