CN111966577B - Program stability detection method and device - Google Patents
Program stability detection method and device Download PDFInfo
- Publication number
- CN111966577B CN111966577B CN202010642987.2A CN202010642987A CN111966577B CN 111966577 B CN111966577 B CN 111966577B CN 202010642987 A CN202010642987 A CN 202010642987A CN 111966577 B CN111966577 B CN 111966577B
- Authority
- CN
- China
- Prior art keywords
- preset
- program
- thread
- program code
- calling
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/3644—Software debugging by instrumenting at runtime
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention provides a program stability detection method and device, wherein the method comprises the following steps: when a program code of a preset method is called by running a preset program object, a preset message forwarding method is called to add a thread detection method; detecting the type of a thread running a program code of the preset program object calling a preset method through the thread detection method; judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread; if the preset program object calls the program code of the preset method to have the preset problem, executing the feedback operation aiming at the preset problem, thereby reminding a developer to process. The embodiment of the invention utilizes a runtime mechanism to implant a thread detection method, so that the detection task is simultaneously and efficiently completed with extremely low invasiveness to the original application program.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a program stability detection method and a program stability detection device.
Background
With the popularization of mobile internet, mobile application plays an increasing role in life, mobile application providers continuously expand services, provide richer functions, and pay more attention to the performance of application apps to ensure user experience.
There are many metrics that measure App performance, such as App startup time, rendering frame rate, memory consumption, power consumption, app crash rate, etc. The detection of detailed data of each item from an operating App is the first step to improve the performance of mobile applications, and many performance detection tools exist nowadays, but these detection tasks are characterized by heavy weight, serious invasiveness to the App, low flexibility, and the like. The cost consumed by the developer in performance detection and optimization is excessive, the result that the performance is not increased and reduced due to serious intrusion of a third party framework is faced, and meanwhile, most performance testing tools are required to pay, so that the product optimization cost of an enterprise technical team is increased.
Disclosure of Invention
An object of an embodiment of the present invention is to provide a program stability detection method, so as to implement detection of an application program with low invasiveness. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a program stability detection method, including:
when a program code of a preset method is called by running a preset program object, a preset message forwarding method is called to add a thread detection method;
detecting the type of a thread running a program code of the preset program object calling a preset method through the thread detection method;
judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread;
if the preset program object calls the program code of the preset method to have the preset problem, executing the feedback operation aiming at the preset problem.
Optionally, the performing a feedback operation for the preset problem includes:
and interrupting the thread running the program codes of the preset program object calling the preset method and/or generating and displaying the reminding information.
Optionally, the performing a feedback operation for the preset problem includes:
acquiring a current thread;
saving a stack corresponding to the current thread, and acquiring an abnormal time stamp and a program module to which a program code of the preset program object calling a preset method belongs;
generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
Optionally, the program code of the preset program object calling the preset method is program code of an interface element calling rendering method, and the judging whether the program code of the preset program object calling the preset method has a preset problem according to the thread type includes:
judging whether the type of the thread running the program code of the interface element calling rendering method is a sub-thread;
if the type of the thread running the program code of the interface element calling rendering method is a sub-thread, determining that the program code of the interface element calling rendering method has a preset problem.
In a first aspect of the present invention, there is provided a program stability detection apparatus comprising:
the method adding module is used for calling a preset message forwarding method to add a thread detection method when a program code of a preset method is called by a running preset program object;
the thread detection module is used for detecting the type of a thread running the program code of the preset program object calling the preset method through the thread detection method;
the problem judging module is used for judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread;
and the feedback module is used for executing feedback operation aiming at the preset problem if the preset problem exists in the program code of the preset method called by the preset program object.
Optionally, the feedback module includes:
and the reminding sub-module is used for interrupting the thread running the program code of the preset program object calling the preset method and/or generating and displaying reminding information.
Optionally, the feedback module includes:
the thread obtaining sub-module is used for obtaining the current thread;
a saving submodule, configured to save a stack corresponding to the current thread, and obtain an abnormal timestamp and a program module to which a program code of the preset program object calling a preset method belongs;
the log data uploading sub-module is used for generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
Optionally, the program code of the preset program object calling the preset method is program code of the interface element calling the rendering method, and the problem judging module includes:
the sub-thread judging sub-module is used for judging whether the type of the thread running the program code of the interface element calling rendering method is a sub-thread or not;
and the problem determination submodule is used for determining that the program code of the interface element calling rendering method has a preset problem if the type of the thread running the program code of the interface element calling rendering method is a child thread.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform any one of the above-described program stability detection methods.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the program stability detection methods described above.
In the embodiment of the invention, a run time mechanism is utilized, and when a program code for calling a preset method is operated, a preset message forwarding method is called to add a thread detection method; detecting the type of a thread running the program code for calling the preset method by a thread detection method, and judging whether the program code for calling the preset method has a preset problem or not according to the type of the thread; if the preset program object calls the program code of the preset method to have the preset problem, executing the feedback operation aiming at the preset problem. The embodiment of the invention utilizes a runtime mechanism to implant a thread detection method, so that the detection task is simultaneously and efficiently completed with extremely low invasiveness to the original application program.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flowchart illustrating a process stability detection method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an object invocation method;
FIG. 3 is a flowchart illustrating a procedure stability detection method according to a second embodiment of the present invention;
FIG. 4 is a block diagram illustrating an embodiment of a program stability detection apparatus according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
For the iOS application program, the interface rendering of the application program is performed on the main thread, which is also an important factor of the iOS application program in use relatively smoothly, and if the developer performs any operation on the interface element in the sub-thread, the interface element may cause the program to be jammed, the performance of the program to be degraded, or even Crash (program flashing and crashing).
The iOS application is an application written in the Objective-C programming language, which is a runtime oriented language that can decide to implement logic at runtime rather than at compile time. The developer can redirect messages to appropriate objects as needed, even exchange method implementations, etc. For example: the [ object foo ] (this is a sentence of code) syntax does not immediately execute the code of this method of foo. It is a message that sends a message called foo to the object at runtime. This message may be processed by the object, may be forwarded to another object, or may ignore the impersonation that the message was not received. Multiple different messages may also be implemented in correspondence with the same method. These are determined at the time of program operation and industry terminology is called run time.
One of the core ideas of the embodiment of the invention is that a runtime method replacement of program codes is realized by utilizing a runtime mechanism, message forwarding operation is carried out on a method needing coverage detection, and detection codes are implanted to detect whether the operation with risk exists in the method.
Referring to fig. 1, a flowchart illustrating steps of a first embodiment of a program stability detection method according to the present invention may specifically include the following steps:
step 101, when program codes of a preset method are called by running a preset program object, a preset message forwarding method adding thread detection method is called.
In iOS systems, a program object may refer to an instance object of a class or subclass thereof.
Referring to fig. 2, a flowchart of a program object calling method is shown. The program object is implemented in the program code to call the preset method by sending a message (selector) indicating the rendering method to the program object.
The messaging mechanism in iOS systems relies on the obj_msgsend (receiver, selector) function to send messages. The obj_msgsend will find the class of the object according to the isa pointer of the instance object, and then find the message in the method Dispatch Table (Dispatch Table) of the class; if the method dispatch table of the class is not found, the method dispatch table of the parent class is searched until the NSObject class is found.
If the message is found in the method dispatch table, jumping to the corresponding function IMP (address of a certain method) to execute the code; if the message is not found in the method dispatch table, runtime will send a resolveInstanceMethod or a resolveClassMethod will attempt to go to the resolve message; if the resolve method returns NO, runtime sends a forward TargetForSelecter, allowing the developer to forward this message to another object; if no new target object is returned, the runtime sends a methodsignatureForSelecter and forward invite message.
The developer may choose to forward the message to the custom program code at any one of the steps of sending resolveInstanceMethod, sending forwardingtargetForSelect, sending methodSignature ForSelect.
In the embodiment of the invention, a developer can test whether the program code of the preset method called by the program object in the application program has abnormal operation or not in the test tool. When the program object in the detected application program invokes the program code of the preset method, the test tool can add the thread detection method through the preset message forwarding method. The preset message forwarding method may be any one of resolveInstanceMethod, forwardingTargetForSelector, methodSignatureForSelector. Test tools are frameworks used by developers to test applications.
The thread detection method may be a program code customized by a developer, and [ NSThread currentThread ] may be used in the thread detection method to determine the type of a thread of the program code of the preset method called by the current running program object.
Step 102, detecting the type of the thread running the program code of the preset program object calling the preset method by the thread detection method.
Step 103, judging whether the program code of the preset program object calling the preset method has a preset problem or not according to the thread type.
The type of thread may be a main thread or a sub-thread. Program code that invokes a preset method, when written, is configured to run in a thread of a preset type. The preset problem may be a problem that the program code does not run according to a thread of a preset type configured in advance during the running process, and if the type of the thread running the program code calling the preset method is not the preset type, the program code may be considered to have the preset problem.
Step 104, if the program code of the preset program object calling the preset method has a preset problem, executing a feedback operation aiming at the preset problem.
In the embodiment of the invention, a run time mechanism is utilized, and when a program code for calling a preset method is operated, a preset message forwarding method is called to add a thread detection method; detecting the type of a thread running the program code for calling the preset method by a thread detection method, and judging whether the program code for calling the preset method has a preset problem or not according to the type of the thread; and if the preset problem exists, executing feedback operation aiming at the preset problem, so as to remind a developer to process. The embodiment of the invention utilizes a runtime mechanism to implant a thread detection method, so that the detection task is simultaneously and efficiently completed with extremely low invasiveness to the original application program.
Referring to fig. 3, a flowchart illustrating steps of a second embodiment of a program stability detection method according to the present invention may specifically include the following steps:
step 301, when the program code of the preset method is called by the running preset program object, the preset message forwarding method adding thread detection method is called.
The method of the embodiment of the invention can be operated on the testing tool, the testing tool is a framework used by a developer for testing the application program, and the developer can control the program code of the application program to be tested to be loaded on the testing tool and set the detection mode of the testing tool during the test. The developer may perform the detection of the program code in different detection modes.
Step 302, detecting, by the thread detection method, a type of a thread running a program code of the preset program object calling a preset method.
In one embodiment, the preset message forwarding method is a resolution instance method resolveInstanceMethod. In the dynamic method resolution stage, a message indicating the rendering method is sent to the self-defined thread detection method by utilizing the resolveInstanceMethod, so that the self-defined thread detection method is added to an application program.
Step 303, determining whether the thread type of the program code running the interface element call rendering method is a sub-thread.
In the embodiment of the present invention, the program code for calling the preset method by the preset program object may be program code for calling the rendering method by the interface element, and in the iOS system, the interface element UI refers to an instance object of the uiiview class and its subclass, and the interface element inherits from the uiiview class.
Specifically, the thread detection method may be a program code customized by a developer, and [ NSThread currentThread ] may be used in the thread detection method to determine whether a thread currently running the program code of the rendering method called by the interface element is a sub-thread.
Step 304, if the thread type of the program code running the interface element call rendering method is a sub-thread, determining that the program code of the interface element call rendering method has a preset problem.
If the thread of the program code for calling the rendering method by the operation interface element is detected to be the main thread, the abnormal operation is not indicated, and the program code for calling the rendering method by the operation interface element is continued in the test work.
In step 305, if the program code of the preset program object calling the preset method has a preset problem, a feedback operation for the preset problem is performed.
In an embodiment of the present invention, the step 305 may include the following sub-steps:
s11, interrupting a thread running a program code of the preset program object calling a preset method and/or generating and displaying reminding information;
the test tool may perform a strong alert operation or a weak alert operation to inform the developer that an irregular operation exists. The strong reminding operation can be to throw out the abnormal program and exit the running application program; the weak alert operation may generate and display alert information. In practice, whether to perform a strong alert operation or a weak alert operation may be selected according to different development scenarios.
In one example, a current detection mode may be determined; the sub-step S11 may be performed when the current detection mode is the first detection mode.
The test mode is a set working mode which is convenient for testing developers in different development stages, and generally, the development of an application program comprises three stages: the corresponding working modes can be a development mode, a test mode and an online mode respectively.
Specifically, the first detection mode may be a development mode. In the development mode, the test tool may perform a strong alert operation or a weak alert operation to inform the developer that an irregular operation exists.
In an embodiment of the present invention, the step 304 may include the following sub-steps:
step S12, obtaining a current thread;
step S13, saving a stack corresponding to the current thread, and acquiring an abnormal time stamp and a program module to which a program code of the preset program object calling a preset method belongs;
in program development, a developer typically divides an application program into a plurality of program modules, each of which implements a different function. Program modules containing the program code of the program objects are typically the ones responsible for UI presentation of the program modules, e.g. the program modules implementing the user information presentation page.
S14, generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
In one example, sub-steps S12-S14 may be performed when the current detection mode is the second detection mode.
The second detection mode may be a test mode. The strong reminding operation in the development mode can enable the running program to directly exit the program when encountering irregular operation, so as to remind a developer immediately, but the program exiting in the test process can cause blockage to the test flow of a tester, seriously influence the working progress, and meanwhile, the possibility of misleading the tester to judge the current problem exists. In the test mode, when the test tool currently detects that the suspected abnormal operation exists, log uploading operation is only performed.
The test tool can save the stack of the application program of the current thread by utilizing the system API, collect the abnormal time stamp and the program module of the interface element, integrate the information of the part, create a log object, convert the log object into a lightweight data format Json format and upload the information to the appointed server for storage.
Compared with other data structures, the Json data structure has the advantages of simple structure, small volume, easiness in compression and decompression, convenience in analysis and the like, and can play an important role in improving the efficiency of log generation and uploading.
By uploading the log, abnormal and nonstandard method calls in each debugging device in the development and test process are collected by the server. The detection range is not limited to a single device any more, and the abnormal stacks of all running debugging devices can be obtained to form a real-time monitoring network, so that problems can be found out in time, and risks can be eliminated. The technical team can collect a part of logs in a fixed time period, analyze the logs to obtain program modules with abnormal operations, and uniformly check and solve the abnormal operations.
In the embodiment of the invention, when a program code of a preset method is called by a preset program object in running by utilizing a run mechanism, a thread detection method is added by calling a preset message forwarding method; detecting the type of a thread running a program code of a preset program object calling a preset method through a thread detection method; if the type of the thread running the program code of the interface element calling rendering method is a sub-thread, determining that the program code of the interface element calling rendering method has a preset problem; and if the preset problem exists, executing feedback operation aiming at the preset problem, so as to remind a developer to process. The embodiment of the invention utilizes a runtime mechanism to implant a thread detection method, so that the detection task is simultaneously and efficiently completed with extremely low invasiveness to the original application program.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 4, a block diagram of an embodiment of a program stability detection apparatus according to the present invention is shown, and may specifically include the following modules:
the method adding module 401 is configured to call a preset message forwarding method to add a thread detection method when a program code of a preset method is called by a preset program object is run;
a thread detection module 402, configured to detect, by using the thread detection method, a type of a thread running a program code that the preset program object invokes the preset method;
a problem judging module 403, configured to judge, according to the thread type, whether a preset problem exists in a program code of the preset program object calling a preset method;
and the feedback module 404 is configured to execute a feedback operation for the preset problem if the program code of the preset program object calling the preset method has the preset problem.
In an embodiment of the present invention, the feedback module includes:
and the reminding sub-module is used for interrupting the thread running the program code of the preset program object calling the preset method and/or generating and displaying reminding information.
In an embodiment of the present invention, the feedback module includes:
the thread obtaining sub-module is used for obtaining the current thread;
a saving submodule, configured to save a stack corresponding to the current thread, and obtain an abnormal timestamp and a program module to which a program code of the preset program object calling a preset method belongs;
the log data uploading sub-module is used for generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
In an embodiment of the present invention, the program code for calling the preset method by the preset program object is program code for calling the rendering method by the interface element, and the problem determining module 402 may include:
the sub-thread judging sub-module is used for judging whether the type of the thread running the program code of the interface element calling rendering method is a sub-thread or not;
and the problem determination submodule is used for determining that the program code of the interface element calling rendering method has a preset problem if the type of the thread running the program code of the interface element calling rendering method is a child thread.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides an electronic device, as shown in fig. 5, which comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to execute the program stored in the memory 503, and implement the following steps:
when a program code of a preset method is called by running a preset program object, a preset message forwarding method is called to add a thread detection method;
detecting the type of a thread running a program code of the preset program object calling a preset method through the thread detection method;
judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread;
if the preset program object calls the program code of the preset method to have the preset problem, executing the feedback operation aiming at the preset problem.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the program stability detection method according to any one of the above embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform the program stability detection method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
1. A program stability detection method, comprising:
when a program code of a preset method is called by running a preset program object, a preset message forwarding method is called to add a thread detection method;
detecting the type of a thread running a program code of the preset program object calling a preset method through the thread detection method;
judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread;
if the program code of the preset program object calling the preset method has a preset problem, executing a feedback operation aiming at the preset problem;
the program code of the preset program object calling the preset method is the program code of the interface element calling the rendering method, and the judging whether the program code of the preset program object calling the preset method has the preset problem according to the thread type comprises the following steps:
judging whether the type of the thread running the program code of the interface element calling rendering method is a sub-thread;
if the type of the thread running the program code of the interface element calling rendering method is a sub-thread, determining that the program code of the interface element calling rendering method has a preset problem.
2. The method of claim 1, wherein the performing a feedback operation for the preset question comprises:
and interrupting the thread running the program codes of the preset program object calling the preset method and/or generating and displaying the reminding information.
3. The method of claim 1, wherein the performing a feedback operation for the preset question comprises:
acquiring a current thread;
saving a stack corresponding to the current thread, and acquiring an abnormal time stamp and a program module to which a program code of the preset program object calling a preset method belongs;
generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
4. A program stability detection device, comprising:
the method adding module is used for calling a preset message forwarding method to add a thread detection method when a program code of a preset method is called by a running preset program object;
the thread detection module is used for detecting the type of a thread running the program code of the preset program object calling the preset method through the thread detection method;
the problem judging module is used for judging whether a program code of the preset program object calling a preset method has a preset problem or not according to the type of the thread;
the feedback module is used for executing feedback operation aiming at the preset problem if the program code of the preset method called by the preset program object has the preset problem;
the program code of the preset program object calling the preset method is the program code of the interface element calling the rendering method, and the problem judging module comprises:
the sub-thread judging sub-module is used for judging whether the type of the thread running the program code of the interface element calling rendering method is a sub-thread or not;
and the problem determination submodule is used for determining that the program code of the interface element calling rendering method has a preset problem if the type of the thread running the program code of the interface element calling rendering method is a child thread.
5. The apparatus of claim 4, wherein the feedback module comprises:
and the reminding sub-module is used for interrupting the thread running the program code of the preset program object calling the preset method and/or generating and displaying reminding information.
6. The apparatus of claim 4, wherein the feedback module comprises:
the thread obtaining sub-module is used for obtaining the current thread;
a saving submodule, configured to save a stack corresponding to the current thread, and obtain an abnormal timestamp and a program module to which a program code of the preset program object calling a preset method belongs;
the log data uploading sub-module is used for generating log data and uploading the log data to a server; the log data comprises a stack corresponding to the current thread, the abnormal time stamp and a program module to which the program code for calling the preset method belongs.
7. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-3 when executing a program stored on a memory.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010642987.2A CN111966577B (en) | 2020-07-06 | 2020-07-06 | Program stability detection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010642987.2A CN111966577B (en) | 2020-07-06 | 2020-07-06 | Program stability detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111966577A CN111966577A (en) | 2020-11-20 |
CN111966577B true CN111966577B (en) | 2023-09-08 |
Family
ID=73361177
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010642987.2A Active CN111966577B (en) | 2020-07-06 | 2020-07-06 | Program stability detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111966577B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108595236A (en) * | 2018-03-27 | 2018-09-28 | 五八有限公司 | A kind of method and device for preventing sub-line journey from carrying out operating user interface |
CN108763057A (en) * | 2018-04-20 | 2018-11-06 | 北京五八信息技术有限公司 | A kind of thread detection method, device, equipment and computer readable storage medium |
CN109491907A (en) * | 2018-11-05 | 2019-03-19 | 网易(杭州)网络有限公司 | A kind of Caton detection method, device, electronic equipment and storage medium |
CN109783161A (en) * | 2018-12-11 | 2019-05-21 | 北京三快在线科技有限公司 | The operation information of application program determines method, apparatus in iOS system |
US10496449B1 (en) * | 2018-06-11 | 2019-12-03 | International Business Machines Corporation | Verification of atomic memory operations |
CN110879781A (en) * | 2019-11-06 | 2020-03-13 | 北京奇艺世纪科技有限公司 | Program debugging method and device, electronic equipment and computer readable storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB0414983D0 (en) * | 2004-07-03 | 2004-08-04 | Ibm | A method for replacing code in a running object oriented program |
US7958402B2 (en) * | 2008-09-22 | 2011-06-07 | International Business Machines Corporation | Generate diagnostic data for overdue thread in a data processing system |
US9195550B2 (en) * | 2011-02-03 | 2015-11-24 | International Business Machines Corporation | Method for guaranteeing program correctness using fine-grained hardware speculative execution |
CN108021496B (en) * | 2016-10-28 | 2020-09-04 | 腾讯科技(深圳)有限公司 | Thread data processing method and device |
-
2020
- 2020-07-06 CN CN202010642987.2A patent/CN111966577B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108595236A (en) * | 2018-03-27 | 2018-09-28 | 五八有限公司 | A kind of method and device for preventing sub-line journey from carrying out operating user interface |
CN108763057A (en) * | 2018-04-20 | 2018-11-06 | 北京五八信息技术有限公司 | A kind of thread detection method, device, equipment and computer readable storage medium |
US10496449B1 (en) * | 2018-06-11 | 2019-12-03 | International Business Machines Corporation | Verification of atomic memory operations |
CN109491907A (en) * | 2018-11-05 | 2019-03-19 | 网易(杭州)网络有限公司 | A kind of Caton detection method, device, electronic equipment and storage medium |
CN109783161A (en) * | 2018-12-11 | 2019-05-21 | 北京三快在线科技有限公司 | The operation information of application program determines method, apparatus in iOS system |
CN110879781A (en) * | 2019-11-06 | 2020-03-13 | 北京奇艺世纪科技有限公司 | Program debugging method and device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111966577A (en) | 2020-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109726072B (en) | WebLogic server monitoring and alarming method, device and system and computer storage medium | |
US8843895B2 (en) | Debugger connection | |
US7937624B2 (en) | Method for handling a detected error in a script-based application | |
CN109633351B (en) | Intelligent IT operation and maintenance fault positioning method, device, equipment and readable storage medium | |
CN107562556B (en) | Failure recovery method, recovery device and storage medium | |
US8694831B2 (en) | Automatic bug reporting tool | |
CN111190755B (en) | Application program function exception handling method and device | |
CN114490268A (en) | Full link monitoring method, device, equipment, storage medium and program product | |
CN110647471A (en) | Interface test case generation method, electronic device and storage medium | |
CN113495820B (en) | Anomaly information collecting and processing method and device and anomaly monitoring system | |
CN111240876A (en) | Fault positioning method and device for microservice, storage medium and terminal | |
CN114844768A (en) | Information analysis method and device and electronic equipment | |
CN111309743A (en) | Report pushing method and device | |
CN112948224A (en) | Data processing method, device, terminal and storage medium | |
CN111966577B (en) | Program stability detection method and device | |
CN112416735B (en) | Application program detection method and device, terminal equipment and storage medium | |
CN115470075B (en) | Application program fault detection method and device, electronic equipment and storage medium | |
CN116738091A (en) | Page monitoring method and device, electronic equipment and storage medium | |
CN111026651A (en) | Test method, test device, storage medium and electronic equipment | |
CN110674045A (en) | Information tracking detection method and device, electronic equipment and storage medium | |
CN113377648B (en) | Software system diagnosis method, device, electronic equipment and computer readable medium | |
CN109684525B (en) | Document display method and device, storage medium and test equipment | |
CN113742185A (en) | Server and server debugging state monitoring method | |
CN113778800B (en) | Error information processing method, device, system, equipment and storage medium | |
CN115239212B (en) | Monitoring method, device and system of air quality mode and storage medium |
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 |