CN114416087A - Applet development and generation method and device, electronic device and storage medium - Google Patents

Applet development and generation method and device, electronic device and storage medium Download PDF

Info

Publication number
CN114416087A
CN114416087A CN202210056041.7A CN202210056041A CN114416087A CN 114416087 A CN114416087 A CN 114416087A CN 202210056041 A CN202210056041 A CN 202210056041A CN 114416087 A CN114416087 A CN 114416087A
Authority
CN
China
Prior art keywords
target
component
tree structure
syntax tree
abstract syntax
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.)
Pending
Application number
CN202210056041.7A
Other languages
Chinese (zh)
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.)
Ping An International Financial Leasing Co Ltd
Original Assignee
Ping An International Financial Leasing 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 Ping An International Financial Leasing Co Ltd filed Critical Ping An International Financial Leasing Co Ltd
Priority to CN202210056041.7A priority Critical patent/CN114416087A/en
Publication of CN114416087A publication Critical patent/CN114416087A/en
Pending legal-status Critical Current

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/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses an applet development and generation method, an applet development and generation device, electronic equipment and a storage medium. The method comprises the following steps: determining a target page layout result for performing page layout configuration by adopting the target visual component; determining target abstract syntax tree structure data of a target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure; and generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components. By adopting the scheme, the visual components are abstracted into the AST structure to obtain the abstract syntax tree structure data corresponding to the page layout result, and the abstract syntax tree structure data and the component template codes corresponding to the visual components can be directly used for code development subsequently, so that the modular development is realized according to the existing component resources through simple configuration and the modular template codes of each component.

Description

Applet development and generation method and device, electronic device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a small program development and generation method and device, electronic equipment and a storage medium.
Background
At present, small programs are developed rapidly due to the characteristics of light weight, rich social function entries, strong spreading capacity, self-contained popularization function and the like, ecosphere is increasingly strong, and a plurality of application platforms are distributed with own small program ecospheres.
In the related technology, the small program native code can be adopted for small program development, but the small program development process is complex, the learning and development cost is high, and the benefit is low; some small program development platforms provided in the market can be used for small program development, but the business mode is fixed, the flexibility is low, the small program development platforms cannot have own characteristics, the small program development platforms are used as third-party service platforms, the small program development platforms depend on others on a lot of functions such as data, various binding services are required to be received, and the data and information safety cannot be guaranteed.
Disclosure of Invention
The embodiment of the invention provides a small program development and generation method, a small program development and generation device, electronic equipment and a storage medium, so that the complexity of overall service development is greatly reduced, and common operation and maintenance personnel can easily utilize a platform to complete automatic generation of small program projects.
In a first aspect, an embodiment of the present invention provides an applet development and generation method, where the method includes:
determining a target page layout result for performing page layout configuration by adopting the target visual component;
determining target abstract syntax tree structure data of a target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
In a second aspect, an embodiment of the present invention further provides an applet development and generation apparatus, where the apparatus includes:
the page layout determining module is used for determining a target page layout result of the page layout configuration by adopting the target visual component;
the structure data determining module is used for determining the target abstract syntax tree structure data of the target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and the applet code generation module is used for generating a target applet code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the applet development generation method as provided in any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processing apparatus, implements the applet development generation method as provided in any of the embodiments of the present invention.
The embodiment of the invention provides a small program development generation method, which can determine a target page layout result of page layout configuration by adopting target visual components during small program development, convert the target page layout result into corresponding target abstract syntax tree structure data, and abstract each target visual component in the target abstract syntax tree structure data into an abstract syntax tree structure for representing; and generating a target applet code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to each target visual component in the target abstract syntax tree structure data. By adopting the scheme, the required page layout result can be obtained by performing page layout on the visual component as required, the complexity of code generation is simplified, meanwhile, the visual component is abstracted into an abstract syntax tree AST structure, abstract syntax tree structure data corresponding to the page layout result is obtained, the abstract syntax tree structure data and the component template code corresponding to the visual component can be directly used for code development subsequently, the modular development of the template code which is simply configured and modularized for each component according to the existing component resource is realized, meanwhile, the complexity of overall service development is greatly reduced, and common operation and maintenance personnel can easily utilize the platform to complete the automatic generation of the small program project.
The above summary of the present invention is merely an overview of the technical solutions of the present invention, and the present invention can be implemented in accordance with the content of the description in order to make the technical means of the present invention more clearly understood, and the above and other objects, features, and advantages of the present invention will be more clearly understood.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of an applet development generation method provided in an embodiment of the present invention;
FIG. 2 is an interface diagram of an applet development platform provided in an embodiment of the present invention;
FIG. 3 is a diagram illustrating the configuration of components on an applet development platform provided in an embodiment of the present invention;
FIG. 4 is a diagram illustrating component implementation based on an applet development platform provided in an embodiment of the present invention;
FIG. 5 is a flow chart of another applet development generation method provided in an embodiment of the present invention;
FIG. 6 is a schematic diagram of generating a page file based on an applet development platform according to an embodiment of the present invention;
fig. 7 is a block diagram of an applet development generation apparatus provided in an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations (or steps) can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The applet development method, apparatus, electronic device, and storage medium provided in the present application are described in detail by the following embodiments and alternatives thereof.
Fig. 1 is a flowchart of an applet development and generation method provided in an embodiment of the present invention. The embodiment of the invention can be suitable for the situation of modular development of the small programs. The method can be executed by an applet development device, which can be implemented in software and/or hardware and integrated on any electronic device with network communication function. As shown in fig. 1, the applet development and generation method provided in this embodiment may include the following steps:
s110, determining a target page layout result of the page layout configuration by adopting the target visual component.
Referring to fig. 2, when developing an applet, a user may perform page layout on a started page using a pre-configured target visual component according to a business requirement to obtain a target page layout result. And the multiple page layouts involved in the small program can gradually complete the small program development.
S120, determining target abstract syntax tree structure data of a target page layout result; the target visual component in the target abstract syntax tree structure data is represented using an abstract syntax tree structure.
After the target page layout result is obtained, the target page layout result can be converted into corresponding target abstract syntax tree structure data, the target abstract syntax tree can represent the source code of the target page layout result through tree representation of an abstract syntax structure, one node in the target abstract syntax tree corresponds to one visual component, and the visual component is abstracted into an abstract syntax tree structure to represent.
In an alternative of this embodiment, determining a target page layout result for page layout configuration using the target visual component may include the following steps A1-A2:
a1, acquiring at least two target visual components dragged from the candidate visual components for page layout; the candidate visual components include base components, functional components, and custom components that support personalized configurations.
Step A2, configuring the component attribute and the component combination of at least two target visual components to obtain the target page layout result.
Referring to fig. 2 and fig. 3, the candidate visual component library may include a plurality of candidate visual components that can be dragged, for example, the candidate visual component library may include, but is not limited to, a base component, a functional component, and a custom component that supports personalized configuration. The basic components are provided, and the functional modules can be assembled by utilizing the self-layout of the basic components, so that the flexibility is increased, more attributes can be defined by users, and more personalized requirements are realized; the platform opens a unified visual component interface, and can write visual components by self for users with development capability, thereby enriching the visual component library of the platform.
Referring to fig. 2 and fig. 3, when a user performs page layout, in response to a drag event for a visual component, at least one target visual component can be sequentially dragged from a visual component library to a page layout window, and displayed in the page layout window according to layout requirements. Referring to fig. 4, after one or more target visual components are dragged into the page layout window through multiple dragging, each target visual component can be combined and arranged according to requirements, meanwhile, component attribute configuration can be performed on each visual component, it is ensured that each visual component is configured with corresponding component attributes, and page layout can be completed through dynamic configuration.
By adopting the alternative scheme, a rich visual component library is formed after the visual components are standardized, for example, the visual component library comprises basic components, functional components, custom components and the like, different service scene requirements are met, operators can set component attributes and page information according to the existing standard visual component resources without understanding code development, and complete pages and projects can be assembled through simple configuration. Meanwhile, the visual assembly supporting personalized customization is arranged, so that the page is more flexibly arranged and can have own characteristics.
And S130, generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
Each visual component can be pre-configured with a corresponding modularized component template code, and code development is not required to be repeatedly performed on each visual component, so that waste of code development resources corresponding to each component is avoided, and subsequent testing and maintenance costs are effectively reduced. Meanwhile, because the code logic of each visual component is configured in advance, the logic related to the component does not need to be considered when the visual component is subsequently used for code development, the period for developing the small program code by using the visual component is effectively shortened, and the small program development efficiency is improved.
The page layout result is converted into a uniform and universal AST structure, only limited codes need to be maintained, development and maintenance cost is reduced, the abstract syntax tree structure data only contain required component attributes and attributes dependent on the required component attributes, unused redundant information is filtered, and the corresponding applet code execution file can be generated by rendering the target abstract syntax tree structure data by using a component template code corresponding to the target visual component according to actual rendering requirements. Comparing H5 with the applet project code, both underlying layers are native JS, but transcoding is in component templates, which can simplify the transcoding process.
In an alternative of this embodiment, configuring the component properties of at least two target visual components may include the following steps B1-B2:
and step B1, acquiring the component attribute dynamic configuration input of at least two target visual components.
And step B2, binding the component property dynamic configuration input of at least two target visual components with the abstract syntax tree structure of the target visual components in the target abstract syntax tree structure data.
The component attributes comprise description of component key meta information, component attribute information, component dynamic data and event interactive operation information.
Referring to fig. 2 and 3, the visual components are abstracted into an AST data structure, and the visual components include descriptions of key meta information of the components, attribute information of the components, dynamic data, and event interaction operation information. The components are used as minimum units, and in the visual component configuration window, the dynamic configuration input of the component attributes can be performed aiming at each visual component, so that the parameters corresponding to the data attributes can be customized in a certain range.
Referring to fig. 4, each component has a component template code corresponding to a modular configuration, so that after the component properties of each target visual component are dynamically configured, the component properties of each target visual component can be dynamically configured and input and bound to the abstract syntax tree structure of the target visual component in the target abstract syntax tree structure data. Binding dynamic property and data source which can be edited by each visual component in the component template code template fragment, and establishing a mapping relation between the dynamic property and the data source, so that the component template can directly call the component property information bound by the configured AST structure data to generate and develop the applet code.
By adopting the alternative scheme, the component template code template of each visual component is set and fixed in the system in advance, the template code of the component can be dynamically constructed according to the service requirement by adjusting the component attribute, a user does not need to have code development capability, the cost of developing language learning aiming at code development is reduced, each code does not need to be re-developed, only the bound template code needs to be adjusted according to the service requirement of the code, and meanwhile, the template is taken as a rendering unit, so that more UI library components can be compatible.
It is understood that the electronic device for applet development generation may be a server, a terminal device, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
According to the small program development and generation method provided by the embodiment of the invention, the required page layout result can be obtained by performing page layout on the visual component as required, the complexity of code generation is simplified, meanwhile, the visual component is abstracted into an abstract syntax tree AST structure, abstract syntax tree structure data corresponding to the page layout result is obtained, and then, the abstract syntax tree structure data and the component template code corresponding to the visual component can be directly used for code development, so that the modular development is realized through simple configuration and each component modular template code according to the existing component resources, the complexity of overall service development is greatly reduced, and common operation and maintenance personnel can easily utilize a platform to complete the automatic generation of small program projects.
Fig. 5 is a flowchart of another applet development and generation method provided in the embodiment of the present invention, and the embodiment of the present invention further optimizes the foregoing embodiment on the basis of the foregoing embodiment, and the embodiment of the present invention may be combined with various alternatives in one or more of the foregoing embodiments. As shown in fig. 5, the applet development and generation method provided in this embodiment may include the following steps:
s510, determining a target page layout result of the page layout configuration by adopting the target visual component.
S520, determining target abstract syntax tree structure data of a target page layout result; the target visual component in the target abstract syntax tree structure data is represented using an abstract syntax tree structure.
S530, generating a target page file corresponding to a target page layout result according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components in the target abstract syntax tree structure data.
In an alternative of this embodiment, generating the target page file corresponding to the target page layout result according to the target abstract syntax tree structure data and the component template code corresponding to each target visual component in the target abstract syntax tree structure data may include the following steps C1-C2:
and step C1, adding the component property information bound by the target visual component in the target abstract syntax tree structure data into the component template code segment mapped by the target visual component to obtain the configured component template code.
And step C2, rendering the page corresponding to the target page layout result according to the configured component template codes, and generating a target page file corresponding to the target page layout result.
Referring to fig. 6, in the target abstract syntax tree structure data, component attribute information is bound to the target visual component corresponding to each node, and the component attribute is dynamically configured. Each visual component is configured with a corresponding component template code, a target visual component corresponding to each node is dynamically and circularly traversed from a target abstract syntax tree structure data root node, dynamic component attribute information bound to each target visual component is obtained, and the component attribute information is added to a component template code fragment mapped by the corresponding target visual component, for example, the component attribute information is sequentially added to a hypertext markup language (HTML) part, a Script part and a Style part of the component template code fragment in a classified manner, so that the configured component template code can be obtained.
Referring to fig. 6, a DOM tree is rendered dynamically and recursively from a root node, splitting data containing complete page layout information into applet page file structures. Optionally, rendering a page corresponding to the target page layout result according to the configured component template code, and generating a target page file corresponding to the target page layout result may include: loading the HTML part content in the configured component template code fragment to a HTML part of a page corresponding to the target page layout result by operating the configured component template code; loading the Script part content in the configured component template code segment to the page Script part corresponding to the target page layout result; and loading the Style part content in the configured component template code segment to a page Style part corresponding to the target page layout result to obtain a target page file.
With the above alternative, comparing H5 with the applet project code, their bottom layer is native JS, but the code translation is in units of component templates, which can simplify the transcoding process; effectively reduce the design threshold, satisfy self-defined demand, reduce the repetition work, promote work efficiency, help to build fast and stabilize high-quality marketing product, reduce cost helping hand business increases.
And S540, performing logic combination on at least one target page file to obtain a target applet code execution file.
In an alternative of this embodiment, logically combining at least one target page file to obtain a target applet code execution file may include the following steps D1-D2:
step D1, determining a target configuration file adopted by at least one target page file; the target configuration file is used for indicating the combined logic relationship between the target page files.
And D2, executing the script command according to the at least one target page file and the target configuration file, assembling to obtain a Uniapp project, and compiling to obtain a corresponding target applet code execution file.
By adopting the alternative scheme, the page files which are laid out can generate different small program projects through code conversion at the server and be displayed on a plurality of platforms, so that the mobile terminal page is simpler to manufacture, zero threshold building is realized, and a one-stop solution is provided for the middle background.
According to the small program development and generation method provided by the embodiment of the invention, the required page layout result can be obtained by performing page layout on the visual component as required, the complexity of code generation is simplified, meanwhile, the visual component is abstracted into an abstract syntax tree AST structure, abstract syntax tree structure data corresponding to the page layout result is obtained, and then, the abstract syntax tree structure data and the component template code corresponding to the visual component can be directly used for code development, so that the modular development is realized through simple configuration and each component modular template code according to the existing component resources, the complexity of overall service development is greatly reduced, and common operation and maintenance personnel can easily utilize a platform to complete the automatic generation of small program projects.
Fig. 7 is a block diagram of an applet development and generation apparatus provided in the embodiment of the present invention. The embodiment of the invention can be suitable for the situation of modular development of the small programs. The device can be implemented in software and/or hardware and integrated on any electronic equipment with network communication function. As shown in fig. 7, the applet development generating apparatus provided in the embodiment of the present application may include the following: a page layout determination module 710, a structure data determination module 720, and an applet code generation module 730. Wherein:
a page layout determining module 710, configured to determine a target page layout result of the page layout configuration performed by using the target visual component;
a structure data determining module 720, configured to determine target abstract syntax tree structure data of the target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and an applet code generating module 730, configured to generate a target applet code execution file according to the target abstract syntax tree structure data and the component template code corresponding to the target visual component.
On the basis of the foregoing embodiment, optionally, the page layout determining module 710 includes:
acquiring at least two target visual components dragged from the candidate visual components for page layout;
performing component attribute configuration and component combination configuration on at least two target visual components to obtain a target page layout result;
the candidate visual components comprise a basic component, a functional component and a custom component supporting personalized configuration.
On the basis of the foregoing embodiment, optionally, performing component attribute configuration on at least two target visual components, including:
acquiring component attribute dynamic configuration input of at least two target visual components;
dynamically configuring and inputting component properties of at least two target visual components and binding the abstract syntax tree structure of the target visual components in the target abstract syntax tree structure data;
the component attributes comprise the description of component key meta information, component attribute information, component dynamic data and event interaction operation information.
On the basis of the foregoing embodiment, optionally, generating a target applet code execution file according to the target abstract syntax tree structure data and the component template code corresponding to the target visual component, includes:
generating a target page file corresponding to a target page layout result according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components in the target abstract syntax tree structure data;
and logically combining at least one target page file to obtain a target small program code execution file.
On the basis of the above embodiment, optionally, the applet code generating module 730 includes:
adding the component attribute information bound to the target visual component in the target abstract syntax tree structure data into a component template code segment mapped by the target visual component to obtain a configured component template code;
and rendering the page corresponding to the target page layout result according to the configured component template code, and generating a target page file corresponding to the target page layout result.
On the basis of the foregoing embodiment, optionally, rendering a page corresponding to the target page layout result according to the configured component template code, and generating a target page file corresponding to the target page layout result includes:
loading the HTML part content in the configured component template code fragment to a HTML part of a page corresponding to the target page layout result;
loading the Script part content in the configured component template code segment to the page Script part corresponding to the target page layout result;
and loading the Style part content in the configured component template code segment to a page Style part corresponding to the target page layout result to obtain a target page file.
On the basis of the above embodiment, optionally, logically combining at least one target page file to obtain a target applet code execution file, includes:
determining a target configuration file adopted by at least one target page file; the target configuration file is used for indicating the combinational logic relationship among the target page files;
and executing a script command according to the at least one target page file and the target configuration file, assembling to obtain a Uniapp project, and compiling to obtain a corresponding target applet code execution file.
The applet development and generation device provided in the embodiment of the present invention can execute the applet development and generation method provided in any embodiment of the present invention, and has the corresponding functions and beneficial effects of executing the applet development and generation method.
Fig. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. As shown in fig. 8, the electronic device provided in the embodiment of the present invention includes: one or more processors 810 and storage 820; the processor 810 in the electronic device may be one or more, and fig. 8 illustrates one processor 810 as an example; storage 820 is used to store one or more programs; the one or more programs are executed by the one or more processors 810, such that the one or more processors 810 implement the applet development method according to any one of the embodiments of the invention.
The electronic device may further include: an input device 830 and an output device 840.
The processor 810, the storage device 820, the input device 830 and the output device 840 in the electronic apparatus may be connected by a bus or other means, and fig. 8 illustrates an example of connection by a bus.
The storage device 820 in the electronic device is used as a computer-readable storage medium for storing one or more programs, which may be software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the applet development and generation method provided in the embodiment of the present invention. The processor 810 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the storage 820, that is, implementing the applet development and generation method in the above method embodiments.
The storage device 820 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, storage 820 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 820 may further include memory located remotely from processor 810, which may be connected to devices over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 840 may include a display device such as a display screen.
And, when the one or more programs included in the electronic device are executed by the one or more processors 810, the programs perform the following operations:
determining a target page layout result for performing page layout configuration by adopting the target visual component;
determining target abstract syntax tree structure data of a target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
Of course, it can be understood by those skilled in the art that when one or more programs included in the electronic device are executed by the one or more processors 810, the programs may also perform related operations in the applet development generation method provided in any embodiment of the present invention.
An embodiment of the present invention provides a computer-readable medium on which a computer program is stored, the program being used for executing an applet development generation method when executed by a processor, the method including:
determining a target page layout result for performing page layout configuration by adopting the target visual component;
determining target abstract syntax tree structure data of a target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be appreciated that the subject application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An applet development generation method, comprising:
determining a target page layout result for performing page layout configuration by adopting the target visual component;
determining target abstract syntax tree structure data of a target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and generating a target small program code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
2. The method of claim 1, wherein determining a target page layout result for page layout configuration using a target visual component comprises:
acquiring at least two target visual components dragged from the candidate visual components for page layout;
performing component attribute configuration and component combination configuration on at least two target visual components to obtain a target page layout result;
the candidate visual components comprise a basic component, a functional component and a custom component supporting personalized configuration.
3. The method of claim 2, wherein configuring component properties of at least two target visual components comprises:
acquiring component attribute dynamic configuration input of at least two target visual components;
dynamically configuring and inputting component properties of at least two target visual components and binding the abstract syntax tree structure of the target visual components in the target abstract syntax tree structure data;
the component attributes comprise the description of component key meta information, component attribute information, component dynamic data and event interaction operation information.
4. The method of claim 1, wherein generating a target applet code execution file according to the target abstract syntax tree structure data and the component template code corresponding to the target visual component comprises:
generating a target page file corresponding to a target page layout result according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components in the target abstract syntax tree structure data;
and logically combining at least one target page file to obtain a target small program code execution file.
5. The method of claim 4, wherein generating a target page file corresponding to a target page layout result according to the target abstract syntax tree structure data and the component template code corresponding to each target visual component in the target abstract syntax tree structure data comprises:
adding the component attribute information bound to the target visual component in the target abstract syntax tree structure data into a component template code segment mapped by the target visual component to obtain a configured component template code;
and rendering the page corresponding to the target page layout result according to the configured component template code, and generating a target page file corresponding to the target page layout result.
6. The method of claim 5, wherein rendering the page corresponding to the target page layout result according to the configured component template code to generate the target page file corresponding to the target page layout result comprises:
loading the HTML part content in the configured component template code fragment to a HTML part of a page corresponding to the target page layout result;
loading the Script part content in the configured component template code segment to the page Script part corresponding to the target page layout result;
and loading the Style part content in the configured component template code segment to a page Style part corresponding to the target page layout result to obtain a target page file.
7. The method of claim 4, wherein logically combining at least one target pagefile to obtain a target applet code execution file comprises:
determining a target configuration file adopted by at least one target page file; the target configuration file is used for indicating the combinational logic relationship among the target page files;
and executing a script command according to the at least one target page file and the target configuration file, assembling to obtain a Uniapp project, and compiling to obtain a corresponding target applet code execution file.
8. An applet development generation apparatus, characterized in that the apparatus comprises:
the page layout determining module is used for determining a target page layout result of the page layout configuration by adopting the target visual component;
the structure data determining module is used for determining the target abstract syntax tree structure data of the target page layout result; target visual components in the target abstract syntax tree structure data are expressed by adopting an abstract syntax tree structure;
and the applet code generation module is used for generating a target applet code execution file according to the target abstract syntax tree structure data and the component template codes corresponding to the target visual components.
9. An electronic device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the applet development generation method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, characterized in that the program, when executed by a processing means, implements the applet development generation method as claimed in any one of claims 1-7.
CN202210056041.7A 2022-01-18 2022-01-18 Applet development and generation method and device, electronic device and storage medium Pending CN114416087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210056041.7A CN114416087A (en) 2022-01-18 2022-01-18 Applet development and generation method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210056041.7A CN114416087A (en) 2022-01-18 2022-01-18 Applet development and generation method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114416087A true CN114416087A (en) 2022-04-29

Family

ID=81273183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210056041.7A Pending CN114416087A (en) 2022-01-18 2022-01-18 Applet development and generation method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114416087A (en)

Similar Documents

Publication Publication Date Title
US11861334B2 (en) Providing communication between a client system and a process-based software application
US10216554B2 (en) API notebook tool
US20210034336A1 (en) Executing a process-based software application in a first computing environment and a second computing environment
US9645989B2 (en) Techniques to generate custom electronic forms using custom content
US8930824B2 (en) Facilitating propagation of user interface patterns or themes
US20110010613A1 (en) System and method for building mixed mode execution environment for component applications
US9633332B2 (en) Generating machine-understandable representations of content
CN112100550A (en) Page construction method and device
CN109194714B (en) File pushing method and device, terminal device and storage medium
CN110795649A (en) Target page display method, device and system and electronic equipment
CN110795181A (en) Application program interface display method and device based on skip protocol and electronic equipment
CN114036439A (en) Website building method, device, medium and electronic equipment
US20220300262A1 (en) Method for constructing, running and implementing cross-platform application, terminal, server and system
CN111078228A (en) Method and device for converting webpage into small program, server and storage medium
CN112486482A (en) Page display method and device
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
Miravet et al. Framework for the declarative implementation of native mobile applications
CN114416087A (en) Applet development and generation method and device, electronic device and storage medium
CN112732254B (en) Webpage development method, webpage development device, computer equipment and storage medium
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN103970513A (en) Source data information access method and platform
CN113342450A (en) Page processing method and device, electronic equipment and computer readable medium
Honkala Web user interaction: a declarative approach based on XForms
CN113961279A (en) Page rendering method, device, server and storage medium
CN114553688B (en) Cloud computing deployment method, device, equipment and computer readable storage medium

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