Data processing method and device, equipment, storage medium and program product
By adding target objects to the program executor to record and output program stack information in real time, the problem of not being able to obtain program stack information in real time in the prior art is solved, and the efficiency of program debugging and problem positioning is improved.
Patent Information
- Application Number
- CN202510344703.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-11
AI Technical Summary
The prior art cannot obtain program stack information in real time when the program is running, resulting in difficulty in program debugging and problem positioning, and additional auxiliary means may not be able to reproduce exceptions.
Add a target object to the program executor, record and output the program stack information in real time, and record the program stack information generated when the program executor executes the target program in real time, and output it.
It realizes real-time acquisition of program stack information when the program is running, improves the timeliness of tracking program stack information, reduces performance losses and improves the efficiency of problem positioning.
Smart Images

Figure CN120295894A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technologies, and in particular, to a data processing method, apparatus, device, storage medium, and program product. Background Art
[0002] Currently, during the process of program development, program stack information is of great significance for developers to track program running data and ensure the correctness of program operation. Through the program stack information, developers can understand key information such as the call hierarchy, parameter passing situation, and statement execution position during the program's operation. However, currently, it is impossible to track program stack information in real time while the program is running normally. Usually, only after an exception occurs in the program can developers take some remedial measures to obtain relevant information. But this method often loses timeliness, and when obtaining program stack information through other auxiliary means, the previously occurred abnormal situation may not be reproduced again, which brings great difficulties to program debugging and problem location.
[0003] Therefore, how to obtain program stack information in real time while the program is running is an urgent problem to be solved. Summary of the Invention
[0004] Embodiments of this application provide a data processing method, apparatus, device, storage medium, and program product to achieve the effect of obtaining program stack information in real time while the program is running.
[0005] In a first aspect, an embodiment of this application provides a data processing method, including:
[0006] During the execution of a target program, a target object records the program stack information of the program executor executing the target program, and the program executor includes the target object;
[0007] Output the program stack information.
[0008] Optionally, the program executor includes at least two of the target objects, and each of the target objects corresponds to each layer of the program stack in the target program.
[0009] Optionally, the recording of the program stack information of the program executor executing the target program by the target object includes:
[0010] If the target program is in a normal running state, the target object traverses the data area of the program executor to obtain the program stack information of the program executor executing the target program.
[0011] Optionally, the recording of the program stack information of the program executor executing the target program by the target object includes:
[0012] If a runtime exception occurs during the execution of the target program, determine the target program stack layer that sent the runtime exception.
[0013] Call the target probe function through the target object corresponding to the target program stack layer to obtain the program stack information of the target program for each execution layer. The target probe function is used to obtain the current program stack information of the target program.
[0014] Optionally, if the target program is in a normal running state, the output of the program stack information includes:
[0015] After receiving a program stack information acquisition request sent through the API interface of the target program, output the program stack information.
[0016] Optionally, the program stack information includes program call information and statement execution information. The program call information includes the program name, program call hierarchy, parameter name, and parameter type. The statement execution information includes the statement line number. The acquisition of the program stack information of the target program executed by the program executor includes:
[0017] Obtain at least one of the program name, statement line number, parameter name, and parameter type from the static data sharing area of the program executor.
[0018] According to the target objects corresponding to each execution layer, obtain the program call hierarchy of the target program for each execution layer.
[0019] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0020] A control module, configured to record the program stack information of the target program executed by the program executor through the target object during the execution of the target program. The program executor includes the target object.
[0021] An output module, configured to output the program stack information.
[0022] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
[0023] The memory stores computer execution instructions;
[0024] The processor executes the computer execution instructions stored in the memory, so that the processor executes the implementation method described in any one of the first aspects above.
[0025] Fourthly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the implementation manner described in any one of the above first aspects.
[0026] Fifthly, an embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements the implementation manner described in any one of the above first aspects.
[0027] In the data processing method, device, equipment, storage medium and program product provided by the embodiments of the present application, a target object for recording the execution state of the program executor (i.e., program stack information) is added to the program executor. The target object records in real time the program stack information generated when the program executor executes the target program, and outputs the recorded program stack information, thereby realizing the function of obtaining program stack information in real time during program operation and improving the timeliness of tracking program stack information. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0029] Figure 1 It is a schematic flowchart of a data processing method provided by an embodiment of the present application;
[0030] Figure 2 It is a schematic structural diagram of a program executor provided by an embodiment of the present application;
[0031] Figure 3 It is a schematic flowchart of another data processing method provided by an embodiment of the present application;
[0032] Figure 4 It is a schematic flowchart of yet another data processing method provided by an embodiment of the present application;
[0033] Figure 5 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application;
[0034] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
[0035] Through the above drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions later. These drawings and text descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0037] Currently, a program is a set of instructions written in a computer language to achieve a specific goal or solve a specific problem. It can manipulate computer hardware resources and software resources to complete expected tasks, such as office software for document processing, browsers for web browsing, etc. Program development involves multiple links, including requirements analysis, design, coding, testing, and maintenance, etc. The development process needs to follow corresponding syntax rules and programming paradigms.
[0038] During program execution, developers can track the program execution flow by obtaining the program stack information of the program to confirm whether the code runs according to the expected logic. Especially when dealing with recursive functions or multi-threaded programs, this helps to understand the internal mechanism of the program and troubleshoot potential logical problems. Also, when the program runs into an error, the stack information can clearly present the call hierarchy of the function at the time of the error. Developers can use this to understand the program execution path and determine which function or code line the error specifically occurs in, greatly shortening the error troubleshooting time.
[0039] However, currently during program execution, program stack information can mainly be obtained through additional auxiliary means or tools. For example, taking a program developed based on the C language as an example, when compiling a C language program, the -g option needs to be added, and the compiler will add debugging information, including symbol tables, line number information, etc., to the generated executable file. Then, use the gdb tool to debug the program. In the gdb environment, the stack trace information of the current program can be obtained through specific commands (such as the backtrace command) to view the function call stack situation and / or error information of the program run error, etc.
[0040] Obtaining program stack information through additional auxiliary means or tools will cause additional performance losses, affect the efficiency of program execution, and the previous abnormal situations may not be reproducible again, which brings great difficulties to program debugging and problem positioning.
[0041] Therefore, how to obtain program stack information in real time during program execution is an urgent problem to be solved.
[0042] In view of this, the present application provides a data processing method. By adding a target object for recording the execution status of the program executor (i.e., program stack information) to the program executor, the target object records the program stack information generated when the program executor executes the target program in real time, and outputs the recorded program stack information, thereby realizing the function of obtaining the program stack information in real time during program operation and improving the timeliness of tracking the program stack information.
[0043] The execution subject of the data processing method provided by the present application can be an electronic device, or a processing chip of the electronic device, or software or program code for implementing the data processing method. When the execution subject is an electronic device, the electronic device can be, for example, a computing device such as a mobile phone, a computer, or a tablet computer. Software or program code for running the data processing method can be deployed on the computing device, and the program stack information can be obtained in real time during program operation through the software or program code.
[0044] Next, the technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail through specific embodiments. These several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0045] Figure 1 It is a schematic flowchart of a data processing method provided by an embodiment of the present application. As Figure 1 shown, the method includes:
[0046] S101. During the execution of the target program, record the program stack information of the program executor executing the target program through the target object.
[0047] Among them, the program executor includes a target object.
[0048] Figure 2 It is a schematic structural diagram of a program executor provided by an embodiment of the present application. As Figure 2 shown, the program executor includes at least one target object (i.e., estate), and the target object is used to record the program executor status when the program executor executes. If the program executor is executing the target program, the program executor status is the program stack information of the target program.
[0049] Among them, the program executor can be a program executor applied to databases such as Kingbase database, SQL database, Oracle database, etc. For example, it can be a program executor based on Procedure Language & Structured Query Language (PL / SQL), or it can be any other program executor, and this application does not limit this.
[0050] The target object can store the recorded program stack information inside itself, so that when the program stack information needs to be output, the stored program stack information can be displayed to the developer, facilitating the developer to view the real-time state during program operation.
[0051] In a possible implementation, the program executor may only include one target object. For each execution layer when the program executor executes the target program (that is, each layer of the program stack in the target program corresponds to a target object), it records the program stack information of each execution layer through this target object.
[0052] In another possible implementation, the program executor may include at least two target objects. For each execution layer when the program executor executes the target program, the program stack information of this execution layer is recorded through a corresponding target object (that is, each target object corresponds to each layer of the program stack in the target program), so as to isolate the program stack information of different execution layers. Among them, the execution layer refers to that when the program executor executes the target program, each recursive and nested call of the program executor is an execution layer.
[0053] Optionally, the program executor may also include a shared data area. The static program stack information between different execution layers can be stored in the shared data area. The static program stack information refers to the program stack information that is independent of the program call hierarchy and does not change during the operation of the target program. When each execution layer in the program executor corresponds to a target object, each target object can obtain the static program stack information from the shared data area, so as to reduce the repeated storage of the static program stack information and improve the storage space of the program stack information that the target object in the program executor can store.
[0054] The following takes the program executor including at least two target objects, and each target object corresponds to each layer of the program stack in the target program as an example for introduction.
[0055] In this step, during the execution of the target program, the program executor gradually advances the execution process according to the program logic. The target object closely follows the running rhythm of the program executor, and captures and records key information in real time.
[0056] One possible implementation method is that when the program executor enters a new function call, the corresponding target object begins to record the program stack information. Each execution layer has its own exclusive target object, which directly obtains information from the running state of the program executor. The target object obtains the program call information such as the name and parameter information of the current function. At the same time, with the help of the instruction pointer and code mapping relationship maintained inside the program executor, the line number of the current execution statement in the source program is accurately located as the statement running information. For the function call level, since each execution level corresponds to a target object, the target object can be determined by its own hierarchical position information in the program executor.
[0057] Another possible implementation method is that the target object can realize information recording by establishing a specific association with the data area of the program executor. During the program execution process, the data area of the program executor will update the status information related to the function execution in real time. The target object sets a specific monitoring mechanism in the data area. When the information related to the function call in the data area changes, the corresponding target object will immediately perceive it. For example, when a new function call occurs, the data area will record information such as the function name and parameters, and the target object obtains this information through monitoring. At the same time, the target object determines the calling level of the current function in combination with the status identifier maintained by the program executor for each execution layer. This status identifier can be a status bit or a specific data structure, and the target object obtains the level information by parsing it. When obtaining statement execution information, the target object can use the mapping table provided by the program executor to convert the address of the currently executed instruction into the line number in the source program. The target object integrates the various types of information obtained to form a complete program stack information record.
[0058] S102: Output program stack information.
[0059] In this step, the program stack information may be output to a developer interface or a system log so that the developer can obtain the program stack information during program execution.
[0060] In a possible implementation, the program stack information may be output in response to the developer's instruction. For example, upon receiving the program stack information acquisition instruction input by the developer, the program stack information is extracted from the target object and output to the developer. Optionally, the program stack information of all target objects may be directly output, or the program stack information of some target objects corresponding to the instruction may be output according to the developer's instruction.
[0061] Another possible implementation method is to actively output program stack information while the target program is running.
[0062] The method provided by the embodiment of the present application realizes the function of obtaining the program stack information in real time during program operation and improves the timeliness of tracking the program stack information by adding a target object for recording the execution status of the program executor (i.e., the program stack information) to the program executor, recording the program stack information generated when the program executor executes the target program through the target object, and outputting the recorded program stack information.
[0063] Next, taking two cases where the target program is in a normal running state and a running exception occurs during the execution of the target program, a detailed introduction will be given on how to record the program stack information of the program executor executing the target program through the target object in step S101 above.
[0064] Case A: The target program is in a normal running state.
[0065] If the target program is in a normal running state, the target object traverses the data area of the program executor to obtain the program stack information of the program executor executing the target program.
[0066] During the normal operation of the target program, the process of the target object traversing the data area of the program executor to obtain the program stack information is a dynamic and continuous process.
[0067] A possible implementation manner is that the target object can traverse the data area of the program executor at fixed time intervals. For example, every 50 milliseconds, each target object will start a traversal operation. The target object first obtains the information related to its own execution layer from the data area of the program executor. Since each execution layer corresponds to a target object, the target object can directly locate the part of the data belonging to itself. The target object can obtain the name of the current execution function, which may be stored at a specific location in the data area of the program executor, and the target object obtains the name through a pre-set address mapping relationship. Then, the parameter information of the function is obtained. The parameter information may be stored in a specific data structure, and the target object can parse the parameter name and parameter value according to the storage format of the parameters. For the statement running information, the target object can rely on the mapping table of the instruction pointer and the source program line number provided by the program executor to find the corresponding statement line number through the position of the current instruction pointer. When obtaining the function call hierarchy information, the target object can determine it based on its own hierarchy identifier in the program executor. Each target object has a unique hierarchy identifier, which is assigned at program startup and updated as the execution layer progresses. The target object organizes the information obtained and forms a record unit containing program call information and statement running information, and stores it in a temporary data structure. As the traversal continues, the target object will continuously update and improve this data structure, and finally form a complete program stack information record to prepare for possible subsequent output.
[0068] In another possible implementation, the target object can traverse the data area of the program executor in an event-driven manner. When a specific event occurs in the program executor, such as function entry and exit events, the corresponding target object will respond immediately. Taking the function entry event as an example, when a new function is called, the program executor will trigger a corresponding event notification. After the target object at the execution layer where the function is located receives the notification, it starts to obtain relevant information from the data area. For example, the target object can first obtain the name of the newly entered function. Through the function call record mechanism provided by the program executor, it can accurately know the name of the currently called function. Then, it obtains the parameter information passed to the function. The parameter information may be passed through the registers or specific memory areas of the program executor, and the target object obtains this information according to the parameter passing rules of the program executor. For the statement execution information, the target object can use the code tracing mechanism inside the program executor to determine the statement line number corresponding to the function entry. In terms of the function call hierarchy, the target object can determine the hierarchical position of the current function in the entire call stack according to the hierarchical relationship table maintained in the program executor. Through this event-driven method, the target object can obtain more accurate program stack information closely related to function calls, and since the information is obtained only when key events occur, the performance impact on program execution is reduced.
[0069] Optionally, in case A, step S102 may specifically include:
[0070] After receiving a program stack information acquisition request sent through the Application Programming Interface (API) of the target program, output the program stack information.
[0071] Among them, the target program can provide a specific API to wait for receiving external requests through this API. If a program stack information acquisition request sent by a developer is received, the program executor can call the target objects that previously recorded the program stack information, and these target objects will gather the information they recorded respectively to generate and output the program stack information available for the developer to use.
[0072] Case B: A runtime exception occurs during the execution of the target program.
[0073] Figure 3 It is a schematic flowchart of another data processing method provided by an embodiment of the present application. As Figure 3 shown, step S101 may specifically include:
[0074] S301. If a runtime exception occurs during the execution of the target program, determine the target program stack layer where the runtime exception is sent.
[0075] In this step, the target object can monitor the running state of the program executor in real time. When a runtime exception occurs during the execution of the target program, the target object corresponding to the execution layer can determine the occurrence of the runtime exception according to the execution state of the program executor. Then, according to the correspondence between the target object and the execution layer, the target program stack layer of the runtime exception can be determined.
[0076] S302. Call the target probe function through the target object corresponding to the target program stack layer to obtain the program stack information of the target program at each execution layer.
[0077] Among them, the target probe function is used to obtain the current program stack information of the target program.
[0078] A possible implementation is that the target object can pre-store a reference to the target probe function internally. When receiving an instruction to obtain program stack information, the target object can call the target probe function. The target probe function starts from the current target program stack layer and obtains information according to the execution layer relationship maintained in the program executor. Since each execution layer corresponds to a target object, the target probe function first interacts with the target object of the current layer to obtain the program call information of this layer, such as function name, parameter information, etc. At the same time, obtain the statement running information, such as the line number of the currently executed statement. After that, the target probe function obtains a reference to the target object of the upper layer that called it through the target object (if there is an upper layer). Then, recursively call itself, passing in the reference to the target object of the upper layer, and continue to obtain the program stack information of the upper layer. In this recursive process, the target probe function will organize and merge the information obtained from each layer, and finally form a set of program stack information containing all execution layers from the stack layer where the exception occurred to the outermost layer. This method can accurately obtain the detailed information of each execution layer according to the actual order of function calls through recursive calls, ensuring the integrity and accuracy of the information.
[0079] Another implementation method is that the target object can call the target probe function through a message passing mechanism. When the program stack information needs to be obtained, the target object can send a message containing the information of the current stack layer to the target probe function. After receiving the message, the target probe function creates a set for storing the information of each execution layer. The target probe function first obtains the program stack information of this layer from the target object corresponding to the current target program stack layer and adds it to the set. Then, it obtains the reference of the target object of the upper layer through the target object (if there is an upper layer), and sends a message containing the information acquisition request to this upper layer target object. After receiving the message, the upper layer target object also sends its own program stack information back to the target probe function. The target probe function adds this information to the set and continues to send requests to the upper layer until the outermost execution layer is reached.
[0080] Optionally, in case B, the aforementioned step S102 may specifically include:
[0081] If a running exception occurs during the execution of the target program, the program stack information is actively output. For example, the program stack information can be output to the system log file. The system log file will record this information in a certain format and chronological order, which is convenient for developers to view and analyze the exception situation afterwards. Or the program stack information can be sent to a dedicated monitoring system or the developer's working environment. For example, it can be sent to the developer's integrated development environment so that the developer can directly view the detailed program stack information in the integrated development environment, quickly locate the cause of the exception, and perform repairs.
[0082] In a possible implementation method, the program stack information may include program call information and statement execution information. Among them, the program call information may include the program name, program call level, parameter name, parameter type, etc.; the statement execution information includes the statement line number.
[0083] The program name is the unique name used to identify and distinguish different programs, which reflects the main function of the program or the project it belongs to. It serves as the identifier of the program in the operating system or development environment, facilitating users to call and manage. For example, in the command line, the corresponding program can be started by entering the program name.
[0084] Program call level: The program call level describes the nested call depth and order between functions during the execution of the program, showing the hierarchical structure formed by different function call relationships in the program execution process, which helps developers understand the program execution path and the position of each function in the overall logic.
[0085] Parameter name: The parameter name is the name used to identify the data item passed to a function in a function definition or call. It gives a meaningful identifier to the parameter, making the code more readable and maintainable. Developers can clearly understand the purpose of the parameter through the parameter name.
[0086] Parameter type: The parameter type specifies the data type of the function parameter, such as integer, floating-point, character, array, structure, etc. It determines the type of data that the parameter can store and the operation and processing methods within the function, ensuring that the function operates correctly on the parameter.
[0087] Statement line number: The statement line number is the number assigned to each line of the source program, used to identify the position of the statement in the program. It enables developers to quickly locate the corresponding code line when debugging the code, finding errors, or referring to a specific statement.
[0088] Among them, the program name, parameter name, parameter type, and statement line number are static program stack information, that is, program stack information that is independent of the program call hierarchy during the running of the target program and does not change. The program call hierarchy is dynamic program stack information. The program name, parameter name, parameter type, and statement line number can be stored in the shared data area mentioned above, so that each target object only needs one program pointer to independently access the static program stack information in different program call hierarchies. Moreover, there is no need to store the static program stack information multiple times, saving the storage space of the target object.
[0089] In this implementation manner, the method for obtaining the program stack information of the target program executed by the program executor can be specifically as Figure 4 shown. Figure 4 It is a schematic flowchart of another data processing method provided by an embodiment of the present application. As Figure 4 shown, the method may specifically include:
[0090] S401. Obtain at least one of the program name, statement line number, parameter name, and parameter type from the static data sharing area of the program executor.
[0091] As described above, the static data sharing area of the program executor stores static program stack information such as the program name, statement line number, parameter name, and parameter type generated during program operation. The target object can access the static data sharing area of the program executor to obtain at least one of the data such as the program name, statement line number, parameter name, and parameter type required by the target object.
[0092] S402. Obtain the program call hierarchy of the target program of each execution layer according to the corresponding target object of each execution layer.
[0093] As described above, since each execution layer corresponds to a target object, the program call hierarchy of the target program for each execution layer can be obtained by acquiring the execution status of this execution layer recorded by the target object corresponding to this execution layer.
[0094] The method provided by the embodiments of the present application sets a shared data area for storing static program stack information in the program executor, so that when obtaining program stack information, at least one of the static program stack information such as program name, statement line number, parameter name, and parameter type is obtained from the static data sharing area of the program executor, and according to the target object corresponding to each execution layer, the program call hierarchy of the target program for each execution layer is obtained, thereby reducing the repeated storage of static program stack information and increasing the storage space of the program stack information that can be stored by the target object in the program executor.
[0095] Figure 5 It is a structural schematic diagram of a data processing device provided by the embodiments of the present application. As Figure 5 shown, the device may include: a control module 11 and an output module 12.
[0096] The control module 11 is configured to record the program stack information of the program executor executing the target program through the target object during the execution of the target program, and the program executor includes the target object.
[0097] The output module 12 is configured to output the program stack information.
[0098] Optionally, the program executor includes at least two target objects, and each target object corresponds to each layer of the program stack in the target program.
[0099] Optionally, the control module 11 is specifically configured to, if the target program is in a normal running state, traverse the data area of the program executor through the target object to obtain the program stack information of the program executor executing the target program.
[0100] Optionally, the control module 11 is specifically configured to, if a running exception occurs during the execution of the target program, determine the target program stack layer where the running exception occurs. The program stack information of the target program for each execution layer is obtained by calling the target probe function through the target object corresponding to the target program stack layer, and the target probe function is used to obtain the current program stack information of the target program.
[0101] Optionally, when the target program is in a normal running state, the output module 12 is specifically configured to output the program stack information after receiving a program stack information acquisition request sent through the API interface of the target program.
[0102] Optionally, when the program stack information includes program call information and statement execution information, the program call information includes program name, program call hierarchy, parameter name, and parameter type, and the statement execution information includes statement line number, the control module 11 is specifically configured to obtain at least one of the program name, statement line number, parameter name, and parameter type from the static data sharing area of the program executor. According to the corresponding target objects of each execution layer, obtain the program call hierarchy of the target program of each execution layer.
[0103] The data processing device provided in the embodiment of the present application can execute the data processing method in the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0104] Figure 6 It is a schematic structural diagram of an electronic device provided in an embodiment of the present application. Among them, the electronic device is used to execute the data processing method described above. As Figure 6 shown, the electronic device 600 may include: at least one processor 601, a memory 602, and a communication interface 603.
[0105] The memory 602 is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions.
[0106] The memory 602 may include a high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
[0107] The processor 601 is used to execute the computer execution instructions stored in the memory 602 to implement the method described in the foregoing method embodiment. Among them, the processor 601 may be a CPU, or a specific integrated circuit (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more integrated circuits configured to implement the embodiment of the present application.
[0108] The processor 601 can communicate and interact with external devices through the communication interface 603. The external devices can be, for example, other electronic devices, etc. In a specific implementation, if the communication interface 603, the memory 602, and the processor 601 are implemented independently, the communication interface 603, the memory 602, and the processor 601 can be interconnected through a bus and complete communication with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0109] Optionally, in a specific implementation, if the communication interface 603, the memory 602, and the processor 601 are integrated on a chip, the communication interface 603, the memory 602, and the processor 601 can complete communication through an internal interface.
[0110] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented.
[0111] This application also provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the above-mentioned method is implemented.
[0112] The above-mentioned readable storage medium 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 memory, flash memory, a magnetic disk, or an optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0113] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0114] The division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed between each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0117] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks and other various media that can store program codes.
[0118] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disks or optical disks and other various media that can store program codes.
[0119] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include common general knowledge or conventional technical means in the technical field not disclosed in the present invention. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
Claims
1. A data processing method, characterized in that, Including: During the execution of the target program, the program stack information of the target program executed by the program executor is recorded through the target object, and the target object is included in the program executor; Output the program stack information.
2. The method according to claim 1, wherein At least two of the target objects are included in the program executor, and each target object corresponds to each layer of the program stack in the target program.
3. The method according to claim 2, wherein The recording of the program stack information of the target program executed by the program executor through the target object includes: If the target program is in a normal running state, the data area of the program executor is traversed through the target object to obtain the program stack information of the target program executed by the program executor.
4. The method according to claim 2, wherein The recording of the program stack information of the target program executed by the program executor through the target object includes: If a running exception occurs during the execution of the target program, determine the target program stack layer where the running exception is sent; Call the target probe function through the target object corresponding to the target program stack layer to obtain the program stack information of the target program at each execution layer, and the target probe function is used to obtain the current program stack information of the target program.
5. The method according to any one of claims 1-4, characterized in that, If the target program is in a normal running state, the output of the program stack information includes: After receiving a program stack information acquisition request sent through the API interface of the target program, output the program stack information.
6. The method according to any one of claims 3-4, characterized in that The program stack information includes program call information and statement execution information; the program call information includes program name, program call level, parameter name, and parameter type; The statement execution information includes statement line numbers; the acquisition of the program stack information of the target program executed by the program executor includes: Obtain at least one of the program name, the statement line number, the parameter name, and the parameter type from the static data sharing area of the program executor; Obtain the program call level of the target program at each execution layer according to the corresponding target object at each execution layer.
7. A data processing device, characterized in that, Including: A control module for recording the program stack information of the target program executed by the program executor through the target object during the execution of the target program, and the target object is included in the program executor; An output module for outputting the program stack information.
8. An electronic device, characterized in that, Including: A memory, a processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Stored with computer-executable instructions, when the computer-executable instructions are executed, the data processing method according to any one of claims 1-6 is implemented.
10. A computer program product, characterized in that, Including a computer program, when the computer program is executed, the data processing method according to any one of claims 1-6 is implemented.