CN110032519B - Cloud function debugging method and device, computer equipment and storage medium - Google Patents
Cloud function debugging method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110032519B CN110032519B CN201910325680.7A CN201910325680A CN110032519B CN 110032519 B CN110032519 B CN 110032519B CN 201910325680 A CN201910325680 A CN 201910325680A CN 110032519 B CN110032519 B CN 110032519B
- Authority
- CN
- China
- Prior art keywords
- local
- cloud function
- debugging
- cloud
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a cloud function debugging method, a cloud function debugging device, computer equipment and a storage medium, wherein the method comprises the following steps: in a developer tool, receiving local debugging instructions for cloud functions created to the local; simulating a cloud function execution environment locally by the developer tool in response to the local debugging instructions; loading the local code of the cloud function in the cloud function operating environment; executing the code locally when a call request for the cloud function is acquired; and debugging the code of the cloud function according to an execution result. The scheme of this application can improve debugging efficiency.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a cloud function debugging method and apparatus, a computer device, and a storage medium.
Background
With the rapid development of scientific technology, various technologies come into play, and the cloud technology is one of the technologies with wide application. For example, cloud technology may be applied to a sub-application such that cloud capabilities are used in the sub-application. In order to realize the cloud capability provided by the cloud technology, the cloud function needs to be developed. The debugging of the cloud function is necessary to ensure the normal operation of the cloud function.
In the traditional method, after a developer writes a cloud function code, the developer needs to upload and deploy the cloud function code to a cloud end to test. Therefore, each time a code is changed, the code must wait for uploading and deployment before test verification, and the whole debugging process is relatively long, so that the debugging efficiency is relatively low.
Disclosure of Invention
Therefore, it is necessary to provide a cloud function debugging method and apparatus, a computer device, and a storage medium, for solving the problem of relatively low debugging efficiency of the conventional method.
A method of cloud function debugging, the method comprising:
in a developer tool, receiving local debugging instructions for cloud functions created to the local;
simulating a cloud function execution environment locally by the developer tool in response to the local debugging instructions;
loading the code of the cloud function in the local in the cloud function running environment;
executing the code locally when a call request for the cloud function is acquired;
and debugging the code of the cloud function according to an execution result.
A cloud function debugging apparatus, the apparatus comprising:
the debugging trigger module is used for receiving a local debugging instruction aiming at the cloud function established to the local in a developer tool;
The operating environment simulation module is used for responding to the local debugging instruction and locally simulating a cloud function operating environment through the developer tool;
the loading module is used for loading the local code of the cloud function in the cloud function running environment;
the debugging module is used for executing the local codes when a call request aiming at the cloud function is acquired; and debugging the code of the cloud function according to an execution result.
A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
in a developer tool, receiving local debugging instructions for cloud functions created to the local;
simulating a cloud function execution environment locally by the developer tool in response to the local debugging instructions;
loading the code of the cloud function in the local in the cloud function running environment;
executing the code locally when a call request for the cloud function is acquired;
and debugging the code of the cloud function according to an execution result.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of:
In a developer tool, receiving local debugging instructions for cloud functions created to the local;
simulating a cloud function execution environment locally by the developer tool in response to the local debugging instructions;
loading the code of the cloud function in the local in the cloud function running environment;
executing the code locally when a call request for the cloud function is acquired;
and debugging the code of the cloud function according to an execution result.
According to the cloud function debugging method, the cloud function debugging device, the computer equipment and the storage medium, local debugging of the cloud function established in the local can be initiated in the developer tool, and the cloud function running environment can be simulated in the local through the developer tool; and loading the code of the cloud function in the local area in the cloud function running environment. In this way, if a call request for the cloud function is received subsequently, the loaded local code can be directly called and executed without calling the cloud terminal, so that local debugging of the cloud function is realized. Because the cloud function is debugged locally, the complicated deployment at the cloud end is omitted, and the debugging efficiency of the cloud function is improved.
Drawings
FIG. 1 is a diagram illustrating an application scenario of a cloud function debugging method in an embodiment;
FIG. 2 is a flowchart illustrating a cloud function debugging method according to an embodiment;
FIG. 3 is a diagram of a local debug panel in one embodiment;
FIG. 4 is a schematic diagram of an interface for a local debug trigger portal in one embodiment;
FIG. 5 is an architecture diagram of a cloud function debugging method in one embodiment;
FIG. 6 is a block diagram of a cloud function debugging apparatus in one embodiment;
FIG. 7 is a block diagram of a cloud function debugging apparatus in another embodiment;
FIG. 8 is a block diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram illustrating an application scenario of a cloud function debugging method in an embodiment. Referring to fig. 1, the application scenario includes a terminal 110 and a cloud server 120. The terminal 110 may be a smart television, a smart speaker, a desktop computer, or a mobile terminal, and the mobile terminal may include at least one of a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, a wearable device, and the like.
The terminal 110 may run a developer tool and receive, in the developer tool, a local debugging instruction for the cloud function created to the local. The terminal 110 may locally simulate a cloud function execution environment through the developer tool in response to the local debugging instruction. The terminal 110 may load the local code of the cloud function in the cloud function operating environment; executing the code locally when a call request for the cloud function is acquired; and debugging the code of the cloud function according to an execution result. It can be understood that after the terminal 110 debugs the code of the cloud function according to the cloud function debugging method in the embodiment of the present application, the test work on the cloud function is completed, and then the terminal 110 may upload and deploy the debugged code of the cloud function to the cloud server 120 for use, for example, for a sub application to call.
Fig. 2 is a flowchart illustrating a cloud function debugging method in an embodiment. In this embodiment, an example is mainly given in which the cloud function debugging method is applied to a computer device, and the computer device may be the terminal 110 in fig. 1. Referring to fig. 2, the method specifically includes the following steps:
S202, in the developer tool, a local debugging instruction for the cloud function created to the local is received.
Among them, the developer tool (IDE) is a type of application software that assists in developing computer programs. It is understood that the developer tool runs in a computer device.
In one embodiment, the developer tool may be a child application developer tool. The sub-application developer tool is a developer tool for developing and debugging the sub-application. It should be noted that the developer tool is not limited to the sub-application developer tool.
The child application is an application program that can be implemented in an environment provided by the parent application. The parent application is an application program bearing the child application and provides an environment for implementing the child application. The parent application is a native application. A native application is an application that can run directly on an operating system.
The cloud function is a code running in the cloud (namely a cloud server), does not need a management server, is compiled in a developer tool, and can run after being uploaded and deployed to the cloud.
It can be understood that when the developer tool is a sub-application developer tool, the cloud function debugged according to the method provided by the embodiments of the present application can be called by the sub-application after being deployed at the cloud end.
The cloud function created to the local refers to a cloud function created by local registration of the computer device. That is, for a cloud function created to the local, the code of the cloud function is registered in the local of the computer device. It can be understood that, for a cloud function that is not created to the local, the cloud function cannot be debugged locally, and only can be debugged through an online cloud.
And local debugging instructions for instructing to debug the cloud function locally.
Specifically, a debugger may perform a local debugging operation on a cloud function created to the local based on an interface of the developer tool, and the computer device may generate a local debugging instruction for the cloud function when detecting the local debugging operation acting on the interface.
It should be noted that the interface acted on by the local debugging operation may be a child window embedded in the developer tool, or may be an independent window.
It is to be appreciated that the cloud function created to local can be at least one. When the created-to-home cloud function is multiple, the computer device may concurrently receive local debugging instructions for the multiple created-to-home cloud functions. That is, multiple cloud functions created to local may be debugged concurrently. The computer device may also receive only local debugging instructions for a single created-to-local cloud function. That is, only one cloud function created to local is debugged at a time. This is not limitative.
And S204, responding to the local debugging instruction, and simulating the cloud function operating environment locally through a developer tool.
The cloud function operating environment is an environment provided for the operation of the cloud function.
It can be understood that, in the conventional method, a cloud function running environment is provided in the cloud end to debug a cloud function. In the embodiment of the application, a developer tool running on the computer device is used for simulating the cloud function running environment locally on the computer device, so that the cloud function is debugged locally on the computer device.
Specifically, the computer device may initialize an operating environment of a cloud function through a developer tool, and then add a cloud function runtime environment variable to the initialized operating environment to generate a final cloud function operating environment. The environment variables during the operation of the cloud function refer to some environment parameters required by the operation of the cloud function.
And S206, loading the local code of the cloud function in the cloud function running environment.
When the cloud function is created locally to the computer device, the stored code of the cloud function is registered locally.
Specifically, the computer device may locally acquire the code of the cloud function that is targeted by the local debugging instruction and has been created to the local, and run the code that loads the cloud function in the local in the locally simulated cloud function running environment.
And S208, when the call request for the cloud function is acquired, executing the local code.
The call request for the cloud function is used for requesting to call the cloud function to execute the code of the cloud function.
It can be understood that, in the cloud function execution environment, after the code of the cloud function in the local area is loaded, if a call request for the cloud function is subsequently received, the computer device may directly call and execute the loaded code in the local area without calling to the cloud end.
It should be noted that the call request manner for the cloud function may include multiple manners.
In one embodiment, the call request for the cloud function may comprise a call request for the cloud function initiated by a cloud function debugger. The cloud function debugger is included in the developer tool and used for debugging and processing the codes of the cloud functions.
In one embodiment, when the developer tool is a child application developer tool, the call request for the cloud function may also include a call request for the cloud function triggered by a child application simulator. It should be noted that the call request for the cloud function may be generated in other manners, and is not limited to the two illustrated manners. For example, when the developer tool launches the local debug panel, a call request may also be initiated by the local debug panel for the cloud function. The local debugging panel is an interface used for receiving local debugging operation on the cloud function.
Wherein, the sub-application simulator is included in the sub-application developer tool. The child application simulator is used for simulating the real logic expression of the currently developed child application in the parent application, and can present the correct state on the child application simulator for most interfaces. It is understood that the sub-application simulator is equivalent to simulating the state that would be present in the parent application when the sub-application is normally running.
In one embodiment, upon initiating execution of code for which the cloud function is local, the computer device may output a start hint in the cloud function debugger. When detecting that the code of the cloud function in the local area is completely executed, the computer device may output an end prompt message in the cloud function debugger. It can be understood that after the code is executed and finished, the prompt information is output, so that debugging personnel can more quickly and accurately master the code execution progress, unnecessary time cost waste is avoided, and the efficiency of cloud function debugging is indirectly improved.
In one embodiment, the computer device may output user log information generated during execution of the code that is native. The generated user log information contains a certain amount of information, and the local debugging of the cloud function is assisted, so that the accuracy of the cloud function debugging is improved.
And S210, debugging the code of the cloud function according to the execution result.
The execution result is a result obtained by executing the local code of the cloud function.
In particular, the computer device may present the execution results. And the debugging personnel can judge whether the code of the cloud function needs to be debugged or not based on the displayed execution result. The computer device can display the cloud function debugger in a developer tool, and for the code of the cloud function needing debugging, a debugging person can input a corresponding debugging operation instruction in the cloud function debugger. The computer device can respond to the debugging operation instruction to carry out corresponding debugging processing on the code of the cloud function.
In one embodiment, the execution result may include at least one of a function execution time and function call information.
The time consumed for executing the function refers to the time consumed for executing the local code of the cloud function once. And function call information for describing information of other cloud functions called by the cloud function when the local code is executed. Other cloud functions include create-to-local cloud functions and cloud-to-cloud functions.
In one embodiment, the function call information may be presented in a graphical, textual, or teletext manner.
According to the cloud function debugging method, local debugging of the cloud function established in the local can be initiated in the developer tool, and the cloud function running environment is simulated in the local through the developer tool; and loading the code of the cloud function in the local area in the cloud function running environment. In this way, if a call request for the cloud function is received subsequently, the loaded local code can be directly called and executed without calling the cloud terminal, so that local debugging of the cloud function is realized. Because the cloud function is debugged locally, the complicated deployment at the cloud end is omitted, and the debugging efficiency of the cloud function is improved.
In addition, the debugging of the cloud function is one link in the whole development process, so that the debugging efficiency of the cloud function is improved, and meanwhile, the development efficiency is correspondingly improved.
In one embodiment, step S202 includes: in the developer tool, starting a local debugging panel; displaying an identification of a cloud function created to the local in a local debugging panel; and receiving a local debugging instruction aiming at the cloud function corresponding to the displayed identification through a local debugging panel.
The local debugging panel is an interface used for receiving local debugging operation on the cloud function. It is to be understood that the local debugging panel may be a sub-window embedded in the developer tool, or may be a separate window, which is not limited to this.
Specifically, the computer device may acquire, through the local debugging panel, an identifier of the cloud function created to the local, and display the acquired identifier of the cloud function in the local debugging panel. The debugging personnel can perform debugging related operation on the displayed identification based on the local debugging panel so as to trigger the computer equipment to generate a local debugging instruction for the cloud function corresponding to the displayed identification.
In one embodiment, a debugging person may select one or more target identifiers from the displayed identifiers, and perform debugging-related operations on the selected target identifiers to trigger the computer device to generate a local debugging instruction for the cloud function corresponding to the target identifier.
In one embodiment, the local debugging panel can comprise an identification display area of the cloud function created to the local. The identification display area is used for displaying the identification of the cloud function created to the local. It is to be understood that the set of identities of cloud functions created to local may be exposed in the identity exposure area.
In one embodiment, the identification of the cloud function includes a name of the cloud function. In other embodiments, the identification of the cloud function may also include a name and an additional label of the cloud function. The additional mark is an attached mark for adding the cloud function. It is to be appreciated that the additional indicia can include at least one of a cloud function identity indicia and a cloud function location indicia. And the cloud function identity mark is used for displaying and emphasizing the cloud function identity. The cloud function position mark is a position for showing the cloud function.
In one embodiment, the cloud function identity token may comprise a cloud icon. In one embodiment, the cloud function location tag may include a local tag and a cloud tag. And the local mark is used for indicating that the cloud function is created to the local. And the cloud end mark is used for indicating that the cloud function is created to the cloud end.
It can be understood that the same cloud function can be created to the local and the cloud. Therefore, the local mark and the cloud mark can be correspondingly displayed aiming at the mark of the cloud function. It should be noted that, since the identifier of the cloud function created to the local is displayed in the identifier display area, when the area includes the cloud function location mark, a local mark is correspondingly displayed for each displayed identifier of the cloud function, and only the identifier of the cloud function also created to the cloud end is correspondingly displayed with the cloud end mark.
In one embodiment, a cloud function display area may be further included in the local debugging panel.
The cloud function display area is used for displaying the local codes of the loaded cloud functions. And the call request control area is used for realizing the processing related to the call request of the cloud function.
In one embodiment, when a trigger operation for identifying the cloud function in the cloud function display area is received, the local code of the cloud function is correspondingly presented in the cloud function display area.
In one embodiment, when a single-click operation for identification of a cloud function is received, a temporary tab may be opened in the cloud function presentation area. When a double-click operation for the identification of the cloud function is received, a fixed tag may be opened in the cloud function presentation area. It can be understood that the temporary label means that the temporary label indicates that the cloud function is opened, and when the identifier of the cloud function does not belong to the selected state, the temporary label is not displayed, but a new label of the cloud function selected by clicking is displayed. The fixed label refers to a display in which a label of the cloud function can be fixed. It is understood that even if the identification of other cloud functions is selected, the label of the cloud function can still be displayed in the cloud function display area.
In one embodiment, the computer device may drag a Tab (Tab) over other tabs to change Tab ordering in response to a drag operation on the Tab of the cloud function. The computer device may also respond to dragging the tab out of the window to debug the cloud function in the form of a separate window. And when the label is dragged, screenshot comprising the label, the cloud function debugger and the local debugging panel can be displayed.
It can be understood that, in this case, when the label of the cloud function is opened again in the main window of the local debugging panel, the debugger and the request control panel are not displayed, and only the popped prompt and the operations of providing the show window and the retrieve window are displayed. Selecting a local debug for the cloud function in an editor automatically exposes a separate debug window for the cloud function.
In one embodiment, the local debug panel may be further configured to receive an instruction for call related processing of the cloud function, and the local debug panel may generate a call request for the cloud function according to the instruction. Specifically, a call request control area may be provided in the local debugging panel, and a debugging person may perform an operation related to a cloud function call in the call request control area to input an instruction of call-related processing for the cloud function. In one embodiment, the operation related to the cloud function call includes inputting a cloud function call request parameter.
It should be noted that the size of each area (e.g., the identifier exposure area, the cloud function exposure area, and the call request control area) included in the local debug panel may be scaled. When the computer device receives the zooming instruction, the corresponding zooming processing can be carried out on the area which is aimed by the zooming instruction, so as to change the size of the area. For example, when the call related processing of the cloud function is performed, the call request control area may be enlarged to obtain a larger space for operation.
In an embodiment, the local debugging panel may further include a switch for automatically reloading the hot load, and if the switch for automatically reloading the hot load is selected to be turned on, when the local file of the cloud function is changed, the local cloud function is reloaded automatically, so that a user can debug and code modification conveniently.
In one embodiment, the time limit for function execution may also be set in the local debug panel on a self-defined basis. When set to 0, this indicates infinite.
FIG. 3 is a diagram of a local debug panel, in one embodiment. Referring to fig. 3, 302 is an identifier display area, in which identifiers of cloud functions created to the local are displayed, for example, "aa" and "aatest" are names of cloud functions created to the local, respectively, and a cloud icon in front of "aa" is an additional mark for indicating that "aa" belongs to an identity of a cloud function. The cloud function "aa" corresponds to the local mark L and the cloud mark C, which indicates that the cloud function "aa" is created to the local and the cloud, 304 is a cloud function display area, and 306 is a call request control area.
In the embodiment, the local debugging panel started in the developer tool receives the local debugging instruction of the cloud function, so that the local debugging processing of the cloud function is realized, and the debugging efficiency is improved. In addition, the cloud function can be locally debugged and processed more intensively through the special local debugging panel, so that complicated switching operation is omitted, resource waste caused by switching of the system is avoided, and the debugging efficiency of the cloud function is further improved.
In one embodiment, said in the developer tool, launching the local debug panel comprises: in a developer tool, showing a local debugging trigger inlet aiming at a cloud function; and after the trigger instruction of the local debugging trigger inlet is obtained, starting a local debugging panel.
The local debugging trigger inlet is used for triggering and starting the local debugging panel.
It is to be appreciated that the computer device can expose the local debug trigger portal directly in the developer tool. The computer device may also expose the local debug trigger portal upon detecting a preset specified operation made against the developer tool.
Specifically, the debugging personnel may trigger the local debugging trigger entry, and the computer device may obtain the trigger instruction and start the local debugging panel in response to the trigger instruction.
In one embodiment, exposing, in the developer tool, a local debug trigger portal for cloud functions comprises: displaying a cloud function catalog in a developer tool; when a specified operation aiming at a total directory in the cloud function directories or a cloud function root directory in the cloud function directories is detected, a local debugging trigger entry aiming at a cloud function is displayed.
The cloud function catalog is catalog information of the cloud functions developed in the developer tool. It is understood that the cloud function directory includes a total directory and cloud function root directories. And the total directory is the highest-level directory in the cloud function directories. The cloud function root directory is a subordinate directory of the total directory.
Specifically, the computer device may obtain information of cloud functions developed in the developer tool, generate a cloud function catalog from the information of the developed cloud functions, and present the cloud functions in an editor in the developer tool. The debugging personnel can carry out specified operation on the cloud function directory, and when the specified operation is detected by the computer equipment, the local debugging triggering inlet aiming at the cloud function can be triggered and displayed. Wherein the editor, included in the developer tool, is for editing the code.
In one embodiment, the specified operation includes right clicking on the cloud function directory. It is understood that in other embodiments, the specifying operation may further include dragging or long-pressing the cloud function directory, and the like. This is not limitative.
In one embodiment, the computer device may, upon detecting the specified operation, trigger generation and presentation in the developer tool of a set of options including an option corresponding to the local debug trigger entry. When a trigger instruction for the option is received, the computer device may trigger a local debugging trigger entry corresponding to the option to start a local debugging panel.
In one embodiment, a debugger may perform a specified operation on a general directory in the cloud function directory, and the computer device may trigger presentation of a local debugging trigger entry for the cloud function when detecting the specified operation. In another embodiment, a commissioning person may perform a specified operation on a cloud function root directory in the cloud function directory, and the computer device may trigger to expose a local commissioning trigger entry for the cloud function when detecting the specified operation.
FIG. 4 is a diagram that illustrates an interface of a local debug trigger portal, in accordance with an embodiment. Referring to fig. 4, a developer tool is taken as an example of a sub application developer tool. The cloud function catalog 402 is presented in the editor of the developer tool, and right-clicking one of the cloud functions "miniprogam" triggers the generation of an option set, with the circular area 404 being an enlarged view of a portion of the options in the option set. As can be seen in the circular area 404, the option set includes a "local debug" option, which corresponds to a local debug trigger entry. The debug personnel can perform a trigger operation on the debug trigger entry, that is, the local debug panel shown in fig. 3 can be started.
In the embodiment, the local debugging trigger inlet for the cloud function is displayed in the developer tool to trigger the local debugging panel to debug the cloud function locally, that is, the debugging processing of the cloud function can be realized in the developer tool, and the debugging efficiency is improved. In addition, in a developer tool, a local debugging trigger inlet aiming at the cloud function is displayed, and the debugging efficiency is improved by quickly starting a local debugging panel.
In one embodiment, the method further comprises: starting a local debugging service program through a developer tool; initializing a local server according to a local debugging service program; and creating a local cloud function in the local server. In this embodiment, in the local debugging panel, displaying the identifier of the cloud function created to the local includes: and acquiring the identification of the created cloud function from the local server, and displaying the identification in the local debugging panel.
The local debugging service program is a program which is arranged in a developer tool and is used for carrying out local debugging processing on the cloud function.
Specifically, the computer device may launch a local debugging service via a developer tool, and a local server may be initialized locally to the computer device based on the local debugging service.
It will be appreciated that the developer tool may interact with the initialized local server. Specifically, the developer tool may initiate a request for creating a cloud function to the local debugging service program, and the local debugging service program may register and create the cloud function specified in the request for creating in the local server. That is, the local debugging service program may mount the code specifying the created cloud function into the local server to implement the creation of the cloud function in the local server.
In one embodiment, when receiving a request for creating a cloud function, the local debugging service program may check validity of the cloud function specified in the request for creating, and when the validity check is passed, register and create the cloud function in the local server.
It is to be appreciated that the local debug service can send the create results to the developer tool. After receiving the creation result of successful creation, the developer tool can execute the step of starting the local debugging panel in the developer tool. After the local debugging panel is started, the local debugging panel can be automatically connected with the local server, the identification of the cloud function created to the local is pulled from the local server, and the pulled identification of the cloud function is displayed in the local debugging panel.
In other embodiments, the step of starting the local debugging service program through the developer tool may also be executed after the local debugging panel is started in the developer tool, which is not limited to this.
It should be noted that the interaction between the developer tool and the initialized local server is not limited to the creation process of the cloud function. The developer tool may send a cloud function management request to the local debugging service program, the cloud function management request including a request to query or delete a cloud function in addition to a request to create the cloud function locally. The local debugging service program can perform corresponding management processing on the cloud function in the local server according to the cloud function management request.
In the embodiment, the local server is initialized through the local debugging service program to create the cloud function locally, and a prerequisite is provided for local debugging of the cloud function, so that local debugging processing can be realized for the cloud function created locally, and debugging efficiency is improved.
In an embodiment, the receiving, by the local debugging panel, a local debugging instruction for a cloud function corresponding to the exposed identifier includes: acquiring a target identifier selected from the displayed identifiers; displaying a local debugging switch corresponding to the target identification; and when the opening operation of the local debugging switch is detected, generating a local debugging instruction of the cloud function corresponding to the target identification.
The target identification is an identification of a cloud function to be debugged. And the local debugging switch is used for controlling whether to start local debugging processing aiming at the cloud function. And the local debugging switch corresponding to the target identifier is used for controlling whether to start local debugging processing on the cloud function of the corresponding target.
It is understood that the local debug switch includes two states, a local debug on state and a local debug off state. And the local debugging starting state is used for indicating that the local debugging processing of the cloud function is started. And the local debugging closing state is used for indicating that the local debugging processing of the cloud function is closed, namely the local debugging processing of the cloud function is not carried out.
Specifically, the debugger may select the target identifier from identifiers of cloud functions displayed in the local debugging panel. The computer device may obtain the selected target identification and expose a local debug switch corresponding to the target identification. The debugging personnel can start the local debugging switch, and when the computer equipment detects the start operation, the local debugging switch can be adjusted to a local debugging start state, and a local debugging instruction for the cloud function corresponding to the target identification is triggered and generated.
It is to be understood that the selected target identifications may be at least one.
In one embodiment, the local debug switch may be a check box (checkbox) for turning on local debug. It is understood that, when a selection operation for the check box is detected (which is equivalent to detecting an on operation for the local debugging switch), the computer device may trigger generation of a local debugging instruction for the cloud function corresponding to the target identifier. In other embodiments, the local debug switch may also be a slider bar or button that can toggle across. One end of the sliding bar or the button corresponds to a local debugging starting state, and the other end of the sliding bar or the button corresponds to a local debugging closing state.
To facilitate understanding of the local debug switch, an explanation will now be made in conjunction with fig. 3. Referring to the check box for "starting local debugging" in fig. 3, that is, the check box is a local debugging switch, and by checking the check box, the generation of the local debugging instruction for the cloud function corresponding to the target identifier may be triggered.
It should be noted that, in this embodiment, after the local debugging switch corresponding to one cloud function is turned on, a local debugging function is turned on for the cloud function created to the local, in this case, the code of the cloud function in the local is executed only when the call request for the cloud function is obtained, and if the local debugging function is not turned on, the call request for the cloud function calls the cloud function from the cloud end.
In one embodiment, after the local debugging instruction for the cloud function corresponding to the target identifier is generated, the cloud function entry file can be automatically opened in a debugger in the developer tool, so that a user can conveniently open the entry file to start breakpoint debugging. And the cloud function entry file is used for describing which text function needs to be opened. In a developer tool, the sidebar directory tree under the panel can be automatically opened to locate the entry file, so that a user can conveniently and quickly find the function-related file.
In one embodiment, after detecting an on operation for the local debug switch, the computer device may check whether there is an installation-dependent module and give a warning prompt when not.
In one embodiment, when the node.js path of a dependent module that needs to be installed is not set, the computer device may default to the node.js path in the system environment variable. Js path, which describes the location of dependent modules that need to be installed. The debugging personnel can input a display node path in the input box, and the corresponding node version number is displayed below the display node path. The computer device may monitor the path and node version number entered in the input box to monitor its legitimacy.
In the embodiment, whether the cloud function is debugged or not can be flexibly and accurately controlled through the local debugging switch, so that the accuracy of debugging control is improved.
In one embodiment, the method further comprises: displaying a request mode option set in the local debugging panel; when the selected option in the request mode option set is a manual trigger option, displaying a request parameter configuration area; acquiring the request parameters input in the request parameter configuration area; and generating a call request aiming at the cloud function according to the input request parameters.
The request mode option is a visual representation of the request mode. The request mode refers to a mode of triggering a call request for a cloud function. The request mode option set comprises at least one request mode option.
The request mode option set comprises a manual trigger option. And manual triggering refers to a mode of manually acting on the local debugging panel to trigger generation of a call request for the cloud function. And the request parameter configuration area is used for configuring request parameters of the call request for generating the cloud function.
Specifically, a debugger may input a request parameter in the request parameter configuration area, and the computer device obtains the input request parameter and generates a call request for the cloud function according to the request parameter.
It is understood that the request parameter configuration area is included in the call request control area. For ease of understanding, reference is now made to FIG. 3 for explanation. Referring to fig. 3, the call request control area 306 includes a request parameter configuration area. When the selected request mode option is the "manual trigger" option, the request parameters may be input in the request parameter configuration area. After the request parameter is input, a debugging person may click a "call" button to initiate a call request to the cloud function "openapi" through the local debugging panel.
In one embodiment, when the developer tool is a sub-application developer tool, the set of ask mode options may include a simulator trigger option in addition to a manual trigger option. And when the option selected from the request mode option set is a simulator trigger option, displaying a simulator operation prompt.
The simulator triggering option is used for indicating the triggering mode of the simulator. The simulator trigger refers to a mode of generating a call request for a cloud function through the sub-application simulator trigger. And the simulator operation prompt is used for prompting a debugging person to carry out trigger operation related to the call request for generating the cloud function on the simulator. It can be understood that when the selected option is the simulator trigger option, the requested parameter configuration area may not be displayed, but only the simulator operation prompt is displayed, or the display of the requested parameter configuration area may be retained.
In one embodiment, the local debug panel may check the validity of the entered request parameters. In one embodiment, a template saving entry is further provided in the local debugging panel, and when a trigger operation on the template saving entry is detected, the request parameter can be saved as a template for direct pull use later. It will be appreciated that the initial save may pop-up a hint that initializes the location where the template is saved.
In the embodiment, the request parameter configuration area is set, and the customized request parameters can be received, so that the cloud function can be more flexibly and more sufficiently called, and further, the accuracy of cloud function debugging can be improved according to sufficient and appropriate calling.
In one embodiment, the developer tool is a child application developer tool; the method further comprises the following steps:
displaying a set of simulation calling mode options in the local debugging panel; the set includes a sub-application invocation option. In this embodiment, the generating a call request for the cloud function according to the input request parameter includes: and when the selection operation aiming at the sub-application calling option is detected, generating a calling request of the sub-application aiming at the cloud function according to the input request parameter. In this embodiment, when obtaining the call request for the cloud function, the executing the local code includes: and acquiring the context content of the parent application of the child application by executing the local code.
The simulation calling mode refers to a mode of simulating and calling a cloud function. It is understood that the call mode is simulated and used for representing an object for calling the cloud function, namely, representing who calls the cloud function.
The set of simulated calling mode options includes a sub-application calling option. And the sub-application calling option is used for indicating that the cloud function is called from the sub-application side. In one embodiment, the simulated invocation mode options may also include a cloud function invocation option.
Specifically, when the option selected from the request mode option set is a manual trigger option, a set of simulation call mode options may also be displayed in the local debugging panel. The debugging personnel can select an option from the set of the simulated calling mode options, and when the selection operation for the sub-application calling option is detected, the computer equipment can generate a calling request of the sub-application for the cloud function by the local debugging panel according to the input request parameters. The computer device can send the call request to the local debugging service program through the local debugging panel, so that the local debugging service program executes the code created by the cloud function on the local server, and obtains the context content of the parent application of the child application by executing the code. In one embodiment, the contextual content of the parent application may include openids. openid is the only identification corresponding to the user identity in the parent application.
In one embodiment, the simulated invocation mode options may also include a cloud function invocation option. When a selection operation for a cloud function call option is detected, the local debugging panel may generate a call request for another cloud function for the cloud function according to the input request parameter. The computer device can send the call request to the local debugging service program through the local debugging panel so that the local debugging service program can execute the code created by the cloud function at the local server.
This is also explained in connection with fig. 3. Referring to FIG. 3, the "simulation" column corresponds to "call from applet" (i.e., the sub-application call option is selected, it being understood that an applet is a popular call for sub-applications). In this way, a call request may be initiated from the child application to the cloud function.
In the embodiment, the calling of the sub-application to the cloud function can be simulated in a self-defined manner, so that the calling is more sufficient, debugging blind spots are reduced, and the debugging accuracy is improved. In addition, the cloud function is called by the child application, and the context content of the parent application of the child application can be directly obtained, so that corresponding operation is saved, and the efficiency is improved.
In one embodiment, step S204 includes: in the developer tool, starting a local debugging service program; initializing the running environment of a cloud function through the local debugging service program; and adding the cloud function operation environment variable into the initialized operation environment to obtain a locally simulated cloud function operation environment.
The environment variables during the operation of the cloud function refer to some environment parameters required by the operation of the cloud function.
Specifically, the computer device may create an initialized cloud function operating environment through a local debugging service program, and then put the cloud function operating environment variable into the initialized operating environment to obtain a final cloud function operating environment simulated locally.
In the embodiment, the cloud function runtime environment variable is added to the initialized runtime environment, so that the cloud function runtime environment can be simulated locally and more accurately.
In one embodiment, step S206 includes: and in the cloud function operating environment, loading the local code of the cloud function into a cloud function instance template to create a local cloud function instance. In this embodiment, when obtaining the call request for the cloud function, the executing the local code includes: acquiring a call request aiming at the cloud function through the local cloud function instance; executing the code in the local cloud function instance in response to the call request.
The cloud function instance is a process for implementing a cloud function. The cloud function instance template is an initial templated cloud function instance. It can be understood that the final cloud function instance can be obtained only by injecting the code of the cloud function into the cloud function instance template. The local cloud function instance is a cloud function instance created locally.
Specifically, the computer device may create a cloud function instance template through a local debugging service program, and load a local code of the cloud function into the cloud function instance template in the cloud function operating environment, thereby creating and obtaining a local cloud function instance. The call request for the cloud function is called to a local cloud function instance, namely, the call request for the cloud function is obtained through the local cloud function instance. The local cloud function instance may process the call request, and execute the code in the local cloud function instance.
In the embodiment, the local cloud function instance is created in the cloud function operating environment, and thus when a call request for a cloud function is received, the local cloud function instance can be called without calling on a wire, and further debugging efficiency can be improved.
In one embodiment, the method further comprises: establishing connection between a local cloud function example and a local debugging panel; based on the connection, code in the local cloud function instance is shown in a local debugging panel; and acquiring debugging breakpoint marks added aiming at the displayed codes. In this embodiment, in response to the call request, executing the code in the local cloud function instance includes: and responding to the call request, and executing the code in the local cloud function instance according to the debugging breakpoint mark.
The debugging breakpoint mark is a mark of a debugging breakpoint and is used for marking the position of the debugging breakpoint in the code of the cloud function. The breakpoint can interrupt the program where needed, thereby facilitating the analysis.
Specifically, the local cloud function instance may initiate a debug mode, exposing a local debug link address of the local cloud function instance. The computer device may connect the local debug link address through the local debug panel to establish a connection between the local debug panel and the local cloud function instance.
In one embodiment, a local cloud function instance may expose local debug link addresses based on the WebSocket protocol (WebSocket is a protocol that performs full duplex communication over a single TCP connection). The computer device may connect to the local debug link address through the local debug panel. In one embodiment, the local debug panel may connect to the local debug link address based on a browser developer tool. In one embodiment, the browser developer tool may be Chrome devtools (i.e., a Chrome developer tool, a set of tools for web page production and debugging embedded within a Chrome browser).
The computer device may expose code of the cloud function in the connected local cloud function instance in a local debug panel based on the established connection, such that a code level endpoint debugging process may be performed. Debugging personnel can add debugging breakpoint marks to the displayed codes in the local debugging panel, and the computer equipment can acquire the debugging breakpoint marks added to the displayed codes through the local debugging panel. In this way, when a call request for a cloud function is obtained by the local cloud function instance, the computer device may execute code in the local cloud function instance according to the debug breakpoint flag in response to the call request.
In the above embodiment, based on the connection between the local cloud function instance and the local debugging panel, the code can be visualized in the local debugging panel, so that breakpoint debugging is implemented at the code level. And then can carry out debugging according to the breakpoint, carry out debugging processing more accurately.
FIG. 5 is an architecture diagram of a method for cloud function debugging in one embodiment. Referring to fig. 5, the architecture diagram includes three major components of a sub-application developer tool, a local server, and a local cloud function instance. The sub-application developer tool comprises a sub-application simulator logic layer, a local debugging panel and a cloud function debugger. In one embodiment, the Cloud Function debugger may be a Serverless Cloud Function debugger ((SCF) that may acquire key information related to the debugging process from the Cloud development platform, and then start the local debugging service program to create the local server based on the key information. specifically, the Cloud Function debugger may perform the steps of starting the local debugging service program, mounting a code of the Cloud Function, setting the Cloud Function manager, setting the Cloud Function gateway, and exposing the API interface of the Cloud Function manager, respectively, in step (2) of FIG. 5, thereby obtaining the local server in which the Cloud Function is created locally, the local server includes the API interface service of the Cloud Function manager, and the Cloud Function gateway, and based on the local server, the Cloud Function instance template may be sequentially created and loaded, initializing a cloud function operating environment, opening a debugging mode, loading codes of the cloud functions created to the local into a cloud function instance template, and waiting for an indication, so that a local cloud function instance is created. The local cloud function instance is loaded with the code of the cloud function in the local. The local debugging panel can be connected with the local cloud function instance through the cloud function debugger. Specifically, the cloud function debugger may create a browser developer tool (for example, Chrome DevTools are a set of tools embedded in a Chrome browser for web page production and debugging) through step (3), and connect a port based on the browser developer tool, so that a local debugging panel is connected to the local cloud function instance, so as to display the code in the local cloud function instance on the local debugging panel, thereby performing breakpoint debugging. Both the applet simulator and the local debug panel supported by the sub-application simulator logic layer may initiate a call request to the cloud function debugger. The applet simulator can route the cloud function call request to the cloud function debugger through the sub-application simulator logic layer through the step (4) to initiate the call request, and the local debugging panel can send debugging call information to the cloud function debugger through the interface through the step (4) to initiate the call request. The cloud function debugger can call and execute the code in the local cloud function instance according to the call request through the step (5), and obtain the execution result. The code in the local cloud function instance can also initiate an external request through the cloud function gateway to access an extranet or call other cloud functions created to the local. In addition, in step (4), the cloud function debugger can expose an HTTP port to reserve an API for the external browser call, so that the external browser can perform cloud function management.
As shown in fig. 6, in one embodiment, a cloud function debugging apparatus 600 is provided, the apparatus 600 including: a debugging trigger module 602, a running environment simulation module 604, a loading module 606, and a debugging module 608, wherein:
a debugging triggering module 602, configured to receive, in the developer tool, a local debugging instruction for the cloud function created to the local.
And the running environment simulation module 604 is used for responding to the local debugging instruction and locally simulating a cloud function running environment through the developer tool.
A loading module 606, configured to load a local code of the cloud function in the cloud function execution environment.
A debugging module 608, configured to execute the code locally when a call request for the cloud function is obtained; and debugging the code of the cloud function according to an execution result.
In one embodiment, debug trigger module 602 is also used to launch a local debug panel in the developer tool; displaying an identifier of a cloud function created to the local in the local debugging panel; and receiving a local debugging instruction aiming at the cloud function corresponding to the displayed identification through a local debugging panel.
In one embodiment, the debug trigger module 602 is further configured to expose a local debug trigger entry for the cloud function in the developer tool; and after the trigger instruction of the local debugging trigger inlet is obtained, starting a local debugging panel.
In one embodiment, debug trigger module 602 is also used to expose a cloud function catalog in a developer tool; when a specified operation aiming at a total directory in the cloud function directories or a cloud function root directory in the cloud function directories is detected, a local debugging trigger entry aiming at a cloud function is displayed.
In one embodiment, the apparatus 600 further comprises:
a creating module 603 configured to start a local debugging service program through a developer tool; initializing a local server according to the local debugging service program; creating a local cloud function in the local server; the debugging trigger module 602 is further configured to obtain an identifier of the created cloud function from the local server, and present the identifier in the local debugging panel.
In one embodiment, the debug trigger module 602 is further configured to obtain a target identifier selected from the presented identifiers; displaying a local debugging switch corresponding to the target identification; and when the opening operation aiming at the local debugging switch is detected, generating a local debugging instruction aiming at the cloud function corresponding to the target identification.
As shown in fig. 7, in one embodiment, the apparatus 600 further comprises: a creation module 603 and a call control module 607, wherein:
A call control module 607, configured to display a request mode option set in the local debugging panel; when the selected option in the request mode option set is a manual trigger option, displaying a request parameter configuration area; acquiring the request parameters input in the request parameter configuration area; and generating a call request aiming at the cloud function according to the input request parameters.
In one embodiment, the developer tool is a child application developer tool. The call control module 607 is further configured to display a set of simulation call mode options in the local debug panel; the set comprises a sub-application calling option; when the selection operation aiming at the sub-application calling option is detected, generating a calling request of the sub-application aiming at the cloud function according to the input request parameter; and acquiring the context content of the parent application of the child application by executing the local code.
In one embodiment, the runtime simulation module 604 is further configured to launch a local debug service in the developer tool; initializing the running environment of a cloud function through the local debugging service program; and adding the cloud function runtime environment variable into the initialized runtime environment to obtain a locally simulated cloud function runtime environment.
In one embodiment, the execution environment simulation module 604 is further configured to load the code of the cloud function in the local area to the cloud function instance template in the cloud function execution environment, and create a local cloud function instance; acquiring a call request aiming at the cloud function through the local cloud function instance; executing the code in the local cloud function instance in response to the call request.
In one embodiment, the debug module 608 is further configured to establish a connection between the local cloud function instance and the local debug panel; based on the connection, showing the code in the local cloud function instance in a local debugging panel; acquiring debugging breakpoint marks added aiming at the displayed codes; and responding to the call request, and executing the code in the local cloud function instance according to the debugging breakpoint mark.
In one embodiment, the debugging module 608 is further configured to obtain a local debugging link address of the local cloud function instance; and connecting the local debugging link address through a local debugging panel to establish connection between the local debugging panel and the local cloud function instance.
FIG. 8 is a diagram illustrating an internal configuration of a computer device in accordance with an embodiment. Referring to fig. 8, the computer device may be the terminal 110 of fig. 1. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device may store an operating system and a computer program. The computer program, when executed, may cause a processor to perform a method of cloud function debugging. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The internal memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute a cloud function debugging method. The network interface of the computer device is used for network communication. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer equipment can be a touch layer covered on a display screen, a key, a track ball or a touch pad arranged on a terminal shell, an external keyboard, a touch pad or a mouse and the like. The computer device may be a personal computer, a smart speaker, a mobile terminal or a vehicle-mounted device, and the mobile terminal includes at least one of a mobile phone, a tablet computer, a personal digital assistant or a wearable device.
It will be appreciated by those skilled in the art that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the cloud function debugging apparatus provided in the present application may be implemented in the form of a computer program, where the computer program may be executed on a computer device as shown in fig. 8, and a nonvolatile storage medium of the computer device may store various program modules that constitute the cloud function debugging apparatus, for example, the debugging trigger module 602, the running environment simulation module 604, the loading module 606, and the debugging module 608 shown in fig. 6. For example, the computer device may receive, in a developer tool, a local debugging instruction for a cloud function created to the local through a debugging triggering module 602 in the cloud function debugging apparatus 600 as shown in fig. 6. The computer device may locally simulate, via the developer tool, a cloud function execution environment in response to the local debug instruction via the execution environment simulation module 604. The computer device may load the code of the cloud function in the local environment through the loading module 606. The computer device may execute the code locally through the debugging module 608 when obtaining a call request for the cloud function; and debugging the code of the cloud function according to an execution result.
In one embodiment, a computer device is provided, which includes a memory and a processor, the memory storing a computer program, and the computer program, when executed by the processor, causes the processor to perform the steps of the cloud function debugging method described above. Here, the steps of the cloud function debugging method may be steps in the cloud function debugging method in the foregoing embodiments.
In one embodiment, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, causes the processor to perform the steps of the cloud function debugging method described above. Here, the steps of the cloud function debugging method may be steps in the cloud function debugging method in the foregoing embodiments.
It should be noted that "first" and "second" in the embodiments of the present application are used only for distinction, and are not used for limitation in terms of size, order, dependency, and the like.
It should be understood that, although the steps in the embodiments of the present application are not necessarily performed in the order indicated by the step numbers. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent should be subject to the appended claims.
Claims (13)
1. A method of cloud function debugging, the method comprising:
in a developer tool, receiving local debugging instructions for a cloud function created to the local;
responding to the local debugging instruction, starting a local debugging service program in the developer tool, initializing the running environment of the cloud function locally through the local debugging service program, adding the running environment variable of the cloud function to the initialized running environment, and generating a final cloud function running environment; the local debugging service program is a program which is arranged in a developer tool and is used for carrying out local debugging processing on the cloud function; the cloud function runtime environment variable refers to an environment parameter required by the cloud function during runtime;
In the cloud function operating environment, loading the local code of the cloud function into a cloud function instance template to create a local cloud function instance;
acquiring a call request aiming at the cloud function through the local cloud function instance;
responding to the call request, and executing the code in the local cloud function instance according to a debugging breakpoint mark for marking a debugging breakpoint position in the code;
and debugging the code of the cloud function according to an execution result.
2. The method of claim 1, wherein receiving, in the developer tool, a local debugging instruction for the cloud function created to the local comprises:
in the developer tool, starting a local debugging panel;
displaying an identifier of a cloud function created to the local in the local debugging panel;
and receiving a local debugging instruction aiming at the cloud function corresponding to the displayed identification through a local debugging panel.
3. The method of claim 2, wherein launching a local debug panel in the developer tool comprises:
in a developer tool, showing a local debugging trigger inlet aiming at a cloud function;
And after the trigger instruction of the local debugging trigger inlet is obtained, starting a local debugging panel.
4. The method of claim 3, wherein exposing, in the developer tool, a local debug trigger portal for cloud functions comprises:
displaying a cloud function catalog in a developer tool;
when a specified operation aiming at a total directory in the cloud function directories or a cloud function root directory in the cloud function directories is detected, a local debugging trigger entry aiming at a cloud function is displayed.
5. The method of claim 2, further comprising:
initializing a local server according to the local debugging service program;
creating a local cloud function in the local server;
the displaying, in the local debugging panel, the identification of the cloud function created to the local includes:
and acquiring the identification of the created cloud function from a local server, and displaying the identification in the local debugging panel.
6. The method of claim 2, wherein receiving, by the local debug panel, the local debug instruction for the cloud function corresponding to the exposed identifier comprises:
acquiring a target identifier selected from the displayed identifiers;
Displaying a local debugging switch corresponding to the target identification;
and when the opening operation of the local debugging switch is detected, generating a local debugging instruction of the cloud function corresponding to the target identification.
7. The method of claim 2, further comprising:
displaying a request mode option set in the local debugging panel;
when the selected option in the request mode option set is a manual trigger option, displaying a request parameter configuration area;
acquiring the request parameters input in the request parameter configuration area;
and generating a call request aiming at the cloud function according to the input request parameters.
8. The method of claim 7, wherein the developer tool is a sub-application developer tool;
the method further comprises the following steps:
displaying a set of simulation calling mode options in the local debugging panel; the set comprises a sub-application calling option;
the generating a call request for the cloud function according to the input request parameters comprises:
when the selection operation aiming at the sub-application calling option is detected, generating a calling request of the sub-application aiming at the cloud function according to the input request parameter;
When obtaining a call request for the cloud function, executing the code locally comprises:
and acquiring the context content of the parent application of the child application by executing the local code.
9. The method of claim 2, further comprising:
establishing a connection between the local cloud function instance and the local debugging panel;
based on the connection, showing the code in the local cloud function instance in a local debugging panel;
and acquiring debugging breakpoint marks added aiming at the displayed codes.
10. The method of claim 9, wherein establishing the connection between the local cloud function instance and the local debug panel comprises:
acquiring a local debugging link address of the local cloud function instance;
and connecting the local debugging link address through a local debugging panel to establish connection between the local debugging panel and the local cloud function instance.
11. A cloud function debugging apparatus, comprising:
the debugging triggering module is used for receiving a local debugging instruction aiming at the cloud function established to the local in the developer tool;
The operating environment simulation module is used for responding to the local debugging instruction, starting a local debugging service program in the developer tool, initializing the operating environment of the cloud function locally through the local debugging service program, adding the cloud function operating environment variable to the initialized operating environment, and generating a final cloud function operating environment; the local debugging service program is a program which is arranged in a developer tool and is used for carrying out local debugging processing on the cloud function; the cloud function runtime environment variable refers to an environment parameter required by the cloud function during runtime;
the loading module is used for loading the local code of the cloud function into a cloud function instance template in the cloud function operating environment to create a local cloud function instance;
the debugging module is used for acquiring a call request aiming at the cloud function through the local cloud function instance; responding to the call request, and executing the code in the local cloud function instance according to a debugging breakpoint mark for marking a debugging breakpoint position in the code; and debugging the code of the cloud function according to an execution result.
12. A computer arrangement comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 1 to 10.
13. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910325680.7A CN110032519B (en) | 2019-04-22 | 2019-04-22 | Cloud function debugging method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910325680.7A CN110032519B (en) | 2019-04-22 | 2019-04-22 | Cloud function debugging method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110032519A CN110032519A (en) | 2019-07-19 |
CN110032519B true CN110032519B (en) | 2022-07-19 |
Family
ID=67239630
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910325680.7A Active CN110032519B (en) | 2019-04-22 | 2019-04-22 | Cloud function debugging method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110032519B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110837473B (en) * | 2019-11-07 | 2023-08-22 | 腾讯科技(深圳)有限公司 | Application program debugging method, device, terminal and storage medium |
CN111162960B (en) * | 2019-12-03 | 2022-12-02 | 支付宝实验室(新加坡)有限公司 | Method and server for starting debugging panel |
CN113971124B (en) * | 2020-07-24 | 2024-06-25 | 腾讯科技(深圳)有限公司 | Sub-application debugging method and device, computer equipment and storage medium |
CN114553688B (en) * | 2020-11-25 | 2023-07-14 | 腾讯科技(深圳)有限公司 | Cloud computing deployment method, device, equipment and computer readable storage medium |
CN113176994B (en) * | 2021-04-28 | 2024-06-25 | 中国工商银行股份有限公司 | Mock data method and device based on function calculation |
CN113760762B (en) * | 2021-09-08 | 2024-03-08 | 贝壳找房(北京)科技有限公司 | Method for simulating operating environment of applet, electronic device and storage medium |
CN114490336A (en) * | 2021-12-28 | 2022-05-13 | 阿里云计算有限公司 | Joint debugging test method, access system, front end and storage medium |
CN114996117B (en) * | 2022-03-28 | 2024-02-06 | 湖南智擎科技有限公司 | Client GPU application evaluation system and method for SaaS mode |
CN117112394B (en) * | 2023-06-28 | 2024-08-06 | 领悦数字信息技术有限公司 | Method and system for debugging application developed based on server-free framework |
CN117472784B (en) * | 2023-12-25 | 2024-03-19 | 图灵人工智能研究院(南京)有限公司 | Browser-based Serverless code online debugging method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108322458A (en) * | 2018-01-30 | 2018-07-24 | 深圳壹账通智能科技有限公司 | Web Application intrusion detections method, system, computer equipment and storage medium |
CN109062658A (en) * | 2018-06-29 | 2018-12-21 | 优刻得科技股份有限公司 | Realize dispatching method, device, medium, equipment and the system of computing resource serviceization |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9104803B2 (en) * | 2011-01-03 | 2015-08-11 | Paypal, Inc. | On-demand software test environment generation |
-
2019
- 2019-04-22 CN CN201910325680.7A patent/CN110032519B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108322458A (en) * | 2018-01-30 | 2018-07-24 | 深圳壹账通智能科技有限公司 | Web Application intrusion detections method, system, computer equipment and storage medium |
CN109062658A (en) * | 2018-06-29 | 2018-12-21 | 优刻得科技股份有限公司 | Realize dispatching method, device, medium, equipment and the system of computing resource serviceization |
Non-Patent Citations (1)
Title |
---|
「小程序·云开发」支持云调用等功能更新;微信团队;《https://developers.weixin.qq.com/community/develop/doc/000c02105702082f9c68a24f35b801》;20190416;第1-7页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110032519A (en) | 2019-07-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110032519B (en) | Cloud function debugging method and device, computer equipment and storage medium | |
CN109901834B (en) | Document page generation method, device, computer equipment and storage medium | |
CN111522552B (en) | Sub-application generation method and device, computer equipment and storage medium | |
CN112270149B (en) | Verification platform automatic integration method and system, electronic equipment and storage medium | |
CN102667730A (en) | Design time debugging | |
CN111796799B (en) | Sub-application development method and device, computer equipment and storage medium | |
CN112214405B (en) | Software testing method and device, electronic equipment and readable storage medium | |
CN112486828A (en) | Test case generation method and device, computer equipment and storage medium | |
CN111008132B (en) | Application debugging method and device for Android system, computer equipment and storage medium | |
CN109766139B (en) | Configuration method and device of configuration file | |
CN116841543A (en) | Development method for dynamically generating cross-platform multi-terminal application based on Flutter | |
CN106126425B (en) | Function traversal method and system based on Android automated test frame | |
CN112052037A (en) | Application software development method, device, equipment and medium | |
CN113342629B (en) | Operation track restoration method and device, computer equipment and storage medium | |
CN114625448A (en) | Flow generation method and device combining RPA and AI, electronic equipment and storage medium | |
GB2400211A (en) | A method of creating software that is portable across different operating systems | |
CN117215574A (en) | Low code development system and method integrating flow design and UI design | |
CN116719736A (en) | Test case generation method and device for testing software interface | |
CN112765018B (en) | Instrument and meter debugging system and method | |
CN112162743A (en) | Driver generation method, device, computer equipment and storage medium | |
CN108241488A (en) | A kind of system and method for generating APP interfaces | |
CN111143227A (en) | Data operation method, device, terminal and storage medium | |
JP2001318796A (en) | Program execution control method using internal and external event driven system, recording medium and program preparation support system | |
US8887075B2 (en) | System and method for device skinning | |
Wu et al. | The design and implementation of an integrated building environment for android systems |
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 |