Page loading method and device in application program, electronic device and storage medium

By employing a multi-level caching technique for displaying page objects, the network waiting issue during page loading within the application was resolved, resulting in faster rendering and improved user experience.

CN117312702BActive Publication Date: 2026-03-20SUZHOU DAJIAYING INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Excessive network latency during page loading within the application can cause loading warnings or blank pages to appear, impacting user experience, especially when network issues prevent effective content display.

Method used

By using a multi-level caching method to display page objects, the system detects the locally cached objects and their dependent objects. If they are within the validity period, they are rendered and displayed; otherwise, the display objects are generated level by level, reducing the number of network requests.

Benefits of technology

By reducing network dependence, the number of network requests during page loading is reduced, thereby improving page rendering and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312702B_ABST
    Figure CN117312702B_ABST
Patent Text Reader

Abstract

The application discloses a page loading method and device in an application program, equipment and a medium. The method comprises the following steps: according to a loading request of a target page, detecting whether a direct display object of the target page is cached; if the direct display object is cached and the direct display object is within a valid period, rendering and displaying the target page according to the direct display object; if the direct display object is not cached, detecting whether a dependent display object used for generating the direct display object is locally cached step by step; if the target dependent display object of the target dependent level is locally cached and the target dependent display object is within a valid period, generating the direct display object step by step according to the target dependent display object of the target dependent level, and rendering and displaying the target page according to the direct display object. The technical scheme of the embodiment of the application realizes the loading and rendering display of the page by the way of multi-level caching of the page display object under the premise of reducing the network dependence to the maximum extent.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and in particular, to a page loading method and device in an application program, an electronic device and a storage medium. BACKGROUND

[0002] With the development of science and technology, various terminals appear in people's life. An important role of the terminal is to display the pages of various application programs, so the loading and rendering processing of the page also become one of the focuses of the researchers in the field.

[0003] In the related art, when loading the page in the application program, the page data is mainly obtained by requesting the data from the server, and the page rendering display is performed based on the page data obtained from the network.

[0004] The inventor found that the prior art has the following defects in the process of implementing the present application: when the number of users requesting the server network interface is huge at the same time, the network waiting time is too long, and then a long time page loading prompt or blank page display appears, which brings fatigue to the user; in addition, when the network loading data is abnormal or the loading data is empty due to network interruption and the like, no effective content can be displayed in the page, which greatly affects the user's application experience. SUMMARY

[0005] The present application provides a page loading method and device in an application program, an electronic device and a storage medium, which realizes the loading and rendering display of the page by the way of multi-level cache page display object, so as to reduce the dependence on the network to the greatest extent.

[0006] According to an aspect of an embodiment of the present application, a page loading method in an application program is provided, comprising:

[0007] In the normal running process of the application program, in response to the loading request of the target page, it is detected whether the directly display object corresponding to the target page is cached locally;

[0008] If the directly display object is cached locally and is within the valid period, the target page is rendered and displayed according to the directly display object;

[0009] If the directly display object is not cached locally, the dependent display objects used to generate the directly display object are detected step by step in the order from low to high according to the dependence level;

[0010] If the target dependent display object of the target dependence level is cached locally and is within the valid period, the directly display object is generated step by step according to the target dependent display object of the target dependence level, and the target page is rendered and displayed according to the directly display object.

[0011] According to another aspect of the embodiments of the present application, there is provided a page loading apparatus in an application program, comprising:

[0012] a direct display object detection module, configured to, in a normal running process of the application program, in response to a loading request of a target page, detect whether a direct display object corresponding to the target page is locally cached;

[0013] a first rendering display module, configured to, if the direct display object is locally cached and is within a valid period, render and display the target page according to the direct display object;

[0014] a step-by-step detection module, configured to, if the direct display object is not locally cached, detect step by step whether a dependent display object used for generating the direct display object is locally cached in an order from low to high of a dependency level;

[0015] a second rendering display module, configured to, if a target dependent display object of a target dependency level is locally cached and is within a valid period, generate the direct display object step by step according to the target dependent display object of the target dependency level, and render and display the target page according to the direct display object.

[0016] According to another aspect of the embodiments of the present application, there is also provided an electronic device, comprising:

[0017] at least one processor; and

[0018] a memory connected with the at least one processor in communication; wherein,

[0019] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the page loading method in an application program according to any of the embodiments of the present application.

[0020] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium, which stores computer instructions for enabling a processor to execute the page loading method in an application program according to any of the embodiments of the present application when executed by the processor.

[0021] The technical scheme of the embodiment of the application comprises the following steps: detecting whether a direct display object corresponding to a target page is cached according to a loading request of the target page; if the direct display object is cached locally and is within a valid period, rendering and displaying the target page according to the direct display object; if the direct display object is not cached locally, detecting whether a dependent display object used for generating the direct display object is cached locally in order of a low level to a high level of a dependency level; if the target dependent display object of the target dependency level is cached locally and is within the valid period, generating the direct display object step by step according to the target dependent display object of the target dependency level, and rendering and displaying the target page according to the direct display object; and the technical means of rendering and displaying the target page according to the target dependent display object of the target dependency level, step by step generating the direct display object, and rendering and displaying the target page according to the direct display object, realizes loading and rendering and displaying of the page by means of multi-level caching of the page display object under the premise of reducing network dependence to the maximum extent, reduces the number of network requests in the page loading process, and thus can effectively reduce the server network interface pressure while ensuring the rendering and displaying effect of the page and improving the application program use experience of the user.

[0022] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the application, nor is it intended to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative effort.

[0024] Figure 1 is a flow chart of a page loading method in an application according to an embodiment of the application;

[0025] Figure 2 is a flow chart of another page loading method in an application according to an embodiment of the application;

[0026] Figure 3 is a structural schematic diagram of an object creation queue and an object deletion queue suitable for the technical scheme of the embodiment of the application;

[0027] Figure 4 is a structural schematic diagram of a page loading device in an application according to an embodiment of the application;

[0028] Figure 5 is a structural schematic diagram of an electronic device for implementing a page loading method in an application according to an embodiment of the application. DETAILED DESCRIPTION

[0029] In order to better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts should fall within the protection scope of the present application.

[0030] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product, or device.

[0031] Embodiment one

[0032] Figure 1 A flowchart of a page loading method in an application program is provided for the first embodiment of the present application. The present embodiment can be applicable to the case where a user opens an installed application program on a mobile terminal (mobile phone or tablet computer) and selects a set application page for display in the application program. The method can be executed by a page loading device in the application program, which can be realized in the form of hardware and / or software and generally can be configured in the mobile terminal where the application program client is installed. As shown in the figure, the method comprises: Figure 1

[0033] S110, in the normal running process of the application program, in response to a loading request for a target page, detecting whether a directly displayed object corresponding to the target page is cached locally.

[0034] The normal running of the application program can be understood as the stage of normal starting and working of the application program, except for some atypical application program states. Specifically, the atypical application program states can be the running state after the first installation and first start of the application program, or the running state after the completion of software update and the first start of the application program, etc.

[0035] ​It can be understood that the application generally has a function of displaying information, and a user triggers a loading request of a target page to display the target page carrying information required by the user in the application through a set triggering mode.

[0036] Specifically, the target page generally has a page skeleton and various page display elements filled in the page skeleton. The above-mentioned page display elements can be divided into time-sensitive display elements, such as real-time information required to be viewed by the user, and non-time-sensitive elements, such as various controls or function buttons and the like. Among them, the time-sensitive display element needs to be obtained from the server in real time through the network.

[0037] In the embodiment, in order to reduce the dependence on the network to the greatest extent, an implementation manner of a multi-level cache page display object is creatively proposed. The above-mentioned page display object is the time-sensitive display element mentioned above.

[0038] Correspondingly, after determining the target page currently required to be loaded and rendered and displayed, the various time-sensitive display elements required to be displayed in the target page can be determined accordingly. After determining the various time-sensitive display elements, instead of directly obtaining these contents from the network, it is detected whether a direct display object corresponding to the time-sensitive display elements in the target page is cached locally in the application.

[0039] Among them, the direct display object can be understood as an object that can be directly used in the process of page display. In other words, the direct display object can be understood as an object that can be directly used for page rendering and display after processing the time-sensitive display elements obtained from the network.

[0040] Typically, the direct display object can be an entity class used in programming. In a specific example, the direct display object can be a pojo (plain old java objects), a bo (business object) or a dao (data access object), and the embodiment does not limit this.

[0041] S120, if the direct display object is cached locally and the direct display object is within a valid period, the target page is rendered and displayed according to the direct display object.

[0042] If the application locally caches the direct display object corresponding to the target page, it is necessary to first detect whether the direct display object is within the validity period (e.g., 1 minute, 10 minutes, or 30 minutes, etc.). Specifically, the validity period can be understood as a time length threshold value during which the application has locally cached the direct display object. If it is determined that the direct display object is within the validity period, it can be determined that the direct display object meets the timeliness requirement, and then the target page can be directly rendered and displayed according to the direct display object. At this time, it is completely unnecessary to rely on network data transmission.

[0043] In S130, if the direct display object is not locally cached, it is detected whether the dependent display object used to generate the direct display object is locally cached in order from low to high according to the dependency level.

[0044] In this embodiment, when the direct display object corresponding to the target page is not locally cached, instead of directly obtaining the timeliness display element from the network to generate the direct display object, it is considered to check whether the dependent display object used to generate the direct display object is locally cached, so as to reduce the dependence on the network to the greatest extent.

[0045] The dependent display object can be understood as content used to directly or indirectly generate the direct display object. It can be understood that after the timeliness display element is directly obtained from the network, it may need to be processed in one or several steps to finally obtain the direct display object. At this time, the timeliness display element can be understood as a dependent display object that is most dependent on a dependent display object. Specifically, taking the android system as an example, when the message interaction between the front end (application) and the back end (server) is performed, the most original format returned by the back end to the front end is json format, and then the above-mentioned timeliness display element (dependent display object) can be understood as a json format object. After obtaining the json format object, it is necessary to first convert the json format object into an xml format object which is very common in mobile client development, and finally convert the xml format object into a pojo.

[0046] That is, in this example, when the pojo is used as the direct display object, the direct display object has two levels of dependent display objects, one is an xml format object used to directly generate the pojo, and the other is a json format object used to indirectly generate the pojo.

[0047] In the embodiments of the present application, the following definition is made: the lower the dependency level, the closer the dependency relationship with the direct display object. Further, in the above example, when it is determined that the pojo corresponding to the target page is not locally cached in the application program, the step-by-step detection of the dependent display object can be performed in the order of first searching the xml format object and then searching the json format object.

[0048] It can be understood that, in the technical solution of the present embodiment, even if the direct display object is not locally cached in the application program, as long as any dependent display object of the direct display object is locally cached in the application program, the target page can be rendered and displayed according to the direct display object ultimately obtained from the dependent display object, and further, the network data transmission is not required.

[0049] S140, if the target dependent display object of the target dependent level is locally cached and the target dependent display object is within the validity period, then the direct display object is generated step by step according to the target dependent display object of the target dependent level, and the target page is rendered and displayed according to the direct display object.

[0050] The target dependent display object can be understood as the dependent display object used to generate the direct display object, which is searched in the order of low to high dependency level. The target dependent level can be understood as the dependency level relationship between the target dependent display object and the direct display object.

[0051] Continuing the previous example, if the target dependent display object searched is an xml format object, then the target dependent level is a first-level dependency; if the target dependent display object searched is a json format object, then the target dependent level is a second-level dependency.

[0052] Similarly, if the target dependent display object is within the validity period, it means that the local caching duration of the target dependent display object in the application program has not exceeded the preset time limit value, at this time, the direct display object can be directly or indirectly generated based on the target dependent display object, and the target page is rendered and displayed according to the direct display object.

[0053] In an optional embodiment of the present embodiment, generating the direct display object step by step according to the target dependent display object of the target dependent level can include:

[0054] detecting whether the target dependent level is a direct dependent level of the direct display object;

[0055] if yes, then generating the direct display object directly according to the target dependent display object, otherwise, generating a next dependent display object of a next dependent level having a direct dependency relationship with the target dependent display object;

[0056] After determining the next dependency level as the target dependency level and the next dependency presentation object as the target dependency presentation object, return to execute the operation of checking whether the target dependency level is the direct dependency level of the direct presentation object, until the direct presentation object is successfully generated.

[0057] In this optional implementation, if the target dependency level is the direct dependency level of the direct display object (e.g., first-level dependency), the direct display object can be directly generated based on the target dependency display object; if the target dependency level is not the direct dependency level of the direct display object, the direct display object is generated level by level starting from the target dependency display object.

[0058] In other words, continuing the previous example, after obtaining a JSON object that is still valid, since the target dependency level of this JSON object is a second-level dependency, not a direct dependency, it is necessary to first generate an XML object corresponding to this JSON object and then continue verification. Clearly, the target dependency level of the XML object is a first-level dependency, belonging to the direct dependency level, and therefore a POJO corresponding to this XML object can be directly generated to complete the rendering and display of the target page.

[0059] This can be achieved by first encapsulating one or more object conversion interfaces. Each object conversion interface is used to generate a next-level dependency presentation object that has a direct dependency relationship with a dependency presentation object, or to generate the direct presentation object based on the dependency presentation object corresponding to the direct dependency level of the direct presentation object. Then, by simply calling the object conversion interfaces, the required dependency presentation object or direct presentation object can be generated.

[0060] In another optional implementation of this embodiment, the furthest dependent display object corresponding to the direct display object of a certain page A can be requested from the network each time. After generating the direct display object of page A based on this dependent display object, page A can be rendered and displayed. For example, after generating a POJO in the hierarchical order of JSON format object -> XML format object -> POJO, page A can be rendered and displayed based on this POJO. Then, the direct display object corresponding to page A and all dependent display objects are associated and cached (caching may succeed or fail). Therefore, when a user visits page A again within a short period, page A can be rendered and displayed again based on the cached direct display object or any dependent display object without needing to access the network again.

[0061] The technical scheme of the embodiment of the application comprises the following steps: detecting whether a direct display object corresponding to a target page is cached according to a loading request of the target page; if the direct display object is cached locally and is within a valid period, rendering and displaying the target page according to the direct display object; if the direct display object is not cached locally, detecting whether a dependent display object used for generating the direct display object is cached locally in order of a low level to a high level of a dependency level; if the target dependent display object of the target dependency level is cached locally and is within a valid period, generating the direct display object in stages according to the target dependent display object of the target dependency level, and rendering and displaying the target page according to the direct display object. The technical scheme can realize page loading and rendering display by a multi-level cache page display object mode under the premise of reducing network dependence to the greatest extent, reduce the number of network requests in the page loading process, and thus can effectively reduce the server network interface pressure while ensuring the rendering display effect of the page and improving the user experience of the application program.

[0062] On the basis of the above embodiments, the method can further comprise:

[0063] When the application program is started for the first time after the software version is updated, a loading operation of a data dictionary in the application program is performed; if the loading is successful, a default data direct use object is generated in stages according to a default data dependent object of a highest dependency level in the data dictionary, so as to be directly used by the application program; if the loading fails, a network request is sent to the default data dependent object of the highest dependency level, and a default data direct use object is generated in stages according to the successfully acquired default data dependent object, so as to be directly used by the application program.

[0064] The data dictionary can be understood as some default data that needs to be configured before the application program is started or a function is used, for example, a valid period of data, a timeout length, or display parameters of various non-time-sensitive display data.

[0065] In the optional embodiment, when the application program is started for the first time after the software version is updated, the data dictionary can be updated, and the loading operation of the data dictionary can be performed in the application program. It can be understood that the default data in the data dictionary is generally in the most original format returned by the backend to the frontend during the interaction between the front end and the back end, that is, the default data dependent object of the highest dependency level used for the default data direct use object directly used by the application program. Further, when the data dictionary is loaded successfully, the default data direct use object can be generated in stages according to the default data dependent object of the highest dependency level in the data dictionary, so as to be directly used by the application program.

[0066] In addition, when the data dictionary fails to be loaded, in order to ensure normal use of the application program, a default data dependency object of a highest dependency level is requested through a network, and a default data direct use object is generated level by level according to the successfully acquired default data dependency object, for direct use of the application program.

[0067] It should be emphasized that, in the embodiments of the present application, it is assumed that the time of the first start after the application program updates the software version is not much different from the time when the application program updates the software version, and thus the data dictionary in the application program should meet the timeliness requirement. However, when the time of the first start after the application program updates the software version is greatly different from the time when the application program updates the software version, the data dictionary in the application program may be invalid. In order to further avoid the occurrence of the above problem, after the data dictionary is successfully loaded, an operation of verifying the validity period of the data dictionary can be further added. If the data dictionary is within the validity period, a default data direct use object can be generated level by level according to the default data dependency object of the highest dependency level in the data dictionary, for direct use of the application program. If the data dictionary is not within the validity period, a default data dependency object of a highest dependency level can be requested through a network, and a default data direct use object is generated level by level according to the successfully acquired default data dependency object, for direct use of the application program.

[0068] On the basis of the above embodiments, the method can further include:

[0069] When it is detected that the validity period update condition is met, the latest validity period is requested through a network, and the latest validity period is locally updated and stored.

[0070] The validity period update condition can be understood as a preset timing time, for example, 12 o'clock at midnight every day, or receiving a validity period update instruction sent by a server. Thus, when it is detected that the validity period update condition is met, the latest validity period can be requested through a network, and the latest validity period can be locally updated and stored. The above validity period is the validity period for timeliness detection of the direct display object or the target dependency display object.

[0071] Through the above setting, the validity period in the application program is dynamically adjustable, and thus the safety requirement of the embodiments of the present application in different scenarios (for example, the higher the safety requirement, the shorter the validity period) can be met, and the universality and safety of the scheme are improved.

[0072] Embodiment Two

[0073] Figure 2 A flowchart of a page loading method in an application program is provided for the second embodiment of the present application. The present embodiment is optimized on the basis of the above embodiments, and in the present embodiment, the judgment branches in the above embodiments are completed.

[0074] Correspondingly, as shown in Figure 2 the method comprises the following steps.

[0075] S210, in the normal running process of the application, in response to a loading request of a target page, it is detected whether a directly displayed object corresponding to the target page is locally cached: if yes, S220 is executed; otherwise, S230 is executed.

[0076] S220, it is detected whether the directly displayed object is within a valid period: if yes, S240 is executed; otherwise, S250 is executed.

[0077] S230, in the order from low to high according to the dependency level, it is detected whether a dependent display object for generating the directly displayed object is locally cached: if yes, S280 is executed; otherwise, S250 is executed.

[0078] S240, the target page is rendered and displayed according to the directly displayed object.

[0079] S250, a dependent display object of the highest dependency level is requested via the network: if the request is successful, S260 is executed; if the request fails, S270 is executed.

[0080] In this embodiment, if the directly displayed object is not within the valid period, it can be simply judged that the dependent display objects directly or indirectly dependent on the directly displayed object are also highly likely to be out of the valid period. At this time, it is not necessary to detect whether the dependent display object for generating the directly displayed object is locally cached, and the dependent display object of the highest dependency level can be directly requested via the network.

[0081] S260, the directly displayed object is generated step by step according to the dependent display object of the highest dependency level, and the target page is rendered and displayed according to the directly displayed object.

[0082] In this embodiment, if the dependent display object of the highest dependency level is successfully requested via the network, after the directly displayed object is generated step by step, all invalid objects locally cached are deleted, and the latest generated one or more dependent display objects and the directly displayed object are locally cached.

[0083] S270, all invalid objects locally cached are deleted, and a first exception page is constructed and displayed.

[0084] In this embodiment, if the dependent display object of the highest dependency level is not successfully requested via the network, in addition to deleting all invalid objects locally cached, a first exception page also needs to be constructed and displayed.

[0085] The first abnormal page can be a pre-configured abnormal page, and an abnormal prompt such as 'network connection failure' or 'access content is empty' can be displayed in the abnormal page.

[0086] S280, detecting whether the target dependency display object of the target dependency level cached locally is within a valid period: if yes, executing S290; otherwise, executing S250.

[0087] In the embodiment, under the premise that the direct display object corresponding to the target page is not cached locally, when the target dependency display object of the target dependency level cached locally is also not within a valid period, the operation of requesting the dependency display object of the highest dependency level from the network is triggered.

[0088] Correspondingly, if the dependency display object of the highest dependency level is successfully requested from the network, after the direct display object is generated step by step, all invalid objects cached locally can be deleted, and the latest generated one or more dependency display objects and the direct display object are cached locally. At the same time, if the dependency display object of the highest dependency level is not successfully requested from the network, in addition to deleting all invalid objects cached locally, the same first abnormal page needs to be constructed for display.

[0089] S290, generating the direct display object step by step according to the target dependency display object of the target dependency level, and rendering and displaying the target page according to the direct display object.

[0090] The technical scheme of the embodiment of the application reduces the network dependence to the greatest extent, realizes the loading and rendering display of the page by the way of multi-level caching of the page display object, reduces the number of network requests in the page loading process, and thus can effectively reduce the server network interface pressure while guaranteeing the rendering display effect of the page and improving the application program use experience of the user.

[0091] At the same time, the technical scheme of the embodiment of the application clearly specifies the scenario in which the network must be relied on to obtain the required page display object to meet the page display requirement, further enriches the application scenario of the case, and improves the universality of the case.

[0092] On the basis of the above-mentioned embodiments, rendering and displaying the target page according to the direct display object can include:

[0093] If the application program exit instruction triggered by the rendering failure is detected in the rendering process of the target page, after the application program exit instruction is intercepted, a second abnormal page is constructed for display.

[0094] Currently, after successfully obtaining the direct display object, there is still a certain probability of page rendering failure. For example, the obtained data exceeds the data display range in the page, and for such problems, the existing solution is to flash the application program, and the next time the application program is started, the above exception is repaired. Such setting often causes bad influence on the user experience.

[0095] Based on this, in the embodiments of the present application, an improved solution to the above prior art is proposed, that is, when the application program exit instruction triggered by the rendering failure is detected, instead of directly executing the application program exit instruction, the application program exit instruction is selected to be intercepted, and after interception, a second exception page is constructed for display, so as to avoid the flashing of the application program.

[0096] Among them, the second exception page can be another exception page different from the first exception page, which is pre-configured. The exception prompt of "page rendering failure" can be displayed in the second exception page, and the reason for the page rendering failure can be carried in the second exception page or not.

[0097] On the basis of the above embodiments, the method can further include:

[0098] Pre-constructing an object creation queue and an object deletion queue, the object creation queue including the direct display object and the creation sub-queue of the dependent display object of each dependency level, and the object deletion queue including the direct display object and the deletion sub-queue of the dependent display object of each dependency level.

[0099] Among them, the object creation queue is used to generate the direct display object and / or the dependent display object, and the object deletion queue is used to delete the direct display object and / or the dependent display object.

[0100] Specifically, in Figure 3 A structure diagram of an object creation queue and an object deletion queue suitable for the technical solution of the embodiments of the present application is shown. In this optional embodiment, pojo is still taken as the direct display object, the dependent display object having a direct dependency relationship with the direct display object is an xml format object, and the dependent display object having an indirect dependency relationship with the direct display object is a json format object.

[0101] As Figure 3As shown, two types of message queues can be constructed in advance, one is object creation queue C, and the other is object deletion queue D. Among them, the object creation queue C includes three sub-queues, that is, the pojo object creation sub-queue C1, the xml object creation sub-queue C2 and the json object creation sub-queue C3; the object deletion queue D also includes three sub-queues, that is, the pojo object deletion sub-queue D1, the xml object deletion sub-queue D2 and the json object deletion sub-queue D3.

[0102] In the optional embodiment, a unified object creation message can be sent to generate three types of sub-messages respectively and distribute them to the pojo object creation sub-queue C1, the xml object creation sub-queue C2 and the json object creation sub-queue C3, so as to create the dependent display objects and the direct display objects step by step; and a message of a specific type object can be selectively constructed and distributed to a matched creation sub-queue to create a matched dependent display object or a direct display object.

[0103] Similarly, a unified object deletion message can also be sent to generate three types of sub-messages respectively and distribute them to the pojo object deletion sub-queue D1, the xml object deletion sub-queue D2 and the json object deletion sub-queue D3 to delete the dependent display objects and the direct display objects that are invalid at the same time; and a message of a specific type object can be selectively constructed and distributed to a matched deletion sub-queue to delete a dependent display object or a direct display object that has been invalid.

[0104] Embodiment three

[0105] Figure 4 A structural schematic diagram of a page loading device in an application program provided by the embodiment three of the application is shown in the figure. Figure 4 As shown, the device includes a direct display object detection module 410, a first rendering display module 420, a step-by-step detection module 430 and a second rendering display module 440, wherein:

[0106] The direct display object detection module 410 is configured to, in a normal running process of the application program, in response to a loading request of a target page, detect whether a direct display object corresponding to the target page is cached locally;

[0107] The first rendering display module 420 is configured to, if the direct display object is cached locally and the direct display object is within a valid period, render and display the target page according to the direct display object;

[0108] The step-by-step detection module 430 is configured to, if the direct display object is not cached locally, detect whether a dependent display object used to generate the direct display object is cached locally in order of low to high of a dependency level step by step;

[0109] The second rendering display module 440 is configured to generate the direct display object step by step according to the target dependent display object of the target dependent hierarchy, and perform rendering display on the target page according to the direct display object, if the target dependent display object of the target dependent hierarchy is cached locally and the target dependent display object is within the validity period.

[0110] The technical scheme of the embodiment of the application comprises the following steps: detecting whether the direct display object corresponding to the target page is cached locally according to the loading request of the target page; performing rendering display on the target page according to the direct display object, if the direct display object is cached locally and the direct display object is within the validity period; detecting whether the dependent display object used for generating the direct display object is cached locally in order from low to high according to the dependent hierarchy, if the direct display object is not cached locally; generating the direct display object step by step according to the target dependent display object of the target dependent hierarchy, and performing rendering display on the target page according to the direct display object, if the target dependent display object of the target dependent hierarchy is cached locally and the target dependent display object is within the validity period. The technical scheme can realize the loading and rendering display of the page by the way of multi-hierarchy caching of the page display object under the premise of reducing the network dependence to the maximum extent, reduces the number of network requests in the page loading process, and thus can effectively reduce the network interface pressure of the server while ensuring the rendering display effect of the page and improving the application program use experience of the user.

[0111] On the basis of the above-mentioned embodiments, the second rendering display module 440 can be specifically configured to:

[0112] detect whether the target dependent hierarchy is the direct dependent hierarchy of the direct display object;

[0113] if yes, generate the direct display object directly according to the target dependent display object, or otherwise, generate the next dependent display object of the next dependent hierarchy which has the direct dependent relationship with the target dependent display object;

[0114] after determining the next dependent hierarchy as the target dependent hierarchy and determining the next dependent display object as the target dependent display object, return to perform the operation of detecting whether the target dependent hierarchy is the direct dependent hierarchy of the direct display object, until the direct display object is successfully generated.

[0115] On the basis of the above-mentioned embodiments, the first network request module can be further configured to:

[0116] after detecting whether the direct display object corresponding to the target page is cached locally, request the dependent display object of the highest dependent hierarchy via the network, if the cached direct display object is not within the validity period;

[0117] If the acquisition is successful, the direct display object is generated level by level according to the display object of the highest dependency level, and the target page is rendered and displayed according to the direct display object;

[0118] If the acquisition fails, the local cached direct display object and all dependency display objects are deleted, and a first exception page is constructed for display.

[0119] On the basis of the above embodiments, the second network request module can be further used for:

[0120] After detecting whether the dependency display object for generating the direct display object is locally cached in the order of the dependency level from low to high level by level, if any dependency display object of any dependency level is not locally cached, or the target dependency object locally cached is not within the valid period, the dependency display object of the highest dependency level is requested through the network.

[0121] If the acquisition is successful, the direct display object is generated level by level according to the display object of the highest dependency level, and the target page is rendered and displayed according to the direct display object;

[0122] If the acquisition fails, all the dependency display objects locally cached are deleted, and a first exception page is constructed for display.

[0123] On the basis of the above embodiments, the second rendering display module 440 can be further specifically used for:

[0124] If the application exit instruction triggered by the rendering failure is detected during the rendering of the target page, the application exit instruction is intercepted, and a second exception page is constructed for display.

[0125] On the basis of the above embodiments, the method further includes a message queue creation module for:

[0126] The object creation queue and the object deletion queue are constructed in advance, the object creation queue includes the creation sub-queue of the direct display object and the dependency display object of each dependency level, and the object deletion queue includes the deletion sub-queue of the direct display object and the dependency display object of each dependency level;

[0127] The object creation queue is used for generating the direct display object and / or the dependency display object, and the object deletion queue is used for deleting the direct display object and / or the dependency display object.

[0128] On the basis of the above embodiments, the dictionary loading module can be further used for:

[0129] When the application is started for the first time after the software version of the application is updated, the loading operation on the data dictionary in the application is performed.

[0130] If the loading is successful, the default data direct use object is generated level by level according to the default data dependency object of the highest dependency level in the data dictionary, for direct use of the application program;

[0131] If the loading fails, the network requests the default data dependency object of the highest dependency level, and generates the default data direct use object level by level according to the successfully acquired default data dependency object, for direct use of the application program.

[0132] On the basis of the above-mentioned embodiments, an effective period updating module can also be included, configured to:

[0133] When it is detected that the effective period updating condition is met, the network requests the latest effective period, and the latest effective period is locally updated and stored.

[0134] The page loading device in the application program provided by the embodiments of the application can execute the page loading method in the application program provided by any of the embodiments of the application, and has the corresponding function modules and beneficial effects of the execution method.

[0135] Embodiment four

[0136] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the applications described and / or claimed in this document.

[0137] As shown in Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0138] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, a speaker, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0139] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as performing a page loading method within an application as described in any embodiment of the present application.

[0140] That is, during normal operation of the application, in response to a loading request for a target page, it is detected whether a direct display object corresponding to the target page is locally cached;

[0141] If the direct display object is locally cached and within a valid period, the target page is rendered and displayed according to the direct display object;

[0142] If the direct display object is not locally cached, then in order of low to high according to the dependency level, it is detected whether a dependent display object used to generate the direct display object is locally cached;

[0143] If the target dependent display object of the target dependency level is locally cached and within a valid period, the direct display object is generated step by step according to the target dependent display object of the target dependency level, and the target page is rendered and displayed according to the direct display object.

[0144] In some embodiments, the page loading method within an application as described in any embodiment of the present application can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11 as aforementioned, one or more steps of the page loading method within an application as described in any embodiment of the present application can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the page loading method within an application as described in any embodiment of the present application by way of other any suitable means (e.g., by way of firmware).

[0145] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0146] Computer programs implementing methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program running on the processor implements the functions / operations specified in the flowcharts and / or the block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, or entirely on a remote machine or server.

[0147] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0148] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0149] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0150] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0151] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.

[0152] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for loading pages within an application, characterized in that, include: During the normal operation of the application, in response to a loading request for the target page, it checks whether the direct display object corresponding to the target page is cached locally; If the local cache directly displays the object and the directly displayed object is within its validity period, then the target page will be rendered and displayed based on the directly displayed object; If the object is not cached locally and is directly displayed, then check whether the dependent display objects used to generate the directly displayed object are cached locally level by level, in order of dependency hierarchy from low to high. If the target dependency display object of the target dependency hierarchy is cached locally and the target dependency display object is within its validity period, then direct display objects are generated level by level according to the target dependency display objects of the target dependency hierarchy, and the target page is rendered and displayed according to the direct display objects; wherein, the direct display object is a data object obtained by processing the time-sensitive display elements obtained from the network and is directly used for page rendering. After checking whether the local cache corresponds to the directly displayed object of the target page, it also includes: If the locally cached direct presentation object is not valid, then the network request should be made for the highest-level dependency presentation object. If the acquisition is successful, the direct display objects are generated level by level according to the highest dependency display object, and the target page is rendered and displayed according to the direct display objects; If the retrieval fails, delete the directly displayed object and all dependent displayed objects from the local cache, and construct the first exception page for display.

2. The method according to claim 1, characterized in that, Based on the target dependency presentation objects in the target dependency hierarchy, direct presentation objects are generated level by level, including: Check if the target dependency level is the direct dependency level of the directly displayed object; If so, a direct display object is generated directly based on the target dependency display object; otherwise, a next dependency display object is generated that has a direct dependency relationship with the target dependency display object. After determining the next dependency level as the target dependency level and the next dependency presentation object as the target dependency presentation object, return to execute the operation of checking whether the target dependency level is the direct dependency level of the direct presentation object, until the direct presentation object is successfully generated.

3. The method according to claim 1, characterized in that, After checking whether the dependency presentation objects used to generate the directly displayed objects are locally cached level by level according to the dependency hierarchy from low to high, the process also includes: If no dependency rendering object of any dependency level is cached locally, or if the target dependency object cached locally is not within its validity period, then a network request will be made for the dependency rendering object of the highest dependency level. If the acquisition is successful, the direct display objects are generated level by level according to the highest dependency display object, and the target page is rendered and displayed according to the direct display objects; If the retrieval fails, delete all dependent display objects from the local cache and construct the first exception page for display.

4. The method according to any one of claims 1-3, characterized in that, The target page is rendered and displayed based on the directly displayed object, including: If an application exit command triggered by rendering failure is detected during the rendering of the target page, the application exit command is intercepted, and a second abnormal page is constructed and displayed.

5. The method according to any one of claims 1-3, characterized in that, The method further includes: An object creation queue and an object deletion queue are pre-built. The object creation queue includes a creation sub-queue for directly displayed objects and a creation sub-queue for dependent displayed objects at each dependency level. The object deletion queue includes a deletion sub-queue for directly displayed objects and a deletion sub-queue for dependent displayed objects at each dependency level. The object creation queue is used to generate direct display objects and / or dependent display objects, and the object deletion queue is used to delete direct display objects and / or dependent display objects.

6. The method according to claim 1, characterized in that, Also includes: On the first launch of the application after an updated software version, perform a data dictionary loading operation within the application; If loading is successful, default data objects are generated level by level according to the default data dependency object at the highest dependency level in the data dictionary, so that the application can use them directly. If loading fails, a network request is made for the default data dependency object at the highest dependency level, and default data objects are generated level by level based on the successfully obtained default data dependency object for direct use by the application.

7. The method according to claim 1, characterized in that, Also includes: When the conditions for updating the validity period are met, the network requests the latest validity period and updates the validity period locally.

8. A page loading device within an application, characterized in that, include: The Direct Display Object Detection Module is used to detect whether the direct display object corresponding to the target page is cached locally in response to a loading request for the target page during the normal operation of the application. The first rendering and display module is used to render and display the target page based on the directly displayed object if the directly displayed object is cached locally and is within its validity period. The step-by-step detection module is used to check whether the dependent display objects used to generate the directly displayed objects are cached locally, in order of increasing dependency level, if the object is not cached locally and is directly displayed. The second rendering and display module is used to generate direct display objects level by level based on the target dependency display objects of the target dependency hierarchy if the target dependency display objects of the target dependency hierarchy are cached locally and the target dependency display objects are within their validity period, and then render and display the target page based on the direct display objects. The directly displayed object is a data object obtained by processing timely display elements obtained from the network and used directly for page rendering; The device further includes a first network request module, used for: After checking whether the local cache corresponds to the direct display object of the target page, if the local cached direct display object is not within its validity period, then the network request is made to the highest dependency level of the dependency display object. If the acquisition is successful, the direct display objects are generated level by level according to the highest dependency display object, and the target page is rendered and displayed according to the direct display objects; If the retrieval fails, delete the directly displayed object and all dependent displayed objects from the local cache, and construct the first exception page for display.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the page loading method within the application according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the page loading method within the application program as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Page generation method, device and equipment

    CN112905175A