Page display method, device and equipment of application program and storage medium
By pre-storing the first view resource data of the browser page locally and obtaining the second view resource data from the server, and adjusting the view display order in conjunction with dynamic libraries, the problem of slow browser page display speed is solved, and fast display and flexible layout are achieved.
Patent Information
- Application Number
- CN202111390218.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-11-22
AI Technical Summary
In existing technologies, browser pages are slow to display, and the pages remain blank for extended periods. The serial processing of resource data acquisition and rendering results in excessively long display times and a lack of flexibility.
The resource data corresponding to the first view of the page to be displayed is pre-stored locally, and the resource data of the second view is obtained from the server during the rendering process, so as to realize the parallel processing of rendering and resource data acquisition. The order of resource data acquisition and rendering of the view is adjusted by injecting the page view controller through dynamic library.
It speeds up page display, avoids prolonged blank page states, improves user experience, and enhances the flexibility of page display.
Smart Images

Figure CN116150516B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a page display method and device of an application program, an electronic device and a storage medium. BACKGROUND
[0002] A browser refers to a software tool that can display HTML (Hyper Text Mark-up Language, HyperText Markup Language or HyperText Linkage Language) file content of a web server or a file system and enable a user to interact with the files. The browser is the most commonly used tool for accessing the Internet. With the rapid development of Internet technology, the browser is increasingly frequently applied in daily life, work and study. How to improve the loading speed of a browser page is a problem that needs to be continuously researched by those skilled in the art. SUMMARY
[0003] To solve the above technical problem, embodiments of the present application provide a page display method and device of an application program, an electronic device and a computer readable storage medium, which can accelerate the display speed of a page.
[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0005] According to an aspect of an embodiment of the present application, a page display method of an application program is provided, comprising: obtaining first resource data corresponding to a first view of a to-be-displayed page pre-stored locally; obtaining second resource data corresponding to a second view from a server in a process of rendering processing the first resource data, the to-be-displayed page comprising the first view and the second view; rendering processing the second resource data; and displaying the first view and the second view after the rendering processing on the to-be-displayed page.
[0006] According to an aspect of an embodiment of the present application, a page display device of an application program is provided, comprising: a first request module configured to obtain first resource data corresponding to a first view of a to-be-displayed page pre-stored locally; a second request module configured to obtain resource data corresponding to a second view from a server in a process of rendering processing the first resource data, the to-be-displayed page comprising the first view and the second view; a rendering module configured to render process the resource data corresponding to the second view; and a display module configured to display the first view and the second view after the rendering processing on the to-be-displayed page.
[0007] According to an aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a memory, the memory having computer readable instructions stored thereon, the computer readable instructions being executed by the processor to implement the above-mentioned page display method of an application program.
[0008] According to an aspect of the embodiments of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores computer readable instructions. When the computer readable instructions are executed by a processor of a computer, the computer executes the page display method of the application provided in the foregoing.
[0009] According to an aspect of the embodiments of the present application, a computer program product or computer program is provided, and the computer program product or computer program includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the page display method of the application provided in the various optional embodiments.
[0010] In the technical solutions provided in the embodiments of the present application, the first resource corresponding to the first view of the page to be displayed is pre-stored locally, and when the page display of the application is performed, the first resource data is acquired from the local device and rendered, so that the first view is quickly displayed in the page to be displayed. The page to be displayed can be kept in a blank state for a long time, the user experience is improved, and in the process of displaying the first view in the page to be displayed, the second resource data corresponding to the second view is acquired from the server, so that the rendering process and the resource data acquisition process are parallel, and the display speed of the page to be displayed is improved.
[0011] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:
[0013] Figure 1 is a schematic diagram of an implementation environment related to the present application according to an exemplary embodiment;
[0014] Figure 2 is a page view display diagram of an application in the prior art according to an exemplary embodiment of the present application;
[0015] Figure 3 is a flowchart of a page display method of an application according to an exemplary embodiment of the present application;
[0016] Figure 4 is a flowchart of an exemplary page display method based on the embodiment shown in Figure 3
[0017] Figure 5 is a flowchart of injecting a dynamic library into a page view controller according to an exemplary embodiment of the present application;
[0018] Figure 6 is a flowchart of step S30 in the embodiment shown in Figure 4
[0019] Figure 7 is a flowchart of step S200 in the embodiment shown in Figure 3
[0020] Figure 8 is a flowchart of step S100 in the embodiment shown in Figure 3
[0021] Figure 9 is a flowchart of step S300 in the embodiment shown in Figure 3
[0022] Figure 10 is a flowchart of step S300 in the embodiment shown in Figure 3
[0023] is a flowchart of an exemplary page display method based on the embodiment shown in Figure 11 Figure 3 and Figure 9
[0024] Figure 12 is a block diagram of a page display device according to an exemplary embodiment of the present application;
[0025] Figure 13 shows a structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0026] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is with reference to the drawings, in which like numerals represent like elements throughout the several figures. The following description of exemplary embodiments is not representative of all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.
[0027] The block diagrams shown in the drawings are merely functional entities, and do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0028] The flowcharts shown in the drawings are merely exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to actual conditions.
[0029] It should also be noted that "multiple" as mentioned in the present application refers to two or more. The association relationship of "and / or" describes the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0030] Figure 1 is a schematic diagram of an implementation environment related to the present application according to an exemplary embodiment. The implementation environment related to the present application can be applied to various scenarios such as cloud technology, artificial intelligence, intelligent transportation, and assisted driving. Figure 1 As shown, the implementation environment related to the present application at least includes a terminal 110 used by a user and a server 130. The terminal 110 and the server 130 realize data interaction through the Internet.
[0031] The terminal 110 can be a smartphone, a tablet computer, a PC (Personal Computer), a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, or any other electronic device capable of running an application program, and the present application is not limited in this regard. The server 130 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Networks), and basic cloud computing services such as big data and artificial intelligence platforms, and the present application is not limited in this regard.
[0032] The mobile application is deployed in the terminal 110, and the running of the mobile application and the jumping between the pages in the mobile application are realized under the operation of the user. No matter the running of the mobile application or the jumping between the pages in the mobile page, the mobile application will obtain a page and display the page in the terminal 110. The data for displaying the page is obtained by the terminal 110 through the data interaction between the terminal 110 and the server 130.
[0033] For example, the terminal 110 is configured to obtain first resource data corresponding to a first view of a to-be-displayed page, render the first resource data, obtain second resource data corresponding to a second view of the to-be-displayed page from the server 130 in the process of rendering the first resource data, render the second resource data, and display the first view and the second view after the rendering on the to-be-displayed page.
[0034] In the prior art, the display process of multiple views in a page is generally as follows: the resource data corresponding to each view is obtained from the server in the order from top to bottom and from left to right of the page, after the resource data corresponding to all the views contained in the entire page is successfully obtained, each view is rendered in the order from top to bottom and from left to right of the page, and finally all the views after the rendering are displayed in the page. The display mode of the page has the following defects:
[0035] (1) The rendering of the resource data is started after the resource data corresponding to all the views is completely obtained, and this serial mode reduces the display speed of the page and may cause the page to be in a blank state for a long time.
[0036] (2) The acquisition process and the rendering process of the resource data are serially processed, which causes the display time of the page to be too long.
[0037] (3) The order of acquiring the resource data and rendering the resource data is fixed, that is, the rendering is performed in the order from top to bottom and from left to right of the page, and this mode is not flexible enough.
[0038] Please refer to Figure 2 , Figure 2 is a page view display diagram of an application in the prior art according to an example embodiment of the present application. As shown in Figure 2 , the page includes views Figure 1 - view Figure 6 In the completed display state of the page, the positions corresponding to the views Figure 1 - view Figure 6 are used to display the resource data corresponding to the views Figure 1 - view Figure 6 When the page is displayed in the prior art, the views Figure 1 - view Figure 6corresponding resource data, for example, a view Figure 1 corresponding to resource data related to finance, a view Figure 2 corresponding to resource data related to insurance, a view Figure 3 corresponding to resource data related to welfare, a view Figure 4 corresponding to resource data related to medical treatment, a view Figure 5 corresponding to resource data related to beauty, a view Figure 6 corresponding to resource data stored locally, and when the page is displayed, resource data related to finance, resource data related to insurance, resource data related to welfare, resource data related to medical treatment, resource data related to beauty, and resource data stored locally are obtained in sequence. Figure 1 - a view Figure 6 corresponding to resource data is rendered, that is, resource data related to finance, resource data related to insurance, resource data related to welfare, resource data related to medical treatment, resource data related to beauty, and resource data stored locally are rendered in sequence.
[0039] To solve at least the above problems in the prior art, embodiments of the present application respectively provide a page display method of an application program, a page display device of an application program, an electronic device, and a computer readable storage medium. These embodiments will be described in detail below.
[0040] Please refer to Figure 3 , Figure 3 is a flowchart of a page display method of an application program according to an example embodiment of the present application. The method can be specifically executed by the terminal 110 in the implementation environment shown in Figure 1 . As shown in Figure 3 , the page display method of the application program provided by the present embodiment includes steps S100-S400, and the details are described as follows.
[0041] Step S100: Obtain first resource data corresponding to a first view of a to-be-displayed page pre-stored locally.
[0042] In the embodiment, the page to be displayed refers to a page to be displayed by the application when the application runs in the terminal device, and the page usually includes multiple views, such as the first view and the second view mentioned in the embodiment, wherein the number of the first view and the second view is at least one. The display of the views included in the page needs the terminal device to perform rendering processing on the resource data corresponding to the views. It needs to be understood that the page mentioned in the embodiment refers to a web page, and the page can include information such as graphics, text, sound, and video, for example, can be an H5 page, and H5 refers to the fifth modified version of HTML (Hyper Text Markup Language).
[0043] In the embodiment, the first view corresponding to the first resource data is stored in the terminal device in advance, that is, the first view is a view in the page to be displayed, and the resource data of the view is stored in the terminal device in advance. The display position of the first view in the page to be displayed can be set according to the needs of the user, which is not specifically limited here, for example, can be in the middle position, the upper left corner position, the lower right corner position, and the like. If the first view is multiple, the display positions of the multiple first views in the page to be displayed have no necessary connection, for example, can be continuous, or can be discontinuous. The first resource data, for example, includes static resources, which is a part of the application and is saved in the terminal device. The static resources have the characteristic that the results obtained by all users are the same, for example, text, pictures, audio, video, and files with suffixes such as HTML, CSS, JavaScript, and TXT.
[0044] The first resource data, for example, includes historical resource data pre-acquired from the server, for example, the first resource data corresponding to the first view is historical resource data corresponding to other views in the page to be displayed except the first view, or historical resource data corresponding to views in other pages different from the page to be displayed, which is not specifically limited here.
[0045] In the embodiment, when the page display of the application starts, the first resource data corresponding to the first view is pre-stored in the local, and does not need to be downloaded from the server, even in the case of poor network. The first resource data corresponding to the first view can be acquired, so that the first resource data used for rendering the first view can be quickly acquired in the embodiment.
[0046] Step S200: In the process of performing rendering processing on the first resource data, the second resource data corresponding to the second view is acquired from the server, and the page to be displayed includes the first view and the second view.
[0047] In the browser, the browser kernel is a very important module, and its main role is to convert the page into a visual image result. Usually, the browser kernel is also called a rendering engine, and the so-called rendering process is a process of constructing a mathematical model according to the description or definition, and generating an image through the model. The rendering engine of the browser is a module that can convert HTML / CSS / JavaScript text and its corresponding resource files into an image result. Therefore, the first resource data can be rendered by the browser kernel in the embodiment.
[0048] In the embodiment, the to-be-displayed page further includes a second view that is not required for local storage view rendering, and the display position of the second view in the to-be-displayed page can be arbitrary, which is not limited here. In fact, the display position of the second view in the to-be-displayed page has nothing to do with the display position of the first view in the to-be-displayed page.
[0049] Since the second resource data corresponding to the second view is not pre-stored locally, the embodiment needs to obtain the second resource data corresponding to the second view from the server. In fact, most of the resources in the existing application development process are stored in the server to reduce the update frequency of the application and the size of the application. In addition, the resources located in the server can be updated in real time, thereby improving the user experience. Usually, the resource data stored in the server is called dynamic data, and the dynamic resource needs to be processed by a program or read from a database. Different data can be displayed on the page according to different conditions. The content update does not need to modify the page, but the access speed is not as good as that of static resources. Dynamic resource reference forces to search again every time such resources are accessed. The characteristic is that the results obtained by all users may be different. For example, dynamic resources can include jsp, servlet, php, asp and other types of resources.
[0050] For example, the process of obtaining the second resource data corresponding to the second view from the server is to generate a data request in the page and send the request to the server. The data request includes resource information to be requested. For example, in this step, the second resource data information of the second view needs to be obtained. The second resource data information includes URL address information. URL is a uniform resource locator, which is the address of a standard resource on the Internet. Each file on the Internet has a unique corresponding URL. The information contained in the URL indicates the location of the file. The server searches for the corresponding resource data according to the URL address information and sends it to the local end. The data request is a TCP request, an HTTP request, etc., which is not limited here.
[0051] In the case that the number of the first views contained in the page to be displayed is one, the second resource data corresponding to the second view is obtained from the server in the process of rendering the first resource data corresponding to the first view and displaying the first view after the rendering on the page to be displayed.
[0052] In the case that the number of the first views contained in the page to be displayed is more than one, after obtaining the first resource data corresponding to each first view, the first resource data corresponding to other first views is obtained in the process of rendering the obtained first resource data and displaying the corresponding first view on the page to be displayed, and then the first resource data corresponding to the other first views is rendered to display the corresponding first view on the page to be displayed. For example, the page to be displayed contains the first view A and the first view B, the first resource data corresponding to the first view A is obtained first, the first resource data corresponding to the first view B is obtained in the process of rendering the first resource data corresponding to the first view A and displaying the first view A on the page to be displayed, and the first resource data corresponding to the first view B is rendered to display the first view B on the page to be displayed.
[0053] For example, in the case that the number of the first views contained in the page to be displayed is more than one, the order of obtaining the first resource data corresponding to the first views can be random, or the first resource data corresponding to the first views can be obtained according to the display positions of the first views on the page to be displayed, for example, the order of obtaining the first resource data corresponding to each first view is determined according to the display positions of the views on the page to be displayed from left to right and from top to bottom.
[0054] In the process of rendering the obtained first resource data corresponding to each first view, the first resource data corresponding to other first views is obtained, which can further speed up the display of the page, and the first resource data obtained is immediately rendered and displayed on the page to be displayed, thereby further shortening the time during which the page to be displayed is in a blank state and improving the user experience.
[0055] It can be seen that, in the embodiment, the first views whose first resource data is pre-stored locally are rendered and displayed first, which can speed up the display of the first views on the page to be displayed, avoid the long-time blank state of the page to be displayed, improve the user experience, and obtain the second resource data corresponding to the second view from the server in the process of rendering the first resource data and displaying the first view after the rendering on the page to be displayed, which is a parallel processing mode of the rendering process and the resource data obtaining process, and can speed up the display of the page to be displayed.
[0056] Step S300: rendering processing is performed on the second resource data.
[0057] Exemplarily, before rendering processing is performed on the second resource data, the second resource data can be parsed first, and it is determined whether the second resource data is correct. If the parsing is correct, rendering processing is performed on the second resource data.
[0058] Exemplarily, when the number of the second views contained in the to-be-displayed page is multiple, the second resource data corresponding to the second view with shorter time consumption can be obtained from the server resource data first, and the second resource data is rendered and displayed. Correspondingly, the second resource data corresponding to the second view with longer time consumption is obtained from the server subsequently, and the second resource data is rendered and displayed. In this way, the second view with shorter time consumption is displayed before the second view with longer time consumption, so that more resource data can be displayed in the to-be-displayed page in a short time. Preferably, the multiple second views are sorted according to the time length of the resource data, and the second resource data corresponding to each second view is obtained, rendered and displayed according to the time length of the resource data from small to large.
[0059] Step S400: the second view after rendering processing is displayed on the to-be-displayed page.
[0060] In the embodiment, the first view and the second view can be displayed according to the page view layout preset in the program development process, or the layout of the views can be changed. For example, the views in the to-be-displayed page are arranged according to the order of rendering processing of the views, and are displayed on the local webpage. For example, since the rendering processing of the first view is prior to the rendering processing of the second view, the first view can be placed at the upper left corner of the to-be-displayed page, and the second view can be placed at the lower right corner of the to-be-displayed page.
[0061] The page display method of the application program provided in the embodiment can obtain the first resource data from the local and perform rendering processing on the first resource data, so as to display the first view on the to-be-displayed page quickly, which can avoid the to-be-displayed page being in a blank state for a long time, improve user experience, and obtain the second resource data corresponding to the second view from the server in the process of displaying the first view on the to-be-displayed page, so as to realize parallel of the rendering processing process and the resource data obtaining process, and accelerate the display speed of the to-be-displayed page.
[0062] Referring to Figure 4 , Figure 4 on the basis of the embodiment shown in Figure 3 is a flowchart of an exemplary page display method of an application program. As shown inFigure 4 As shown, the method comprises Figure 3 Based on the embodiment shown, before step S100, the method further comprises steps S10-S30, which are described in detail as follows:
[0063] Step S10: constructing a dynamic library, the dynamic library comprising positioning information of a page view controller corresponding to a page to be displayed.
[0064] Dynamic library, also known as Dynamic Link Library in English, is the abbreviation of Dynamic Link Library. DLL is a library containing code and data that can be used by multiple programs simultaneously. DLL is not an executable file. Dynamic linking provides a method that enables a process to call functions that are not part of its executable code. The executable code of the functions is located in a DLL, which contains one or more functions that have been compiled, linked, and stored separately from the processes that use them. DLLs also facilitate the sharing of data and resources. Multiple applications can access the contents of a single copy of a DLL in memory at the same time. DLL is a library containing code and data that can be used by multiple programs simultaneously. Dynamic library under Windows has the.dll suffix, and under Linux has the.so suffix.
[0065] Page view controller (PVC) is a container that stores other view controllers, manages its content in units of pages, and can display the content in the form of page turning or scrolling. If the developer wants to use the page turning mode, the spine needs to be set, which is generally located on the left side or top of the view. Then each view controller is regarded as a page of content in the book and added to the page view controller to make the book. Users can switch between pages through page turning or dragging operations. Each page corresponds to a page view controller, which is used to control the loading, rendering, and entire life cycle of the view in the page. When displaying a page, the page view controller corresponding to the page needs to be obtained first, and then the view in the page is loaded, rendered, and displayed by using the page view controller.
[0066] The page view controller is usually stored in the local memory. The prior art obtains the target page view controller corresponding to the page to be displayed from a large number of page view controllers by polling the local memory. The above-mentioned method of obtaining the target page view controller slows down the display speed of the page to be displayed due to the long time consumption, for example, when there are too many pages to be displayed in an application, each page corresponds to a page view controller.
[0067] Exemplarily, the positioning information of the page view controller corresponding to the page to be displayed can be a storage path used to indicate that the page view controller corresponding to the page to be displayed is local. Exemplarily, the positioning information of the page view controller corresponding to the page to be displayed can be a relative position relationship between the target page view controller and other page view controllers, for example, the target page view controller is a sub-page view controller of another page view controller, and thus the positioning information of the sub-page view controller can be determined according to the positioning information of the parent page view controller. Exemplarily, the positioning information of the page view controller corresponding to the page to be displayed can be a series of specified codes used to obtain the page view controller corresponding to the page to be displayed.
[0068] It should be noted that the page to be displayed in the dynamic library is a part or all of the plurality of pages in the application, which indicates that the page in the dynamic library is displayed by using the page display method of the application provided in the embodiment, and the page in the dynamic library is still displayed according to the page display method provided in the prior art.
[0069] Step S20: obtaining the page view controller corresponding to the page to be displayed according to the positioning information.
[0070] In the embodiment, the page view controller corresponding to the page to be displayed is obtained according to the positioning information in the dynamic library, which can accelerate the speed of obtaining the page view controller corresponding to the page to be displayed, avoid the long time of obtaining the page view controller corresponding to the page to be displayed by directly polling from the plurality of page view controllers of the application, and further reduce the speed of page display.
[0071] Step S30: injecting the dynamic library into the page view controller, and displaying the page to be displayed by using the page view controller to which the dynamic library is injected.
[0072] Exemplarily, at the start of the application, the plurality of APIs in the dynamic library are injected into the page view controller of the application by using the page view controller, so that the subsequent page view controller can call the corresponding function of the dynamic library to change the order of resource data obtaining, rendering, display and the like of the view in the page to be displayed. After the dynamic library is injected into the page view controller corresponding to the page to be displayed in the embodiment, the page display method of the application provided in the embodiment is used, and the creation, obtaining and rendering method of the page view is Hooked by using the MS technology, so as to achieve the purpose of rearranging or adjusting the display order of the page view.
[0073] Exemplarily, referring to Figure 5 , Figure 5 is a block diagram of injecting the dynamic library into the page view controller according to an exemplary embodiment of the present application, as shown in Figure 5As shown, the page view controller includes a loading module, a control module, and an execution module, wherein the loading module is used for resource data acquisition, parsing, rendering, display, and the like of the view of the page, the control module is used for controlling the loading module to perform corresponding operations, and the execution module is used for performing resource data acquisition, parsing, rendering, display, and the like, and the dynamic library is injected into the loading module so as to achieve the purpose of rearrangement or adjustment of the display order of the page view.
[0074] Exemplarily, referring to Figure 6 , Figure 6 is Figure 4 Step S30 in the embodiment shown is shown in the flowchart of an exemplary embodiment, as Figure 6 Step S30 includes steps S31-S39, which are described in detail as follows:
[0075] Step S31: Start the application program and load the dynamic library.
[0076] Step S32: Generate a dictionary set, the dictionary set including a plurality of view class names, save the feature information of the view class names, and inject the dynamic library including the dictionary set into the page view controller.
[0077] In this embodiment, the dictionary set is created in the following manner: create the dictionary set as a view class name set, save the feature information of the methods in the class according to the class name, including the method protocol, the method attribute, the inheritance relationship of the method, and the order of the method call; check MainThreadCheck, print the environment variables of the context; call loadInsertedDylib, traverse the isa pointer of the class structure body contained in lib to obtain the address of the class object, and put the object address as the key and the feature information as the value into the dictionary.
[0078] Step S33: Load the page.
[0079] Step S34: Determine whether the server needs to be requested.
[0080] In this embodiment, whether the server needs to be requested is determined according to whether the configuration file of the application program is stored in the server.
[0081] Step S35: If so, obtain the configuration file from the server.
[0082] Step S36: If not, obtain the configuration file from the local.
[0083] Step S37: Parse the configuration file.
[0084] Step S38: Start loading the page.
[0085] Step S39: Execute MS.
[0086] MS(Method swizzling) refers to the process of changing the implementation of an existing selector, depending on the invocation of the method in Objective-C, which can be changed at runtime, i.e., changing the mapping between the selector in the dispatch table of the class to the final function.
[0087] The embodiment mainly uses three APIs (Application Programming Interface), namely:
[0088] method_exchangeImplementations exchanges the IMP of two methods
[0089] class_replaceMethod modifies the class
[0090] method_setImplementation directly sets the IMP of a method
[0091] Using the three APIs can hook the method.
[0092] API is a pre-defined interface, such as a function, an HTTP interface, or a convention for linking different components of a software system. It is used to provide a set of routines that an application can access based on a certain software or hardware without accessing the source code or understanding the details of the internal working mechanism.
[0093] IMP is the abbreviation of "implementation", which is the address of the Objective-C method implementation code block. IMP is also called a function pointer. It can be directly called like a C function. Usually, the message is sent to the object through [object method: parameter] or objc_msgSend(), and then the Objective-C runtime finds the matching IMP and calls the IMP. Each API in the dynamic library has a corresponding method name, property name, protocol name, and inheritance relationship.
[0094] In the embodiment, the MS is performed by adjusting or rearranging the calling order of the method of obtaining the resource data of the view of the page to be displayed, the parsing method, the rendering processing method, etc. in the dynamic library through the page view controller, according to the specific Figure 3The manner in the illustrated embodiment determines the manner of adjusting or rearranging the method call order of the resource data acquisition method, the analysis method, the rendering processing method, etc. of the view. Exemplarily, the present embodiment can change the method call order by the manner of Hook.
[0095] Hook is a platform of Windows message processing mechanism, and an application program can set a subroutine on it to detect a certain message of a specified window, and the detected window can be created by other processes. When the message arrives, it is processed before the target window processing function. The hook mechanism allows the application program to intercept the processing of window messages or specific events. The hook is actually a program segment that processes messages, which is hung into the system through a system call. Whenever a specific message is issued, the hook program will capture the message before it reaches the destination window, that is, the hook function will get control first. At this time, the hook function can process and change the message, or it can not process and continue to pass the message, or it can forcibly end the transmission of the message.
[0096] The present embodiment injects the dynamic library into the page view controller of the page to be displayed at the start of the application program, so as to adjust the call order of the functions related to the page view display in the configuration file subsequently, and then realize the adjustment of the display order of the views in the page, and accelerate the page display speed.
[0097] Referring to Figure 7 , Figure 7 is Figure 3 The step S200 in the illustrated embodiment is shown in the flowchart of an exemplary embodiment, as shown in Figure 7 S200 includes steps S210-S220, which are described in detail as follows:
[0098] Step S210: calling a first rendering function corresponding to a first view from the configuration file of the application program by using the page view controller.
[0099] In the present embodiment, the configuration file includes functions for acquiring resource data corresponding to the view and the original call order of the functions, rendering functions for rendering resource data corresponding to the view, and the original call order of the rendering functions.
[0100] Exemplarily, the views to be displayed include a first view and a second view, the configuration file includes a function of obtaining first resource data corresponding to the first view, a function of rendering the first resource data, and the like, and includes a function of obtaining second resource data corresponding to the second view, a function of rendering the second resource data, and the like. Since the second view is in the upper left of the first view, when the page to be displayed is displayed, the second resource data is first obtained by using the function of obtaining the second resource data, the first resource data is obtained by using the function of obtaining the first resource data, the second resource data is rendered by using the function of rendering the second resource data, and the first resource data is rendered by using the function of rendering the first resource data.
[0101] The configuration file is developed by a developer of the application program in advance and is a part of the application program, and is called by the page view controller in the page display process of the application program to realize display of the corresponding view. In the embodiment, the configuration file can be saved locally in advance or on a server, which is not limited here. Exemplarily, if the layout of the multiple views in the page to be displayed is not dynamically adjusted each time the page is displayed, for example, a settings page, the configuration file is saved locally to speed up the calling speed of the corresponding function in the configuration file. If the layout of the multiple views in the page to be displayed is adjusted over time, for example, a home page recommendation, information, a playing page, and the like, the configuration file can be saved on the server, and the configuration file is obtained from the server when the page to be displayed is displayed, so as to update the configuration file.
[0102] In the embodiment, the configuration file further includes the name of each API that needs to be dynamically injected from the dynamic library, so as to determine each dynamically injected API, generate a page list file including each API that needs to be dynamically injected, traverse the class that needs to be dynamically injected in the list file, and call the method name, attribute, protocol name, and inheritance relationship for dynamic injection in the class that needs to be dynamically injected accessed each time in the traversal process.
[0103] In the above exemplary embodiment, since the original calling sequence of the function corresponding to the second view is before the original calling sequence of the function corresponding to the first view, that is, if the second resource data corresponding to the second view needs to be acquired and the second resource data needs to be rendered first according to the original calling sequence of the function, the embodiment first calls the function corresponding to the first view to process the first view and display it in the page in order to speed up the display speed of the page to be displayed. Specifically, the embodiment first uses the API in the dynamic library to perform Hook processing on the function in the configuration file that needs to adjust the calling sequence, so that the calling sequence of the function after Hook processing is changed. For example, in the embodiment, the IMPs of the function for rendering the first resource data corresponding to the first view and the function for rendering the second resource data corresponding to the second view are exchanged using the API method_exchangeImplementations, so that the calling sequence of the function for rendering the first resource data corresponding to the first view is earlier than the calling sequence of the function for rendering the second resource data corresponding to the second view.
[0104] In the embodiment, since the prior art renders the view after all the resource data corresponding to the page to be displayed is acquired, in order to speed up the display speed of the view and shorten the time of the processing blank state of the page to be displayed, the embodiment starts to render the first resource data after the first resource data corresponding to the first view is acquired, without waiting for the second resource data corresponding to the second view to be acquired. Therefore, the embodiment also needs to change the IMP of the function for rendering the first resource data corresponding to the first view. For example, the embodiment can directly set the IMP of the function for rendering the first resource data corresponding to the first view using the API method_setImplementation, so that the calling of the function for rendering the first resource data is before the calling sequence of the function for acquiring the second resource data or at least meets the condition of simultaneous calling.
[0105] In addition, since the embodiment acquires the second resource data corresponding to the second view in the process of rendering the first resource data and displaying the first view after rendering in the page to be displayed, the calling sequence of the function for rendering the first resource data corresponding to the first view and the function for acquiring the second resource data corresponding to the second view does not need to be specified.
[0106] Step S220: rendering the first resource data using the first rendering function.
[0107] In the embodiment, the configuration file can further include a rendering manner of each view in the page to be displayed. For example, the page to be displayed includes three views to be displayed, and the configuration information indicates that two of the views can be rendered by the rendering manner of the weex plug-in, and the other view can be rendered by the rendering manner of the native plug-in. In actual application, the configuration file can include an identifier of a view and an array of rendering manners corresponding to the view. The rendering manner corresponding to the view can only display the best rendering manner, and in addition to the best rendering manner, other candidate rendering manners can also be displayed. Therefore, in the configuration information, the identifier of the view and the rendering manner can be in one-to-one relationship, or in one-to-many manner.
[0108] In the embodiment, the first rendering function can be a plug-in interface for rendering processing of the first resource data, which is not limited here.
[0109] In the embodiment, a rendering plug-in set can be provided, which can be used as a software development kit (SDK). The rendering plug-in set can include a plurality of rendering plug-ins. For example, the rendering plug-in set can include weex, windvane, dinamic and native plug-ins. When a developer develops an application, the rendering plug-in set can be accessed as a whole, or a part of the rendering plug-in set can be accessed. The rendering plug-in in the rendering plug-in set can be registered once in the application to be developed, and can be used globally in the application. Of course, in actual application, in addition to using the SDK provided by the present application, the developer can also implement other rendering plug-ins by himself, and the self-implemented rendering plug-ins can also be accessed in the application to be developed. As long as the rendering plug-in accessed in the application can implement the technical solution of the present application, it shall be within the protection scope of the present application.
[0110] In the embodiment, since the process of rendering processing of the first resource data by the kernel of the application is independent of the process of obtaining the second resource data corresponding to the second view from the server by the application, in order to speed up the display speed of the entire page to be displayed, the second resource data corresponding to the second view is obtained from the server in the process of rendering processing of the first resource data and displaying the first view after rendering processing in the page to be displayed.
[0111] Exemplarily, the process of obtaining the second resource data corresponding to the second view is as follows:
[0112] The resource data request is sent to the server, and the resource data request includes address information of the resource data.
[0113] The receiving server acquires the resource data according to the address information of the resource data.
[0114] Referring to Figure 8 , Figure 8 is Figure 3 Step S100 in the embodiment shown in FIG. 1 is shown in a flowchart of an exemplary embodiment, as shown in FIG. 2, and step S100 includes steps S110-S120, which are described in detail as follows: Figure 8
[0115] Step S110: matching the view of the page to be displayed with a locally pre-stored corresponding relationship table, the corresponding relationship table including the corresponding relationship between the view identifier and the resource data.
[0116] In this embodiment, in order to facilitate the acquisition of the first resource data corresponding to the first view of the page to be displayed pre-stored locally, an exemplary corresponding relationship table including the corresponding relationship between the view identifier and the resource data is constructed in the development process of the application program, the view identifier is used to uniquely identify the view included in the application program, and the corresponding relationship between the resource data and the view indicates that when the page including the corresponding view is displayed, the resource data is displayed at the position corresponding to the view. It should be noted that the corresponding relationship between the resource data and the view does not necessarily have to be one-to-one, that is, one resource data can correspond to multiple views, for example, the general resource is a font file, and the font file is used to set the size, font, color, etc. of the file in the page view.
[0117] Exemplarily, after the local installation of the application program is successful, the corresponding relationship table including the corresponding relationship between the view identifier and the resource data can be updated in real time, for example, a dynamic resource of the server does not change in the preset number of display processes, the dynamic resource is cached locally, and the corresponding relationship between the dynamic resource and the view is established.
[0118] Step S120: taking the view matched successfully as the first view.
[0119] In this embodiment, the view identifier corresponding to all views of the page to be displayed is matched with the corresponding relationship table, if the corresponding view identifier is found in the corresponding relationship table, the view corresponding to the view identifier is taken as the first view. The view corresponding to the view identifier that is not found in the corresponding relationship table is taken as the view.
[0120] Referring to Figure 9 , Figure 9 is Figure 3 Step S300 in the embodiment shown in FIG. 1 is shown in a flowchart of an exemplary embodiment, as shown in FIG. 2, and step S300 includes steps S310-S320, which are described in detail as follows: Figure 9
[0121] Step S310: Use the page view controller corresponding to the page to be displayed to call the second rendering function corresponding to the second view from the application's configuration file.
[0122] In this embodiment, the original calling order of the first and second rendering functions in the configuration file corresponds to the original display order of the first and second views on the page to be displayed. That is, the original calling order of the rendering functions in the configuration file is the preset calling order of the rendering functions during the application development phase, and the original display order of the views on the page to be displayed is the order in which the views are displayed according to the corresponding original calling order in the configuration file.
[0123] For example, in this embodiment, if the original calling order of the second rendering function corresponding to the second view in the configuration file is before the original calling order of the first rendering function corresponding to the first view, then the calling order of the second rendering function of the first rendering function is swapped; otherwise, the original calling order of the second rendering function in the configuration file remains unchanged. Therefore, in this step, the second rendering function called by the page view controller from the application's configuration file may be the second rendering function whose calling order has been swapped with the first rendering function. In fact, after step S210, the calling order of the first rendering function corresponding to the first view must be before the calling order of the second rendering function corresponding to the second view. If the calling order of the second rendering function in the configuration file is before the calling order of the first rendering function, then the calling order is swapped using Hook technology. Therefore, the second rendering function corresponding to the second view called in this step is either a function after Hook processing or an unprocessed function.
[0124] Step S320: Render the second resource data using the second rendering function.
[0125] In this embodiment, in order to further speed up the display of the page to be displayed, if there are multiple second views, each time the second resource data corresponding to a second view is obtained, the obtained second resource function is immediately rendered, and at the same time, the second resource data corresponding to other second views is obtained from the server.
[0126] See Figure 10 , Figure 10 yes Figure 3 Step S300 in the illustrated embodiment is shown in a flowchart of an exemplary embodiment, as follows: Figure 10 As shown, step S300 includes steps S330-S340, which are described in detail below:
[0127] Step S330: If the acquisition time of the second resource data exceeds the preset threshold, then request the server to stop sending the second resource data.
[0128] The embodiment sends a resource request corresponding to the second resource data to the server, so that the server acquires the second resource data according to address information of the second resource data included in the resource request and returns the second resource data to the local. Exemplarily, the operation of sending the resource request is started to be timed, and if the timing duration is greater than or equal to a preset threshold, the local has not received the second resource data sent by the server or has only received part of the second resource data, which indicates that the acquisition duration of the second resource data is greater than the preset threshold. The preset threshold can be set or adjusted according to actual application scenarios and needs, and the embodiment does not make any limitation on the setting of the preset threshold.
[0129] Step S340: Requesting to acquire third resource data pre-stored in the local, and taking the third resource data as second resource data corresponding to the second view.
[0130] In the embodiment, the third resource data includes third resource data that is not view data corresponding to the second view and is cached in the local. Exemplarily, the third resource data is first resource data corresponding to the first view in the current page to be displayed, or the third resource data is first resource data corresponding to the first view in another page to be displayed, or the third resource data is resource data not corresponding to any view, such as a placeholder and the like.
[0131] The embodiment acquires resource data from the local and takes the resource data as second resource data corresponding to the second view when the acquisition duration of the second resource data corresponding to the second view is too long, and then performs rendering processing on the third resource data and displays the second view after the rendering processing in the page to be displayed, that is, the acquisition speed of the second resource data corresponding to the second view is accelerated by controlling the acquisition duration of the second resource data corresponding to the second view, and thus the display speed of the entire page to be displayed can be accelerated.
[0132] Referring to Figure 11 , Figure 11 on the basis of the embodiments shown in Figure 3 and Figure 10 , a flowchart of a page display method of an application program is shown. As shown in Figure 11 , the method further includes steps S500-S700 after step S400 on the basis of the embodiment shown in Figure 3 , which are described in detail as follows:
[0133] Step S500: Requesting the server to continue to issue second resource data corresponding to the second view.
[0134] The embodiment is after step S340, the third resource data is taken as the second resource data corresponding to the second view, step S400 is directly rendered to the third resource data and is handled, and the second view after rendering processing is shown in the background in the page to be shown, and the above-mentioned mode can accelerate the display speed of the page to be shown, and subsequently in order to show the view data corresponding to the second view to the user, the embodiment requests the server to continue to issue the second resource data corresponding to the second view.
[0135] Exemplarily, the local sends a page refresh request to the server, the refresh request includes the identification of the second view to be refreshed, the server looks up the historical resource data acquisition request of the second view corresponding to the identification according to the identification of the second view in the page refresh request, so as to determine the address information of the second resource data according to the historical resource data acquisition request, continue to acquire the second resource data corresponding to the second view identification, specifically, the server has acquired part of the data in the second resource data within a preset threshold time, so the remaining part of the corresponding second resource data can be acquired according to the address information, and finally the complete second resource data is sent to the local, without repeated acquisition, so as to accelerate the refresh speed of the page to be shown.
[0136] Step S600: rendering processing is performed on the acquired second resource data to obtain the second view to be updated.
[0137] In this step, the page view controller calls the second rendering function corresponding to the second view from the configuration file, and the second rendering function is used to render the second resource data.
[0138] Step S700: refreshing the page to be shown according to the second view to be updated.
[0139] In this step, the second view to be updated is used to replace the corresponding second view in the page to be shown, and the second view to be updated is shown in the page to be shown, so as to refresh the page to be shown.
[0140] The page display method provided by the embodiment can on one hand use the third resource data cached locally as the second resource data corresponding to the second view with long resource data acquisition time, and show it after rendering processing in the page to be shown, so as to accelerate the display speed of the page to be shown, and on the other hand, after the page to be shown is successfully displayed, the server is requested to continue to issue the second resource data corresponding to the second view with long resource data acquisition time, and the second resource data is rendered to obtain the second view to be updated, and the page to be shown is refreshed by using the second view to be updated, so that the content of the page to be shown is completely shown to the user, and the user experience is improved.
[0141] Participation Figure 12 ,Figure 12 is a block diagram of a page display device of an application program according to an example embodiment of the present application, as shown in Figure 12 The page display device 40 of the application program includes a first obtaining module 41, a second obtaining module 42, a first rendering module 43, and a display module 44.
[0142] The first obtaining module 41 is configured to obtain first resource data corresponding to a first view of a to-be-displayed page stored locally in advance. The second obtaining module 42 is configured to obtain resource data corresponding to a second view from a server in a process of rendering the first resource data and displaying the first view after the rendering on the to-be-displayed page, the to-be-displayed page including the first view and the second view. The first rendering module 43 is configured to render the second resource data. The display module 44 is configured to display the second view after the rendering on the to-be-displayed page.
[0143] In another example embodiment, the page display device 40 of the application program further includes a constructing module, a third obtaining module, and an injecting module. The obtaining module is configured to construct a dynamic library, the dynamic library including positioning information of a page view controller corresponding to the to-be-displayed page. The third obtaining module is configured to obtain the page view controller corresponding to the to-be-displayed page according to the positioning information. The injecting module is configured to inject the dynamic library into the application program by using the page view controller, and perform a display process of the to-be-displayed page according to the dynamic library and the application program.
[0144] In another example embodiment, the second obtaining module 42 includes a first calling unit and a first rendering unit. The first calling unit is configured to call a first rendering function corresponding to the first view from a configuration file of the application program by using a page controller. The first rendering unit is configured to perform rendering processing on the first resource data by using the first rendering function.
[0145] In another example embodiment, the first rendering module 43 includes a second calling unit and a second rendering unit. The second calling unit is configured to call a second rendering function corresponding to the second view from the configuration file by using a page view controller. The original calling order of the first rendering function and the second rendering function in the configuration file corresponds to the original display order of the first view and the second view in the to-be-displayed page. The second rendering unit is configured to perform rendering processing on the second resource data by using the second rendering function.
[0146] In another example embodiment, the second obtaining module 42 comprises a first requesting unit and a second requesting unit, wherein the first requesting unit is configured to request the server to stop issuing the second resource data when the obtaining duration of the second resource data is greater than a preset threshold; and the second requesting unit is configured to request to obtain third resource data pre-stored locally, and take the third resource data as the second resource data corresponding to the second view, the third resource data comprising data irrelevant to the view data corresponding to the second view.
[0147] In another example embodiment, the page display apparatus 40 of the application program comprises a requesting module, a second rendering module and a refreshing module, wherein the requesting module is configured to request the server to continue issuing the second resource data corresponding to the second view; the second rendering module is configured to perform rendering processing on the obtained second resource data to obtain the second view to be updated; and the refreshing module is configured to perform refreshing processing on the page to be displayed according to the second view to be updated.
[0148] In another example embodiment, the first obtaining module 41 comprises a matching unit and a determining unit, wherein the matching unit is configured to match the view of the page to be displayed with a corresponding relationship table pre-stored locally, the corresponding relationship table comprising the corresponding relationship between the view identifier and the resource data; and the determining unit is configured to take the view matched successfully as the first view.
[0149] It should be noted that the apparatus provided in the above embodiments and the method provided in the above embodiments belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiments, which will not be described here.
[0150] In another example embodiment, the present application provides an electronic device comprising a processor and a memory, wherein the memory has stored thereon computer readable instructions which, when executed by the processor, implement the page display method of the application program as described above.
[0151] Figure 13 A structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.
[0152] It should be noted that, Figure 13 The computer system 1000 of the electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0153] As Figure 13As shown, the computer system 1000 includes a central processing unit (CPU) 1001 which can perform various appropriate actions and processes, such as executing the information recommendation method in the above-described embodiments, according to a program stored in a read-only memory (ROM) 1002 or a program loaded into a random access memory (RAM) 1003 from the storage section 1008. Various programs and data required for the operation of the system are also stored in the RAM 1003. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0154] Connected to the I / O interface 1005 are an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as necessary. A removable recording medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1010 as necessary, so that a computer program read therefrom is installed in the storage section 1008 as necessary.
[0155] In particular, according to the embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product including a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 1009, and / or installed from the removable recording medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the system of the present application are performed.
[0156] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer-readable signal medium can include a data signal carrying computer-readable computer programs in a baseband or as a part of a carrier wave. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, device or apparatus. The computer programs contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.
[0157] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks represented in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0158] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0159] Another aspect of the present application also provides a computer readable storage medium, which stores computer readable instructions. The computer readable instructions are executed by a processor to implement the page display method of the application program in any of the preceding embodiments.
[0160] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the page display method of the application program provided in each of the preceding embodiments.
[0161] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a 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 thereof. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program used by an instruction execution system, apparatus or device, and can be used or combined with the same. In this application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable computer programs. Such a propagated data signal can take various forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, transmit, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. The computer programs contained in the computer-readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, or the like, or any suitable combination thereof.
[0162] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0163] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0164] The above is only a preferred exemplary embodiment of the present application, and is not intended to limit the implementation of the present application. Those skilled in the art can easily make corresponding modifications or changes according to the main concept and spirit of the present application, and the protection scope of the present application should be subject to the protection scope required by the claims.
Claims
1. A method for displaying a page in an application, characterized in that, The page to be displayed contains multiple views, and the method includes: Construct a dynamic library, which includes the positioning information of the page view controller corresponding to the page to be displayed; Obtain the page view controller corresponding to the page to be displayed based on the location information; When the application starts, the dynamic library is injected into the page view controller; wherein, the page view controller that injects the dynamic library adjusts the call order of functions related to page view display in the application's configuration file to adjust the display order of views in the page to be displayed; the page to be displayed is displayed using the page view controller that injects the dynamic library, including: Retrieve the first resource data corresponding to the first view of the page to be displayed, which is stored locally. During the process of rendering the first resource data and displaying the rendered first view on the page to be displayed, the second resource data corresponding to the second view is obtained from the server. The second resource data is rendered. The rendered second view is then displayed on the page to be displayed.
2. The method according to claim 1, characterized in that, The rendering process of the first resource data includes: Call the first rendering function corresponding to the first view from the application's configuration file; The first resource data is rendered using the first rendering function.
3. The method according to claim 2, characterized in that, The rendering process of the second resource data includes: The second rendering function corresponding to the second view is called from the configuration file, wherein the original calling order of the first rendering function and the second rendering function in the configuration file corresponds to the original display order of the first view and the second view in the page to be displayed. The second resource data is rendered using the second rendering function.
4. The method according to claim 1, characterized in that, The step of obtaining the second resource data corresponding to the second view from the server includes: If the acquisition time of the second resource data exceeds a preset threshold, then request the server to stop sending the second resource data; The system requests to retrieve locally stored third resource data and uses this third resource data as the second resource data corresponding to the second view. The third resource data includes data that is unrelated to the view data corresponding to the second view.
5. The method according to claim 4, characterized in that, After displaying the rendered second view on the page to be displayed, the method further includes: Request the server to continue sending the second resource data corresponding to the second view; The obtained second resource data is rendered to obtain the second view to be updated; The page to be displayed is refreshed based on the second view to be updated.
6. The method according to claim 1, characterized in that, The step of obtaining the first resource data corresponding to the first view of the page to be displayed, which is pre-stored locally, includes: The view of the page to be displayed is matched with a locally stored correspondence table, which includes the correspondence between view identifiers and resource data. The view that matches successfully will be used as the first view.
7. A page display device for an application, characterized in that, The page to be displayed contains multiple views, and the device includes: A building module is used to build a dynamic library, the dynamic library including the positioning information of the page view controller corresponding to the page to be displayed; The third acquisition module is used to acquire the page view controller corresponding to the page to be displayed based on the positioning information. An injection module is used to inject the dynamic library into the page view controller when the application starts; wherein, the page view controller that injects the dynamic library adjusts the calling order of functions related to page view display in the application's configuration file to adjust the display order of views in the page to be displayed; The first acquisition module is used to acquire the first resource data corresponding to the first view of the page to be displayed that is pre-stored locally; The second acquisition module is used to acquire the second resource data corresponding to the second view from the server during the process of rendering the first resource data and displaying the rendered first view on the page to be displayed. The rendering module is used to render the second resource data. The display module is used to display the rendered second view on the page to be displayed. The first acquisition module, the second acquisition module, the rendering module, and the display module are implemented using a page view controller that injects the dynamic library.
8. An electronic device, characterized in that, include: Memory, which stores computer-readable instructions; A processor reads computer-readable instructions stored in memory to perform the method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by the processor of a computer, cause the computer to perform the method described in any one of claims 1-6.
10. A computer program product comprising computer instructions stored in a computer-readable storage medium; The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method of any one of claims 1-6.
Citation Information
Patent Citations
Page display method and device, terminal equipment and computer readable storage medium
CN112182446A
H5 page loading method and device, equipment and storage medium
CN113326080A