CN109582317B - Method and apparatus for debugging hosted applications - Google Patents

Method and apparatus for debugging hosted applications Download PDF

Info

Publication number
CN109582317B
CN109582317B CN201811454291.6A CN201811454291A CN109582317B CN 109582317 B CN109582317 B CN 109582317B CN 201811454291 A CN201811454291 A CN 201811454291A CN 109582317 B CN109582317 B CN 109582317B
Authority
CN
China
Prior art keywords
page
debugged
executed
process corresponding
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811454291.6A
Other languages
Chinese (zh)
Other versions
CN109582317A (en
Inventor
赵一瀚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to CN201811454291.6A priority Critical patent/CN109582317B/en
Publication of CN109582317A publication Critical patent/CN109582317A/en
Application granted granted Critical
Publication of CN109582317B publication Critical patent/CN109582317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a method and a device for debugging hosted applications. The hosted application comprises a master page and at least one slave page, and a specific implementation mode of the method comprises the following steps: responding to the detected user operation by the process corresponding to the page to be debugged, and forwarding operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in at least one slave page; the process corresponding to the main page responds to the received operation related data, determines a code to be executed and a corresponding target page identifier based on the received operation related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier through the main process; and responding to the received to-be-executed code forwarded by the main process by the process corresponding to the to-be-debugged page, and executing the to-be-executed code to re-render and present the to-be-debugged page. This embodiment expands the scope of debugging hosted applications.

Description

Method and apparatus for debugging hosted applications
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for debugging hosted applications.
Background
A hosted application (also called an applet) is an application that can be used in a hosted application without download and installation. Most of the current hosted applications include a Master page (also called Master page) and at least one Slave page (also called Slave page). Where the master page is used to store and process data and the slave page is used to render a page.
Developers often need to debug hosted applications during the development of the hosted applications. One of the debugging methods is to use a real machine for debugging, that is, to use real terminal devices (for example, terminal devices such as a mobile phone and a tablet personal computer) for debugging. In order to apply the hosted application to various machine models, the debugging mode needs to be debugged on equipment of various machine models, and the efficiency is low. In another way, the simulator in the browser (for example, the simulator in the chrome browser) is used for debugging, but the simulator in the browser cannot realize communication between the master page and the slave page, and the debugging range of the hosted application is limited.
Disclosure of Invention
The embodiment of the application provides a method and a device for debugging hosted applications.
In a first aspect, an embodiment of the present application provides a method for debugging a hosted application, where the method includes: responding to the detected user operation by the process corresponding to the page to be debugged, and forwarding operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in at least one slave page; the process corresponding to the main page responds to the received operation related data, determines a code to be executed and a corresponding target page identifier based on the received operation related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier through the main process; and responding to the received to-be-executed code forwarded by the main process by the process corresponding to the to-be-debugged page, and executing the to-be-executed code to re-render and present the to-be-debugged page.
In some embodiments, the method further comprises: determining a page loaded to the top of a page stack as a page to be debugged; the process corresponding to the main page analyzes the page to be debugged to obtain initial values of parameters related to the page to be debugged, and the obtained initial values of the parameters are forwarded to the process corresponding to the page to be debugged through the main process; and rendering and presenting the page to be debugged by the process corresponding to the page to be debugged according to the parameter initial value of the parameter in the page to be debugged received from the main process.
In some embodiments, the method further comprises: and in response to the detection of the slave page loading request, determining a page identifier corresponding to the slave page to be loaded, and pushing the slave page to be loaded and the corresponding page identifier to a page stack.
In some embodiments, the method further comprises: and in response to detecting the page exit request, popping the page at the top of the page stack and the corresponding page identifier out of the page stack.
In some embodiments, the operation-related data includes operation content data and a source page identification.
In a second aspect, an embodiment of the present application provides an apparatus for debugging a hosted application, where the apparatus includes: the operation related data forwarding unit is configured to respond to the detection of the user operation by a process corresponding to the page to be debugged, and forward operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in at least one slave page; the code forwarding unit to be executed is configured to respond to the received operation related data by the process corresponding to the main page, determine the code to be executed and the corresponding target page identifier based on the received operation related data, and forward the code to be executed to the process corresponding to the page indicated by the target page identifier through the main process; and the execution and rendering unit is configured to respond to the received to-be-executed code forwarded by the main process by the process corresponding to the to-be-debugged page, execute the to-be-executed code, and re-render and present the to-be-debugged page.
In some embodiments, the apparatus further comprises: the determining unit is configured to determine the page loaded to the top of the page stack as a page to be debugged; the initial value forwarding unit is configured to analyze the page to be debugged by the process corresponding to the main page, obtain the initial values of the parameters related to the page to be debugged, and forward the obtained initial values of the parameters to the process corresponding to the page to be debugged through the main process; and the page rendering unit is configured to render and present the page to be debugged according to the parameter initial value of the parameter in the page to be debugged, which is received from the main process, by the process corresponding to the page to be debugged.
In some embodiments, the apparatus further comprises: and the page loading unit is configured to determine a page identifier corresponding to the slave page to be loaded in response to detecting the slave page loading request, and push the slave page to be loaded and the corresponding page identifier to the page stack.
In some embodiments, the apparatus further comprises: and the page exit unit is configured to respond to the detection of the page exit request and pop the page at the top of the page stack and the corresponding page identification out of the page stack.
In some embodiments, the operation-related data includes operation content data and a source page identification.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, where the computer program, when executed by one or more processors, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for debugging the hosted application, communication between the master page and the slave page in the debugging hosted application is realized by using cross-process communication, so that the cross-process communication is effectively utilized, and the debugging range of debugging the hosted application is expanded.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for debugging a hosted application according to the present application;
FIG. 3 is a schematic diagram of one application scenario for a method for debugging hosted applications according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for debugging a hosted application according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for debugging hosted applications in accordance with the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the method for debugging a hosted application or the apparatus for debugging a hosted application of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as hosted application debugging applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for hosted application debugging class applications displayed on the terminal devices 101, 102, 103. The background server may analyze and perform other processing on data such as the hosted application debugging class request received from the terminal device, and feed back a processing result (e.g., a debugging result) to the terminal device.
It should be noted that the method for debugging the hosted application provided in the embodiment of the present application is generally performed by the server 105, and accordingly, the apparatus for debugging the hosted application is generally disposed in the server 105.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple software or software modules (e.g., to provide hosted application debugging services), or as a single software or software module. And is not particularly limited herein.
It should be noted that, in some cases, the method for debugging the hosted application provided by the embodiment of the present application may be performed by the server 105, and the above exemplary system architecture 100 may not include the terminal devices 101, 102, and 103. In some cases, the method for debugging hosted applications provided by the embodiments of the present application may also be performed by the terminal devices 101, 102, 103, and the exemplary system architecture 100 may not include the server 105. In other cases, the method for debugging hosted applications provided by the embodiment of the present application may also be performed by the server 105 and the terminal devices 101, 102, 103 together. This is not limited in this application.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to FIG. 2, a flow 200 of one embodiment of a method for debugging a hosted application in accordance with the present application is illustrated. The method for debugging the hosted application comprises the following steps:
step 201, in response to detecting the user operation, the process corresponding to the page to be debugged forwards the operation related data of the user operation to the process corresponding to the main page through the main process.
In this embodiment, the hosted application may include a master page and at least one slave page. The execution body of the method for debugging the hosted application (e.g., the server shown in fig. 1) may have installed therein a browser for displaying a web page. The host Process for debugging the hosted application may interact with the Process established for the opened page through Inter-Process Communication (IPC). In practice, the method for debugging the hosted application may be an application developed by using an Electron framework, and the debugging of the hosted application can be realized in the application.
In order to debug the hosted application, a main page of the hosted application may be opened in a browser background, and the executing entity may establish a process corresponding to the main page for the main page. Of course, the home page here is for storing and processing data and does not display the home page of the hosted application in the browser. Then, a page to be debugged may be determined among the at least one slave page. Then, in order to debug the page to be debugged, the page to be debugged may be opened in the browser, and it can be understood that the execution main body also establishes a corresponding process for the page to be debugged. Since the page to be debugged is already opened in the browser, a user (e.g., a development engineer) may debug the page to be debugged, and perform an operation corresponding to a function that is desired to be debugged with respect to the page to be debugged. For example, the operation made by the user may be a click, a slide, and so on. Therefore, the process corresponding to the page to be debugged can send the operation related data operated by the user to the main process first and then the main process forwards the operation related data to the process corresponding to the main page under the condition that the operation of the user aiming at the page to be debugged is detected.
Here, the operation-related data of the user operation may include, but is not limited to: the page element identification of the user operation, the operation type of the user operation (e.g., click, slide), the specific information content entered by the user (e.g., the text entered by the user in the text box, or the specific selection item selected by the user in the selection-type page element).
In step 202, in response to receiving the operation-related data, the process corresponding to the main page determines a code to be executed and a corresponding target page identifier based on the received operation-related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier via the main process.
In this embodiment, if the process corresponding to the main page receives the operation-related data sent by the main process, the process corresponding to the main page may determine, according to the code logic of the main page, the code to be executed and the corresponding target page identifier based on the received operation-related data, send the determined code to be executed and the corresponding target page identifier to the main process, and then send, by the main process, the received code to be executed to the process corresponding to the page indicated by the received target page identifier.
In some optional implementation manners of this embodiment, the operation related data sent by the process corresponding to the page to be debugged to the host process may be the operation content data and the source page identifier, where the source page identifier is the page identifier of the page to be debugged. In this way, the process corresponding to the main page may extract the page identifier in the operation-related data after receiving the operation-related data forwarded by the main process, and then may determine the code to be executed based on the other data of the received operation-related data and determine the extracted page identifier as the target page identifier by using the code logic related to the extracted page identifier in the code logic of the main page.
Step 203, the process corresponding to the page to be debugged responds to the received code to be executed forwarded by the main process, and executes the code to be executed to re-render and present the page to be debugged.
In this embodiment, a process corresponding to a page to be debugged in an execution subject of the method for debugging the hosted application may execute the received code to be executed to re-render and present the page to be debugged, when receiving the code to be executed forwarded by the host process. In this way, debugging of hosted applications in the execution body described above can be achieved without preparing for a live machine test.
It should be noted that, the execution body may also be prestored with applications for different models and different scaling ratios, so that the debugging engineer may select a corresponding application according to the model and the scaling ratio to be debugged, so as to debug the hosted application under the conditions of different models and different scaling ratios.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for debugging a hosted application according to the present embodiment. In the application scenario of fig. 3, a user 301 debugs a hosted application on a computer 302. First, a process 304 corresponding to the page to be debugged 303 detects a user operation, and forwards operation-related data 305 of the user operation to a process 308 corresponding to a main page 307 via a main process 306.
Then, the process 308 corresponding to the main page 307 receives the operation related data 305, determines the code to be executed 309 and the corresponding target page identifier based on the received operation related data 305, where the code to be executed is the page identifier of the page 303 to be debugged, and forwards the code to be executed to the process 304 corresponding to the page 303 indicated by the target page identifier through the main process 309.
Finally, the process 304 corresponding to the page to be debugged 304 receives the code to be executed 309 forwarded by the main process 306, and executes the code to be executed 309 to re-render and present the page to be debugged 303.
The method provided by the above embodiment of the present application realizes the communication between the master page and the slave page in the debugging hosted application by using cross-process communication, thereby effectively utilizing the cross-process communication and expanding the debugging range for debugging the hosted application.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for debugging a hosted application is illustrated. The flow 400 of the method for debugging a hosted application includes the steps of:
step 401, determining the page loaded to the top of the page stack as the page to be debugged.
In this embodiment, a page stack may be stored in an execution body (for example, a server shown in fig. 1) of the method for debugging the hosted application, and the page stack is used for storing a page. And the page at the top of the page stack is the current display page. Since the hosted application includes a master page and at least one slave page, in order to debug the hosted application, a page at the top of the page stack may be first determined as a page to be debugged, that is, the page to be debugged is a page currently displayed by the browser.
Step 402, the process corresponding to the main page parses the page to be debugged to obtain the initial values of the parameters related to the page to be debugged, and forwards the obtained initial values of the parameters to the process corresponding to the page to be debugged through the main process.
In this embodiment, the main page in the execution main body is used for storing and processing data, and the process corresponding to the main page may analyze the determined page to be debugged to obtain initial values of parameters related to the page to be debugged, and present the obtained parameters and the initial values corresponding to the parameters to the main process, and forward the initial values to the process corresponding to the page to be debugged by the main process.
The parameters of the page to be debugged herein may include, but are not limited to, attribute values of each page element in the page to be debugged. For example, a page element may be a page background color, a page background picture, a font size, a font color, a font, a picture source, a web address to which the picture is linked, and so forth.
And step 403, rendering and presenting the page to be debugged by the process corresponding to the page to be debugged according to the parameter initial value of the parameter in the page to be debugged received from the main process.
In this embodiment, the process corresponding to the page to be debugged may render and present the page to be debugged according to the parameter initial value of the parameter in the page to be debugged received from the main process, when the parameter initial value of the parameter of the page to be debugged sent by the main process is received.
Step 404, in response to detecting the user operation, the process corresponding to the page to be debugged forwards the operation related data of the user operation to the process corresponding to the main page through the main process.
Step 405, in response to receiving the operation related data, the process corresponding to the main page determines a code to be executed and a corresponding target page identifier based on the received operation related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier via the main process.
Step 406, in response to receiving the to-be-executed code forwarded by the main process, the process corresponding to the page to be debugged executes the to-be-executed code to re-render and present the page to be debugged.
The specific operations of step 404, step 405, and step 406 in this embodiment are substantially the same as the operations of step 201, step 202, and step 203 in the embodiment shown in fig. 2, and are not described again here.
Step 407, in response to detecting the slave page loading request, determining a page identifier corresponding to the slave page to be loaded, and pushing the slave page to be loaded and the corresponding page identifier into a page stack.
In this embodiment, the executing body may, when detecting a slave page loading request, first determine a page identifier corresponding to a slave page to be loaded, and then push the slave page to be loaded and the corresponding page identifier into a page stack, so that the slave page to be loaded is called a page stack top page, and then the browser displays the slave page to be loaded.
Here, various implementations may be employed to determine the page identifier corresponding to the slave page to be loaded. For example, the number of pages in the page stack may be first obtained, and then the page identifier corresponding to the slave page to be loaded is determined as the obtained number plus 1. That is, the page identification of each page in the page stack is that the page is the fourth element in the page stack.
Step 408, in response to detecting the page exit request, popping the page at the top of the page stack and the corresponding page identifier out of the page stack.
In this embodiment, the execution body may be configured to, when a page exit request is detected, directly pop up a page at the top of the page stack and a corresponding page identifier from the page stack because the page displayed by the current browser is a page at the top of the page stack, and then pop up a page located below the top of the page stack before the page stack is called a page at the top of the page stack after the page stack is popped up, so that the browser may display the page at the top of the page stack after the page stack is popped up.
Storing the page and displaying the debugging page according to the page stack mode can realize the first-in last-out and last-in first-out of the opened page, and is the interactive experience which accords with the intuition of people.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for debugging a hosted application in the present embodiment has more steps of using stack-structured memory pages. Therefore, the scheme described in the embodiment can achieve intuitive interactive experience of people in the debugging process of the hosted application.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for debugging hosted applications, which corresponds to the method embodiment shown in fig. 2, and which can be applied in various electronic devices in particular.
As shown in fig. 5, the apparatus 500 for debugging hosted applications of the present embodiment includes: an operation-related data forwarding unit 501, a to-be-executed code forwarding unit 502, and an execution and rendering unit 503. The operation-related data forwarding unit 501 is configured to, in response to detecting a user operation, forward, by a process corresponding to a page to be debugged, operation-related data of the user operation to a process corresponding to the master page through a master process, where the page to be debugged is a page in the at least one slave page; a to-be-executed code forwarding unit 502 configured to, in response to receiving operation-related data, determine, based on the received operation-related data, a to-be-executed code and a corresponding target page identifier, and forward the to-be-executed code to a process corresponding to a page indicated by the target page identifier via the main process; the execution and rendering unit 503 is configured to respond to the received to-be-executed code forwarded by the main process by a process corresponding to the to-be-debugged page, execute the to-be-executed code, and re-render and present the to-be-debugged page.
In this embodiment, specific processes of the operation-related data forwarding unit 501, the code forwarding unit 502 to be executed, and the execution and rendering unit 503 of the apparatus 500 for debugging a hosted application, and technical effects brought thereby may respectively refer to the relevant descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, and are not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: a determining unit (not shown in the figure), configured to determine the page loaded to the top of the page stack as the page to be debugged; an initial value forwarding unit (not shown in the figure), configured to analyze the page to be debugged by the process corresponding to the main page, obtain initial values of parameters related to the page to be debugged, and forward the obtained initial values of the parameters to the process corresponding to the page to be debugged through the main process; and a page rendering unit (not shown in the figure) configured to render and present the page to be debugged according to the parameter initial value of the parameter in the page to be debugged, which is received from the host process, by the process corresponding to the page to be debugged.
In some optional implementations of this embodiment, the apparatus further includes: and the page loading unit (not shown in the figure) is configured to determine a page identifier corresponding to the slave page to be loaded in response to detecting the slave page loading request, and push the slave page to be loaded and the corresponding page identifier to the page stack.
In some optional implementations of this embodiment, the apparatus further includes: and a page exit unit (not shown in the figure) configured to, in response to detecting a page exit request, pop the page at the top of the page stack and the corresponding page identifier out of the page stack.
In some optional implementations of this embodiment, the operation-related data includes operation content data and a source page identifier.
It should be noted that, for details of implementation and technical effects of each unit in the apparatus for debugging a hosted application provided in the embodiment of the present application, reference may be made to descriptions of other embodiments in the present application, and details are not described herein again.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)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 section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An Input/Output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an operation-related data forwarding unit, a code forwarding unit to be executed, and an execution and rendering unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the execution and rendering unit may also be described as a "unit that executes code to be executed to re-render and render a page to be debugged".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: responding to the detected user operation by the process corresponding to the page to be debugged, and forwarding operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in at least one slave page; the process corresponding to the main page responds to the received operation related data, determines a code to be executed and a corresponding target page identifier based on the received operation related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier through the main process; and responding to the received to-be-executed code forwarded by the main process by the process corresponding to the to-be-debugged page, and executing the to-be-executed code to re-render and present the to-be-debugged page.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for debugging a hosted application, wherein the hosted application includes a master page and at least one slave page, comprising:
responding to the detected user operation by the process corresponding to the page to be debugged, and forwarding operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in the at least one slave page;
the process corresponding to the main page responds to the received operation related data, determines a code to be executed and a corresponding target page identifier based on the received operation related data, and forwards the code to be executed to the process corresponding to the page indicated by the target page identifier through the main process, wherein the corresponding target page identifier comprises the page identifier of the page to be debugged;
and the process corresponding to the page to be debugged responds to the received code to be executed forwarded by the main process, and executes the code to be executed so as to re-render and present the page to be debugged.
2. The method of claim 1, wherein the method further comprises:
determining a page loaded to the top of a page stack as the page to be debugged;
the process corresponding to the main page analyzes the page to be debugged to obtain initial values of parameters related to the page to be debugged, and the obtained initial values of the parameters are forwarded to the process corresponding to the page to be debugged through the main process;
and rendering and presenting the page to be debugged by the process corresponding to the page to be debugged according to the parameter initial value of the parameter in the page to be debugged received from the main process.
3. The method of claim 2, wherein the method further comprises:
and responding to the detected slave page loading request, determining a page identifier corresponding to the slave page to be loaded, and pushing the slave page to be loaded and the corresponding page identifier into the page stack.
4. The method of claim 3, wherein the method further comprises:
and responding to the detected page exit request, and popping the page at the top of the page stack and the corresponding page identification out of the page stack.
5. The method of claim 4, wherein the operation-related data includes operation content data and a source page identification.
6. An apparatus for debugging a hosted application, wherein the hosted application includes a master page and at least one slave page, comprising:
the operation related data forwarding unit is configured to respond to the detection of the user operation by a process corresponding to the page to be debugged, and forward operation related data of the user operation to the process corresponding to the master page through the master process, wherein the page to be debugged is a page in the at least one slave page;
a to-be-executed code forwarding unit configured to, in response to receiving operation-related data, determine, based on the received operation-related data, a to-be-executed code and a corresponding target page identifier, and forward the to-be-executed code to a process corresponding to a page indicated by the target page identifier via the main process, where the corresponding target page identifier includes a page identifier of the to-be-debugged page;
and the execution and rendering unit is configured to respond to the received to-be-executed code forwarded by the main process by a process corresponding to the to-be-debugged page, execute the to-be-executed code, and re-render and present the to-be-debugged page.
7. The apparatus of claim 6, wherein the apparatus further comprises:
a determining unit configured to determine a page loaded to the top of a page stack as the page to be debugged;
the initial value forwarding unit is configured to analyze the page to be debugged by the process corresponding to the main page, obtain initial values of parameters related to the page to be debugged, and forward the obtained initial values of the parameters to the process corresponding to the page to be debugged through the main process;
and the page rendering unit is configured to render and present the page to be debugged according to the parameter initial value of the parameter in the page to be debugged, which is received from the main process, by the process corresponding to the page to be debugged.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the page loading unit is configured to respond to the detection of the slave page loading request, determine a page identifier corresponding to a slave page to be loaded, and push the slave page to be loaded and the corresponding page identifier to the page stack.
9. The apparatus of claim 8, wherein the apparatus further comprises:
a page exit unit configured to pop up a page at the top of the page stack and a corresponding page identifier out of the page stack in response to detecting a page exit request.
10. The apparatus of claim 9, wherein the operation-related data comprises operation content data and a source page identification.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN201811454291.6A 2018-11-30 2018-11-30 Method and apparatus for debugging hosted applications Active CN109582317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811454291.6A CN109582317B (en) 2018-11-30 2018-11-30 Method and apparatus for debugging hosted applications

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811454291.6A CN109582317B (en) 2018-11-30 2018-11-30 Method and apparatus for debugging hosted applications

Publications (2)

Publication Number Publication Date
CN109582317A CN109582317A (en) 2019-04-05
CN109582317B true CN109582317B (en) 2022-02-08

Family

ID=65925855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811454291.6A Active CN109582317B (en) 2018-11-30 2018-11-30 Method and apparatus for debugging hosted applications

Country Status (1)

Country Link
CN (1) CN109582317B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058857B (en) * 2019-04-28 2021-08-31 上海连尚网络科技有限公司 Boarded application generation method and apparatus
CN110471784B (en) * 2019-07-29 2023-03-14 创新先进技术有限公司 Play terminal exception handling method and device based on Electron platform
CN113641580B (en) * 2021-08-11 2023-10-20 上海哔哩哔哩科技有限公司 Mixed mode mobile application debugging method and system
CN113760762B (en) * 2021-09-08 2024-03-08 贝壳找房(北京)科技有限公司 Method for simulating operating environment of applet, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508769A (en) * 2011-10-11 2012-06-20 北京锐安科技有限公司 Debugged program debugging method based on core-implanted debugger
CN103019734A (en) * 2012-12-25 2013-04-03 北京奇虎科技有限公司 Activity object implementation method, system and browser
CN103530233A (en) * 2013-10-31 2014-01-22 广州菁英信息技术有限公司 Automation testing method, testing server and system of mobile browser
CN104461559A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method for communication between browser and mobile terminal and browser device
US10089654B1 (en) * 2015-09-24 2018-10-02 Amazon Technologies, Inc. Detecting expired content within slots in a user interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508769A (en) * 2011-10-11 2012-06-20 北京锐安科技有限公司 Debugged program debugging method based on core-implanted debugger
CN103019734A (en) * 2012-12-25 2013-04-03 北京奇虎科技有限公司 Activity object implementation method, system and browser
CN103530233A (en) * 2013-10-31 2014-01-22 广州菁英信息技术有限公司 Automation testing method, testing server and system of mobile browser
CN104461559A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method for communication between browser and mobile terminal and browser device
US10089654B1 (en) * 2015-09-24 2018-10-02 Amazon Technologies, Inc. Detecting expired content within slots in a user interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
文伟全.Android自动化测试和流量控制整合应用.《 中国优秀硕士论文电子期刊网(电子期刊)》.2014, *

Also Published As

Publication number Publication date
CN109582317A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109582317B (en) Method and apparatus for debugging hosted applications
CN110708346B (en) Information processing system and method
CN109558323B (en) System, method and apparatus for debugging pages
CN105335132B (en) Method, device and system for customizing application program function
CN106874519B (en) Page display method and device
US10439967B2 (en) Attachment reply handling in networked messaging systems
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
CN109684188B (en) Test method and device
CN105975393B (en) Page display detection method and system
CN113031946B (en) Method and device for rendering page component
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
WO2023040443A1 (en) Method and device for drawing canvas
US10951486B2 (en) Terminal device, UI expansion method, and UI expansion program
CN110795649A (en) Target page display method, device and system and electronic equipment
CN114064172A (en) Data rendering method and device
CN109582580B (en) System, method and apparatus for debugging pages
US11438403B2 (en) Page presentation method and system, computer system, and computer readable medium
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN113553123B (en) Data processing method, device, electronic equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112947918A (en) Data display method and device
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN108459890B (en) Interface display method and device for application
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant