Page generation method, device, electronic device and program product
By using the translation processing of environment fields and component fields during the page generation process, a unified and simplified page executable code is generated, which solves the problem of high code complexity in Vue.JS development, and realizes simplification and unified management of code.
Patent Information
- Application Number
- CN202111507476.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In Vue.JS-based page development, due to the inconsistent coding style and level of developers, the page executable code is highly complex, which is not conducive to subsequent maintenance.
By obtaining the page source code for page browsing requests, using the environment field to determine the translation environment, and translating the component field to generate executable code, combined with static syntax detection to ensure the code quality.
The generated page has low complexity and a unified code style, which is convenient for subsequent management and maintenance.
Smart Images

Figure CN114168139B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a page generation method, apparatus, electronic device, and program product. Background Art
[0002] With the development of the Internet industry, the page development technology based on the web front-end is also gradually developing. Vue.JS and its related dependencies are one of the open-source web front-end development frameworks and solutions.
[0003] In the prior art, the page development based on Vue.JS is generally implemented by developers coding based on the business logic of the business system.
[0004] However, the coding styles and coding levels of developers are inconsistent, which will result in different executable codes being used by different developers when writing the business logic of the same business system, increasing the complexity of the executable code of the page and being unfavorable for subsequent maintenance. Summary of the Invention
[0005] Embodiments of this application provide a page generation method, apparatus, electronic device, and program product to simplify the complexity of the page executable code.
[0006] In a first aspect, this application provides a page generation method, including:
[0007] Responding to a page browsing request triggered by a user, and obtaining the page source code of the page requested by the page browsing request; wherein, the page source code includes an environment field and a component field;
[0008] Determining the translation environment of the page source code according to the environment field in the page source code;
[0009] Based on the translation environment, performing a translation process on the component field in the page source code to obtain page executable code;
[0010] Performing a process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code.
[0011] It can be seen that by performing a translation process on the component field in the page source code according to the environment field in the page source code to obtain page executable code that can be directly mounted with a rendering instance, since the executable code of the page is obtained through translation, its code complexity is relatively low. At the same time, the code style is unified, which is convenient for subsequent management.
[0012] In an optional implementation, it further includes:
[0013] Obtaining the source code to be processed of each page;
[0014] Perform static syntax detection processing on the source code to be processed for each page, and generate the source code of the page.
[0015] In an alternative embodiment, the performing static syntax detection processing on the source code to be processed for each page and generating the source code of the page includes:
[0016] Detect and process the field length, and / or field format, and / or the legality of the field corresponding value of each field in the source code to be processed;
[0017] If any field in the source code to be processed fails the detection processing, stop the page generation and prompt the user to recompile the source code of the page;
[0018] If all fields in the source code to be processed pass the detection processing, use the source code to be processed as the source code of the page.
[0019] It can be seen that by performing static syntax detection processing on the source code to be processed, it is possible to avoid problems in subsequent untranslatability caused by syntax problems in the source code, effectively improving the generation efficiency of the page executable code.
[0020] In an alternative embodiment, the determining the translation environment of the source code of the page according to the environment field in the source code of the page includes:
[0021] Determine the server address and access address of the environment corresponding to the value according to the value of the environment field in the source code of the page;
[0022] Package the server address and access address of the environment to obtain the translation environment of the source code of the page.
[0023] It can be seen that by using the method of assigning values to the environment field in the source code of the page, it is convenient to quickly determine the translation environment required for translation during translation, improving the transfer efficiency.
[0024] In an alternative embodiment, the performing translation processing on the component field in the source code of the page based on the translation environment to obtain page executable code includes:
[0025] Call the translation encoding of the interface corresponding to the translation environment according to the translation environment;
[0026] Use the translation encoding to perform translation processing on the component field in the source code of the page to obtain the page executable code.
[0027] In a second aspect, the present application provides a page generation device, including:
[0028] A code acquisition module, configured to respond to a page browsing request triggered by a user, and acquire the page source code of the page requested by the page browsing request; wherein, the page source code includes an environment field and a component field;
[0029] A translation module, configured to determine the translation environment of the page source code according to the environment field in the page source code; based on the translation environment, perform a translation process on the component field in the page source code to obtain page executable code;
[0030] A page generation module, configured to perform a process of mounting a rendering instance on the page executable code to generate a page corresponding to the page source code.
[0031] In an alternative embodiment, it further includes: a syntax detection module;
[0032] The syntax detection module is configured to:
[0033] Acquire the source code to be processed of each page; perform a static syntax detection process on the source code to be processed of each page to generate the page source code.
[0034] In an alternative embodiment, the syntax detection module is specifically configured to:
[0035] Detect and process the field length, and / or field format, and / or the legality of the field corresponding value of each field in the source code to be processed;
[0036] If any field in the source code to be processed fails the detection process, stop the page generation and prompt the user to recompile the page source code;
[0037] If all fields in the source code to be processed pass the detection process, use the source code to be processed as the page source code.
[0038] In an alternative embodiment, the translation module is specifically configured to:
[0039] Determine the server address and access address of the environment corresponding to the value according to the value of the environment field in the page source code;
[0040] Package the server address and access address of the environment to obtain the translation environment of the page source code.
[0041] In an alternative embodiment, the translation module is specifically configured to:
[0042] Call the translation encoding of the interface corresponding to the translation environment according to the translation environment;
[0043] Perform translation processing on the component fields in the page source code using the translation encoding to obtain the page executable code.
[0044] In a third aspect, the present application provides an electronic device, including: at least one processor and a memory;
[0045] The memory stores computer-executable instructions;
[0046] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method described in the first aspect.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method described in the first aspect is implemented.
[0048] In a fifth aspect, the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0049] The page generation method, device, electronic device, and program product provided by the embodiments of the present application obtain the page source code of the page requested by the page browsing request by responding to the page browsing request triggered by the user; wherein, the page source code includes an environment field and a component field; determine the translation environment of the page source code according to the environment field in the page source code; based on the translation environment, perform translation processing on the component fields in the page source code to obtain page executable code; perform the process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code, so as to obtain page executable code that can be directly mounted with a rendering instance. Since the executable code of the page is obtained through translation, its code complexity is relatively low. At the same time, the code style is unified, which is convenient for subsequent management. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings here are incorporated into the description and constitute a part of this description, showing embodiments consistent with the present application, and are used together with the description to explain the principles of the present application.
[0051] Figure 1 It is a schematic diagram of a network architecture based on the present application;
[0052] Figure 2 It is a schematic flowchart of a page generation method provided by the present application;
[0053] Figure 3 It is a schematic structural diagram of a page generation device provided by the embodiments of the present application;
[0054] Figure 4 It is a schematic structural diagram of another page generation device provided by an embodiment of the present application;
[0055] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0056] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Specific Embodiments
[0057] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of systems and methods consistent with some aspects of the present application as detailed in the appended claims.
[0058] With the development of the Internet industry, web front-end page development technologies are also gradually evolving. Vue.JS and its related dependencies are one of the open-source web front-end development frameworks and solutions.
[0059] In the prior art, page development based on Vue.JS is generally achieved by developers coding based on business logic and business systems. That is, developers independently code and develop according to the requirements prototype, and after obtaining the executable code, render the executable code to present the page.
[0060] However, since Vue-related technologies are general-purpose development frameworks and there are no restrictions on the development method in the framework, multiple code implementations can be used for the same business logic. At the same time, since the coding styles and coding levels of different developers are different, the executable codes obtained by different developers when writing the business logic of the same business system are different. For the overall business system, pages with the same or similar business logic are implemented based on different executable codes, which will increase the overall complexity of the business system and is not conducive to subsequent maintenance of the business system.
[0061] In view of the above problems, the page generation method, device, electronic device and program product provided by the embodiments of the present application obtain the page source code of the page requested by the page browsing request by responding to the page browsing request triggered by the user; wherein, the page source code includes an environment field and a component field; determine the translation environment of the page source code according to the environment field in the page source code; based on the translation environment, perform translation processing on the component field in the page source code to obtain page executable code; perform the process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code, so as to obtain page executable code that can be directly mounted with a rendering instance. Since the executable code of the page is obtained through translation, its code complexity is relatively low, and at the same time, the code style is unified, which is convenient for subsequent management.
[0062] The method provided by the present application will be described below in combination with different implementation manners.
[0063] Reference Figure 1 , Figure 1 is a schematic diagram of a network architecture on which the present application is based. The Figure 1 network architecture shown specifically includes a user device 1 and a server 2;
[0064] Among them, the user device 1 can specifically be a hardware device that can be used to participate in various activities, including but not limited to devices with page browsing functions such as mobile devices, desktop computers, and tablet computers. By interacting with the server 2, the user device 1 can obtain the page of the business system generated by the server 2.
[0065] The server 2 can specifically be a cloud server cluster of the business system. The server 2 can respond to the page browsing request triggered by the user device 1 to provide a page browsing service of the business system for the user device 1. Among them, the page generation device provided by the present application is integrated in the server 2. When the server 2 provides a page browsing service for the user device 1, the page generation device in the server 2 will be started and perform page generation processing based on the page source code compiled by the developer to render and generate a page for the user device 1 to browse.
[0066] For the convenience of description, the present application will describe the page generation method in this case with the page generation device as the execution subject and in combination with the accompanying drawings.
[0067] Embodiment 1
[0068] Figure 2 is a schematic flowchart of a page generation method provided by the present application. Among them, as Figure 2 shown, the page generation method includes:
[0069] Step 201: In response to a page browsing request triggered by a user, obtain the page source code of the page requested by the page browsing request; wherein, the page source code includes an environment field and a component field.
[0070] Step 202: Determine the translation environment of the page source code according to the environment field in the page source code.
[0071] Step 203: Based on the translation environment, perform a translation process on the component field in the page source code to obtain page executable code.
[0072] Step 204: Perform a process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code.
[0073] In the embodiment of the present application, the page source code involved in the page generation method is pre-compiled by a developer and uploaded to the server where the page generation device is located. By translating the component field in the page source code according to the environment field in the page source code, page executable code that can be directly mounted with a rendering instance is obtained. Since the executable code of the page is obtained through translation, its code complexity is relatively low. At the same time, the code style is unified, which is convenient for subsequent management.
[0074] The solution provided by the present application will be further described below in combination with the above steps:
[0075] First of all, it should be noted that the page source code is obtained by a developer through compilation of a lightweight DSL (Domain Specific Language). In this lightweight DSL, the environment field and the component field are defined.
[0076] Among them, different call logics such as different interfaces, data sources, and routes will correspond to different field values in the environment field. For example, the environment field can be defined as the field "targetRunTime". Based on the actual business situation, the developer can configure the value of the environment field of the page. For example, the field can be set to "MicroApplication" so that the subsequent page generation device will call the logic corresponding to the value, such as interfaces, data sources, and routes.
[0077] In addition, the component field defines the business logic of the code and the component library of the applicable business system. Similar to the aforementioned environment field, in this component field, the developer needs to compile for the implementation of the business logic based on the actual component library adapted to the business requirements.
[0078] That is to say, through the above lightweight DSL, the developer can compile the code according to the actual business requirements, and upload the compiled code to the server for the page generation device to obtain.
[0079] Based on the above, a large number of page source codes of pre-compiled business systems will be stored in the server. Each of these page source codes includes the aforementioned environment fields and component fields.
[0080] First, the page generation device will respond to the page browsing request triggered by the user and obtain the page source code of the page requested by the page browsing request; among them, the page source code includes environment fields and component fields. Subsequently, the page generation device will determine the translation environment of the page source code according to the environment fields in the page source code.
[0081] Specifically, the determination of the translation environment is based on the value of the environment field. As mentioned before, due to the differences in the component libraries used for the page, developers will configure corresponding values in the environment field of the page source code corresponding to the page to represent the environment in which the page source code runs, and the translation environment will include various configurations in this environment. For example, if the value in the environment field is used to characterize that the code runs in a certain environment, then the translation environment will include information such as the server address and access address. That is, the page generation device determines the server address and access address of the environment corresponding to the value according to the value of the environment field in the page source code; encapsulates the server address and access address of the environment to obtain the translation environment of the page source code. By adopting the method of assigning values to the environment field in the page source code, it is convenient to quickly determine the translation environment required for translation during translation, improving the translation efficiency.
[0082] Based on the translation environment, the page generation device will perform translation processing on the component fields in the page source code to obtain page executable code. Specifically, based on the environment information of various environments encapsulated in the translation environment, the page generation device can perform translation processing on the code described in the component fields in the aforementioned page source code. For example, if the component field in a page source code is used to describe the file upload function, during translation, the page generation device needs to determine the specific code content of the executable code after translation based on the server address and access address corresponding to the file upload function described by the environment field. That is to say, call the translation encoding of the interface corresponding to the translation environment according to the translation environment; use the translation encoding to perform translation processing on the component fields in the page source code to obtain the page executable code.
[0083] In this way, the executable code obtained by the page generation device has correct syntax, a unified format, and the code quality is close to the code sequence of manual coding. In an alternative manner, developers can further repair the executable code to further improve the code quality.
[0084] After obtaining the page executable code, the page generation device will mount and render an instance of the executable code to generate an actual page. In this process, the page generation device will execute the executable code to determine the code content represented by the executable code, and call the corresponding rendering function in the Vue framework to perform the mounting and rendering of the instance to generate the page.
[0085] Subsequently, the page generation device will also return the page to the user device through the server for the user to view and interact with.
[0086] Based on the above embodiments, in an alternative embodiment, in order to ensure the translation efficiency of the subsequent page source code and avoid the problem that the page source code cannot be transferred due to incorrect encoding syntax, the page generation device will also perform static detection processing on the code, that is, the page generation device will first obtain the source code to be processed for each page, and then perform static syntax detection processing on the source code to be processed for each page to generate the page source code.
[0087] Specifically, the static syntax detection method refers to the process of using preset syntax detection rules to detect each field and the corresponding value of each field in the code. Further, the static syntax detection includes detecting and processing the field length, and / or, field format, and / or, the legality of the value corresponding to the field in the source code to be processed. Correspondingly, if any field in the source code to be processed fails the detection processing, the page generation is stopped and the user is prompted to recompile the page source code; if all fields in the source code to be processed pass the detection processing, the source code to be processed is used as the page source code.
[0088] By performing static syntax detection processing on the source code to be processed, the page source code called is all code that has passed the static syntax detection processing, effectively avoiding the problem that subsequent translation cannot be performed due to syntax problems in the source code, and effectively improving the generation efficiency of the page executable code.
[0089] The page generation method provided in the embodiments of the present application obtains the page source code of the page requested by the page browsing request by responding to the page browsing request triggered by the user; wherein, the page source code includes an environment field and a component field; determines the translation environment of the page source code according to the environment field in the page source code; based on the translation environment, performs translation processing on the component field in the page source code to obtain page executable code; and performs the processing of mounting and rendering an instance on the page executable code to generate the page corresponding to the page source code, so as to obtain page executable code that can be directly mounted and rendered. Since the page executable code is obtained through translation, its code complexity is relatively low, and at the same time, the code style is unified, which is convenient for subsequent management.
[0090] Example 2
[0091] A page generation method corresponding to the above embodiment Figure 3 is a schematic structural diagram of a page generation device provided by an embodiment of the present application, as Figure 3 shown. The page generation device includes: a code acquisition module 310, a translation module 320, and a page generation module 330.
[0092] The code acquisition module 310 is configured to respond to a page browsing request triggered by a user, and acquire the page source code of the page requested by the page browsing request; wherein, the page source code includes an environment field and a component field;
[0093] The translation module 320 is configured to determine a translation environment of the page source code according to the environment field in the page source code; based on the translation environment, perform a translation process on the component field in the page source code to obtain page executable code;
[0094] The page generation module 330 is configured to perform a process of mounting a rendering instance on the page executable code to generate a page corresponding to the page source code.
[0095] In an alternative embodiment Figure 4 is a schematic structural diagram of another page generation device provided by an embodiment of the present application, as Figure 4 shown, which further includes: a syntax detection module 340;
[0096] The syntax detection module 340 is configured to:
[0097] acquire the source code to be processed of each page; perform static syntax detection processing on the source code to be processed of each page to generate page source code.
[0098] In an alternative embodiment, the syntax detection module 340 is specifically configured to:
[0099] detect and process the field length, and / or, field format, and / or, the legality of the field corresponding value of each field in the source code to be processed;
[0100] if any field in the source code to be processed fails the detection process, stop the page generation and prompt the user to recompile the page source code;
[0101] if all fields in the source code to be processed pass the detection process, use the source code to be processed as the page source code.
[0102] In an alternative embodiment, the translation module 320 is specifically configured to:
[0103] Determine the server address and access address of the environment corresponding to the value according to the value of the environment field in the page source code;
[0104] Encapsulate the server address and access address of the environment to obtain the translated environment of the page source code.
[0105] In an alternative embodiment, the translation module 320 is specifically configured to:
[0106] Call the translation encoding of the interface corresponding to the translated environment according to the translated environment;
[0107] Use the translation encoding to perform translation processing on the component fields in the page source code to obtain the page executable code.
[0108] The page generation device provided by the embodiments of the present application obtains the page source code of the page requested by the page browsing request by responding to the page browsing request triggered by the user; wherein, the page source code includes an environment field and a component field; determine the translated environment of the page source code according to the environment field in the page source code; based on the translated environment, perform translation processing on the component fields in the page source code to obtain the page executable code; perform the process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code, so as to obtain the page executable code that can be directly mounted with a rendering instance. Since the executable code of the page is obtained through translation, its code complexity is relatively low. At the same time, the code style is unified, which is convenient for subsequent management.
[0109] Embodiment Three
[0110] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 5 shown, an embodiment of the present invention also provides an electronic device 500, including: a memory 501, a processor 502, and a computer program.
[0111] Among them, the computer program is stored in the memory 501 and is configured to be executed by the processor 502 to implement the page generation method provided by any one of the embodiments of the present invention. For relevant descriptions, reference can be made to the relevant descriptions and effects corresponding to the steps in the accompanying drawings for understanding, and no further elaboration will be made here.
[0112] Among them, in this embodiment, the memory 501 and the processor 502 are connected through a bus.
[0113] Embodiment Four
[0114] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the page generation method provided by any one of the embodiments of the present invention.
[0115] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of systems or modules can be in electrical, mechanical or other forms.
[0116] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] In addition, the functional modules in each embodiment of the present invention can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0118] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer or other programmable question-answering systems, so that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, executed partially on the machine as an independent software package and partially on a remote machine, or executed entirely on a remote machine or server.
[0119] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] In addition, the present application provides a computer program product, including a computer program which, when executed by a processor, implements the foregoing data synchronization method based on a multi-site active-active system.
[0121] Moreover, although the operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed to achieve the desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, the various features described in the context of a single implementation can also be implemented separately or in any suitable sub-combination in multiple implementations.
[0122] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A page generation method, characterized in that, Including: In response to a page browsing request triggered by a user, obtain the page source code of the page requested by the page browsing request; wherein, the page source code includes an environment field and a component field; Determine the translation environment of the page source code according to the environment field in the page source code; According to the translation environment, call the translation code of the interface corresponding to the translation environment, and use the translation code to perform translation processing on the component field in the page source code to obtain page executable code, and the page executable code is code that can directly execute and mount a rendering instance for processing; Perform the process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code; The determining the translation environment of the page source code according to the environment field in the page source code includes: According to the value of the environment field in the page source code, determine the server address and access address of the environment corresponding to the value; Package the server address and access address of the environment to obtain the translation environment of the page source code.
2. The page generation method according to claim 1, wherein Also including: Obtain the source code to be processed of each page; Perform static syntax detection processing on the source code to be processed of each page to generate the page source code.
3. The page generation method according to claim 2, wherein The performing static syntax detection processing on the source code to be processed of each page to generate the page source code includes: Perform detection processing on the field length, and / or field format, and / or the legality of the field corresponding value of each field in the source code to be processed; If any field in the source code to be processed fails the detection processing, stop the page generation and prompt the user to recompile the page source code; If all fields in the source code to be processed pass the detection processing, use the source code to be processed as the page source code.
4. A page generation device, characterized in that, Including: A code acquisition module, configured to obtain the page source code of the page requested by the page browsing request triggered by the user in response to the page browsing request; wherein, the page source code includes an environment field and a component field; A translation module, configured to determine the translation environment of the page source code according to the environment field in the page source code; based on the translation environment, perform translation processing on the component field in the page source code to obtain page executable code, and the page executable code is code that can directly execute and mount a rendering instance for processing; A page generation module, configured to perform the process of mounting a rendering instance on the page executable code to generate the page corresponding to the page source code; The translation module, specifically configured to: Call the translation code of the interface corresponding to the translation environment according to the translation environment; Use the translation code to perform translation processing on the component field in the page source code to obtain the page executable code; The translation module, specifically configured to: According to the value of the environment field in the page source code, determine the server address and access address of the environment corresponding to the value; Package the server address and access address of the environment to obtain the translation environment of the page source code.
5. The page generation device according to claim 4, wherein Also including: A syntax detection module; The syntax detection module is configured to obtain the source code to be processed of each page; Perform static syntax detection processing on the source code to be processed for each page, and generate the page source code.
6. The page generation device according to claim 5, wherein The syntax detection module is specifically configured to: Detect and process the field length, and / or field format, and / or the legality of the field corresponding value of each field in the source code to be processed; If any field in the source code to be processed fails the detection processing, stop the page generation and prompt the user to recompile the page source code; If all fields in the source code to be processed pass the detection processing, use the source code to be processed as the page source code.
7. An electronic device, characterized in that, Comprising: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the method according to any one of claims 1-3 is implemented.
9. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Static webpage rendering method, device, equipment and computer storage medium
CN110990731A
DSL-based multi-technology stack front-end code generation method and device
CN113485706A