Method, device, storage medium and electronic device for obtaining program jam information

By filtering the running time and identification information of the storage objective function during the program operation, the problems of large memory consumption and difficult positioning in the existing technology are solved, and efficient acquisition of program lag information is achieved.

CN114780346BActive Publication Date: 2025-08-22BEIJING JINTI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210451641.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-08-22
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

The existing lag monitoring technology has large data to obtain, which causes the monitoring program itself to consume a lot of memory, and may cause frame loss during transmission, making it difficult to accurately locate lag information.

Method used

During the operation of the target program, by determining the currently called objective function, obtaining its running time and function identification information, and filtering and storing according to the preset storage array, only function identification information with the running time exceeding the threshold is stored, the association relationship between functions is constructed, and program lag information is generated.

Benefits of technology

It reduces the space required for storage, streamlines the memory overhead of log information, and can accurately locate the stuttering function through identification information, saving time in finding the cause of stuttering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780346B_ABST
    Figure CN114780346B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, storage medium and electronic device for obtaining program jamming information, the method comprising: when a target program is in a running state, determining a target function currently called by the target program; obtaining the running time of the target function and first function identification information; storing and processing the first function identification information according to the running time of the target function and a preset storage array; when the target program ends, generating jamming information corresponding to the target program according to a stored designated function, the designated function including a function whose running time is greater than or equal to a preset time threshold, the jamming information at least including the running time of the designated function and the function identification information of the target function. In this way, by screening in the storage stage, the space required for storage is reduced, the memory overhead of the log information is streamlined, and at the same time, the jamming function can be accurately located through the identification information, saving time in finding the cause of the jam.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of obtaining application program running information, and in particular, to a method, device, storage medium, and electronic device for obtaining program freeze information. Background Art

[0002] With the increasing popularity of electronic devices, users are placing higher demands on applications. Since applications can experience lag during use, and reducing lag and improving fluency are key indicators of product experience, obtaining information about application lag is crucial.

[0003] Existing jam monitoring technology obtains all data information during the program running process, and then obtains program jam information through this data information. However, due to the large amount of data required to be obtained, the existing jam monitoring technology will cause the monitoring program itself to consume a large amount of memory, and will also cause loss of transmission frames during the transmission process. It is also very difficult to accurately locate the required jam information in a large amount of data. Summary of the Invention

[0004] In order to solve the above problems, the present disclosure provides a method, device, storage medium and electronic device for obtaining program freeze information.

[0005] In a first aspect, the present disclosure provides a method for obtaining program freeze information, the method comprising:

[0006] When a target program is in a running state, determine a target function currently called in the target program; obtain the running time of the target function and first function identification information; store the first function identification information according to the running time of the target function and a preset storage array; when the target program ends, generate program jam information corresponding to the target program according to the stored designated function, the designated function includes a function whose running time is greater than or equal to a preset time threshold, and the program jam information includes at least the running time of the designated function and the function identification information of the target function.

[0007] Optionally, the storage processing of the first function identification information according to the running time of the target function includes: when the target function starts to run, storing the first function identification information to a specified position of the target storage array; when the target function ends running, obtaining the running time of the target function; when the running time is less than the preset time threshold, deleting the first function identification information in the target storage array.

[0008] Optionally, the program freeze information also includes an association relationship between the first function identification information and the second function identification information, where the second function identification information is the function identification information of the parent function corresponding to the target function; the method also includes: when the first function identification information is stored in a specified position of the target storage array, determining the parent function corresponding to the target function from the target storage array; and establishing an association relationship between the first function identification information and the second function identification information corresponding to the parent function.

[0009] Optionally, when the running time is less than a preset time threshold, deleting the first function identification information in the target storage array includes: when the parent function ends running, obtaining the number of specified functions that inherit the parent function in the target storage array; when the number of specified functions is less than or equal to a preset number threshold, deleting the second function identification information of the parent function in the target storage array.

[0010] Optionally, generating the program lag information corresponding to the target program based on the specified function stored in the target storage array includes: obtaining the calling time of the specified function based on the running time of the specified function; determining the lag function from the specified function based on the calling time; and using the lag information corresponding to the lag function as the program lag information corresponding to the target program.

[0011] Optionally, determining the jam function based on the running time of the designated function includes: taking a preset number of designated functions with the longest calling time as the jam function.

[0012] Optionally, obtaining the calling time of the specified function based on the running time of the specified function includes: using the running time of the specified function as the calling time of the specified function; or, when the specified function contains the same function, accumulating the running time corresponding to the same function to obtain the cumulative running time, and using the cumulative running time as the calling time.

[0013] In a second aspect, the present disclosure provides a device for obtaining program freeze information, the device comprising:

[0014] A determination module, configured to determine a target function currently called in the target program when the target program is in a running state;

[0015] An acquisition module, configured to acquire the running time of the target function and first function identification information;

[0016] A storage module, configured to store the first function identification information according to the running time of the target function and a preset storage array;

[0017] A generation module is used to generate program jam information corresponding to the target program based on the stored designated function when the target program ends running. The designated function includes a function whose running time is greater than or equal to a preset time threshold. The program jam information at least includes the running time of the designated function and the function identification information of the target function.

[0018] Optionally, the storage module is used to store the first function identification information in a specified position of the target storage array when the target function starts running; obtain the running time of the target function when the target function ends running; and delete the first function identification information in the target storage array when the running time is less than the preset time threshold.

[0019] Optionally, the program freeze information also includes an association relationship between the first function identification information and the second function identification information, where the second function identification information is the function identification information of the parent function corresponding to the target function; the device also includes: a relationship module; the relationship module is used to determine the parent function corresponding to the target function from the target storage array when the first function identification information is stored in a specified position of the target storage array; and establish an association relationship between the first function identification information and the second function identification information corresponding to the parent function.

[0020] Optionally, the storage module is used to obtain the number of specified functions that inherit the parent function in the target storage array when the parent function ends running; and delete the second function identification information of the parent function in the target storage array when the number of specified functions is less than or equal to a preset number threshold.

[0021] Optionally, the generation module is used to obtain the calling time of the specified function based on the running time of the specified function; determine the jamming function from the specified function based on the calling time; and use the jamming information corresponding to the jamming function as the program jamming information corresponding to the target program.

[0022] Optionally, the generation module is used to use a preset number of designated functions with the longest calling time as the lag function.

[0023] Optionally, the generation module is used to use the running time of the specified function as the calling time of the specified function; or, when the specified function contains the same function, the running time corresponding to the same function is accumulated to obtain the cumulative running time, and the cumulative running time is used as the calling time.

[0024] In a third aspect, the present disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0025] In a fourth aspect, the present disclosure provides an electronic device, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the above method.

[0026] Using the above technical solution, when the target program is running, the target function currently being called in the target program is determined; the target function's runtime and first function identification information are obtained; based on the target function's runtime and a preset storage array, the first function identification information is stored and processed; and when the target program finishes running, program stall information corresponding to the target program is generated based on the stored specified function. This reduces the storage space required and the memory overhead of the log information by filtering during the storage phase. At the same time, the stalled function can be accurately located through the identification information, saving time in searching for the cause of the stall.

[0027] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:

[0029] Figure 1 This is a flow chart of a method for obtaining program freeze information according to an exemplary embodiment;

[0030] Figure 2 is a schematic diagram showing a process for storing function identification information according to an exemplary embodiment;

[0031] Figure 3 This is a block diagram of a device for obtaining program freeze information according to an exemplary embodiment;

[0032] Figure 4 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0033] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.

[0034] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the corresponding data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0035] First, the application scenario of the present application is explained. The present application is applied to the scenario of obtaining program jam information. The existing method of obtaining program jam information is to monitor and store each function called during the program running and its running time, and generate log information based on the functions called during the program running and its running time, and finally find the cause of the program jam based on the log information.

[0036] However, since the data generated during program operation is relatively large and complex, the existing method of obtaining program stall information will occupy a large amount of running memory, affecting the terminal's performance. In addition, due to the large amount of stored content, it is difficult to deploy on a large scale and requires remote transmission, which may cause frame rate loss. In addition, the proportion of effective information in the large amount of stored content is relatively small, making it difficult to locate the real cause of program stalls.

[0037] Therefore, in order to solve the above problems, the inventors have proposed a method, device, storage medium and electronic device for obtaining program jamming information in response to the defects in the prior art. When the target program is in the running state, the target function currently called in the target program is determined; the running time of the target function and the first function identification information are obtained; based on the running time of the target function and the preset storage array, the first function identification information is stored and processed; when the target program ends, the program jamming information corresponding to the target program is generated according to the stored specified function. In this way, by filtering in the storage stage, the space required for storage is reduced, the memory overhead of the log information is streamlined, and the jamming function can be accurately located through the identification information, saving time in finding the cause of the jam.

[0038] The present disclosure is described below with reference to specific embodiments.

[0039] Figure 1 This is a method for obtaining program freeze information according to an exemplary embodiment of the present application. Figure 1 As shown, the method includes:

[0040] S101 : When a target program is in a running state, determine a target function currently called in the target program.

[0041] The target program may be any program that needs to obtain freeze information.

[0042] In one possible implementation, a program monitoring code may be created. When the target program is running, a cursor algorithm may be constructed to create a first pointer pointing to the currently running function. The function currently called during the running of the target program may be determined through the first pointer.

[0043] S102: Obtain the running time and first function identification information of the target function.

[0044] The function identification information may be a function ID (Identity document).

[0045] In one possible implementation, statistical code can be inserted into the source code compilation stage during the program execution. The statistical code is used to mark the start time when the function starts, the exit time when the function exits, and the first function identification information of the function. Combined with the above-mentioned first pointer, the function pointed to by the first pointer is obtained, and the running time and first function identification information of the target function currently being called can be obtained.

[0046] In this way, the situation of the program calling functions can be monitored at all times during the program running, and the data information of the function being called can be obtained in time.

[0047] S103: Store the first function identification information according to the running time of the target function and a preset storage array.

[0048] In this step, the jam information that needs to be stored can be determined based on the running time of the current calling function during the running of the target program.

[0049] In one possible implementation, when the target function starts running, the first function identification information can be stored in a specified position of the target storage array; when the target function ends running, the running time of the target function is obtained; when the running time is less than the preset time threshold, the first function identification information in the target storage array is deleted.

[0050] For example, Figure 2 A schematic diagram of a stored procedure is shown in Figure 2 As shown in a, there is a target program MSG, which has function A. Function A has sub-functions B, C, and D. When the target program MSG is running, Figure 2 As shown in b, function A is called, the first pointer points to function A, and obtains the start time of function A and the function ID of function A, and stores the function ID of function A to the specified position 1 of the target storage array, as shown in Figure 2As shown in Figure 3, when function A calls function B, the first pointer moves to point to function B, obtains the start call time of function B and the function ID of function B, and stores the function ID of function B in the specified position 2 of the target storage array. When function B does not have a sub-function, the first pointer continues to point to function B before the call of function B ends, and when the call of function B ends, as shown in Figure 3, Figure 2 d, obtain the end time of the function B, and obtain the running time of the function B according to the start call time and end time of the function B, as shown in Figure 2 As shown in FIG. 5 , if the running time of function B is less than the preset time threshold, the function ID of function B stored in the designated position 2 is deleted, and when function C starts to call and the first pointer points to function C, the function ID of function C is stored in the designated position 2 of the target storage array; as shown in FIG. Figure 2 As shown in g, if the running time of function B is greater than or equal to the preset time threshold, the function ID of function B stored in the specified position 2 is retained, and when function C starts to call and the first pointer points to function C, the function ID of function C is stored in the specified position 3 of the target storage array.

[0051] In this way, the function ID of the target function whose calling time exceeds the preset time threshold can be stored, and there is no need to store the function IDs of all calling functions. This not only saves a lot of storage space, but also makes it easier to find the jamming information that causes the program to jam.

[0052] In another possible implementation, the program freeze information also includes an association relationship between the first function identification information and the second function identification information, where the second function identification information is the function identification information of the parent function corresponding to the target function; when the first function identification information is stored in a specified position of the target storage array, the parent function corresponding to the target function is determined from the target storage array; and an association relationship is established between the first function identification information and the second function identification information corresponding to the parent function.

[0053] For example, a program monitoring code can be created. When the target program is in a running state, a cursor algorithm is constructed to create a first pointer pointing to the currently running function, a second pointer always pointing to the parent function of the currently running function, and a third pointer always pointing to the current storage position of the target storage array. The pointing relationship between the currently called function and the currently called function and its parent function during the running of the target program is determined through the first pointer, the second pointer, and the third pointer.

[0054] For example, Figure 2As shown in a, there is a target program MSG, the target program MSG has function A, the function A has sub-functions B, C and D. When the target program MSG is running, Figure 2 As shown in b, function A is called, the first pointer points to function A, and the start time and function ID of function A are obtained. Function A does not have a parent function, the second pointer is empty, and the function ID of function A is stored in the specified position 1 of the target storage array. The third pointer points to the specified position 1, as shown in Figure 2 As shown in Figure c, when function A calls function B, the first pointer moves to point to function B, obtains the start calling time of function B and the function ID of function B, the second pointer points to function A, determines the inheritance relationship between function B and function A, stores the function ID of function B in the specified position 2 of the target storage array, the third pointer points to the specified position 2, and establishes a pointing relationship from the specified position 1 to the specified position 2; when function B does not have a sub-function, the pointing directions of the three pointers remain unchanged before the call of function B ends; as shown in Figure 3 Figure 2 As shown in d, when the function B call ends, the first pointer points to function A, the second pointer is empty, and the third pointer points to the specified position 2. The end time of the function B is obtained, and the running time of the function B is obtained according to the start call time and end time of the function B, as shown in Figure 2 As shown in e, if the running time of the function B is less than the preset time threshold, the function ID of the function B stored in the designated position 2 and the pointing relationship between the designated position 1 and the designated position 2 are deleted, and when the function C starts to be called, the first pointer points to the function C, the second pointer points to the function A, and the third pointer points to the designated position 2; Figure 2 As shown in g, if the running time of the function B is greater than or equal to the preset time threshold, the function ID of the function B stored in the designated position 2 and the pointing relationship of the designated position 1 to the designated position 2 are retained, and when the function C starts to be called, the first pointer points to function C, the second pointer points to function A, and the third pointer points to the designated position 3 of the target storage array, and a pointing relationship is established from the designated position 1 to the designated position 3, and so on. By continuously correcting the pointing relationship of the storage function, the pointing relationship between the parent function and the child function of multiple storage functions can be established, and then a tree relationship of the function IDs of all storage functions can be formed.

[0055] In this way, by constructing a tree-like relationship, during the storage process, not only is the function ID of the target function whose call time exceeds the preset time threshold stored, but the inheritance relationship of the target function is further marked, which is conducive to accurately locating the jam information that causes the program to jam.

[0056] In addition, when the parent function ends, the number of specified functions that inherit the parent function in the target storage array is obtained; when the number of specified functions is less than or equal to the preset number threshold, the second function identification information of the parent function in the target storage array is deleted.

[0057] The preset quantity threshold may be 0.

[0058] For example, if the above-mentioned function B, function C and function D are all functions called by function A, and the running time of function B, function C and function D are all less than the preset time threshold, then when function A ends, the function ID of function A stored in the specified position 1 is deleted.

[0059] In this way, when there is no child function that may cause lag, clearing the second function identification information of the parent function stored in the target storage function is beneficial to further save storage space.

[0060] S104: When the target program is finished running, generate program freeze information corresponding to the target program according to the stored designated function.

[0061] The designated function includes a function whose running time is greater than or equal to a preset time threshold, and the program freeze information includes at least the running time of the designated function and the function identification information of the target function.

[0062] In one possible implementation, the calling time of the specified function is obtained based on the running time of the specified function; the jamming function is determined from the specified function based on the calling time; and the jamming information corresponding to the jamming function is used as the program jamming information corresponding to the target program.

[0063] Among them, a preset number of designated functions with the longest calling time can be used as the lag function.

[0064] For example, when the target program is finished running, the function identification information stored in the target storage array may be extracted a second time.

[0065] For example, by traversing the function identification information records in the target storage array, the specified functions whose call time exceeds a preset ratio, or the preset number of specified functions with the longest call time, are extracted as the stuck functions. This can further save the required storage space.

[0066] It should be noted that since a function may be called multiple times, if the function is called only once, the running time of the specified function will be used as the calling time of the specified function; or, if the function is called multiple times, that is, when the specified function contains the same function, the running time corresponding to the same function will be accumulated to obtain the cumulative running time, and the cumulative running time will be used as the calling time.

[0067] Using the above method, while the target program is running, the target function currently being called in the target program is determined; the target function's runtime and first function identification information are obtained; based on the target function's runtime and a preset storage array, the first function identification information is stored and processed; and when the target program terminates, program stall information corresponding to the target program is generated based on the stored designated function. This method, through filtering during the storage phase, reduces the space required for storage and streamlines the memory overhead of log information. Furthermore, the stalling function can be accurately located through identification information, saving time in searching for the cause of the stall.

[0068] Figure 3 This application is a device for obtaining program jam information according to an exemplary embodiment. Figure 3 As shown, the device includes:

[0069] The determination module 301 is used to determine the target function currently called in the target program when the target program is in a running state;

[0070] An acquisition module 302 is configured to acquire the running time of the target function and first function identification information;

[0071] A storage module 303 is configured to store the first function identification information according to the running time of the target function and a preset storage array;

[0072] The generation module 304 is used to generate program jam information corresponding to the target program according to the stored designated function when the target program ends running. The designated function includes a function whose running time is greater than or equal to a preset time threshold. The program jam information at least includes the running time of the designated function and the function identification information of the target function.

[0073] Optionally, the storage module 303 is used to store the first function identification information in a specified position of the target storage array when the target function starts running; obtain the running time of the target function when the target function ends running; and delete the first function identification information in the target storage array when the running time is less than the preset time threshold.

[0074] Optionally, the program freeze information further includes an association relationship between the first function identification information and second function identification information, where the second function identification information is function identification information of a parent function corresponding to the target function; and the device further includes:

[0075] The relationship module 305 is used to determine the parent function corresponding to the target function from the target storage array when the first function identification information is stored in the specified position of the target storage array; and establish an association relationship between the first function identification information and the second function identification information corresponding to the parent function.

[0076] Optionally, the storage module 303 is used to obtain the number of specified functions that inherit the parent function in the target storage array when the parent function ends running; and delete the second function identification information of the parent function in the target storage array when the number of specified functions is less than or equal to a preset number threshold.

[0077] Optionally, the generation module 304 is used to obtain the calling time of the specified function based on the running time of the specified function; determine the jamming function from the specified function based on the calling time; and use the jamming information corresponding to the jamming function as the program jamming information corresponding to the target program.

[0078] Optionally, the generating module 304 is configured to use a preset number of designated functions with the longest calling time as the lag function.

[0079] Optionally, the generation module 304 is used to use the running time of the specified function as the calling time of the specified function; or, when the specified function contains the same function, the running time corresponding to the same function is accumulated to obtain the cumulative running time, and the cumulative running time is used as the calling time.

[0080] Using the above device, when a target program is running, the target function currently being called in the target program is determined; the target function's runtime and first function identification information are obtained; based on the target function's runtime and a preset storage array, the first function identification information is stored and processed; and when the target program terminates, program stall information corresponding to the target program is generated based on the stored designated function. This, through filtering during the storage phase, reduces the space required for storage and streamlines the memory overhead of log information. Furthermore, the stalled function can be accurately located through identification information, saving time in searching for the cause of the stall.

[0081] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0082] Figure 4 FIG. 4 is a block diagram of an electronic device 400 according to an exemplary embodiment. Figure 4 As shown, the electronic device 400 may include: a processor 401 , a memory 402 , and may further include one or more of a multimedia component 403 , an input / output (I / O) interface 404 , and a communication component 405 .

[0083] The processor 401 is used to control the overall operation of the electronic device 400 to complete all or part of the steps in the method for obtaining program jam information described above. The memory 402 is used to store various types of data to support the operation of the electronic device 400. For example, these data may include instructions for any application or method operating on the electronic device 400, as well as application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 402 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The multimedia component 403 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 402 or transmitted via the communication component 405. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 404 provides an interface between the processor 401 and other interface modules. The aforementioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 405 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more thereof, is not limited here. Therefore, the corresponding communication component 405 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0084] In an exemplary embodiment, the electronic device 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned method for obtaining program jam information.

[0085] In another exemplary embodiment, a computer-readable storage medium including program instructions is further provided. When executed by a processor, the program instructions implement the steps of the above-mentioned method for obtaining program jam information. For example, the computer-readable storage medium may be the above-mentioned memory 402 including the program instructions. The above-mentioned program instructions may be executed by the processor 401 of the electronic device 400 to complete the above-mentioned method for obtaining program jam information.

[0086] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned method for obtaining program jam information when executed by the programmable device.

[0087] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.

[0088] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.

[0089] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.

Claims

1. A method for obtaining program freeze information, characterized in that: The method comprises: When the target program is in a running state, determining a target function currently called in the target program; Obtaining the running time of the target function and first function identification information; storing the first function identification information according to the running time of the target function and a preset storage array; When the target program ends running, generating program jam information corresponding to the target program according to the stored designated function, the designated function including a function whose running time is greater than or equal to a preset time threshold, and the program jam information including at least the running time of the designated function and the function identification information of the target function; The storing and processing the first function identification information according to the running time of the target function includes: When the target function starts to run, storing the first function identification information in a designated location of a target storage array; When the objective function finishes running, obtaining the running time of the objective function; When the running time is less than the preset time threshold, deleting the first function identification information in the target storage array; The program jam information further includes an association relationship between the first function identification information and second function identification information, where the second function identification information is function identification information of a parent function corresponding to the target function; and when the running time is less than a preset time threshold, deleting the first function identification information in the target storage array includes: When the parent function is finished running, obtaining the number of specified functions that inherit the parent function in the target storage array; When the number of the designated functions is less than or equal to a preset number threshold, the second function identification information of the parent function in the target storage array is deleted.

2. The method according to claim 1, characterized in that The method further comprises: In a case where the first function identification information is stored in a designated position of the target storage array, determining a parent function corresponding to the target function from the target storage array; An association relationship is established between the first function identification information and the second function identification information corresponding to the parent function.

3. The method according to claim 1 or 2, characterized in that Generating the program jam information corresponding to the target program according to the specified function stored in the target storage array includes: Obtaining the calling time of the specified function according to the running time of the specified function; Determining a stuck function from the specified functions according to the call time; The jam information corresponding to the jam function is used as the program jam information corresponding to the target program.

4. The method according to claim 3, characterized in that Determining the jam function according to the running time of the specified function includes: A preset number of designated functions with the longest calling time are used as the jamming functions.

5. The method according to claim 4, characterized in that The acquiring the calling time of the specified function according to the running time of the specified function includes: The running time of the specified function is used as the calling time of the specified function; or, In the case that the designated functions include identical functions, the running times corresponding to the identical functions are accumulated to obtain a cumulative running time, and the accumulated running time is used as the calling time.

6. A device for obtaining program freeze information, characterized in that: The device comprises: A determination module, configured to determine a target function currently called in the target program when the target program is in a running state; An acquisition module, configured to acquire the running time of the target function and first function identification information; A storage module, configured to store the first function identification information according to the running time of the target function and a preset storage array; a generating module, configured to generate, when the target program ends, program jam information corresponding to the target program based on the stored designated function, wherein the designated function includes a function whose running time is greater than or equal to a preset time threshold, and the program jam information includes at least the running time of the designated function and the function identification information of the target function; The storing and processing the first function identification information according to the running time of the target function includes: When the target function starts to run, storing the first function identification information in a designated location of a target storage array; When the objective function finishes running, obtaining the running time of the objective function; When the running time is less than the preset time threshold, deleting the first function identification information in the target storage array; The program jam information further includes an association relationship between the first function identification information and second function identification information, where the second function identification information is function identification information of a parent function corresponding to the target function; and when the running time is less than a preset time threshold, deleting the first function identification information in the target storage array includes: When the parent function is finished running, obtaining the number of specified functions that inherit the parent function in the target storage array; When the number of the designated functions is less than or equal to a preset number threshold, the second function identification information of the parent function in the target storage array is deleted.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

8. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Jamming detection method and device, electronic equipment and storage medium

    CN109491907A

  • Interface thread visualization method and device, computer equipment and storage medium

    CN111273980A

  • Method for collecting and tracking trace call chain and electronic equipment

    CN113448815A