Application program debugging method and device, medium and electronic equipment
By intercepting and parsing data on the communication path of cross-platform applications and reproducing the communication process in source code using a simulated environment, cross-platform application debugging problems are solved, and bug troubleshooting efficiency and code quality are improved.
Patent Information
- Application Number
- CN202310520605.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2024-11-12
AI Technical Summary
Cross-platform application debugging is difficult, especially because components introduced in hybrid binary methods cannot be quickly debugged using source code, and it is difficult to find bugs during development in the middle platform mode, resulting in difficult to guarantee code quality.
By intercepting data on the communication path between the target application and the front-end code execution engine, recording and parsing the communication link data, the simulated environment reproduces the communication process in the form of source code, and debugging of the target application is achieved.
It realizes rapid debugging and bug troubleshooting, improves business problem troubleshooting efficiency, can promptly detect code problems during development, and improves code quality.
Smart Images

Figure CN118939521A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to an application debugging method, device, medium and electronic device. Background Art
[0002] A cross-platform application development framework means that developers use the same set of codes and can run the developed applications on multiple end platforms (for example, mini-programs, browsers, iOS, Andriod, MacOS, Linux, Kylin, UOS, etc.) with just one coding.
[0003] However, for most cross-end business scenarios, a client's cross-platform application (APP) involves hundreds of different components. In order to reduce the package size, these components are usually introduced in a mixed binary manner, which makes it impossible to quickly debug the cross-platform APP using source code. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides an application debugging method, comprising: intercepting data on a communication path between a target application and a front-end code execution engine via a target application component, recording and storing communication link data obtained from the interception process as a recording product; wherein the target application component is represented in binary form; acquiring the recording product and parsing the communication link data, and reproducing the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0006] In a second aspect, the present disclosure provides an application debugging device, comprising:
[0007] An interception module, used to intercept data on a communication path between a target application and a front-end code execution engine via a target application component, and record the communication link data obtained from the interception process and store it as a recording product; wherein the target application component is represented in binary form;
[0008] A debugging module is used to obtain the recording product and parse the communication link data, and reproduce the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0009] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect of the present disclosure.
[0010] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any one of the methods described in the first aspect of the present disclosure.
[0011] By adopting the above technical solution, since data can be intercepted on the communication path between the target application and the front-end code execution engine via the target application component, the communication link data obtained by the interception process is recorded and stored as a recording product, wherein the target application component is represented in binary form, and then the recording product is obtained and parsed to obtain the communication link data, and based on the communication link data, the communication process of the target application is reproduced in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via the playback application component, and the playback application component is represented in the form of source code corresponding to the target application component. In this way, the effect of debugging the target application using the source code is achieved, so that developers (for example, SDK developers directly facing cross-platform framework development) can replay the front-end page in the playback application anytime and anywhere, and finally reproduce the front-end page in the target application without loss. For cross-end business scenarios involving hundreds of different components, through the methods disclosed in this disclosure, it is possible to quickly copy related business scenarios and replay the copied business scenarios in a playback application, in which developers can use source code for debugging. For the middle-office model, through the methods disclosed in this disclosure, numerous front-end pages can be copied and automated playback tests can be performed in the middle-office code testing system, so that problems with the code can be found in a timely manner during development. Therefore, in terms of bug resolution, this disclosure can greatly improve the efficiency of business problem troubleshooting; in terms of improving code quality, this disclosure can troubleshoot many problems that cannot be discovered by ordinary tests in daily development.
[0012] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0014] Figure 1 The present invention is a flowchart of an application debugging method according to an embodiment of the present invention.
[0015] Figure 2 It is a schematic diagram of intercepting communication link data between a target application and a front-end code execution engine according to an embodiment of the present disclosure.
[0016] Figure 3 It is a schematic diagram of intercepting communication link data between a target application and a front-end code execution engine according to an embodiment of the present disclosure.
[0017] Figure 4 It is a schematic diagram of storing and compressing the intercepted communication link data according to an embodiment of the present disclosure.
[0018] Figure 5 It is a schematic diagram of reproducing a front-end page in a playback application according to an embodiment of the present disclosure.
[0019] Figure 6 It is a schematic block diagram of an application debugging device according to an embodiment of the present disclosure.
[0020] Figure 7 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0022] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0023] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0024] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0027] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0028] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0029] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0030] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0031] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0032] In the related art, the cross-platform framework uses the front-end page developed by the front-end as input, performs a series of parsing and rendering, and generates the native page of the mobile phone. Moreover, the development and debugging tools are generally embedded in the cross-platform framework or rely on the cross-platform framework itself, thereby providing certain debugging and error correction capabilities to the cross-platform framework in reverse.
[0033] However, for most cross-end business scenarios, a client's cross-platform APP involves hundreds of different components. In order to reduce the package size, these components are usually introduced in a mixed binary manner, which makes it impossible to quickly debug the cross-platform APP using source code.
[0034] In addition, most large enterprises adopt the middle platform model to iterate the internal technology ecosystem. However, as a middle platform product, the cross-platform framework cannot be directly tested with many front-end businesses during the development process, resulting in many bugs being discovered at the end of the version, but it is difficult to discover these bugs during the development period. This results in a high cost to ensure the code quality of the cross-platform framework under the middle platform model.
[0035] Figure 1 FIG. 1 is a flow chart of an application debugging method according to an embodiment of the present disclosure. Figure 1 As shown, the application debugging method includes the following steps S11 to S12.
[0036] In step S11, data interception is performed on the communication path between the target application and the front-end code execution engine via the target application component, and the communication link data obtained from the interception process is recorded and stored as a recording product; wherein the target application component is represented in binary form.
[0037] The front-end code execution engine may be an engine for executing codes such as front-end code, such as a JavaScript engine.
[0038] The target application is the application to be debugged. The target application can be an application developed using a cross-platform framework or an application developed using other development frameworks and using binary imports of components.
[0039] Take the case where the code executed by the front-end code execution engine is the front-end code and the target application component is the rendering component. The rendering component is introduced into the target application in binary mode. During the operation of the target application, the target application will download the front-end code, for example, from the cloud, and then the target application will send the front-end code to the front-end code execution engine through the rendering component. After receiving the front-end code, the front-end code execution engine will start to execute the front-end code. During the execution process, if rendering is required, the front-end code execution engine will send the rendering logic to the rendering component for rendering. After the rendering component is rendered, the rendering result will be displayed through the front-end page of the target application. The front-end page refers to the application page displayed on the front end (such as the client, browser, etc.). This is actually a communication process between the target application and the front-end code execution engine via the target application component. The operation performed in step S11 is to intercept the communication link data on the communication path or communication link in the above communication process.
[0040] Figure 2 1 is a schematic diagram of data interception on a communication path between a target application and a front-end code execution engine via a target application component according to an embodiment of the present disclosure. Figure 2 As shown, at least one of the following data interceptions may be performed.
[0041] The first data interception is to intercept the initialization data on the communication path between the target application and the front-end code execution engine via the target application component.
[0042] The initialization data may include at least one of the following: data for initializing the front-end page of the target application (for example, data about the content that needs to be initially displayed on the front-end page); and data for configuring the target application component (for example, global variables, initialization variables, etc. of the target application component).
[0043] Initialization data is data sent from the target application to the front-end code execution engine in one direction.
[0044] The second type of data interception is to intercept event information on the communication path between the target application and the front-end code execution engine via the target application component.
[0045] The event information may be used to indicate an event executed on the front-end page of the target application, such as a click event, a slide event, and the like.
[0046] The event information may be an event sent in a unidirectional direction from the target application to the front-end code execution engine.
[0047] The third type of data interception is to intercept data request information on the communication path between the target application and the front-end code execution engine via the target application component, and to intercept return data information for data request information on the communication path between the target application and the front-end code execution engine via the target application component.
[0048] The third type of data interception intercepts the two-way data acquisition and transmission between the target application and the front-end code execution engine (such as the acquisition and transmission of page view data). For example, the front-end code execution engine sends a data request to the target application, and the target application returns the return data for the data request to the front-end code execution engine.
[0049] Figure 3 It is a schematic diagram of intercepting communication link data between a target application and a front-end code execution engine according to an embodiment of the present disclosure. Figure 3 In the figure, the black dots on each communication link indicate that the communication link data on the communication link is intercepted. After intercepting the communication link data, the target application can be abandoned and the playback application (that is, the application that simulates the communication process between the target application and the front-end code execution engine) can be used to independently communicate with the front-end code execution engine, thereby realizing the debugging of the target application.
[0050] In some embodiments, the communication link data obtained by the interception process can be compressed and encoded to obtain a recording product, and the recording product can be uploaded to a content delivery network (CDN) for persistent storage. Moreover, the communication link data obtained by the interception process can be first stored in a preset format, and then the stored data can be compressed and encoded to obtain a recording product. For example, the communication link data obtained by the interception process can be stored in JSON format, and then the stored data in JSON format can be compressed and encoded to obtain a recording product.
[0051] Figure 4 FIG. 1 is a schematic diagram of storing and compressing communication link data obtained through interception processing according to an embodiment of the present disclosure. Figure 4As shown, the initialization data obtained by the interception process is stored in the initialization data field in the JSON file, the event information data obtained by the interception process is stored in the event information record field in the JSON file, the data request obtained by the interception process is stored in the data request record field in the JSON file, and the return data obtained by the interception process is stored in the return data record field in the JSON file. The JSON file storing the communication link data obtained by the interception process can be compressed and encoded, and then uploaded to the CDN for persistent storage. By performing compression encoding, the excessive volume of the intercepted communication link data in the case of complex front-end pages can be greatly reduced, the disk occupancy can be greatly reduced, and the data network transmission is ensured to be undistorted; by uploading the communication link data obtained by the interception process to the CDN for persistent storage, developers can download the communication link data obtained by the interception process from the CDN anytime and anywhere for subsequent debugging.
[0052] In step S12, the recording product is obtained and parsed to obtain the communication link data, and based on the communication link data, the communication process of the target application is reproduced in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0053] In some embodiments, if the communication link data obtained by the interception process is stored in JSON format, the communication link data obtained by the interception process is parsed by JSON. By parsing the communication link data obtained by the interception process, decoding and decompression can be achieved, thereby restoring the original, intercepted communication link data, and the intercepted communication link data can also be pre-processed, including, for example, data type conversion, playback order arrangement of each communication link data during debugging, clustering, etc.
[0054] In some embodiments, based on the communication link data, reproducing the communication process of the target application in a simulation environment can be achieved in the following manner. First, determine the data type of the communication link data obtained by parsing. For example, the data type can be determined by the function name in the communication link data. If the data type of the communication link data obtained by parsing is initialization data, the initialization data is sent from the playback application to the front-end code execution engine via the playback application component, and the front-end code execution engine executes the initialization data to initialize the front-end page of the playback application through the playback application component. In this way, the effect of debugging the target application based on the initialization data is achieved, and since the target application component is represented in the form of source code, the effect of quickly debugging the target application using the source code is also achieved.
[0055] In some embodiments, based on the communication link data, reproducing the communication process of the target application in a simulation environment can also be achieved in the following manner. First, determine the data type of the communication link data obtained by parsing, for example, the data type can be determined by the function name in the communication link data. Then, if the data type of the communication link data obtained by parsing is event information, the event information is sent from the playback application to the front-end code execution engine via the playback application component, wherein the event information is used to indicate an event executed on the front-end page of the target application. In this way, the effect of debugging the target application based on event information is achieved, and since the target application component is represented in the form of source code, the effect of quickly debugging the target application using source code is also achieved.
[0056] In some embodiments, the communication process of the target application program can be reproduced in a simulation environment based on the communication link data, which can also be achieved in the following manner. First, determine the data type of the communication link data obtained by parsing, for example, the data type can be determined by the function name in the communication link data. Then, if the data type of the communication link data obtained by parsing is a data request, the data request is sent from the front-end code execution engine to the playback application component; the return data matching the data request is searched from the parsed communication link data, that is, since each data request will have corresponding return data when intercepted, the return data matching the data request can be obtained by searching the return data corresponding to the data request from the parsed communication link data; and the return data is returned to the front-end code execution engine. That is, for data request and return data, since it is the behavior initiated by the front-end code execution engine first, the playback application cannot directly return data, but stores the data request and return data in the data storage service, and when receiving the data request sent by the front-end code execution engine, it searches for the corresponding return data in the data storage service and returns it. In this way, the effect of debugging the target application based on data request and return data is achieved. Moreover, since the target application component is represented in the form of source code, the effect of quickly debugging the target application using the source code is also achieved.
[0057] Through the above-mentioned communication methods, the front-end page is reproduced in the playback application, and the debugging function of the target application is realized. Figure 5 Shown in.
[0058] By adopting the above technical solution, since data can be intercepted on the communication path between the target application and the front-end code execution engine via the target application component, the communication link data obtained by the interception process is recorded and stored as a recording product, wherein the target application component is represented in binary form, and then the recording product is obtained and parsed to obtain the communication link data, and based on the communication link data, the communication process of the target application is reproduced in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via the playback application component, and the playback application component is represented in the form of source code corresponding to the target application component. In this way, the effect of debugging the target application using the source code is achieved, so that developers (for example, SDK developers directly facing cross-platform framework development) can replay the front-end page in the playback application anytime and anywhere, and finally reproduce the front-end page in the target application (that is, the application to be debugged) losslessly. For cross-end business scenarios involving hundreds of different components, through the methods disclosed in this disclosure, it is possible to quickly copy related business scenarios and replay the copied business scenarios in a playback application, in which developers can use source code for debugging. For the middle-office model, through the methods disclosed in this disclosure, numerous front-end pages can be copied and automated playback tests can be performed in the middle-office code testing system, so that problems with the code can be found in a timely manner during development. Therefore, in terms of bug resolution, this disclosure can greatly improve the efficiency of business problem troubleshooting; in terms of improving code quality, this disclosure can troubleshoot many problems that cannot be discovered by ordinary tests in daily development.
[0059] Figure 6 FIG. 1 is a schematic block diagram of an application debugging device according to an embodiment of the present disclosure. Figure 6 As shown, the application debugging device includes an interception module 61 and a debugging module 62.
[0060] The interception module 61 is used to intercept data on the communication path between the target application and the front-end code execution engine via the target application component, and record the communication link data obtained from the interception process and store it as a recording product; wherein the target application component is represented in binary form.
[0061] The debugging module 62 is used to obtain the recording product and parse the communication link data, and reproduce the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0062] By adopting the above technical solution, since data can be intercepted on the communication path between the target application and the front-end code execution engine via the target application component, the communication link data obtained by the interception process is recorded and stored as a recording product, wherein the target application component is represented in binary form, and then the recording product is obtained and parsed to obtain the communication link data, and based on the communication link data, the communication process of the target application is reproduced in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via the playback application component, and the playback application component is represented in the form of source code corresponding to the target application component. In this way, the effect of debugging the target application using the source code is achieved, so that developers (for example, SDK developers directly facing cross-platform framework development) can replay the front-end page in the playback application anytime and anywhere, and finally reproduce the front-end page in the target application (that is, the application to be debugged) losslessly. For cross-end business scenarios involving hundreds of different components, through the methods disclosed in this disclosure, it is possible to quickly copy related business scenarios and replay the copied business scenarios in a playback application, in which developers can use source code for debugging. For the middle-office model, through the methods disclosed in this disclosure, numerous front-end pages can be copied and automated playback tests can be performed in the middle-office code testing system, so that problems with the code can be found in a timely manner during development. Therefore, in terms of bug resolution, this disclosure can greatly improve the efficiency of business problem troubleshooting; in terms of improving code quality, this disclosure can troubleshoot many problems that cannot be discovered by ordinary tests in daily development.
[0063] Optionally, the interception module 61 intercepts data on the communication path between the target application and the front-end code execution engine via the target application component, including at least one of the following:
[0064] Intercepting initialization data on a communication path between the target application and the front-end code execution engine via the target application component, the initialization data comprising at least one of the following: data for initializing a front-end page of the target application, and data for configuring the target application component;
[0065] Intercepting event information on a communication path between the target application and the front-end code execution engine via the target application component, wherein the event information is used to indicate an event executed on a front-end page of the target application;
[0066] Intercepting data request information on a communication path between the target application and the front-end code execution engine via the target application component;
[0067] On a communication path between the target application and the front-end code execution engine via the target application component, return data information for data request information is intercepted.
[0068] Optionally, the interception module 61 records the communication link data obtained from the interception process as a recording product for storage, including: compressing and encoding the communication link data obtained from the interception process to obtain the recording product; uploading the recording product to a content distribution network for persistent storage.
[0069] Optionally, the interception module 61 compresses and encodes the communication link data obtained by the interception process to obtain the recording product, including: storing the communication link data obtained by the interception process in a preset format; and compressing and encoding the stored data to obtain the recording product.
[0070] Optionally, the debugging module 62 reproduces the communication process of the target application in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is initialization data, sending the initialization data from the playback application to the front-end code execution engine via the playback application component, and the front-end code execution engine executes the initialization data to initialize the front-end page of the playback application through the playback application component.
[0071] Optionally, the debugging module 62 reproduces the communication process of the target application in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is event information, then sending the event information from the playback application to the front-end code execution engine via the playback application component, wherein the event information is used to indicate an event executed on the front-end page of the target application.
[0072] Optionally, the debugging module 62 reproduces the communication process of the target application in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is a data request, sending the data request from the front-end code execution engine to the playback application component; searching for return data that matches the data request from the parsed communication link data; and returning the return data to the front-end code execution engine.
[0073] The specific implementation methods of the operations performed by each module in the application debugging device described in the present disclosure have been described in detail in the relevant methods and will not be repeated here.
[0074] The present disclosure also provides a computer-readable medium having a computer program stored thereon, which implements the steps of any method in the present disclosure when the program is executed by a processing device.
[0075] The present disclosure also provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any method in the present disclosure.
[0076] Reference below Figure 7 , which shows an electronic device (eg, Figure 1 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0077] like Figure 7As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0078] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0079] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0080] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0081] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0082] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0083] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: intercepts data on the communication path between the target application and the front-end code execution engine via the target application component, and records the communication link data obtained from the interception process as a recording product for storage; wherein the target application component is represented in binary form; obtains the recording product and parses it to obtain the communication link data, and based on the communication link data, reproduces the communication process of the target application in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via the playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0084] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0085] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0086] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the interception module may also be described as "a module for intercepting data on the communication path between the target application and the front-end code execution engine via the target application component".
[0087] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0088] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0089] According to one or more embodiments of the present disclosure, Example 1 provides an application debugging method, comprising: intercepting data on a communication path between a target application and a front-end code execution engine via a target application component, recording and storing communication link data obtained through the interception process as a recording product; wherein the target application component is represented in binary form; obtaining the recording product and parsing the communication link data, and reproducing the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0090] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the data interception on the communication path between the target application and the front-end code execution engine via the target application component includes at least one of the following:
[0091] Intercepting initialization data on a communication path between the target application and the front-end code execution engine via the target application component, the initialization data comprising at least one of the following: data for initializing a front-end page of the target application, and data for configuring the target application component;
[0092] Intercepting event information on a communication path between the target application and the front-end code execution engine via the target application component, wherein the event information is used to indicate an event executed on a front-end page of the target application;
[0093] Intercepting data request information on a communication path between the target application and the front-end code execution engine via the target application component;
[0094] On a communication path between the target application and the front-end code execution engine via the target application component, return data information for the data request information is intercepted.
[0095] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the recording of the communication link data obtained by the interception process is stored as a recording product, including: compressing and encoding the communication link data obtained by the interception process to obtain the recording product; compressing and encoding the communication link data obtained by the interception process to obtain the recording product; uploading the recording product to a content distribution network for persistent storage.
[0096] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein the communication link data obtained by the interception process is compressed and encoded to obtain the recording product, including: storing the communication link data obtained by the interception process in a preset format; and compressing and encoding the stored data to obtain the recording product.
[0097] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the communication process of the target application is reproduced in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is initialization data, sending the initialization data from the playback application to the front-end code execution engine via the playback application component, and the front-end code execution engine executes the initialization data to initialize the front-end page of the playback application through the playback application component.
[0098] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 1, wherein the communication process of the target application is reproduced in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is event information, sending the event information from the playback application via the playback application component to the front-end code execution engine, wherein the event information is used to indicate an event executed on the front-end page of the target application.
[0099] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 1, wherein the communication process of the target application is reproduced in a simulation environment based on the communication link data, including: determining the data type of the communication link data obtained by parsing; if the data type of the communication link data obtained by parsing is a data request, sending the data request from the front-end code execution engine to the playback application component; searching for return data that matches the data request from the parsed communication link data; and returning the return data to the front-end code execution engine.
[0100] According to one or more embodiments of the present disclosure, Example 8 provides an application debugging device, comprising: an interception module, used to intercept data on the communication path between the target application and the front-end code execution engine via the target application component, and record the communication link data obtained from the interception process as a recording product for storage; wherein the target application component is represented in binary form; a debugging module, used to obtain the recording product and parse the communication link data, and reproduce the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via the playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
[0101] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-7 when executed by a processing device.
[0102] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-7.
[0103] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0104] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0105] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A method for debugging an application program, It is characterized in that include: Intercepting data on a communication path between a target application and a front-end code execution engine via a target application component, and recording communication link data obtained from the interception process for storage as a recording product; wherein the target application component is represented in binary form; The recording product is obtained and parsed to obtain the communication link data, and based on the communication link data, the communication process of the target application is reproduced in a simulation environment, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
2. The method according to claim 1, It is characterized in that The data interception on the communication path between the target application and the front-end code execution engine via the target application component includes at least one of the following: Intercepting initialization data on a communication path between the target application and the front-end code execution engine via the target application component, the initialization data comprising at least one of the following: data for initializing a front-end page of the target application, and data for configuring the target application component; Intercepting event information on a communication path between the target application and the front-end code execution engine via the target application component, wherein the event information is used to indicate an event executed on a front-end page of the target application; Intercepting data request information on a communication path between the target application and the front-end code execution engine via the target application component; On a communication path between the target application and the front-end code execution engine via the target application component, return data information for the data request information is intercepted.
3. The method according to claim 1, It is characterized in that The recording of the communication link data obtained by the interception process is stored as a recording product, including: compressing and encoding the communication link data obtained by the interception process to obtain the recording product; The recording product is uploaded to a content distribution network for persistent storage.
4. The method according to claim 3, It is characterized in that The compressing and encoding the communication link data obtained by the interception process to obtain the recording product includes: The communication link data obtained by the interception process is stored in a preset format; The stored data is compressed and encoded to obtain the recording product.
5. The method according to claim 1, It is characterized in that The reproducing the communication process of the target application in a simulation environment based on the communication link data includes: Determine the data type of the communication link data obtained by parsing; If the data type of the communication link data obtained by parsing is initialization data, the initialization data is sent from the playback application to the front-end code execution engine via the playback application component, and the front-end code execution engine executes the initialization data to initialize the front-end page of the playback application through the playback application component.
6. The method according to claim 1, It is characterized in that The reproducing the communication process of the target application in a simulation environment based on the communication link data includes: Determine the data type of the communication link data obtained by parsing; If the data type of the communication link data obtained by parsing is event information, the event information is sent from the playback application to the front-end code execution engine via the playback application component, wherein the event information is used to indicate an event executed on the front-end page of the target application.
7. The method according to claim 1, It is characterized in that The reproducing the communication process of the target application in a simulation environment based on the communication link data includes: Determine the data type of the communication link data obtained by parsing; If the data type of the communication link data obtained by parsing is a data request, sending the data request from the front-end code execution engine to the playback application component; Searching for return data matching the data request from the communication link data obtained by parsing; The returned data is returned to the front-end code execution engine.
8. An application debugging device, It is characterized in that include: An interception module, used to intercept data on a communication path between a target application and a front-end code execution engine via a target application component, and record the communication link data obtained from the interception process and store it as a recording product; wherein the target application component is represented in binary form; A debugging module is used to obtain the recording product and parse the communication link data, and reproduce the communication process of the target application in a simulation environment based on the communication link data, wherein the simulation environment is an environment for simulating the communication process between the target application and the front-end code execution engine by communicating between the playback application and the front-end code execution engine via a playback application component, and the playback application component is represented in the form of source code corresponding to the target application component.
9. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device, It is characterized in that include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Offline debugging system and method, electronic equipment and storage medium
CN121935139A
