A service program information processing method, device, server and storage medium

By monitoring and collecting the memory occupancy of the service program on the server, the coupling problem caused by the dependence of the monitoring platform in the existing technology is solved, the timely detection and information collection of the memory leak of the service program are realized, and the efficiency of monitoring and the integrity of the information are improved. sex.

CN113791950BActive Publication Date: 2024-09-03BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202111078911.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-09-03
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

The existing server monitoring mechanism relies on the monitoring platform, resulting in high coupling between the service program's information processing and the monitoring platform. If the monitoring data cannot be uploaded to the server, the monitoring will be ineffective and abnormal situations such as memory leaks of the service program cannot be handled in a timely manner.

Method used

By monitoring the memory usage of the service program in real time on the server, we can determine whether there is a memory leak, and when a leak occurs, we will collect and save relevant running information in a loop, including hardware and software status information, to reduce dependence on the monitoring platform.

Benefits of technology

It realizes the memory leak judgment and information collection of the service program itself, reduces the dependence on the monitoring platform, improves the timeliness and information integrity of monitoring, and reduces the coupling between information processing and the monitoring platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113791950B
    Figure CN113791950B
Patent Text Reader

Abstract

The embodiment of the present invention provides a service program information processing method, device, server and storage medium, wherein the server running the service program monitors the memory usage of the service program; in the case of a memory leak, the operation information is cyclically collected and saved. Compared with the method in the related art in which the client reports the collected information to the server and the server makes an abnormal judgment, it not only does not need to rely on the monitoring platform, but also reduces the coupling between the information processing of the service program and the monitoring platform. Moreover, the memory leak can be detected in time, and the operation information can be collected and saved in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of program monitoring, and in particular to an information processing method, device, server and storage medium for a service program. Background Art

[0002] For servers, the memory usage of each service program directly affects the server's operating performance. For example, if a memory leak occurs during the operation of a service program, the memory will eventually be exhausted, and new service programs will not be able to apply for memory, causing the entire server to run abnormally. Here, memory leak refers to the situation where the service program does not release or does not release the memory that has been applied for by the service program in a timely manner after using the memory, resulting in the unreleased memory not being effectively used.

[0003] At present, the server monitoring program is used to monitor the operation of the server. The server monitoring program is generally divided into a client (agent) and a server (server). Among them, the client is usually set in the monitored server, collects relevant information of the server according to the set time period, and reports it to the server. The server is usually set in another monitoring server. The server will set certain trigger conditions. When the collected information meets the trigger conditions, the corresponding response processing is taken, such as sending an alarm message, notifying the operation and maintenance personnel by phone, etc.

[0004] This method requires a dedicated monitoring platform, which is large in size. Running the monitoring program requires the deployment of related components, and the monitoring information must be fed back to the server in real time. If the monitoring data cannot be uploaded to the server due to anomalies during the problem period, the monitoring will be invalid.

[0005] It can be seen that the current monitoring mechanism relies on the monitoring platform, and the information processing of the service program is highly coupled with the monitoring platform. Once the monitoring data cannot be uploaded to the server, the monitoring will be invalid and the information of the service program cannot be processed. Summary of the invention

[0006] The purpose of the embodiments of the present invention is to provide a service program information processing method, device, server and storage medium to reduce the coupling between the service program information processing and the monitoring platform. The specific technical solution is as follows:

[0007] A method for processing information of a service program, the method being applied to a server running the service program, the method comprising:

[0008] Monitor the memory usage of service programs;

[0009] Based on the current memory usage of the service program, determine whether a memory leak currently occurs;

[0010] In the case of a memory leak, the running information of the service program is collected; the running information includes: running status information of various hardware and software preset and related to the running of the service program.

[0011] Optionally, in the case where a memory leak occurs, collecting the running information of the service program includes:

[0012] In the case of a memory leak, the running information of the service program is collected cyclically based on a preset on-site collection interval; and the running information of the service program is saved.

[0013] Optionally, the step of monitoring the memory usage of the service program includes:

[0014] When receiving the instruction of starting the information processing script, the memory usage of the service program is monitored by running the information processing script.

[0015] Optionally, the step of monitoring the memory usage of the service program includes:

[0016] At least one target service program is determined from the service programs; and the current memory occupancy of each target service program is obtained according to a preset monitoring cycle.

[0017] Optionally, the step of determining whether a memory leak currently occurs based on the current memory usage of the service program includes:

[0018] Determine whether the current memory usage of each target service program is greater than a preset memory threshold; if the current memory usage of any target service program is greater than or equal to the preset memory threshold, determine that a memory leak phenomenon currently occurs.

[0019] Optionally, the step of obtaining the current memory usage of each target service program according to the preset monitoring period includes:

[0020] According to the preset monitoring cycle, a memory size query command is executed, wherein the memory size query command is used to query the memory size currently occupied by each target service program;

[0021] Receive the memory usage information of each target service program and record the receiving time as the current timestamp.

[0022] Optionally, the method further includes: in the event that a memory leak phenomenon currently occurs, determining the current timestamp as a triggering time of the memory leak.

[0023] Optionally, the step of cyclically collecting and saving the operation information based on a preset on-site collection interval duration includes:

[0024] Based on the operation information collection interval and the number of operation information cycle collection in the preset configuration information, the operation information is cyclically collected, and the collected operation information is saved based on the target path in the preset configuration information.

[0025] Optionally, the information processing script is a shell script.

[0026] The embodiment of the present invention further provides a service program information processing device, which is applied to a server running a service program, and the device includes:

[0027] A monitoring module is used to monitor the memory usage of the service program;

[0028] A judgment module, used to judge whether a memory leak occurs currently based on the current memory usage of the service program;

[0029] The operation information collection module is used to collect the operation information of the service program when a memory leak occurs. The operation information includes: the operation status information of various hardware and software related to the operation of the service program.

[0030] Optionally, the operation information collection module is specifically used to cyclically collect the operation information of the service program based on a preset on-site collection interval when a memory leak occurs; and save the operation information of the service program.

[0031] Optionally, the device further includes:

[0032] The monitoring module is specifically used to monitor the memory usage of the service program by running the information processing script when receiving an instruction to start the information processing script.

[0033] Optionally, the monitoring module includes a program determination submodule and a memory status acquisition submodule;

[0034] The program determination submodule is used to determine at least one target service program from the service programs;

[0035] The memory status acquisition submodule is used to obtain the current memory occupancy of each target service program according to a preset monitoring cycle.

[0036] Optionally, the judgment module is specifically used to judge whether the current memory usage of each target service program is greater than a preset memory threshold; if the current memory usage of any target service program is greater than or equal to the preset memory threshold, it is determined that a memory leak occurs.

[0037] Optionally, the memory status acquisition submodule is specifically used to execute a memory size query command according to the preset monitoring period, and the memory size query command is used to query the memory size currently occupied by each target service program; receive the memory occupancy information of each target service program, and record the receiving time as the current timestamp.

[0038] Optionally, the device further includes: a memory leak time determination module, configured to determine the current timestamp as a triggering time of the memory leak when a memory leak phenomenon currently occurs.

[0039] Optionally, the operation information collection module is specifically used to cyclically collect the operation information based on the operation information collection interval and the number of operation information cyclic collection in the preset configuration information, and save the collected operation information based on the target path in the preset configuration information.

[0040] Optionally, the information processing script is a shell script.

[0041] The embodiment of the present invention further provides a server, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0042] Memory, used to store computer programs;

[0043] The processor is used to implement the method steps described in the information processing method of any of the above service programs when executing the program stored in the memory.

[0044] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in the information processing method of any of the above service programs are implemented.

[0045] Beneficial effects of the embodiments of the present invention:

[0046] The information processing method, device, server and storage medium of the service program provided by the embodiment of the present invention, the server running the service program itself monitors the memory occupancy of the service program in real time; in the case of a memory leak, the operation information is cyclically collected and saved. In this way, the server running the service program itself determines the memory leak phenomenon, and collects and saves the operation information in time. Compared with the method in the related art in which the client reports the collected information to the server and the server makes an abnormal judgment, it not only does not need to rely on the monitoring platform, but also reduces the coupling between the information processing of the service program and the monitoring platform. In addition, the memory leak phenomenon can be detected in time, and the operation information can be collected and saved in time.

[0047] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0049] Figure 1 A flow chart of an information processing method for a service program provided by an embodiment of the present invention;

[0050] Figure 2 Another flow chart of the information processing method of the service program provided by the embodiment of the present invention;

[0051] Figure 3 for Figure 2 In the illustrated embodiment, a schematic diagram of the execution flow of the information processing script;

[0052] Figure 4 A schematic diagram of a structure of an information processing device for a service program provided by an embodiment of the present invention;

[0053] Figure 5 Another structural diagram of the information processing method of the service program provided by the embodiment of the present invention;

[0054] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0056] In order to reduce the coupling between the information processing of the service program and the monitoring platform, the embodiments of the present invention provide a method, device, server and storage medium for information processing of the service program, which are described below respectively.

[0057] See also Figure 1 The information processing method of the service program provided by the embodiment of the present invention is applied to a server running the service program and may include the following steps:

[0058] Step S101, monitoring the memory usage of the service program;

[0059] Step S102, based on the current memory usage of the service program, determining whether a memory leak currently occurs;

[0060] Step S103, when a memory leak occurs, collecting the running information of the service program.

[0061] In other specific embodiments, this step may specifically include: when a memory leak occurs, cyclically collecting the running information of the service program based on a preset on-site collection interval; and saving the running information of the service program.

[0062] In the embodiment of the present invention, the operation information may include: preset operation status information of various hardware and software related to the operation of the service program. For example, the operation information may specifically include the following:

[0063] 1. The current memory usage of each service program and the memory size occupied by each service program.

[0064] 2. The current CPU usage of each service program. If a multi-core CPU is used to execute the service program, the CPU usage of each core may be included.

[0065] 3. The network bandwidth currently used by each service program.

[0066] 4. The cumulative number of interruptions handled by the server.

[0067] 5. The read and write performance of the current hard disk.

[0068] 6. Current network receiving and sending status and network health status, such as whether there is delay, packet loss, etc.

[0069] The above operation information is only an example. In actual application, it can be set according to the actual situation.

[0070] As can be seen from the above embodiments, the embodiment of the present invention is a method in which the server running the service program itself determines the memory leakage phenomenon and collects and saves the operation information in a timely manner. Compared with the method in the related art in which the client reports the collected information to the server and the server makes an abnormal judgment, it not only does not need to rely on the monitoring platform, but also reduces the coupling between the information processing of the service program and the monitoring platform. Moreover, the memory leakage phenomenon can be detected in a timely manner, and the operation information can be collected and saved in a timely manner.

[0071] In addition, in the related art, the server operation status is monitored by a server monitoring program, and the collected monitoring information is universal, and does not collect overly detailed information for a single indicator. The collected operation information is not complete, which makes it difficult to conduct subsequent problem troubleshooting. However, the information processing method of the service program provided by the embodiment of the present invention is used, and the server itself performs monitoring, and the collected information is not limited by the monitoring platform, so more complete operation information can be collected.

[0072] In another embodiment, the memory usage of the service program can be monitored by running an information processing script. Figure 2 In another embodiment, the information processing method of the service program provided by the embodiment of the present invention may include the following steps:

[0073] Step S201, receiving an instruction to start an information processing script.

[0074] In this embodiment, a preset information processing script may be pre-installed in the server running the service program. The instruction may be used to start the information processing script.

[0075] Step S202, running a preset information processing script in the background.

[0076] In this embodiment, the information processing script is used to execute the steps of monitoring the memory usage of the service program, judging whether a memory leak occurs based on the current memory usage of the service program, and collecting the running information of the service program when a memory leak occurs.

[0077] The information processing script running in the background executes the subsequent steps 203 to 206:

[0078] Step S203, obtaining the current memory usage of each target service program according to a preset monitoring period.

[0079] Specifically, the current memory usage of each target service program can be obtained by executing a memory size query command according to a preset monitoring cycle. The memory size query command is used to query the memory size currently occupied by each target service program.

[0080] Step S204, determining whether the current memory usage of each target service program is greater than or equal to a preset memory threshold.

[0081] Step S205: If the current memory usage of any target service program is greater than or equal to the preset memory threshold, it is determined that a memory leak phenomenon currently occurs.

[0082] Step S206, based on the operation information collection interval and the number of operation information collection cycles in the preset configuration information, the operation information is collected cyclically, and the collected operation information is saved based on the target path in the preset configuration.

[0083] In this embodiment, the startup instruction of the information processing script may include: preset configuration information.

[0084] In this step, the preset configuration information can be obtained from the startup instruction.

[0085] Specifically, the preset configuration information may include: a preset monitoring period, a preset operation information collection interval, a number of operation information cycle collection times, at least one target service program to be monitored, a preset memory threshold of the service program, a preset operation information collection interval, a number of operation information cycle collection times, and a target path for storing operation information, etc.

[0086] In order to balance the system overhead, the information collection cycle in the related art will not be set very short, which makes it difficult for the monitoring program to collect short-term changes and difficult to find problems afterwards. In this embodiment, since the monitoring process is set in the server, the monitoring cycle can be set relatively short, for example, it can be set to 1s. In this way, memory changes in a shorter time can be collected, and whether memory leaks occur can be found more timely.

[0087] In addition, the operation information to be collected in this embodiment can be pre-written into the information processing script, or can be passed to the information processing script through preset configuration information. In this way, whether to increase or decrease the collection items of the operation information to be collected, it can be achieved by adjusting the information processing script or the preset configuration information, making the information processing of the service program more flexible.

[0088] Specifically, the information processing script may be a shell script. In practical applications, a background process may be used in a Unix or Linux operating system to run a lightweight shell script to process and collect information.

[0089] Shell script is similar to batch processing under Windows / Dos, that is, various commands are pre-placed into a file for easy one-time execution of a program file, mainly for the convenience of administrators to set up or manage.

[0090] In this embodiment, when starting the shell script, the configuration information can be passed into the script in the form of parameters, and there are two ways: front-end operation and back-end operation. When the front-end is running, the shell script can be started or ended by manually inputting a start instruction; when the back-end is running, a trigger condition can be set in the system, for example: when the preset monitoring start time arrives, or when the monitoring start instruction input by the user is received, the shell script is automatically started, and after the running information is collected, it is automatically ended, for example: by killing the process corresponding to the shell script to end the operation.

[0091] In this embodiment, during the execution of the information processing script, the triggering time of the memory leak can also be obtained. Figure 3 After the information processing script starts running in the background, you can perform the following steps:

[0092] Step S301, execute the query command and update the timestamp.

[0093] Specifically, based on the monitoring configuration information contained in the above information processing startup instruction, the memory size query command is first executed according to the preset monitoring cycle; then the memory usage information of each target service program is received, and the receiving time is recorded as the current timestamp.

[0094] In this embodiment, the memory usage information may be returned by the target service program or by the operating system, which is not limited here.

[0095] In this embodiment, the timestamp can be stored in the log file in the set directory, and only the last timestamp is retained. This way of overwriting the timestamp can avoid the situation where the log file is huge due to the long monitoring time, and only the last recorded timestamp is meaningful, that is, the last recorded timestamp is determined to be the exact time when the memory leak is triggered.

[0096] Step S302, determine whether a memory leak occurs currently. If not, that is, no memory leak occurs, then execute step 303; if a memory leak occurs, then execute step 304.

[0097] In this step, whether a memory leak occurs can be determined by determining whether the current memory usage of each target service program is greater than or equal to a preset memory threshold of the service program.

[0098] In actual applications, there may be multiple target service programs. As long as the current memory usage of one of the target service programs is greater than or equal to the preset memory threshold of the service program, it is determined that a memory leak occurs.

[0099] For example: when there are multiple target service programs, the maximum value of the memory currently used by each target service program can be taken as a comparison object and compared with the set memory size threshold (that is, the preset memory threshold of the above-mentioned service program). When the maximum value of the memory used by the service program is greater than or equal to the set threshold, it is determined that a memory leak has occurred, the monitoring process is exited, and the information collection process is entered.

[0100] Step S303, after waiting for the monitoring period, return to step 301.

[0101] In actual applications, a loop can be used. In each loop, the monitoring query command is executed first and the timestamp is updated. If the memory usage of the target service program does not reach the set threshold, the loop continues after waiting for the monitoring cycle set by sleep.

[0102] Step S304, collect operation information, and increase the number of cycle collection times by 1.

[0103] In this step, the information processing script can execute the information collection command based on the preset configuration information to collect the operation information once. The specific operation information items collected are as mentioned above and will not be repeated here.

[0104] Step S305, after waiting for the collection cycle, execute step S306.

[0105] In this embodiment, a loop is used. In each loop, the information collection commands are executed sequentially and the collection results are appended and stored in the corresponding information file. Then, the sleep setting is used to set the collection cycle length, and the number of collection times is accumulated and added by 1. If the counter exceeds the set number of times, the information collection is terminated.

[0106] When running information collection, you can execute the corresponding information collection command for each information collection item. There is no order restriction for multiple information collection commands, they are independent of each other and do not interfere with each other, making it easy to expand functions. When you need to obtain more information, you only need to add information collection commands without changing the information collection framework.

[0107] In this embodiment, the number of information collection times N can be roughly calculated according to the following formula:

[0108] N = time period / information collection cycle

[0109] For example, if the running information of the 10 minutes after the memory leak starts is collected, and the collection interval is 2 seconds, then N = 10 × 60 ÷ 2 = 300 times.

[0110] Step S306, determine whether the number of operation information cycle collection times reaches the preset number in the configuration information, if so, end; if not, return to step 304 to continue to collect operation information.

[0111] In this embodiment, in a Unix or Linux operating system, a background process is used to run a lightweight shell script for monitoring and information collection, which achieves decoupling from a complex monitoring platform, and monitoring and information collection are performed through a shell script, and the start and stop of the script does not affect the normal use of the overall monitoring platform.

[0112] At the same time, this embodiment can adjust the monitoring scanning cycle according to actual needs; adjust the monitoring program size threshold according to the monitored object program; configure the information collection cycle; configure the local storage location of the collected information data; configure the number of information collection cycles, that is, only collect relevant information within a local time period near the problem site, which can reduce the collection of redundant information.

[0113] In addition, the application of this embodiment can accurately capture the scene of the memory leak and collect operation information according to the set period, which can avoid long-term collection of information irrelevant to the memory leak and make the collected information more valuable.

[0114] Based on the same inventive concept as the above-mentioned service program information processing method, an embodiment of the present invention further provides a service program information processing device, which is applied to a server running a service program. Figure 4 The information processing device of the service program provided by the embodiment of the present invention may include:

[0115] Monitoring module 401, used to monitor the memory usage of the service program;

[0116] The judgment module 402 is used to judge whether a memory leak occurs based on the current memory usage of the service program;

[0117] The operation information collection module 403 is used to collect the operation information of the service program when a memory leak occurs. The operation information includes: the operation status information of various hardware and software preset related to the operation of the service program.

[0118] By using the information processing device of the service program provided by the embodiment of the present invention, the server running the service program itself determines the memory leakage phenomenon, and collects and saves the operation information in time. Compared with the method in the related art in which the client reports the collected information to the server and the server makes an abnormal judgment, it not only does not need to rely on the monitoring platform, but also reduces the coupling between the information processing of the service program and the monitoring platform. Moreover, the memory leakage phenomenon can be detected in time, and then the operation information can be collected and saved in time.

[0119] In other embodiments, the operation information collection module can be specifically used to cyclically collect the operation information of the service program based on a preset on-site collection interval when a memory leak occurs; and save the operation information of the service program.

[0120] See also Figure 5 Another structure of the information processing device of the service program provided by the embodiment of the present invention is Figure 4 On the basis of the illustrated embodiment, the device may further include: an instruction receiving module 501 , a script running module 502 , and a memory leak time determining module 503 .

[0121] The instruction receiving module 501 is used to receive the instruction of starting the information processing script.

[0122] The script running module 502 is used to run a preset information processing script in the background; the information processing script is used to trigger the monitoring module, the judgment module and the on-site acquisition module.

[0123] In this embodiment, the information processing start instruction may include: preset configuration information.

[0124] The preset configuration information may include: a preset monitoring cycle, a preset operation information collection interval, a number of operation information cycle collection times, at least one monitored target service program and a preset memory threshold of the service program.

[0125] Therefore, in this embodiment, the monitoring module 401 can be specifically used to obtain the current memory usage of each target service program according to the preset monitoring period.

[0126] The judgment module 402 can be specifically used to judge whether the current memory usage of each target service program is greater than or equal to a preset memory threshold; if the current memory usage of any target service program is greater than or equal to the preset memory threshold, it is determined that a memory leak occurs.

[0127] like Figure 5 As shown, in this embodiment, the monitoring module 401 may include: a program determination submodule 4011 and a memory status acquisition submodule 4012 .

[0128] The program determination submodule 4011 may be used to determine at least one target service program from the service programs.

[0129] The memory status acquisition submodule 4012 can be used to obtain the current memory usage of each target service program according to a preset monitoring period.

[0130] In this embodiment, the memory status acquisition submodule 4012 can execute a memory size query command according to the preset monitoring cycle, and the memory size query command is used to query the memory size currently occupied by each target service program; receive the memory occupancy information of each target service program, and record the receiving time as the current timestamp.

[0131] The memory leak time determination module 503 is used to determine the current timestamp as the triggering time of the memory leak when a memory leak phenomenon currently occurs.

[0132] In this embodiment, the preset configuration information may include: preset operation information collection interval duration, operation information cycle collection times, and a target path for storing the operation information.

[0133] The operation information collection module 403 is specifically used to cyclically collect operation information based on the operation information collection interval and the number of operation information cyclic collection in the preset configuration information, and save the collected operation information based on the target path in the preset configuration information.

[0134] In this embodiment, the information processing script may be a shell script.

[0135] In this embodiment, in a Unix or Linux operating system, a background process is used to run a lightweight shell script for monitoring and information collection, which achieves decoupling from a complex monitoring platform, and monitoring and information collection are performed through a shell script, and the start and stop of the script does not affect the normal use of the overall monitoring platform.

[0136] At the same time, this embodiment can adjust the monitoring scanning cycle according to actual needs; adjust the monitoring program size threshold according to the monitored object program; configure the information collection cycle; configure the local storage location of the collected information data; configure the number of information collection cycles, that is, only collect relevant information within a local time period near the problem site, which can reduce the collection of redundant information.

[0137] In addition, the application of this embodiment can accurately capture the scene of the memory leak and collect operation information according to the set period, which can avoid long-term collection of information irrelevant to the memory leak and make the collected information more valuable.

[0138] Based on the same inventive concept as the information processing method of the above service program, the embodiment of the present invention also provides a server, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0139] Memory 603, used for storing computer programs;

[0140] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:

[0141] Monitor the memory usage of service programs;

[0142] Based on the current memory usage of the service program, determine whether a memory leak currently occurs;

[0143] In the case of a memory leak, the running information of the service program is collected; the running information includes: running status information of various hardware and software preset and related to the running of the service program.

[0144] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0145] The communication interface is used for communication between the above server and other devices.

[0146] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0148] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the information processing method of any of the above-mentioned service programs are implemented.

[0149] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the information processing method of any service program in the above embodiments.

[0150] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0151] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0152] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0153] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A service program information processing method, characterized in that: Applied to a server running a service program, the method comprises: Monitor the memory usage of service programs; Based on the current memory usage of the service program, determine whether a memory leak currently occurs; In the case of a memory leak, based on a preset on-site collection interval, the running information of the service program is cyclically collected; the running information of the service program is saved; the running information includes: preset running status information of various hardware and software related to the running of the service program.

2. The method according to claim 1, characterized in that The step of monitoring the memory usage of the service program includes: When an instruction to start the information processing script is received, the memory usage of the service program is monitored by running the information processing script.

3. The method according to claim 1, characterized in that The step of monitoring the memory usage of the service program includes: Determining at least one target service program from the service programs; According to the preset monitoring cycle, obtain the current memory usage of each target service program.

4. The method according to claim 1, characterized in that: The step of determining whether a memory leak currently occurs based on the current memory usage of the service program comprises: Determine whether the current memory usage of each target service program is greater than a preset memory threshold; If the current memory usage of any target service program is greater than or equal to the preset memory threshold, it is determined that a memory leak phenomenon currently occurs.

5. The method according to claim 3, characterized in that: The step of obtaining the current memory usage of each target service program according to the preset monitoring cycle includes: According to the preset monitoring cycle, a memory size query command is executed, wherein the memory size query command is used to query the memory size currently occupied by each target service program; Receive the memory usage information of each target service program and record the receiving time as the current timestamp.

6. The method according to claim 5, characterized in that The method further comprises: In the case where a memory leak phenomenon currently occurs, the current timestamp is determined as the triggering time of the memory leak.

7. The method according to claim 1, characterized in that The step of cyclically collecting and saving the operation information based on the preset on-site collection interval duration includes: Based on the operation information collection interval and the number of operation information cycle collection in the preset configuration information, the operation information is cyclically collected, and the collected operation information is saved based on the target path in the preset configuration information.

8. The method according to claim 1, characterized in that The information processing script is: a shell script.

9. An information processing device for a service program, characterized in that: Applicable to a server running a service program, the device comprises: A monitoring module is used to monitor the memory usage of the service program; A judgment module, used to judge whether a memory leak occurs currently based on the current memory usage of the service program; The operation information collection module is used to cyclically collect the operation information of the service program based on a preset on-site collection interval when a memory leak occurs; save the operation information of the service program; the operation information includes: preset operation status information of various hardware and software related to the operation of the service program.

10. A server, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method and apparatus for monitoring memory leakage

    CN104866409A

  • Detecting and locating method and device for memory leakage based on PoolMon

    CN104965779A

  • Process resource real-time monitoring method

    CN105808412A

  • JVM (Java Virtual Machine) memory leakage automatic-detection method and system

    CN108073439A

  • Memory monitoring method, device and apparatus and storage medium

    CN111488256A