CN110096352B - Process management method, device and computer readable storage medium - Google Patents

Process management method, device and computer readable storage medium Download PDF

Info

Publication number
CN110096352B
CN110096352B CN201910351999.7A CN201910351999A CN110096352B CN 110096352 B CN110096352 B CN 110096352B CN 201910351999 A CN201910351999 A CN 201910351999A CN 110096352 B CN110096352 B CN 110096352B
Authority
CN
China
Prior art keywords
interface
acquiring
time
processing
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910351999.7A
Other languages
Chinese (zh)
Other versions
CN110096352A (en
Inventor
冯锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shanghai Co Ltd
Original Assignee
Tencent Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shanghai Co Ltd filed Critical Tencent Technology Shanghai Co Ltd
Priority to CN201910351999.7A priority Critical patent/CN110096352B/en
Publication of CN110096352A publication Critical patent/CN110096352A/en
Application granted granted Critical
Publication of CN110096352B publication Critical patent/CN110096352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application discloses a process management method, a device and a computer readable storage medium, wherein the method comprises the following steps: acquiring the time to be processed of a first interface; when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface; acquiring a second service level of a second interface, wherein the second interface is an interface except the first interface in the server; and when the second service level is smaller than the first service level, allocating a first process corresponding to the second interface to the first interface. By adopting the method and the device, the utilization rate of the process can be improved.

Description

Process management method, device and computer readable storage medium
Technical Field
The application relates to the technical field of computers, and mainly relates to a process management method, a process management device and a computer readable storage medium.
Background
With the continuous development of information technology, background services are particularly in a logic layer, and more interfaces for processing different business logics are provided. Under the condition of limited resources, how to manage the processes to improve the utilization rate of the server is a technical problem to be solved urgently by the technical personnel in the field.
Disclosure of Invention
The embodiment of the application provides a process management method, a process management device and a computer readable storage medium, which can be used for improving the utilization rate of a process.
In a first aspect, an embodiment of the present application provides a process management method, including:
acquiring the time to be processed of a first interface;
when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface;
acquiring a second service level of a second interface, wherein the second interface is an interface except the first interface in the server;
and when the second service level is smaller than the first service level, allocating a first process corresponding to the second interface to the first interface.
In a second aspect, an embodiment of the present application provides a process management apparatus, including:
the acquisition unit is used for acquiring the time to be processed of the first interface; when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface; acquiring a second service grade of a second interface, wherein the second interface is an interface except the first interface in the server;
and the management unit is used for allocating the first process corresponding to the second interface to the first interface when the second service level is smaller than the first service level.
In a third aspect, an embodiment of the present application provides another process management apparatus, where the process management apparatus includes a processor, a communication interface, and a memory, where the memory stores a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions that, when executed by a process management apparatus, cause the process management apparatus to perform the method of the first aspect.
By adopting the embodiment of the application, when the time to be processed of the first interface is greater than the time threshold of the first interface, the first service level of the first interface and the second service level of the second interface except the first interface in the server are obtained. And when the second service level is smaller than the first service level, allocating a first process corresponding to the second interface to the first interface. Therefore, the process number corresponding to the interface is adjusted through the time to be processed and the service level, and the process utilization rate is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a network architecture to which embodiments of the present application are applied;
fig. 2A is a schematic view of a scenario for sending an interface call request according to an embodiment of the present application;
fig. 2B is a scene schematic diagram of a response interface call request according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a process management method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another process management method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another process management method according to an embodiment of the present application;
fig. 6 is a schematic logical structure diagram of a process management apparatus according to an embodiment of the present application;
fig. 7 is a schematic entity structure diagram of a process management device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
Referring to fig. 1, fig. 1 is a schematic diagram of a network architecture to which the embodiments of the present application are applied. The network architecture diagram comprises a server 101, a user terminal 102 and a user 103. It should be noted that the number and the form of each device in the network architecture diagram shown in fig. 1 are for example and do not constitute a limitation to the embodiment of the present application.
The user terminal 102 may be a Personal Computer (PC), a notebook computer, or a smart phone shown in fig. 1, or may be an electronic device such as an all-in-one machine, a palm computer, a tablet computer (pad), a smart television playing terminal, a vehicle-mounted terminal, or a portable device. The PC end user terminal, such as a kiosk, etc., may have an operating system including, but not limited to, linux system, unix system, windows series system (e.g., windows xp, windows 7, etc.), mac OS X system (operating system of apple computer), etc. The operating system of the mobile end user terminal, such as a smart phone, may include, but is not limited to, an operating system such as an android system, an IOS (operating system of an apple mobile phone), a Window system, and the like.
The server 101 is similar to a general computer architecture and includes a processor, a hard disk, a memory, a system bus, etc. for providing services to the user terminal 102. The server 101 may operate on a single device or may operate on a plurality of clusters, which is not limited herein.
The user 103 may be a user who actually operates the user terminal 102 or may be a developer. The user 103 may input an operation instruction to the user terminal 102 to control the user terminal 102 to perform a corresponding operation.
The user terminal 102 in the embodiment of the present application may install and run an application, and the server 101 is configured to provide an application service for the application installed in the user terminal 102. The application program may be a multimedia application, a page browsing application, an instant messaging application, a game application, and the like, which is not limited herein.
In the embodiment of the present application, the interface is an encapsulated function in which the user terminal 102 submits a call request to the server 101. The different interfaces are used for processing different service types, and the service types may include payment, inquiry, setting, uploading, downloading, refreshing, playing, and the like, which is not limited herein. A process is a program with certain independent functions, which is an independent unit for resource allocation and scheduling of a system, with respect to a running activity on a certain data set.
In the embodiment of the present application, the server 101 may allocate the processes included in the server 101 to each interface, and when the server 101 receives a call request for a target interface, the call request is processed by the process allocated to the target interface. It can be understood that the call request of the specified interface is processed by the specified process, and the processing efficiency of the call request can be improved.
For example, in a multimedia application scenario, a first interface is used to process a search service, a second interface is used to process a play service, and a third interface is used to process a download service. As shown in fig. 2A, the server 101 includes a first interface processing module corresponding to a first interface, a second processing module corresponding to a second interface, and a third interface processing module corresponding to a third interface. When the user terminal 102 (illustrated by taking a mobile phone as an example) runs the multimedia application, the user 103 inputs a search instruction for the target audio on the multimedia application. The user terminal 102 receives the search instruction, and transmits a call request for the first interface to the server 101. That is, the first interface processing module responds to the call request, and processes the search request through the processing process in the first interface processing module to obtain the corresponding search result. As shown in fig. 2B, the first interface processing module sends the obtained search result to the user terminal 102, and the user terminal 102 displays the search result.
In some embodiments, the server 101 may reserve idle processes, i.e., processes that are not assigned to any interface. The idle process may be used for an interface assigned to the interface by the server 101 when the interface response time is too long or when the response fails.
The embodiment of the application provides a process management method, a process management device and a computer readable storage medium, which can improve the utilization rate of a process.
The process management device in the embodiment of the application may be an application program on a server, and is used for managing processes in the server.
The following further describes a specific process of the process management method provided in the embodiment of the present application.
Referring to fig. 3, fig. 3 is a flowchart illustrating a process management method according to an embodiment of the present invention. As shown in FIG. 3, the method may include steps 301-304, and steps 301-304 may be performed by a server or a process management device in the server. Wherein:
301: and acquiring the waiting time of the first interface.
In this embodiment, the first interface is not limited, and may be one of the following service types, such as payment processing, query processing, setting processing, uploading processing, downloading processing, refreshing processing, and playing processing. The waiting time refers to the length of processing time corresponding to the first interface completing the current call request.
In a possible embodiment, step 301 comprises in particular the following steps S11-S13.
S11, acquiring a first request quantity processed by a processing process corresponding to a first interface in a preset time period, and acquiring the running state of the processing process in the preset time period.
The preset time period may be an access peak time period, an access low peak time period, any working time period, and the like, which is not limited herein. The first request amount refers to the number of the call requests processed in a preset time period by the processing process corresponding to the first interface.
The running state refers to the running condition of the server when the processing process corresponding to the first interface executes the call request within a preset time period. The operation state may include an execution duration, a memory usage, a memory peak, a Central Processing Unit (CPU) usage rate, a Graphics Processing Unit (GPU) usage rate, and the like of the server system, which are not limited herein.
The method for acquiring the running state is not limited in the present application, for example, the execution duration may be acquired by a difference between a completion time and a start time of the process executing the call request. For another example, the memory usage may be obtained by a difference between a size of a used memory of the server when the process completes executing the call request and a size of a used memory when the process starts executing the call request, or obtained according to a remaining memory size or an average value between sizes of the used memories during the execution process. Also for example, the memory peak may be obtained from a maximum between remaining memory sizes or used memory sizes during execution, and so on.
And S12, acquiring the processing efficiency of the first interface according to the first request quantity and the running state.
The processing efficiency refers to the number of call requests that can be processed by the first interface in unit time. The method for acquiring the processing efficiency according to the first request quantity and the running state is not limited, the running state can be scored to obtain an evaluation value of the processing progress in the preset time period, a quotient value obtained by dividing the first request quantity by the preset time period is used as the number of processed call requests in the preset time period, and then the quotient value is evaluated according to the evaluation value to obtain the processing efficiency. That is to say, the processing quantity of the processing process corresponding to the first interface in the preset time period and the load level of the server are comprehensively calculated to obtain the operation efficiency. Thus, the accuracy of acquiring the processing efficiency can be improved.
And S13, acquiring the time to be processed of the first interface according to the second request quantity and the processing efficiency corresponding to the first interface.
The second request amount refers to the number of the call requests received by the current first interface. The second request quantity can be divided by a quotient value obtained by the processing efficiency to serve as the time to be processed.
It can be understood that, in the above steps S11 to S13, the processing efficiency of the first interface is obtained through the first request amount and the operating state, and then the time to be processed of the first interface is obtained according to the second request amount and the processing efficiency of the first interface. Therefore, the accuracy of acquiring the time to be processed can be improved.
In the embodiment of the present application, the execution of step 301 may include the following three implementations.
In the first embodiment, step 301 is performed when a call request for the first interface sent by the client is received.
It can be understood that when the server receives a call request for the first interface sent by the client, the server obtains the time to be processed of the first interface to determine the completion time of the processing process corresponding to the current first interface, and may determine whether the processing process needs to be added. If so, the response rate of the interface can be increased after the processing progress of the interface is increased.
In the second embodiment, when the preset time period is reached, step 301 is executed.
The preset time is not limited. It can be understood that, when the preset duration is reached, the time to be processed of the first interface is obtained. That is, the completion time of the processing procedure of the first interface is detected at a timing to determine whether the processing procedure needs to be increased or decreased. If yes, the process corresponding to the interface is redistributed, and the utilization rate of the process can be improved.
In the third embodiment, when the first service level of the first interface is greater than the level threshold, step 301 is executed.
In the embodiment of the application, when the server runs, the process is distributed according to the level of the service level, that is, the call request of the interface with the high service level is processed preferentially. The first service class is used for describing the priority of the first interface for processing the call request.
In a possible embodiment, a service type of a first interface is obtained; and acquiring a first service grade of the first interface according to the service type.
The service type may include payment, inquiry, setting, uploading, downloading, refreshing, playing, etc. as described above. It can be understood that different interfaces correspond to different service types, for example: the service type of the first interface is a search service, the service type of the second interface is a play service, and the service type of the third interface is a download service.
The description form of the service level is not limited, and the description can be performed by using numbers, wherein the larger the number is, the higher the service level is. The service class can be obtained according to the relation between the service type and the time. For example, whether a plurality of time dimensions such as corresponding real-time performance, response duration and the like need to be completed in real time. Therefore, the evaluation values corresponding to the time dimensions can be respectively obtained, the service scores are obtained through weighting calculation according to the evaluation values corresponding to the time dimensions and the preset weight, and the service grades corresponding to the service scores are used as the first service grades of the first interface, so that the accuracy of obtaining the service grades can be improved.
For example, it is assumed that the multiple time dimensions include real-time performance and response time length, the evaluation values of the download service corresponding to the real-time performance and the response time length are 0.6 and 0.7, and the evaluation values of the payment service corresponding to the real-time performance and the response time length are 0.9 and 0.9. If the preset weights corresponding to the real-time performance and the response time length are 0.5 and 0.5 respectively, the service score corresponding to the downloading service is 0.65, and the service score corresponding to the payment service is 0.5. Referring to table 1 again, it can be seen that the service level corresponding to the download service is 2, and the service level corresponding to the payment service is 3.
TABLE 1
Service score Service class
[0,0.4) 1
[0.4,0.7) 2
[0.7,1] 3
In this embodiment, the first service class of the first interface is obtained according to the service type of the first interface, so that the accuracy of obtaining the service class can be improved.
The level threshold is not limited in this application. It is to be understood that, in the third embodiment, when the first service level is greater than the level threshold, the waiting time of the first interface is obtained. Therefore, whether the interface with higher service level needs to increase the processing process or not can be preferentially determined, and if yes, the response rate of the interface can be improved after the processing process of the interface is increased.
It should be noted that the above three embodiments do not limit the examples of the present application, and in practical applications, step 301 may be executed by using other embodiments.
302. And when the waiting time is greater than the time threshold of the first interface, acquiring a first service grade of the first interface.
For the method for obtaining the first service level, reference may be made to the description of the third embodiment in step 301, and details are not described herein again.
The time threshold of the first interface is not limited, and can be acquired according to a preset data table. As shown in table 2, the time threshold of the first interface is 1 minute, the time threshold of the second interface is 2 minutes, and the time threshold of the third interface is 5 minutes. As can be seen from table 1, the time threshold of the first interface is 1 minute.
TABLE 2
Interface Time threshold
First interface 1 minute
Second interface 2 minutes
Third interface 5 minutes
In a possible embodiment, the time threshold of the first interface is determined based on the first traffic class.
In this embodiment, the time threshold may be set according to the level of the service level, i.e. the higher the service level, the smaller the time threshold. For example, assume that the service level corresponding to the download service is 2, and the service level corresponding to the payment service is 3. Therefore, the time threshold corresponding to the download service is set to 2 minutes, and the time threshold corresponding to the payment service is set to 10 seconds.
In this embodiment, the time threshold of the first interface is determined according to the first service level of the first interface, which may improve accuracy of determining the time threshold, and facilitate improvement of effectiveness of process management.
303. And acquiring a second service grade of the second interface.
In this embodiment, the second interface is an interface in the server except the first interface, that is, an interface that handles different types of traffic from the first interface. For the method for obtaining the second service level, reference may be made to the description of the third embodiment in step 301, and details are not described herein. It should be noted that the number of the second interfaces may be multiple.
304. And when the second service level is smaller than the first service level, allocating the first process corresponding to the second interface to the first interface.
In this embodiment of the present application, the first process may be an idle process of the second interface, and may also be a process that allocates a smaller amount of tasks in a processing process corresponding to the second interface, which is not limited herein. It should be noted that the first process may be a corresponding processing process in the plurality of second interfaces.
In a possible embodiment, the method of determining the first interface may comprise the following steps S21-S22.
And S21, determining the number of the added processes of the first interface according to the time to be processed and the time threshold.
The number of the added processes is the number of the first processes, namely the number of the processing processes which are newly allocated to the first interface. The method for determining the number of the added processes is not limited, and the time to be processed can be divided by the time threshold value to obtain a quotient. And if the quotient value is an integer, taking the quotient value as a target ratio. If the quotient is a decimal, the quotient can be rounded or directly subjected to one-bit operation to obtain a target ratio, 1 is subtracted from the target ratio, and the target ratio is multiplied by the number of the processes of the processing process corresponding to the first interface to obtain an increased number of the processes.
For example, if the waiting time of the first interface is 2 minutes, the time threshold is 1 minute, and the number of processes is 5, the quotient is 2, the target ratio is 2, and the number of processes is 5.
It can be understood that, the accuracy of determining the number of added processes can be improved by determining the number of added processes according to the ratio between the time to be processed and the time threshold and the process data of the processing process corresponding to the first interface.
And S22, determining the first process according to the priority of the second interface and the number of the added processes.
The priority is used for describing the distribution sequence corresponding to the second interface, and the second interface with lower priority is easier to determine as the first process. In a possible embodiment, the method of obtaining the priority of the second interface may comprise the following steps S220-S222.
S220, acquiring the number of idle processes corresponding to the second interface;
and the number of the idle processes is the number of the idle processes in the second interface.
S221, obtaining the distance between the second interface and the first interface.
And the distance between the second interface and the first interface is used for describing the complexity of allocating the process corresponding to the second interface to the first interface. The distance between the second interface and the first interface may include a similarity value between the second interface and the first interface, a physical distance between an interface processing module corresponding to the second interface and an interface processing module corresponding to the first interface, and the like. Wherein, the similarity value can be obtained according to the similarity value of the service grades corresponding to the two interfaces.
The method and the device can acquire the similarity value between the second interface and the first interface and the physical distance between the interface processing module corresponding to the second interface and the interface processing module corresponding to the first interface. And then according to the preset weight value corresponding to the similarity value and the physical distance, carrying out weighted calculation on the similarity value and the physical distance to obtain the distance between the second interface and the first interface, so that the accuracy of obtaining the distance can be improved.
S222, acquiring the priority of the second interface according to the number and the distance of the idle processes.
It is to be understood that, in steps S220-S222, the number of idle processes may represent the idle degree of the second interface, and the distance between the second interface and the first interface may represent the complexity degree of allocating the process corresponding to the second interface to the first interface. Therefore, the priority of the second interface is obtained according to the number of idle processes corresponding to the second interface and the distance between the second interface and the first interface, and the accuracy of obtaining the priority can be improved.
The method for determining the first process according to the priority of the second interface and the number of the added processes of the first interface is not limited in the present application, the process of the second interface with the lower priority may be first allocated to the first interface, and if the number of the processing processes corresponding to the second interface with the lower priority is greater than the number of the added processes, the allocation is ended. Otherwise, the process of the second interface with lower priority is redistributed to the first interface.
The method of determining the first process may also be to apportion the number of added processes according to priority. For example, assume that the server includes three second interfaces, wherein the priorities of the three second interfaces are 1, 2, and 3, respectively, and the number of processes corresponding to each of the three second interfaces is 5, 4, and 5. If the number of the processes is increased to 6, three processing processes in the second interfaces with the priority of 1 in the three second interfaces may be used as the first process, two processing processes in the second interfaces with the priority of 2 in the three second interfaces may be used as the first process, and one processing process in the second interfaces with the priority of 3 in the three second interfaces may be used as the first process.
It is understood that, in steps S21-S22, the number of added processes of the first interface is determined according to the waiting time and the time threshold of the first interface, and then the first process is determined according to the priority of the second interface and the number of added processes. In this manner, the accuracy of determining the first process may be improved. After determining the first process, the first process is assigned to the first interface. Therefore, the accuracy of process allocation can be improved, and the operating efficiency of the server is improved conveniently.
In the process management method shown in fig. 3, when the time to be processed of the first interface is greater than the time threshold of the first interface, a first service class of the first interface and a second service class of a second interface, except the first interface, in the server are obtained. And when the second service level is smaller than the first service level, allocating a first process corresponding to the second interface to the first interface. Therefore, the process number corresponding to the interface is adjusted through the time to be processed and the service level, and the process utilization rate is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating another process management method according to an embodiment of the disclosure. As shown in fig. 4, the method may comprise steps 401-403, which steps 401-403 may be performed by the server or a process management device in the server. Wherein:
401. and acquiring the time to be processed of the first interface.
Step 401 may refer to the description of step 301, and is not described herein again.
402. And when the waiting time is less than or equal to the time threshold of the first interface, acquiring a first service grade of the first interface.
For obtaining the first service class of the first interface, reference may be made to the description of the third embodiment in step 301, which is not described herein again. It can be understood that, when the duration to be processed is less than or equal to the time threshold of the first interface, it indicates that the processing process corresponding to the first interface can complete the call request within the time threshold of the first interface, and then no processing process needs to be added to the first interface.
403. And when the first service grade is less than or equal to the grade threshold value, releasing the second process corresponding to the first interface.
The level threshold may refer to the description of the third embodiment in step 301, and is not described herein again. In this embodiment of the application, the second process may be an idle process in the first interface, or may also be a process that allocates a smaller amount of tasks in a processing process corresponding to the first interface, which is not limited herein. It should be noted that the second process may be a plurality of processing processes.
In a possible embodiment, the number of processes to be reduced is determined according to the time to be processed and a time threshold; and determining a second process according to the priority of each processing process in the first interface and the reduction process number.
Wherein the number of processes is reduced to the number of second processes. The method for determining to reduce the number of processes is not limited in the present application, and the quotient value may be obtained by dividing the time to be processed by the time threshold. And dividing the process number of the processing process corresponding to the first interface by the quotient value to obtain a target value, and if the target value is a decimal, rounding off the quotient value to obtain a reduced process number.
For example, if the waiting time of the first interface is 0.5 minute, the time threshold is 1 minute, and the number of processes is 5, the quotient is 0.5, the target value is 2.5, and the number of processes is reduced by 2.
It can be understood that, the accuracy of determining the number of the processes to be reduced can be improved by determining the number of the processes to be reduced according to the ratio between the time to be processed and the time threshold and the process data of the processing process corresponding to the first interface.
The method for obtaining the priority of each processing process in the first interface is not limited, the process list and the processing efficiency of each processing process can be obtained, and the corresponding priority is determined according to the number of the uncompleted calling requests in the process list and the processing efficiency. For example: the first interface includes a first processing procedure, a second processing procedure, and a third processing procedure. The process list of the first processing process comprises 3 incomplete call requests, and the processing efficiency is 1 per minute. The process list of the second processing process includes 2 outstanding call requests, and the processing efficiency is 1 per minute. The process list of the third processing process includes 0 outstanding call requests, and the processing efficiency is 2 per minute. Therefore, the priorities of the first processing procedure, the second processing procedure and the third processing procedure are calculated to be 1, 3 and 5 respectively.
In this embodiment, the number of processes to be reduced of the first interface is determined according to the time to be processed of the first interface and the time threshold, and then the second process corresponding to the first interface is determined according to the priority of each processing process in the first interface and the number of processes to be reduced. Therefore, the accuracy of process allocation can be improved, and the operating efficiency of the server is improved conveniently.
In the process management method shown in fig. 4, when the time to be processed of the first interface is less than or equal to the time threshold of the first interface, the first service class of the first interface is obtained. And when the first service grade is less than or equal to the grade threshold value, releasing the second process corresponding to the first interface. Therefore, the number of processes corresponding to the interfaces is reduced through the time to be processed and the service level, the server can allocate the released processes to other interfaces or serve as standby processes for the client to call, and the utilization rate of the processes is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating another process management method according to an embodiment of the present invention. As shown in fig. 5, the method may comprise steps 501-504, and the steps 501-504 may be performed by the server or a process management device in the server. Wherein:
501. the processing capacity of the first interface is obtained.
The description of the first interface may refer to the description of step 301, and is not repeated herein. The processing capacity refers to the number of processing processes currently required by the first interface. Note that, this step 501 may also be executed with reference to three embodiments of step 301.
In a possible embodiment, step 501 comprises in particular the following steps S31-S33.
S31, acquiring a first request quantity processed by a processing process corresponding to a first interface in a preset time period, and acquiring the running state of the processing process in the preset time period.
And S32, acquiring the processing efficiency of the first interface according to the first request quantity and the running state.
The steps S31 to S32 can refer to the descriptions of the steps S11 to S12, and are not described herein again.
And S33, acquiring the processing capacity of the first interface according to the second request quantity and the process list corresponding to the first interface and the processing efficiency.
The second request amount refers to the number of call requests currently received by the first interface. The process list is used for describing allocation conditions corresponding to completed call requests and uncompleted call requests corresponding to the first interface, and the completion degree of the processing process corresponding to the first interface can be known through the process list.
In step S33, the number of the uncompleted call requests corresponding to the first interface may be obtained according to the process list corresponding to the first interface, the sum of the number and the second request amount may be calculated, and a quotient obtained by dividing the sum by the processing efficiency is used as the processing capacity.
It can be understood that, in the above steps S31 to S33, the processing efficiency of the first interface is obtained according to the first request amount and the operating state, and then the processing capacity of the first interface is obtained according to the second request amount, the process list and the processing efficiency of the first interface. Thus, the accuracy of acquiring the processing capacity can be improved.
502. And when the processing capacity is larger than the capacity threshold value of the first interface, acquiring a first service level of the first interface.
For obtaining the first service class of the first interface, reference may be made to the description of the third embodiment in step 301, which is not described herein again. The capacity threshold of the first interface may be the number of processing processes currently included in the first interface, or may be a preset capacity value corresponding to the first service level, where the higher the first service level is, the larger the capacity threshold is, and is not limited herein.
503. And acquiring a second service grade of the second interface.
In the embodiment of the present application, the second interface is an interface other than the first interface in the server. Step 503 may refer to the description of step 303, and is not described herein again.
504. And when the second service level is smaller than the first service level, allocating the first process corresponding to the second interface to the first interface.
Step 504 may refer to the description of step 304, and is not described herein again.
In the process management method shown in fig. 5, when the processing capacity of the first interface is greater than the capacity threshold of the first interface, a first service level of the first interface and a second service level of a second interface, other than the first interface, in the server are obtained. And when the second service level is smaller than the first service level, allocating the first process corresponding to the second interface to the first interface. Therefore, the process number corresponding to the interface is adjusted through the processing capacity and the service level, and the process utilization rate is improved.
In a possible embodiment, before obtaining the first traffic class of the first interface, the following steps may be further performed: acquiring a processing evaluation value of a first interface; and when the processing evaluation value is smaller than the processing threshold value of the first process, executing the step of acquiring the first service level of the first interface.
Wherein the processing evaluation value is used to describe a processing state of the first process. In the embodiment of the present application, acquiring the processing evaluation value of the first interface may include the following two embodiments.
In the first embodiment, a processing evaluation value is acquired from the processing efficiency.
The processing efficiency refers to the number of call requests that can be processed by the first interface in unit time, and can reflect the processing condition of the processing process corresponding to the first interface. It is understood that, in the first embodiment, the process evaluation value corresponding to the processing efficiency is acquired, and the accuracy of acquiring the process evaluation value can be improved.
In a second embodiment, a first difference between the time to be processed and the time threshold is obtained, and a second difference between the processing capacity and the capacity threshold is obtained; and acquiring a processing evaluation value according to the first difference, the second difference and the processing efficiency.
It can be understood that the first difference, the second difference, and the processing efficiency all can represent the processing condition of the processing procedure corresponding to the first interface. In the second embodiment, the accuracy of acquiring the processing evaluation value can be further improved by acquiring the processing evaluation value by the first difference, the second difference, and the processing efficiency.
It should be noted that the above two embodiments do not limit the embodiments of the present application, and in practical applications, the step of acquiring the first service level of the first interface may also be executed by using other embodiments.
It is to be understood that, by implementing this embodiment, when the processing evaluation value is smaller than the processing threshold value of the first process, a process corresponding to an interface having a traffic level smaller than that of the first interface is assigned to the first interface. Thus, the processing evaluation value of the first process is comprehensively considered, the number of the processes corresponding to the interface is adjusted through the processing evaluation value and the service level, and the utilization rate of the processes is further improved.
The method of the embodiments of the present application is set forth above in detail and the apparatus of the embodiments of the present application is provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a process management apparatus according to an embodiment of the present application, and as shown in fig. 6, the apparatus 600 includes:
the obtaining unit 601 is configured to obtain a time to be processed of a first interface; when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface; acquiring a second service level of a second interface, wherein the second interface is an interface except the first interface in the server;
the management unit 602 is configured to allocate, when the second service level is smaller than the first service level, a first process corresponding to the second interface to the first interface.
In a possible example, the obtaining unit 601 is specifically configured to determine, according to the time to be processed and the time threshold, an increased number of processes of the first interface; determining a first process according to the priority of the second interface and the number of the added processes; assigning the first process to the first interface.
In a possible example, the obtaining unit 601 is further configured to obtain a number of idle processes corresponding to the second interface; acquiring the distance between the second interface and the first interface; and acquiring the priority of the second interface according to the number of the idle processes and the distance.
In a possible example, the obtaining unit 601 is specifically configured to obtain a first request amount that has been processed by a processing process corresponding to a first interface within a preset time period, and obtain an operating state of the processing process within the preset time period; acquiring the processing efficiency of the first interface according to the first request quantity and the running state; and acquiring the time to be processed of the first interface according to the second request quantity corresponding to the first interface and the processing efficiency.
In a possible example, the obtaining unit 601 is specifically configured to obtain a service type of the first interface; and acquiring a first service grade of the first interface according to the service type.
In one possible example, the apparatus 600 further comprises:
the calling unit 603 is configured to call the obtaining unit 601 to execute the step of obtaining the time to be processed of the first interface when a call request for the first interface sent by the client is received, or when a preset time length is reached, or when the first service level is greater than the level threshold.
In a possible example, the management unit 602 is further configured to release the second process corresponding to the first interface when the pending time is less than or equal to the time threshold and the first service level is less than or equal to the level threshold.
In one possible example, the obtaining unit 601 is further configured to obtain a processing capacity of the first interface; and when the processing capacity is larger than the capacity threshold value of the first interface, executing the step of acquiring the waiting time of the first interface.
In a possible example, the obtaining unit 601 is specifically configured to obtain the processing capacity of the first interface according to the second request amount and the process list corresponding to the first interface, and the processing efficiency.
In one possible example, the obtaining unit 601 is further configured to obtain a processing evaluation value of the first interface; and when the processing evaluation value is smaller than the processing threshold value of the first process, executing the step of acquiring the waiting time of the first interface.
In one possible example, the obtaining unit 601 is specifically configured to obtain the processing evaluation value according to the processing efficiency.
In one possible example, the obtaining unit 601 is specifically configured to obtain a first difference between the time to be processed and the time threshold, and obtain a second difference between the processing capacity and the capacity threshold; and acquiring the processing evaluation value according to the first difference, the second difference and the processing efficiency.
The process management apparatus may implement the function of the process management apparatus in the foregoing method embodiment, and for detailed processes executed by each unit in the process management apparatus, reference may be made to the execution steps of the information processing apparatus in the foregoing method embodiment, which are not described herein again.
Referring to fig. 7, fig. 7 is a schematic physical structure diagram of a process management apparatus 700 according to an embodiment of the present disclosure, where the process management apparatus 700 includes a processor 701, a communication interface 702, and a memory 703. The processor 701, the communication interface 702, and the memory 703 may be connected to each other by a bus 704, or may be connected by other means. The related functions implemented by the acquisition unit 601, the management unit 602, and the call unit 603 shown in fig. 6 may be implemented by one or more processors 701.
The processor 701 includes one or more processors, for example, one or more central processing units, and in the case that the processor 701 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. In the embodiment of the present application, the processor 701 is configured to control the process management apparatus to implement the embodiments shown in fig. 3, fig. 4, and fig. 5.
The communication interface 702 is used to enable communication with a device such as a user terminal.
The memory 703 includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory 703 is used for storing relevant instructions and data.
In an embodiment of the present application, the memory 703 stores a computer program, the computer program includes program instructions, the processor 701 is configured to call the program instructions, the program includes instructions for performing the following steps:
acquiring the time to be processed of a first interface;
when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface;
acquiring a second service grade of a second interface, wherein the second interface is an interface except the first interface in the server;
and when the second service level is smaller than the first service level, allocating a first process corresponding to the second interface to the first interface.
By adopting the embodiment of the application, the process number corresponding to the interface is adjusted through the time to be processed and the service level, so that the process utilization rate is improved.
In one possible example, in terms of assigning the first process corresponding to the second interface to the first interface, the instructions in the program are specifically configured to perform the following operations:
determining the number of the added processes of the first interface according to the time to be processed and the time threshold;
determining a first process according to the priority of the second interface and the number of the added processes;
assigning the first process to the first interface.
In one possible example, the instructions in the program are further to perform the following operations:
acquiring the number of idle processes corresponding to the second interface;
acquiring the distance between the second interface and the first interface;
and acquiring the priority of the second interface according to the number of the idle processes and the distance.
In one possible example, in terms of obtaining the wait time of the first interface, the instructions in the program are specifically configured to:
acquiring a first request quantity processed by a processing process corresponding to a first interface in a preset time period, and acquiring the running state of the processing process in the preset time period;
acquiring the processing efficiency of the first interface according to the first request quantity and the running state;
and acquiring the time to be processed of the first interface according to the second request quantity corresponding to the first interface and the processing efficiency.
In one possible example, in terms of obtaining the first traffic level of the first interface, the instructions in the program are specifically configured to:
acquiring the service type of the first interface;
and acquiring a first service grade of the first interface according to the service type.
In one possible example, before the obtaining the pending time for the first interface, the instructions in the program are further to:
and when a call request aiming at the first interface sent by the client is received, or when a preset time length is reached, or when the first service level is greater than a level threshold value, executing the step of acquiring the time to be processed of the first interface.
In one possible example, the instructions in the program are further to perform the following operations:
and when the waiting time is less than or equal to the time threshold and the first service grade is less than or equal to the grade threshold, releasing a second process corresponding to the first interface.
In one possible example, before the obtaining the pending time for the first interface, the instructions in the program are further to:
acquiring the processing capacity of the first interface;
and when the processing capacity is larger than the capacity threshold value of the first interface, executing the step of acquiring the waiting time of the first interface.
In one possible example, in terms of the obtaining the processing capacity of the first interface, the instructions in the program are specifically configured to:
and acquiring the processing capacity of the first interface according to the second request quantity and the process list corresponding to the first interface and the processing efficiency.
In one possible example, before the obtaining the pending time for the first interface, the instructions in the program are further to:
acquiring a processing evaluation value of the first interface;
and when the processing evaluation value is smaller than the processing threshold value of the first process, executing the step of acquiring the waiting time of the first interface.
In one possible example, in terms of the obtaining of the processing evaluation value of the first interface, the instructions in the program are specifically configured to:
and acquiring the processing evaluation value according to the processing efficiency.
In one possible example, in terms of obtaining the processing evaluation value of the first interface, the instructions in the program are specifically configured to:
obtaining a first difference between the time to be processed and the time threshold, and obtaining a second difference between the processing capacity and the capacity threshold;
and acquiring the processing evaluation value according to the first difference, the second difference and the processing efficiency.
Embodiments of the present application further provide a computer-readable storage medium storing a computer program, the computer program comprising program instructions that, when executed by a process management apparatus, cause the process management apparatus to perform the above-described method embodiments.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A process management method, comprising:
acquiring the time to be processed of a first interface;
when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface;
acquiring a second service level of a second interface, wherein the second interface is an interface except the first interface in the server, and different interfaces correspond to different interface processing modules and are used for processing services of different service types;
when the second service level is smaller than the first service level, determining the number of the added processes of the first interface according to the time to be processed and the time threshold;
determining a first process corresponding to the second interface according to the priority of the second interface and the number of the added processes, wherein the priority of the second interface is determined according to the number of idle processes corresponding to the second interface and the distance between the second interface and the first interface; the distance between the second interface and the first interface is determined according to the similarity between the second interface and the first interface and the physical distance between the interface processing module corresponding to the second interface and the interface processing module corresponding to the first interface, and is used for indicating the complexity of allocating the process corresponding to the second interface to the first interface;
and allocating the first process corresponding to the second interface to the first interface.
2. The method of claim 1, further comprising:
acquiring the number of idle processes corresponding to the second interface;
acquiring the distance between the second interface and the first interface;
and acquiring the priority of the second interface according to the number of the idle processes and the distance.
3. The method according to claim 1 or 2, wherein the obtaining the pending time of the first interface comprises:
acquiring a first request quantity processed by a processing process corresponding to a first interface in a preset time period, and acquiring the running state of the processing process in the preset time period;
acquiring the processing efficiency of the first interface according to the first request quantity and the running state;
and acquiring the time to be processed of the first interface according to the second request quantity corresponding to the first interface and the processing efficiency.
4. The method according to claim 1 or 2, wherein the obtaining the first traffic class of the first interface comprises:
acquiring the service type of the first interface;
and acquiring a first service grade of the first interface according to the service type.
5. The method according to claim 1 or 2, wherein before said obtaining the pending time of the first interface, the method further comprises:
and when a call request aiming at the first interface sent by the client is received, or when a preset time length is reached, or when the first service level is greater than a level threshold value, executing the step of acquiring the time to be processed of the first interface.
6. The method of claim 5, further comprising:
and when the waiting time is less than or equal to the time threshold and the first service level is less than or equal to the level threshold, releasing a second process corresponding to the first interface.
7. A process management apparatus, comprising:
the acquisition unit is used for acquiring the time to be processed of the first interface; when the time to be processed is greater than the time threshold of the first interface, acquiring a first service grade of the first interface; acquiring a second service grade of a second interface, wherein the second interface is an interface except the first interface in the server, and different interfaces correspond to different interface processing modules and are used for processing services of different service types;
a management unit, configured to determine, when the second service level is smaller than the first service level, an increased process number of the first interface according to the time to be processed and the time threshold; determining a first process corresponding to the second interface according to the priority of the second interface and the number of the added processes; allocating a first process corresponding to the second interface to the first interface; the priority of the second interface is determined according to the number of idle processes corresponding to the second interface and the distance between the second interface and the first interface; the distance between the second interface and the first interface is determined according to the similarity between the second interface and the first interface and the physical distance between the interface processing module corresponding to the second interface and the interface processing module corresponding to the first interface, and is used for indicating the complexity of allocating the process corresponding to the second interface to the first interface.
8. A process management apparatus comprising a processor, a communication interface and a memory, wherein the memory stores a computer program comprising program instructions, and the processor is configured to invoke the program instructions to perform the method of any of claims 1-6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a process management apparatus, cause the process management apparatus to perform the method of any of claims 1-6.
CN201910351999.7A 2019-04-28 2019-04-28 Process management method, device and computer readable storage medium Active CN110096352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910351999.7A CN110096352B (en) 2019-04-28 2019-04-28 Process management method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910351999.7A CN110096352B (en) 2019-04-28 2019-04-28 Process management method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110096352A CN110096352A (en) 2019-08-06
CN110096352B true CN110096352B (en) 2023-03-31

Family

ID=67446274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910351999.7A Active CN110096352B (en) 2019-04-28 2019-04-28 Process management method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110096352B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080363B (en) * 2022-08-23 2022-11-15 中国中金财富证券有限公司 System capacity evaluation method and device based on service log
CN115495312B (en) * 2022-09-27 2023-07-18 北京百度网讯科技有限公司 Service request processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101946472A (en) * 2008-01-10 2011-01-12 苹果公司 Apparatus and methods for network resource allocation
AU2011244901A1 (en) * 2004-06-24 2011-11-24 X2M Connect Limited Client processor device
CN107534981A (en) * 2015-04-23 2018-01-02 瑞典爱立信有限公司 Resource re-allocation
CN109561134A (en) * 2018-10-26 2019-04-02 平安科技(深圳)有限公司 Electronic device, distributed type assemblies service distribution method and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2011244901A1 (en) * 2004-06-24 2011-11-24 X2M Connect Limited Client processor device
CN101946472A (en) * 2008-01-10 2011-01-12 苹果公司 Apparatus and methods for network resource allocation
CN107534981A (en) * 2015-04-23 2018-01-02 瑞典爱立信有限公司 Resource re-allocation
CN109561134A (en) * 2018-10-26 2019-04-02 平安科技(深圳)有限公司 Electronic device, distributed type assemblies service distribution method and storage medium

Also Published As

Publication number Publication date
CN110096352A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
US11558244B2 (en) Improving performance of multi-processor computer systems
EP2893444B1 (en) Quota-based resource management
JP2021516395A (en) Resource configuration method, equipment, terminals, and storage media
CN113377540A (en) Cluster resource scheduling method and device, electronic equipment and storage medium
CN110673948B (en) Cloud game resource scheduling method, server and storage medium
CN110162397B (en) Resource allocation method, device and system
CN110096352B (en) Process management method, device and computer readable storage medium
CN111104219A (en) Binding method, device, equipment and storage medium of virtual core and physical core
CN108241535B (en) Resource management method and device and server equipment
CN111798113A (en) Resource allocation method, device, storage medium and electronic equipment
CN111796933A (en) Resource scheduling method, device, storage medium and electronic equipment
CN114721818A (en) Kubernetes cluster-based GPU time-sharing method and system
CN111813541B (en) Task scheduling method, device, medium and equipment
CN103440113A (en) Disk IO (Input/output) resource allocation method and device
CN112463361A (en) Method and equipment for distributing elastic resources of distributed computation
CN114579187B (en) Instruction distribution method and device, electronic equipment and readable storage medium
CN108572869B (en) Physical host selection method, device, equipment and readable storage medium
CN111580975B (en) Memory optimization method and system for speech synthesis
CN113918344A (en) Resource demand allocation method, device, equipment and computer readable medium
CN115168057B (en) Resource scheduling method and device based on k8s cluster
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium
CN115328666B (en) Device scheduling method, system, electronic device and computer readable storage medium
CN115686803B (en) Computing task management system, method and device for scheduling policy dynamic loading
CN111782362A (en) Message task scheduling method and device and electronic equipment
CN115617445A (en) Container management method and device in Serverless computing

Legal Events

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