Browser-based page display method, device and equipment and storage medium

By obtaining and parsing the component files of structure, style, and logical text information in the Web front-end web page and embedding them into the main page file, the problem of lack of versatility and reliance on front-end frameworks in component development in the existing technology is solved, and the loading speed is improved. and development efficiency.

CN118643236APending Publication Date: 2024-09-13BYD CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310261304.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing component-based development lacks versatility in Web front-end web pages and cannot effectively handle structural components, resulting in slow page loading and difficulty in maintenance, and relies on specific front-end frameworks.

Method used

By obtaining and parsing component files containing structure, style, and logical text information, embedding them into the main page file, and asynchronously loading component files to improve performance and eliminate dependence on the front-end framework.

Benefits of technology

It improves page loading speed, simplifies development and maintenance processes, realizes component versatility and code reuse, and reduces redundant code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643236A
    Figure CN118643236A
Patent Text Reader

Abstract

The invention relates to a browser-based page display method and device, equipment and a storage medium. The browser-based page display method comprises the following steps: acquiring a home page file of a to-be-displayed target page; executing the main page file, and obtaining a component file introduced by the main page file; wherein the component file comprises multiple pieces of text information which are packaged in advance and correspond to page functions of the main page file, and the multiple pieces of text information comprise structure text information, style text information and logic text information; analyzing and splitting the component file to obtain a plurality of pieces of text information; respectively embedding the plurality of pieces of text information into the main page file to obtain the main page file embedded with the text information; and rendering and displaying the target page according to the main page file embedded with the text information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of front-end web page development, and more specifically, to a browser-based page display method, a page display device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the widespread use of Web applications, the functional requirements for Web applications (network applications) are increasing, and the page content is becoming more complex, resulting in the gradual increase in page file size. Therefore, whether from the perspective of the difficulty of page maintenance or the page loading speed, component-based development has become a trend.

[0003] Existing component-based development is generally based on established front-end frameworks and development environments, such as Vue or React. The corresponding component source code needs to follow the corresponding coding standards and requirements, and also needs to escape the code to form browser-recognizable code, which leads to the problem that the component-based development process of existing Web front-end web pages is not universal. In addition, there are also existing technologies that directly develop components for browsers, but these component-based developments are often limited to style components and logic files, and do not involve structural components. A complete page is composed of three major parts: structural components, style components, and logic components. Summary of the invention

[0004] An object of the embodiments of the present disclosure is to provide a new technical solution for a browser-based page display method.

[0005] According to the first aspect of the present disclosure, a browser-based page display method is provided, which includes: obtaining a main page file of a target page to be displayed; executing the main page file, and obtaining a component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structural text information, style text information and logical text information; parsing and splitting the component file to obtain a plurality of text information; embedding the plurality of text information into the main page file respectively to obtain a main page file with embedded text information; and rendering and displaying the target page according to the main page file with embedded text information.

[0006] Optionally, before obtaining the main page file of the target page to be displayed, the method also includes: receiving a user's input for loading the target page; in response to the input, sending a file request to the target server to obtain the main page file of the target page; and receiving the main page file of the target page returned by the target server according to the file request.

[0007] Optionally, obtaining the component file introduced by the main page file includes: obtaining at least one component file introduced by the main page file in an asynchronous manner.

[0008] Optionally, the main page file includes text embedding information for each text information in the component file, and the text embedding information indicates the embedding position of the corresponding text information in the main page file; embedding multiple text information into the main page file respectively includes: embedding multiple text information into the main page file respectively according to the text embedding information of each text information in the component file.

[0009] Optionally, the text embedding information of the structural text information includes container position information and text relative information, the container position information is the preset position information of the associated container corresponding to the structural text information in the main page file, and the text relative information is the embedding position of the structural text information relative to the associated container; according to the text embedding information of each text information in the component file, multiple text information are respectively embedded in the main page file, including: determining the container position of the associated container in the main page file according to the container position information; and embedding the structural text information into the main page file according to the text relative information and the container position.

[0010] Optionally, the structural text information is embedded into the main page file according to the text relative information and the container position, including: when the embedding position of the structural text information indicated by the text relative position information is the same as the container position, the structural text information directly replaces the associated container.

[0011] According to the second aspect of the present specification, a page display device is also provided. The page display device includes: a file acquisition module, used to acquire the main page file of the target page to be displayed; a component acquisition module, used to execute the main page file and acquire the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structural text information, style text information and logical text information; a file parsing module, used to parse and split the component file to obtain a plurality of text information; a text embedding module, used to embed the plurality of text information into the main page file respectively, and obtain the main page file embedded with text information; a page rendering module, used to render and display the target page according to the main page file embedded with text information.

[0012] Optionally, the component acquisition module further includes: an asynchronous acquisition module, configured to acquire at least one component file introduced by the main page file in an asynchronous manner.

[0013] According to a third aspect of this specification, an electronic device is also provided, including a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the browser-based page display method according to any one of the first aspects.

[0014] According to a fourth aspect of the present specification, there is also provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the browser-based page display method according to any one of the first aspects is implemented.

[0015] The browser-based page display method provided by the disclosed embodiment includes obtaining the main page file of the target page to be displayed; executing the main page file and obtaining the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structural text information, style text information and logical text information; parsing and splitting the component file to obtain a plurality of text information; embedding the plurality of text information into the main page file respectively to obtain the main page file embedded with the text information; rendering and displaying the target page according to the main page file embedded with the text information. In this way, the problems of redundant front-end code and cumbersome code reuse process of Web applications can be solved, the page loading speed can be improved, and the dependence on the front-end framework can be eliminated, which is convenient for developers to carry out front-end development and later maintenance.

[0016] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0018] Figure 1 is a hardware configuration diagram of an electronic device for implementing an embodiment;

[0019] Figure 2 is a flowchart of a browser-based page display method according to an embodiment;

[0020] Figure 3 is a schematic diagram of a page display method according to yet another embodiment;

[0021] Figure 4 is a schematic diagram of a page display device that can be used to implement an embodiment;

[0022] Figure 5 FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment. DETAILED DESCRIPTION

[0023] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present application.

[0024] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0025] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0026] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0027] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0028] <Implementation Environment and Hardware Configuration>

[0029] Figure 1 1 is a hardware configuration diagram of an electronic device 1000 that can be applied to the browser-based page display method according to an embodiment of the present invention.

[0030] like Figure 1 As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a display device 1400, an input device 1500, etc. Among them, the processor 1100 is used to execute a computer program, and the computer program may use an instruction set of an architecture such as x86, Arm, RISC, MIPS, SSE, etc. The memory 1200 includes, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 is a physical interface, such as a USB interface or a headphone interface, etc. The display device 1400 may be a display screen, and the display screen may be a touch display screen. The input device 1500 may include a keyboard, a mouse, etc., and may also include a touch device.

[0031] In this embodiment, the memory 1200 of the electronic device 1000 is used to store a computer program, and the computer program is used to control the processor 1100 to operate to implement the browser-based page display method according to any embodiment. A technician can design a computer program according to the scheme disclosed in this specification. How the computer program controls the processor 1100 to operate is well known in the art, so it will not be described in detail here.

[0032] It should be understood by those skilled in the art that although Figure 1Multiple devices of the electronic device 1000 are shown in the figure. The electronic device 1000 of the embodiment of the present disclosure may only involve some of the devices, or may also include other devices, which is not limited here.

[0033] <Method Example>

[0034] Figure 2 A method for displaying a page based on a browser according to an embodiment is shown. The method for displaying a page can be performed as follows: Figure 1 The electronic device 1000 shown is implemented. The electronic device 1000 is installed with a browser user end for loading a front-end page.

[0035] The page display method includes the following steps S1100 to S1500, which are described in detail below:

[0036] Step S1100, obtaining the main page file of the target page to be displayed.

[0037] In this embodiment, the browser may obtain a main page file corresponding to the target page to be displayed.

[0038] In one embodiment of the present application, before obtaining the main page file of the target page to be displayed in step S1100, the method further includes steps S1010 to S1030. The specific contents are as follows:

[0039] Step S1010, receiving a user's input for loading a target page.

[0040] In this embodiment, the user can complete the input for loading the target page in the browser. The target page can be a web page that the user requests to access. For example, the user's input can be the user entering the URL (Uniform Resource Locator) corresponding to the target page in the URL bar of the browser, or the user clicking the web link address corresponding to the target page in the browser, which is not limited here. After the user performs the corresponding input for loading the target page, the browser can receive the user's input for loading the target page.

[0041] Step S1020, in response to the input, sending a file request for obtaining the main page file of the target page to the target server.

[0042] In this embodiment, in response to the input of loading the target page, the browser may send a document request for obtaining the main page file of the target page to the target server. This is understandable to those skilled in the art and will not be described in detail here.

[0043] Step S1030, receiving the main page file of the target page returned by the target server according to the file request.

[0044] In this embodiment, after sending a document request to the target server, the browser may receive a main document file corresponding to the target page returned by the target server. The main page file may be an HTML (Hypertext Markup Language) file corresponding to the target page.

[0045] Step S1200, execute the main page file and obtain the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structural text information, style text information and logical text information.

[0046] In this embodiment, the main page file may include a page code. The page code includes the name of the component file to be introduced. After loading the main page file, the browser will execute the page code in the main page file to obtain the component file introduced by the page code. The component file may include a plurality of pre-packaged text information corresponding to the page function of the main page file. The plurality of text information may include structural text information, style text information and logical text information.

[0047] In one embodiment of the present application, step S1200, obtaining the component files introduced by the main page file, may include step S1210. The specific contents are as follows:

[0048] Step S1210, obtaining at least one component file introduced by the main page file in an asynchronous manner.

[0049] In this embodiment, ly.js (component parsing code file developed based on JavaScript) can be first introduced into the browser. The ly.js file is a parsing component source code written based on JavaScript (scripting programming language), which can be directly run in the browser without the need for an additional development environment.

[0050] In this embodiment, the page code can introduce one component file or multiple component files, which can be set according to the actual situation and is not limited here. The browser can obtain at least one component file introduced by the page code by asynchronous loading. Asynchronous loading is non-blocking loading, that is, while the browser is loading one component file among multiple component files, it can also continue to load other component files. Specifically, the browser can use the imports() function (import function) in ly.js to asynchronously load multiple component files. In addition, the page code can also define the operation of the component file after successful loading, so as to facilitate subsequent instantiation. Exemplarily, the page code can be: LY.imports (path: component address, handle()). Path: component address in the code can represent the introduction address of the component file. handle() is a callback function, which can represent the execution of a callback operation on the loaded component file.

[0051] In this embodiment, each component file can be encapsulated with three parts: structural text information, style text information, and logical text information. Specifically, the structural code in the structural text information, the style code in the style text information, and the logic code in the logical text information can be respectively wrapped by HTML tags Template (structural code module), Style (style code module), and Script (logic code module). The text structure of the structural text information, style text information, or logical text information can be respectively <template> Structure Code< / template> , <style>样式代码< / style> and <script>逻辑代码< / script> This is understandable to those skilled in the art and will not be described in detail here.

[0052] Step S1300, parse and split the component files to obtain multiple text information.

[0053] In this embodiment, the browser can use the loading method encapsulated in ly.js to parse and split the acquired component files to obtain multiple text information encapsulated in each component file, namely, structural text information, style text information and logical text information.

[0054] Step S1400 , embed multiple text information into the main page file respectively to obtain the main page file embedded with the text information.

[0055] In this embodiment, the browser can use the loading method encapsulated in ly.js to embed the structural text information, style text information and logical text information obtained by splitting the component files into the main page file respectively, to obtain the main page file after multiple text information are embedded.

[0056] In one embodiment of the present application, the main page file includes text embedding information for each text information in the component file, and the text embedding information indicates the embedding position of the corresponding text information in the main page file.

[0057] In this embodiment, the main page file may include text embedding information corresponding to the structure text information, text embedding information corresponding to the style text information, and text embedding information corresponding to the logic text information. The text embedding information corresponding to each text information may indicate the embedding position of each text information in the main page file.

[0058] In one embodiment of the present application, step S1400, embedding the plurality of text information into the main page file may include step S1410. The specific contents are as follows:

[0059] Step S1410, embedding multiple text information into the main page file respectively according to the text embedding information of each text information in the component file.

[0060] In this embodiment, the browser can embed the structural text information, style text information and logical text information directly into the main page file according to the embedding position indicated by the text embedding information corresponding to each text information. In detail, the text embedding information can use the style attributes of the relative page to set the embedding position of each text information. For example, the code of the text embedding information corresponding to the style text information can be: {position:absolute; top:0.left:0}. In detail, the "position:absolute" in this code means absolute positioning, and "top:0.left:0" means setting the style text information at a position that is 0 away from the top of the target page and 0 away from the left side of the target page. In other words, the text embedding information can indicate that the embedding position of the style text information can be the starting position of the main page file.

[0061] It should also be noted that, for the structured text information, the browser can adopt step S1410, that is, embed the structured text information directly into the main page file according to the embedding position indicated by the text embedding information corresponding to the structured text information. Figure 3 As shown, the browser can also use another method to embed the structured text information into the main page file, that is, embed the structured text information into the main page file according to the container position information and text relative information included in the text embedding information. The specific contents are as follows:

[0062] In one embodiment of the present application, the text embedding information of the structural text information includes container position information and text relative information. The container position information is the position information of the preset associated container corresponding to the structural text information in the main page file, and the text relative information is the embedding position of the structural text information relative to the associated container.

[0063] In the present embodiment, the text embedding information of the structured text information may further include container position information and text relative information. The container position information may be the position information of the associated container corresponding to the structured text information in the main page file. It should be noted that the associated container may be a container related to the structured text information defined in the page code. The text relative information may be the embedding position of the structured text information relative to the associated container. Among them, the container tag in the HTML file includes a start container tag and an end container tag. The container in the above content refers to the area surrounded by the start container tag and the end container tag. The HTML file includes a plurality of containers surrounded by different container tags. This is understandable to those skilled in the art and will not be described in detail here.

[0064] In one embodiment of the present application, step S1410, according to the text embedding information of each text information in the component file, embeds multiple text information into the main page file respectively, which may include steps S1411 to S1412. The specific contents are as follows:

[0065] Step S1411, determining the container position of the associated container in the main page file according to the container position information.

[0066] In this embodiment, the browser may determine the container position in the associated container main page file corresponding to the container position information according to the container position information in the text embedding information of the structured text information.

[0067] Step S1412, embedding the structured text information into the main page file according to the text relative information and the container position.

[0068] In this embodiment, if Figure 3 As shown, according to the container position of the associated container indicated by the container position information and the embedding position of the structural text information relative to the associated container indicated by the text relative information, the structural text information can be embedded in the designated position of the main page file.

[0069] Specifically, when the text relative information indicates that the embedding position of the structural text information relative to the associated container is before the associated container, the browser can use the before() method in ly.js (a built-in method for adding content before the selected element) to embed the structural text information before the container external position of the associated container; when the text relative information indicates that the embedding position of the structural text information relative to the associated container is after the associated container, the browser can use the after() method in ly.js (a built-in method for inserting specified content after the selected element) to embed the structural text information after the container external position of the associated container; when the text relative information indicates that the structural text information is embedded in the associated container, the browser can use the after() method in ly.js (a built-in method for inserting specified content after the selected element) to embed the structural text information after the container external position of the associated container. When the embedding position of the information relative to the associated container is the front of the associated container, the browser can use the insertBefore() method in ly.js (a built-in method that can add a new child node to the beginning of the child node list of the current node) to embed the structured text information into the starting position of the associated container; when the text relative information indicates that the embedding position of the structured text information relative to the associated container is the last position of the associated container, the browser can use the insertAfter() method in ly.js (a built-in method that can insert a new child node to the end of the child node list of the current node) to embed the structured text information into the ending position of the associated container. This is understandable to those skilled in the art and will not be elaborated on here.

[0070] In an embodiment of the present application, step S1412, embedding structured text information into the main page file according to the text relative information and the container position may include step S1412A. The specific contents are as follows:

[0071] Step S1412A: When the embedding position of the structured text information indicated by the text relative position information is the same as the container position, the structured text information directly replaces the associated container.

[0072] In this embodiment, when the text relative information indicates that the embedding position of the structural text information relative to the associated container is consistent with the container position of the associated container, the browser can directly replace the associated container with the structural text information. Specifically, the browser can use the replace() method in ly.js (a built-in method for replacing some characters with other characters in a string) to directly replace the associated container with the structural text information. The embedding position of the replaced structural text information in the main page file can be consistent with the container position of the previous associated container.

[0073] Step S1500, rendering and displaying the target page according to the main page file embedded with the text information.

[0074] In this embodiment, the browser can instantiate the structure text information, the style text information and the logic text information. After the instantiation is completed, the browser can render and display the target page corresponding to the main page file according to the main page file embedded with the text information.

[0075] Specifically, the page code of the main document file will define the component files to be introduced and the callback function handle() executed for each text information included in the component file. Therefore, each text information will execute the callback function handle() after being embedded in the main page document. Exemplarily, the browser can convert the structured text information into DOM nodes and return it as a parameter in the callback function handle(template). The browser will instantiate the DOM (Document Object Model) node in the callback function. This is understandable to those skilled in the art and will not be described in detail here.

[0076] After instantiating the structural text information, style text information, and logic text information embedded in the main page file, the browser can render and display the target page corresponding to the main page file according to the main page file.

[0077] The browser-based page display method provided by the embodiment of the present application obtains the main page file of the target page to be displayed; executes the main page file, and obtains the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structural text information, style text information and logical text information; parses and splits the component file to obtain a plurality of text information; embeds the plurality of text information into the main page file respectively to obtain the main page file with embedded text information; renders and displays the target page according to the main page file with embedded text information. In this way, the problems of redundant front-end code and cumbersome code reuse process of Web applications can be solved, the page loading speed can be improved, and the dependence on the front-end framework can be eliminated, which is convenient for developers to carry out front-end development and later maintenance.

[0078] <System Embodiment>

[0079] In this embodiment, a page display device 2000 is also provided. Figure 4 As shown, the page display device includes a file acquisition module 2100, a component acquisition module 2200, a file parsing module 2300, a text embedding module 2400 and a page rendering module 2500. Among them:

[0080] The file acquisition module 2100 is used to acquire the main page file of the target page to be displayed;

[0081] The component acquisition module 2200 is used to execute the main page file and acquire the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structure text information, style text information and logic text information;

[0082] The file parsing module 2300 is used to parse and split the component files to obtain multiple text information;

[0083] The text embedding module 2400 is used to embed multiple text information into the main page file respectively to obtain the main page file embedded with the text information;

[0084] The page rendering module 2500 is used to render and display the target page according to the main page file embedded with text information.

[0085] In one embodiment of the present application, the component acquisition module 2200 further includes an asynchronous acquisition module 2210. Wherein:

[0086] The asynchronous acquisition module 2210 is used to asynchronously acquire at least one component file introduced by the main page file.

[0087] The page display device provided in the embodiment of the present application can solve the problems of redundant front-end code and cumbersome code reuse process of Web applications, improve the page loading speed, and eliminate the dependence on the front-end framework, making it easier for developers to perform front-end development and subsequent maintenance.

[0088] It should be noted that, although several modules or units of the system for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the implementation method of the present application, the characteristics and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the characteristics and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0089] <Equipment Embodiment>

[0090] In this embodiment, an electronic device 7000 is also provided. Figure 5 As shown, the electronic device 7000 may include a processor 7100 and a memory 7200, wherein the memory 7200 stores computer instructions, and when the computer instructions are executed by the processor 7100, the browser-based page display method of any embodiment of the present disclosure is executed.

[0091] <Medium Example>

[0092] In this embodiment, a computer-readable storage medium is further provided, on which computer instructions are stored. When the computer instructions are executed by a processor, a browser-based page display method as in any method embodiment of the present invention is implemented.

[0093] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing the processor 2100 to implement various aspects of the present invention.

[0094] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0095] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0096] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0097] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0098] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0099] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0100] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0101] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A browser-based page display method, characterized in that: include: Get the main page file of the target page to be displayed; Executing the main page file and acquiring the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structure text information, style text information and logic text information; Parsing and splitting the component files to obtain the multiple text information; Embedding the plurality of text information into the main page file respectively to obtain a main page file embedded with the text information; The target page is rendered and displayed according to the main page file embedded with the text information.

2. The page display method according to claim 1, characterized in that: Before obtaining the main page file of the target page to be displayed, the method further includes: Receiving a user's input for loading the target page; In response to the input, sending a file request for acquiring a main page file of the target page to a target server; Receive the main page file of the target page returned by the target server according to the file request.

3. The page display method according to claim 1, characterized in that: The obtaining of the component file introduced by the main page file includes: At least one of the component files introduced by the main page file is obtained in an asynchronous manner.

4. The page display method according to claim 1, characterized in that: The main page file includes text embedding information of each text information in the component file, and the text embedding information indicates the embedding position of the corresponding text information in the main page file; The embedding the plurality of text information into the main page file respectively comprises: The plurality of text information are respectively embedded in the main page file according to the text embedding information of each text information in the component file.

5. The page display method according to claim 4, characterized in that: The text embedding information of the structured text information includes container position information and text relative information, wherein the container position information is the position information of the associated container corresponding to the structured text information in the main page file, and the text relative information is the embedding position of the structured text information relative to the associated container; The embedding of the plurality of text information into the main page file respectively according to the text embedding information of each text information in the component file comprises: Determining the container position of the associated container in the main page file according to the container position information; The structured text information is embedded into the main page file according to the text relative information and the container position.

6. The page display method according to claim 5, characterized in that: The embedding the structured text information into the main page file according to the text relative information and the container position includes: In the case that the embedding position of the structured text information indicated by the text relative position information is the same as the container position, the structured text information directly replaces the associated container.

7. A page display device, characterized in that: The device comprises: A file acquisition module, used to acquire the main page file of the target page to be displayed; A component acquisition module, used to execute the main page file and acquire the component file introduced by the main page file; wherein the component file includes a plurality of pre-packaged text information corresponding to the page function of the main page file, and the plurality of text information includes structure text information, style text information and logic text information; A file parsing module, used for parsing and splitting the component files to obtain the multiple text information; A text embedding module, used for embedding the plurality of text information into the main page file respectively, to obtain a main page file with embedded text information; The page rendering module is used to render and display the target page according to the main page file embedded with the text information.

8. The page display device according to claim 7, characterized in that: The component acquisition module also includes: The asynchronous acquisition module is used to acquire at least one component file introduced by the main page file in an asynchronous manner.

9. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the browser-based page display method according to any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the browser-based page display method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Page rendering method and device, computer equipment and storage medium

    CN114579137A