Page display method and device, storage medium and electronic equipment
By introducing the rendering server's parsing and processing of Less or Sass style languages into the MVC architecture, a sandbox environment is generated and styles are supplemented, which solves the problem of low style reusability and compatibility in the MVC architecture and achieves efficient page display and compilation. .
Patent Information
- Application Number
- CN202410880765.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
The existing MVC architecture system does not separate the front and back ends, resulting in the lack of middle-layer rendering in system development, resulting in low style reusability, huge projects, and difficult maintenance. It only supports cascading style sheet language type writing, and the page display compatibility is low. .
The rendering server receives the page display request forwarded by the HTTP server, uses multiple sub-services to parse and render the Less or Sass style language file, generates the target page file, and determines the preset rendering mode information in the sandbox environment to perform style supplementary processing. , and finally package the rendered style file and return it to the browser for page display.
It improves the compatibility of page display, simplifies code writing, reduces the project size, speeds up project compilation and running speed, supports high-order style writing, and achieves the unification of styles.
Smart Images

Figure CN118733033A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology or other related fields, and in particular, to a page display method, device, storage medium and electronic device. Background Art
[0002] At present, although the software design pattern (Model-View-ViewModel, MVVM) is widely used in the mainstream front-end technology, the previous generation of MVC architecture has not been completely eliminated and is still in use as a part of the stable system. For the running system, it is inevitable to encounter temporary maintenance adjustments. Since the old MVC architecture system is not separated from the front and back ends, it is difficult to intervene in the intermediate state during system development. The lack of intermediate layer rendering means that many reusable styles in the development process of the old system can only be written by copying and pasting independent HTML pages, which makes the project huge, redundant, and difficult to maintain the system.
[0003] Since the compilation of the MVC framework Java template engine (Thymeleaf) page only supports Cascading Style Sheets (CSS) language writing, for example, relying on developers to write CSS for each HTML page to achieve page development and display, style writing is not flexible enough and causes a lot of inconvenience to projects that want to use unified style management. For example, it does not support style inheritance relationships, does not support style variable settings, and has low compatibility for page display. In addition, the style reusability between pages of a single project is low.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a page display method, device, storage medium and electronic device to at least solve the technical problem that when displaying pages in the prior art, only pages written based on cascading style sheet language type are supported, and the compatibility of page display is low.
[0006] According to one aspect of an embodiment of the present invention, a page display method is provided, comprising: receiving a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; parsing and rendering the style language file based on the multiple sub-services to obtain a page file corresponding to the target page to be displayed; returning the page file to the HTTP server, wherein the HTTP server forwards the page file to a browser in a client for page display.
[0007] Furthermore, based on multiple sub-services, the style language file is parsed and rendered to obtain a page file corresponding to the target page to be displayed, including: generating a target sandbox environment based on a sandbox service in the multiple sub-services, wherein the target sandbox environment is used to isolate the rendering environment; determining preset rendering mode information corresponding to the target page to be displayed in the target sandbox environment based on the style language file based on a judgment service in the multiple sub-services; parsing the preset rendering mode information based on a first parsing service and a second parsing service in the multiple sub-services to obtain a parsing result, and performing style supplementation processing on the preset rendering mode information based on the parsing result to obtain the target rendering mode information, wherein the contents parsed by the first parsing service and the second parsing service are different; performing style rendering on the target rendering mode information based on a style rendering service in the multiple sub-services to obtain a style file corresponding to the target page to be displayed; packaging the style file based on a packaging service in the multiple sub-services to obtain a page file.
[0008] Furthermore, a target sandbox environment is generated based on a sandbox service in multiple sub-services, including: obtaining type information of a browser in a client based on the sandbox service; determining a target sandbox environment type corresponding to the browser type information, and generating a target sandbox environment based on the target sandbox environment type.
[0009] Furthermore, based on the judgment service among the multiple sub-services, the preset rendering mode information corresponding to the target page to be displayed is determined in the target sandbox environment according to the style language file, including: based on the judgment service, the file content of the style language file is analyzed in the target sandbox environment to obtain the target tag information in the style language file, wherein the target tag information is used to indicate the skin type and language type corresponding to the target page; the preset rendering mode information is determined according to the target tag information.
[0010] Furthermore, based on the first parsing service and the second parsing service in the multiple sub-services, the preset rendering mode information is parsed and processed to obtain a parsing result, including: parsing the first attribute information in the preset rendering mode information based on the first parsing service to obtain target skin type information; parsing the second attribute information in the preset rendering mode information based on the second parsing service to obtain target language type information; and composing the parsing result based on the target skin type information and the target language type information.
[0011] Furthermore, the preset rendering mode information is style-supplemented based on the parsing result to obtain target rendering mode information, including: based on the first parsing service, obtaining the target skin and the document object model style corresponding to the target skin from the style repository based on the target skin type information, and supplementing the preset rendering mode information with style based on the target skin and the document object model style to obtain the first rendering mode information; based on the second parsing service, determining the target precompiler based on the target language type information, and supplementing the preset rendering mode information with style based on the target precompiler to obtain the second rendering mode information; and forming the target rendering mode information based on the first rendering mode information and the second rendering mode information.
[0012] Furthermore, based on the style rendering service in multiple sub-services, the target rendering mode information is style rendered to obtain a style file corresponding to the target page to be displayed, including: rendering the target rendering mode information based on the style rendering service to obtain the target page to be displayed; compiling and converting the target page to be displayed to obtain a style file.
[0013] According to another aspect of an embodiment of the present invention, a page display device is also provided, including: a receiving module, used to receive a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; a processing module, used to parse and render the style language file based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; a sending module, used to return the page file to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0014] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned page display method.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned page display method when running.
[0016] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, which includes one or more processors; a memory for storing one or more programs, which enables the one or more processors to run the programs when the one or more programs are executed by the one or more processors, wherein the programs are configured to execute the above-mentioned page display method when running.
[0017] In an embodiment of the present invention, a service-oriented rendering method is used to support the development and display of pages using the Less and Sass advanced style languages. First, a page display request forwarded by an HTTP server is received through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; the style language file is parsed and rendered based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; the page file is returned to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0018] In the above process, after the style language file of the target page is written based on the Less and Sass advanced style languages, it can be parsed and rendered through multiple sub-services of the rendering server to achieve page display and improve the compatibility of page display. The service-oriented approach achieves the unification of style, simplifies the code writing in page development, reduces the project volume, and speeds up the project compilation and operation.
[0019] It can be seen that through the technical solution of the present invention, the purpose of supporting the parsing of the rendering server is achieved, so that the MVC framework Java Thymeleaf can support high-order style writing, thereby achieving the technical effect of improving the compatibility of page display, and further solving the technical problem that when displaying pages in the prior art, only pages written based on the cascading style sheet language type are supported, resulting in low compatibility of page display. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of an optional page display method according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of an optional page display system according to an embodiment of the present invention;
[0023] Figure 3 is a schematic diagram of an optional page display device according to an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between the system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0028] Example 1
[0029] According to an embodiment of the present invention, an embodiment of a method for displaying a page is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 1 is a flow chart of an optional page display method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0031] Step S101, receiving a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language.
[0032] In the above steps, an application system, a processor, an electronic device or the like may be used as an execution subject. Optionally, a page display system may be used as an execution subject.
[0033] Figure 2 is a schematic diagram of an optional page display system according to an embodiment of the present invention, such as Figure 2 As shown, it includes a development end (i.e., a production environment end), an HTTP server, a rendering server (Server Render), and a client. For example, after developing a page based on a Web application server in an integrated development environment A and based on HTTP and a reverse proxy Web server in an integrated development environment B, a page display request is initiated, and the HTTP server obtains the transmission files of the Web application server, HTTP, and reverse proxy Web server (such as the style language file of the target page requested for display), and forwards it to Server Render. Therefore, the page display request forwarded by the HTTP server is received by the rendering server, and the rendering server includes a sandbox service (Sandbox), a judgment service (isRender), a first analysis service (analysisATS), a second analysis service (styleATS), a style rendering service (styleRender), and a packaging service (rollupTheme).
[0034] Step S102: parsing and rendering the style language file based on multiple sub-services to obtain a page file corresponding to the target page to be displayed.
[0035] Step S103, returning the page file to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0036] Optionally, the rendering server acts as an intermediate service layer and is a service relay before the page is loaded. It parses and renders the style language file based on multiple sub-services, and can obtain the page file corresponding to the target page to be displayed. The page file is then returned to the HTTP server, and the HTTP server forwards the page file to the browser in the client for page display.
[0037] For example, the Thymeleaf framework is deployed through a Web application server, HTTP, and a reverse proxy Web server, and uses the HTTP protocol to send pages. When Server Render receives the page display resources published by the HTTP server, it performs shared analysis and rendering, that is, sharing of resources and switching of styles are implemented on the rendering end, and then forwarded to the browser for display.
[0038] Based on the scheme defined by the above steps S101 to S103, it can be known that in an embodiment of the present invention, the development and display of pages using Less and Sass advanced style languages are supported through a service-oriented rendering method. First, a page display request forwarded by an HTTP server is received through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; the style language file is parsed and rendered based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; the page file is returned to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0039] It is easy to notice that in the above process, after the style language file of the target page is written based on the Less and Sass advanced style languages, it can be parsed and rendered through multiple sub-services of the rendering server, thereby realizing page display and improving the compatibility of page display. The service-oriented approach achieves the unification of style, simplifies the code writing in page development, reduces the project volume, and speeds up the project compilation and operation.
[0040] It can be seen that through the technical solution of the present invention, the purpose of supporting the parsing of the rendering server is achieved, so that the MVC framework Java Thymeleaf can support high-order style writing, thereby achieving the technical effect of improving the compatibility of page display, and further solving the technical problem that when displaying pages in the prior art, only pages written based on the cascading style sheet language type are supported, resulting in low compatibility of page display.
[0041] In an optional embodiment, a style language file is parsed and rendered based on multiple sub-services to obtain a page file corresponding to a target page to be displayed, including: generating a target sandbox environment based on a sandbox service in the multiple sub-services, wherein the target sandbox environment is used to isolate the rendering environment; determining preset rendering mode information corresponding to the target page to be displayed in the target sandbox environment based on the style language file based on a judgment service in the multiple sub-services; parsing the preset rendering mode information based on a first parsing service and a second parsing service in the multiple sub-services to obtain a parsing result, and performing style supplementation processing on the preset rendering mode information based on the parsing result to obtain a target rendering mode information, wherein the parsed contents of the first parsing service and the second parsing service are different; performing style rendering on the target rendering mode information based on a style rendering service in the multiple sub-services to obtain a style file corresponding to the target page to be displayed; and packaging the style file based on a packaging service in the multiple sub-services to obtain a page file.
[0042] Optionally, in the process of parsing and rendering the style language file based on multiple sub-services to obtain the page file corresponding to the target page to be displayed, the target sandbox environment is first generated based on the sandbox service, and the rendering environment is bidirectionally isolated. The processing of isRender, analysisATS, styleATS, and styleRender is in the target sandbox environment.
[0043] In an optional embodiment, a target sandbox environment is generated based on a sandbox service in multiple sub-services, including: obtaining type information of a browser in a client based on the sandbox service; determining a target sandbox environment type corresponding to the browser type information, and generating a target sandbox environment based on the target sandbox environment type.
[0044] Optionally, in the process of generating a target sandbox environment based on a sandbox service in multiple sub-services, firstly, the type information of the browser in the client is obtained based on the sandbox service, and then the target sandbox environment type corresponding to the browser type information is determined, and the target sandbox environment is generated according to the target sandbox environment type. For example, Sandbox will use a snapshot sandbox or a proxy sandbox for environmental isolation according to the client browser type, that is, generate a target sandbox environment.
[0045] It should be noted that the sandbox service is used to isolate the rendering environment in both directions, so as to prevent the complete project configuration from affecting the effect of shared rendering, and to prevent shared rendering from contaminating the entire project. At the same time, the sandbox service can monitor and control other rendering services. If a rendering service works abnormally, it can be closed and re-rendered through the built-in mechanism of the rendering service.
[0046] Optionally, based on the judgment service, the preset rendering mode information corresponding to the target page to be displayed is determined according to the style language file in the target sandbox environment. For example, the rendering skin type to be used is determined according to the page skin written in the style language file, wherein the preset rendering mode information includes at least skin type information and language type information.
[0047] In an optional embodiment, a judgment service among multiple sub-services determines preset rendering mode information corresponding to a target page to be displayed in a target sandbox environment based on a style language file, including: analyzing the file content of the style language file in the target sandbox environment based on the judgment service to obtain target tag information in the style language file, wherein the target tag information is used to indicate a skin type and a language type corresponding to the target page; and determining preset rendering mode information based on the target tag information.
[0048] Optionally, in the process of determining the preset rendering mode information corresponding to the target page to be displayed based on the style language file in the target sandbox environment by the judgment service among multiple sub-services, the file content of the style language file is first analyzed in the target sandbox environment based on the judgment service to obtain the target tag information in the style language file, and then the preset rendering mode information is determined based on the target tag information.
[0049] For example, isRender analyzes the file content of the style language file in the target sandbox environment, obtains the meta tag information (i.e., the target tag information), and determines the skin type and language type based on the meta tag information, that is, performs Thymeleaf compatibility judgment and determines the corresponding rendering method of the page. For example, if the light color skin in styleATS is selected, the page you write will be marked in the meta tag, such as: <meta name=”themeType”content=”light”> ; If you choose a dark skin, the page you write will be marked in the meta tag, such as: <meta name=”themeType”content=”dark”> Optionally, code examples and explanations follow:
[0050] <meta name=”themeType”> The content attribute identifies the skin type used, such as dark, light;
[0051] <meta name=”styleType”> The content attribute identifies the language type to be parsed, such as Less, Sass, and CSS.
[0052] It should be noted that the rendering server can support the syntax of precompiled languages such as Less and Sass, which simplifies the code writing in Java Thymeleaf development. Through simple naming and writing, the ability to draw skin attributes in the rendering service can be obtained. The style is unified through service-oriented, and the style can be switched through meta configuration. The language type of the style language file can also be regular CSS. If it is CSS, there is no need for precompilation conversion.
[0053] Optionally, the preset rendering mode information is parsed based on the first parsing service and the second parsing service to obtain a parsing result, and the preset rendering mode information is supplemented with a style based on the parsing result to obtain the target rendering mode information.
[0054] In an optional embodiment, the preset rendering mode information is parsed based on the first parsing service and the second parsing service in multiple sub-services to obtain a parsing result, including: parsing the first attribute information in the preset rendering mode information based on the first parsing service to obtain target skin type information; parsing the second attribute information in the preset rendering mode information based on the second parsing service to obtain target language type information; and composing the parsing result based on the target skin type information and the target language type information.
[0055] In the process of parsing the preset rendering mode information based on the first parsing service and the second parsing service in multiple sub-services to obtain the parsing result, the first attribute information (themeType attribute) in the preset rendering mode information is parsed based on analysisATS to obtain the target skin type information (i.e. the selected skin type). For example, analysisATS performs syntax analysis, tree structure parsing and reorganization, and semantic analysis to parse the skin type selected by themeType, perform shared rendering according to the agreement, and reorganize the page drawing through the built-in abstract syntax tree (ATS) component and parsing rules of the service. The second attribute information (styleType attribute) in the preset rendering mode information is parsed based on styleATS to obtain the target language type information (i.e. the selected language type). For example, styleATS parses the language type selected by styleType.
[0056] In an optional embodiment, the preset rendering mode information is style-supplemented based on the parsing result to obtain target rendering mode information, including: based on the first parsing service, obtaining the target skin and the document object model style corresponding to the target skin from the style repository based on the target skin type information, and style-supplementing the preset rendering mode information based on the target skin and the document object model style to obtain the first rendering mode information; based on the second parsing service, determining the target precompiler based on the target language type information, and style-supplementing the preset rendering mode information based on the target precompiler to obtain the second rendering mode information; and forming the target rendering mode information based on the first rendering mode information and the second rendering mode information.
[0057] In the process of performing style supplement processing on the preset rendering mode information according to the parsing result to obtain the target rendering mode information, analysisATS obtains the target skin and the document object model style corresponding to the target skin from the style repository according to the target skin type information, and performs style supplement on the preset rendering mode information according to the target skin and the document object model style to obtain the first rendering mode information. For example, analysisATS selects the corresponding AST skin parsing in the style repository to supplement the Dom style. Based on styleATS, the target precompiler is determined according to the target language type information, and the preset rendering mode information is style supplemented according to the target precompiler to obtain the second rendering mode information. For example, styleATS connects to the skin style management library, matches the corresponding precompiler therein, performs parsing and drawing of the specified skin, and supplements the style.
[0058] Optionally, style rendering is performed on the target rendering mode information based on the style rendering service to obtain a style file corresponding to the target page to be displayed. In an optional embodiment, style rendering is performed on the target rendering mode information based on the style rendering service in multiple sub-services to obtain a style file corresponding to the target page to be displayed, including: rendering the target rendering mode information based on the style rendering service to obtain the target page to be displayed; compiling and converting the target page to be displayed to obtain a style file.
[0059] In the process of performing style rendering on the target rendering mode information based on the style rendering service in multiple sub-services to obtain the style file corresponding to the target page to be displayed, the target rendering mode information is rendered based on styleRender to obtain the target page to be displayed, and the target page to be displayed is compiled and converted to obtain the style file. For example, styleRender performs shared rendering of the page based on the server-side configuration and the preset style of the component of the rendering server, and performs Less and Sass syntax compilation and conversion, and finally sends it to the browser side for drawing in the form of CSS (i.e., style file).
[0060] Optionally, the style file is packaged based on the packaging service to obtain the page file. For example, rollupTheme packages the rendered skin and processed related files (such as the style file) and loads them to the page to obtain the page file.
[0061] In an embodiment of the present invention, a service-oriented rendering method is used to support the development and display of pages using the Less and Sass advanced style languages. First, a page display request forwarded by an HTTP server is received through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; the style language file is parsed and rendered based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; the page file is returned to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0062] In the above process, after the style language file of the target page is written based on the Less and Sass advanced style languages, it can be parsed and rendered through multiple sub-services of the rendering server to achieve page display and improve the compatibility of page display. The service-oriented approach achieves the unification of style, simplifies the code writing in page development, reduces the project volume, and speeds up the project compilation and operation.
[0063] It can be seen that through the technical solution of the present invention, the purpose of supporting the parsing of the rendering server is achieved, so that the MVC framework Java Thymeleaf can support high-order style writing, thereby achieving the technical effect of improving the compatibility of page display, and further solving the technical problem that when displaying pages in the prior art, only pages written based on the cascading style sheet language type are supported, resulting in low compatibility of page display.
[0064] Example 2
[0065] According to an embodiment of the present invention, an embodiment of a device for displaying a page is provided, wherein: Figure 3 is a schematic diagram of an optional page display device according to an embodiment of the present invention, such as Figure 3As shown, the device includes: a receiving module 301, which is used to receive a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; a processing module 302, which is used to parse and render the style language file based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; a sending module 303, which is used to return the page file to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0066] It should be noted that the above-mentioned receiving module 301, processing module 302 and sending module 303 correspond to steps S101 to S103 in the above-mentioned embodiment, and the examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0067] Optionally, the processing module includes: a generation module, which is used to generate a target sandbox environment based on a sandbox service in multiple sub-services, wherein the target sandbox environment is used to isolate the rendering environment; a determination module, which is used to determine the preset rendering mode information corresponding to the target page to be displayed in the target sandbox environment according to the style language file based on the judgment service in multiple sub-services; a first processing module, which is used to parse the preset rendering mode information based on the first parsing service and the second parsing service in the multiple sub-services to obtain a parsing result, and perform style supplement processing on the preset rendering mode information based on the parsing result to obtain the target rendering mode information, wherein the contents parsed by the first parsing service and the second parsing service are different; a second processing module, which is used to perform style rendering on the target rendering mode information based on the style rendering service in the multiple sub-services to obtain a style file corresponding to the target page to be displayed; and a third processing module, which is used to package the style file based on the packaging service in the multiple sub-services to obtain a page file.
[0068] Optionally, the generation module includes: an acquisition module, used to obtain type information of the browser in the client based on the sandbox service; a first generation module, used to determine the target sandbox environment type corresponding to the browser type information, and generate a target sandbox environment based on the target sandbox environment type.
[0069] Optionally, the determination module includes: a fourth processing module, used to analyze the file content of the style language file in the target sandbox environment based on the judgment service, and obtain target tag information in the style language file, wherein the target tag information is used to indicate the skin type and language type corresponding to the target page; a first determination module, used to determine the preset rendering mode information based on the target tag information.
[0070] Optionally, the first processing module includes: a first parsing module, used to parse the first attribute information in the preset rendering mode information based on the first parsing service to obtain target skin type information; a second parsing module, used to parse the second attribute information in the preset rendering mode information based on the second parsing service to obtain target language type information; and a second determination module, used to form a parsing result based on the target skin type information and the target language type information.
[0071] Optionally, the first processing module also includes: a fifth processing module, which is used to obtain the target skin and the document object model style corresponding to the target skin from the style repository based on the target skin type information based on the first parsing service, and supplement the preset rendering mode information with style based on the target skin and the document object model style to obtain the first rendering mode information; a sixth processing module, which is used to determine the target precompiler based on the target language type information based on the second parsing service, and supplement the preset rendering mode information with style based on the target precompiler to obtain the second rendering mode information; a third determination module, which is used to form the target rendering mode information based on the first rendering mode information and the second rendering mode information.
[0072] Optionally, the second processing module includes: a seventh processing module, used to render the target rendering mode information based on the style rendering service to obtain a target page to be displayed; an eighth processing module, used to compile and convert the target page to be displayed to obtain a style file.
[0073] Example 3
[0074] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned page display method.
[0075] Example 4
[0076] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned page display method when running.
[0077] Example 5
[0078] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, wherein: Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Figure 4As shown, the electronic device includes one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are set to execute the above-mentioned page display method when running. When the processor executes the program, the following steps are implemented: receiving a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes multiple sub-services, and the page display request includes at least a style language file of the target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; parsing and rendering the style language file based on multiple sub-services to obtain a page file corresponding to the target page to be displayed; returning the page file to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
[0079] Optionally, when executing the program, the processor also implements the following steps: generating a target sandbox environment based on a sandbox service among multiple sub-services, wherein the target sandbox environment is used to isolate the rendering environment; determining preset rendering mode information corresponding to a target page to be displayed in the target sandbox environment based on a style language file based on a judgment service among multiple sub-services; parsing the preset rendering mode information based on a first parsing service and a second parsing service among multiple sub-services to obtain a parsing result, and performing style supplementation processing on the preset rendering mode information based on the parsing result to obtain target rendering mode information, wherein the contents parsed by the first parsing service and the second parsing service are different; performing style rendering on the target rendering mode information based on a style rendering service among multiple sub-services to obtain a style file corresponding to the target page to be displayed; and packaging the style file based on a packaging service among multiple sub-services to obtain a page file.
[0080] Optionally, when executing the program, the processor further implements the following steps: obtaining type information of the browser in the client based on the sandbox service; determining a target sandbox environment type corresponding to the browser type information, and generating a target sandbox environment based on the target sandbox environment type.
[0081] Optionally, the processor also implements the following steps when executing the program: based on the judgment service, analyzing the file content of the style language file in the target sandbox environment, obtaining target tag information in the style language file, wherein the target tag information is used to indicate the skin type and language type corresponding to the target page; determining the preset rendering mode information based on the target tag information.
[0082] Optionally, when the processor executes the program, the following steps are also implemented: based on the first parsing service, the first attribute information in the preset rendering mode information is parsed to obtain the target skin type information; based on the second parsing service, the second attribute information in the preset rendering mode information is parsed to obtain the target language type information; and the parsing result is composed according to the target skin type information and the target language type information.
[0083] Optionally, when the processor executes the program, the following steps are also implemented: based on the first parsing service, the target skin and the document object model style corresponding to the target skin are obtained from the style repository according to the target skin type information, and the preset rendering mode information is supplemented with the style according to the target skin and the document object model style to obtain the first rendering mode information; based on the second parsing service, the target precompiler is determined according to the target language type information, and the preset rendering mode information is supplemented with the style according to the target precompiler to obtain the second rendering mode information; and the target rendering mode information is composed according to the first rendering mode information and the second rendering mode information.
[0084] Optionally, when executing the program, the processor further implements the following steps: rendering the target rendering mode information based on the style rendering service to obtain a target page to be displayed; and compiling and converting the target page to be displayed to obtain a style file.
[0085] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0086] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0087] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0088] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0089] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0090] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0091] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0092] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for displaying a page. It is characterized in that include: Receiving, through a rendering server, a page display request forwarded by an HTTP server, wherein the rendering server includes a plurality of sub-services, the page display request includes at least a style language file of a target page requested for display, and the language type of the style language file is one of the following: Less language, Sass language; Parsing and rendering the style language file based on the multiple sub-services to obtain a page file corresponding to the target page to be displayed; The page file is returned to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
2. The method according to claim 1, It is characterized in that Parsing and rendering the style language file based on the multiple sub-services to obtain a page file corresponding to the target page to be displayed includes: Generate a target sandbox environment based on a sandbox service in the multiple sub-services, wherein the target sandbox environment is used to isolate a rendering environment; Based on the judgment service among the multiple sub-services, determining, in the target sandbox environment, preset rendering mode information corresponding to the target page to be displayed according to the style language file; Parsing the preset rendering mode information based on a first parsing service and a second parsing service in the multiple sub-services to obtain a parsing result, and performing style supplementation processing on the preset rendering mode information according to the parsing result to obtain target rendering mode information, wherein the first parsing service and the second parsing service parse different contents; Performing style rendering on the target rendering mode information based on a style rendering service in the multiple sub-services to obtain a style file corresponding to the target page to be displayed; The style file is packaged based on a packaging service in the multiple sub-services to obtain the page file.
3. The method according to claim 2, It is characterized in that Generating a target sandbox environment based on a sandbox service in the multiple sub-services includes: Acquire type information of the browser in the client based on the sandbox service; Determine a target sandbox environment type corresponding to the type information of the browser, and generate the target sandbox environment according to the target sandbox environment type.
4. The method according to claim 2, It is characterized in that Determining preset rendering mode information corresponding to the target page to be displayed in the target sandbox environment according to the style language file based on the judgment service in the multiple sub-services includes: Analyzing the file content of the style language file in the target sandbox environment based on the judgment service to obtain target tag information in the style language file, wherein the target tag information is used to indicate the skin type and language type corresponding to the target page; The preset rendering mode information is determined according to the target tag information.
5. The method according to claim 2, It is characterized in that The preset rendering mode information is parsed based on the first parsing service and the second parsing service in the multiple sub-services to obtain a parsing result, including: Parsing the first attribute information in the preset rendering mode information based on the first parsing service to obtain target skin type information; Parsing the second attribute information in the preset rendering mode information based on the second parsing service to obtain target language type information; The parsing result is formed according to the target skin type information and the target language type information.
6. The method according to claim 5, It is characterized in that Performing style supplementation processing on the preset rendering mode information according to the analysis result to obtain target rendering mode information includes: Based on the first parsing service, a target skin and a document object model style corresponding to the target skin are acquired from a style repository according to the target skin type information, and the preset rendering mode information is supplemented with a style according to the target skin and the document object model style to obtain first rendering mode information; Determining a target precompiler according to the target language type information based on the second parsing service, and supplementing the preset rendering mode information with a style according to the target precompiler to obtain second rendering mode information; The target rendering mode information is composed according to the first rendering mode information and the second rendering mode information.
7. The method according to claim 2, It is characterized in that Performing style rendering on the target rendering mode information based on the style rendering service in the multiple sub-services to obtain a style file corresponding to the target page to be displayed includes: Rendering the target rendering mode information based on the style rendering service to obtain the target page to be displayed; The target page to be displayed is compiled and converted to obtain the style file.
8. A device for displaying a page, It is characterized in that include: A receiving module, configured to receive a page display request forwarded by an HTTP server through a rendering server, wherein the rendering server includes a plurality of sub-services, and the page display request includes at least a style language file of a target page requested for display, wherein the language type of the style language file is one of the following: Less language, Sass language; A processing module, configured to parse and render the style language file based on the multiple sub-services to obtain a page file corresponding to the target page to be displayed; The sending module is used to return the page file to the HTTP server, wherein the HTTP server forwards the page file to the browser in the client for page display.
9. A computer program product, It is characterized in that It comprises a computer program, which, when executed by a processor, implements the page display method described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the page display method described in any one of claims 1 to 7 when running.
11. An electronic device, It is characterized in that The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the program is configured to execute the page display method described in any one of claims 1 to 7 when running.
Citation Information
Cited By
Sandbox isolation style debugging method and equipment based on generative AI technology
CN120493237A
