CN113590119A - Page creation method, electronic device and storage medium - Google Patents

Page creation method, electronic device and storage medium Download PDF

Info

Publication number
CN113590119A
CN113590119A CN202110865347.2A CN202110865347A CN113590119A CN 113590119 A CN113590119 A CN 113590119A CN 202110865347 A CN202110865347 A CN 202110865347A CN 113590119 A CN113590119 A CN 113590119A
Authority
CN
China
Prior art keywords
page
preset
target
template
extension
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
CN202110865347.2A
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.)
Yuanguang Software Co Ltd
Original Assignee
Yuanguang Software 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 Yuanguang Software Co Ltd filed Critical Yuanguang Software Co Ltd
Priority to CN202110865347.2A priority Critical patent/CN113590119A/en
Publication of CN113590119A publication Critical patent/CN113590119A/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

Abstract

The application discloses a page creation method, electronic equipment and a computer-readable storage medium. The method comprises the following steps: determining a template page to be inherited by a target page according to a preset root node of the target page; expanding the template page according to a preset expansion rule of the target page to obtain the target page; and presetting an expansion rule based on the nodes of the template page. By the method, the labor cost required by page creation can be reduced, and the page creation efficiency is improved.

Description

Page creation method, electronic device and storage medium
Technical Field
The present application relates to the field of web project development technologies, and in particular, to a page creation method, an electronic device, and a computer-readable storage medium.
Background
When developing a web project, developers need to create different pages separately. Therefore, the developer needs to perform repeated operations when creating the same portion of different pages. Moreover, when the same part in different pages is adjusted in the subsequent page upgrading process, the same part in different pages needs to be adjusted respectively, that is, each page needs to be adjusted, which not only requires high labor cost, but also has low efficiency.
Disclosure of Invention
The application provides a page creation method, an electronic device and a computer readable storage medium, which can solve the problems of high labor cost and low efficiency of the conventional page creation method.
In order to solve the technical problem, the application adopts a technical scheme that: a method of feature matching is provided. The method comprises the following steps: determining a template page to be inherited by a target page according to a preset root node of the target page; expanding the template page according to a preset expansion rule of the target page to obtain the target page; and presetting an expansion rule based on the nodes of the template page.
In order to solve the above technical problem, another technical solution adopted by the present application is: an electronic device is provided, which comprises a processor and a memory connected with the processor, wherein the memory stores program instructions; the processor is configured to execute the program instructions stored by the memory to implement the above-described method.
In order to solve the above technical problem, the present application adopts another technical solution: there is provided a computer readable storage medium storing program instructions that when executed are capable of implementing the above method.
By the mode, when the page is created, the repeated parts (nodes) of different pages can be obtained by directly inheriting the template page, and at least one node of the template page is only required to be expanded to obtain the corresponding non-repeated part. Therefore, the repeated part can realize different page multiplexing without repeated operation of developers. Furthermore, in the subsequent upgrading process, the automatic upgrading of different pages can be completed only by modifying the template pages. Therefore, the method provided by the application can reduce the labor cost required by page creation and improve the efficiency of page creation.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a page creation method of the present application;
FIG. 2 is a schematic view of the detailed process of S11 in FIG. 1;
FIG. 3 is a schematic view of the detailed process of S12 in FIG. 1;
FIG. 4 is a schematic structural diagram of an embodiment of an electronic device of the present application;
FIG. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the 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.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Fig. 1 is a flowchart illustrating an embodiment of a page creation method according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 1 is not limited in this embodiment. As shown in fig. 1, the present embodiment may include:
s11: and determining a template page to be inherited by the target page according to a preset root node of the target page.
If a user (generally, a developer) needs to create a target page, an initial target page can be created by inputting an instruction through a user interface, and extensions attributes are set for a preset root node included in the initial target page. The preset root node may be any node included in the initial target page, that is, any node included in the target page before the template page is not inherited, for example, a first node. The value of the extensions attribute is the storage path of the template page to be inherited, so that the template page to be inherited can be determined according to the extensions attribute of the preset root node.
The template page comprises a view corresponding to the node and a business logic. For example, the template page is a browser page, which includes a node "search box", and the view of the "search box" includes color, length, width, and so on; the business logic corresponding to the search box is the operation logic for realizing the related functions through the search box. Correspondingly, in the application, the inheritance of the target page to the template page can be divided into two parts, wherein one part is a view corresponding to a node of the inheritance template page; the other part is the business logic corresponding to the node that inherits the template page. For inheritance of business logic, the inheritance mode of ES or TS can be directly followed.
Referring to fig. 2 in combination, S11 may include the following sub-steps:
s111: and analyzing the target page containing the preset root node into target structure data in a preset format.
It can be understood that the view of the initial target page is unstructured data in a character string format, and this step is essentially to parse the view of the initial target page into target structured data in a preset format. The preset format may be an Ast format, and the target structure data may be represented as pageAst.
S112: and reading a preset root node from the target structure data to determine a template page.
After the target structure data is analyzed, the preset root node can be directly read from the target data, and then the template page is determined according to the extensions attribute of the preset root node.
In addition, after the extensions attribute is set for the preset root node, a corresponding preset extension rule needs to be set for the initial target page. For a detailed description of the preset extension rule, refer to the related description of the following steps.
S12: and expanding the template page according to a preset expansion rule of the target page to obtain the target page.
The preset expansion rule is based on the nodes of the template page.
And expanding the template page according to a preset expansion rule by using the nodes of the template page. The preset extension rule comprises an extension type and an extension target, wherein the extension type is one of new addition, removal (remove) and replacement (replace), and the new addition comprises two types of a new addition child node (append) and a new addition sibling node (insert). The extended target is used to represent a node of the template page. In other words, the value of the extension target is identification information of the node in the template page, for example, "# id", ". class", "tagName", or the like. Therefore, the template page is expanded according to the preset expansion rule, and the expansion target represents the node of the template page on the basis of the corresponding expansion type, namely, the node of the template page is subjected to one operation of adding, replacing and removing. In case the extension type is replacement, the preset extension rule includes a new node. And under the condition that the extension type is newly added, the preset extension rule comprises an extension position, and the extension position is a position relative to the extension target. In case of an apend, the extension position belongs to the position category of the extension target, for example, before the end position. If insert, the extension positions are the upper (before), lower (after), left (left), and right (right) sides of the extension target.
And performing new addition operation on the nodes of the template page, namely adding new nodes at the extended positions. And (4) carrying out replacement operation on the nodes of the template page, namely replacing the nodes of the template page with new nodes. And removing the nodes of the template page, namely deleting the nodes of the template page.
In one embodiment, the preset extension rule is an extension attribute added to at least one node of the template page. The case of different extension types is explained as follows:
if the extension type is a new child node, the extension attributes plugin can be represented as:
<div:plugins=”{type:’append’,place:’xxx’,target:’xxx’}”><div>。
wherein type represents an extension type, place represents an extension position, target represents an extension target, and div represents a new node.
If the extension type is a newly added sibling node, the extension attributes plugins can be expressed as:
<div:plugins=”{type:’append’,place:’xxx’,target:’xxx’}”><div>。
for example, the extended attribute is:
<div:plugins=”{type:’insert’,place:’before’,target:’#demo’}”><div>
meaning that a child node div needs to be added above demo.
If the extension type is a replacement node, the extension attributes plugins can be expressed as:
plugins=”{type:’replace’,place:’xxx’,target:’xxx’}”。
if the extension type is remove node, the extension attributes plugins can be expressed as:
plugins=”{type:’insert’,place:’xxx’,target:’xxx’}”。
as another embodiment, the preset expansion rule is an expansion node added to the template page. The case of different extension types is illustrated as follows:
if the extension type is a new child node, the extension node plugins can be represented as:
<plugins type=”append”,place=”xxx”,target=”xxx”>
child node expanded content
</plugins>
Wherein the content extension at the child node comprises one or more new child nodes.
If the extension type is a newly added brother node, the extension node plugins can be represented as:
<plugins type=”insert”,place=”xxx”,target=”xxx”>
brother node extension content
</plugins>
Wherein the sibling extension content includes one or more new sibling.
Referring to fig. 3 in combination, S12 may include the following sub-steps:
s121: and analyzing the template page into template structure data in a preset format, and expanding the template structure data according to a preset expansion rule.
It can be understood that the view of the template is unstructured data in a character string format, and this step is essentially to parse the view of the template into template structured data in a preset format. The preset format may be an Ast format, and the template structure data may be represented as templateAst.
S122: and compiling the expanded template structure data to obtain a target page.
The compiling is opposite to the parsing process, namely the compiling is to compile the target structure data into the target non-structure data in a character string format.
Through the implementation of the embodiment, when the page is created, the repeated parts (nodes) of different pages can be obtained by directly inheriting the template page, and at least one node of the template page is only required to be expanded to obtain the corresponding non-repeated part. Therefore, the repeated part can realize different page multiplexing without repeated operation of developers. Furthermore, in the subsequent upgrading process, the automatic upgrading of different pages can be completed only by modifying the template pages. Therefore, the method provided by the application can reduce the labor cost required by page creation and improve the efficiency of page creation.
Fig. 4 is a schematic structural diagram of an embodiment of an electronic device according to the present application. As shown in fig. 4, the electronic device includes a processor 21, and a memory 22 coupled to the processor 21.
Wherein the memory 22 stores program instructions for implementing the method of any of the above embodiments; processor 21 is operative to execute program instructions stored by memory 22 to implement the steps of the above-described method embodiments. The processor 21 may also be referred to as a CPU (Central Processing Unit). The processor 21 may be an integrated circuit chip having signal processing capabilities. The processor 21 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
FIG. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application. As shown in fig. 5, the computer-readable storage medium 30 of the embodiment of the present application stores program instructions 31, and the program instructions 31 implement the method provided by the above-mentioned embodiment of the present application when executed. The program instructions 31 may form a program file stored in the computer-readable storage medium 30 in the form of a software product, so as to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned computer-readable storage medium 30 includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (10)

1. A page creation method, comprising:
determining a template page to be inherited by a target page according to a preset root node of the target page;
expanding the template page according to a preset expansion rule of the target page to obtain the target page; the preset expansion rule is based on the nodes of the template page.
2. The method of claim 1,
the preset expansion rule is an expansion attribute added to at least one node of the template page.
3. The method of claim 1,
the preset expansion rule is an expansion node added to the template page.
4. The method of claim 1, wherein the preset extension rule comprises an extension type, and wherein the extension type is one of new, removed, and replaced.
5. The method according to claim 4, wherein the preset expansion rule comprises an expansion target, and the expansion target is used for representing a node of the template page.
6. The method of claim 4, wherein the preset extension rule comprises a new node.
7. The method of claim 6, wherein the extension type is new, and the preset extension rule comprises an extension position, and the extension position is an orientation relative to the extension target.
8. The method according to claim 1, wherein the determining, according to a preset root node of a target page, a template page to be inherited by the target page comprises:
analyzing the target page containing the preset root node into target structure data in a preset format; reading the preset root node from the target structure data to determine the template page;
the expanding the template page according to the preset expansion rule of the target page to obtain the target page includes:
analyzing the template page into template structure data in a preset format, and expanding the template structure data according to the preset expansion rule;
and compiling the expanded template structure data to obtain the target page.
9. An electronic device comprising a processor, a memory coupled to the processor, wherein,
the memory stores program instructions;
the processor is configured to execute the program instructions stored by the memory to implement the method of any of claims 1-8.
10. A computer-readable storage medium, characterized in that the storage medium stores program instructions that, when executed, implement the method of any of claims 1-8.
CN202110865347.2A 2021-07-29 2021-07-29 Page creation method, electronic device and storage medium Pending CN113590119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110865347.2A CN113590119A (en) 2021-07-29 2021-07-29 Page creation method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110865347.2A CN113590119A (en) 2021-07-29 2021-07-29 Page creation method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113590119A true CN113590119A (en) 2021-11-02

Family

ID=78252056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110865347.2A Pending CN113590119A (en) 2021-07-29 2021-07-29 Page creation method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113590119A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140129924A1 (en) * 2012-11-06 2014-05-08 Open Text S.A. System and method for creation of templates
WO2016177250A1 (en) * 2015-05-05 2016-11-10 阿里巴巴集团控股有限公司 Client page rendering method and apparatus
CN111666526A (en) * 2020-06-17 2020-09-15 广州市百果园信息技术有限公司 Page generation method, device, equipment and storage medium
CN112416339A (en) * 2020-02-17 2021-02-26 上海哔哩哔哩科技有限公司 Page development method and device and computer equipment
CN112486491A (en) * 2020-12-15 2021-03-12 平安国际智慧城市科技股份有限公司 Page generation method and device, computer equipment and storage medium
CN112905944A (en) * 2021-04-06 2021-06-04 成都新希望金融信息有限公司 Page online dynamic generation method and device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140129924A1 (en) * 2012-11-06 2014-05-08 Open Text S.A. System and method for creation of templates
WO2016177250A1 (en) * 2015-05-05 2016-11-10 阿里巴巴集团控股有限公司 Client page rendering method and apparatus
CN112416339A (en) * 2020-02-17 2021-02-26 上海哔哩哔哩科技有限公司 Page development method and device and computer equipment
CN111666526A (en) * 2020-06-17 2020-09-15 广州市百果园信息技术有限公司 Page generation method, device, equipment and storage medium
CN112486491A (en) * 2020-12-15 2021-03-12 平安国际智慧城市科技股份有限公司 Page generation method and device, computer equipment and storage medium
CN112905944A (en) * 2021-04-06 2021-06-04 成都新希望金融信息有限公司 Page online dynamic generation method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN111708539B (en) Application program code conversion method and device, electronic equipment and storage medium
US7096420B1 (en) Method and system for automatically documenting system command file tags and generating skeleton documentation content therefrom
US8181105B2 (en) Apparatus, method, and program that performs syntax parsing on a structured document in the form of electronic data
CN111428462A (en) Communication protocol template construction method and terminal equipment
CN106294493B (en) Method and device for realizing document format conversion
CN102637135A (en) Method and device for compiling CSS (cascading style sheet)
CN111061643B (en) SDK cluster compatibility detection method and device, electronic equipment and storage medium
CN109145235B (en) Method and device for analyzing webpage and electronic equipment
CN108647025A (en) Processing method and processing device, electronics and the storage device of DOM Document Object Model interior joint
CN108536489B (en) Method, apparatus, and computer-readable storage medium for matching resource environments
JP4688816B2 (en) Effective space-saving XML parsing
CN112181924A (en) File conversion method, device, equipment and medium
WO2023087720A1 (en) Applet generation method and apparatus, device and storage medium
CN109815243B (en) Structured storage method and device during document interface modification
CN111506342A (en) Version difference detection method and device, electronic equipment and storage medium
US20120151441A1 (en) Efficient generation of executable file from program files when some of the program files expressly incorporate other program files
WO2024066995A1 (en) Text code editing method and system
CN113590119A (en) Page creation method, electronic device and storage medium
CN110764816A (en) Method, device and medium for managing page
Fritsche et al. A Look-Ahead Strategy for Rule-Based Model Transformations.
CN114625373A (en) Application conversion method and device, electronic equipment and storage medium
CN111736848B (en) Packet conflict positioning method, device, electronic equipment and readable storage medium
CN111444456B (en) Style editing method and device and electronic equipment
CN114489594A (en) Method for constructing command parser, method and device for processing command parsing
WO2019169720A1 (en) Automatic test assertion method and apparatus, and computer device and 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