CN112667388B - Protection method of operating system and electronic equipment - Google Patents

Protection method of operating system and electronic equipment Download PDF

Info

Publication number
CN112667388B
CN112667388B CN202110283148.0A CN202110283148A CN112667388B CN 112667388 B CN112667388 B CN 112667388B CN 202110283148 A CN202110283148 A CN 202110283148A CN 112667388 B CN112667388 B CN 112667388B
Authority
CN
China
Prior art keywords
type
identifier
operating system
electronic device
processor
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
CN202110283148.0A
Other languages
Chinese (zh)
Other versions
CN112667388A (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110283148.0A priority Critical patent/CN112667388B/en
Publication of CN112667388A publication Critical patent/CN112667388A/en
Application granted granted Critical
Publication of CN112667388B publication Critical patent/CN112667388B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a protection method of an operating system and electronic equipment, relates to the technical field of electronic equipment, and can improve the stability of the operating system. The specific scheme comprises the following steps: the first process may send a call request to the second process. And then, the second process responds to the call request of the first process and sends a callback request to the first process. If the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request, the electronic device may obtain the process information of the first process, and determine the process type of the first process according to the process information of the first process. And then, the electronic equipment can execute a preset processing function corresponding to the process type of the first process and wake up the second process. The awakened second process can receive the call of any process in the multiple processes, and multiple process types and preset processing functions corresponding to each process type can be stored in the electronic device.

Description

Protection method of operating system and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of electronic equipment, in particular to a protection method of an operating system and electronic equipment.
Background
With the development of electronic technology, most electronic devices (such as mobile phones, notebook computers, smart watches, etc.) are equipped with operating systems, and the operating systems can ensure the normal operation of the electronic devices.
In an operating system, two processes can call each other through Inter-Process Communication (IPC) to implement a service function. The operating system may include a plurality of system critical processes, each of which is used to implement one or more basic functions in the operating system. Typically, other processes (e.g., application processes), etc.) may invoke system critical processes to implement corresponding business functions. Of course, multiple system critical processes may also be intermodulated to implement corresponding service functions.
Take process 1 (e.g., an application process or a system critical process) invoking process 2 (e.g., a system critical process) as an example. In the process of calling the system critical process 2 by the process 1, if the process 1 is blocked, the system critical process 2 called by the process 1 may also be blocked. If the system critical process 2 becomes blocked, the system critical process 2 cannot be invoked by other processes. Thus, an operating system exception (e.g., an operating system is stuck, restarted, etc.) may be caused, which may seriously affect the user experience of using the electronic device.
Disclosure of Invention
The application provides a protection method of an operating system and electronic equipment, which can ensure that a key process of the system can normally run when a running process in the operating system is abnormal, and avoid the operating system from being abnormal.
In a first aspect, the present application provides a method for protecting an operating system, which may be applied to an electronic device installed with an operating system, where the operating system is configured to run a plurality of processes, where the plurality of processes includes a first process and a second process, and the second process makes a system critical process of the operating system.
In the method, a first process may send a call request to a second process, where the call request requests to call the second process. Thereafter, the second process may send a callback request to the first process in response to the call request of the first process. If the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request, the electronic device may obtain the process information of the first process, and determine the process type of the first process according to the process information of the first process, where the process information is used to indicate the process type of the first process, and the callback response message is used to respond to the callback request. And then, the electronic equipment can execute a preset processing function corresponding to the process type of the first process and wake up the second process. The awakened second process can receive the call of any process in the multiple processes, and multiple process types and preset processing functions corresponding to each process type can be stored in the electronic device.
Based on the above technical solution, in the process of calling back the first process by the second process, if the first process is blocked, which causes the second process (i.e. the system critical process) to be in a blocked state, the electronic device may wake up the second process. In this way, when other processes running in the operating system invoke the second process, the second process can communicate with other processes invoking the second process to complete the associated business function. Thus, the operating system can be prevented from being abnormal (such as the operating system is stuck, restarted and the like).
And the electronic equipment can execute a corresponding preset processing function according to the process type of the first process. Therefore, a scheme for waking up the second process can be added, and the stability of the operating system is improved.
With reference to the first aspect, in one possible design manner, the multiple process types include a first type of process, a second type of process, a third type of process, and a fourth type of process. Wherein, the blocking influence degree of the process belonging to different process types is different, and the blocking influence degree is as follows: the degree of influence on the normal operation of the operating system when the process is in a blocked state.
It should be noted that the blocking influence degree of the first class of process is greater than the blocking influence degree of the second class of process, the blocking influence degree of the second class of process is higher than the blocking influence degree of the third class of process, and the blocking influence degree of the third class of process is higher than the blocking influence degree of the fourth class of process.
With reference to the first aspect, in another possible design manner, the method for enabling the electronic device to execute the preset processing function corresponding to the process type of the first process includes: if the first process is the first-class process, the electronic device may obtain a process identifier of the second process, and restart the second process according to the process identifier of the second process.
It can be understood that if the first process is a first type of process, the blocking impact of the first process is higher. Therefore, the electronic device can restart the second process and recall the first process through the second process so as to ensure that the related service functions can normally run and improve the stability of the operating system.
If the first process is the second type of process, the electronic device may obtain a process identifier of the first process, which is called back by the second process. The electronic device may then terminate the invocation of the first process by the second process based on the process identification of the first process.
It will be appreciated that if the first process is a process of the second type, this indicates that the first process has a relatively high degree of blocking impact. Therefore, the electronic device can wake the second process by terminating the call of the first process, so that the abnormity of the operating system is avoided.
If the first process is a third-class process, the electronic device may obtain a process identifier of the second process, and restart the second process according to the process identifier of the second process.
It will be appreciated that if the first process is a process of the third type, this indicates that the first process has a relatively low blocking impact. However, the third category of processes (e.g., alarm clock processes, etc.) is important for the user's use. Therefore, the electronic device can restart the second process and recall the first process through the second process so as to ensure that the related service functions can normally run and improve the stability of the operating system.
If the first process is a fourth-class process, the electronic device may obtain a process identifier of the first process, which is called back by the second process. And then, the electronic equipment can check and kill the first process according to the process identification of the first process.
It can be understood that if the first process is a fourth type process, it means that the first process has a low blocking effect. Therefore, the electronic equipment can rapidly wake up the second process by killing the first process, and the abnormal condition of the operating system is avoided.
With reference to the first aspect, in another possible design manner, the process information includes a type value and an application identifier. The method for determining the process type of the first process by the electronic device according to the process information of the first process includes: if the type value of the first process is smaller than the first preset type value, the electronic device may determine that the first process is the first type process. If the type value of the first process is greater than the first preset type value, the electronic device may determine the process type of the first process according to the application identifier of the first process.
With reference to the first aspect, in another possible design manner, the method for determining, by the electronic device, the process type of the first process according to the application identifier of the first process includes: if the application identifier of the first process is the first preset identifier, the electronic device may determine that the first process is the second type of process. If the application identifier of the first process is the second preset identifier, the electronic device may determine that the first process is the third type of process. If the application identifier of the first process is the third preset identifier, the electronic device may determine that the first process is a fourth type of process.
It will be appreciated that the electronic device may distinguish the type of process by a process type value and a process identification. Therefore, the electronic equipment can wake up the second process by adopting different preset processing functions according to the process type, a scheme for waking up the second process is added, and the stability of the operating system is improved.
With reference to the first aspect, in another possible design manner, the second process is a first-class process. That is, the above-described system critical processes may be attributed to the first class of processes.
In a second aspect, the present application provides an electronic device, where the electronic device is installed with an operating system, and the operating system is configured to run a plurality of processes, where the plurality of processes includes a first process and a second process, and the second process is a system critical process of the operating system. The electronic device includes: a memory and a processor, the memory coupled to the processor; the memory is for storing computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the method as set forth in the first aspect and any one of its possible designs.
In a third aspect, the present application provides a chip system, which is applied to an electronic device. The system-on-chip includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line. The interface circuit is configured to receive a signal from a memory of the electronic device and to transmit the signal to the processor, the signal including computer instructions stored in the memory. When executed by a processor, the computer instructions cause an electronic device to perform the method according to the first aspect and any of its possible designs.
In a fourth aspect, the present application provides a computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method according to the first aspect and any one of its possible design forms.
In a fifth aspect, the present application provides a computer program product for causing a computer to perform the method according to the first aspect and any one of its possible designs when the computer program product runs on the computer.
It should be understood that beneficial effects that can be achieved by the electronic device according to the second aspect and any one of the possible design manners of the electronic device according to the second aspect, the chip system according to the third aspect, the computer storage medium according to the fourth aspect, and the computer program product according to the fifth aspect may refer to the beneficial effects of the first aspect and any one of the possible design manners of the electronic device, and are not described herein again.
Drawings
FIG. 1 is a schematic diagram of interprocess communication provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of another interprocess communication provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of another interprocess communication provided by an embodiment of the present application;
fig. 4 is a schematic diagram of an example of a display interface of an electronic device according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another interprocess communication provided by an embodiment of the present application;
fig. 6 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 7 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
FIG. 8 is a schematic diagram of another interprocess communication provided by an embodiment of the present application;
fig. 9 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 10 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 11 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 12 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 13 is a flowchart of a method for protecting an operating system according to an embodiment of the present application;
fig. 14 is a schematic composition diagram of a protection device for an operating system according to an embodiment of the present disclosure;
fig. 15 is a schematic structural component diagram of a chip system according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
The "/" character in this application generally indicates that the former and latter associated objects are in an "or" relationship. For example, A/B may be understood as A or B.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "e.g.," is intended to present concepts in a concrete fashion.
With the development of electronic technology, most electronic devices (such as mobile phones, notebook computers, smart watches, etc.) are equipped with operating systems, and the operating systems can ensure the normal operation of the electronic devices. In an operating system, two processes can call each other through Inter-Process Communication (IPC) to implement a service function. The operating system may include a plurality of system critical processes, each of which is used to implement one or more basic functions in the operating system. Typically, other processes (e.g., application processes), etc.) may invoke system critical processes to implement corresponding business functions. Of course, multiple system critical processes may also be intermodulated to implement corresponding service functions.
However, in the process of invoking the process 2 by the process 1, when the process 1 is blocked or otherwise abnormal, the process 2 invoked by the process 1 may be blocked, so that the operating system is abnormal (for example, the operating system is jammed, restarted, etc.), and the use experience of the user is seriously affected.
Illustratively, as shown in fig. 1, in the process of invoking the process 2 by the process 1 of the electronic device (e.g., a mobile phone), the process 1 may send an invocation request to the process 2. Thereafter, process 2 of the handset may receive the call request from process 1 and send a callback request to process 1. After the mobile phone receives the callback request from the process 2, if the process 1 does not respond to the callback request of the process 2 for a long time (for example, 10 seconds), an exception may occur in the operating system of the mobile phone.
For example, as shown in fig. 2, process 101 may be process 1, process 102 may be process 2, and the cell phone may invoke process 2 through process 1. If the process 101 is a screen recording application process, the screen recording application process is used for receiving the content displayed on the screen of the mobile phone; the process 102 is a surfaceflicker process for capturing content of a screen display of a cell phone. When the screen recording application is started, the screen recording application process can request the display content of the screen from the surfefringer process. The surfaceflicker process may then send the display content of the screen to the screen recording application process. If the screen recording application process is blocked, so that the screen recording application process does not send a response message to the surfaceflicker process within the preset time length, the mobile phone can determine that the surfaceflicker process calls the screen recording application process overtime, and the surfaceflicker process is in a blocked state. As a result, the operating system of the handset 100 may also become blocked.
It should be noted that when a process (e.g., process 2) of the electronic device calls back another process (e.g., process 2) to time out, process 2 may be blocked, and process 2 may be in a blocked state. In this way, the other processes of the electronic device cannot call the process 2, which causes an exception to the operating system of the electronic device.
Illustratively, as shown in fig. 3, in the process of process 2 calling back process 1, process 1 is in a blocking state, which causes process 2 calling back process 1 to timeout, resulting in process 2 being in a blocking state. If the process 2 is in the blocked state and the processes 3 and 4 are also calling the process 2, the processes 3 and 4 cannot communicate with the process 2. For example, as shown in fig. 4, the screen recording interface 103 displayed by the cell phone 100 includes a video 104. When the surfdeflinger process (i.e., the process 2) is in the blocked state, the mobile phone 100 receives an operation (for example, the process 3 calls the surfdeflinger process) returning to the main interface, and the surfdeflinger process cannot accept the call of the process 3, so that the mobile phone 100 still displays the screen recording interface 103 and cannot display the main interface.
At present, in a conventional technical solution, when the time length of an exception occurring in an operating system is longer than 120 seconds, a process of the operating system restarts the operating system. Alternatively, when an abnormality occurs in the operating system, the electronic device may restart the electronic device (i.e., restart the operating system) in response to a restart operation by the user (e.g., long-pressing of a lock screen key).
However, in the above conventional solutions, when the operating system is abnormal, the operating system needs to be restarted. Therefore, not only the service function cannot be realized, but also the user needs to spend time waiting for the system to restart, and the use experience of the user using the electronic equipment is seriously influenced.
To this end, an embodiment of the present application provides a method for protecting an operating system, which may be applied to an electronic device installed with an operating system, where the operating system is used to run a plurality of processes. In the method, in the process that one process (such as process 1) of the electronic equipment calls another process (such as process 2), if the process 1 does not send a callback response message to the process 2 in time, the electronic equipment can wake up the process 2. Therefore, the process 2 can receive the calls of other processes, so that the normal operation of the operating system is guaranteed, the abnormity of the operating system is avoided, and the stability of the operating system is improved.
It should be noted that when the electronic device wakes up the process 2, the process 2 is in a wake state (i.e., a non-blocking state). While process 2 is in the wake state, process 2 can accept calls from other processes. Therefore, normal operation of the operating system can be guaranteed.
For example, the electronic device installed with the operating system in the embodiment of the present application may be a tablet computer, a mobile phone, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, an in-vehicle device, and the like, and the embodiment of the present application does not particularly limit the specific form of the electronic device. Moreover, the operating systems may be Android systems, Linux systems, Hongmon systems, and the like, and the embodiments of the present application do not limit the operating systems. In the following embodiment, the method provided by the application is introduced by taking the operating system as an Android system.
The execution main body of the protection method of the operating system provided by the application can be a protection device of the operating system, and the execution device can be an electronic device provided with the operating system. Meanwhile, the execution device may also be a Central Processing Unit (CPU) of the electronic device, or a control module for maintaining an operating system in the electronic device. In the embodiment of the present application, a protection method for an operating system executed by a processor is taken as an example, and the protection method for an operating system provided in the embodiment of the present application is described.
In the embodiment of the application, the processor can realize inter-process call and management (for example, inter-process call between the process 1 and the process 2) by calling the cross-process management interface. Fig. 5 is a schematic diagram illustrating an example of inter-process communication according to an embodiment of the present application. As shown in FIG. 5, suppose the cross-process management interface is a binder interface. In the process of process 1 (also referred to as a first process) calling process 2 (also referred to as a second process), the first process may send a call request to the second process by calling a binder interface to call the second process. Similarly, the second process may also send a callback request to the first process by calling the binder interface to call the first process. And after the first process receives the callback request from the second process, the first process can also send a callback response request to the second process by calling the binder interface to indicate that the first process has received the callback request. When the second process receives the callback response message from the first process, the processor may determine that the first process has completed the call-back with the second process.
The second process is a system critical process of the operating system. The system key process is used for supporting the basic affairs of the operating system such as managing and configuring the memory, controlling the input device and the output device, operating the network and managing the file system. For example, the system key process may be SystemServer, SurfaceFinler, MediaServer, or the like.
It should be noted that, if the first process is in the blocking state when receiving the callback response message, which may cause the second process (i.e., the system critical process) to not receive the callback response message from the first process for a long time, the second process may be in the blocking state. Therefore, other processes in the electronic device cannot call the second process, so that the operating system is abnormal.
In this embodiment of the application, if the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request to the first process, the processor may wake up the second process to ensure that the operating system can normally operate. As shown in fig. 6, the protection method of the operating system includes: S301-S305.
S301, the first process sends a calling request to the second process.
Wherein the call request is for requesting a call to a second process.
It should be noted that, for the description of the process of sending the call request from the first process to the second process, reference may be made to the description of fig. 5 in the foregoing embodiment, which is not described herein again.
S302, the second process sends a callback request to the first process.
The callback request is used for indicating the second process to call the first process. The callback request may include data, instructions, and the like, which is not limited in this embodiment of the present application. Illustratively, if the first process is a screen recording application process, the second process is a surfaceflinger process. The mobile phone can call a screen recording application process through the surfefringer process, and send data of the recorded display screen to the screen recording application process.
In this embodiment, the second process may send a callback request to the first process in response to the call request of the first process, so as to respond to the call of the first process.
It should be noted that, for the description that the second process sends the callback request process to the first process, reference may be made to the description of fig. 5 in the foregoing embodiment, which is not described herein again.
S303, the processor judges whether the second process receives the callback response message from the first process within the preset time length after the second process sends the callback request.
Wherein the callback response message is responsive to the received callback request.
In some embodiments, the processor may monitor, via the timer, whether the second process receives the callback response message from the first process within a preset time period after the second process sends the callback request to the first process. For example, the processor may start the monitor process to set the timer when the second process sends a callback request to the first process. The processor may then determine, based on the time value in the timer, the time it takes for the second process to wait to receive the callback response message (which may be referred to as a call duration for short) from sending the callback request. Then, the processor may monitor, according to the time value in the timer, whether the second process can receive the callback response message from the first process within a preset time period after the second process sends the callback request to the first process.
It should be noted that the preset time period may be 5 seconds, 8 seconds, 10 seconds, and the like, which is not limited in the embodiment of the present application. The above-described manner of setting the timer in the embodiment of the present application is not limited. For example, the processor may set the timer through the alarm timer mechanism. As another example, the processor may set a timer using a select function, a sleep function, or the like.
For example, if the preset time period is 8 seconds. The processor may start timing (e.g., from 0 seconds) when the second process sends a callback request to the first process. If the time value in the timer is 8 seconds, the second process does not receive the callback response message from the first process, and the processor may determine that the second process does not receive the callback response message within the preset time length, and the second process calls back the first process to be overtime. If the time value in the timer is less than 8 seconds, the second process receives the callback response message from the first process, and the processor can determine that the second process receives the callback response message within the preset time length, so that the second process can normally run.
In a possible design, if the second process receives the callback response message from the first process within a preset time period after the second process sends the callback request to the first process, the processor may execute S304. If the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request to the first process, the processor may execute S305.
It can be understood that, by monitoring whether the second process receives the callback response message of the first process within the preset time, the processor can determine whether the second process has callbacks to the first process and times out in time, and then execute the corresponding processing function, so as to ensure that the operating system can operate normally.
S304, the processor determines that the second process is in the awakening state.
It should be noted that, when the second process is in the wake state, the second process may communicate with any process running in the operating system.
It can be understood that, if the second process receives the callback response message from the first process within the preset time length after the second process sends the callback request to the first process, it indicates that the second process has called back the first process without timeout, and the processor may determine that the second process is in the wake state. That is, the second process may communicate with any process running in the operating system, which is capable of running normally.
S305, the processor wakes up the second process.
In this embodiment of the present application, if the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request to the first process, the processor may determine that the second process is in the blocking state.
It should be noted that, when the second process is in the blocked state, other processes running in the operating system cannot call the second process to complete the service function. Thus, an exception may be caused to the operating system. Thus, when the processor determines that the second process is in the blocked state, the processor may wake the second process.
In this embodiment, the processor may execute a predetermined processing function to wake up the second process. That is, after the processor executes the predetermined processing function, the state of the second process may be updated from the blocking state to the wake state. And the awakened second process can receive the call of any process in a plurality of processes running in the operating system.
In this way, when other processes running in the operating system invoke the second process, the second process can communicate with other processes invoking the second process to complete the associated business function. Therefore, the operating system can be prevented from being abnormal (such as the operating system is stuck and restarted), and the stability of the operating system is improved.
In some embodiments, the processor may wake the second process by killing the first process, ending the second process 'call to the first process' relationship. As shown in fig. 7, S305 may include: S401-S402.
S401, the processor obtains a process identifier of a first process called back by a second process.
It should be noted that, in the embodiment of the present application, each process corresponds to one process identifier, and the process identifiers of the processes are different. For example, the process identification of the first process is 111 and the process identification of the second process is 112. And when the second process sends a callback request to the first process (i.e. the second process calls the first process), the processor may store the calling relationship identifier of the second process, the called process, the process identifier of the called process, and the corresponding relationship between the calling durations. And the calling relation identification is used for indicating the calling relation between the second process and other processes. For example, the calling relationship identifier of the second process is 001, which is used to indicate that the calling relationship exists between the second process and the first process.
Illustratively, as shown in table 1, it shows the corresponding relationship between the calling relationship identifier of the second process, the called process, the process identifier of the called process and the calling duration.
TABLE 1
Figure 594006DEST_PATH_IMAGE001
That is, when the calling relationship is identified as 001, the second process is instructed to call the first process, the process identification of the first process is 111, and the calling duration is 8 seconds (timeout). When the calling relation is 002, the second process is instructed to call the third process, and the process identifier of the third process is 113, and the calling time length is 3 seconds. When the calling relation is marked as 003, the second process is used for indicating that the second process calls the fourth process, the process mark of the fourth process is 114, and the calling time length is 1.5 seconds.
In this embodiment, the processor may identify the first process by the process identifier of the first process. For example, the processor may obtain the process identification of the first process through the lookup interface. The processor may then identify the first process based on the process identification of the first process. For example, in conjunction with table 1, the lookup interface may obtain the correspondence in table 1, and determine that the process identifier of the first process that called the timeout is 111.
S402, the processor kills the first process according to the process identification of the first process.
In this embodiment, the processor may kill the first process according to the process identifier of the first process. For example, the processor may kill the process corresponding to the process identification of the first process via the killing interface. For example, the process id of the first process may be pid, and the processor may kill the first process through interfaces such as pthread _ kill (pid, SIGQ), android.
After the processor kills the first process, the second process can communicate with other processes. Illustratively, in conjunction with FIG. 3, as shown in FIG. 8, after the processor kills process 1, no communication will take place between process 2 and process 1. Also, process 3 and process 4 may communicate with process 2.
It is understood that after the processor kills the first process (i.e., the first process stops running), the calling relationship existing between the second process and the first process also ends. Therefore, after the processor kills the first process, the second process cannot continue to wait for the callback response message of the first process, so that the second process can callback the first process to be overtime, and the second process is in a blocking state. That is, after the processor kills the first process, the processor may wake the second process, enabling the second process to communicate with other processes. Therefore, in the embodiment of the application, the processor can wake up the second process in time, so that the abnormality of the operating system is avoided, and the stability of the operating system is improved.
In some embodiments, the processor may invoke the first process by terminating the second process, waking the second process. As shown in fig. 9, S305 may further include: S601-S602.
S601, the processor obtains a process identifier of a first process called back by a second process.
It should be noted that, for the process of acquiring the process identifier of the first process called back by the second process, reference may be made to the description of the process identifier of the first process that is acquired by the processor and called back by the second process in S401, which is not described herein again.
S602, the processor terminates the calling of the first process through the second process according to the process identification of the first process.
For example, the processor may terminate the second process from calling the process corresponding to the process identification of the first process through the cross-process management interface. Specifically, for the process in which the processor terminates the process of calling the first process through the second process according to the process identifier of the first process, reference may be made to a process of terminating the process calling by the processor in the conventional technology, which is not described herein again.
It will be appreciated that after the processor terminates the invocation of the first process by the second process, the second process will not continue to wait for the callback response message of the first process, causing the second process to callback the timeout of the first process, resulting in the second process being in a blocked state. That is, after the processor terminates the second process to invoke the first process, the processor may wake the second process to enable the second process to communicate with other processes. Therefore, in the embodiment of the application, the processor can wake up the second process in time, so that the abnormality of the operating system is avoided, and the stability of the operating system is improved.
In some embodiments, the predetermined processing function executed by the processor may restart the second process to wake up the second process. As shown in fig. 10, S305 may further include: S701-S702.
S701, the processor acquires the process identification of the second process.
In this embodiment of the application, when the second process sends the callback request to the first process (that is, the second process calls the first process), the processor may store the call relationship identifier of the second process, the process identifier of the second process, the called process, the process identifier of the called process, and the correspondence between the call durations.
Illustratively, as shown in table 2, it shows the corresponding relationship between the calling relationship identifier of the second process, the process identifier of the second process, the called process, the process identifier of the called process and the calling duration.
TABLE 2
Figure 979988DEST_PATH_IMAGE002
It should be noted that, when the second process calls the first process, the processor may only store the process identifier and the call duration of the second process. In this way, the processor can still determine whether the second process has called back for timeout, thereby executing the corresponding pre-set processing function on the second process.
In this embodiment, the processor may identify the second process by the process identifier of the second process. For example, the processor may obtain the process identification of the second process through the lookup interface. The processor may then identify the second process based on the process identification of the second process. For example, in conjunction with table 2, the lookup interface may obtain the correspondence in table 2, and determine that the process identifier of the second process that called the timeout is 112.
S702, the processor restarts the second process according to the process identification of the second process.
It should be noted that, the method for restarting the second process by the processor is not limited in the embodiment of the present application. For example, the processor may restart the second process by restarting a module, thread, etc. in the second process based on the process identification of the second process. As another example, the processor may restart the second process by initializing the second process. As another example, the processor may initiate a backup recovery mechanism to restart the second process.
It can be appreciated that after the processor restarts the second process, the second process does not continue to wait for the callback response message of the first process, causing the second process to call back the first process to timeout, causing the second process to be in a blocked state. That is, after the processor terminates the second process to invoke the first process, the processor may wake the second process to enable the second process to communicate with other processes. Therefore, in the embodiment of the application, the processor can wake up the second process in time, so that the abnormality of the operating system is avoided, and the stability of the operating system is improved.
In other embodiments, the processor stores a plurality of process types and a preset processing function corresponding to each process type. The processor may execute a preset processing function corresponding to the process type of the first process according to the process type of the first process.
In this embodiment, the processor may divide the plurality of processes into a first type of process, a second type of process, a third type of process, and a fourth type of process according to a blocking influence degree of each process running in the operating system. Wherein, the blocking influence degree of the process is as follows: the degree of influence on the normal operation of the operating system when the process is in a blocked state. The blocking influence degrees of the first class process, the second class process, the third class process and the fourth class process are different, and the blocking influence degrees of the first class process to the fourth class process are reduced in sequence. Specifically, the blocking influence degree of the first type of process is higher than that of the second type of process; the blocking influence degree of the second type of process is higher than that of the third type of process; the degree of influence of blocking of the processes of the third type is higher than that of the processes of the fourth type.
It should be noted that, in the embodiment of the present application, the process types of the first process and the second process are not limited. For example, the first process is a first type of process and the second process is a second type of process. For another example, the first process and the second process are both a first type of process.
It should be noted that the first type of process, the second type of process, and the third type of process in this embodiment are all processes of an embedded application installed in an electronic device (i.e., a system application of the electronic device). The fourth type of process in the embodiment of the present application is a process of a downloadable application. The downloadable application refers to an application that can be run on the terminal device. Each downloadable application program runs in an independent process, has an independent memory address space, and can call a system key process of an operating system to realize a corresponding service function. The downloadable application may be an application pre-installed in the terminal or a third party application that may be downloaded by the user and installed in the terminal.
For example, the first type of process may be a system critical process (e.g., a system process and a subsystem process) for supporting an operating system to process basic transactions such as managing and configuring memory, controlling input devices and output devices, operating a network, and managing a file system. For example, the system key process may be SystemServer, SurfaceFinler, MediaServer, or the like. The second type of process may be a resident system application process (e.g., a screen locking process) and a core system application process (e.g., a phone process, a short message process, etc.). The third kind of process may be a common system application process, such as a calendar process, a clock process, a setup process, and the like. The fourth type of application process may be a third-party application process, such as a social application process, a media playing process, a shopping process, and the like.
The following describes a process in which the processor executes a corresponding preset processing function according to the process type of the first process. As shown in fig. 11, after S303, the method further includes: S801-S804.
S801, the processor judges whether the first process is the first type process.
In one possible design, if the first process is a first type of process, the processor may perform the above steps S701 and S702. That is, the processor may wake the second process by restarting the second process. If the first process is a non-first type process, the processor may perform S802.
It can be understood that if the first process is a first type of process, the blocking impact of the first process is higher. Therefore, the processor can restart the second process and recall the first process through the second process so as to ensure that the related service functions can normally run and improve the stability of the operating system.
S802, the processor judges whether the first process is a second type process.
In one possible design, if the first process is a second type of process, the processor may perform the above S601 and S602. That is, the processor may terminate invoking the first process by the second process, waking the second process. If the first process is a non-second type process, the processor may execute S803.
It will be appreciated that if the first process is a process of the second type, this indicates that the first process has a relatively high degree of blocking impact. Therefore, the processor can wake the second process by terminating the call of the first process, and the abnormity of the operating system is avoided.
S803, the processor judges whether the first process is a third process.
In one possible design, if the first process is a third type of process, the processor may perform the above steps S701 and S702. That is, the processor may wake the second process by restarting the second process. If the first process is a non-third class process, the processor may perform S804.
It will be appreciated that if the first process is a process of the third type, this indicates that the first process has a relatively low blocking impact. However, the third type of process is a general system process (e.g., an alarm clock process, etc.), which is important for the user to use. Therefore, the processor can restart the second process and recall the first process through the second process so as to ensure that the related service functions can normally run and improve the stability of the operating system.
S804, the processor judges whether the first process is a fourth type process.
In one possible design, if the first process is a process of the fourth type, the processor may perform the above S401 and S402. That is, the processor may wake the second process by killing the first process.
It can be understood that if the first process is a fourth type process, it means that the first process has a low blocking effect. Therefore, the processor can quickly wake up the second process by killing the first process, and the abnormal condition of the operating system is avoided.
It should be noted that, in the embodiment of the present application, the order of executing S801-S804 by the processor is not limited. For example, the processor may perform S801, then S802, then S803, and then S804. For another example, the processor may simultaneously execute S801 to S804, which is not limited in this embodiment.
It should be noted that the method provided in the embodiment of the present application can also be applied to other types of processes in the operating system besides the first type of process, the second type of process, the third type of process, and the fourth type of process, and the embodiment of the present application is not limited to this. A method for a processor to determine a process type of a first process in an embodiment of the present application is described below.
In this embodiment, the processor may determine the process type of the first process by using the process information of the first process. The process information is used for indicating the type of the process, and each process corresponds to one process information.
In some embodiments, the process information includes a type value. Each process corresponds to a type value, and the type values corresponding to the processes are different. Illustratively, the type value may be a User Identification (UID). The system process (e.g. the first class process) and the application process (e.g. the second class process, the third class process, and the fourth class process) in the operating system both correspond to a User Identification (UID), and the UID of the application process starts from 10000. That is, the processor may determine whether the process type of the first process is a system process (e.g., a first class process) by a user identification (i.e., a type value) of the first process. As shown in fig. 12, after S303, the method further includes: and S901-S903.
S901, the processor obtains the type value of the first process.
It should be noted that, when the second process sends the callback request to the first process (that is, the second process calls the first process), the processor may store the call relationship identifier of the second process, the called process, the process identifier of the called process, the type value of the called process, and the correspondence between the call durations.
Illustratively, in conjunction with table 1, as shown in table 3, it shows the corresponding relationship between the calling relationship identifier of the second process, the called process, the process identifier of the called process, the type value of the called process, and the calling duration.
TABLE 3
Figure 759725DEST_PATH_IMAGE003
That is, the type value of the first process is 500, the type value of the third process is 3000, and the type value of the fourth process is 20000. For the description of other data in table 2, reference may be made to the description of table 1, which is not repeated herein.
For example, the processor may obtain the type value of the first process through a lookup interface. For example, in conjunction with table 2, the lookup interface may obtain the correspondence in table 1, and determine that the type value of the first process that called the timeout is 500.
S902, the processor judges whether the type value of the first process is larger than a first preset type value.
In one possible design, if the type value of the first process is greater than the first predetermined type value, the processor performs step S903. If the type value of the first process is smaller than the first preset type value, the processor determines that the first process is a non-first type process (for example, a second type process, a third type process and a fourth type process), and executes S802-S804. Illustratively, suppose the first predetermined type value is 10000. As can be seen from table 1, the type values of the first processes are all smaller than the first preset type value, and the processor may execute S903. If the first default type value is 10000, the type value of the first process is 15000. The first process is a non-first class process.
S903, the processor determines that the first process is a first type process.
That is, if the type value of the first process is smaller than the first preset type value, the processor determines that the blocking impact degree of the first process is higher.
In this embodiment of the present application, the first class of processes may include a first level process and a second level process, and a blocking influence degree of the first level process is greater than a blocking influence degree of the second level process. The processor may determine a process type of the first process based on the first preset type value and the second preset type value. Wherein the first predetermined type value is greater than the second predetermined type value.
In one possible design, the processor may determine that the first process is a first level process if the type value of the first process is less than a second predetermined type value. If the type value of the first process is greater than the second preset type value and less than the first preset type value, the processor may determine that the first process is a second-level process. Illustratively, if the first predetermined type value is 10000, the second predetermined type value is 1000. As can be seen from table 1, the first process and the third process are both the first type of process. The first process is a first-level process, and the third process is a second-level process.
It will be appreciated that the processor may distinguish the type of process by its type value. Therefore, the processor can wake up the second process by adopting different preset processing functions according to the process type, so that the scheme of waking up the second process is added, and the stability of the operating system is improved.
It should be noted that each application process in the operating system corresponds to one application program, and each application program corresponds to one application identifier, where the application identifier is used to indicate the type of the application program. That is, the application identification may also be used to indicate the type of process.
In some embodiments, in order that the processor may identify processes other than the first type of process (e.g., processes of the second type, processes of the third type, etc.), the processor may further determine a process type of the first process according to a type value of the first process and an application identifier of the first process. That is, the process information may include not only the type value but also the application identification. As shown in fig. 13, after S903, the method further includes S904-S910.
S904, the processor obtains the application identification of the first process.
In some embodiments, the processor may parse each application in the electronic device and obtain an application identification of the application process through an application management Service (PMS). For example, the processor may obtain the application identifier of the social application process by parsing the application corresponding to the social application process.
S905, the processor determines whether the application identifier of the first process is a first preset identifier.
In one possible design, if the application identifier of the first process is the first predetermined identifier, the processor performs S910. If the application identifier of the first process is not the first predetermined identifier, the processor performs S908.
S906, the processor determines whether the application identifier of the first process is a second preset identifier.
In one possible design, if the application identifier of the first process is the second preset identifier, the processor executes S911. If the application identifier of the first process is not the second preset identifier, the processor executes S909.
S907, the processor determines whether the application identifier of the first process is a third preset identifier.
In a possible design, if the application identifier of the first process is the third preset identifier, the processor performs S910.
In the embodiment of the present application, the processor does not limit the order of executing S905 to S907. For example, the processor may first perform S905, then perform S906, and then perform S907. For another example, the processor may first execute S905, then execute S907, and then execute S906. For another example, the processor may first execute S906, then execute S905, and then execute S907. For another example, the processor may first execute S906, then execute S907, and then execute S905. For another example, the processor may execute S905, S906, and S907 at the same time.
S908, the processor determines that the first process is a second type process.
And S909, the processor determines that the first process is the third type process.
S910, the processor determines that the first process is a fourth type process.
Based on the technical scheme, the processor can distinguish the type of the process through the type value and the process identification of the process. Therefore, the processor can wake up the second process by adopting different preset processing functions according to the process type, so that the scheme of waking up the second process is added, and the stability of the operating system is improved.
In some embodiments, the method provided by the embodiment of the present application may also be applied to a process of performing interaction among a plurality of electronic devices. That is, the first process and the second process may be processes in different electronic devices in which operating systems are installed. Wherein the first process may be a process in a first device and the second process may be a process in a second device. In the process of interaction between the first device and the second device, the first process of the first device calls the second process of the second device. In the process of the first device calling the second process, the second process of the second device may send a callback request to the first process. If the callback response message from the first process is not received within the preset time length after the second process of the second device sends the callback request to the first process, the second device can wake up the second process.
It should be noted that, for the description of the second device waking up the second process when the multiple electronic devices interact with each other, reference may be made to the description in the foregoing embodiment, which is not described herein again.
It can be understood that, when the second process of the second device is in the blocked state, the second device may wake up the second process, so as to avoid the second device from generating an exception. Therefore, other electronic equipment can still interact with the second equipment to realize the service function, and the use experience of the user is improved.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of electronic equipment. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those skilled in the art will readily appreciate that the exemplary operating system protection method steps described in connection with the embodiments disclosed herein may be implemented in hardware or a combination of hardware and computer software. Whether a function is performed as hardware or as software driven hardware in an electronic device depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the protection device of the operating system may be divided into functional modules or functional units according to the above method examples, for example, each functional module or functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module or a functional unit. The division of the modules or units in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Please refer to fig. 14, which illustrates a schematic diagram of a protection device of an operating system according to an embodiment of the present application. The protection device of the operating system may be a functional module in the electronic device, which is used to implement the method according to the embodiment of the present application. As shown in fig. 14, the protection apparatus of the operating system may include: a communication unit 1001, a processing unit 1002, and an acquisition unit 1003.
The communication unit 1001 is used to support the electronic device to execute a process calling another process through one process in the operating system. For example, the communication unit 1001 is used to support the electronic device to perform S301, S302 in the above-described method embodiments, and/or other processes for the techniques described herein.
The processing unit 1002 is configured to support the electronic device to perform: waking up the process, judging the type of the process in the operating system, and the like. For example, the processing unit 1002 is configured to support the electronic device to perform S303, S304, S305, S402, S602, S701, S702, S801, S802, S803, S804, S902, S903, S905, S906, S907, S908, S909, S910, and/or other processes for the techniques described herein in the above-described method embodiments.
The obtaining unit 1003 is configured to support the electronic device to perform: process information of a process is acquired. For example, the obtaining unit 1003 is used to support the electronic device to perform S401, S601, S901, S904 in the above method embodiments, and/or other processes for the techniques described herein.
Other embodiments of the present application provide an electronic device. The electronic device may include: a memory and one or more processors. The memory is coupled to the processor. The electronic device may further include a camera. The memory is for storing computer program code comprising computer instructions. When the processor executes the computer instructions, the electronic device may perform various functions or steps performed by the mobile phone in the above-described method embodiments.
Embodiments of the present application further provide a chip system, as shown in fig. 15, where the chip system includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 may be interconnected by wires. For example, the interface circuit 1102 may be used to receive signals from other devices (e.g., a memory of an electronic device). As another example, the interface circuit 1102 may be used to send signals to other devices (e.g., the processor 1101). Illustratively, the interface circuit 1102 may read instructions stored in the memory and send the instructions to the processor 1101. The instructions, when executed by the processor 1101, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the electronic device, the electronic device is enabled to execute each function or step executed by the mobile phone in the foregoing method embodiment.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute each function or step executed by the mobile phone in the above method embodiments.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are 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 integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. The protection method of the operating system is characterized by being applied to electronic equipment provided with the operating system, wherein the operating system is used for running a plurality of processes, the plurality of processes comprise a first process and a second process, and the second process is a system key process of the operating system; the process types of the plurality of processes include: the method comprises the following steps of a first type process, a second type process, a third type process and a fourth type process; the method comprises the following steps:
the first process sends a calling request to the second process, and the calling request is used for requesting to call the second process;
the second process responds to the calling request of the first process and sends a callback request to the first process so as to respond to the calling of the first process;
if the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request, the electronic equipment acquires the process information of the first process and determines the process type of the first process according to the process information of the first process; wherein the process information is used for indicating the process type of the first process, and the callback response message is used for responding to the callback request;
if the first process is the first-class process, the electronic equipment acquires a process identifier of the second process, and restarts the second process according to the process identifier of the second process;
if the first process is the second type process, the electronic equipment acquires a process identifier of the first process called back by the second process;
the electronic equipment terminates the calling of the first process through the second process according to the process identification of the first process;
if the first process is the third type process, the electronic equipment acquires a process identifier of the second process, and restarts the second process according to the process identifier of the second process;
if the first process is the fourth type process, the electronic device acquires a process identifier of the first process called back by the second process;
the electronic equipment checks and kills the first process according to the process identification of the first process;
wherein, the blocking influence degrees of the processes belonging to different process types are different; the blocking influence degree is as follows: the degree of influence on the normal operation of the operating system when the process is in a blocked state; the blocking influence degree of the first class process is higher than that of the second class process, the blocking influence degree of the second class process is higher than that of the third class process, and the blocking influence degree of the third class process is higher than that of the fourth class process.
2. The method of claim 1, wherein the process information comprises a type value and an application identification;
the electronic equipment determines the process type of the first process according to the process information of the first process, and the method comprises the following steps:
if the type value of the first process is smaller than a first preset type value, the electronic equipment determines that the first process is a first type process;
and if the type value of the first process is larger than a first preset type value, the electronic equipment determines the process type of the first process according to the application identifier of the first process.
3. The method according to claim 2, wherein the determining, by the electronic device, the process type of the first process according to the application identifier of the first process if the type value of the first process is greater than a first preset type value includes:
if the application identifier of the first process is a first preset identifier, the electronic equipment determines that the first process is a second type of process;
if the application identifier of the first process is a second preset identifier, the electronic equipment determines that the first process is a third type of process;
and if the application identifier of the first process is a third preset identifier, the electronic equipment determines that the first process is a fourth type of process.
4. A method according to any of claims 1-3, wherein the second process is the first class of process.
5. An electronic device is characterized in that an operating system is installed in the electronic device, the operating system is used for running a plurality of processes, the plurality of processes comprise a first process and a second process, and the second process is a system key process of the operating system; the process types of the plurality of processes include: the method comprises the following steps of a first type process, a second type process, a third type process and a fourth type process; the electronic device includes: a memory and one or more processors; the memory coupled with the processor, the memory to store computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to:
the first process sends a calling request to the second process, and the calling request is used for requesting to call the second process;
the second process responds to the calling request of the first process and sends a callback request to the first process so as to respond to the calling of the first process;
if the second process does not receive the callback response message from the first process within the preset time length after the second process sends the callback request, acquiring the process information of the first process, and determining the process type of the first process according to the process information of the first process; wherein the process information is used for indicating the process type of the first process, and the callback response message is used for responding to the callback request;
if the first process is the first-class process, acquiring a process identifier of the second process, and restarting the second process according to the process identifier of the second process;
if the first process is the second type process, acquiring a process identifier of the first process called back by the second process; according to the process identification of the first process, terminating the calling of the first process through the second process;
if the first process is the third type process, acquiring a process identifier of the second process, and restarting the second process according to the process identifier of the second process;
if the first process is the fourth type process, acquiring a process identifier of the first process called back by the second process; checking and killing the first process according to the process identifier of the first process;
wherein, the blocking influence degrees of the processes belonging to different process types are different; the blocking influence degree is as follows: the degree of influence on the normal operation of the operating system when the process is in a blocked state; the blocking influence degree of the first class process is higher than that of the second class process, the blocking influence degree of the second class process is higher than that of the third class process, and the blocking influence degree of the third class process is higher than that of the fourth class process.
6. The electronic device of claim 5, wherein the process information comprises a type value and an application identification; the computer instructions, when executed by the one or more processors, cause the electronic device to further perform the steps of:
if the type value of the first process is smaller than a first preset type value, determining that the first process is a first type process;
and if the type value of the first process is larger than a first preset type value, determining the process type of the first process according to the application identifier of the first process.
7. The electronic device of claim 6, wherein the computer instructions, when executed by the one or more processors, cause the electronic device to further perform the steps of:
if the application identifier of the first process is a first preset identifier, determining that the first process is a second type of process;
if the application identifier of the first process is a second preset identifier, determining that the first process is a third type of process;
and if the application identifier of the first process is a third preset identifier, determining that the first process is a fourth type of process.
8. The electronic device of any of claims 5-7, wherein the second process is the first class of process.
9. A computer storage medium comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-4.
CN202110283148.0A 2021-03-16 2021-03-16 Protection method of operating system and electronic equipment Active CN112667388B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110283148.0A CN112667388B (en) 2021-03-16 2021-03-16 Protection method of operating system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110283148.0A CN112667388B (en) 2021-03-16 2021-03-16 Protection method of operating system and electronic equipment

Publications (2)

Publication Number Publication Date
CN112667388A CN112667388A (en) 2021-04-16
CN112667388B true CN112667388B (en) 2021-06-01

Family

ID=75399600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110283148.0A Active CN112667388B (en) 2021-03-16 2021-03-16 Protection method of operating system and electronic equipment

Country Status (1)

Country Link
CN (1) CN112667388B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246557A (en) * 2012-02-07 2013-08-14 腾讯科技(深圳)有限公司 Method and device for calling application information in cross process mode
CN105159786A (en) * 2015-07-03 2015-12-16 北京奇虎科技有限公司 Method and device for inter-process communication
CN107807861A (en) * 2017-10-31 2018-03-16 努比亚技术有限公司 Freeze screen solution method, mobile terminal and computer-readable recording medium
WO2019061407A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Method and device for handling timeout of system service

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989214A (en) * 2009-07-30 2011-03-23 鸿富锦精密工业(深圳)有限公司 Process management system
CN102117240B (en) * 2009-12-31 2016-01-20 腾讯科技(深圳)有限公司 A kind of method and device obtaining progress blocking information
CN107908478B (en) * 2017-11-30 2021-11-16 努比亚技术有限公司 Memory cleaning method, mobile terminal and computer readable storage medium
CN112231103A (en) * 2020-10-16 2021-01-15 苏州浪潮智能科技有限公司 Storage thread management method, system, terminal and storage medium based on state lock

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246557A (en) * 2012-02-07 2013-08-14 腾讯科技(深圳)有限公司 Method and device for calling application information in cross process mode
CN105159786A (en) * 2015-07-03 2015-12-16 北京奇虎科技有限公司 Method and device for inter-process communication
WO2019061407A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Method and device for handling timeout of system service
CN107807861A (en) * 2017-10-31 2018-03-16 努比亚技术有限公司 Freeze screen solution method, mobile terminal and computer-readable recording medium

Also Published As

Publication number Publication date
CN112667388A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US10932196B2 (en) Method for reducing power consumption of mobile terminal, storage medium and mobile terminal
CN107766128B (en) Method and device for starting application
CN109542744B (en) Method, device, storage medium and terminal for detecting abnormal starting problem of terminal
CN106569585B (en) A kind of method and terminal managing program process
CN107450839B (en) Control method and device based on black screen gesture, storage medium and mobile terminal
US8549356B2 (en) Method and system for recovery of a computing environment via a hot key sequence at pre-boot or runtime
CN107844341B (en) Process starting control method and device, storage medium and mobile terminal
CN110096329B (en) Display content control method, electronic device and computer readable storage medium
CN101663643A (en) Methods and systems to selectively scrub a system memory
CN114281431A (en) Function calling method, device, medium, embedded equipment and operating system
CN113467981A (en) Exception handling method and device
CN112667388B (en) Protection method of operating system and electronic equipment
CN115686877A (en) Data interaction method and device, storage medium and computing equipment
CN113412480B (en) Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN111783090A (en) Information processing method and device, equipment and storage medium
CN111400037A (en) Memory management method and device, computer storage medium and terminal
CN108132803B (en) Timing keep-alive and awakening method, system, terminal and medium based on mobile terminal
CN116679992A (en) Information processing method and device, electronic equipment and storage medium
CN110659082A (en) Application program interface display method and device, terminal and storage medium
CN113221042B (en) Webpage operation process recording method and device, electronic equipment and computer readable medium
CN110704247B (en) Processing method and device for application memory exception, electronic equipment and device
CN112199078A (en) Toast message pushing method and device based on android fragment component and computer equipment
CN107608726A (en) Monitoring method, device, electronic equipment and storage medium
US10986221B2 (en) Execution of testing processes on apparatuses

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