Application monitoring method, device, system, electronic device and readable medium
By laying out extension programs in the kernel of PHP applications, crawling and merging execution data, the problem of insufficient information acquisition in the existing technology is solved, and fast and detailed application monitoring and performance optimization are achieved.
Patent Information
- Application Number
- CN202010002014.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-02
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-01-02
AI Technical Summary
In the prior art, the problem of burying point positioning errors in PHP applications has problems such as large workload, only obtaining a small amount of information, and affecting performance, making it difficult to quickly solve errors and performance problems in applications.
By laying out extension programs in the application kernel, crawling the application's execution data according to predetermined rules, generating monitoring data through merged programs and sending it to the monitoring server, obtaining full information and real-time monitoring.
You can obtain the full amount of information about the application without modifying the PHP application code, quickly locate errors and performance problems, provide detailed function call relationships, file names, line numbers and error causes, and improve the efficiency of error resolution and performance optimization.
Smart Images

Figure CN113064783B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer information processing, and in particular, to an application monitoring method, device, system, electronic device and readable medium. Background Art
[0002] Due to the rapid development and continuous innovation of the Internet itself, only the fastest development speed and the lowest cost can win, keep a website's leading position and attract more users. Various applications, such as PHP-related technologies and related talents, cater to the current development trend of the Internet. Hypertext preprocessor PHP (Hypertext Preprocessor) as a very excellent and simple Web development language, closely combined with Linux, Nginx, and Mysql, forms an open source golden combination of LNMP (a website server architecture), which not only reduces the cost of use, but also improves the development speed to meet the latest interactive network development applications. Among the 500 million Internet websites in the world, more than 60% use PHP technology. The growing number of Internet users has also put forward higher requirements for the performance and stability of PHP websites. Therefore, there must be a system for real-time monitoring of PHP application performance and errors, quickly locating and eliminating errors, improving website performance and real-time alarms to avoid losses.
[0003] In the prior art, error problems in applications are often located by tracking points in PHP applications. However, the tracking point method requires developers to perform a large number of tracking points, and the tracking point method can only obtain a small amount of information about the application. Therefore, a new application monitoring method, device, system, electronic device and readable medium are needed.
[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0005] In view of this, the present disclosure provides an application monitoring method, device, system, electronic device and readable medium, which can easily and quickly capture all information related to the application and quickly solve problems existing in the application.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to the first aspect of the present disclosure, a method for monitoring an application is proposed, the method comprising: capturing the execution data of the application according to predetermined rules through an extension program; sending the execution data to a merging program through the extension program; merging the execution data through the merging program to generate monitoring data; and sending the monitoring data to a monitoring server through the merging program.
[0008] In an exemplary embodiment of the present disclosure, capturing the execution data of an application program according to a predetermined rule through an extension program includes: receiving an access instruction of the application program through the extension program, and triggering the extension program to capture the execution data of the application program according to the predetermined rule.
[0009] In an exemplary embodiment of the present disclosure, the method further includes: arranging the extension program in the kernel of the application program.
[0010] In an exemplary embodiment of the present disclosure, the execution data of an application is captured according to a predetermined rule through an extension program, including: determining a function name to be monitored according to the predetermined rule; and capturing the execution data corresponding to the function name in the application through the extension program.
[0011] In an exemplary embodiment of the present disclosure, capturing the execution data corresponding to the function name in the application program through an extension program includes: the extension program obtains the execution data corresponding to the function name through function pointer replacement.
[0012] In an exemplary embodiment of the present disclosure, the execution data is merged by the merging program to generate monitoring data, including: monitoring a two-way communication connection through a first subprocess of the merging program to obtain the execution data, and merging the execution data to generate monitoring data.
[0013] In an exemplary embodiment of the present disclosure, sending the monitoring data to the monitoring server through the merging program includes: sending the monitoring data to the monitoring server through a second subprocess of the merging program.
[0014] In an exemplary embodiment of the present disclosure, the method further includes: regularly updating the configuration information of the merging program through a third subprocess of the merging program.
[0015] According to a second aspect of the present disclosure, an application monitoring device is proposed, which includes: a capture module, configured to capture the execution data of the application according to predetermined rules through an extension program; a first sending module, configured to send the execution data to a merging program through the extension program; a generating module, configured to merge the execution data through the merging program to generate monitoring data; and a second sending module, configured to send the monitoring data to a monitoring server through the merging program.
[0016] In an exemplary embodiment of the present disclosure, the capture module is configured to receive an access instruction of the application program through the extension program, and trigger the extension program to capture execution data of the application program according to a predetermined rule.
[0017] In an exemplary embodiment of the present disclosure, the device further includes: a placement module configured to place the extension program in the kernel of the application.
[0018] In an exemplary embodiment of the present disclosure, the capture module is configured to: determine the function name to be monitored according to a predetermined rule; and capture the execution data corresponding to the function name in the application program through an extension program.
[0019] In an exemplary embodiment of the present disclosure, the capture module is configured to obtain the execution data corresponding to the function name by replacing the function pointer through the extension program.
[0020] In an exemplary embodiment of the present disclosure, the generating module is configured to monitor the two-way communication connection through the first subprocess of the merging program to obtain the execution data, and perform data merging on the execution data to generate monitoring data.
[0021] In an exemplary embodiment of the present disclosure, the second sending module is configured to send the monitoring data to the monitoring server through the second sub-process of the merging program.
[0022] In an exemplary embodiment of the present disclosure, the device further includes: an updating module configured to periodically update the configuration information of the merging program through a third sub-process of the merging program.
[0023] According to a third aspect of the present disclosure, an application monitoring system is proposed, which includes: a proxy server, configured to obtain access instructions of an application; and forward the access instructions to an extension program server; the extension program server, configured to capture execution data of the application according to predetermined rules through the extension program, and send the execution data to a data server; the data server, configured to merge the execution data to generate monitoring data; and send the monitoring data to the monitoring server; the monitoring server, configured to receive and display the monitoring data.
[0024] According to a fourth aspect of the present disclosure, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0025] According to a fifth aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.
[0026] According to the application monitoring method, device, system, electronic device and readable medium disclosed in the present invention, it is possible to quickly and conveniently capture all information related to the application and quickly solve problems existing in the application.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail its exemplary embodiments with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present disclosure, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative work.
[0029] Figure 1 The present invention is a system block diagram showing a method and device for monitoring an application program according to an exemplary embodiment.
[0030] Figure 2 The figure is a flow chart of a method for monitoring an application program according to an exemplary embodiment.
[0031] Figure 3 is a schematic diagram of an application monitoring method according to another exemplary embodiment.
[0032] Figure 4 is a schematic diagram of an application monitoring method according to another exemplary embodiment.
[0033] Figure 5 The figure is a block diagram of a device for monitoring an application program according to an exemplary embodiment.
[0034] Figure 6 is a block diagram of an application monitoring system according to another exemplary embodiment.
[0035] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.
[0036] Figure 8 The present invention is a schematic diagram showing a computer-readable storage medium according to an exemplary embodiment. DETAILED DESCRIPTION
[0037] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0038] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0040] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0041] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the disclosed concepts. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0042] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present disclosure, and therefore cannot be used to limit the protection scope of the present disclosure.
[0043] The inventor of this application discovered that in the prior art, by embedding points in PHP applications, simple information such as the execution time and number of calls of key methods is reported, and certain thresholds are set in the system background to alarm. After receiving the alarm, errors are resolved and performance is optimized based on simple information.
[0044] The existing method of locating application information has the following disadvantages:
[0045] 1. You need to manually modify the code of the PHP application. Developers need to sort out the key methods themselves to add tracking code, but usually they will not add all methods, firstly because the workload is huge, and secondly because adding too many tracking points to non-critical methods may affect the performance of the website.
[0046] 2. It is impossible to know whether the unburied methods affect the website performance or cause errors. There will be a large number of unburied methods on the website. If these methods cause errors or performance degradation in the production environment, technicians and users will not be able to perceive it.
[0047] 3. It is difficult to locate errors and optimize performance. When a method in an application generates an error or performance degradation, the only information that can be obtained by tracking points is simple information such as failure to call the method or increased execution time. There is no key information such as the calling relationship, file name, line number, error cause, etc. when the method is called, which is not conducive to solving the problem.
[0048] In view of this, the present application proposes an application monitoring method, device, and system that can be used out of the box without modifying the PHP application code.
[0049] According to the application monitoring method of the present application, since the acquired application data is full data, application errors and methods with slower performance (such as methods with execution time exceeding 500 milliseconds) can be dynamically captured without missing any.
[0050] Moreover, according to the application monitoring method of the present application, detailed information such as the function call relationship, file name, line number, error cause, parameter value passed at runtime, etc. when performance degrades or errors occur can be obtained to quickly resolve the errors.
[0051] Figure 1 The present invention is a system block diagram showing a method and device for monitoring an application program according to an exemplary embodiment.
[0052] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0053] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0054] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0055] The server 105 may be a server that provides various services, such as a backend server that supports shopping websites browsed by users using the terminal devices 101, 102, and 103. The backend server 105 may analyze and process the received request data through its own installed application program, and feed back the processing result to the terminal device.
[0056] The server 105 may, for example, capture the execution data of the application according to predetermined rules through an extension program; the server 105 may, for example, send the execution data to a merging program through the extension program; the server 105 may, for example, merge the execution data through the merging program to generate monitoring data; the server 105 may, for example, send the monitoring data to a monitoring server through the merging program.
[0057] The server 105 may also receive an access instruction of the application program through the extension program, for example, and trigger the extension program to capture the execution data of the application program according to a predetermined rule.
[0058] The server 105 may be a physical server, or may be composed of multiple servers, for example. A portion of the server 105 may be used as a proxy server system in the present disclosure, configured to obtain access instructions of the application; and forward the access instructions to the extension program server; a portion of the server 105 may be used as an extension program server system in the present disclosure, configured to capture the execution data of the application according to predetermined rules through the extension program, and send the execution data to the data server; a portion of the server 105 may be used as a data server system in the present disclosure, configured to merge the execution data to generate monitoring data; and send the monitoring data to the monitoring server; and a portion of the server 105 may also be used as a monitoring server system in the present disclosure, for example, to receive and display the monitoring data.
[0059] It should be noted that the application monitoring method provided in the embodiment of the present disclosure can be executed by the server 105, and accordingly, the application monitoring device can be set in the server 105. The web page end provided for users to browse products and the request end for merchant query are generally located in the terminal devices 101, 102, and 103.
[0060] Figure 2 2 is a flowchart of an application monitoring method according to an exemplary embodiment. The application monitoring method 20 at least includes steps S202 to S208.
[0061] like Figure 2 As shown, in S202, the execution data of the application is captured according to a predetermined rule by the extension program. The application may be a PHP application. It is worth mentioning that the method of the present application may also be applied to other applications.
[0062] In one embodiment, the proxy server obtains the access instruction of the application program, and forwards the access instruction to the extension program, triggering the extension program to capture the execution data of the application program according to a predetermined rule. Wherein, the proxy server can be, for example, an Nginx server, which is a high-performance hypertext transfer protocol HTTP and reverse proxy service, and also an IMAP (Interactive Mail Access Protocol) / POP3 (Post Office Protocol version 3) / SMTP (Simple Mail Transfer Protocol) service. Nginx serves as a load balancing service: Nginx can directly support Rails (a Web development framework) and PHP programs to provide external services internally, and can also support external services as an HTTP proxy service. Nginx is written in C language.
[0063] In one embodiment, the proxy server forwarding the access instruction to the extension program includes: monitoring the access instruction through a resident process to forward the access instruction to the extension program.
[0064] In one embodiment, the method further includes: arranging the extension program in the kernel of the application program. The PHP extension program (e.g., jd_agent.so) can be developed using C language. In one embodiment, the extension program is located in an extension program server, and the execution data corresponding to multiple functions in the application program can be captured through the extension program in the extension program server.
[0065] In one embodiment, the extension program may determine the function name to be monitored according to a predetermined rule, and capture the execution data corresponding to the function name in the application program through the extension program.
[0066] In one embodiment, the application program may be a scripting language program, in which a plurality of functions for executing data are provided. When the extension program receives the access instruction, the plurality of functions in the scripting language program are captured to obtain the execution data.
[0067] In one embodiment, the predetermined rule may include a specified function name of the execution data or a threshold value of the execution data. The extension program can monitor multiple functions of the execution data of the application program in real time. After receiving the access instruction, if the predetermined rule is a specified function name of the execution data, the function name of the specified execution data in the predetermined rule is matched with the functions of the execution data of all monitored applications to determine the function name to be monitored. If the predetermined rule is a threshold value of each execution data, the execution data of all functions of the monitored application program is statistically analyzed to obtain the execution data that reaches the corresponding execution data threshold value. The function names of these execution data are the function names of the determined function names to be monitored. After determining the function names, the execution data corresponding to these function names are captured.
[0068] In one embodiment, the principle of the PHP extension program to capture function-related data is to replace it with a function pointer in C language, and the specific form can be, for example, as follows:
[0069] Assuming that you need to capture the execution time of the PHP kernel function zend_execute, a similar extension pseudo code can be as follows:
[0070] void(*old_zend_execute)(); / Used to save the original zend_execute function pointer
[0071] void jd_execute(); / / Used to capture the execution time of zend_execute function
[0072] old_zend_execute = zend_execute; / / Save the original function pointer
[0073] zend_execute = jd_execute; / / Replace with your own function pointer
[0074] void jd_execute(){
[0075] / / Record start time
[0076] old_zend_execute();
[0077] / / Record end time
[0078] }
[0079] In one embodiment, the execution data may include but is not limited to: request time execution time, task execution time, function call relationship, server command execution parameters, error information, and external service information. More specifically, the execution data may also include: according to the configuration in the extension program or the threshold set in the extension program, the request execution time, function or method execution time, function or method call relationship, parameter value, function or method file name, line number, SQL statement of allergy sensitive information, SQL class function or method execution time, NOSQL operation execution time, error information, external service (PHP requests third-party service via HTTP / TCP) execution time, and GET, POST data of this request and other information. Using the PHP extension program (jd_agent.so) to capture data is not only detailed and rich, but also does not require modifying a line of PHP project code.
[0080] In S204, the execution data is sent to the merging program through the extension program.
[0081] In one embodiment, a cache merger program (jd_daemon) may be constructed, and the extension program sends the acquired execution data to the merger program.
[0082] In S206, the execution data is merged by the merging program to generate monitoring data.
[0083] In one embodiment, the merging program (jd_daemon) is used to cache and merge the execution data sent by the PHP extension program (jd_agent.so), and then send it to the server at a fixed time (for example, every minute).
[0084] In one embodiment, when jd_daemon is started, a child process called jd_dameon is created. The parent process is responsible for monitoring whether the child process exits abnormally, and restarting the child process if it exits. Specifically, the child process can be created by replicating fork, fork function is a fork function in UNIX and UNIX-like systems. The return value of fork function: if it is successfully called once, two values are returned, the child process returns 0, and the parent process returns the child process mark; otherwise, -1 is returned if an error occurs.
[0085] The fork function splits the running program into two (almost) identical processes, each of which starts a thread that starts executing from the same location in the code. The threads in both processes continue to execute as if two users had started two copies of the application at the same time.
[0086] In one embodiment, the jd_daemon subprocess first loads a configuration file, which may include but is not limited to path information and port information. When the configuration file is updated, jd_daemon is automatically restarted.
[0087] In one embodiment, after the jd_daemon subprocess first loads the configuration file, three threads may be started: a first process, a second process, and a third process, wherein the first process may be a monitoring thread, the second process may be a heartbeat thread, and the third process may be a configuration update thread.
[0088] In one embodiment, the first subprocess of the merging program monitors the two-way communication connection to obtain the execution data, and merges the execution data to generate monitoring data. According to an embodiment of the present invention, the first subprocess can calculate the execution data, for example, count the number of times.
[0089] In one embodiment, the monitoring data is sent to the monitoring server through the second subprocess of the merging program. After receiving the monitoring data sent by the first subprocess, the second subprocess periodically sends the monitoring data to the monitoring server.
[0090] In one embodiment, the configuration information of the merged program is updated regularly through the third subprocess of the merged program. The third subprocess, such as the configuration update thread, is responsible for sending environmental information to the server when jd_daemon is started, and obtaining configuration information from the server. The configuration related to jd_agent.so will be written into the shared memory for jd_agent.so to read, and then the updated configuration information will be obtained from the server periodically (for example, every 10 seconds). The configuration information may include: the configuration file loaded by the merged process, and the predetermined rules for capturing execution data in the extended program.
[0091] In S208, the monitoring data is sent to the monitoring server through the merging program. After the merging program generates the monitoring data through the first subprogram, the monitoring data is periodically reported to the monitoring server through its second subprogram and displayed.
[0092] According to the application monitoring method disclosed in the present invention, the mode of monitoring the running status of the application through the application extension program can, on the one hand, conveniently obtain more execution data compared to the point-tracking method in the prior art. The number of points-tracking is limited, and if more execution data is to be obtained, more points need to be tracked. On the other hand, there is no need to rewrite the upper-level code of the application program. By adding the underlying code of the extension program in the kernel, the extension program can be reused and the execution data of the application program can be quickly obtained.
[0093] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.
[0094] Figure 3 is a schematic diagram of an application monitoring method according to another exemplary embodiment. Figure 3 The whole process of application monitoring is illustrated by example.
[0095] Arrange the PHP extension program in the extension program server in advance. The PHP extension program can be arranged inside the PHP program and started when the PHP program is started;
[0096] The proxy server obtains the access instruction of the application program and forwards the access instruction to the extension program server.
[0097] The extension program server monitors multiple functions in the application program in real time through the extension program. When receiving an access request, it captures the execution data of the application program according to a predetermined rule and sends the execution data to the data server.
[0098] The merging program may be located in the data server, and the merging program may merge the execution data to generate monitoring data; and send the monitoring data to the monitoring server.
[0099] The monitoring server receives and displays the monitoring data.
[0100] According to the application monitoring method disclosed in the present invention, detailed data during the execution of a PHP application is captured through a PHP extension program, rather than adding embedding code in the PHP application to capture simple data. The full amount of information of a PHP application can be automatically captured without modifying the PHP application code.
[0101] Figure 4 FIG. 1 is a schematic diagram of an application monitoring method according to another exemplary embodiment. Figure 4 As shown in the figure, when the merged program jd_daemon is started, a child process jd_dameon is created. The parent process is responsible for monitoring whether the child process exits abnormally, and restarting the child process if it exits. Specifically, a child process can be created by fork, for example. The fork function is a fork function in UNIX and UNIX-like systems. The return value of the fork function: if it is successfully called once, two values are returned, the child process returns 0, and the parent process returns the child process mark; otherwise, -1 is returned if an error occurs.
[0102] The fork function splits the running program into two (almost) identical processes, each of which starts a thread that starts executing from the same location in the code. The threads in both processes continue to execute as if two users had started two copies of the application at the same time.
[0103] In one embodiment, after the jd_daemon subprocess first loads the configuration file, three threads can be started: a listening thread, a heartbeat thread, and an update configuration thread. The two-way communication connection is monitored by the listening thread to obtain the execution data, and the execution data is merged to generate monitoring data. The monitoring data is sent to the monitoring server through the heartbeat thread. The configuration information of the merged program is regularly updated through the update configuration thread.
[0104] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided by the present disclosure are performed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0105] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0106] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0107] Figure 5The block diagram of an application monitoring device according to an exemplary embodiment is shown in FIG. 5 . The application monitoring device 50 includes: a capture module 502 , a first sending module 504 , a generation module 506 , and a second sending module 508 .
[0108] The capture module 502 is configured to capture the execution data of the application program according to a predetermined rule through the extension program.
[0109] The first sending module 504 is configured to send the execution data to the merging program through the extension program.
[0110] The generating module 506 is configured to merge the execution data through the merging program to generate monitoring data.
[0111] The second sending module 508 is configured to send the monitoring data to the monitoring server through the merging procedure.
[0112] According to the application monitoring method disclosed in the present invention, detailed data during the execution of the PHP application is captured through the PHP extension program, rather than adding embedding code in the PHP application to capture simple data. It is possible to automatically capture the full amount of information of the PHP application without modifying the PHP application code.
[0113] Figure 6 6 is a block diagram of an application monitoring system according to another exemplary embodiment. The application monitoring system 60 includes: a proxy server 602 , an extension server 604 , a data server 606 , and a monitoring server 608 .
[0114] The proxy server 602 is configured to obtain the access instruction of the application program; and forward the access instruction to the extension program server.
[0115] The extension program server 604 is configured to capture the execution data of the application program according to a predetermined rule through the extension program, and send the execution data to the data server.
[0116] The data server 606 is configured to merge the execution data to generate monitoring data; and send the monitoring data to a monitoring server.
[0117] The monitoring server 608 is configured to receive and display the monitoring data.
[0118] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.
[0119] Refer to the following Figure 7 The electronic device 200 according to this embodiment of the present disclosure is described. Figure 7The electronic device 200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0120] like Figure 7 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0121] The storage unit stores a program code, which can be executed by the processing unit 210, so that the processing unit 210 executes the steps according to various exemplary embodiments of the present disclosure described in the electronic prescription circulation processing method section of this specification. For example, the processing unit 210 can execute the following steps: Figure 2 Follow the steps shown in .
[0122] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0123] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0124] Bus 230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0125] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0126] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0127] Figure 8 A schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure is schematically shown.
[0128] refer to Figure 8 As shown, a program product 400 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0129] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0130] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0131] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0132] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium realizes the following functions: real-time monitoring of multiple functions in the application through an extension program; obtaining the execution parameters of the multiple functions through the extension program according to predetermined rules to generate multiple sub-monitoring data; merging the multiple sub-monitoring data to generate monitoring data; and sending the monitoring data to a monitoring server through a scheduled task.
[0133] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0134] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0135] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. An application monitoring method, characterized in that: An extension program is arranged in the kernel of the application program; wherein the method comprises: The proxy server obtains the access instruction of the application program, and forwards the access instruction to the extension program, triggering the extension program to capture the execution data of the application program according to the predetermined rules; The extension program monitors multiple execution data functions of the application program in real time; When the extension program receives the access instruction, determining that the predetermined rule includes a function name of the specified execution data or a threshold value of the execution data; If the predetermined rule includes a function name of the specified execution data, the extension program matches the function name of the specified execution data in the predetermined rule with the functions of the execution data of all monitored application programs to determine the function name to be monitored; If the reservation rule includes a threshold value of each execution data, the extension program performs statistics based on the execution data of all functions of the monitored application program, obtains the execution data of the function to be monitored that reaches the corresponding execution data threshold value, and the function name of the execution data that reaches the corresponding execution data threshold value is the determined function name to be monitored; After determining the name of the function to be monitored, the extension program captures execution data corresponding to the name of the function to be monitored in the application program; sending the execution data to the merging program through the extending program; Merging the execution data by the merging program to generate monitoring data; and The monitoring data is sent to a monitoring server through the merging procedure.
2. The method according to claim 1, characterized in that The extension program collects statistics based on the execution data of all functions of the monitored application program, and obtains the execution data of the functions to be monitored that reaches the corresponding execution data threshold, including: The extension program obtains the execution data corresponding to the function name by replacing the function pointer.
3. The method according to claim 1, characterized in that The execution data is merged by the merging program to generate monitoring data, including: The first subprocess of the merging program monitors the two-way communication connection to obtain the execution data, and performs data merging on the execution data to generate monitoring data.
4. The method according to claim 3, characterized in that Sending the monitoring data to a monitoring server through the merging procedure includes: The monitoring data is sent to the monitoring server through the second subprocess of the merging program.
5. The method according to claim 4, characterized in that The method further comprises: The configuration information of the merging program is updated regularly through the third subprocess of the merging program.
6. An application monitoring device, characterized in that: An extension program is arranged in the kernel of the application program; wherein the device comprises: A capture module is configured to obtain an access instruction of an application through a proxy server, and forward the access instruction to the extension program, triggering the extension program to capture the execution data of the application according to a predetermined rule; monitor multiple execution data functions of the application in real time through the extension program; when the extension program receives the access instruction, it is determined that the predetermined rule includes a specified function name of the execution data or a threshold of the execution data; if the predetermined rule includes a specified function name of the execution data, the extension program matches the function name of the specified execution data in the predetermined rule with the functions of the execution data of all monitored applications to determine the function name to be monitored; if the predetermined rule includes a threshold of each execution data, the extension program performs statistics based on the execution data of all functions of the monitored application, and obtains the execution data of the function to be monitored that reaches the corresponding execution data threshold, and the function name of the execution data that reaches the corresponding execution data threshold is the determined function name to be monitored; after determining the function name to be monitored, the extension program captures the execution data corresponding to the function name to be monitored in the application; A first sending module, configured to send the execution data to the merging program through the extension program; A generating module, configured to merge the execution data through the merging program to generate monitoring data; The second sending module is configured to send the monitoring data to the monitoring server through the merging program.
7. An application monitoring system, characterized in that: An extension program is arranged in the kernel of the application program; wherein the application program monitoring method comprises: A proxy server is configured to obtain an access instruction of an application; and forward the access instruction to an extension program server, triggering the extension program to capture the execution data of the application according to a predetermined rule; the extension program server is configured to monitor multiple execution data functions of the application in real time through the extension program; when the extension program receives the access instruction, it is determined that the predetermined rule includes a specified function name of the execution data or a threshold of the execution data; if the predetermined rule includes a specified function name of the execution data, the extension program matches the function name of the specified execution data in the predetermined rule with the functions of the execution data of all monitored applications to determine the function name to be monitored; if the predetermined rule includes a threshold of each execution data, the extension program performs statistics based on the execution data of all functions of the monitored application to obtain the execution data of the function to be monitored that reaches the corresponding execution data threshold, and the function name of the execution data that reaches the corresponding execution data threshold is the determined function name to be monitored; after determining the function name to be monitored, the extension program captures the execution data corresponding to the function name to be monitored in the application; A data server configured to merge the execution data to generate monitoring data; and send the monitoring data to a monitoring server; The monitoring server is configured to receive and display the monitoring data.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
