Process priority management method and device, equipment and medium
By using the first kernel socket in the operating system to receive data and adjust process priorities, the problem that process priority management in the prior art cannot ensure the normal use of system resources is solved, and the performance of computing equipment is improved.
Patent Information
- Application Number
- CN202411337228.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, process priority management methods cannot ensure the normal use of system resources by various processes in the system, affecting the performance of computing equipment.
Receive data through the first kernel socket, determine whether there is priority scheduling information, and adjust the priority of the first and second processes based on this information to ensure that the process can process system resources in a timely manner.
It realizes that when a process of preset type occurs, it adjusts its priority in real time, and adjusts the priority of other preset type processes to ensure the normal use of system resources and improves system performance.
Smart Images

Figure CN119473570A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a process priority management method, device, equipment and medium. Background Art
[0002] In an operating system, a reasonable configuration of process priority can optimize system performance, improve the response speed of key tasks, and thus improve user satisfaction. In related technologies, processes usually do not change priority during operation, and do not change dynamically with the system operation scenario. Such a mechanism will not schedule low-priority processes when high-priority processes are busy and exhaust CPU resources, which will affect the real-time response of low-priority processes. Therefore, the priority management method in related technologies cannot guarantee the normal use of system resources by various processes in the system, affecting the performance of computing devices. Summary of the invention
[0003] The embodiment of the present application provides an implementation scheme different from the related art to solve the technical problem that the priority management method in the related art cannot guarantee the normal use of system resources by various processes in the system, thereby affecting the performance of the computing device.
[0004] In a first aspect, the present application provides a process priority management method, comprising:
[0005] Receive data through the first kernel socket;
[0006] Determining whether first priority scheduling information exists in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type;
[0007] If so, the priorities of the first process and a second process of a second type are adjusted based on the first priority scheduling information, where the second process is a process that is involved when the first process is running.
[0008] In a second aspect, the present application provides a process priority management device, comprising:
[0009] A data receiving unit, configured to receive data via a first kernel socket;
[0010] a determining unit, configured to determine whether first priority scheduling information exists in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type;
[0011] A priority adjustment unit is used to adjust the priority of the first process and a second process of a second type based on the first priority scheduling information if it is determined that the first kernel socket has first priority scheduling information, where the second process is a process involved when the first process is running.
[0012] In a third aspect, the present application provides an electronic device, including:
[0013] Processor; and
[0014] A memory, configured to store executable instructions of the processor;
[0015] The processor is configured to execute the first aspect, or any method in any possible implementation manner of the first aspect, by executing the executable instructions.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the first aspect, or any method in any possible implementation manner of the first aspect.
[0017] The present application provides receiving data through a first kernel socket; determining whether there is first priority scheduling information in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type; if so, adjusting the priority of the first process and the second process of a second type based on the first priority scheduling information, wherein the second process is a scheme of processes involved when the first process runs, and when the first process of the first type receives data through the first kernel socket, simultaneously triggering adjustment of the priority of the first process and the second process of the second type, thereby achieving the technical effect of adjusting the priority of the process in real time when a process of a preset type occurs, and adjusting the priority of processes of other preset types, ensuring the normal use of system resources by various processes in the system, improving the process execution speed of the system, and thus improving the performance of the computing device. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 A flowchart of a process priority management method provided in one embodiment of the present application;
[0020] Figure 2 A schematic diagram of the principle of a process priority management method provided in one embodiment of the present application;
[0021] Figure 3 A schematic diagram of the structure of a process priority management device provided in one embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.
[0024] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that this scheme is implemented in other orders in addition to the order illustrated or described in the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0025] Regardless of whether the process is the default priority or the high priority, the priority will not change during operation, and will not change dynamically with the system operation scenario. This mechanism will affect the real-time response of low-priority processes when high-priority processes are busy and exhaust CPU resources. When all real-time processes are set to high priority, high-priority processes will preempt each other for scheduling regardless of whether they need resources, and the priority mechanism will lose its effect. At the same time, when there are a large number of high-priority processes in the system, it will make it more difficult for low-priority processes to be scheduled.
[0026] In order to solve this technical problem, the present application provides a process priority management method, device, equipment and medium, which classifies the processes and adjusts the priorities of the first process and the second process of the second type at the same time when the first process of the first type receives data through the first kernel socket corresponding to the first process, so that the first process can be processed in a timely manner. This is used to solve the technical problem that the priority management method in the related technology cannot guarantee the normal use of system resources by various processes in the system, thereby affecting the computing performance of the system, so as to achieve the technical effect of ensuring the normal use of system resources by various processes in the system and improving the computing performance of the system.
[0027] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0028] Figure 1 A flowchart of a process priority management method provided for an exemplary embodiment of the present application is provided. The method may be applicable to a computing device. The method at least includes the following S11-S13:
[0029] S11, receiving data through the first kernel socket;
[0030] The first kernel socket is a socket corresponding to the first process of the first type in the kernel socket subsystem, wherein the kernel socket subsystem is a subsystem in the operating system kernel responsible for processing network communication operations related to the socket.
[0031] The data received by the first kernel socket is the data received during the processing of the first process, and the first kernel socket will retrieve the received data back to the user space for processing.
[0032] The type of the first kernel socket can be any type, that is, the address family type, socket type or protocol type corresponding to the first kernel socket can be any type, for example, the address family type can be AF_INET or AF_LOCAL, and the protocol type can be Transmission Control Protocol (TCP) or User Datagram Protocol (UDP).
[0033] S12, determining whether first priority scheduling information exists in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type;
[0034] When the first kernel socket receives data, it is detected whether there is first priority scheduling information in the first kernel socket, where the first priority scheduling information indicates priority scheduling information of a first process of a first type.
[0035] In some embodiments, the first process whose process type is the first type is a process that uses socket as a communication means to communicate messages with other processes or systems and handle transactions. In this application, the process whose process type is the first type is called a transaction process, and the first process belongs to a transaction process.
[0036] The first priority scheduling information is information related to the priority adjustment of the first process transmitted by the relevant personnel to the kernel socket subsystem corresponding to the first process through the option setting function when the first process creates the first kernel socket. The specific parameters can be reasonably set according to the transaction processing needs of the first process. When the first process receives data through the first kernel socket, the kernel socket subsystem adjusts the priority of the first process according to the first priority adjustment information.
[0037] More specifically, when the first process creates a socket corresponding to the first process, relevant personnel can transmit the first priority scheduling information corresponding to the first process to the kernel socket subsystem through the setsockopt function.
[0038] S13: If yes, adjust the priorities of the first process and a second process of the second type based on the first priority scheduling information, where the second process is a process involved when the first process is running.
[0039] In some embodiments, the first priority scheduling information includes: a first initial priority, a first scheduling priority of the first process when the first kernel socket receives data, and a first priority recovery time from the first scheduling priority to the first initial priority. In S13, adjusting the priority of the first process based on the first priority scheduling information includes:
[0040] The priority of the first process is adjusted from a first initial priority to a first scheduling priority; after the first process is at the first scheduling priority and a first priority recovery time, the priority of the first process is restored to the first initial priority.
[0041] In some embodiments, in order to ensure that the first process can be processed in time when receiving data through the first kernel socket, it is necessary to increase the priority of the first process at this time. Therefore, compared with the first scheduling priority, the first initial priority corresponds to a lower priority, and the first scheduling priority corresponds to a higher priority. Further, after the first process is at the first scheduling priority and the first priority recovery time, the priority of the first process is restored to the first initial priority, including: when the priority of the first process is adjusted to the first scheduling priority, a timer corresponding to the first process is started, and after the timer corresponding to the first process reaches the first priority recovery time, the priority of the first process is restored from the first scheduling priority to the first initial priority.
[0042] In the method provided in the present application, when a priority adjustment operation for a first process is triggered, the priority of a second process whose process type is a second type is adjusted simultaneously.
[0043] Specifically, the process type of the second type is the process involved when the transaction process performs transaction processing, including, for example: the processes required for most transaction processes to perform transaction processing (such as message center processes) and the processes that have a negative impact on most transaction processes (such as processes that occupy a large amount of resources). In this application, the process type of the second type is called a busy process. When a busy process is executed, there are usually frequent data receiving operations through the socket. In this application, the above-mentioned second process belongs to a busy process.
[0044] In some embodiments, the second process is a process in a preset kernel module, and the second priority scheduling information corresponding to the second process is registered in the preset kernel module when the second process is started.
[0045] The preset kernel module is a kernel module for managing and scheduling busy processes, providing a process information registration interface, a process information deregistration interface and a priority adjustment interface to the system globally, and the second process is a busy process.
[0046] More specifically, the process information registration interface is used to register the process information and priority adjustment information of the busy process into a preset kernel module when the busy process is started, wherein the process information of the busy process is used to uniquely indicate the busy process, such as including the process ID or the process name, etc., and the priority adjustment information of the busy process is used to adjust the priority of the busy process, such as including the initial priority and the scheduling priority;
[0047] The process information deregistration interface is used to delete the process information and priority scheduling information of the busy process from the preset kernel module when the busy process is destroyed;
[0048] The priority adjustment interface is used to call the priority adjustment interface when the kernel socket subsystem triggers a priority adjustment operation for the transaction process, so that the preset kernel module adjusts the priority of all busy processes in the preset kernel module.
[0049] In some embodiments, adjusting the priority of the second process includes:
[0050] The priority of the second process is adjusted based on the second priority scheduling information.
[0051] In a specific embodiment provided by the present application, the second priority scheduling information includes: a second initial priority, a second scheduling priority to which the second process is adjusted when the priority of the second process is adjusted, which is triggered when the first process performs a priority adjustment, and adjusting the priority of the second process whose process type is the second type in the preset kernel module based on the second priority scheduling information includes:
[0052] The priority of the second process is adjusted from the second initial priority to the second scheduling priority.
[0053] If the second process is a process needed by the first process to perform transaction processing, then compared with the second scheduling priority, the second initial priority corresponds to a lower priority, and the second scheduling priority corresponds to a higher priority; if the second process is a process that has a negative impact on the first process, then compared with the second scheduling priority, the second initial priority corresponds to a higher priority, and the second scheduling priority corresponds to a lower priority.
[0054] In some embodiments, the second process registers the second priority scheduling information to the preset kernel module, including: if the second process belongs to the kernel process, the second priority scheduling information can be registered to the preset kernel module by directly calling the process information registration interface of the preset kernel module; if the second process belongs to the upper-level process, the process information registration interface of the preset kernel module can be indirectly called through the option setting function of the socket created by the second process to register the second priority scheduling information to the preset kernel module.
[0055] When the busy process registers its own priority scheduling information in the preset kernel module, the process information of the busy process itself is also registered in the preset kernel module.
[0056] Furthermore, when a priority adjustment operation is triggered for a transaction process (eg, a first process), the kernel socket subsystem synchronously calls the priority adjustment interface of a preset kernel module to adjust the priority of each busy process in the preset kernel module, and the second process is one of the busy processes.
[0057] In some embodiments, a unique registration chain for storing priority scheduling information and process information of each busy process is maintained in the preset kernel module. The busy process registers its own priority scheduling information in the preset kernel module, specifically including: the busy process registers its own priority scheduling information in the registration chain in the kernel module. For example, for the second process, the second process registers the second priority scheduling information in the preset kernel module, specifically including: the second process registers the second priority scheduling information in the registration chain in the preset kernel module.
[0058] In some embodiments, the method further comprises:
[0059] When the second process is destroyed, the second priority scheduling information is deleted from the preset kernel module.
[0060] In the above embodiment, the second priority scheduling information is registered to the registration chain of the preset kernel module. When the second process is destroyed, the second priority scheduling information is deleted from the preset kernel module, including: deleting the second priority scheduling information from the registration chain in the preset kernel module.
[0061] When the second process is destroyed, its own process information will also be deleted from the preset kernel module. Specifically, its own process information will be deleted from the registration chain in the preset kernel module.
[0062] More specifically, when the second process is destroyed, the process information deregistration interface may be called to delete the process information and the second priority scheduling information of the second process from the registration chain in the preset kernel module.
[0063] The priority recovery time for the second process to recover to the second initial priority is determined according to the priority recovery time of the transaction process. In some embodiments, the priority of the second process is recovered to the second initial priority only when all transaction processes with priority scheduling information in the kernel socket subsystem are recovered to the initial priority.
[0064] In some embodiments, when adjusting the priority of the first process based on the first priority scheduling information, the method further includes:
[0065] At the same time, the priority of a third process of a third type is adjusted, and the third process is a process associated with the first process.
[0066] Compared with busy processes, relatively few transaction processes will involve processes of the third type, which are not suitable for registration as second type processes. In this application, processes of the third type may be referred to as transaction-associated processes.
[0067] In the present application, there is a corresponding relationship between a transaction process and a transaction-associated process. Different transaction processes may correspond to different transaction-associated processes. At the same time, a transaction-associated process may have multiple transaction processes corresponding to the transaction-associated process. For example, when transaction process 1 is performing transaction processing, the process type to be used is the third type of process including process A, then the transaction-associated process corresponding to transaction process 1 can be set to include process A, and when transaction process 2 is performing transaction processing, the process type to be used is the third type of process including process A and process B, then the transaction-associated process corresponding to transaction process 2 can be set to include process A and process B.
[0068] In the present application, each transaction-associated process corresponding to the first process is referred to as a third process. It should be noted that when the first process receives data through the first kernel socket, it is necessary to adjust the priorities of all transaction-associated processes corresponding to the first process at the same time, that is, it is necessary to adjust the priorities of each third process at the same time.
[0069] In some embodiments, the method further comprises:
[0070] While registering the first priority scheduling information in the kernel socket subsystem, registering the third priority scheduling information corresponding to the third process in the kernel socket subsystem;
[0071] Adjust the priority of the third process, including:
[0072] The priority of the third process is adjusted based on the third priority scheduling information.
[0073] Specifically, while registering the first priority scheduling information of the first process to the kernel socket subsystem through option setting, the process information and third priority scheduling information of each third process corresponding to the first process are also registered to the kernel socket subsystem, wherein the process information of the third process includes information such as the process name or process ID for uniquely identifying the third process, and the kernel socket subsystem adjusts the priority of the third process according to the third priority scheduling information.
[0074] In some embodiments, the third priority scheduling information includes a third initial priority and a third scheduling priority, and adjusting the priority of a third process of the third type based on the third priority scheduling information includes: adjusting the priority of the third process from the third initial priority to the third scheduling priority.
[0075] In some embodiments, the method further comprises:
[0076] For each third process, while the priority of the third process is adjusted to the third scheduling priority, the operating system starts a timer corresponding to the third process, and the timer corresponds to the priority recovery time of the third process. When the timer reaches the priority recovery time, the third process is restored from the third scheduling priority to the third initial priority. Among them, the priority recovery time corresponding to the timer is determined according to the priority recovery time of the transaction process corresponding to the third process. For example, the transaction process corresponding to the third process includes process 1 and process 2. Process 1 occurs (i.e., data is received through the socket), and the priority recovery time corresponding to process 1 is 3s. At this time, the priority recovery time corresponding to the timer corresponding to the third process is 3s. Process 2 occurs 1s after process 1 occurs, and the priority recovery time corresponding to process 2 is 4s. Considering both process 1 and process 2, the priority recovery time corresponding to the timer corresponding to the third process is 4s.
[0077] In some embodiments, the method further comprises:
[0078] Obtaining a preset system performance indicator for indicating a current system load state;
[0079] Adjusting the priority of the first process based on the first priority scheduling information includes:
[0080] The priority of the first process is adjusted based on the preset system performance indicator and the first priority scheduling information.
[0081] By determining the priority scheduling information used to adjust the priority of the first process according to the current system load state, the priority of the first process when it occurs can be adjusted more reasonably, and the device performance can be further optimized.
[0082] Among them, the current system load status is used to describe the current operating status and load conditions of the computing device. The preset system performance indicators are indicators that can indicate the current system load status, for example, including one or more of the following: CPU utilization, memory utilization, disk I / O utilization, etc.
[0083] In some embodiments, the preset system performance indicator is CPU utilization, and adjusting the priority of the first process based on the preset system performance indicator and the first priority scheduling information includes:
[0084] When the CPU usage is lower than the preset CPU usage threshold, the priority of the first process is adjusted based on the first priority scheduling information. When the CPU usage is not lower than the preset CPU usage threshold, the target priority scheduling information is determined, and the priority of the first process is adjusted based on the target priority scheduling information.
[0085] In some embodiments, the first priority scheduling information includes a first initial priority, a first scheduling priority, and a first priority recovery time, and the target priority scheduling information includes a target initial priority, a target scheduling priority, and a target priority recovery time. In order to ensure that the first process is scheduled faster, the priority corresponding to the target scheduling priority is higher than the first scheduling priority, and the target priority recovery time is greater than the first priority recovery time.
[0086] The present application provides a method for receiving data through a first kernel socket; determining whether there is first priority scheduling information in the first kernel socket, wherein the first priority scheduling information indicates the priority scheduling information of a first process of a first type; if so, adjusting the priority of the first process and the second process of the second type based on the first priority scheduling information, wherein the second process is a process scheme involved when the first process runs, and when the first process of the first type receives data through the first kernel socket, simultaneously triggering the adjustment of the priority of the first process and the second process of the second type, thereby achieving the technical effect of adjusting the priority of the process in real time when a preset type of process occurs, and adjusting the priority of other preset types of processes, ensuring the normal use of system resources by various processes in the system, improving the process execution speed of the system, and thus improving the performance of the computing device.
[0087] Figure 2 A schematic diagram of a process priority management method provided by an exemplary embodiment of the present application is shown in FIG. Figure 2 , the figure shows n transaction processes, k transaction-associated processes corresponding to transaction process 1, and m busy processes, where:
[0088] Each transaction process can register the priority scheduling information corresponding to each transaction process into the kernel socket subsystem through the option setting function. When transaction process 1 receives data through the socket, the kernel socket subsystem will adjust the priority of transaction process 1. At the same time, it will adjust the priority of the k transaction-associated processes corresponding to transaction process 1 and the m busy processes in the preset kernel module.
[0089] Specifically, for the k transaction-associated processes corresponding to transaction process 1, the priority adjustment of the transaction-associated processes is completed directly through the kernel socket subsystem. For the m busy processes, the kernel socket subsystem calls the priority adjustment interface provided by the preset kernel module to the system globally, so that the preset kernel module adjusts the priority of the busy process.
[0090] For the specific technical implementation details of this embodiment, please refer to the above content, and this application will not go into details here.
[0091] Figure 3 A schematic diagram of the structure of a process priority management device provided for an exemplary embodiment of the present application;
[0092] The device comprises:
[0093] A data receiving unit 31, configured to receive data via a first kernel socket;
[0094] A determining unit 32 is configured to determine whether there is first priority scheduling information in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type;
[0095] The priority adjustment unit 33 is used to adjust the priority of the first process and the second process of the second type based on the first priority scheduling information if it is determined that the first kernel socket has the first priority scheduling information, where the second process is a process involved when the first process is running.
[0096] In some embodiments, the first priority scheduling information includes: a first initial priority, a first scheduling priority of the first process when the first kernel socket receives data, and a first priority recovery time from the first scheduling priority to the first initial priority. When the device is used to adjust the priority of the first process based on the first priority scheduling information, it is specifically used to:
[0097] adjusting the priority of the first process from the first initial priority to the first scheduling priority;
[0098] After the first process is at the first scheduling priority and the first priority recovery time, the priority of the first process is restored to the first initial priority.
[0099] In some embodiments, the device is further used to:
[0100] Obtaining a preset system performance indicator for indicating a current system load state;
[0101] The adjusting the priority of the first process based on the first priority scheduling information includes:
[0102] The priority of the first process is adjusted based on the preset system performance indicator and the first priority scheduling information.
[0103] In some embodiments, the second process is a process in a preset kernel module, and the second priority scheduling information corresponding to the second process is registered in the preset kernel module when the second process is started. When the device is used to adjust the priority of the second process, it is specifically used to:
[0104] The priority of the second process is adjusted based on the second priority scheduling information.
[0105] In some embodiments, the device is further used to:
[0106] When the second process is destroyed, the second priority scheduling information is deleted from the preset kernel module.
[0107] In some embodiments, when adjusting the priority of the first process based on the first priority scheduling information, the apparatus is further configured to:
[0108] At the same time, the priority of a third process of a third type is adjusted, and the third process is a process associated with the first process.
[0109] In some embodiments, the device is further used to:
[0110] While registering the first priority scheduling information with the kernel socket subsystem, registering the third priority scheduling information corresponding to the third process with the kernel socket subsystem;
[0111] The adjusting the priority of the third process includes:
[0112] The priority of the third process is adjusted based on the third priority scheduling information.
[0113] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.
[0114] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
[0115] Figure 4 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:
[0116] The memory 401 and the processor 402, the memory 401 is used to store the computer program and transmit the program code to the processor 402. In other words, the processor 402 can call and run the computer program from the memory 401 to implement the method in the embodiment of the present application.
[0117] For example, the processor 402 may be configured to execute the above method embodiments according to instructions in the computer program.
[0118] In some embodiments of the present application, the processor 402 may include but is not limited to:
[0119] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0120] In some embodiments of the present application, the memory 401 includes but is not limited to:
[0121] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0122] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 401 and executed by the processor 402 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0123] like Figure 4 As shown, the electronic device may also include:
[0124] The transceiver 403 may be connected to the processor 402 or the memory 401 .
[0125] The processor 402 may control the transceiver 403 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 403 may include a transmitter and a receiver. The transceiver 403 may further include an antenna, and the number of antennas may be one or more.
[0126] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0127] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
[0128] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.
[0129] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0130] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0131] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0132] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0133] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A process priority management method, characterized in that: include: Receive data through the first kernel socket; Determining whether first priority scheduling information exists in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type; If so, the priorities of the first process and a second process of a second type are adjusted based on the first priority scheduling information, where the second process is a process that is involved when the first process is running.
2. The method according to claim 1, characterized in that The first priority scheduling information includes: a first initial priority, a first scheduling priority of the first process when the first kernel socket receives data, and a first priority recovery time from the first scheduling priority to the first initial priority. The adjusting the priority of the first process based on the first priority scheduling information includes: adjusting the priority of the first process from the first initial priority to the first scheduling priority; After the first process is at the first scheduling priority and the first priority recovery time, the priority of the first process is restored to the first initial priority.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining a preset system performance indicator for indicating a current system load state; The adjusting the priority of the first process based on the first priority scheduling information includes: The priority of the first process is adjusted based on the preset system performance indicator and the first priority scheduling information.
4. The method according to claim 1, characterized in that: The second process is a process in a preset kernel module, and the second priority scheduling information corresponding to the second process is registered in the preset kernel module when the second process is started. The adjusting the priority of the second process includes: The priority of the second process is adjusted based on the second priority scheduling information.
5. The method according to claim 4, characterized in that The method further comprises: When the second process is destroyed, the second priority scheduling information is deleted from the preset kernel module.
6. The method according to claim 1, characterized in that When adjusting the priority of the first process based on the first priority scheduling information, the method further includes: At the same time, the priority of a third process of a third type is adjusted, and the third process is a process associated with the first process.
7. The method according to claim 6, characterized in that The method further comprises: While registering the first priority scheduling information to the kernel socket subsystem, registering the third priority scheduling information corresponding to the third process to the kernel socket subsystem; Adjust the priority of the third process, including: The priority of the third process is adjusted based on the third priority scheduling information.
8. A process priority management device, characterized in that: include: A data receiving unit, configured to receive data via a first kernel socket; a determining unit, configured to determine whether first priority scheduling information exists in the first kernel socket, wherein the first priority scheduling information indicates priority scheduling information of a first process of a first type; A priority adjustment unit is used to adjust the priority of the first process and a second process of a second type based on the first priority scheduling information if it is determined that the first kernel socket has first priority scheduling information, where the second process is a process involved when the first process is running.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.