Page rendering method, device, apparatus and storage medium
By splitting application components into independent components and generating configuration files, on-demand loading is achieved, solving the problem of low rendering efficiency of online third-party packages and improving rendering efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHAOLIAN CONSUMER FINANCE CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-07-21
AI Technical Summary
Existing online third-party rendering technologies suffer from high overall loading latency, significant resource waste, and low fault tolerance. Simple block loading fails to achieve on-demand triggering, resulting in low rendering efficiency.
The application's components are divided into multiple independent components, configuration files are generated and published to the server, and the client downloads and loads the required component files from the cache or the server in parallel according to the configuration files for rendering.
By loading component files on demand, rendering efficiency is significantly improved, loading time is reduced, and user experience is enhanced, especially in weak network environments.
Smart Images

Figure CN122431750A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of front-end page development technology, and in particular to a method, apparatus, device and storage medium for rendering pages. Background Technology
[0002] With the digital transformation of enterprises, online third-party packages are widely used in internal enterprise systems and collaborative scenarios. Their page rendering efficiency and resource consumption directly impact user experience and system stability. Currently, there are two main implementation methods for rendering online third-party packages, both of which have significant drawbacks: The first approach is whole-component loading and rendering, which loads the online third-party package as a single component, regardless of which function the user currently needs. The disadvantages of this approach are: the more complex the third-party package's functionality, the larger the component size, and the longer the loading time, leading to high page initialization latency, especially noticeable in weak network environments, resulting in significant resource waste; furthermore, if a single component malfunctions, the entire third-party package will fail to render properly, resulting in low fault tolerance.
[0003] The second method, simple chunked loading, although it simply chunks the third-party package, does not achieve "on-demand triggering". It still loads most of the unnecessary components when the page is initialized. Moreover, the chunked components lack independent interfaces and cannot be called flexibly. The real-time rendering effect is poor, and the component switching delay is obvious when the user switches functions.
[0004] Therefore, it is necessary to develop a new method for rendering pages to improve rendering efficiency. Summary of the Invention
[0005] The main objective of this application is to provide a method, apparatus, device, and storage medium for rendering pages, aiming to solve the technical problem of improving rendering efficiency.
[0006] To achieve the above objectives, this application proposes a method for rendering a page, the method comprising: In response to an action that triggers page rendering, read the configuration file; Multiple component files are read based on the configuration information in the configuration file; The multiple component files are executed to render the page.
[0007] In one embodiment, the step of reading the configuration file includes: Determine if the configuration file exists in the cache; If the configuration file exists, it is read from the cache; if it does not exist, the configuration file is downloaded from the server and saved to the cache, and then read from the cache.
[0008] In one embodiment, the step of reading multiple component files based on the configuration information of the configuration file includes: Obtain the unique identifier of the plurality of component files from the configuration information; The multiple component files are iterated through in a loop, and the following operation is performed on each component file: based on the unique identifier of the component file, it is determined whether the component file exists in the cache; if not, the component file is marked as a component file to be downloaded. All component files to be downloaded are downloaded in parallel from the server and saved to the cache; Read the multiple component files from the cache.
[0009] In one embodiment, prior to the step of reading the configuration file in response to an operation that triggers page rendering, the method further includes: Generate and publish online component files; The steps for generating and publishing online component files specifically include: Divide the components of the basic application into multiple independent components; Publish the aforementioned multiple independent components to the server.
[0010] In one embodiment, prior to the step of reading the configuration file in response to an operation that triggers page rendering, the method further includes: Generate and publish the configuration file; The steps of generating and publishing the configuration file specifically include: The configuration file is generated according to customer requirements; Publish the configuration file to the server.
[0011] In one embodiment, it further includes: Different caching strategies are used to save the configuration file and the component file to the cache.
[0012] In one embodiment, the step of saving the configuration file and the component file to the cache using different caching strategies includes: The configuration file is stored using a short-term caching strategy, ensuring that the storage time of the configuration file in the cache does not exceed a preset value; The component file is stored in the cache using a long-term caching strategy until it is updated.
[0013] Furthermore, to achieve the above objectives, this application also proposes a page rendering apparatus, which includes: The configuration file reading module is used to read configuration files in response to actions that trigger page rendering. The component file acquisition module is used to acquire multiple component files based on the configuration information in the configuration file; The page rendering execution module is used to execute the multiple component files to perform page rendering.
[0014] In addition, to achieve the above objectives, this application also proposes a page rendering device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the page rendering method as described above.
[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the page rendering method described above.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: The page rendering method, apparatus, device, and storage medium proposed in this application obtain configuration information for multiple component files by reading a configuration file. Based on this configuration information, the multiple component files are read and executed to render the page. If the client needs to achieve a new rendering effect, it only needs to update the configuration file. Furthermore, the configuration file allows for flexible configuration of component files, enabling on-demand loading of component files. Compared to existing technologies that require loading all application component files during rendering, this method loads fewer component files, thus reducing rendering time and improving rendering efficiency. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the first embodiment of the page rendering method of this application; Figure 2 This is a flowchart illustrating step S10 in the second embodiment of the page rendering method of this application; Figure 3 This is a flowchart illustrating step S20 in the third embodiment of the page rendering method of this application; Figure 4 This is a flowchart illustrating the fourth embodiment of the page rendering method of this application; Figure 5 for Figure 4 A flowchart illustrating an embodiment of step S01; Figure 6 This is a flowchart illustrating the fifth embodiment of the page rendering method of this application; Figure 7 for Figure 6 A flowchart illustrating an embodiment of step S02; Figure 8 This is a flowchart illustrating the sixth embodiment of the page rendering method of this application; Figure 9 for Figure 8 A flowchart illustrating an embodiment of step S40; Figure 10 This is a schematic diagram of the module structure of the page rendering device according to an embodiment of this application; Figure 11 This is a schematic diagram of the device structure of the hardware operating environment involved in the page rendering method in the embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of this application embodiment is: in response to the operation of triggering page rendering, read the configuration file; read multiple component files according to the configuration information of the configuration file; and execute the multiple component files to perform page rendering.
[0024] In this embodiment, for ease of description, the following description will focus on the rendering page client as the execution subject.
[0025] Because existing page rendering methods have several shortcomings: The first approach is whole-component loading and rendering, which loads the online third-party package as a single component, regardless of which function the user currently needs. The disadvantages of this approach are: the more complex the third-party package's functionality, the larger the component size, and the longer the loading time, leading to high page initialization latency, especially noticeable in weak network environments, resulting in significant resource waste; furthermore, if a single component malfunctions, the entire third-party package will fail to render properly, resulting in low fault tolerance.
[0026] The second method, simple chunked loading, although it simply chunks the third-party package, does not achieve "on-demand triggering". It still loads most of the unnecessary components when the page is initialized. Moreover, the chunked components lack independent interfaces and cannot be called flexibly. The real-time rendering effect is poor, and the component switching delay is obvious when the user switches functions.
[0027] This application provides a solution that divides an application's components into multiple independent components, publishes these independent components to a server, and selects suitable components from these independent components according to customer needs. These suitable components are then configured into a configuration file to generate a configuration file, which is also published to the server. During rendering operations on the client side, firstly, the configuration file is read from the cache. If the configuration file is not in the cache, it is downloaded from the server to the cache, and then read from the cache. Next, based on the configuration file, multiple component files are read from the cache. If a component file is not in the cache, it is marked as a component file to be downloaded, and multiple component files to be downloaded are downloaded in parallel from the server to the cache, and then read from the cache. Finally, these component files are executed to render the page.
[0028] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions. The following description uses a personal computer as an example to illustrate this embodiment and the subsequent embodiments.
[0029] Based on this, embodiments of this application provide a method for rendering a page, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the page rendering method of this application. In this embodiment, the page rendering method includes steps S10 to S30: Step S10: In response to the operation that triggers the rendering of the page, read the configuration file.
[0030] Understandably, the action that triggers the rendering of the page is entering a page or clicking an icon on the page.
[0031] This configuration file contains configuration information for multiple component files. The configuration file includes: the IDs or names of each component file, and the component configuration data. The component configuration data includes business data such as displaying images, text, and links.
[0032] In real-world applications, the number of component files in a configuration file is typically a few, a dozen, or even more than a hundred.
[0033] Configuration files can be in various formats such as JSON, YAML, INI, Properties, and TOML.
[0034] Step S20: Read multiple component files according to the configuration information in the configuration file.
[0035] These multiple component files are independent components, each with its own interface functions.
[0036] Each component file is a compiled and bundled obfuscated JavaScript file. The content of each component file primarily contains the component's logic code.
[0037] Step S30: Execute the multiple component files to render the page.
[0038] After reading these component files, they can be executed directly to complete page rendering. Since these component files are executable files, they do not need to be recompiled, which significantly improves rendering efficiency.
[0039] In this step, the multiple component files are executed in parallel to quickly perform the rendering operation.
[0040] This embodiment obtains configuration information for multiple component files by reading a configuration file. Based on this configuration information, it reads and executes these component files to render the page. If the client needs to achieve a new rendering effect, it only needs to update the configuration file. Furthermore, the configuration file allows for flexible configuration of component files, enabling on-demand loading of component files. Compared to existing technologies that require loading all application component files during rendering, this method loads fewer component files, thus reducing rendering time and improving rendering efficiency.
[0041] The total execution time for rendering a page includes the time spent reading the configuration file; therefore, it is necessary to improve the efficiency of reading the configuration file. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating step S10 of reading the configuration file in the second embodiment of the page rendering method of this application. Based on the first embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. The difference between the second embodiment and the first embodiment is that step S10 may include steps A1 to A3.
[0042] A1: Check if the configuration file exists in the cache; It should be noted that this cache refers to the browser's cache.
[0043] You can check if a configuration file exists in the cache by its name or ID.
[0044] A2: If it exists, read the configuration file from the cache; If the configuration file exists in the cache, then read the configuration file from the cache.
[0045] A3: If it does not exist, download the configuration file from the server and save the configuration file to the cache, and read the configuration file from the cache.
[0046] If the configuration file does not exist, it is downloaded from the server based on the communication protocol. After downloading the configuration file from the server, it is saved to the cache for easy access next time.
[0047] In this embodiment, when executing step S10, the configuration file is first read from the cache. If it cannot be read from the cache, the configuration file is downloaded from the server to the cache, and then read from the cache. Compared to reading the configuration file from memory, this helps to shorten the time for reading the configuration file, thereby improving the efficiency of reading the configuration file and thus improving the rendering efficiency.
[0048] The total execution time for rendering a page includes the time spent reading multiple component files; therefore, it is necessary to improve the efficiency of reading these files. Please refer to... Figure 3 , Figure 3 This is a flowchart illustrating step S20 of reading multiple component files in the third embodiment of the page rendering method of this application. Based on the first embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. The difference between the third embodiment and the first embodiment is that in this embodiment, step S20 may include steps B1 to B4: B1: Obtain the unique identifier of the plurality of component files from the configuration information; The unique identifier for a component file can be either an ID or a filename.
[0049] B2: Loop through the multiple component files and perform the following operation for each component file: Determine whether the component file exists in the cache based on its unique identifier; if not, mark the component file as a component file to be downloaded. Based on the ID or file name of each component file, check if the component file exists in the cache. If the component file does not exist, it can be added to the array or queue of component files to be downloaded and waited for download.
[0050] B3: Download all component files to be downloaded from the server in parallel and save them to the cache; This step is the key step in this embodiment. In this step, a method of downloading multiple component files to be downloaded in parallel is used instead of downloading multiple component files to be downloaded serially.
[0051] B4: Read the plurality of component files from the cache.
[0052] In this embodiment, when executing step S20, the system first reads from the cache. If the file cannot be read from the cache, multiple component files are downloaded from the server for reading. This helps to shorten the time for reading multiple component files, thereby improving the efficiency of reading multiple component files and ultimately enhancing rendering efficiency.
[0053] Step B3 in this embodiment, by downloading the component files in parallel, significantly improves the download speed compared to downloading them serially, thereby enhancing rendering efficiency. Users will experience a noticeable improvement in page access efficiency, especially when first accessing the application.
[0054] In simple terms, when an application's functionality changes or new features are added, page rendering needs to be based on new components. Please refer to... Figure 4 , Figure 4 This is a flowchart illustrating the fourth embodiment of the page rendering method of this application. Figure 4 and Figure 1 The difference is that step S10 includes the following: Step S01: Generate and publish the online component files.
[0055] This online component file contains all the components of the base application, breaking them down into multiple independent components. The developers of this online component file are the application's software engineers. As the software engineers continuously add new features based on the development needs of the actual application, the size and volume of the base application continue to increase, and correspondingly, the number of these online component files also increases.
[0056] The base application is distinct from the application on this rendered page; it refers to the parent version of the application on this rendered page. The application on this rendered page generally has fewer features compared to the base application. However, in some cases, the application on this rendered page can also be the base application.
[0057] For applications that generate cost-rendered pages, the appropriate components should be configured according to the online component files published above when developing the configuration file.
[0058] In one feasible implementation, refer to Figure 5 Step S01 specifically includes the following sub-steps C1~C2: C1: Divide the components of the basic application into multiple independent components; Specifically, in the process of developing basic applications, a separate development structure for each component in the project is added. The code of each component is separated from the code layer, the boundaries and interface specifications of each component are clearly defined, code confusion between components is eliminated, and a component-based architecture with high cohesion and low coupling is achieved.
[0059] Then, the component loading collaboration logic is used as the first-level packaging entry point, and each of the above components is configured as a separate second-level packaging entry point to generate independent resource files for each component. Each independent resource file is an independent component.
[0060] C2: Publish the multiple independent components to the server.
[0061] In this embodiment, all component files of the client application are divided into multiple independent component files. When a component malfunctions, only that component file needs to be modified.
[0062] In other embodiments, the configuration files and multiple independent components may be published to different servers.
[0063] It's easy to understand that to achieve different rendering effects, the configuration file needs to be updated in real time. Please refer to... Figure 6 , Figure 6 This is a flowchart illustrating the fifth embodiment of the page rendering method of this application. Figure 6 and Figure 1 The difference is that step S10 includes the following: Step S02: Generate and publish the configuration file.
[0064] The developers of configuration files are typically operations and maintenance engineers.
[0065] The developers of online component files are typically application developers.
[0066] In one feasible implementation, refer to Figure 7 Step S02 specifically includes the following sub-steps D1~D2: D1: Generate the configuration file according to customer requirements; Specifically, configuration files are generated based on the client's requirements for rendering the page. Different components are configured in these configuration files according to different client requirements. When configuring components in the configuration files, multiple independent components can be selected and combined to generate different configuration files.
[0067] D2: Publish the configuration file to the server.
[0068] The configuration file can be published to the server manually or automatically.
[0069] In this embodiment, the operations and maintenance development engineer generates a configuration file based on customer requirements and then publishes the configuration file to the server. This allows for the flexible deployment of various applications to adapt to different application scenarios, building upon the already developed basic application. Furthermore, the configuration file can be created solely by the operations and maintenance development engineer, without the need for application development engineers. This division of labor reduces the workload of development engineers and facilitates application operations and maintenance.
[0070] In essence, to improve file reading efficiency, downloaded configuration files and component files are stored in a cache for easy access next time. Based on the first embodiment, please refer to... Figure 8 , Figure 8 This is a flowchart illustrating the sixth embodiment of the page rendering method of this application. Figure 8 and Figure 1 The difference lies in the fact that it also includes steps: S40: Use different caching strategies to save the configuration file and the component file to the cache.
[0071] Since configuration files and component files are updated at different frequencies, it is necessary to adopt different caching strategies to save configuration files and component files.
[0072] In one feasible implementation, refer to Figure 9 Step S40 may include steps E1 to E2: E1: Use a short-term caching strategy to save the configuration file, so that the storage time of the configuration file in the cache does not exceed a preset value; In this step, the retention time of the configuration file in the cache can be set to be equal to a preset value, or the retention time of the configuration file in the cache can be set to be less than the preset value, for example, one or two minutes less than the preset value.
[0073] For example, the preset value can be set to 5 minutes. The retention period of the configuration file in the cache can be set to 5 minutes. When the retention time of the configuration file in the cache exceeds 5 minutes, the configuration file will be deleted immediately.
[0074] E2: The component file is saved using a long-term caching strategy, and the component file is kept in the cache until the component file is updated.
[0075] It should be noted that different versions of component files can be distinguished by file extensions. When a new version of the component file is downloaded and saved to the cache, the old version of the component file is automatically and promptly deleted to update the component file in real time.
[0076] In addition, it should be noted that the rendering results are not saved to the cache in this embodiment because the rendering results depend on external data and are updated frequently. The rendering and running process is re-executed every time the user enters the application. This process takes up a small percentage of time and does not affect the overall application performance. At the same time, it can ensure that the user obtains the latest dynamic data.
[0077] This embodiment employs a cache reuse mechanism, directly using the cache for files that the user has already requested, thereby reducing file download and overall rendering time.
[0078] The configuration file in this embodiment adopts a short-term caching strategy, which can realize real-time updates of configuration data and achieve the "what you configure is what you get" effect after configuration changes take effect immediately. At the same time, it can take into account the loading performance of users who frequently enter the application in a short period of time and avoid resource consumption caused by repeated requests to the configuration file.
[0079] The component files in this embodiment adopt a long-term caching strategy. Given that most components are updated infrequently, long-term caching can prioritize the use of local cache to load components, reducing network request time. When the component code is updated, a new file request is triggered by modifying the component file extension, and the old version of the component file is naturally cleared within the cache period, ensuring the timeliness of component updates and the rationality of cache reuse.
[0080] This application also provides a page rendering device, please refer to... Figure 10 , Figure 10 This is a schematic diagram of the module structure of a page rendering device according to an embodiment of this application. In this embodiment, the page rendering device includes: The configuration file reading module 10 is used to read the configuration file in response to the operation that triggers the rendering of the page; The component file acquisition module 20 is used to acquire multiple component files based on the configuration information in the configuration file; The page rendering execution module 30 is used to execute the multiple component files to perform page rendering.
[0081] As one possible implementation, in this embodiment, the configuration file reading module 10 is further used to determine whether the configuration file exists in the cache; if so, the configuration file is read from the cache; if not, the configuration file is downloaded from the server and saved to the cache, and the configuration file is read from the cache.
[0082] As one possible implementation, in this embodiment, the component file acquisition module 20 is further configured to acquire the unique identifier of the plurality of component files from the configuration information; circumvent the plurality of component files and perform the following operations on each component file: determine whether the component file exists in the cache based on the unique identifier of the component file; if not, mark the component file as a component file to be downloaded; download all component files to be downloaded from the server in parallel and save them to the cache; and read the plurality of component files from the cache.
[0083] As one possible implementation, in this embodiment, the page rendering device further includes an online component file generation and publishing module. The online component file generation and publishing module is used to generate and publish online component files. The online component file generation and publishing module is also used to divide the components of the basic application into multiple independent components; and to publish the multiple independent components to the server.
[0084] In one possible implementation, this embodiment of the page rendering apparatus further includes a configuration file generation and publishing module. The configuration file generation and publishing module is used to generate and publish the configuration file. This module is also used to generate the configuration file according to customer requirements and publish the configuration file to the server.
[0085] As one possible implementation, in this embodiment, the page rendering apparatus further includes a file cache processing module. This file cache processing module is used to save the configuration file and the component files to the cache using different caching strategies.
[0086] As one possible implementation, in this embodiment, the file caching module is further configured to use a short-term caching strategy to save the configuration file, ensuring that the storage time of the configuration file in the cache does not exceed a preset value. The file caching module is also configured to use a long-term caching strategy to save the component file, keeping the component file in the cache until it is updated.
[0087] The rendering apparatus provided in this application, employing the rendering method described in the above embodiments, can solve the technical problem of low rendering efficiency during the rendering process. Compared with the prior art, the beneficial effects of the rendering apparatus provided in this application are the same as those of the rendering method provided in the above embodiments, and other technical features in the rendering apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0088] This application provides a page rendering device, which includes: a plurality of processors; and a memory communicatively connected to the plurality of processors; wherein the memory stores instructions executable by the plurality of processors, and the instructions are executed by the plurality of processors to enable the plurality of processors to execute the page rendering method in the first embodiment described above.
[0089] The following is for reference. Figure 11 This document illustrates a structural diagram of a rendering page device suitable for implementing embodiments of this application. The rendering page device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 11 The rendering device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0090] like Figure 11 As shown, the page rendering device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the page rendering device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the rendering page device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show rendering page devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.
[0091] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0092] The rendering device provided in this application, employing the rendering method described in the above embodiments, can solve the technical problem of rendering pages. Compared with the prior art, the beneficial effects of the rendering device provided in this application are the same as those of the rendering method provided in the above embodiments, and other technical features of the rendering device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0093] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0094] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0095] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the page rendering method in the above embodiments.
[0096] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0097] The aforementioned computer-readable storage medium may be included in a page rendering device or may exist independently and not assembled into a page rendering device.
[0098] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a page rendering device, enable the page rendering device to efficiently render a page.
[0099] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0101] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0102] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described page rendering method, thereby solving the technical problem of low rendering efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the page rendering method provided in the above embodiments, and will not be repeated here.
[0103] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for rendering a page, characterized in that, include: In response to an action that triggers page rendering, read the configuration file; Multiple component files are read based on the configuration information in the configuration file; The multiple component files are executed to render the page.
2. The page rendering method as described in claim 1, characterized in that, The steps for reading the configuration file include: Determine if the configuration file exists in the cache; If it exists, read the configuration file from the cache; If it does not exist, download the configuration file from the server and save the configuration file to the cache, and read the configuration file from the cache.
3. The page rendering method as described in claim 2, characterized in that, The step of reading multiple component files based on the configuration information in the configuration file includes: Obtain the unique identifier of the plurality of component files from the configuration information; The multiple component files are iterated through in a loop, and the following operation is performed on each component file: based on the unique identifier of the component file, it is determined whether the component file exists in the cache; if not, the component file is marked as a component file to be downloaded. All component files to be downloaded are downloaded in parallel from the server and saved to the cache; Read the multiple component files from the cache.
4. The page rendering method as described in claim 1, characterized in that, Before the step of reading the configuration file in response to the operation that triggers page rendering, the method further includes: Generate and publish online component files; The steps for generating and publishing online component files specifically include: Divide the components of the basic application into multiple independent components; Publish the aforementioned multiple independent components to the server.
5. The page rendering method as described in claim 1, characterized in that, Before the step of reading the configuration file in response to the operation that triggers page rendering, the method further includes: Generate and publish the configuration file; The steps of generating and publishing the configuration file specifically include: The configuration file is generated according to customer requirements; Publish the configuration file to the server.
6. The page rendering method as described in claim 1, characterized in that, Also includes: Different caching strategies are used to save the configuration files and component files to the cache.
7. The page rendering method as described in claim 6, characterized in that, The step of saving the configuration file and the component file to the cache using different caching strategies includes: The configuration file is stored using a short-term caching strategy, ensuring that the storage time of the configuration file in the cache does not exceed a preset value; The component file is stored in the cache using a long-term caching strategy until it is updated.
8. A page rendering apparatus, characterized in that, include: The configuration file reading module is used to read configuration files in response to actions that trigger page rendering. The component file acquisition module is used to acquire multiple component files based on the configuration information in the configuration file; The page rendering execution module is used to execute the multiple component files to perform page rendering.
9. A rendering device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the page rendering method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the page rendering method as described in any one of claims 1 to 7.