Process processing method, device and electronic equipment

By creating a child process in the Linux environment and setting its priority termination parameters, the problem of child process and target process scoring when memory overflow is solved, service stability is improved, and service downtime caused by memory overflow is avoided.

CN112084058BActive Publication Date: 2024-08-27BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011013796.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-23
Publication Date
2024-08-27
Estimated Expiration
2040-09-23

AI Technical Summary

Technical Problem

In the Linux environment, when the memory usage is high, the process termination mechanism is easy to terminate the main process, resulting in poor service operation stability, and the existing solution fails to effectively adjust the scoring parameters of the child process and the target process when memory overflows, resulting in memory application failure and service failure. Downtime.

Method used

By creating a child process and setting its specified parameter value, it will be terminated before the target process when memory overflows, reducing the probability of the target process being terminated, using the OOM kill mechanism to release memory and improve service stability.

Benefits of technology

By terminating child processes first to release memory, the probability of the target process being terminated is reduced, the stability of service operation is improved, and service downtime caused by memory overflow is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112084058B
    Figure CN112084058B
Patent Text Reader

Abstract

The present invention provides a process processing method, device and electronic device, firstly creating a subprocess based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when the memory overflows, determine from the memory the process that needs to be terminated; then setting the parameter value of the designated parameter of the subprocess to a second parameter value; wherein the second parameter value has a designated numerical relationship with the first parameter value, so that when the memory overflows, the subprocess is terminated before the target process. In this method, the parameter values ​​of the designated parameters of the target process and the subprocess are set to have a designated numerical relationship, and when the memory overflows, the numerical relationship can make the subprocess in the service be terminated before the target process, and by terminating the subprocess to release the memory, the probability of the target process being terminated can be reduced, thereby improving the stability of the service operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer systems, and in particular to a process processing method, device and electronic equipment. Background Art

[0002] In the Linux environment, a large number of service processes are running in the system memory, including the main process of the service and the subprocesses created under the main process; when a new service needs to apply for memory, if the memory usage rate is very high and insufficient to provide sufficient memory for the new service, the memory application will fail, and the process termination mechanism will be triggered. This mechanism can terminate some of the processes currently running in the memory. Since the main process of the service runs for a long time and occupies a high amount of memory, the process termination mechanism can easily terminate the main process, which will cause the service to terminate, resulting in poor stability in service operation. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a process processing method, device and electronic device to improve the stability of service operation.

[0004] In a first aspect, an embodiment of the present invention provides a process processing method, the method comprising: creating a child process based on a target process; wherein the parameter value of a designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determining from memory a process that needs to be terminated; setting the parameter value of the designated parameter of the child process to a second parameter value; wherein the second parameter value has a specified numerical relationship with the first parameter value, so that when memory overflows, the child process is terminated before the target process.

[0005] Furthermore, the second parameter value is greater than the first parameter value, and a difference between the second parameter value and the first parameter value is greater than a preset threshold.

[0006] Furthermore, after the step of setting the parameter value of the designated parameter of the child process to the second parameter value, the method also includes: when the memory overflows, for each process running in the memory, based on the parameter value of the designated parameter of the process, calculating the score of the process; according to the score of each process, determining the process that needs to be terminated; wherein, the higher the score of the process, the greater the probability of being determined as a process that needs to be terminated; and terminating the determined process.

[0007] Further, when the second parameter value is greater than the first parameter value, the score of the subprocess is higher than the score of the target process.

[0008] Furthermore, after the step of creating a child process based on the target process, the method also includes: turning off the active deletion of expired keys function of the target process to reduce the probability of the process data of the target process being updated; wherein the active deletion of expired keys function is used to: delete the process data when the storage time of the process data of the target process in the memory reaches a specified time length.

[0009] Furthermore, after the step of turning off the active deletion of expired keys function of the target process, the method further includes: after the sub-process ends, turning on the active deletion of expired keys function of the target process.

[0010] Furthermore, the step of setting the parameter value of the designated parameter of the sub-process to the second parameter value includes: setting the parameter value of the designated parameter of the sub-process to the second parameter value through the target process or the sub-process.

[0011] In a second aspect, an embodiment of the present invention provides a process processing device, the device comprising: a child process creation module, used to create a child process based on a target process; wherein the parameter value of the specified parameter of the target process is a first parameter value; the specified parameter is used to indicate: when the memory overflows, determine from the memory the process that needs to be terminated; a parameter setting module, used to set the parameter value of the specified parameter of the child process to a second parameter value; wherein the second parameter value has a specified numerical relationship with the first parameter value, so that when the memory overflows, the child process is terminated before the target process.

[0012] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the process processing method of the first aspect.

[0013] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the process processing method of the first aspect.

[0014] The embodiments of the present invention bring the following beneficial effects:

[0015] A process processing method, device and electronic device provided by an embodiment of the present invention first creates a subprocess based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determine from memory the process that needs to be terminated; then set the parameter value of the designated parameter of the subprocess to a second parameter value; wherein the second parameter value has a designated numerical relationship with the first parameter value, so that when memory overflows, the subprocess is terminated before the target process. In this method, a designated numerical relationship is set between the parameter values ​​of the designated parameters of the target process and the subprocess, and when memory overflows, the numerical relationship can cause the subprocess in the service to be terminated before the target process, and by terminating the subprocess to release memory, the probability of the target process being terminated can be reduced, thereby improving the stability of the service operation.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flowchart of a process processing method provided by an embodiment of the present invention;

[0020] Figure 2 A flowchart of another process processing method provided by an embodiment of the present invention;

[0021] Figure 3 A flowchart of another process processing method provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of the structure of a process processing device provided by an embodiment of the present invention;

[0023] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] In Linux, the memory between parent and child processes usually adopts the COW (Copy On Write) mechanism, which saves a lot of memory space copies and reduces the use of service memory. However, when the parent process or the child process modifies the memory, the side effect of the COW mechanism will occur, that is, double occupation of memory will occur. For example, Redis (Remotedictionary server) is a full memory database. When the master and slave are fully replicated or backed up, a subprocess needs to be created to generate RDB (Relational Database). When the host's large-capacity instance memory and I / O (Input / Output) are tight, and the main process operates data, it will cause the side effect of the COW mechanism, that is, double memory copies, increasing the use of host memory. If the memory occupancy rate is very high at this time, it is not enough to provide sufficient memory for the new service, which will cause memory application failure. In severe cases, OOM (OutOf Memory) may occur. At this time, the process termination mechanism will be triggered, that is, the system will terminate some Redis instances with excessive memory usage, and even cause downtime; because the main process of the service has a long running time and high memory occupancy, the process termination mechanism can easily terminate the main process, and terminating the main process will cause the service to terminate, resulting in poor stability of service operation. Based on this, a process processing method, device and electronic device provided in an embodiment of the present invention can be applied to terminal devices such as mobile phones, computers, and servers.

[0026] To facilitate understanding of this embodiment, a process processing method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps:

[0027] Step S102, creating a child process based on the target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when the memory overflows, determining from the memory a process that needs to be terminated;

[0028] The above-mentioned memory overflow refers to the existence of unreclaimable memory or excessive memory in the application system, which eventually causes the memory required for program operation to be greater than the maximum memory available. At this time, the program cannot run, and the system will prompt a memory overflow. Sometimes the software will be automatically closed, and some memory will be released after restarting the computer or software, and the software can run normally again. Memory overflow errors caused by system configuration, data flow, user code, etc. cannot be avoided even if the user re-executes the task.

[0029] Since Linux has an OOM kill mechanism, this mechanism monitors processes that occupy too much memory, especially those that occupy memory very quickly, and then automatically terminates the process to prevent memory exhaustion. Specifically, when the system fails to apply for memory, a memory overflow will be triggered, which will in turn trigger an OOM killer event. This event will cause the system to score all service processes indiscriminately, including target processes and child processes, and terminate processes with higher scores. However, the commonly used solution at present is to directly fork child processes to back up data when backing up data with bgsave or bgrewriteaof and when synchronizing the master and slave in full, and will not adjust the main parameters that affect the score in the child process with memory overflow and the target process.

[0030] The above-mentioned specified parameter can be the oom_score_adj() function; the setting range of the parameter value of the specified parameter is usually (-1000, 1000); the parameter value of the specified parameter can determine whether the system terminates the running process when the memory overflows. Specifically, when the memory overflows, the scoring of the running process can usually be determined by the parameter value of the specified parameter. If the parameter value of the specified parameter is set to a negative number, it means that the final score will be discounted; if the parameter value of the specified parameter is set to a positive number, it means that the final score will increase and the process can be terminated first; if the parameter value of the specified parameter is set to zero, it means that the final score will not be adjusted.

[0031] Therefore, in actual implementation, when creating a child process based on the target process, or when the target process is started, the parameter value of the specified parameter of the target process can be set to a first parameter value through the target process. The first parameter value is a smaller value, such as -900; in addition, the timing for the target process to create a child process is usually when the master-slave full synchronization, Redis expired key problem, or bgsave and bgrewriteaof data saving tasks occur.

[0032] Step S104, setting the parameter value of the designated parameter of the child process to a second parameter value; wherein the second parameter value has a designated numerical relationship with the first parameter value, so that when memory overflows, the child process is terminated before the target process.

[0033] After setting the parameter value of the specified parameter of the target process, in order to avoid the target process being terminated when the memory overflows, it is also necessary to set the parameter value of the specified parameter of the child process to a second parameter value. The second parameter value is relatively large, for example, 1000. The second parameter value is usually set to be greater than the first parameter value, and the difference between the second parameter value and the first parameter value is greater than a preset threshold. The preset threshold can be set according to actual needs, such as 2000, 1000, etc. The functions of the specified parameters of the above-mentioned child process and the specified parameters of the aforementioned target process can both be the oom_score_adj() function.

[0034] A process processing method provided in this embodiment first creates a child process based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determine from memory the process that needs to be terminated; then set the parameter value of the designated parameter of the child process to a second parameter value; wherein the second parameter value has a designated numerical relationship with the first parameter value, so that when memory overflows, the child process is terminated before the target process. In this method, a designated numerical relationship is set between the parameter values ​​of the designated parameters of the target process and the child process, and when memory overflows, the numerical relationship can cause the child process in the service to be terminated before the target process, and by terminating the child process to release memory, the probability of the target process being terminated can be reduced, thereby improving the stability of the service operation.

[0035] This embodiment provides another process processing method, which is implemented on the basis of the above embodiment. This embodiment focuses on describing the specific implementation process of the step of setting the parameter value of the designated parameter of the subprocess to the second parameter value (implemented by step S204), and the implementation process of the steps after the step of setting the parameter value of the designated parameter of the subprocess to the second parameter value (specifically implemented by steps S206-S210), such as Figure 2 As shown, the method comprises the following steps:

[0036] Step S202, creating a child process based on the target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when the memory overflows, determining from the memory a process that needs to be terminated;

[0037] Step S204, setting the parameter value of the specified parameter of the sub-process to a second parameter value through the target process or the sub-process; wherein the second parameter value has a specified numerical relationship with the first parameter value, so that when the memory overflows, the sub-process is terminated before the target process;

[0038] The above-mentioned specified numerical relationship includes that the second parameter value is greater than the first parameter value, and the difference between the second parameter value and the first parameter value is greater than a preset threshold; it also includes that the badness scores of the sub-process and the target process determined by the second parameter value and the first parameter value have a specified numerical relationship, which may be that the badness score of the sub-process is greater than the badness score of the target process.

[0039] Specifically, a parameter setting task can be configured in the target process or child process in advance, so that after the target process creates a child process, the parameter value of the specified parameter of the child process can be set to a second parameter value through the target process or child process; wherein the second parameter value has a specified numerical relationship with the first parameter value, and the specified numerical relationship can make the score of the child process corresponding to the second parameter value greater than the score of the target process corresponding to the first parameter; so that when memory overflows, the process with the highest score is preferentially selected, and the process with the highest score is planted and run.

[0040] Step S206, when the memory overflows, for each process running in the memory, a score of the process is calculated based on the parameter values ​​of the specified parameters of the process;

[0041] When memory overflow occurs, that is, when the OOM kill mechanism is triggered, the OMM killer checks all running processes, and then calculates the score of each process, that is, the badness score, based on the parameter values ​​of the specified parameters of the process according to the preset algorithm. The scoring rules for calculating the process usually consist of two parts, including the memory usage of the process and the parameter values ​​of the specified parameters of the process. For example, processes that occupy more memory are calculated to have higher scores, while kernel processes and more important processes are calculated to have lower scores.

[0042] Step S208, determining the process that needs to be terminated according to the score of each process; wherein the higher the score of the process, the greater the probability of being determined as the process that needs to be terminated;

[0043] Step S210, terminating the determined process.

[0044] After calculating the scores of the target process and sub-processes, the process with the highest score is determined as the process that needs to be terminated according to the score. In addition, if there is still a memory overflow after the process with the highest score is terminated, the process with the highest score other than the process with the highest score can be determined as the process that needs to be terminated, and the determined process can be terminated until the memory overflow no longer occurs. This method can directly use the system's OOM kill mechanism to terminate the sub-processes of redundant tasks in the service, thereby freeing up some memory, which can reduce the pressure on the system, continue to maintain stable service capabilities, and improve the stability of service operation.

[0045] In addition, when the second parameter value is greater than the first parameter value, the score of the subprocess is higher than the score of the target process; at this time, the subprocess can be determined as a process that needs to be terminated to ensure the normal operation of the target process and maintain the stability of the main service.

[0046] In this method, during the service operation, the parameter value of the specified parameter of the target process is first set to a first parameter value. After a child process is created based on the target process, the parameter value of the specified parameter of the child process can be set to a second parameter value through the target process or the child process, wherein the second parameter value has a specified numerical relationship with the first parameter value, the second parameter value is greater than the first parameter value, and the difference between the second parameter value and the first parameter value is greater than a preset threshold value; so that when the memory overflows, the child process is terminated before the target process, thereby increasing the probability that the target process will not be terminated, and at the same time releasing a portion of the running memory, thereby improving the stability of the service operation while optimizing the memory shortage.

[0047] In addition, there is the problem of Redis expiration key, that is, Redis itself has a mechanism to set the time after which specific data is automatically deleted. When this automatic deletion mechanism generates bgsave and bgrewriteaof tasks and master-slave full synchronization, it will cause the problem of excessive COW, that is, the data in the master process will be automatically deleted when it expires. At this time, the master process will modify the memory, which will trigger the problem of memory replication.

[0048] For example, in the case of high QPS (Queries Per Second), the main process occupies more memory than the child process, and the Redis expired key problem will cause a large amount of cow to be generated in the memory, that is, double memory usage. When the system's OOM kill mechanism is triggered, the main process will be selected by the system with a high score and terminated, and then the service will be stopped.

[0049] Based on this, this embodiment also provides another process processing method, which is implemented on the basis of the above embodiment, such as Figure 3 As shown, the method comprises the following steps:

[0050] Step S302, creating a child process based on the target process;

[0051] Step S304, turning off the active deletion of expired keys function of the target process to reduce the probability of the process data of the target process being updated; wherein the active deletion of expired keys function is used to: when the storage time of the process data of the target process in the memory reaches a specified time length, delete the process data;

[0052] Because the service will not generate redundant memory sharing, if there are a large number of expired keys that are actively deleted, it may cause additional memory input to update process data; therefore, in order to prevent the target process from generating memory duplication and occupying memory space during operation, the target process can be made not to automatically delete expired keys; specifically, in the process of creating a child process based on the target process, the preset processing rules can be used to make the target process actively turn off the target process's active deletion of expired keys function, thereby reducing the probability of the target process's process data being updated and reducing the use of process memory.

[0053] Step S306, when the sub-process is finished running, the active deletion of expired keys function of the target process is enabled.

[0054] In order to enable the target process to restore the function of deleting expired keys after the subprocess ends, and delete the process data whose storage time exceeds the specified time; the function of actively deleting expired keys of the target process can be enabled through the target process settings after the subprocess ends.

[0055] It should be noted that Figure 1 and Figure 2 The method shown, and Figure 3 The method shown can be implemented simultaneously to achieve the purpose of process processing. That is, after creating a child process based on the target process, when the parameter value of the designated parameter of the target process is set to the first parameter value, the active deletion of expired keys of the target process can be turned off; in addition, after the parameter value of the designated parameter of the child process is set to the second parameter value and after the child process ends, the active deletion of expired keys of the target process can be turned on.

[0056] In the above method, in order to ensure the stability of the target process, the target process can be turned off to actively delete expired keys to reduce the probability of the target process's process data being updated; when the child process ends, the target process can be turned on to actively delete expired keys to reduce the probability of the target process's process data being updated, thereby avoiding the target process modifying memory and triggering memory replication, thereby improving the stability of service operation. For example, in the method of maintaining the stability of the Redis service, the stability of the main service can be maintained when the Redis feature consumes memory operations.

[0057] Corresponding to the above method embodiment, this embodiment provides a process processing device, such as Figure 4 As shown, the device comprises:

[0058] A subprocess creation module 41 is used to create a subprocess based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determine from the memory the process that needs to be terminated;

[0059] The parameter setting module 42 is used to set the parameter value of the specified parameter of the subprocess to a second parameter value; wherein the second parameter value has a specified numerical relationship with the first parameter value, so that when the memory overflows, the subprocess is terminated before the target process.

[0060] A process processing device provided by an embodiment of the present invention first creates a child process based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determine from memory the process that needs to be terminated; then set the parameter value of the designated parameter of the child process to a second parameter value; wherein the second parameter value has a designated numerical relationship with the first parameter value, so that when memory overflows, the child process is terminated before the target process. In this method, the parameter values ​​of the designated parameters of the target process and the child process are set to have a designated numerical relationship, and when memory overflows, the numerical relationship can cause the child process in the service to be terminated before the target process, and by terminating the child process to release memory, the probability of the target process being terminated can be reduced, thereby improving the stability of the service operation.

[0061] Furthermore, the second parameter value is greater than the first parameter value, and a difference between the second parameter value and the first parameter value is greater than a preset threshold.

[0062] Furthermore, the above-mentioned device also includes: a score calculation module, which is used to calculate the score of the process based on the parameter value of the specified parameter of each process running in the memory when the memory overflows; a process determination module, which is used to determine the process that needs to be terminated according to the score of each process; wherein, the higher the score of the process, the greater the probability of being determined as a process that needs to be terminated; and a termination module, which is used to terminate the determined process.

[0063] Further, when the second parameter value is greater than the first parameter value, the score of the subprocess is higher than the score of the target process.

[0064] Furthermore, the above-mentioned device also includes a closing module, which is used to turn off the active deletion of expired keys function of the target process to reduce the probability of the process data of the target process being updated; wherein, the active deletion of expired keys function is used to: when the storage time of the process data of the target process in the memory reaches a specified time length, the process data is deleted.

[0065] Furthermore, the above-mentioned device also includes an enabling module: used to enable the active deletion of expired keys function of the target process after the sub-process ends.

[0066] Furthermore, the parameter setting module is also used to: set the parameter value of the designated parameter of the sub-process to the second parameter value through the target process or the sub-process.

[0067] The process processing device provided in the embodiment of the present invention has the same technical features as the process processing method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0068] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above process processing method.

[0069] See also Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine executable instructions that can be executed by the processor 100. The processor 100 executes the machine executable instructions to implement the above process processing method.

[0070] Further, Figure 5 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0071] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0072] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0073] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned process processing method.

[0074] The computer program products of the process processing method, device and electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.

[0075] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0076] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0077] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0078] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0079] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A process processing method, characterized in that: The method comprises: Creating a child process based on a target process; wherein the parameter value of the designated parameter of the target process is a first parameter value; the designated parameter is used to indicate: when memory overflows, determining from the memory a process that needs to be terminated; Through the target process or the child process, the parameter value of the specified parameter of the child process is set to a second parameter value; wherein the second parameter value has a specified numerical relationship with the first parameter value, so that when memory overflows, the child process is terminated before the target process; the second parameter value is greater than the first parameter value, and the difference between the second parameter value and the first parameter value is greater than a preset threshold.

2. The method according to claim 1, characterized in that After the step of setting the parameter value of the designated parameter of the subprocess to a second parameter value, the method further comprises: When the memory overflows, for each process running in the memory, a score of the process is calculated based on the parameter value of the specified parameter of the process; Determine the process that needs to be terminated according to the score of each process; wherein the higher the score of the process, the greater the probability of being determined as the process that needs to be terminated; Terminates the identified process.

3. The method according to claim 2, characterized in that When the second parameter value is greater than the first parameter value, the score of the subprocess is higher than the score of the target process.

4. The method according to claim 1, characterized in that: After the step of creating a child process based on the target process, the method further includes: Turn off the active deletion of expired keys function of the target process to reduce the probability of the process data of the target process being updated; wherein, the active deletion of expired keys function is used to delete the process data when the storage time of the process data of the target process in the memory reaches a specified time length.

5. The method according to claim 4, characterized in that After the step of disabling the active deletion of expired keys function of the target process, the method further includes: after the subprocess ends running, enabling the active deletion of expired keys function of the target process.

6. A process processing device, characterized in that: The device comprises: A subprocess creation module is used to create a subprocess based on a target process; wherein the parameter value of the specified parameter of the target process is a first parameter value; the specified parameter is used to indicate: when memory overflows, determine from the memory the process that needs to be terminated; A parameter setting module is used to set the parameter value of the specified parameter of the sub-process to a second parameter value through the target process or the sub-process; wherein the second parameter value has a specified numerical relationship with the first parameter value so that when memory overflows, the sub-process is terminated before the target process; the second parameter value is greater than the first parameter value, and the difference between the second parameter value and the first parameter value is greater than a preset threshold.

7. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the process processing method according to any one of claims 1 to 5.

8. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the process processing method according to any one of claims 1 to 5.