Mirror-based page display method and apparatus, storage medium, and computer equipment
By mirroring and caching the page's UI layout file and rendering with the UI layout file image in the local cache, the problem of slow page rendering speed is solved and the user experience is improved.
Patent Information
- Application Number
- CN202310685067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2043-06-09
AI Technical Summary
In smart electronic devices, when the page layout is complex, the existing technology is difficult to effectively improve the page rendering speed, resulting in long wait times for users and poor user experience.
By mirroring and caching the page's UI layout file, the UI layout file image is used in the local cache for rendering, and the business data is synchronized to fill it on the rendered UI layer.
It significantly improves page rendering speed, reduces user waiting time, and improves user experience.
Smart Images

Figure CN116841670B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of page display technology, and in particular to a mirror-based page display method and device, a storage medium, and a computer device. Background Art
[0002] With the increasing popularity of smart electronic devices and the continuous development of Internet technology, more and more people browse information through smart electronic devices. When a user requests a service to open a page through an application, the client will pull the rendering information of the page from the server to render the page. When there is a lot of information on the page and the page layout is complex, the amount of data that needs to be pulled from the server is large. The large amount of data will cause data processing or interface rendering logic to be time-consuming and the interface opening time is serious. In the prior art, most of them are to simplify the UI layout, reduce the layout level (nesting) to speed up the interface rendering speed, or add multi-threading to the data logic layer to speed up the execution of data logic. Simplifying the UI layout will not only weaken the expressiveness of the page, but also still take a certain amount of time to pull data from the server, and does not fundamentally solve the problem. When a user requests to open a page, it still needs to wait for a long time, the page display speed is slow, and the user experience is poor. Summary of the invention
[0003] In view of this, the present application provides a mirror-based page display method and device, storage medium, and computer equipment, which mirror and cache the UI layout file of the page, thereby directly using the UI layout file image in the local cache to render the UI layout of the page, which helps to improve the page rendering speed, speed up the page opening speed, reduce user waiting time, and improve user experience.
[0004] According to one aspect of the present application, a mirroring-based page display method is provided, the method comprising:
[0005] In response to a display request for a target page in an application, obtaining a page identifier of the target page and a request service identifier corresponding to the display request;
[0006] Generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image matching the page identifier, wherein the page image includes a UI layout file image;
[0007] The target page is rendered in a UI layer based on the UI layout file image, and the first business data corresponding to the requested business identifier is synchronously pulled, and the first business data is filled into the rendered UI layer.
[0008] Optionally, the page image further includes a mirror service identifier and a service data image; after searching the image cache of the application for a page image matching the mirror query information, the method further includes:
[0009] Determine whether the requested service identifier is the mirrored service identifier;
[0010] If the requested service identifier is the mirror service identifier, the target page is rendered in the UI layer based on the UI layout file mirror, and the service data mirror is filled into the rendered UI layer;
[0011] If the requested service identifier is not the mirrored service identifier, the step of performing UI layer rendering on the target page based on the UI layout file mirroring, synchronously pulling the first service data corresponding to the requested service identifier, and filling the first service data into the rendered UI layer is executed.
[0012] Optionally, after filling the business data image onto the rendered UI layer, the method further includes:
[0013] Pulling the second service data corresponding to the requested service identifier;
[0014] The business data image populated on the UI layer is updated based on the second business data.
[0015] Optionally, the page mirror further includes a business data mirror timestamp; and pulling the second business data corresponding to the requested business identifier includes:
[0016] Calling a data interface to query the business data update timestamp corresponding to the requested business identifier;
[0017] If the business data mirroring timestamp is consistent with the business data update timestamp, the business data mirroring on the UI layer is kept unchanged;
[0018] If the business data mirror timestamp is inconsistent with the business data update timestamp, the second business data corresponding to the requested business identifier is pulled, and the business data mirror in the page mirror is replaced with the second business data.
[0019] Optionally, after filling the first business data into the rendered UI layer, the method further includes:
[0020] A new mirrored service identifier is generated based on the requested service identifier, a new service data mirror is generated based on the first service data, and the new mirrored service identifier and the new service data mirror are stored in the page mirror of the target page.
[0021] Optionally, the method further comprises:
[0022] If there is no page image matching the page identifier in the image cache, pulling the UI layout file corresponding to the page identifier and the third service data corresponding to the requested service identifier;
[0023] Rendering the target page in a UI layer based on the UI layout file, and filling the third business data into the rendered UI layer;
[0024] Based on the page identifier, the request service identifier, the UI layout file and the third service data, the page image of the target page is stored in the image cache.
[0025] Optionally, storing the page image of the target page in the image cache based on the page identifier, the request service identifier, the UI layout file, and the third service data includes:
[0026] Combining the application ID and the page ID as a key;
[0027] Generate a UI layout file image corresponding to the UI layout file, generate a business data image corresponding to the third business data, and combine the UI layout file image, the business data image and the requested business identifier into value;
[0028] A page image of the target page is generated based on the key and the value, and stored in the image cache.
[0029] Optionally, after storing the page image of the target page in the image cache, the method further includes:
[0030] Detect whether the running memory of the application exceeds a preset percentage of the total memory of the application;
[0031] If it exceeds, the page image with the earliest storage time in the image cache is deleted.
[0032] According to another aspect of the present application, a mirroring-based page display device is provided, the device comprising:
[0033] An acquisition module, configured to, in response to a display request for a target page in an application, acquire a page identifier of the target page and a request service identifier corresponding to the display request;
[0034] A query module, used to generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image matching the page identifier, wherein the page image includes a UI layout file image;
[0035] The display module is used to render the target page in a UI layer based on the UI layout file mirror, and synchronously pull the first business data corresponding to the requested business identifier, and fill the first business data into the rendered UI layer.
[0036] Optionally, the display module is further used for:
[0037] Determine whether the requested service identifier is the mirrored service identifier;
[0038] If the requested service identifier is the mirror service identifier, the target page is rendered in the UI layer based on the UI layout file mirror, and the service data mirror is filled into the rendered UI layer;
[0039] If the requested service identifier is not the mirrored service identifier, the step of performing UI layer rendering on the target page based on the UI layout file mirroring, synchronously pulling the first service data corresponding to the requested service identifier, and filling the first service data into the rendered UI layer is executed.
[0040] Optionally, the display module is further used for:
[0041] After the business data is mirrored and filled into the rendered UI layer, the second business data corresponding to the requested business identifier is pulled;
[0042] The business data image populated on the UI layer is updated based on the second business data.
[0043] Optionally, the display module is further used for:
[0044] Calling a data interface to query the business data update timestamp corresponding to the requested business identifier;
[0045] If the business data mirroring timestamp is consistent with the business data update timestamp, the business data mirroring on the UI layer is kept unchanged;
[0046] If the business data mirror timestamp is inconsistent with the business data update timestamp, the second business data corresponding to the requested business identifier is pulled, and the business data mirror in the page mirror is replaced with the second business data.
[0047] Optionally, the display module is further used for:
[0048] If there is no page image matching the page identifier in the image cache, pulling the UI layout file corresponding to the page identifier and the third service data corresponding to the requested service identifier;
[0049] Rendering the target page in a UI layer based on the UI layout file, and filling the third business data into the rendered UI layer;
[0050] The device further includes: a storage module, configured to store the page image of the target page in the image cache based on the page identifier, the request service identifier, the UI layout file, and the third service data.
[0051] Optionally, the storage module is further used for:
[0052] Combining the application ID and the page ID as a key;
[0053] Generate a UI layout file image corresponding to the UI layout file, generate a business data image corresponding to the third business data, and combine the UI layout file image, the business data image and the requested business identifier into value;
[0054] A page image of the target page is generated based on the key and the value, and stored in the image cache.
[0055] Optionally, the storage module is further used for:
[0056] After filling the first business data into the rendered UI layer, a new mirror business identifier is generated based on the request business identifier, a new business data mirror is generated based on the first business data, and the new mirror business identifier and the new business data mirror are stored in the page mirror of the target page.
[0057] Optionally, the storage module is further used for:
[0058] After storing the page image of the target page in the image cache, detecting whether the running memory of the application exceeds a preset percentage of the total memory of the application;
[0059] If it exceeds, the page image with the earliest storage time in the image cache is deleted.
[0060] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned mirroring-based page display method is implemented.
[0061] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned mirroring-based page display method when executing the program.
[0062] By means of the above technical solution, the present application provides a mirror-based page display method and device, storage medium, and computer equipment, which stores the UI layout file mirror of the application page in the mirror cache, so that when the user requests to open the target page, the page mirror of the target page is read from the mirror cache according to the page identifier of the target page to render the UI layer of the target page, and at the same time, the first business data corresponding to the requested business identifier is pulled and filled in the UI layer of the target page to form a complete target page. The embodiment of the present application mirrors and caches the UI layout file of the page, thereby directly using the UI layout file mirror in the local cache to render the UI layout of the page, which helps to improve the page rendering speed, speed up the page opening speed, reduce the user waiting time, and improve the user experience.
[0063] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0065] Figure 1 A schematic diagram of a process of a mirror-based page display method provided in an embodiment of the present application is shown;
[0066] Figure 2 A schematic diagram of a process of another mirroring-based page display method provided in an embodiment of the present application is shown;
[0067] Figure 3 A schematic diagram of a process of another mirroring-based page display method provided in an embodiment of the present application is shown;
[0068] Figure 4 A schematic diagram of a process flow of a method for extracting business data provided by an embodiment of the present application is shown;
[0069] Figure 5 A schematic diagram of a page mirroring data structure provided by an embodiment of the present application is shown;
[0070] Figure 6A schematic diagram of the structure of a mirror-based page display device provided in an embodiment of the present application is shown;
[0071] Figure 7 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0072] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0073] In this embodiment, a page display method based on mirroring is provided. Figure 1 As shown, the method includes:
[0074] Step 101: In response to a display request for a target page in an application, a page identifier of the target page and a request service identifier corresponding to the display request are obtained.
[0075] Step 102: Generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image that matches the page identifier, wherein the page image includes a UI layout file image.
[0076] Step 103: Render the target page in a UI layer based on the UI layout file image, and synchronously pull the first business data corresponding to the requested business identifier, and fill the first business data into the rendered UI layer.
[0077] In an embodiment of the present application, first, when a user uses an application to request to display a certain target page, the client obtains the page identifier corresponding to the target page and the request service identifier corresponding to the display request, wherein the page identifier can specifically be the class name of the target page. Secondly, the client queries whether there is a page image matching the page identifier in the image cache of the application according to the page identifier of the target page, wherein the image cache is used to store the page image of any page in the application, and the page image of a certain page at least includes the image of the UI layout file of the page, which is used to render the UI layout of the page. In addition, the page image may also include data filled in the page UI layout. Finally, the UI layout file image in the page image of the target page is directly used to render the UI layer of the target page, and the first business data matching the request service identifier is pulled from the server while rendering, so that the first business data is filled in the rendered target business UI layer after the first business data is pulled. In addition, if the page image includes a business data image and the business data image matches the business request identifier, the business data image can also be directly filled in the UI layer.
[0078] By applying the technical solution of this embodiment, the UI layout file image of the application page is stored in the image cache, so that when the user requests to open the target page, the page image of the target page is read from the image cache according to the page identifier of the target page to render the UI layer of the target page, and at the same time, the first business data corresponding to the requested business identifier is pulled and filled in the UI layer of the target page to form a complete target page. The embodiment of the present application mirrors and caches the UI layout file of the page, thereby directly using the UI layout file image in the local cache to render the UI layout of the page, which helps to improve the page rendering speed, speed up the page opening speed, reduce user waiting time, and improve user experience.
[0079] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another page display method based on mirroring is provided, such as Figure 2 As shown, the method includes:
[0080] Step 201: In response to a display request for a target page in an application, a page identifier of the target page and a request service identifier corresponding to the display request are obtained.
[0081] Step 202: Generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image that matches the page identifier, wherein the page image includes a UI layout file image.
[0082] Step 203: determine whether the requested service identifier is the mirrored service identifier.
[0083] Step 204: If the requested business identifier is the mirrored business identifier, the target page is rendered in the UI layer based on the UI layout file mirror, and the business data mirror is filled into the rendered UI layer; the second business data corresponding to the requested business identifier is pulled; and the business data mirror filled in the UI layer is updated based on the second business data.
[0084] In the embodiment of the present application, the page image includes not only the UI layout file image but also the business data image, wherein the same page can be applicable to different business requests. After the page image is queried, it is possible to further determine whether the business data image in the page image matches the request business identifier of the display request, that is, determine whether the request business identifier belongs to the mirror business identifier corresponding to the business data image. If the request business identifier belongs to the mirror business identifier, it means that the page image is stored based on the same business identifier as the current request, and the UI layout file image in the page image can be directly used to render the UI layer of the target page, and the business data image in the page image can be used to fill the rendered UI layer with data to achieve rapid display of the target page. In addition, if Figure 3 As shown, when the UI (View) interface is started, it will query whether there is a mirror in the Map cache object; if it exists, it will again determine whether the business request ID in the object is consistent with the current business request ID. If they are consistent, the current interface will be directly displayed and the interface will be asynchronously called to query whether the data has been updated (the interface parameter is the request ID). If there is an update, the data will be directly updated to the UI; if the business ID is inconsistent, the UI object will be cloned to display the UI first, and then the business data logic layer will be executed to fill the data into the UI. In order to further ensure that the business data displayed on the page is the latest, while using the business data mirror to quickly fill the target page with data, the latest business data corresponding to the requested business identifier can be pulled from the server, that is, the above-mentioned second business data, so that the business data filled in the UI layer can be updated according to the second business data.
[0085] In an embodiment of the present application, optionally, the page mirror also includes a business data mirror timestamp; pulling the second business data corresponding to the requested business identifier includes: calling a data interface to query the business data update timestamp corresponding to the requested business identifier; if the business data mirror timestamp is consistent with the business data update timestamp, keeping the business data mirror on the UI layer unchanged; if the business data mirror timestamp is inconsistent with the business data update timestamp, pulling the second business data corresponding to the requested business identifier, and replacing the business data mirror in the page mirror with the second business data.
[0086] In this embodiment, the data interface is called to query the business data update timestamp of the business data corresponding to the requested business identifier in the server, and compare the business data update timestamp in the server with the business data mirror timestamp in the page mirror in the local mirror cache to see if they are consistent. If they are consistent, it means that the business data has not changed, and the target page can be kept unchanged. If they are inconsistent, it means that the business data has changed. At this time, the latest second business data of the server can be pulled through the data interface, and the business data displayed on the target page can be updated using the second business data. At the same time, in order to ensure that the business data can be accurately displayed the next time the user uses the same business to open the target page, the business data mirror in the page mirror in the local mirror cache is replaced with the second business data, that is, the second business data is saved as the new business data mirror corresponding to the business request identifier in the page mirror of the target page. Figure 4 As shown, the flowchart mainly describes the detailed description of whether the data interface has been updated: first, call the server-side data interface to obtain the correct json string returned by the server; obtain the code in the json string (the code is mainly the update timestamp of the server, if there is an update, the code will be updated to the current timestamp), whether the code is consistent with the locally stored code, if consistent, it means the data has not been updated, if inconsistent, it means the data has been updated; when the data is updated, the json string returned by the current server will be stored locally; the storage method is stored in an xml file, the key in the xml is the url request address including parameters, and the value is a json string.
[0087] Step 205: If the requested business identifier is not the mirrored business identifier, the target page is rendered at the UI layer based on the UI layout file mirror, and the first business data corresponding to the requested business identifier is synchronously pulled, and the first business data is filled into the rendered UI layer; a new mirrored business identifier is generated based on the requested business identifier, a new business data mirror is generated based on the first business data, and the new mirrored business identifier and the new business data mirror are stored in the page mirror of the target page.
[0088] In this embodiment, if the image cache contains the page image of the target page, but the request service identifier is not in the image service identifier of the page image, it means that the page image previously stored for the target page was stored when the user opened the page through other service requests, and the service data image in the page image is not available this time, but the UI layout file image in the page image is still available. At this time, the UI layer of the target page is rendered based on the UI layout file image, and the service data corresponding to the request service identifier is synchronously pulled from the server, that is, the first service data, and the pulled first service data is filled in the rendered target page UI layer to form a complete target page.
[0089] Furthermore, the requested service identifier and the corresponding first service data may be stored as a new image in the page image of the target page, so that the page image may be directly used for page display when a request is made for the same service next time.
[0090] Step 206: If there is no page image matching the page identifier in the image cache, pull the UI layout file corresponding to the page identifier and the third business data corresponding to the requested business identifier; render the UI layer of the target page based on the UI layout file, and fill the third business data into the rendered UI layer; based on the page identifier, the requested business identifier, the UI layout file and the third business data, store the page image of the target page in the image cache.
[0091] In this embodiment, if the page image of the target page does not exist in the local image cache, a new business UI instance will be created, and the rendering UI execution business data layer will display the data on the UI layer. After success, the current business UI instance will be stored in the local image cache for use by the next UI interface.
[0092] Step 207 , detecting whether the running memory of the application exceeds a preset percentage of the total memory of the application; if so, deleting the page image with the earliest storage time in the image cache.
[0093] In this embodiment, each time the image cache is added, the cache mechanism will make a judgment on the current app memory. If the running memory occupied by the current App exceeds two-thirds of the total memory allocated by the system for Apps, the Map cache will be deleted (first-in-first-out principle) to avoid App freezes or memory overflows.
[0094] Optionally, storing the page image of the target page in the image cache based on the page identifier, the request service identifier, the UI layout file and the third service data includes: combining the application identifier and the page identifier as a key; generating a UI layout file image corresponding to the UI layout file, generating a service data image corresponding to the third service data, and combining the UI layout file image, the service data image and the request service identifier as a value; generating the page image of the target page based on the key and the value, and storing it in the image cache.
[0095] In this embodiment, if Figure 5 As shown, the page image is stored in a key-value pair data structure, where key: package name.class name, specifically "application package name.page class name". The image cache can be a local Map cache. The Value data Model structure in the Map cache mainly includes the UI layer and the business logic layer, that is, the UI layout file image and the business data image. The UI layer, as the name implies, is the View layout file (including static layout and dynamic layout); the business logic is mainly composed of network requests and database operations. The business logic provides an interface for the UI layer to call, so that the data can be filled into the UI.
[0096] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a page display device based on mirroring, such as Figure 6 As shown, the device comprises:
[0097] An acquisition module, configured to, in response to a display request for a target page in an application, acquire a page identifier of the target page and a request service identifier corresponding to the display request;
[0098] A query module, used to generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image matching the page identifier, wherein the page image includes a UI layout file image;
[0099] The display module is used to render the target page in a UI layer based on the UI layout file mirror, and synchronously pull the first business data corresponding to the requested business identifier, and fill the first business data into the rendered UI layer.
[0100] Optionally, the display module is further used for:
[0101] Determine whether the requested service identifier is the mirrored service identifier;
[0102] If the requested service identifier is the mirror service identifier, the target page is rendered in the UI layer based on the UI layout file mirror, and the service data mirror is filled into the rendered UI layer;
[0103] If the requested service identifier is not the mirrored service identifier, the step of performing UI layer rendering on the target page based on the UI layout file mirroring, synchronously pulling the first service data corresponding to the requested service identifier, and filling the first service data into the rendered UI layer is executed.
[0104] Optionally, the display module is further used for:
[0105] After the business data is mirrored and filled into the rendered UI layer, the second business data corresponding to the requested business identifier is pulled;
[0106] The business data image populated on the UI layer is updated based on the second business data.
[0107] Optionally, the display module is further used for:
[0108] Calling a data interface to query the business data update timestamp corresponding to the requested business identifier;
[0109] If the business data mirroring timestamp is consistent with the business data update timestamp, the business data mirroring on the UI layer is kept unchanged;
[0110] If the business data mirror timestamp is inconsistent with the business data update timestamp, the second business data corresponding to the requested business identifier is pulled, and the business data mirror in the page mirror is replaced with the second business data.
[0111] Optionally, the display module is further used for:
[0112] If there is no page image matching the page identifier in the image cache, pulling the UI layout file corresponding to the page identifier and the third service data corresponding to the requested service identifier;
[0113] Rendering the target page in a UI layer based on the UI layout file, and filling the third business data into the rendered UI layer;
[0114] The device further includes: a storage module, configured to store the page image of the target page in the image cache based on the page identifier, the request service identifier, the UI layout file, and the third service data.
[0115] Optionally, the storage module is further used for:
[0116] Combining the application ID and the page ID as a key;
[0117] Generate a UI layout file image corresponding to the UI layout file, generate a business data image corresponding to the third business data, and combine the UI layout file image, the business data image and the requested business identifier into value;
[0118] A page image of the target page is generated based on the key and the value, and stored in the image cache.
[0119] Optionally, the storage module is further used for:
[0120] After filling the first business data into the rendered UI layer, a new mirror business identifier is generated based on the request business identifier, a new business data mirror is generated based on the first business data, and the new mirror business identifier and the new business data mirror are stored in the page mirror of the target page.
[0121] Optionally, the storage module is further used for:
[0122] After storing the page image of the target page in the image cache, detecting whether the running memory of the application exceeds a preset percentage of the total memory of the application;
[0123] If it exceeds, the page image with the earliest storage time in the image cache is deleted.
[0124] It should be noted that for other corresponding descriptions of the functional units involved in the mirror-based page display device provided in the embodiment of the present application, reference can be made to Figures 1 to 5 The corresponding description in the method will not be repeated here.
[0125] The present application also provides a computer device, which may be a personal computer, a server, a network device, etc. Figure 7 As shown, the computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0126] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0128] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A page display method based on mirroring, characterized in that: The method comprises: In response to a display request for a target page in an application, obtaining a page identifier of the target page and a request service identifier corresponding to the display request, wherein the same page is applicable to different service requests; Generate image query information of the target page based on the page identifier, and query the image cache of the application for a page image matching the page identifier, wherein the page image includes a UI layout file image, an image service identifier, and a business data image; If the requested service identifier is not the mirror service identifier, the target page is rendered at the UI layer based on the UI layout file mirror, and the first service data corresponding to the requested service identifier is synchronously pulled, and the first service data is filled into the rendered UI layer; a new mirror service identifier is generated based on the requested service identifier, a new service data mirror is generated based on the first service data, and the new mirror service identifier and the new service data mirror are stored in the page mirror of the target page; If the requested service identifier is the mirrored service identifier, the target page is rendered in the UI layer based on the UI layout file mirror, and the service data mirror is filled into the rendered UI layer; the second service data corresponding to the requested service identifier is pulled, and the service data mirror filled in the UI layer is updated based on the second service data; If there is no page image matching the page identifier in the image cache, then pull the UI layout file corresponding to the page identifier and the third business data corresponding to the requested business identifier; render the UI layer of the target page based on the UI layout file, and fill the third business data into the rendered UI layer; based on the page identifier, the requested business identifier, the UI layout file and the third business data, store the page image of the target page in the image cache; wherein, the application identifier and the page identifier are combined as a key; generate a UI layout file image corresponding to the UI layout file, generate a business data image corresponding to the third business data, and combine the UI layout file image, the business data image and the requested business identifier as a value; generate a page image of the target page based on the key and the value, and store it in the image cache.
2. The method according to claim 1, characterized in that The page image also includes a business data image timestamp; the pulling of the second business data corresponding to the request business identifier includes: Calling a data interface to query the business data update timestamp corresponding to the requested business identifier; If the business data mirroring timestamp is consistent with the business data update timestamp, the business data mirroring on the UI layer is kept unchanged; If the business data mirror timestamp is inconsistent with the business data update timestamp, the second business data corresponding to the requested business identifier is pulled, and the business data mirror in the page mirror is replaced with the second business data.
3. The method according to claim 1 or 2, characterized in that: After storing the page image of the target page in the image cache, the method further includes: Detect whether the running memory of the application exceeds a preset percentage of the total memory of the application; If it exceeds, the page image with the earliest storage time in the image cache is deleted.
4. A mirror-based page display device, characterized in that: The device comprises: An acquisition module, used for acquiring, in response to a display request for a target page in an application, a page identifier of the target page and a request service identifier corresponding to the display request, wherein the same page is applicable to different service requests; A query module, used to generate the image query information of the target page based on the page identifier, and query the image cache of the application for a page image matching the page identifier, wherein the page image includes a UI layout file image, an image service identifier, and a business data image; A display module is used for, if the requested service identifier is not the mirror service identifier, performing UI layer rendering on the target page based on the UI layout file mirror, and synchronously pulling the first service data corresponding to the requested service identifier, and filling the first service data into the rendered UI layer; generating a new mirror service identifier based on the requested service identifier, generating a new service data mirror based on the first service data, and storing the new mirror service identifier and the new service data mirror in the page mirror of the target page; if the requested service identifier is the mirror service identifier, performing UI layer rendering on the target page based on the UI layout file mirror, and filling the service data mirror into the rendered UI layer; pulling the second service data corresponding to the requested service identifier, and updating the service data mirror filled in the UI layer based on the second service data; if there is no page mirror matching the page identifier in the mirror cache, pulling the UI layout file corresponding to the page identifier and the third service data corresponding to the requested service identifier; performing UI layer rendering on the target page based on the UI layout file, and filling the third service data into the rendered UI layer; A storage module is used to store the page image of the target page in the image cache based on the page identifier, the request service identifier, the UI layout file and the third service data; wherein the application identifier and the page identifier are combined as a key; a UI layout file image corresponding to the UI layout file is generated, a service data image corresponding to the third service data is generated, and the UI layout file image, the service data image and the request service identifier are combined as a value; a page image of the target page is generated based on the key and the value, and stored in the image cache.
5. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
6. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Hybrid application-based loading method and apparatus
CN107491320A
Data processing method and device, electronic equipment and storage medium
CN114416247A