CN111427738B - Display method, application monitoring module, byte code enhancement module and display system - Google Patents
Display method, application monitoring module, byte code enhancement module and display system Download PDFInfo
- Publication number
- CN111427738B CN111427738B CN201910020466.0A CN201910020466A CN111427738B CN 111427738 B CN111427738 B CN 111427738B CN 201910020466 A CN201910020466 A CN 201910020466A CN 111427738 B CN111427738 B CN 111427738B
- Authority
- CN
- China
- Prior art keywords
- code
- application program
- abnormal
- abnormality
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 141
- 238000012544 monitoring process Methods 0.000 title claims abstract description 54
- 230000002159 abnormal effect Effects 0.000 claims abstract description 108
- 230000005856 abnormality Effects 0.000 claims abstract description 87
- 230000008569 process Effects 0.000 claims abstract description 25
- 238000006243 chemical reaction Methods 0.000 claims abstract description 4
- 238000001514 detection method Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 abstract description 12
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 8
- 230000004048 modification Effects 0.000 description 7
- 238000012986 modification Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000003491 array Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/327—Alarm or error message display
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a display method of an abnormal code, an application monitoring module, a byte code enhancement module and a display system of the abnormal code, wherein the display method comprises the following steps: the byte code enhancement module controls the application program to load the byte code of the application program, controls the application program to run the appointed conversion byte code, so that the application program carries out decompilation processing on the loaded byte code to obtain a source code of the application program, and controls the application program to upload the source code to a server for storage; the method comprises the steps that an application monitoring module obtains abnormal information reflecting the occurrence of abnormality in the execution process of an application program; acquiring codes with abnormality from source codes pre-stored in a server according to the abnormality information, and taking the codes as abnormal codes; the exception code is shown.
Description
Technical Field
The invention relates to the technical field of application performance management, in particular to an abnormal code display method, an application monitoring module, a byte code enhancement module and an abnormal code display system.
Background
In the field of information science and system control, application Monitoring modules (Application Performance Management & Monitoring, APM) are dedicated to Monitoring and managing application software performance and availability. By monitoring and diagnosing performance problems of complex applications, good operation of the software application is ensured.
The application monitoring module may be used to monitor information, CPU, query Per Second (QPS), log, etc. during the running of the application. When the application program fails, the application monitoring module can obtain the abnormal information of the application program. For example, the Application monitoring module may be an ARMS (Application Real-Time Monitoring Service).
However, in the prior art, the application monitoring module cannot show the code of the execution abnormality of the application program according to the obtained abnormality information. And the user cannot quickly locate the source code with the abnormality according to the abnormality information so as to process the abnormality.
Disclosure of Invention
It is an object of the present invention to provide a new solution for exposing exception codes.
According to a first aspect of the present invention, there is provided a method for displaying an exception code, the method being implemented by an application monitoring module, the method comprising:
obtaining abnormal information reflecting the occurrence of abnormality in the execution process of the application program;
acquiring codes with abnormality from source codes pre-stored in the server according to the abnormality information, and taking the codes as abnormal codes;
the exception code is shown.
Optionally, the step of obtaining the abnormality information reflecting the occurrence of the abnormality in the execution process of the application program includes:
and acquiring the intercepted information under the condition of intercepting the abnormal section of the specified method of the application program as the abnormal information.
Optionally, the step of obtaining the abnormality information reflecting the occurrence of the abnormality in the execution process of the application program includes:
acquiring an abnormal log stack generated under the condition that an application program is abnormal in the execution process;
and acquiring information contained in the exception log stack as the exception information.
Optionally, the method further comprises:
detecting whether a triggering event for acquiring abnormal information occurs or not;
and executing the step of acquiring the abnormal information reflecting the occurrence of the abnormality in the execution process of the application program according to the detection result of the trigger event.
Optionally, the triggering event includes any one or more of the following:
reaching a preset information acquisition period;
intercepting the abnormal information under the condition of intercepting an abnormal section of a specified method of the application program;
an exception log stack is generated.
Optionally, the exception information includes a method name, a class name, and a code line number;
the step of obtaining the code with the abnormality from the source code pre-stored in the server according to the abnormality information, wherein the step of obtaining the code with the abnormality as the abnormality code comprises the following steps:
determining the class with abnormality contained in the source code according to the class name as an abnormal class;
determining a method for generating an abnormality contained in the abnormality class according to the method name as an abnormality method;
determining a code with an abnormality included in the abnormality method according to the code line number as the abnormality code;
and acquiring the abnormal code.
According to a second aspect of the present invention, there is provided a presentation method of exception code, the presentation method being implemented by a bytecode enhancement module, the presentation method comprising:
controlling the application program to load the byte code of the application program;
controlling the application program to run the appointed conversion byte codes so that the application program can decompil the loaded byte codes to obtain the source codes of the application program;
and controlling the application program to upload the source code to a server for storage.
Optionally, the display method further includes:
detecting whether a starting event of the application program occurs;
and executing the step of controlling the application program to load the byte code of the application program according to the detection result of the starting event.
According to a third aspect of the present invention, there is provided an application monitoring module comprising a first processor and a first memory, the first memory being configured to store first executable instructions for controlling the first processor to perform the presentation method according to the first aspect of the present invention.
According to a fourth aspect of the present invention, there is provided a byte code enhancement module comprising a second processor and a second memory, the second memory being for storing executable second instructions for controlling the second processor to perform the presentation method according to the second aspect of the present invention.
According to a fifth aspect of the present invention, there is provided an exception code display system, including a server, an application monitoring module according to the third aspect of the present invention, and a bytecode enhancement module according to the fourth aspect of the present invention, where the server is configured to store source code.
In the embodiment of the invention, the byte code enhancement module controls the application program to upload the source code of the application program to the server for storage when each time is started, and the application monitoring module obtains the abnormal code according to the abnormal information for display. In this way, no modification of the code of the application may be required. Furthermore, the source code uploaded to the server may be guaranteed to be the version executed by the application. In addition, the source code is uploaded to the server for storage, so that the performance of the electronic equipment provided with the byte code enhancement module is less affected. When the application program runs abnormally, the abnormal codes can be uniquely, quickly and accurately positioned and displayed for the user to process, so that the time for the user to solve the abnormality can be saved, and the user experience can be improved.
Other features of the present invention and its advantages will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a block diagram showing an example of a hardware configuration of an electronic device that can be used to implement an embodiment of the present invention.
Fig. 2 shows a flowchart of a presentation method of an exception code of a first embodiment of the present invention.
Fig. 3 shows a flowchart of the steps of acquiring an exception code according to the first embodiment of the present invention.
Fig. 4 shows a block diagram of an application monitoring module of a first embodiment of the invention.
Fig. 5 shows a flowchart of a presentation method of an exception code according to a second embodiment of the present invention.
Fig. 6 shows a block diagram of a byte code enhancement module of a second embodiment of the present invention.
FIG. 7 shows a block diagram of a presentation system of exception code of a third embodiment of the present invention.
Fig. 8 is a flowchart of an abnormal code showing method implemented by the abnormal code showing system according to the third embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
< hardware configuration >
Fig. 1 is a block diagram showing a hardware configuration of an electronic device 1000 in which an embodiment of the present invention can be implemented.
The electronic device 1000 may be a laptop, desktop, cell phone, tablet, etc. As shown in fig. 1, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, ROM (read only memory), RAM (random access memory), nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 can be capable of wired or wireless communication, and specifically can include Wifi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display, a touch display, or the like. The input device 1600 may include, for example, a touch screen, keyboard, somatosensory input, and the like. A user may input/output voice information through the speaker 1700 and microphone 1800.
The electronic device shown in fig. 1 is merely illustrative and is in no way meant to limit the invention, its application or uses. In an embodiment of the present invention, the memory 1200 of the electronic device 1000 is configured to store instructions for controlling the processor 1100 to operate to execute any one of the method for presenting an exception code provided by the embodiment of the present invention. It will be appreciated by those skilled in the art that although a plurality of devices are shown for the electronic apparatus 1000 in fig. 1, the present invention may relate to only some of the devices thereof, for example, the electronic apparatus 1000 relates to only the processor 1100 and the storage device 1200. The skilled person can design instructions according to the disclosed solution. How the instructions control the processor to operate is well known in the art and will not be described in detail here.
The general conception of the embodiment of the invention is to provide a new technical scheme for displaying the abnormal codes, the byte code enhancement module controls the application program to upload the source codes of the application program to a server for storage when each time is started, and the application monitoring module obtains the abnormal codes for displaying according to the abnormal information. In this way, no modification of the code of the application may be required. Furthermore, the source code uploaded to the server may be guaranteed to be the version executed by the application. In addition, the source code is uploaded to the server for storage, so that the performance of the electronic equipment provided with the byte code enhancement module is less affected. When the application program runs abnormally, the abnormal codes can be uniquely, quickly and accurately positioned and displayed for the user to process, so that the time for the user to solve the abnormality can be saved, and the user experience can be improved.
< first embodiment >
< method >
In this embodiment, a method for displaying an exception code is provided. The presentation method may be implemented by an application performance management module provided in the electronic device.
In this embodiment, the method for displaying the exception code may include steps S2100 to S2300 as shown in fig. 2.
In step S2100, abnormality information reflecting the occurrence of an abnormality in the execution process of the application program is acquired.
The abnormality information can be obtained when an abnormality occurs in the application program, and can reflect specific abnormality occurring in the execution process of the application program.
In one example, the step of obtaining the anomaly information may further be: information intercepted in the case of intercepting an abnormal section of a specified method of the application is acquired as abnormal information.
The electronic device may intercept the abnormal section of the specified method in real time or according to a preset interception frequency. The specified method may be, for example, a common method of an application program, which is executed simultaneously when each method of the application program is executed.
By intercepting the abnormal section of the specified method, the information corresponding to the code with the abnormality, namely the abnormality information, can be intercepted.
The exception information in this embodiment may include a class name, a method name, and a line number of codes in which an exception occurs. The number of lines for executing the code with the exception is the number of lines for executing the code with the exception in all the codes of the application program.
Specifically, if an abnormality occurs during execution of a certain line code of the target method, the acquired parameters include a class name of the target method, a method name of the target method, and the line number of the certain line code of the target method.
In another example, the step of acquiring the anomaly information may further be: acquiring an abnormal log stack generated under the condition that an application program is abnormal in the execution process; information contained in the exception log stack is acquired as exception information.
Specifically, the application performance management module of the embodiment may be used to monitor the execution process of each method of the application program. When any method of the application program is abnormal in the execution process, a log reflecting the abnormality of the method in the calling process, namely an abnormality log stack corresponding to the method, can be generated.
For example, the obtained exception log stack may be:
java.lang.NullPointerException:at com.example.a3.core.service.anomaly.ItService.doSql(ItService.java:216)~[a3-core-2.0.0.jar:na]
then, the class name included in the anomaly information may be: com.example.a3.core.service.analog.ItService, method name may be: doSql, the number of code lines may be: 216.
in one example, the presentation method may further include:
whether a trigger event for acquiring the abnormal information occurs or not is detected, and step S2100 is executed according to the detection result of the trigger event.
Specifically, in the case where the occurrence of the trigger event is detected, step S2100 may be performed to acquire the abnormality information. If no trigger event occurrence is detected, detection may continue without performing step S2100 to obtain exception information.
Further, the triggering event may include, for example, any one or more of the following:
reaching a preset information acquisition period;
under the condition of intercepting an abnormal section of a specified method of an application program, intercepting abnormal information;
an exception log stack is generated.
In the case that the triggering event includes reaching a preset information acquisition period, the preset information acquisition period may be preset according to an application scenario. For example, the preset information acquisition period may be one hour. Then, step S2100 may be performed every hour to acquire all the anomaly information intercepted in the hour, or to acquire the anomaly information contained in all the anomaly log stacks generated in the hour. If no exception information is intercepted or an exception log stack is not generated in one information acquisition period, the next information acquisition period may be entered without executing step S2100. Each time the information acquisition period is reached, it may be determined that a trigger event for acquiring abnormal information is detected.
In the case where the trigger event includes interception of the abnormal information, it may be an abnormal section of a specified method of intercepting the application during execution of the application, and step S2100 is performed once each time the abnormal information is intercepted. Therefore, if the abnormal information is intercepted by the abnormal section of the specified method, the occurrence of the triggering event for acquiring the abnormal information is indicated.
In the case where the trigger event includes generation of an exception log stack, it may be an exception log stack that is automatically generated when an exception occurs during execution of the application. Step S2100 is performed once each time an exception stack log is generated. Thus, if an exception log stack is generated, it indicates that a trigger event has occurred to obtain exception information.
Step S2200, obtaining the codes with the abnormal states from the source codes pre-stored in the server according to the abnormal information as abnormal codes.
The exception information may include a method name, a class name, and a code line number corresponding to a code in which an exception occurs when the application is executed. Then, according to the method name, class name and code line number corresponding to the code generating the abnormality when executing the application program, a line code generating the abnormality, namely, an abnormal code, can be uniquely determined from the source codes prestored in the server.
Specifically, the bytecode enhancement module controls the application program to upload the source code of the application program to the server for storage. The bytecode enhancement module may be an electronic device mounted with a tool (e.g., a Javaagent) for implementing the bytecode enhancement function. Java agent is a mechanism provided by Java that can intercept modification of bytecodes before loading class files.
Further, the bytecode enhancement module and the application monitoring module may be provided on the same electronic device.
In one embodiment, step S2200 may further comprise, for example, steps S2210-S2240 as shown in FIG. 3:
step S2210 uses the class in which the abnormality occurs, which is included in the class name source code included in the abnormality information, as an abnormal class.
In the server, since the source code is stored in the unit of class name, the corresponding class may be searched from the source code by the class name included in the abnormality information, and the corresponding class may be used as the abnormality class.
Step S2220 specifies, as an abnormality method, a method of occurrence of an abnormality included in the abnormality class based on the method name included in the abnormality information.
The codes of each class may be stored in units of method names, and thus, a method in which an abnormality occurs may be determined from among abnormality classes by the method names contained in the abnormality information as an abnormality method.
In step S2230, the code in which the abnormality occurs included in the abnormality method is determined as the abnormality code based on the number of code lines.
The code of each method may have stored in advance the number of start and stop lines of the code of the corresponding method in all the codes. For example, the number of start and stop lines of the code of the exception method may be 6-12 lines, indicating that the code of lines 6-12 is the code of the exception method among all the codes of the application program.
The number of lines of codes included in the abnormality information makes it possible to determine the code in which an abnormality occurs in the abnormality method. For example, when the code of the 6 th to 12 th lines is the code of the exception method and the number of lines of the code included in the exception information is 8, the code having an exception in the execution of one line, that is, the exception code, can be uniquely determined.
In step S2240, an exception code is acquired.
Only the exception code may be obtained from the server into the application monitoring module. The codes between the preset line numbers before and after the abnormal codes can be obtained into the application monitoring module. For example, the first 5 lines of the abnormal code to the last 10 lines of the abnormal code may be all acquired into the application monitoring module. All codes (including the abnormal codes) contained in the abnormal method can be acquired into the application monitoring module.
Step S2300, the exception code is presented.
In the case where only the abnormal code is acquired in step S2240, only the abnormal code may be displayed. In the case where the code between the set number of lines before and after the abnormal code is acquired in step S2240, other codes may be displayed while the abnormal code is displayed. In the case where all the codes included in the abnormal method are acquired in step S2240, other codes in the abnormal method may be displayed while the abnormal code is displayed. When other codes are displayed on the display interface, the codes may be displayed in the number of lines per line. Specifically, the code with the smaller number of code lines may be displayed above the code with the larger number of code lines.
Further, it may be to highlight an abnormal code to distinguish from other codes. For example, it may be to modify the color of the anomaly code, modify the font size of the anomaly code, annotate (e.g., may annotate an arrow, etc.) before the anomaly code, and/or display the anomaly code on the top line of the display interface.
Therefore, when the application program runs abnormally, the abnormal code can be uniquely, quickly and accurately positioned according to the obtained abnormal information for display, so that the abnormal code can be processed by a user, the abnormal solving time of the user can be saved, and the user experience can be improved.
< application monitoring Module >
In this example, there is also provided an application monitoring module 400, as shown in fig. 4, including: a first processor 410 and a first memory 420. The first memory 420 is used for storing a first instruction; the first instruction is configured to control the first processor 410 to execute the method for displaying the exception code according to any one of the embodiments.
In this embodiment, the application monitoring module 400 may also include other devices or modules, such as the electronic device 1000 shown in fig. 1.
Those skilled in the art will appreciate that the application monitoring module 400 may be implemented in a variety of ways. For example, the application monitoring module 400 may be implemented by an instruction configuration processor. For example, instructions may be stored in ROM and read from the ROM into a programmable device to implement the application monitoring module 400 when the device is booted. For example, the application monitoring module 400 may be solidified into a dedicated device (e.g., ASIC). The application monitoring module 400 may be divided into separate units or they may be implemented in combination. The application monitoring module 400 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
In this embodiment, the application monitoring module 400 may have various implementation forms, for example, the application monitoring module 400 may be any software product or functional module running in an application program that provides an application monitoring service, or a peripheral embedded part, a plug-in part, a patch part, or the like of the software product or the application program, or may be the software product or the application program itself.
The present embodiment has been described above with reference to the accompanying drawings, and according to this embodiment, a method for displaying an abnormal code and an application monitoring module are provided, where abnormal information reflecting an occurrence of an abnormality in an execution process of an application program is obtained, and according to the abnormal information, an abnormal code in which the abnormality occurs is obtained from source codes pre-stored in a server, and is displayed. Therefore, when the application program runs abnormally, the abnormal code can be uniquely, quickly and accurately positioned and displayed for the user to process, the time for the user to solve the abnormality can be saved, and the user experience can be improved.
< second embodiment >
< method >
In this embodiment, a method for displaying an exception code is provided. The presentation method may be implemented by a bytecode enhancement module provided in the electronic device.
In this embodiment, the method for displaying the exception code may include steps S5100 to S5300 as shown in fig. 5.
In step S5100, the control application program loads its own bytecode.
The application program of the embodiment is specifically an application program monitored by the application monitoring module.
In one example, the presentation method may further include:
detecting whether a starting event of an application program occurs; according to the detection result of the start event, this step S5100 is executed.
Specifically, the application program may be controlled to load the bytecode of the application program under the condition that the starting of the application program is detected.
Bytecode is a binary file consisting of a sequence of OP code/data pairs, which contains an executable program, is an intermediate code. Bytecodes are typically not readable by humans like source code, but are sequences of encoded numerical constants, references, instructions, etc. Bytecode is primarily for the purpose of implementing specific software operations and software environments, independent of hardware environments.
Specifically, since the electronic device can recognize the bytecode and cannot recognize the source code, it is necessary to compile the source code of the application program in advance to obtain the bytecode. In the event that an application launch is detected, the control application loads the bytecode.
In step S5200, the application program is controlled to run the specified converted byte code, so that the application program performs decompilation processing on the loaded byte code to obtain the source code of the application program.
The conversion bytecode specified in the present embodiment may be a transform enhanced bytecode. When the application program loads the converted byte code, the application program can perform decompilation processing on the loaded byte code to obtain source code.
In step S5300, the control application program uploads the source code to the server for storage.
In this embodiment, by using the method for displaying the abnormal code executed by the bytecode enhancement module, the application program can be controlled to upload its own source code to the server for storage when each time is started, and the application monitoring module obtains the abnormal code according to the abnormal information for displaying. In this way, no modification of the code of the application may be required. Furthermore, the source code uploaded to the server may be guaranteed to be the version executed by the application. In addition, the source code is uploaded to the server for storage, so that the performance of the electronic equipment provided with the byte code enhancement module is less affected.
< byte code enhancement Module >
In this example, there is also provided a byte code enhancement module 600, as shown in fig. 6, including: a second processor 610 and a second memory 620. The second memory 620 is used for storing second instructions; the second instruction is configured to control the second processor 610 to execute the method for presenting the exception code according to any one of the embodiments.
In this embodiment, the byte code enhancement module 600 may also include other devices or modules, such as the electronic device 1000 shown in fig. 1.
It will be appreciated by those skilled in the art that the bytecode enhancement module 600 may be implemented in a variety of ways. For example, the bytecode enhancement module 600 may be implemented by an instruction configuration processor. For example, instructions may be stored in ROM and read from the ROM into a programmable device to implement the byte code enhancement module 600 when the device is booted. For example, the bytecode enhancement module 600 may be solidified into a dedicated device (e.g., ASIC). The bytecode enhancement module 600 may be divided into separate units or they may be combined together for implementation. The bytecode enhancement module 600 may be implemented by one of the above-described various implementations, or may be implemented by a combination of two or more of the above-described various implementations.
In this embodiment, the bytecode enhancement module 600 may have various implementation forms, for example, the bytecode enhancement module 600 may be any software product or functional module running in an application program that provides an application monitoring service, or a peripheral insert, a plug-in, a patch, etc. of the software product or the application program, and may also be the software product or the application program itself.
The present embodiment has been described above with reference to the accompanying drawings, and according to this embodiment, a method for displaying an abnormal code and a bytecode enhancement module are provided, where an application program is controlled to load its own bytecode, and the application program is controlled to run a specified converted bytecode, so that the application program performs decompilation processing on the loaded bytecode, and uploads the obtained source code to a server for storage, and an application monitoring module obtains the abnormal code according to abnormal information for displaying. In this way, no modification of the code of the application may be required. Furthermore, the source code uploaded to the server may be guaranteed to be the version executed by the application. In addition, the source code is uploaded to the server for storage, so that the performance of the electronic equipment provided with the byte code enhancement module is less affected.
< third embodiment >
< System >
In this embodiment, there is also provided a system 700 for displaying an exception code, as shown in fig. 7, including:
the application monitoring module 400 provided in the first embodiment of the present invention;
the byte code enhancement module 600 provided in the second embodiment of the present invention; the method comprises the steps of,
server 710 stores source code for the application.
In one example, the application monitoring module 400 and the bytecode enhancement module 600 in the abnormal code presentation system 700 may be disposed on the same electronic device, which may be, for example, the electronic device 1000 shown in fig. 1.
The method of presenting an abnormal code implemented by the system 700 for presenting an abnormal code in the present embodiment will be further described below by way of example with reference to fig. 8.
The method for displaying the abnormal code, as shown in fig. 8, includes: steps S810 to S860.
In step S810, the application program is controlled by the bytecode enhancement module 600 to load its own bytecode.
Step S820, the bytecode enhancement module 600 controls the application program to run the specified converted bytecode so that the application program decompiles the loaded bytecode to obtain the source code of the application program
In step S830, the bytecode enhancement module 600 controls the application program to upload the source code to the server for storage.
In step S840, the source code is stored by the server 710.
In step S850, the application monitoring module 400 acquires abnormality information reflecting the occurrence of an abnormality in the execution process of the application program.
In step S860, the application monitoring module 400 obtains the code with the abnormality from the source code pre-stored in the server as the abnormality code according to the abnormality information.
In step S870, the abnormal code is presented by the application monitoring module 400.
The steps of the method for displaying the abnormal code executed by the application monitoring module 400 have been described in detail in the first embodiment, and the steps of the method for displaying the abnormal code executed by the bytecode enhancement module 600 have been described in detail in the second embodiment, and are not described in detail herein.
In this example, the bytecode enhancement module controls the application program to upload the source code of the application program to the server for storage when each time is started, and the application monitoring module obtains the abnormal code according to the abnormal information for display. In this way, no modification of the code of the application may be required. Furthermore, the source code uploaded to the server may be guaranteed to be the version executed by the application. In addition, the source code is uploaded to the server for storage, so that the performance of the electronic equipment provided with the byte code enhancement module is less affected. When the application program runs abnormally, the abnormal codes can be uniquely, quickly and accurately positioned and displayed for the user to process, so that the time for the user to solve the abnormality can be saved, and the user experience can be improved.
The present invention may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.
Claims (10)
1. A method for exposing an exception code, wherein the method is implemented by an application monitoring module, the method comprising:
obtaining abnormal information reflecting the occurrence of abnormality in the execution process of the application program; the abnormal information comprises a method name, a class name and a code line number;
acquiring codes with abnormality from source codes pre-stored in the server according to the abnormality information, and taking the codes as abnormal codes;
the source code is executed by the byte code enhancement module when the application program is controlled to be started each time;
displaying the abnormal code;
the step of obtaining the abnormality information reflecting the occurrence of the abnormality in the execution process of the application program comprises the following steps:
and acquiring the intercepted information under the condition of intercepting the abnormal section of the specified method of the application program as the abnormal information.
2. The presentation method of claim 1, wherein the step of acquiring exception information reflecting the occurrence of an exception in the execution of the application program comprises:
acquiring an abnormal log stack generated under the condition that an application program is abnormal in the execution process;
and acquiring information contained in the exception log stack as the exception information.
3. The display method of claim 1, wherein the method further comprises:
detecting whether a triggering event for acquiring abnormal information occurs or not;
and executing the step of acquiring the abnormal information reflecting the occurrence of the abnormality in the execution process of the application program according to the detection result of the trigger event.
4. A display method according to claim 3, wherein the triggering event comprises any one or more of:
reaching a preset information acquisition period;
intercepting the abnormal information under the condition of intercepting an abnormal section of a specified method of the application program;
an exception log stack is generated.
5. The display method according to any one of claims 1 to 4, wherein,
the step of obtaining the code with the abnormality from the source code pre-stored in the server according to the abnormality information, wherein the step of obtaining the code with the abnormality as the abnormality code comprises the following steps:
determining the class with abnormality contained in the source code according to the class name as an abnormal class;
determining a method for generating an abnormality contained in the abnormality class according to the method name as an abnormality method;
determining a code with an abnormality included in the abnormality method according to the code line number as the abnormality code;
and acquiring the abnormal code.
6. A presentation method of exception code, wherein the presentation method is implemented by a byte code enhancement module, the presentation method comprising:
controlling the application program to load the byte code of the application program;
controlling the application program to run the appointed conversion byte codes so that the application program can decompil the loaded byte codes to obtain the source codes of the application program;
the application program is controlled to upload the source code to a server for storage; the method comprises the steps that according to abnormal information reflecting the occurrence of an abnormality in the execution process of an application program, an abnormal code is obtained from source codes in a server by an application monitoring module and is displayed as an abnormal code, the abnormal information is intercepted by the application monitoring module under the condition of intercepting an abnormal section of a specified method of the application program, and the abnormal information comprises a method name, a class name and a code line number.
7. The display method of claim 6, wherein the display method further comprises:
detecting whether a starting event of the application program occurs;
and executing the step of controlling the application program to load the byte code of the application program according to the detection result of the starting event.
8. An application monitoring module comprising a first processor and a first memory, the first memory for storing executable first instructions for controlling the first processor to perform the presentation method according to any one of claims 1-5.
9. A byte code enhancement module comprising a second processor and a second memory, the second memory for storing executable second instructions for controlling the second processor to perform the presentation method of claim 6 or 7.
10. A presentation system of exception codes, comprising a server for storing source codes, an application monitoring module according to claim 8, and a bytecode enhancement module according to claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910020466.0A CN111427738B (en) | 2019-01-09 | 2019-01-09 | Display method, application monitoring module, byte code enhancement module and display system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910020466.0A CN111427738B (en) | 2019-01-09 | 2019-01-09 | Display method, application monitoring module, byte code enhancement module and display system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111427738A CN111427738A (en) | 2020-07-17 |
CN111427738B true CN111427738B (en) | 2024-04-05 |
Family
ID=71546018
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910020466.0A Active CN111427738B (en) | 2019-01-09 | 2019-01-09 | Display method, application monitoring module, byte code enhancement module and display system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111427738B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112162908B (en) * | 2020-09-30 | 2024-03-26 | 中国工商银行股份有限公司 | Method and device for realizing program call link monitoring based on byte code injection technology |
CN114706733B (en) * | 2022-05-30 | 2022-09-20 | 支付宝(杭州)信息技术有限公司 | Section program abnormity monitoring method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105808266A (en) * | 2016-03-29 | 2016-07-27 | 广州华多网络科技有限公司 | Code operation method and device |
CN107463492A (en) * | 2017-06-29 | 2017-12-12 | 北京五八信息技术有限公司 | Application failure localization method and device |
CN107918565A (en) * | 2017-11-17 | 2018-04-17 | 广东小天才科技有限公司 | Reporting method of abnormal information of application program and mobile terminal |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7702959B2 (en) * | 2005-08-02 | 2010-04-20 | Nhn Corporation | Error management system and method of using the same |
US20090013208A1 (en) * | 2008-03-31 | 2009-01-08 | Dimuzio Thomas M | Real time automated exception notification and reporting solution |
JP5496792B2 (en) * | 2010-06-29 | 2014-05-21 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Code conversion program, method and system |
US20150378864A1 (en) * | 2014-06-25 | 2015-12-31 | SmartBear Software, Inc. | Systems and methods for instrumenting applications for performance monitoring |
-
2019
- 2019-01-09 CN CN201910020466.0A patent/CN111427738B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105808266A (en) * | 2016-03-29 | 2016-07-27 | 广州华多网络科技有限公司 | Code operation method and device |
CN107463492A (en) * | 2017-06-29 | 2017-12-12 | 北京五八信息技术有限公司 | Application failure localization method and device |
CN107918565A (en) * | 2017-11-17 | 2018-04-17 | 广东小天才科技有限公司 | Reporting method of abnormal information of application program and mobile terminal |
Also Published As
Publication number | Publication date |
---|---|
CN111427738A (en) | 2020-07-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9990209B2 (en) | Digital assistance device for facilitating multi-stage setup | |
US10713107B2 (en) | Detecting a possible underlying problem among computing devices | |
US20130283100A1 (en) | Testing device | |
CN107329659B (en) | Permission setting method and device, electronic equipment and storage medium | |
JP2011192296A (en) | Help utility application program | |
US8984487B2 (en) | Resource tracker | |
CN111427738B (en) | Display method, application monitoring module, byte code enhancement module and display system | |
US10705858B2 (en) | Automatic import of third party analytics | |
CN111913707B (en) | Multiplexing method and device for running process | |
CN104156305A (en) | Application program testing method and device | |
TWI656453B (en) | Detection system and detection method | |
CN108628733B (en) | Method and device for testing batch service processing operation | |
CN105094562A (en) | Information processing method and terminal | |
CN112445588A (en) | Application task processing method, device and equipment and readable storage medium | |
US10606580B2 (en) | Cognitive identification of related code changes | |
CN111427737B (en) | Method and device for modifying exception log and electronic equipment | |
CN111435328B (en) | Application testing method and device, electronic equipment and readable storage medium | |
JP6018344B2 (en) | Dynamic reading code analysis apparatus, dynamic reading code analysis method, and dynamic reading code analysis program | |
CN111597093B (en) | Exception handling method, device and equipment thereof | |
CN106055367B (en) | Script file loading method and device | |
CN110865818A (en) | Application associated domain name detection method and device and electronic equipment | |
CN105653143B (en) | Processing method of application program operation interface and mobile terminal for realizing method | |
KR101369254B1 (en) | Apparatus and method for detecting malicious application | |
US9069562B2 (en) | Mobile computing program slicing and behavior | |
CN113326169A (en) | Data monitoring method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |