CN115509514A - Front-end data simulation method, device, equipment and medium - Google Patents

Front-end data simulation method, device, equipment and medium Download PDF

Info

Publication number
CN115509514A
CN115509514A CN202211470378.9A CN202211470378A CN115509514A CN 115509514 A CN115509514 A CN 115509514A CN 202211470378 A CN202211470378 A CN 202211470378A CN 115509514 A CN115509514 A CN 115509514A
Authority
CN
China
Prior art keywords
data
abstract syntax
syntax tree
simulation
function
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.)
Granted
Application number
CN202211470378.9A
Other languages
Chinese (zh)
Other versions
CN115509514B (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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202211470378.9A priority Critical patent/CN115509514B/en
Publication of CN115509514A publication Critical patent/CN115509514A/en
Application granted granted Critical
Publication of CN115509514B publication Critical patent/CN115509514B/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/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • 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/425Lexical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a front-end data simulation method, a device, equipment and a medium, which are applied to the technical field of front-end data simulation and comprise the following steps: converting the front-end code into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance; constructing a simulation data generating function based on a data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing interface function tree nodes in the abstract syntax tree with the data generating function tree nodes; converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code; and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called. Thus, development efficiency can be improved, and intrusion of front-end code can be avoided.

Description

Front-end data simulation method, device, equipment and medium
Technical Field
The present application relates to the field of front-end data simulation technologies, and in particular, to a front-end data simulation method, apparatus, device, and medium.
Background
In the Web development stage, front-end and back-end developers can simultaneously develop, the speed of drawing a page by the front end is generally higher than the speed of writing an interface by a back-end developer, and the development efficiency can be improved by the front-end Mock data. Mock, as its name implies, is an analog. Usually, an object is simulated by using the same interface to replace a real object, so that external dependence can be effectively isolated, and testing is facilitated. For front-end development, mock, as an important ring, can bring many benefits, such as: the front end and the back end develop and simulate various response values in parallel, so that the test is convenient, page layout problems under some extreme response values can be found as soon as possible, and the like.
At present, one solution is to build a mock server or an Interface platform, such as yapi, or use an API (Application Programming Interface) management platform of a third party, which usually also has a mock function. In the front-end and back-end cooperation process, the back end writes an interface into an interface platform, the front end edits mock (test) data on the interface platform, and a proxy of a dev server is configured to the interface platform. In the front-end development process, interface proxy addresses corresponding to different functions are different, the development server needs to be restarted when the proxy interface addresses are switched every time, the development server is restarted for 30 seconds at a high speed, and the development efficiency is greatly influenced for several minutes at a low speed. The other scheme is that json is simulated and written according to data returned by an interface in a project, and a local json file is requested to perform data processing when the request is made, so that the front-end code is invasive.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a front-end data simulation method, apparatus, device and medium, which can improve development efficiency and avoid intrusion of front-end codes. The specific scheme is as follows:
in a first aspect, the present application discloses a front-end data simulation method, including:
converting the front-end code into an abstract syntax tree; the front-end code comprises a data template which is based on a return value of an interface function in advance and is created in an annotation form;
constructing a simulation data generating function based on a data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing interface function tree nodes in the abstract syntax tree with the data generating function tree nodes;
converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code;
and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called.
Optionally, the front-end code further includes an annotation tag located in front of the data template.
Optionally, the method further includes:
retrieving the data template from the abstract syntax tree based on the annotation tag.
Optionally, the obtaining the data template from the abstract syntax tree based on the annotation tag includes:
and traversing the abstract syntax tree, searching the annotation mark, and acquiring the data template after the annotation mark.
Optionally, the obtaining the data template after the annotation mark includes:
and acquiring the data template after the annotation mark by using a regular expression.
Optionally, the converting the front-end code into the abstract syntax tree includes:
and performing lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
Optionally, the lexical analysis and the syntactic analysis are performed on the front-end code, generating an abstract syntax tree comprising:
and performing lexical analysis and syntactic analysis on the front-end code by using a Babel compiler to generate an abstract syntax tree.
Optionally, the converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code includes:
and converting the abstract syntax tree after the node replacement into a source code form by using a Babel compiler so as to obtain a target front-end code.
Optionally, the constructing a simulation data generating function based on the data template includes:
and constructing a simulation data generating function by utilizing mock.
Optionally, the data template is a pre-created template that can be identified by mock.
Optionally, the executing the target front-end code, and generating and returning simulation data based on the simulation data generating function when calling an interface function, includes:
and executing the target front-end code based on a browser, and generating and returning simulation data based on the simulation data generation function when the browser calls an interface function.
Optionally, replacing the interface function tree nodes in the abstract syntax tree with the data generating function tree nodes includes:
and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node.
In a second aspect, the present application discloses a front-end data simulation apparatus, comprising:
the front-end code conversion module is used for converting the front-end codes into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance;
the tree node replacing module is used for constructing a simulation data generating function based on the data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing the interface function tree nodes in the abstract syntax tree with the data generating function tree nodes;
the syntax tree conversion module is used for converting the abstract syntax tree after the node replacement into a source code form so as to obtain a target front-end code;
and the front-end data simulation module is used for executing the target front-end code and generating and returning simulation data based on the simulation data generation function when an interface function is called.
Optionally, the front-end code further includes an annotation tag located in front of the data template.
Optionally, the apparatus further includes a data template obtaining module, configured to obtain the data template from the abstract syntax tree based on the annotation tag.
Optionally, the data template obtaining module is specifically configured to traverse the abstract syntax tree, search the annotation tag, and obtain the data template after the annotation tag.
Optionally, the front-end code conversion module is specifically configured to perform lexical analysis and syntax analysis on the front-end code to generate an abstract syntax tree.
Optionally, the front-end code conversion module is specifically configured to perform lexical analysis and syntactic analysis on the front-end code by using a Babel compiler, and generate an abstract syntax tree.
Optionally, the syntax tree conversion module is specifically configured to convert the abstract syntax tree after node replacement into a source code form by using a Babel compiler to obtain the target front-end code.
Optionally, the data template is a template that is created in advance and can be identified by mock.
Optionally, the front-end data simulation module is specifically configured to execute the target front-end code based on a browser, and generate and return simulation data based on the simulation data generation function when the browser calls an interface function.
In a third aspect, the present application discloses an electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the front-end data simulation method.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned front-end data simulation method.
Therefore, the front-end codes are converted into the abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance, a simulated data generating function is constructed based on the data template in the abstract syntax tree, the simulated data generating function is converted into abstract syntax tree nodes to obtain data generating function tree nodes, the interface function tree nodes in the abstract syntax tree are replaced by the data generating function tree nodes, then the abstract syntax tree after node replacement is converted into a source code form to obtain a target front-end code, the target front-end code is executed, and when the interface function is called, the simulated data are generated and returned based on the simulated data generating function. That is, in the embodiment of the present application, when performing front-end development, the front-end code is first converted into the abstract syntax tree, then the analog data generating function is constructed based on the data template created according to the return value of the interface function, and is converted into the data generating function tree node, the interface function tree node in the abstract syntax tree is replaced, and then the source code is converted back to obtain the target front-end code, and the target front-end code is executed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a front-end data simulation method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a conventional data simulation scheme of the prior art;
FIG. 3 is a flow chart of a data simulation scheme based on abstract syntax trees according to an embodiment of the present application;
fig. 4 is a schematic diagram of an interface function conversion provided in an embodiment of the present application;
FIG. 5 is a diagram illustrating an abstract syntax tree transformation according to an embodiment of the present application;
FIG. 6 is a diagram illustrating a concrete abstract syntax tree transformation according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a front-end data simulation apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, when front-end data simulation is performed, one scheme is to build a mock server or an interface platform, such as yapi, or use an API management platform of a third party, which usually also has a mock function. In the front-end and back-end cooperation process, the back end writes an interface into an interface platform, the front end edits mock (test) data on the interface platform, and a proxy of a dev server is configured to the interface platform. In the front-end development process, interface proxy addresses corresponding to different functions are different, the development server needs to be restarted when the proxy interface addresses are switched every time, the development server is restarted for 30 seconds at a high speed, and the development efficiency is greatly influenced for several minutes at a low speed. The other scheme is that json is simulated and written according to data returned by an interface in a project, and a local json file is requested to perform data processing when the request is made, so that the front-end code is invasive. Therefore, the front-end data simulation scheme is provided, the development efficiency can be improved, and intrusion of front-end codes is avoided.
Referring to fig. 1, an embodiment of the present application discloses a front-end data simulation method, including:
step S11: converting the front-end code into an abstract syntax tree; and the front-end code comprises a data template which is created in an annotation form based on a return value of the interface function in advance.
In an implementation manner, the embodiment of the present application may perform lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree. Further, in the embodiment of the present application, a Babel compiler is used to perform lexical analysis and syntactic analysis on the front-end code, so as to generate an abstract syntax tree. Specifically, the Babel-parser library is used for carrying out lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
It should be noted that an abstract syntax tree is a tree representation of the abstract syntax structure of the source code, and each node on the tree represents a structure in the source code. Furthermore, abstract syntax trees are not unique to a certain programming language, and almost all programming languages such as JavaScript, python, java, golang, etc. have syntax trees. For example, in the embodiment of the present application, a Babel compiler may be used to perform lexical analysis and syntax analysis on the front-end JavaScript code to generate the abstract syntax tree. The Babel is a JavaScript compiler, or an analysis library, and a lot of methods for analyzing JavaScript codes are built in the Babel, and the Babel can be used to convert the JavaScript codes into AST (Abstract Syntax Tree). Lexical analysis: namely "Lexical Analysis", the first stage of the compilation process, which is tasked with reading the source program from left to right, character by character, then identifying words according to the word-formation rules, and generating token symbol streams. And (3) syntax analysis: i.e. "Syntax Analysis", a logical phase of the compilation process, the task of the syntactic Analysis is to combine token symbol stream sequences into various syntactic phrases, such as "programs", "statements", "expressions", etc., on the basis of lexical Analysis.
Step S12: and constructing a simulation data generating function based on the data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing the interface function tree nodes in the abstract syntax tree with the data generating function tree nodes.
In a specific embodiment, the front-end code further comprises an annotation tag located in front of the data template. For example, the annotation tag is @ mock, and further, the embodiment of the present application may obtain the data template from the abstract syntax tree based on the annotation tag. In addition, the embodiment of the application may traverse the abstract syntax tree, search the annotation tag, and obtain the data template after the annotation tag. The data template after the annotation mark can be obtained by using a regular expression in the embodiment of the application.
It is understood that the embodiment of the present application may encapsulate an interface function, call the interface function inside the encapsulated function, and add an annotation tag and a data template in the form of code annotation above the interface function. In this way the data template is defined in the form of a comment, which starts with the @ mock symbol, which can be easily found.
In one implementation, the embodiments of the present application may construct a simulation data generating function based on the data template by using mock. And the data template is a pre-created template which can be identified by mock. Js is an excellent JavaScript library for generating simulation data, and according to the embodiment of the application, a simulation data generation function for generating simulation data may be constructed based on the mock. That is, a data template after @ mock is obtained, a function for generating simulation data is constructed by using a method in a mock.js library based on the data template, the function is converted into an abstract syntax tree node segment, and the abstract syntax tree node related to the API request for obtaining data is replaced by the tree node of the data generating function.
Further, the step of replacing the interface function tree nodes in the abstract syntax tree with the data generation function tree nodes includes the following specific steps: and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node. Specifically, the interface function tree node of the statement in the abstract syntax tree is inserted into the data generating function tree node.
That is, in the embodiment of the present application, code content is changed at a JavaScript code compiling stage, an abstract syntax tree is manipulated, and a mode of originally requesting to obtain simulation data by calling an API is replaced with a mode of generating simulation data by mock. And the aim of changing the code is achieved by replacing the abstract syntax tree nodes.
Step S13: and converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code.
In one embodiment, the abstract syntax tree after node replacement can be converted into a source code form by using a Babel compiler to obtain the target front-end code. Specifically, the abstract syntax tree after node replacement is converted into a source code form by using a Babel-generator library to obtain a target front-end code. For example, the source code is in the form of a JavaScript code, and in the embodiment of the present application, the Babel-generator library is used to convert the abstract syntax tree after the node replacement into the JavaScript code, so as to obtain the target front-end code.
That is, in the embodiment of the present application, the abstract syntax tree may be traversed, the annotation mark may be searched for, the data template after the annotation mark is obtained, a simulation data generating function is constructed based on the traversed data template, the simulation data generating function is converted into an abstract syntax tree node to obtain a data generating function tree node, an interface function tree node in the abstract syntax tree is replaced with the data generating function tree node, and then the abstract syntax tree after the traversal is completed is converted into a code form to obtain a target front end code.
Step S14: and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called.
And executing the target front-end code based on a browser, and generating and returning simulation data based on the simulation data generation function when the browser calls an interface function.
For example, referring to fig. 2, fig. 2 is a flowchart of a conventional data simulation scheme in the prior art, as can be seen from fig. 2, the conventional data simulation scheme is provided with a simulation server, an API request initiated by a browser passes through the simulation server, simulation data is generated at the simulation server, and is finally returned to the browser, which requires that the API request address configuration must be correct. The embodiment of the application does not adopt a traditional mock server mode, and the link of the mock server is removed, namely, an interface simulation server is skipped, a simulation request is not needed, and fixed simulation data is not written in the code. Instead, after the compiler performs lexical analysis and syntax analysis on the JavaScript code, the abstract syntax tree is directly operated, and the code requested by the original interface is directly replaced by the data returned by the interface. For example, as shown in fig. 3, fig. 3 is a flowchart of a data simulation scheme based on an abstract syntax tree according to the embodiment of the present application, and as can be seen from fig. 3, in the embodiment of the present application, a simulation server is removed, some special processing is performed at an interface-specifying stage, after a JavaScript compiler performs lexical analysis and syntactic analysis to generate an abstract syntax tree, an abstract syntax tree node corresponding to an interface request (i.e., an interface function) is replaced with a data generating function tree node, and simulation data is directly returned when a browser calls an interface. The scheme is effective only in a development environment, the development efficiency is improved, and legal API requests are still walked in a formal environment to obtain real data. Wherein, the side of this scheme adoption includes: and packaging an interface function, calling an API (application programming interface) interface in the packaging function, returning a return value of the interface to the outside of the function, adding an @ mock symbol above the interface function in a code annotation mode, defining a data template which can be identified by mock-js according to the return value of the interface function behind the @ mock symbol, and converting the object into analog data for browser rendering by a method in a mock-js library. Further, the interface function is converted into an abstract syntax tree by using babel, the AST abstract syntax tree is used for finding the @ mock mark, the content behind the @ mock mark is obtained by using a regular expression, and a function for generating simulation data is constructed on the basis of a data template behind the @ mock mark. For example, referring to fig. 4, fig. 4 discloses an interface function conversion diagram for the embodiment of the present application. As can be seen from fig. 4, the API interface calling method is eliminated in the embodiment of the present application. Therefore, calling the API interface will inevitably trigger an XHR (XMLHttpRequest) request of the browser, and then a series of request logics are followed, which is abandoned in the embodiments of the present application, and the API interface calling method directly manipulates the syntax tree at the JavaScript code precompilation stage, that is, after the abstract syntax tree is generated through the code lexical analysis and the syntax analysis, as shown in fig. 5, fig. 5 is a schematic diagram of abstract syntax tree conversion provided by the embodiments of the present application. In a syntax tree scene, a mock.js method is introduced, namely, a function is generated based on a data template and by utilizing the simulated data constructed by mock.js, and the simulated data can be generated by utilizing the function.
Further, referring to fig. 6, fig. 6 is a schematic diagram of a concrete abstract syntax tree transformation disclosed in the embodiment of the present application. Packaging the interface function, adding a line of JavaScript annotation above the interface function, wherein the annotation begins with an @ mock symbol, and a data template is defined behind the @ mock symbol; converting the JavaScript code into an abstract syntax tree by using a babel-parser library; traversing an abstract syntax tree, judging whether annotations at the beginning of the @ mock symbol exist or not, if not, continuing the next cycle, namely traversing the next tree branch, if so, obtaining a data template behind the @ mock symbol by using regular expression matching, if not, jumping out the current cycle and continuing the next cycle, if so, constructing a function for generating simulation data based on the data template and the mock js, and converting the function into an abstract syntax tree node to obtain a data generating function tree node. Finding the API interface calling statement, removing the abstract tree node of the interface statement, and inserting the data generating function tree node at the position, namely replacing the interface function tree node with the data generating function tree node. And after traversing, using a babel-generator library to invert the abstract syntax tree into JavaScript codes. Therefore, the traditional mock server mode is abandoned, and the simulation server is not required to be accessed through API requests in the process of acquiring the simulation data. But at the JavaScript precompilation stage, the abstract syntax tree is manipulated, and the API request code is replaced by a simulation data generation function. That is, the API request function is still written in the project, but in the JavaScript code compiling stage, the request function is replaced by the simulation data generation function according to the data template after the @ mock symbol above the function. The scheme is only effective in a development environment, and legal API requests are still walked in a formal environment to acquire real data. Compared with the mode that the API interface requests the simulation data, the method and the device do not need to pass through the XHR interface request of the browser, developers do not need to care about the configuration of the XHR interface address, and time for frequently restarting the development server is saved in the development stage. Compared with the mode of writing fixed simulation data in the project, the embodiment of the application does not cause invasiveness to the front-end code in the project. Through the scheme provided by the application, the front-end data simulation is more convenient and faster, and the development efficiency is improved.
Therefore, in the embodiment of the application, the front-end code is converted into the abstract syntax tree; the front-end code comprises a data template which is created in an annotation mode based on a return value of an interface function in advance, a simulation data generation function is constructed based on the data template in the abstract syntax tree, the simulation data generation function is converted into abstract syntax tree nodes to obtain data generation function tree nodes, the interface function tree nodes in the abstract syntax tree are replaced by the data generation function tree nodes, then the abstract syntax tree after node replacement is converted into a source code mode to obtain a target front-end code, the target front-end code is executed, and when the interface function is called, simulation data are generated and returned based on the simulation data generation function. That is, in the embodiment of the present application, when performing front-end development, the front-end code is first converted into the abstract syntax tree, then the analog data generating function is constructed based on the data template created according to the return value of the interface function, and is converted into the data generating function tree node, the interface function tree node in the abstract syntax tree is replaced, and then the source code is converted back to obtain the target front-end code, and the target front-end code is executed.
Referring to fig. 7, an embodiment of the present application discloses a front-end data simulation apparatus, including:
a front-end code conversion module 11, configured to convert a front-end code into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance;
a tree node replacing module 12, configured to construct a simulation data generating function based on the data template in the abstract syntax tree, convert the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replace the interface function tree nodes in the abstract syntax tree with the data generating function tree nodes;
a syntax tree conversion module 13, configured to convert the abstract syntax tree after node replacement into a source code form to obtain a target front-end code;
and a front-end data simulation module 14, configured to execute the target front-end code, and generate and return simulation data based on the simulation data generation function when the interface function is called.
Therefore, in the embodiment of the application, the front-end code is converted into the abstract syntax tree; the front-end code comprises a data template which is created in an annotation mode based on a return value of an interface function in advance, a simulation data generation function is constructed based on the data template in the abstract syntax tree, the simulation data generation function is converted into abstract syntax tree nodes to obtain data generation function tree nodes, the interface function tree nodes in the abstract syntax tree are replaced by the data generation function tree nodes, then the abstract syntax tree after node replacement is converted into a source code mode to obtain a target front-end code, the target front-end code is executed, and when the interface function is called, simulation data are generated and returned based on the simulation data generation function. That is, in the embodiment of the present application, when performing front-end development, a front-end code is first converted into an abstract syntax tree, then a simulated data generating function is constructed based on a data template created according to a return value of an interface function and converted into a data generating function tree node, the interface function tree node in the abstract syntax tree is replaced, and then a source code form is converted back to obtain a target front-end code, and the target front-end code is executed.
In one embodiment, the front-end code further comprises annotation tags located in front of the data templates. For example, the annotation tag is @ mock.
Optionally, the apparatus further includes a data template obtaining module, configured to obtain the data template from the abstract syntax tree based on the annotation tag.
Further, the data template obtaining module is specifically configured to traverse the abstract syntax tree, search the annotation tag, and obtain the data template after the annotation tag. Wherein the obtaining of the data template after the annotation mark comprises: and acquiring the data template after the annotation mark by using a regular expression.
In an embodiment, the front-end code conversion module 11 is specifically configured to perform lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
Further, the front-end code conversion module 11 is specifically configured to perform lexical analysis and syntactic analysis on the front-end code by using a Babel compiler, so as to generate an abstract syntax tree. Specifically, the Babel-parser library is used for carrying out lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
In one embodiment, the syntax tree conversion module 13 is specifically configured to convert the node-replaced abstract syntax tree into a source code form by using a Babel compiler to obtain the target front-end code. Specifically, the abstract syntax tree after node replacement is converted into a source code form by using a Babel-generator library to obtain a target front-end code. For example, the source code is in the form of JavaScript code, and in the embodiment of the present application, the Babel-generator library is used to convert the abstract syntax tree after node replacement into JavaScript code to obtain the target front-end code.
Wherein the constructing a simulation data generation function based on the data template comprises: and constructing a simulation data generation function by utilizing mock. Replacing the interface function tree nodes in the abstract syntax tree with the data generation function tree nodes, comprising: and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node. That is, a data template behind @ mock is obtained, a function for generating simulation data is constructed by using a method in a mock.js library based on the data template, and the function is converted into an abstract syntax tree node
And the data template is a pre-created template which can be identified by mock.
Further, in an embodiment, the front-end data simulation module 14 is specifically configured to execute the target front-end code based on a browser, and generate and return simulation data based on the simulation data generation function when the browser calls an interface function.
Referring to fig. 8, an embodiment of the present application discloses an electronic device 20, which includes a processor 21 and a memory 22; wherein, the memory 22 is used for storing computer programs; the processor 21 is configured to execute the computer program to implement the following steps:
converting the front-end code into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance; establishing a simulation data generating function based on a data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing interface function tree nodes in the abstract syntax tree with the data generating function tree nodes; converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code; and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called.
Therefore, in the embodiment of the application, the front-end code is converted into the abstract syntax tree; the front-end code comprises a data template which is created in an annotation mode based on a return value of an interface function in advance, a simulation data generation function is constructed based on the data template in the abstract syntax tree, the simulation data generation function is converted into abstract syntax tree nodes to obtain data generation function tree nodes, the interface function tree nodes in the abstract syntax tree are replaced by the data generation function tree nodes, then the abstract syntax tree after node replacement is converted into a source code mode to obtain a target front-end code, the target front-end code is executed, and when the interface function is called, simulation data are generated and returned based on the simulation data generation function. That is, in the embodiment of the present application, when performing front-end development, the front-end code is first converted into the abstract syntax tree, then the analog data generating function is constructed based on the data template created according to the return value of the interface function, and is converted into the data generating function tree node, the interface function tree node in the abstract syntax tree is replaced, and then the source code is converted back to obtain the target front-end code, and the target front-end code is executed.
Wherein the front-end code further comprises an annotation tag located in front of the data template.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: retrieving the data template from the abstract syntax tree based on the annotation tag.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and traversing the abstract syntax tree, searching the annotation mark, and acquiring the data template after the annotation mark.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and acquiring the data template after the annotation mark by using a regular expression.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and performing lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and performing lexical analysis and syntactic analysis on the front-end code by using a Babel compiler to generate an abstract syntax tree.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and converting the abstract syntax tree after the node replacement into a source code form by using a Babel compiler so as to obtain a target front-end code.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and constructing a simulation data generation function by utilizing mock.
Furthermore, the data template is a template which is created in advance and can be identified by mock.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and executing the target front-end code based on a browser, and generating and returning simulation data based on the simulation data generation function when the browser calls an interface function.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node.
The memory 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the storage mode may be a transient storage mode or a permanent storage mode.
In addition, the electronic device 20 further includes a power supply 23, a communication interface 24, an input-output interface 25, and a communication bus 26; the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to a specific application requirement, which is not specifically limited herein.
Further, an embodiment of the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:
converting the front-end code into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance; constructing a simulation data generating function based on a data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing interface function tree nodes in the abstract syntax tree with the data generating function tree nodes; converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code; and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called.
Therefore, in the embodiment of the application, the front-end code is converted into the abstract syntax tree; the front-end code comprises a data template which is created in an annotation mode based on a return value of an interface function in advance, a simulation data generation function is constructed based on the data template in the abstract syntax tree, the simulation data generation function is converted into abstract syntax tree nodes to obtain data generation function tree nodes, the interface function tree nodes in the abstract syntax tree are replaced by the data generation function tree nodes, then the abstract syntax tree after node replacement is converted into a source code mode to obtain a target front-end code, the target front-end code is executed, and when the interface function is called, simulation data are generated and returned based on the simulation data generation function. That is, in the embodiment of the present application, when performing front-end development, a front-end code is first converted into an abstract syntax tree, then a simulated data generating function is constructed based on a data template created according to a return value of an interface function and converted into a data generating function tree node, the interface function tree node in the abstract syntax tree is replaced, and then a source code form is converted back to obtain a target front-end code, and the target front-end code is executed.
Wherein the front-end code further comprises an annotation tag located in front of the data template.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: retrieving the data template from the abstract syntax tree based on the annotation tag.
In this embodiment, when the processor executes the computer subprogram stored in the computer readable storage medium, the following steps may be specifically implemented: traversing the abstract syntax tree, searching the annotation mark, and acquiring the data template after the annotation mark.
In this embodiment, when the processor executes the computer subprogram stored in the computer readable storage medium, the following steps may be specifically implemented: and acquiring the data template after the annotation mark by using a regular expression.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and performing lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and performing lexical analysis and syntactic analysis on the front-end code by using a Babel compiler to generate an abstract syntax tree.
In this embodiment, when the processor executes the computer subprogram stored in the computer readable storage medium, the following steps may be specifically implemented: and converting the abstract syntax tree after the node replacement into a source code form by using a Babel compiler so as to obtain a target front-end code.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and constructing a simulation data generation function by utilizing mock.
Further, the data template is a pre-created template which can be identified by mock.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and executing the target front-end code based on a browser, and generating and returning simulation data based on the simulation data generation function when the browser calls an interface function.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing describes in detail a front-end data simulation method, apparatus, device, and medium provided by the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing examples are only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. A method for front-end data simulation, comprising:
converting the front-end code into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance;
constructing a simulation data generating function based on a data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing interface function tree nodes in the abstract syntax tree with the data generating function tree nodes;
converting the abstract syntax tree after the node replacement into a source code form to obtain a target front-end code;
and executing the target front-end code, and generating and returning simulation data based on the simulation data generation function when an interface function is called.
2. The front-end data simulation method of claim 1, wherein the front-end code further comprises a comment tag located before the data template.
3. The front-end data simulation method of claim 2, further comprising:
retrieving the data template from the abstract syntax tree based on the annotation tag.
4. The front-end data simulation method of claim 3, wherein the retrieving the data template from the abstract syntax tree based on the annotation tag comprises:
and traversing the abstract syntax tree, searching the annotation mark, and acquiring the data template after the annotation mark.
5. The front-end data simulation method of claim 4, wherein the obtaining the data template after the annotation mark comprises:
and acquiring the data template after the annotation mark by using a regular expression.
6. The front-end data simulation method of claim 1, wherein the converting the front-end code into an abstract syntax tree comprises:
and performing lexical analysis and syntactic analysis on the front-end code to generate an abstract syntax tree.
7. The front-end data simulation method of claim 6, wherein the lexical analysis and the syntactic analysis of the front-end code to generate an abstract syntax tree comprises:
and performing lexical analysis and syntactic analysis on the front-end code by using a Babel compiler to generate an abstract syntax tree.
8. The front-end data simulation method of claim 1, wherein the converting the node-replaced abstract syntax tree into a source code form to obtain a target front-end code comprises:
and converting the abstract syntax tree after the node replacement into a source code form by using a Babel compiler so as to obtain a target front-end code.
9. The front-end data simulation method of claim 1, wherein the building a simulation data generation function based on the data template comprises:
and constructing a simulation data generation function by utilizing mock.
10. The front-end data simulation method of claim 9, wherein the data template is a pre-created mock.
11. The front-end data simulation method of claim 1, wherein executing the target front-end code, upon calling an interface function, generates and returns simulation data based on the simulation data generation function, comprises:
and executing the target front-end code based on a browser, and generating and returning simulation data based on the simulation data generation function when the browser calls an interface function.
12. The front-end data simulation method of any of claims 1 to 11, wherein replacing interface function tree nodes in the abstract syntax tree with data spanning function tree nodes comprises:
and searching an interface function call statement, and replacing the interface function tree node of the statement in the abstract syntax tree with the data generating function tree node.
13. A front-end data simulation apparatus, comprising:
the front-end code conversion module is used for converting the front-end codes into an abstract syntax tree; the front-end code comprises a data template which is created in an annotation form based on a return value of an interface function in advance;
the tree node replacing module is used for constructing a simulation data generating function based on the data template in the abstract syntax tree, converting the simulation data generating function into abstract syntax tree nodes to obtain data generating function tree nodes, and replacing the interface function tree nodes in the abstract syntax tree with the data generating function tree nodes;
the syntax tree conversion module is used for converting the abstract syntax tree after the node replacement into a source code form so as to obtain a target front-end code;
and the front-end data simulation module is used for executing the target front-end code and generating and returning simulation data based on the simulation data generation function when calling the interface function.
14. An electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor for executing the computer program to implement the front-end data simulation method of any of claims 1 to 12.
15. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the front-end data simulation method of any of claims 1 to 12.
CN202211470378.9A 2022-11-23 2022-11-23 Front-end data simulation method, device, equipment and medium Active CN115509514B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211470378.9A CN115509514B (en) 2022-11-23 2022-11-23 Front-end data simulation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211470378.9A CN115509514B (en) 2022-11-23 2022-11-23 Front-end data simulation method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115509514A true CN115509514A (en) 2022-12-23
CN115509514B CN115509514B (en) 2023-03-10

Family

ID=84514472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211470378.9A Active CN115509514B (en) 2022-11-23 2022-11-23 Front-end data simulation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115509514B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220261280A1 (en) * 2020-02-26 2022-08-18 Sap Se Cross-compilation, orchestration, and scheduling for in-memory databases as a service
CN116501303A (en) * 2023-06-25 2023-07-28 北京长亭科技有限公司 Automatic API code generation method and device

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371079A1 (en) * 2014-08-25 2016-12-22 International Business Machines Corporation Correcting non-compliant source code in an integrated development environment
CN107194245A (en) * 2017-05-12 2017-09-22 南京大学 A kind of funcall remodeling method isolated for linux kernel page table
CN110399133A (en) * 2019-06-25 2019-11-01 西北大学 A kind of JavaScript code optimization method based on front end bytecode technology
CN110609693A (en) * 2019-08-15 2019-12-24 平安国际智慧城市科技股份有限公司 Code updating method and device based on data standardization and terminal equipment
CN111010364A (en) * 2018-10-04 2020-04-14 甲骨文国际公司 System for offline object-based storage and simulation of REST responses
CN111124924A (en) * 2019-12-25 2020-05-08 五八同城信息技术有限公司 API (application program interface) deployment method and device, electronic equipment and storage medium
CN112363727A (en) * 2020-11-10 2021-02-12 中国平安人寿保险股份有限公司 JAVA conversion method and device of SQL (structured query language) code, computer equipment and storage medium
CN112860356A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 API call control method and device, electronic equipment and storage medium
CN113407877A (en) * 2021-06-21 2021-09-17 杭州卓健信息科技股份有限公司 Configurable web form implementation method
CN113778848A (en) * 2021-01-29 2021-12-10 北京沃东天骏信息技术有限公司 Test code generation method, device, computer system and medium
US20220044131A1 (en) * 2020-08-06 2022-02-10 Cisco Technology, Inc. Advanced workflow based self-serve automation system
CN114153459A (en) * 2021-12-03 2022-03-08 中国建设银行股份有限公司 Interface document generation method and device
US20220075710A1 (en) * 2020-09-09 2022-03-10 Parasoft Corporation System and method for improved unit test creation
US20220100640A1 (en) * 2020-09-30 2022-03-31 Red Hat, Inc. Generating test input values for functional components based on test coverage analysis
CN114327495A (en) * 2021-12-27 2022-04-12 城云科技(中国)有限公司 AST-based abnormal acquisition code injection method, device and application thereof
CN114625413A (en) * 2022-03-28 2022-06-14 杭州安恒信息技术股份有限公司 Routing data generation method, device, equipment and storage medium
CN114741085A (en) * 2022-03-21 2022-07-12 阿里巴巴(中国)有限公司 Data processing method, device, equipment and storage medium
CN114756183A (en) * 2022-06-16 2022-07-15 深圳市信润富联数字科技有限公司 Data printing method, device, equipment and storage medium
CN114840410A (en) * 2021-02-01 2022-08-02 腾讯科技(深圳)有限公司 Test analysis method and device, computer equipment and storage medium

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371079A1 (en) * 2014-08-25 2016-12-22 International Business Machines Corporation Correcting non-compliant source code in an integrated development environment
CN107194245A (en) * 2017-05-12 2017-09-22 南京大学 A kind of funcall remodeling method isolated for linux kernel page table
CN111010364A (en) * 2018-10-04 2020-04-14 甲骨文国际公司 System for offline object-based storage and simulation of REST responses
CN110399133A (en) * 2019-06-25 2019-11-01 西北大学 A kind of JavaScript code optimization method based on front end bytecode technology
CN110609693A (en) * 2019-08-15 2019-12-24 平安国际智慧城市科技股份有限公司 Code updating method and device based on data standardization and terminal equipment
CN111124924A (en) * 2019-12-25 2020-05-08 五八同城信息技术有限公司 API (application program interface) deployment method and device, electronic equipment and storage medium
US20220044131A1 (en) * 2020-08-06 2022-02-10 Cisco Technology, Inc. Advanced workflow based self-serve automation system
US20220075710A1 (en) * 2020-09-09 2022-03-10 Parasoft Corporation System and method for improved unit test creation
US20220100640A1 (en) * 2020-09-30 2022-03-31 Red Hat, Inc. Generating test input values for functional components based on test coverage analysis
CN112363727A (en) * 2020-11-10 2021-02-12 中国平安人寿保险股份有限公司 JAVA conversion method and device of SQL (structured query language) code, computer equipment and storage medium
CN113778848A (en) * 2021-01-29 2021-12-10 北京沃东天骏信息技术有限公司 Test code generation method, device, computer system and medium
CN114840410A (en) * 2021-02-01 2022-08-02 腾讯科技(深圳)有限公司 Test analysis method and device, computer equipment and storage medium
CN112860356A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 API call control method and device, electronic equipment and storage medium
CN113407877A (en) * 2021-06-21 2021-09-17 杭州卓健信息科技股份有限公司 Configurable web form implementation method
CN114153459A (en) * 2021-12-03 2022-03-08 中国建设银行股份有限公司 Interface document generation method and device
CN114327495A (en) * 2021-12-27 2022-04-12 城云科技(中国)有限公司 AST-based abnormal acquisition code injection method, device and application thereof
CN114741085A (en) * 2022-03-21 2022-07-12 阿里巴巴(中国)有限公司 Data processing method, device, equipment and storage medium
CN114625413A (en) * 2022-03-28 2022-06-14 杭州安恒信息技术股份有限公司 Routing data generation method, device, equipment and storage medium
CN114756183A (en) * 2022-06-16 2022-07-15 深圳市信润富联数字科技有限公司 Data printing method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
丁志军等: "Web服务组合测试综述", 《软件学报》 *
刘爽: "动态分析JavaScript的代码推荐方法", 《数码世界》 *
方文强: "《面向GitHub开源社区的Bug定位***的设计与实现》", 《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220261280A1 (en) * 2020-02-26 2022-08-18 Sap Se Cross-compilation, orchestration, and scheduling for in-memory databases as a service
US11681549B2 (en) * 2020-02-26 2023-06-20 Sap Se Cross-compilation, orchestration, and scheduling for in-memory databases as a service
CN116501303A (en) * 2023-06-25 2023-07-28 北京长亭科技有限公司 Automatic API code generation method and device
CN116501303B (en) * 2023-06-25 2023-11-14 北京长亭科技有限公司 Automatic API code generation method and device

Also Published As

Publication number Publication date
CN115509514B (en) 2023-03-10

Similar Documents

Publication Publication Date Title
CN111708539B (en) Application program code conversion method and device, electronic equipment and storage medium
CN115509514B (en) Front-end data simulation method, device, equipment and medium
US11126930B2 (en) Code completion for dynamically-typed programming languages using machine learning
CN110442330B (en) List component conversion method and device, electronic equipment and storage medium
CN110502227B (en) Code complement method and device, storage medium and electronic equipment
CN105446704A (en) Shader parse method and device
CN113508385B (en) Method and system for formal language processing using subroutine graph
CN114153459A (en) Interface document generation method and device
US11573790B2 (en) Generation of knowledge graphs based on repositories of code
US11500619B1 (en) Indexing and accessing source code snippets contained in documents
CN112988163B (en) Intelligent adaptation method, intelligent adaptation device, intelligent adaptation electronic equipment and intelligent adaptation medium for programming language
CN112631604B (en) Front-end frame implementation method and device
CN113987405A (en) AST-based mathematical expression calculation algorithm
Nacke et al. Learn LLVM 17: A beginner's guide to learning LLVM compiler tools and core libraries with C++
CN117008920A (en) Engine system, request processing method and device, computer equipment and storage medium
JP7344259B2 (en) Pattern transformation methods, apparatus, electronic devices, computer storage media and computer program products in deep learning frameworks
CN114816356A (en) System and method for generating HTTP request code based on interface document
Wang et al. User-Customizable Transpilation of Scripting Languages
CN115562649B (en) Auxiliary writing method and system for source codes of computer mixed program language
Grigorev et al. String-embedded language support in integrated development environment
CN114816425B (en) Method and system for converting an automation language program into a LUA language program
WO2022074712A1 (en) Specification information extraction device, specification information extraction method, and program
CN116909568A (en) Method, device, equipment and storage medium for adding time-consuming codes in source code file
CN117785156A (en) Single file optimization method and device, electronic equipment and storage medium
CN117331518A (en) Debugging variable printing method and device, storage medium and computer equipment

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