Page loading method, device, storage medium and electronic device
Through virtual rendering and storage of page data, the problem of repeated rendering after page jump is solved, the page loading speed is improved, and the user experience is improved.
Patent Information
- Application Number
- CN202210556064.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-05-20
AI Technical Summary
When the page returns again after jumping, the page components are destroyed, causing the browser to re-render, resulting in a long page loading time and affecting the user experience.
By obtaining the pre-stored historical page rendering file, if there is no rendering file for the target page, the page data is obtained from the server for virtual rendering, the first page rendering file is generated, and the target page is loaded according to the file to avoid repeated rendering.
Improved page loading speed, improved user experience, and reduced page data request and rendering time.
Smart Images

Figure CN114817816B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a page loading method, device, storage medium and electronic device. Background Art
[0002] In actual application scenarios, it is common to return to the current page after jumping from the current page. After the page jumps, the page components in the page will be destroyed. If you return to the page again, you need to re-render the page in the browser through the browser rendering mechanism, which results in a long page loading time and affects the user experience. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a page loading method, device, storage medium and electronic device.
[0004] According to a first aspect of the present invention, a method for loading a page is provided, the method comprising:
[0005] In response to a rendering request for a target page, obtaining a historical page rendering file corresponding to one or more pre-stored historical pages;
[0006] If the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages, obtaining page data of the target page from a server corresponding to the target page;
[0007] Performing virtual rendering according to the page data to obtain the first page rendering file;
[0008] The target page is loaded according to the first page rendering file.
[0009] Optionally, the method further comprises: when there is a first page rendering file corresponding to the target page in the history page rendering files corresponding to the one or more history pages, determining a second page rendering file corresponding to the target page from the pre-stored history page rendering files corresponding to the one or more history pages; wherein the history page rendering files include a first rendering node for recording each page element in the history page;
[0010] The target page is loaded according to the second page rendering file.
[0011] Optionally, performing virtual rendering according to the page data to obtain the first page rendering file includes:
[0012] According to the page data, virtual rendering is performed in the storage space to obtain a second rendering node corresponding to each page element in the target page;
[0013] The first page rendering file is obtained according to the second rendering node.
[0014] Optionally, the method further includes: acquiring first page identification information of the target page;
[0015] According to the first page identification information, the first page rendering file is stored as a historical page rendering file corresponding to the historical page.
[0016] Optionally, the method further comprises: in response to a page jump request for the target page, acquiring a target page element in the current target page;
[0017] The first page rendering file is updated according to the target page element.
[0018] Optionally, the acquiring the first page identification information of the target page includes:
[0019] Obtaining page address information of the target page;
[0020] Generate a key value of the target page according to the page address information;
[0021] The first page identification information is obtained according to the key value and the first page rendering file.
[0022] Optionally, the method further includes: acquiring first page identification information of the target page;
[0023] The absence of the first page rendering file corresponding to the target page in the historical page rendering files corresponding to the one or more historical pages is determined in the following manner:
[0024] When the second page identification information corresponding to the one or more historical pages does not include the first page identification information, it is determined that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages.
[0025] Optionally, the method further includes: deleting any one or more historical page rendering files corresponding to the one or more historical pages when the storage time of the historical page rendering files corresponding to the one or more historical pages reaches a preset storage time threshold; or,
[0026] After the user triggers a storage reset request, the historical page rendering files corresponding to any one or more of the historical pages are deleted.
[0027] According to a second aspect of the present invention, a device for page loading is provided, the device comprising:
[0028] A first acquisition module, configured to acquire, in response to a rendering request for a target page, a historical page rendering file corresponding to one or more pre-stored historical pages;
[0029] A second acquisition module is used to acquire page data of the target page from a server corresponding to the target page when the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages;
[0030] A rendering module, used for performing virtual rendering according to the page data to obtain the first page rendering file;
[0031] The first loading module is used to load the target page according to the first page rendering file.
[0032] Optionally, the device further comprises:
[0033] A determination module, configured to determine, when there is a first page rendering file corresponding to the target page in the history page rendering files corresponding to the one or more history pages, a second page rendering file corresponding to the target page from the pre-stored history page rendering files corresponding to the one or more history pages; wherein the history page rendering files include a first rendering node for recording each page element in the history page;
[0034] The second loading module is used to load the target page according to the second page rendering file.
[0035] Optionally, the rendering module is used to perform virtual rendering in a storage space according to the page data to obtain a second rendering node corresponding to each page element in the target page; and obtain the first page rendering file according to the second rendering node.
[0036] Optionally, the device further comprises:
[0037] A third acquisition module, used to acquire first page identification information of the target page;
[0038] A storage module is used to store the first page rendering file as a historical page rendering file corresponding to the historical page according to the first page identification information.
[0039] Optionally, the device further comprises:
[0040] A fourth acquisition module, configured to acquire a target page element in the current target page in response to a page jump request to the target page;
[0041] An updating module is used to update the first page rendering file according to the target page element.
[0042] Optionally, the third acquisition module is used to acquire page address information of the target page; generate a key value of the target page according to the page address information; and obtain the first page identification information according to the key value and the first page rendering file.
[0043] Optionally, the third acquisition module is used to acquire first page identification information of the target page;
[0044] The second acquisition module is used to determine that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages when the second page identification information corresponding to the one or more historical pages does not include the first page identification information.
[0045] Optionally, the device also includes: a deletion module, used to delete any one or more historical page rendering files corresponding to the historical pages when the storage time of the historical page rendering files corresponding to the one or more historical pages stored reaches a preset storage time threshold; or, after the user triggers a storage reset request, delete the historical page rendering files corresponding to any one or more historical pages.
[0046] According to a third aspect of the present invention, there is provided a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect of the present invention.
[0047] According to a fourth aspect of the present invention, there is provided an electronic device, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the method described in the first aspect of the present invention.
[0048] Through the above technical solution, first, in response to a rendering request for a target page, a historical page rendering file corresponding to one or more pre-stored historical pages is obtained; secondly, when the first page rendering file corresponding to the target page does not exist in the historical page rendering file corresponding to one or more historical pages, the page data of the target page is obtained from the server corresponding to the target page; then, virtual rendering is performed according to the page data to obtain the first page rendering file; finally, the target page is loaded according to the first page rendering file. Through the above technical solution, when the first page rendering file corresponding to the target page does not exist in the historical page rendering file corresponding to one or more historical pages, that is, when the target page is rendered for the first time, virtual rendering is first performed through the page data to obtain the rendered first page rendering file, and then the target page is loaded according to the first page rendering file. In other words, the present invention does not directly render the target page in the browser, but first virtually renders the page data into the first page rendering file, and then loads the target page according to the first page rendering file. In this way, when the user visits the target page again, the target page can be loaded according to the first page rendering file, without re-rendering the target page, which improves the speed of page loading and improves the user experience.
[0049] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention but do not constitute a limitation of the present invention. In the accompanying drawings:
[0051] Figure 1 is a flow chart of a page loading method according to an exemplary embodiment;
[0052] Figure 2 is a flow chart of another method for loading a page according to an exemplary embodiment;
[0053] Figure 3 is a flow chart of another method for loading a page according to an exemplary embodiment;
[0054] Figure 4 is a flow chart of another method for loading a page according to an exemplary embodiment;
[0055] Figure 5 is a flow chart of another method for loading a page according to an exemplary embodiment;
[0056] Figure 6is a flow chart of another method for loading a page according to an exemplary embodiment;
[0057] Figure 7 is a structural diagram of a device for page loading according to an exemplary embodiment;
[0058] Figure 8 is a structural diagram of another device for page loading according to an exemplary embodiment;
[0059] Fig. 9 is a structural diagram of another device for page loading according to an exemplary embodiment;
[0060] Fig.10 is a structural diagram of another device for page loading according to an exemplary embodiment;
[0061] Fig.11 is a structural diagram of another device for page loading according to an exemplary embodiment;
[0062] Fig.12 The diagram is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0064] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0065] In the description below, words such as “first” and “second” are only used for the purpose of distinguishing the description and should not be understood as indicating or implying relative importance or order.
[0066] As mentioned in the background technology, if you return to the page again, you need to re-render the page in the browser through the browser rendering mechanism. After the page is rendered by the browser, the rendered data will not be saved. In other words, the page will be re-rendered every time the user enters the page.
[0067] In view of this, the present invention provides a method, device, storage medium and electronic device for page loading, which first virtually renders page data into a first page rendering file, and then loads a target page according to the first page rendering file. In this way, when a user visits the target page again, the target page can be loaded according to the first page rendering file without re-rendering the target page, thereby improving the page loading speed and enhancing the user experience.
[0068] The specific implementation modes of the present invention are described in detail below with reference to the accompanying drawings.
[0069] Figure 1 is a flow chart of a method for loading a page according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps:
[0070] In step S101, in response to a rendering request for a target page, a historical page rendering file corresponding to one or more pre-stored historical pages is obtained.
[0071] In actual application scenarios, when a user enters for the first time or triggers a jump request to a target page, a rendering request for the target page will be triggered.
[0072] The one or more historical page rendering files may be stored after rendering the one or more historical pages.
[0073] In some embodiments, the target page may be a pre-set page that needs to be stored. For example, the page that needs to be stored may be pre-determined by encapsulating the target page in a designated component. If a user triggers a rendering request for the target page, it is possible to obtain a historical page rendering file corresponding to one or more pre-stored historical pages to further determine whether there is a first page rendering file corresponding to the target page in the historical page rendering files corresponding to one or more historical pages. If the page for which the user triggers the rendering request is not included in the target page, it can be determined that the page does not need to be stored, and the page can be directly rendered on the browser according to the browser rendering mechanism in the prior art, which also reduces the storage pressure of the storage space to a certain extent.
[0074] In step S102, when the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to one or more historical pages, the page data of the target page is obtained from the server corresponding to the target page.
[0075] For example, it can be determined in the following manner that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to one or more historical pages: the first page identification information of the target page can be first obtained, and when the second page identification information corresponding to one or more historical pages does not include the first page identification information, it is determined that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to one or more historical pages.
[0076] Specifically, first, the first page identification information of the target page can be obtained. Among them, the page address information of the target page can be obtained first, and the key value of the target page can be generated according to the page address information. Then, according to the key value, the first page identification information is obtained. By way of example, the page address information can be, for example, a page URL (English: Uniform Resource Locator; Chinese: Uniform Resource Locator) path. For example, if the page URL path of the target page is http: / / www.xxx.com / a / b, then the key value of the target page can be "key_a_b", and then the key value can be used as the first page identification information, that is, the first page identification information of the target page is "key_a_b". Similarly, the second page identification information corresponding to one or more historical pages can also be obtained by the above method according to the page address information of the historical pages.
[0077] In this step, if the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to one or more historical pages, it can be determined that the target page is rendered for the first time, and page data for rendering the target page can be obtained from the server corresponding to the target page.
[0078] In step S103, virtual rendering is performed according to the page data to obtain the first page rendering file.
[0079] In this step, compared with the prior art of directly rendering the page data in the browser, this embodiment virtually renders the page data into the first page rendering file. In this way, the first page rendering file of the target page can be saved, and the next time the user visits the target page, there is no need to render the target page again, and the target page can be directly loaded according to the first page rendering file, avoiding repeated rendering and improving the page loading speed.
[0080] In step S104, the target page is loaded according to the first page rendering file.
[0081] By adopting the above scheme, when the first page rendering file corresponding to the target page does not exist in the historical page rendering file corresponding to one or more historical pages, that is, when the target page is rendered for the first time, the page data is first virtually rendered to obtain the rendered first page rendering file, and then the target page is loaded according to the first page rendering file. In other words, the present invention does not render the target page directly in the browser, but first virtually renders the page data into the first page rendering file, and then loads the target page according to the first page rendering file. In this way, when the user visits the target page again, the target page can be loaded according to the first page rendering file, without re-rendering the target page, which improves the speed of page loading and enhances the user experience.
[0082] Figure 2 is a flow chart showing another method for loading a page according to an exemplary embodiment. Figure 2 As shown, the method may also include the following steps:
[0083] In step S105, when the first page rendering file corresponding to the target page exists in the historical page rendering files corresponding to the one or more historical pages, a second page rendering file corresponding to the target page is determined from the pre-stored historical page rendering files corresponding to the one or more historical pages.
[0084] The historical page rendering file includes a first rendering node for recording each page element in the historical page, and the first rendering node is obtained by rendering according to the page data of the historical page.
[0085] Similarly, firstly, the first page identification information of the target page can be obtained. Secondly, when the second page identification information corresponding to one or more historical pages includes the first page identification information, it can be determined that the first page rendering file corresponding to the target page exists in the historical page rendering files corresponding to one or more historical pages.
[0086] In this step, if there is a first page rendering file corresponding to the target page in the historical page rendering files corresponding to one or more historical pages, it can be determined that the target page is not rendered for the first time, then the second page rendering file corresponding to the target page can be determined from the historical page rendering files corresponding to one or more historical pages stored in advance. In this way, the target page can be loaded directly according to the acquired second page rendering file, avoiding repeated rendering. In addition, the page elements of the historical page corresponding to the target page and the status of the page (for example, scrolling the page to a specified position, filtering the page components, etc.) are stored in the second page rendering file. In other words, all operations performed by the user on the historical page corresponding to the target page at the historical moment will be saved. When the user visits the target page again, there is no need to re-perform the relevant operations (such as re-scrolling the page to a specified position, re-filtering the page components, etc.), which improves the user experience.
[0087] In step S106, the target page is loaded according to the second page rendering file.
[0088] Figure 3 is a flow chart showing another method for loading a page according to an exemplary embodiment. Figure 3 As shown, step S103 performs virtual rendering according to the page data to obtain a first page rendering file including:
[0089] In step S1031, virtual rendering is performed in the storage space according to the page data to obtain a second rendering node corresponding to each page element in the target page.
[0090] In step S1032, the first page rendering file is obtained according to the second rendering node.
[0091] The first page rendering file may be, for example, a virtual DOM (English: Document Object Model; Chinese: Document Object Model) of a second rendering node for storing a target page created in a storage space. Accordingly, the second rendering node may be, for example, a DOM node corresponding to each page element in the target page obtained by performing virtual rendering in a storage space according to page data.
[0092] Similarly, the first rendering node may also be a DOM node corresponding to each page element in the historical page.
[0093] The storage space may be a memory or a cache, and those skilled in the art may select one according to actual needs, which is not limited here.
[0094] Figure 4 is a flow chart showing another method for loading a page according to an exemplary embodiment. Figure 4 As shown, the method may also include the following steps:
[0095] In step S107, the first page identification information of the target page is obtained.
[0096] In order to facilitate the user to visit the target page again later, the corresponding stored historical page rendering file can be found and loaded according to the first page identification information, without re-rendering the target page. In some embodiments, the first page identification information of the target page can also be obtained through the following steps: S1, obtain the page address information of the target page. S2, generate the key value of the target page according to the page address information. S3, obtain the first page identification information according to the key value and the first page rendering file. For example, if the key value is "key_a_b", the key value can be used as the key, and the second rendering node in the first page rendering file can be used as the value, thereby forming a key-value pair format, such as "{key: "key_a_b", value: "page a"}", where "key_a_b" is the key in the key-value pair, and "page a" is the value in the key-value pair.
[0097] In step S108, according to the first page identification information, the first page rendering file is stored as a historical page rendering file corresponding to the historical page.
[0098] In this way, when the user triggers a page jump request for the target page, only the page components displayed on the target page are destroyed, and the first page rendering file corresponding to the target page has been stored. When the target page is visited next time, the target page can be loaded directly according to the stored historical page rendering file, saving the time of page data request and page rendering, and improving the user experience.
[0099] It should be noted that in Figure 4 In the process, step S104 can also be executed after step S108, that is, after storing the first page rendering file as the historical page rendering file corresponding to the historical page, the first page rendering file corresponding to the target page can be directly obtained from the historical page rendering file corresponding to the historical page. This method can avoid directly rendering the target page in the browser.
[0100] Figure 5 This is a flow chart of another method for loading a page according to an exemplary embodiment. Considering that the rendering method in the prior art is to render directly on the browser, if the user has previously performed operations such as filtering, sliding pages, filling in, etc., they will not be saved and the user needs to perform the operations again, which affects the user's experience. Figure 5 As shown, the method may also include the following steps:
[0101] In step S109, in response to the page jump request to the target page, a target page element in the current target page is obtained.
[0102] In order to save the latest status of all page elements in the target page, in this embodiment, when the user triggers a page jump request for the target page, the target page element in the current page of the target page is obtained. The target page element is used to record all page components in the target page at the current moment and the page status of the target page. The page status may include, for example, the scrolling position of the target page at the current moment or the user's screening of page components. In this way, when the user visits the target page again, the target page can maintain the status when the target page was last entered, and the user does not need to re-operate.
[0103] In step S110, the first page rendering file is updated according to the target page element.
[0104] For example, the target page element can be compared with the page element in the first page rendering file, the difference between the target page element and the page element in the first page rendering file is obtained, the first page rendering file is updated according to the difference, and the updated first page rendering file is stored as the historical page rendering file corresponding to the historical page.
[0105] It should be noted that if the target page is obtained by loading the second page rendering file, that is, the target page is not rendered for the first time, the target page element in the current page of the target page can also be obtained in response to the page jump request for the target page, and the second page rendering file can be updated according to the target page element, and the updated second page rendering file is stored as the historical page rendering file corresponding to the historical page. In this way, it can be ensured that the historical page rendering file corresponding to the historical page records the latest page status of each page.
[0106] In addition, considering that in some scenarios, users hope that the target page can be reset to the initial state, and in order to prevent memory leaks in the storage space and ensure that the page loading is not affected. Figure 6 As shown, the method may also include the following steps:
[0107] In step S111, when the storage time of the historical page rendering files corresponding to one or more stored historical pages reaches a preset storage time threshold, the historical page rendering files corresponding to any one or more historical pages are deleted; or, after the user triggers a storage reset request, the historical page rendering files corresponding to any one or more of the historical pages are deleted.
[0108] In this embodiment, if the user has not visited the stored historical pages for a long time, that is, the storage time of the historical page rendering files corresponding to one or more stored historical pages reaches the preset storage time threshold, in order to prevent memory leakage in the storage space and ensure that the loading of the page is not affected, it is necessary to clear the historical pages that have not been visited for a long time, that is, delete the historical page rendering files corresponding to any one or more historical pages. Among them, only the historical page rendering files corresponding to the historical pages whose storage time in the storage space reaches the preset storage time threshold can be deleted, and all historical page rendering files stored in the storage space can also be deleted when the storage time of the historical page rendering files corresponding to any one of the historical pages reaches the preset storage time threshold.
[0109] If the user wants to reset the storage, for example, the user triggers a page refresh request for the target page, then in order to meet the user's needs, only the historical page rendering file of the target page stored in the storage space can be deleted, or all historical page rendering files stored in the storage space can be deleted. In this way, when the user revisits the target page, since the first page rendering file corresponding to the target page is not stored in the storage space, the target page will be re-rendered, that is, the target page will return to the initial state of the page.
[0110] By adopting the above scheme, when the first page rendering file corresponding to the target page does not exist in the historical page rendering file corresponding to one or more historical pages, that is, when the target page is rendered for the first time, the page data is first virtually rendered to obtain the rendered first page rendering file, and then the target page is loaded according to the first page rendering file. In other words, the present invention does not render the target page directly in the browser, but first virtually renders the page data into the first page rendering file, and then loads the target page according to the first page rendering file. In this way, when the user visits the target page again, the target page can be loaded according to the first page rendering file, without re-rendering the target page, which improves the speed of page loading and enhances the user experience.
[0111] Figure 7 is a structural diagram of a device for page loading according to an exemplary embodiment. Figure 7 As shown, the device 200 includes:
[0112] A first acquisition module 201 is used to acquire, in response to a rendering request for a target page, a historical page rendering file corresponding to one or more pre-stored historical pages;
[0113] A second acquisition module 202 is used to acquire page data of the target page from a server corresponding to the target page when the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages;
[0114] A rendering module 203, used for performing virtual rendering according to the page data to obtain the first page rendering file;
[0115] The first loading module 204 is used to load the target page according to the first page rendering file.
[0116] Alternatively, if Figure 8 As shown, the device 200 also includes:
[0117] The determination module 205 is used to determine the second page rendering file corresponding to the target page from the pre-stored historical page rendering files corresponding to the one or more historical pages when the first page rendering file corresponding to the target page exists in the historical page rendering files corresponding to the one or more historical pages; wherein the historical page rendering files include a first rendering node for recording each page element in the historical page;
[0118] The second loading module 206 is used to load the target page according to the second page rendering file.
[0119] Optionally, the rendering module 203 is configured to perform virtual rendering in a storage space according to the page data to obtain a second rendering node corresponding to each page element in the target page; and obtain the first page rendering file according to the second rendering node.
[0120] Alternatively, if Fig. 9 As shown, the device 200 also includes:
[0121] The third acquisition module 207 is used to acquire the first page identification information of the target page;
[0122] The storage module 208 is used to store the first page rendering file as the historical page rendering file corresponding to the historical page according to the first page identification information.
[0123] Alternatively, if Fig.10 As shown, the device 200 also includes:
[0124] The fourth acquisition module 209 is used to obtain a target page element in the current target page in response to a page jump request to the target page;
[0125] The updating module 210 is used to update the first page rendering file according to the target page element.
[0126] Optionally, the third acquisition module 207 is used to acquire page address information of the target page; generate a key value of the target page according to the page address information; and obtain the first page identification information according to the key value and the first page rendering file.
[0127] Optionally, the third acquisition module 207 is used to acquire first page identification information of the target page;
[0128] The second acquisition module 202 is used to determine that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages when the second page identification information corresponding to the one or more historical pages does not include the first page identification information.
[0129] Alternatively, if Fig.11 As shown, the device 200 also includes:
[0130] Deletion module 211 is used to delete any one or more historical page rendering files corresponding to the historical page when the storage time of the historical page rendering files corresponding to the one or more historical pages reaches a preset storage time threshold; or, after the user triggers a storage reset request, delete any one or more historical page rendering files corresponding to the historical page.
[0131] By using the above-mentioned device, when the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to one or more historical pages, that is, when the target page is rendered for the first time, the page data is first virtually rendered to obtain the rendered first page rendering file, and then the target page is loaded according to the first page rendering file. In other words, the present invention does not directly render the target page in the browser, but first virtually renders the page data into the first page rendering file, and then loads the target page according to the first page rendering file. In this way, when the user visits the target page again, the target page can be loaded according to the first page rendering file, without the need to re-render the target page, thereby increasing the speed of page loading and improving the user experience.
[0132] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0133] Fig.12 FIG. 1 is a block diagram of an electronic device 300 according to an exemplary embodiment. Fig.12As shown, the electronic device 300 may include: a processor 301 , a memory 302 . The electronic device 300 may also include one or more of a multimedia component 303 , an input / output (I / O) interface 304 , and a communication component 305 .
[0134] The processor 301 is used to control the overall operation of the electronic device 300 to complete all or part of the steps in the above-mentioned page loading method. The memory 302 is used to store various types of data to support the operation of the electronic device 300, and these data may include, for example, instructions for any application or method used to operate on the electronic device 300, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 303 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 302 or sent through the communication component 305. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 304 provides an interface between the processor 301 and other interface modules, and the other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 305 is used for wired or wireless communication between the electronic device 300 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 305 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0135] In an exemplary embodiment, the electronic device 300 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned page loading method.
[0136] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned page loading method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 302 including program instructions, and the above-mentioned program instructions can be executed by the processor 301 of the electronic device 300 to complete the above-mentioned page loading method.
[0137] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, a variety of simple modifications can be made to the technical solution of the present invention, and these simple modifications all belong to the protection scope of the present invention.
[0138] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
[0139] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.
Claims
1. A method for loading a page, characterized in that: The method comprises: In response to a rendering request for a target page, obtaining a historical page rendering file corresponding to one or more pre-stored historical pages; If the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages, obtaining page data of the target page from a server corresponding to the target page; Performing virtual rendering according to the page data to obtain the first page rendering file; Loading the target page according to the first page rendering file; The method further comprises: Acquire first page identification information of the target page; According to the first page identification information, storing the first page rendering file as a historical page rendering file corresponding to the historical page; After storing the first page rendering file as the historical page rendering file corresponding to the historical page, the method further includes: In response to a page jump request for the target page, a target page element in the current target page is obtained; the target page element is used to record page components and page status in the target page, and the page status includes a scrolling position of the target page or a user's filtering operation on the page components; The first page rendering file is updated according to the target page element.
2. The method according to claim 1, characterized in that The method further comprises: In a case where the first page rendering file corresponding to the target page exists in the historical page rendering files corresponding to the one or more historical pages, determining the second page rendering file corresponding to the target page from the pre-stored historical page rendering files corresponding to the one or more historical pages; wherein the historical page rendering files include a first rendering node for recording each page element in the historical page; The target page is loaded according to the second page rendering file.
3. The method according to claim 1, characterized in that The performing virtual rendering according to the page data to obtain the first page rendering file includes: According to the page data, virtual rendering is performed in the storage space to obtain a second rendering node corresponding to each page element in the target page; The first page rendering file is obtained according to the second rendering node.
4. The method according to claim 1, characterized in that: The acquiring of the first page identification information of the target page includes: Obtaining page address information of the target page; Generate a key value of the target page according to the page address information; The first page identification information is obtained according to the key value and the first page rendering file.
5. The method according to claim 1, characterized in that The method further comprises: Acquire first page identification information of the target page; The absence of the first page rendering file corresponding to the target page in the historical page rendering files corresponding to the one or more historical pages is determined in the following manner: When the second page identification information corresponding to the one or more historical pages does not include the first page identification information, it is determined that the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the storage time of the historical page rendering files corresponding to the one or more stored historical pages reaches a preset storage time threshold, deleting any one or more historical page rendering files corresponding to the historical pages; or After the user triggers a storage reset request, the historical page rendering files corresponding to any one or more of the historical pages are deleted.
7. A device for loading a page, characterized in that: The device comprises: A first acquisition module, configured to acquire, in response to a rendering request for a target page, a historical page rendering file corresponding to one or more pre-stored historical pages; A second acquisition module is used to acquire page data of the target page from a server corresponding to the target page when the first page rendering file corresponding to the target page does not exist in the historical page rendering files corresponding to the one or more historical pages; A rendering module, used for performing virtual rendering according to the page data to obtain the first page rendering file; A first loading module, configured to load the target page according to the first page rendering file; The device also includes: A third acquisition module, used to acquire first page identification information of the target page; A storage module, configured to store the first page rendering file as a historical page rendering file corresponding to the historical page according to the first page identification information; The device also includes: a fourth acquisition module, configured to acquire a target page element in the current target page in response to a page jump request for the target page after storing the first page rendering file as the historical page rendering file corresponding to the historical page; the target page element is used to record page components and page status in the target page, wherein the page status includes a scrolling position of the target page or a user's filtering operation on the page components; An updating module is used to update the first page rendering file according to the target page element.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
