CN110209548B - Service control method, system, electronic device and computer readable storage medium - Google Patents

Service control method, system, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN110209548B
CN110209548B CN201810354466.XA CN201810354466A CN110209548B CN 110209548 B CN110209548 B CN 110209548B CN 201810354466 A CN201810354466 A CN 201810354466A CN 110209548 B CN110209548 B CN 110209548B
Authority
CN
China
Prior art keywords
service
electronic device
target
processes
memory
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
CN201810354466.XA
Other languages
Chinese (zh)
Other versions
CN110209548A (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.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201810354466.XA priority Critical patent/CN110209548B/en
Publication of CN110209548A publication Critical patent/CN110209548A/en
Application granted granted Critical
Publication of CN110209548B publication Critical patent/CN110209548B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a service control method, which relates to the field of data processing and comprises the steps of monitoring a process of which the process is completed in service, and ending a target process when the process of which the process is completed is monitored to have the target process, wherein the memory occupied space of the target process exceeds the memory occupied space threshold of the target process. The invention also discloses a system, electronic equipment and a computer readable storage medium, which can solve the problems of data transmission loss and abnormal interruption of user requests caused by restarting service.

Description

Service control method, system, electronic device and computer readable storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a service control method, a system, an electronic device, and a computer readable storage medium.
Background
During the operation of the service, memory leakage may occur for a variety of reasons. Memory leakage phenomena refer to the phenomenon that heap memory that has been dynamically allocated in service is not released or cannot be released by a program for some reason. This phenomenon may cause a waste of system memory, resulting in serious consequences such as slow running of the program and even system breakdown.
In order to reduce the occurrence of memory leakage, there is currently a service control method, which monitors the memory occupation space of a service, and if the memory occupation space of the service is greater than a preset memory occupation space threshold, restarts the service to release the heap memory occupied by the service.
However, the above service control method easily causes data transmission loss and user request to be abnormally interrupted because the service is interrupted before the restart is completed.
Disclosure of Invention
The invention provides a service control method, a system, electronic equipment and a computer readable storage medium, which can solve the problems of data transmission loss and abnormal interruption of a user request caused by restarting a service.
In one aspect, an embodiment of the present invention provides a service control method, including:
monitoring the process of which the process response is completed in the service;
and ending the target process when the target process exists in the process of which the response is monitored, wherein the memory occupied space of the target process exceeds the memory occupied space threshold of the target process.
A second aspect of the present invention provides an electronic device, comprising:
the monitoring module is used for monitoring the process of which the process response is completed in the service;
And the processing module is used for ending the target process when the monitoring module monitors that the target process exists in the process responded by the completed process, and the memory occupied space of the target process exceeds the memory occupied space threshold of the target process.
In a third aspect of the present invention, there is provided a service control method, including: displaying a configuration interface, the configuration interface comprising: the first input box is used for inputting address information, and the first control is used for inputting detection instructions;
when the detection instruction is received, acquiring hardware configuration information of the electronic equipment pointed by the address information according to the address information input in the first input box at present, wherein the hardware configuration information comprises the physical memory size of the electronic equipment;
displaying hardware configuration information of the electronic equipment on the configuration interface so that a user configures memory weight coefficients of the electronic equipment and upper limit numbers of service processes allowing the electronic equipment to run in parallel based on the hardware configuration information of the electronic equipment;
the memory weight coefficient and the upper limit number of the electronic equipment are used for determining a memory occupied space threshold value of the electronic equipment, so that when a target process exists in the service of the electronic equipment, the electronic equipment is triggered to finish the target process;
The service process is a process of the service, and the target process is a process of which the memory occupied space exceeds the memory occupied space threshold of the electronic equipment.
A fourth aspect of the present invention provides a service control system comprising: an electronic device and a monitoring device;
the electronic equipment is used for executing a service process, and the service process is a service process;
the electronic equipment is also used for monitoring the process of the completed process response in the service, if the electronic equipment monitors that a target process exists in the process of the completed process response, a process ending request is sent to the control equipment, and when an instruction of the control equipment for allowing ending based on the process ending request response is received, the target process is ended;
the memory occupied space of the target process exceeds a memory occupied space threshold of the target process.
The service control method, the system, the electronic device or the computer readable storage medium provided by the embodiment of the invention can not cause the problems of data transmission loss and abnormal interruption of the user request caused by restarting the service or ending the process of processing the user request because only the target process in the service is closed, the whole service is not required to be restarted and only the process of which the process response is completed in the service is monitored.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained from these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a flowchart of a service control method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a service control method according to another embodiment of the present invention;
FIG. 3 is a flowchart of a service control method according to another embodiment of the present invention;
FIG. 4 is a process management system;
fig. 5 is a schematic structural diagram of an electronic device according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to another embodiment of the present invention;
FIG. 9 is a schematic diagram of a configuration interface in a service control method according to another embodiment of the present invention;
Fig. 10 is a schematic structural diagram of a service control system according to another embodiment of the present invention;
fig. 11 is a schematic structural diagram of a service control system according to another embodiment of the invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more comprehensible, the present invention will be described in detail below with reference to the accompanying drawings provided by the embodiments of the present invention, and it is apparent that the described embodiments are only some but not all embodiments of the present invention. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments provided by the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a service control method according to an embodiment of the invention, and as shown in fig. 1, the service control method includes:
101. the process of the completed process response in the service is monitored.
Specifically, a process of which the process response is completed in the service is obtained, the memory occupied space of the process of which the process response is completed in the service is compared with the memory occupied space threshold of the process, and if the memory occupied space of the process is larger than the memory occupied space threshold of the process, the process is marked as a target process.
102. And ending the target process when the target process exists in the processes corresponding to the completed processes.
In practical applications, a service often includes a plurality of processes, and configuring the service in an electronic device means that the processes are distributed to the electronic device for processing. In order to increase the processing efficiency of the service, the service may be allocated to a plurality of different electronic devices for simultaneous processing. Alternatively, the number of processes and the memory-occupiable space threshold of the processes allocated to different electronic devices may be different according to the different hardware configurations of the electronic devices. And if the target process exists in the service, triggering the electronic equipment where the target process is located to finish the target process.
It should be noted that, in the service control method provided in this embodiment, by monitoring the memory occupied space of the process of the service and ending the target process in the service, the memory occupied space of the target process exceeds the memory occupied space threshold of the target process, so as to achieve the purpose of preventing memory leakage.
In this embodiment, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problems of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request will not occur.
Referring to fig. 2, fig. 2 is a flowchart of a service control method according to another embodiment of the present invention, where the service control method includes:
201. and acquiring hardware configuration information of the electronic equipment, a memory weight coefficient of the electronic equipment and an upper limit number of service processes allowing the electronic equipment to run in parallel.
Specifically, the electronic device is an electronic device configured with a service, and the service process refers to a process of the service. The hardware configuration of the electronic device includes a physical memory size of the electronic device.
Optionally, the hardware configuration of the electronic device further includes a core number of a central processing unit of the electronic device, a memory weight coefficient of the electronic device is set according to a size of a physical memory of the electronic device, and an upper limit number of service processes of the electronic device, which allow the electronic device to run in parallel, is set according to the core number of the central processing unit of the electronic device.
In practical applications, a service includes a plurality of service processes that can be configured to a plurality of electronic devices for processing. The hardware configuration of the electronic devices is respectively obtained, different memory weight coefficients are respectively set for the electronic devices according to the physical memory sizes of the electronic devices, and different upper limit numbers of service processes allowing the electronic devices to run in parallel are respectively set for the electronic devices according to the core numbers of the central processing units of the electronic devices.
In order to distinguish the electronic devices, an address may be allocated to each of the electronic devices, and the obtained hardware configuration of the electronic device, the memory weight coefficient set for the electronic device, and the upper limit number of the service processes allowing the electronic device to run in parallel may be stored in a basic configuration table under the address of the electronic device.
202. And calculating the memory occupied space threshold of the service process of the electronic equipment according to a threshold calculation formula.
Specifically, the threshold calculation formula is: p=α×m/n, where p is a memory space-occupiable threshold of a service process of the electronic device, α is a memory weight coefficient of the electronic device, n is an upper limit number of the service process allowing the electronic device to run in parallel, and m is a physical memory size of the electronic device.
In practical application, when a service process in service is configured to a plurality of electronic devices for processing, the physical memory size of the electronic devices, the memory weight coefficient set for the electronic devices and the upper limit number of the service processes which are set for the electronic devices and allow the electronic devices to run in parallel are obtained by reading a basic configuration table under an address corresponding to the electronic devices, and the memory space occupation threshold values of the service processes of the electronic devices are calculated respectively.
203. The progress of the response is monitored in the service.
Specifically, the memory occupation space of the service process for which the process response is completed is obtained, the memory occupation space of the service process for which the process response is completed is compared with the memory occupation space threshold of the service process, and if the memory occupation space of the service process is larger than the memory occupation space threshold of the service process, the service process is marked as a target process.
204. Detecting whether the number of the workable service processes of the electronic equipment is smaller than the preset lower limit number of the workable service processes, if the number of the workable service processes of the electronic equipment is smaller than the lower limit number of the workable service processes, creating new service processes in the electronic equipment until the number of the workable service processes in the electronic equipment is equal to the upper limit number of the service processes allowing the electronic equipment to run in parallel.
Specifically, the number of service processes that can be operated is the number of service processes that are running in the electronic device.
It should be noted that, closing a large number of service processes of the electronic device may cause the number of service processes available for the electronic device to be too small, if the number of service processes available for the electronic device is smaller than the preset lower limit number of service processes available for the electronic device, the operation of the service configured for the electronic device may be unstable, and when the number of service processes available for the electronic device is zero, the electronic device stops operating the process, resulting in loss of data transmission and abnormal interruption of the user request. When the number of the workable service processes of the electronic equipment is detected to be smaller than the preset lower limit number of the workable service processes, the electronic equipment is triggered to create a new service process, and the problems of unstable operation, data transmission loss and abnormal interruption of a user request of the service configured to the electronic equipment can be avoided.
205. And ending the target process when the target process exists in the processes for which the process response is monitored.
In this embodiment, in the first aspect, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problem of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request is not generated. In the second aspect, the memory space-occupiable threshold of the service process of the electronic device is calculated by the threshold calculation formula, so that the memory space-occupiable threshold of the service process of the electronic device is not required to be set for the electronic device according to manual experience. In the third aspect, whether the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is detected before the target process is finished, so that the problem of unstable operation of the service configured to the electronic device due to the fact that the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is avoided.
Referring to fig. 3, fig. 3 is a flowchart of a service control method according to another embodiment of the present invention, and as shown in the drawings, the service control method includes:
301. and acquiring hardware configuration information of the electronic equipment, a memory weight coefficient of the electronic equipment and an upper limit number of service processes allowing the electronic equipment to run in parallel.
302. And calculating the memory occupied space threshold of the service process of the electronic equipment according to a threshold calculation formula.
303. The progress of the response is monitored in the service.
304. Detecting whether the number of the operable service processes of the electronic equipment is smaller than the preset lower limit number of the operable service processes, if the number of the operable service processes of the electronic equipment is smaller than the lower limit number of the operable service processes, touching to create a new service process in the electronic equipment until the number of the operable service processes in the electronic equipment is equal to the upper limit number of the service processes allowing the electronic equipment to run in parallel.
Specifically, the number of service processes that can be operated is the number of service processes that are running in the electronic device, and the service processes are the processes of the service.
305. And removing the target process from the workable service process queue of the electronic equipment, and storing the memory leakage information of the target process.
Specifically, the memory leakage information includes: the method comprises the steps of address of an electronic device, process number of a target process, time for the target process to finish a process task for the first time, time for the target process to finish a process task for the last time, net increment of memory occupied by the target process and total times for the target process to finish the process task. The memory leakage information is used for providing basis for evaluating the memory leakage condition of the service distributed to the electronic equipment.
306. And ending the target process when the target process exists in the processes for which the process response is monitored.
Specifically, if more than N target processes exist in the service, the delay time of each target process is randomly generated for each target process, the delay time of each target process is triggered, and the electronic equipment is started to finish the corresponding target process after delaying the corresponding delay time based on the delay time of each target process. The delay time is randomly selected from a preset range, and N is not less than 2.
It should be noted that if more than N target processes exist in the service, triggering the electronic device to end the target processes simultaneously may cause mutation of the total process number in the service, and further cause unstable operation of the service, so that the target processes are closed after a random delay time, asynchronous end of the target processes may be achieved, and the problem of unstable operation of the service caused by mutation of the total process number in the service is avoided.
It should be noted that the present embodiment may be combined with the embodiment shown in fig. 2, and the steps 301 to 303 may refer to the relevant steps of the embodiment shown in fig. 1 and 2 specifically, and are not repeated herein.
In this embodiment, the service control method further includes: while executing steps 302 to 306, detecting whether the number of service processes available to the electronic device is less than the upper limit number of service processes allowed to run in parallel for each preset time, if the number of service processes available to the electronic device is less than the upper limit number, creating a new service process in the electronic device until the number of service processes available to the electronic device is equal to the upper limit number.
In practical applications, ending a target process by an electronic device may result in a decrease in the number of service processes that can be operated by the electronic device, thereby affecting the running speed of the service configured to the electronic device. And acquiring the number of workable service processes of the electronic equipment at intervals of preset time, if the number of workable service processes of the electronic equipment is less than the upper limit number of service processes allowing the electronic equipment to run in parallel, indicating that a target process exists in the service processes of the electronic equipment, and ending the target process by the electronic equipment, and then creating a new service process in the electronic equipment until the number of workable service processes of the electronic equipment is equal to the upper limit number, so that the running speed of the service configured to the electronic equipment can be ensured.
In order to more clearly describe the service control method provided by the embodiment of the present invention, the following description will take an example of applying the service control method to a process management system, and the service control method is not limited in any way.
Referring to fig. 4, fig. 4 is a process management system, as shown in fig. 4, the process management system includes: a first electronic device 11A, a second electronic device 11B, an electronic third electronic device 11C, a fourth electronic device 11D, a dispatch center 12, and a database 13.
A service including a plurality of processes is provided in the first electronic device 11A, the second electronic device 11B, the third electronic device 11C, and the fourth electronic device 11D, and the process of the service is referred to as a service process, and the service process is respectively allocated to the first electronic device 11A, the second electronic device 11B, the third electronic device 11C, and the fourth electronic device 11D for processing.
In order to distinguish the above-described different electronic devices, one address is assigned to each of the first electronic device 11A, the second electronic device 11B, the third electronic device 11C, and the fourth electronic device 11D.
The database 13 stores therein a basic configuration list in which the addresses of the four electronic devices are stored, and hardware configuration information of the electronic device to which each address points, a memory weight coefficient of the electronic device set by a user, and an upper limit number of service processes allowing the electronic device to run in parallel. The hardware configuration information includes a physical memory size of the electronic device.
The dispatch center 12 reads the basic configuration list from the database 13, and transmits hardware configuration information in the basic configuration list, the memory weight coefficient of the electronic device set by the user, and the upper limit number of service processes allowing the electronic device to run in parallel to the corresponding electronic device.
Each electronic device transmits the received hardware configuration information, the memory weight coefficient of the electronic device set by the user and the upper limit number of the service process allowing the electronic device to run in parallel to the corresponding electronic device, and a calculation formula based on a threshold value is adopted: p=α×m/n calculates the memory space occupation threshold of each electronic device.
In the threshold calculation formula, p is a memory space occupation threshold of a service process of the electronic equipment, alpha is a memory weight coefficient, m is the physical memory size of the electronic equipment, and n is the upper limit of the number of working processes.
And then each electronic device monitors the process of which the process response is completed in the service, namely each electronic device acquires the memory occupation space of the service process which is completed in the electronic device and requested by the current user, compares the memory occupation space of the service process with the memory occupation space threshold of the service process of the electronic device, and if the memory occupation space of the service process is larger than the memory occupation space threshold, the service process is calibrated as a target process.
If the electronic equipment adopts a system with more than the linux 2.6.24 kernel version, the memory occupation condition of the process can be obtained by reading and analyzing the VmRss field. For the electronic device 13 of the system with the above Linux 2.6.24 kernel version not adopted by the dispatching center, a memory record file can be set for each process in a preset folder, the corresponding memory record file is newly built and deleted according to the new and closed service process, and the memory occupied data of the process is stored in the memory record file. In order to better distinguish the processes of the service, a process number is allocated to each process, and the memory record files of each process are in one-to-one correspondence with the process numbers of each process. Detecting whether the acquired memory occupied space of the process exceeds a memory occupied space threshold value allocated for the process, and if the memory occupied space of the process exceeds the memory occupied space threshold value allocated for the process, calibrating the process as a target process.
After the target process is calibrated, the electronic equipment with the target process detects whether the number of the workable service processes of the electronic equipment is smaller than the preset lower limit number of the workable service processes, if the number of the workable service processes of the electronic equipment is smaller than the lower limit number, a new service process is created in the electronic equipment until the number of the workable service processes in the electronic equipment is equal to the upper limit number of the service processes allowing the electronic equipment to run in parallel.
It should be noted that, when the service process of the electronic device is lower than the preset lower limit number of operable service processes, the electronic device may stop processing the process task allocated to the electronic device by the service, so as to avoid that the operable service process of the electronic device is lower than the preset lower limit number of operable service processes when the electronic device ends the target process, and before the electronic device ends the target process, the operable service process of the electronic device is detected, and if the operable service process of the electronic device is lower than the preset lower limit number of operable service processes, the new service process of the electronic device is triggered until the operable service process of the electronic device is equal to the upper limit number of service processes allowing the electronic device to run in parallel.
In the actual application process, the electronic device copies the parent service process through a fork (copy) command to obtain the child service process, so that the creation of a new service process is realized. It should be noted that when the child service process is obtained by copying the parent service process through the fork, if the child process ends before the parent process, the child process is actually deleted, but a data structure called a zombie process is left, in order to avoid generating the zombie process, when the electronic device is triggered to end the child process, the child process is put into a dormant state until the electronic device is triggered to end the parent process of the child process, and then the child process of the parent process is asynchronously ended.
Then, the electronic device removes the target process from the service process queue of the electronic device and stores the memory leakage information of the target process. The memory leakage information includes: the address of the electronic device, the process number of the target process, the time when the target process completes the process task for the first time, the time when the target process completes the process task for the last time, the net increment of the memory occupied by the target process and the total number of times when the target process completes the process task. The stored memory leakage information is used for providing basis for evaluating the memory leakage condition of the electronic equipment.
Then the electronic device ends the target process, and if only one target process exists in the service, the corresponding electronic device can directly end the target process. If at least two target processes exist in the service, the target processes need to be asynchronously ended in order to prevent the fluctuation of the process processing speed caused by the batch ending target processes.
In the following, taking an example that three target processes exist in the service and the three target processes exist in the first electronic device 11A, the second electronic device 11B and the electronic three electronic device 11C respectively, a process of asynchronously ending a plurality of target processes is described, and the number of target processes and the distribution situation of the target processes in the electronic devices are not limited.
The processes of the three target processes may be named as: a process a, a process B, and a process C, the process a being present in the first electronic device 11A, the process B being present in the second electronic device 11B, and the process C being present in the third electronic device 11C. The first electronic device 11A, the second electronic device 11B, and the third electronic device 11C respectively send an end request to the dispatch center 12, and after the dispatch center 12 receives the end request, three delay times are randomly generated and respectively transmitted to the first electronic device 11A, the second electronic device 11B, and the third electronic device 11C, and the first electronic device 11A, the second electronic device 11B, and the third electronic device 11C respectively end the process a, the process B, and the process C after delaying corresponding delay times based on the delay times of each target process. For example, the scheduling center randomly generates delay times of 5 seconds, 7 seconds, and 10 seconds, and transmits the delay time of 5 seconds to the first electronic device 11A, the delay time of 7 seconds to the second electronic device 11B, and the delay time of 10 seconds to the third electronic device 11C. After receiving the delay time, the first electronic device 11A delays for 5 seconds to end the process a; after receiving the delay time, the second electronic device 11B delays for 7 seconds to end the process B; the third electronic device 11C processes C after a delay of 10 seconds, thus realizing asynchronous termination of the plurality of target processes, avoiding fluctuations in the running speed of the service due to the batch termination of the target processes.
After each electronic device calculates the memory space occupation threshold of each electronic device, detecting whether the number of operable service processes of each electronic device is less than the upper limit number of service processes allowing the electronic device to run in parallel every preset time. If the number of operable service processes of the electronic device is less than the upper limit number, a new service process is created in the electronic device until the number of operable service processes of the electronic device is equal to the upper limit number. For example, if the number of service processes available for each electronic device is detected every one minute, and if the number of service processes available for the first electronic device 11A is detected as 12 and the upper limit of the number of service processes available for allowing the first electronic device 11A to run in parallel is 20, a new service process is created in the first electronic device 11A, and the number of service processes available for the first electronic device 11A is increased to 20.
The number of service processes which can be operated is the number of service processes which are running in the electronic equipment.
In this embodiment, in the first aspect, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problem of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request is not generated. In the second aspect, the memory space-occupiable threshold of the service process of the electronic device is calculated by the threshold calculation formula, so that the memory space-occupiable threshold of the service process of the electronic device is not required to be set for the electronic device according to manual experience. In the third aspect, whether the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is detected before the target process is finished, so that the problem of unstable operation of the service configured to the electronic device due to the fact that the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is avoided. In the fourth aspect, when a plurality of target processes exist in the service, a delay time is obtained for each target process randomly, and based on the extension time of each target process, the corresponding target process is ended after the corresponding delay time is delayed, so that asynchronous closing of the target processes is realized, abrupt changes in the number of processes of the service caused by shutting down the plurality of target processes in batches can be avoided, and unstable operation of the processes caused by abrupt changes in the number of processes of the service can be avoided. In the fifth aspect, since the memory leakage information of the target process is obtained before the target process ends, a basis is provided for evaluating the memory leakage condition of the corresponding service. In the sixth aspect, since the number of service processes that can be operated by the electronic device is detected every preset time, if the number of service processes that can be operated by the electronic device is less than the upper limit number of service processes that allow the electronic device to operate in parallel, a new service process is created in the electronic device until the number of service processes that can be operated by the electronic device is equal to the upper limit number, so that the terminated process can be restarted, and the operation speed of the service configured to the electronic device can be ensured.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, as shown in fig. 5, the electronic device includes:
the monitoring module 410 is configured to monitor a process in the service for which a process response has been completed.
And the processing module 420 is configured to end the target process when the monitoring module 410 monitors that the target process exists in the processes for which the process response is completed. The memory footprint of the target process exceeds the memory footprint threshold of the target process.
In this embodiment, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problems of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request will not occur.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, which is different from the electronic device shown in fig. 5, in this embodiment:
further, as shown in fig. 6, the electronic device further includes an obtaining module 430, configured to obtain hardware configuration information of the electronic device, a memory weight coefficient of the electronic device, and an upper limit number of service processes that allow the electronic device to run in parallel, where the hardware configuration information includes a physical memory size of the electronic device, and the service processes are service processes.
The monitoring module 410 includes: the calculating module 411 is configured to calculate a memory space threshold of a service process of the electronic device according to a threshold calculation formula, where the threshold calculation formula is: p=α×m/n, where p is a memory space-occupiable threshold of a service process of the electronic device, α is a memory weight coefficient of the electronic device, n is an upper limit number of the service process allowing the electronic device to run in parallel, and m is a physical memory size of the electronic device.
Optionally, the acquiring module 430 is further configured to acquire a memory space occupied by a process that has completed the process response in the service. The monitoring module 410 further includes: the detection module 412 is configured to compare the memory space occupied by the service process for which the process response has been completed with the memory space occupied by the service process threshold, and if the memory space occupied by the service process is greater than the memory space occupied by the service process threshold, then mark the service process as a target process.
Further, the detecting module 412 is further configured to detect whether the number of operable service processes of the electronic device is less than a preset lower limit number of operable service processes.
The processing module 420 is further configured to, if the detecting module 412 detects that the number of service processes available for operation of the electronic device is less than the lower limit number of service processes available for operation, create a new service process in the electronic device until the number of service processes available for operation in the electronic device is equal to the upper limit number of service processes that allow the electronic device to run in parallel.
The number of service processes which can be operated is the number of service processes which are running in the electronic equipment.
In this embodiment, in the first aspect, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problem of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request is not generated. In the second aspect, the memory space-occupiable threshold of the service process of the electronic device is calculated by the threshold calculation formula, so that the memory space-occupiable threshold of the service process of the electronic device is not required to be set for the electronic device according to manual experience. In the third aspect, whether the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is detected before the target process is finished, so that the problem of unstable operation of the service configured to the electronic device due to the fact that the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is avoided.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, which is different from the electronic device shown in fig. 5 and fig. 6, in this embodiment:
Further, the obtaining module 430 is further configured to obtain the delay time of each target process randomly generated for each target process if there are more than N target processes in the service. Wherein N is not less than 2.
The processing module 410 is further configured to end the corresponding target process after delaying the corresponding delay time based on the delay time of each target process acquired by the acquiring module 430.
Further, the processing module 410 is further configured to remove the target process from the service-capable process queue of the electronic device.
The electronic device further includes a storage module 440, configured to store memory leak information of the target process, where the memory leak information includes: the address of the electronic device, the process number of the target process, the time when the target process completes the process task for the first time, the time when the target process completes the process task for the last time, the net increment of the memory occupied by the target process and the total number of times when the target process completes the process task. The stored memory leakage information is used for providing basis for evaluating the memory leakage condition of the electronic equipment.
Further, the detecting module 412 is further configured to detect whether the number of service processes available for the electronic device is less than the upper limit number of service processes that allow the electronic device to run in parallel.
The processing module 410 is further configured to create a new service process in the electronic device if the number of service processes that can be operated by the electronic device is less than the upper limit number of service processes that allow the electronic device to operate in parallel, until the number of service processes that can be operated by the electronic device is equal to the upper limit number.
In this embodiment, in the first aspect, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problem of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request is not generated. In the second aspect, the memory space-occupiable threshold of the service process of the electronic device is calculated by the threshold calculation formula, so that the memory space-occupiable threshold of the service process of the electronic device is not required to be set for the electronic device according to manual experience. In the third aspect, whether the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is detected before the target process is finished, so that the problem of unstable operation of the service configured to the electronic device due to the fact that the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is avoided. In the fourth aspect, when a plurality of target processes exist in the service, a delay time is obtained for each target process randomly, and based on the extension time of each target process, the corresponding target process is ended after the corresponding delay time is delayed, so that asynchronous closing of the target processes is realized, abrupt changes in the number of processes of the service caused by shutting down the plurality of target processes in batches can be avoided, and unstable operation of the processes caused by abrupt changes in the number of processes of the service can be avoided. In the fifth aspect, since the memory leakage information of the target process is obtained before the target process ends, a basis is provided for evaluating the memory leakage condition of the corresponding service. In the sixth aspect, since the number of service processes that can be operated by the electronic device is detected every preset time, if the number of service processes that can be operated by the electronic device is less than the upper limit number of service processes that allow the electronic device to operate in parallel, a new service process is created in the electronic device until the number of service processes that can be operated by the electronic device is equal to the upper limit number, so that the terminated process can be restarted, and the operation speed of the service configured to the electronic device can be ensured.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, as shown in fig. 8, the electronic device includes: memory 520, processor 510, and computer programs stored on memory 520 and executable on processor 510. When the processor 510 executes the program in the memory 520, the service control method shown in fig. 1 to 3 is implemented.
The memory 520 may be a high-speed random access memory (RAM, random Access Memory) memory or a non-volatile memory (non-volatile memory), such as a disk memory. Memory 520 is used to store a set of executable program codes, and processor 510 is coupled to memory 520.
Further, the embodiment of the present invention also provides a computer readable storage medium, which may be provided in the mobile terminal in each of the above embodiments, and the computer readable storage medium may be a memory in the embodiment shown in fig. 6. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the service control method described in the embodiments shown in the foregoing fig. 1 to 3. Further, the computer-readable medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, etc. which may store the program code.
Referring to fig. 9, fig. 9 is a schematic diagram of a configuration interface in a service control method according to another embodiment of the invention. As shown in fig. 9, the configuration interface includes: a first input box 601 for inputting address information, and a first control 602 for inputting a detection instruction.
When the detection instruction is received, according to the address information input in the current first input box 601, acquiring the hardware configuration information of the electronic device pointed by the address information, where the hardware configuration information includes the physical memory size of the electronic device.
Optionally, the hardware configuration information further includes: the number of cores of the processor of the electronic device and the size of the network card of the electronic device.
And displaying hardware configuration information of the electronic device on the configuration interface so as to be used for configuring the memory weight coefficient of the electronic device and the upper limit number of service processes allowing the electronic device to run in parallel based on the hardware configuration information of the electronic device.
The memory weight coefficient and the upper limit number of the electronic device are used for determining a memory space threshold of the electronic device, so that when the electronic device is monitored to have a target process in service of the electronic device, the electronic device is triggered to end the target process.
The service process is a service process, and the target process is a process with memory occupation space exceeding a memory occupation space threshold of the electronic equipment.
In this embodiment, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problems of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request will not occur.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a service control system according to another embodiment of the present invention, and as shown in fig. 10, the service control system includes: an electronic device 701 and a monitoring device 702.
The electronic device 701 is configured to execute a service process, where the service process is a process of a service.
The electronic device 701 is further configured to monitor a process of a completed process response in the service, if the electronic device 701 monitors that a target process exists in the process of the completed process response, send a process ending request to the monitoring device 702, and when receiving an instruction that the monitoring device 702 allows ending based on the ending request response, the electronic device 701 ends the target process.
The memory occupied space of the target process exceeds the memory occupied space threshold of the target process.
In this embodiment, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problems of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request will not occur.
Referring to fig. 11, fig. 11 is a schematic diagram of a service control system according to another embodiment of the invention, and as shown in fig. 11, unlike the service control system shown in fig. 10, in this embodiment:
further, the service control system further includes: a database 703, a data management device 704 and a configuration terminal 705.
When the number of electronic devices 701 is greater than 1, in order to distinguish the electronic devices, the configuration information management device 704 is configured to allocate an address to each of the electronic devices, and the configuration information management device 704 is further configured to obtain hardware configuration information of each of the electronic devices 701 in real time, and transmit the addresses of the electronic devices and the hardware configuration information of each of the electronic devices to the database 703.
And the database 703 is configured to store the obtained hardware configuration information in a basic configuration table under the address of the corresponding electronic device.
A configuration terminal 705, configured to provide a display interface as shown in fig. 9, where the configuration interface includes: a first input box 601 for inputting address information, and a first control 602 for inputting a detection instruction.
When receiving the detection instruction, the configuration terminal 705 is configured to obtain, according to address information input in the current first input box 601, hardware configuration information of the electronic device to which the address information points from a basic configuration table of the database 703, where the hardware configuration information includes a physical memory size of the electronic device.
Optionally, the hardware configuration information further includes: the number of cores of the processor of the electronic device and the size of the network card of the electronic device.
The configuration terminal 705 is further configured to display hardware configuration information of the electronic device on the configuration interface, so as to configure a memory weight coefficient of the electronic device and an upper limit number of service processes allowing the electronic device to run in parallel based on the hardware configuration information of the electronic device.
The configuration terminal 705 is further configured to transmit, to the database 703, the memory weight coefficient of the electronic device and the upper limit number of service processes that allow the electronic device to run in parallel, which are input by the user.
The database 703 is further configured to store the memory weight coefficient of the electronic device and the upper limit number of the service processes that allow the electronic device to run in parallel in a basic configuration table under the address of the electronic device.
The service process is a service process, and the target process is a process with memory occupation space exceeding a memory occupation space threshold of the electronic equipment.
The electronic device 701 is further configured to obtain, from a basic configuration list under an address of the electronic device in the database 703, hardware configuration information of the electronic device, a memory weight coefficient of the electronic device, and an upper limit number of service processes that allow the electronic device to run in parallel.
The electronic device 701 is further configured to, according to the hardware configuration information of the electronic device obtained by the database 703, the memory weight coefficient of the electronic device, and the upper limit number of service processes that allow the electronic device to run in parallel. The memory occupiable threshold of the service process of the electronic device is calculated based on a threshold calculation formula p=α×m/n. In the threshold calculation formula, p is a memory space occupation threshold of a service process of the electronic equipment, alpha is a memory weight coefficient of the electronic equipment, n is an upper limit number of the service process allowing the electronic equipment to run in parallel, and m is a physical memory size of the electronic equipment.
Further, if the monitoring device 702 receives N end requests at the same time, the monitoring device 702 is further configured to randomly generate N delay times for each end request, and to combine the delay times with an instruction for allowing the end. Wherein N is not less than 2.
The electronic device 701 is further configured to delay the corresponding delay time according to the received delay time and the instruction for allowing the ending, and then end the corresponding target process.
Further, the monitoring device 702 is further configured to, when receiving the end request, detect, before sending an end permission instruction to the electronic device that sends the end request, whether the number of service processes that can be operated by the electronic device is less than a preset lower limit number of service processes that can be operated by the electronic device;
the monitoring device 702 is further configured to trigger the electronic device to create a new service process if the number of service processes available in the electronic device is less than the lower limit number of service processes available in the electronic device, until the number of service processes available in the electronic device is equal to the upper limit number of service processes that allow the electronic device to run in parallel;
the number of service processes is the number of service processes running in the electronic device.
Further, the monitoring device 702 is further configured to, when receiving the end request, trigger the electronic device to remove the target process pointed to by the end request from the service-capable process queue of the electronic device and obtain the memory leak information of the target process before sending the end permission instruction to the electronic device sending the end request.
The monitoring device 702 is further configured to convert the memory leak information into standard memory leak information with a unified data format, and then transmit the standard memory leak information to the database 703.
The memory leakage information includes: the address of the electronic device, the process number of the target process, the time of the target process completing the process task for the first time, the time of the target process completing the process task for the last time, the net increment of the memory occupied by the target process and the total number of times the target process completes the process task. The stored memory leakage information is used for providing basis for evaluating the memory leakage condition of the electronic equipment.
It should be noted that, converting the memory leak information into the standard memory leak information with the same data form may write the buffered standard memory leak information into the database 703 at one time, so as to reduce the number of times of writing and reading to the database.
Further, the monitoring device 702 is further configured to detect, for each preset time, whether the number of service processes available for each electronic device is less than the upper limit number of service processes allowed to run in parallel by the electronic device.
The monitoring device 702 is further configured to trigger a service process for creating information by the electronic device if the number of service processes available for operation of the electronic device is less than the upper limit number, until the number of service processes available for operation of the electronic device is equal to the upper limit number.
In this embodiment, in the first aspect, since only the target process in the service is closed, without restarting the entire service, and since only the process in the service for which the process response has been completed is monitored, the problem of missing data transmission and abnormal interruption of the user request caused by restarting the service or ending the process for processing the user request is not generated. In the second aspect, the memory space-occupiable threshold of the service process of the electronic device is calculated by the threshold calculation formula, so that the memory space-occupiable threshold of the service process of the electronic device is not required to be set for the electronic device according to manual experience. In the third aspect, whether the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is detected before the target process is finished, so that the problem of unstable operation of the service configured to the electronic device due to the fact that the number of operable service processes of the electronic device is less than the preset lower limit number of operable service processes is avoided. In the fourth aspect, when a plurality of target processes exist in the service, a delay time is obtained for each target process randomly, and based on the extension time of each target process, the corresponding target process is ended after the corresponding delay time is delayed, so that asynchronous closing of the target processes is realized, abrupt changes in the number of processes of the service caused by shutting down the plurality of target processes in batches can be avoided, and unstable operation of the processes caused by abrupt changes in the number of processes of the service can be avoided. In the fifth aspect, since the memory leakage information of the target process is obtained before the target process ends, a basis is provided for evaluating the memory leakage condition of the corresponding service. In the sixth aspect, since the number of service processes that can be operated by the electronic device is detected every preset time, if the number of service processes that can be operated by the electronic device is less than the upper limit number of service processes that allow the electronic device to operate in parallel, a new service process is created in the electronic device until the number of service processes that can be operated by the electronic device is equal to the upper limit number, so that the terminated process can be restarted, and the operation speed of the service configured to the electronic device can be ensured.
In the embodiments provided in the present application, it should be understood that the disclosed method, system, and electronic device may be implemented in other manners. For example, the embodiments described above are merely illustrative, e.g., the division of the modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication links shown or discussed with each other may be indirect coupling or communication links through interfaces, modules, or in electrical, mechanical, or other forms.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present invention.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The foregoing describes a service control method, system, electronic device and computer readable storage medium according to the present invention, and those skilled in the art may, according to the ideas of the embodiments of the present invention, vary in terms of specific implementations and application scope.

Claims (13)

1. A service control method, applied to at least two electronic devices, wherein services and processes of the services are distributed in the at least two electronic devices, the method comprising:
Acquiring hardware configuration information corresponding to each of the at least two electronic devices, memory weight coefficients of the at least two electronic devices and an upper limit number of service processes allowing each of the at least two electronic devices to run in parallel, wherein the hardware configuration information comprises the physical memory size of each of the at least two electronic devices, and the service processes are processes of the service;
calculating the memory occupied space threshold of each service process of the at least two electronic devices according to a threshold calculation formula, wherein the threshold calculation formula is as follows: p=α×m/n, where in the threshold calculation formula, p is a memory space-occupiable threshold allocated to a service process in a target electronic device, α is a memory weight coefficient corresponding to the service process in the target electronic device, n is an upper limit number of service processes that allow the target electronic device to run in parallel, m is a physical memory size of the target electronic device, and the target electronic device is any one of the at least two electronic devices;
monitoring the process of which the process response is completed in the respective service of the at least two electronic devices;
And ending the target process when the target process exists in the process of the completed process response in the target electronic equipment, wherein the target process is a service process of which the memory occupied space exceeds the memory occupied space threshold of the target process under the condition that the current user request is completed in the service of the target electronic equipment.
2. The service control method according to claim 1, wherein before the ending the target process, further comprising:
detecting whether the number of workable service processes of the target electronic equipment is smaller than the preset lower limit number of workable service processes;
if the number of the operable service processes of the target electronic device is smaller than the lower limit number of the operable service processes, creating new service processes in the target electronic device until the number of the operable service processes in the target electronic device is equal to the upper limit number of the service processes allowing the target electronic device to run in parallel;
wherein the number of service processes operable is the number of service processes running in the target electronic device.
3. The service control method according to claim 1 or 2, wherein if there are N or more target processes in the service, the ending the target processes includes:
Acquiring the delay time of each target process randomly generated for each target process;
based on the delay time of each target process, ending the corresponding target process after delaying the corresponding delay time;
wherein N is not less than 2.
4. The service control method according to claim 3, wherein before the ending the target process, further comprising:
removing the target process from the workable service process queue of the target electronic device, and storing memory leak information of the target process, wherein,
the memory leakage information includes: the address of the target electronic device, the process number of the target process, the time for the target process to finish the process task for the first time, the time for the target process to finish the process task for the last time, the net increment of the memory occupied by the target process and the total number of times for the target process to finish the process task.
5. The service control method according to claim 4, wherein the service control method further comprises:
detecting whether the number of workable service processes of the target electronic equipment is less than the upper limit number of service processes allowing the target electronic equipment to run in parallel at intervals of preset time;
If the number of the operable service processes of the target electronic equipment is less than the upper limit number, creating a new service process in the target electronic equipment until the number of the operable service processes of the target electronic equipment is equal to the upper limit number.
6. An electronic device, comprising:
the system comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring hardware configuration information corresponding to at least two electronic devices, memory weight coefficients of the at least two electronic devices and an upper limit number of service processes allowing the at least two electronic devices to run in parallel, wherein services and the service processes are distributed in the at least two electronic devices, the hardware configuration information comprises the physical memory sizes of the at least two electronic devices, and the service processes are the service processes;
the calculation module is used for calculating the memory space occupation threshold value of the service process of each of the at least two electronic devices according to a threshold value calculation formula, wherein the threshold value calculation formula is as follows: p=α×m/n, where in the threshold calculation formula, p is a memory space-occupiable threshold allocated to a service process in a target electronic device, α is a memory weight coefficient corresponding to the service process in the target electronic device, n is an upper limit number of service processes that allow the target electronic device to run in parallel, m is a physical memory size of the target electronic device, and the target electronic device is any one of the at least two electronic devices;
The monitoring module is used for monitoring the process of which the process response is completed in the respective service of the at least two electronic devices;
and the processing module is used for ending the target process when the monitoring module monitors that the target process exists in the process responded by the completed process in the target electronic equipment, wherein the target process is a service process of which the memory occupied space exceeds the memory occupied space threshold of the target process under the condition that the current user request is completed in the service of the target electronic equipment.
7. The electronic device of claim 6, wherein the monitoring module further comprises:
the detection module is used for detecting whether the number of the workable service processes of the target electronic equipment is smaller than the preset lower limit number of the workable service processes;
the processing module is further configured to create a new service process in the target electronic device if the number of service processes that can be operated by the target electronic device is less than the lower limit number of service processes that can be operated by the target electronic device until the number of service processes that can be operated by the target electronic device is equal to the upper limit number of service processes that allow the target electronic device to operate in parallel;
Wherein the number of service processes operable is the number of service processes running in the target electronic device.
8. The electronic device of claim 7, wherein the acquisition module is further configured to acquire a delay time of each target process that is randomly generated for each target process;
the processing module is further used for ending the corresponding target process after delaying the corresponding delay time based on the delay time of each target process;
and if more than N target processes exist in the service, the N is not less than 2.
9. The electronic device of claim 8, wherein the processing module is further to remove the target process from a workable service process queue of the target electronic device;
the electronic device further includes:
the storage module is used for storing the memory leakage information of the target process, wherein the memory leakage information comprises: the address of the target electronic device, the process number of the target process, the time for the target process to finish the process task for the first time, the time for the target process to finish the process task for the last time, the net increment of the memory occupied by the target process and the total number of times for the target process to finish the process task.
10. The electronic device of claim 9, wherein the detection module is further configured to detect, at every predetermined time, whether a number of service processes available for the target electronic device is less than an upper limit number of service processes that allow the target electronic device to run in parallel;
and the processing module is further configured to create a new service process in the target electronic device if the number of service processes available for operation of the target electronic device is less than the upper limit number, until the number of service processes available for operation of the target electronic device is equal to the upper limit number.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the service control method of any one of claims 1 to 5.
12. A service control method, comprising: displaying a configuration interface, the configuration interface comprising: the first input box is used for inputting address information, and the first control is used for inputting detection instructions;
when the detection instruction is received, acquiring hardware configuration information of target electronic equipment pointed by the address information according to the address information input in the first input box at present, wherein the hardware configuration information comprises the physical memory size of the target electronic equipment, the target electronic equipment is any one of at least two electronic equipment, and services and processes of the services are distributed in the at least two electronic equipment;
Displaying hardware configuration information of the target electronic equipment on the configuration interface, so that a user configures memory weight coefficients corresponding to service processes in the target electronic equipment and upper limit numbers of the service processes allowing the target electronic equipment to run in parallel based on the hardware configuration information of the target electronic equipment;
the memory weight coefficient and the upper limit number corresponding to the service process in the target electronic device are used for determining a memory occupied space threshold corresponding to the service process in the target electronic device, so that when the target process is monitored to exist in the service of the target electronic device, the target electronic device is triggered to finish the target process, the memory occupied space threshold corresponding to the service process in the target electronic device is calculated according to a threshold calculation formula, and the threshold calculation formula is that: p=α×m/n, where p is a memory space-occupiable threshold allocated to a service process in the target electronic device, α is a memory weight coefficient corresponding to the service process in the target electronic device, n is an upper limit number of service processes that allow the target electronic device to run in parallel, and m is a physical memory size of the target electronic device;
The service process is a process of the service, and the target process refers to a service process that the memory occupied space exceeds the memory occupied space threshold of the target electronic equipment under the condition that the current user request is completed in the service of the target electronic equipment.
13. A service control system, comprising: the system comprises at least two electronic devices and monitoring equipment, wherein services and processes of the services are distributed in the at least two electronic devices;
the at least two electronic devices are used for acquiring hardware configuration information corresponding to each of the at least two electronic devices, memory weight coefficients of the at least two electronic devices and an upper limit number of service processes allowing each of the at least two electronic devices to run in parallel, wherein the hardware configuration information comprises physical memory sizes of each of the at least two electronic devices;
the at least two electronic devices are further configured to calculate a memory space-occupiable threshold of each service process of the at least two electronic devices according to a threshold calculation formula, where the threshold calculation formula is: p=α×m/n, where in the threshold calculation formula, p is a memory space-occupiable threshold allocated to a service process in a target electronic device, α is a memory weight coefficient corresponding to the service process in the target electronic device, n is an upper limit number of service processes that allow the target electronic device to run in parallel, m is a physical memory size of the target electronic device, and the target electronic device is any one of the at least two electronic devices;
The at least two electronic devices are further configured to execute a service process, where the service process is a service process;
the at least two electronic devices are further used for monitoring the process of the completed process response in the service of the at least two electronic devices, if the target electronic device monitors that the target process exists in the process of the completed process response in the target electronic device, a process ending request is sent to the monitoring device, and when an instruction of permission ending of the monitoring device based on the process ending request response is received, the target process is ended;
the target process is a service process in which the memory occupied space exceeds the memory occupied space threshold of the target process under the condition that the current user request is completed in the service of the target electronic device.
CN201810354466.XA 2018-04-19 2018-04-19 Service control method, system, electronic device and computer readable storage medium Active CN110209548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810354466.XA CN110209548B (en) 2018-04-19 2018-04-19 Service control method, system, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810354466.XA CN110209548B (en) 2018-04-19 2018-04-19 Service control method, system, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110209548A CN110209548A (en) 2019-09-06
CN110209548B true CN110209548B (en) 2023-07-14

Family

ID=67779072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810354466.XA Active CN110209548B (en) 2018-04-19 2018-04-19 Service control method, system, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110209548B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051066A (en) * 2019-12-27 2021-06-29 阿里巴巴集团控股有限公司 Memory management method, device, equipment and storage medium
CN112463343B (en) * 2020-12-16 2023-09-26 广州博冠信息科技有限公司 Restarting method and device of business process, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014106410A1 (en) * 2013-01-05 2014-07-10 Tencent Technology (Shenzhen) Company Limited Method for terminal acceleration, terminal and storage medium
WO2017028719A1 (en) * 2015-08-19 2017-02-23 阿里巴巴集团控股有限公司 Metadata output method, client side, and metadata server

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104375899B (en) * 2014-11-21 2016-03-30 北京应用物理与计算数学研究所 The thread of high-performance computer NUMA perception and memory source optimization method and system
CN104503828B (en) * 2014-12-12 2018-12-11 广东欧珀移动通信有限公司 A kind of process management method and terminal
CN105868012B (en) * 2016-03-30 2019-09-10 北京小米移动软件有限公司 The method and apparatus for handling user's request
CN107544840A (en) * 2016-06-28 2018-01-05 北京优朋普乐科技有限公司 A kind of process management method and device
CN106383743B (en) * 2016-09-27 2020-04-17 腾讯科技(深圳)有限公司 Service processing method and system
CN107220076B (en) * 2016-09-27 2018-10-30 华为技术有限公司 A kind of method for recovering internal storage and device
CN106708616A (en) * 2016-11-29 2017-05-24 深圳天珑无线科技有限公司 Process control method and process control device
CN107656804B (en) * 2017-09-22 2019-03-01 深圳金融电子结算中心有限公司 Process pool system and method
CN107832100B (en) * 2017-10-27 2020-12-04 平安普惠企业管理有限公司 APK plug-in loading method and terminal thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014106410A1 (en) * 2013-01-05 2014-07-10 Tencent Technology (Shenzhen) Company Limited Method for terminal acceleration, terminal and storage medium
WO2017028719A1 (en) * 2015-08-19 2017-02-23 阿里巴巴集团控股有限公司 Metadata output method, client side, and metadata server

Also Published As

Publication number Publication date
CN110209548A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN108376112B (en) Pressure testing method, device and readable medium
CN108683720B (en) Container cluster service configuration method and device
US9712404B2 (en) Performance evaluation method and information processing device
CN107832100B (en) APK plug-in loading method and terminal thereof
EP3410288B1 (en) Online upgrade method, device and system
US11537304B2 (en) Data verification method and apparatus, and storage medium
CN108763089B (en) Test method, device and system
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN110457197B (en) Service testing method, device, computer equipment and storage medium
US11210127B2 (en) Method and apparatus for processing request
US20180157557A1 (en) Determining reboot time after system update
CN110209548B (en) Service control method, system, electronic device and computer readable storage medium
CN111104227A (en) Resource control method and device of K8s platform and related components
CN113191114B (en) Method and apparatus for validating a system
CN110569157B (en) Storage testing method, device, server and storage medium
US11194619B2 (en) Information processing system and non-transitory computer readable medium storing program for multitenant service
CN112631994A (en) Data migration method and system
US20210149726A1 (en) Scheduling device, scheduling system, scheduling method, and non-transitory computer-readable medium
CN114936106A (en) Method, device and medium for processing host fault
CN110704220B (en) Method, device and equipment for adjusting fusing parameters
CN112612578A (en) Virtual machine monitoring method and device
CN111143073A (en) Management method, equipment and storage medium of virtualized resources
TW201942741A (en) Information processing apparatus, control method, and program product
CN110704300A (en) TPC-DS automatic test method and TPC-DS test system
US11941432B2 (en) Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program

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