Page display method, device, computer-readable storage medium, and electronic device
By obtaining component files from the server and dynamically building page objects, the problem of Flutter not supporting dynamic updates is solved, the page update efficiency is improved, and the page dynamic display and content update are realized.
Patent Information
- Application Number
- CN202110091323.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-22
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-01-22
AI Technical Summary
The Flutter development framework does not support dynamic generation environments, resulting in the application page style and content updates that require re-release of application versions, which consumes a lot of manpower and time and reduces the update efficiency.
By obtaining the component files of the target page from the server, including component construction information, data interface address and binding relationship between the page objects, the page objects are dynamically built and updated, and the page objects are realized dynamically displayed and updated.
It improves the efficiency of updating Flutter application pages, realizes dynamic acquisition of page layout and content, and reduces the dependence on developers' time.
Smart Images

Figure CN112799663B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a page display method, device, computer-readable storage medium and electronic device. Background Art
[0002] Flutter is a cross-platform mobile development framework that uses Dart as the development language and supports operating systems such as Android, iOS, and Web. Since Dart supports both AOT (Ahead-of-Time Compilation) and JIT (Just in Time Compilation), Flutter naturally supports dynamicization, but for security reasons, the Flutter framework does not support Flutter enabling dynamicization in the build environment.
[0003] Therefore, in the prior art, when a page in an application needs to be updated, the developer needs to redevelop a new version of the application and release it. Only after the mobile terminal downloads the update can the new page style and content be displayed on the client. Obviously, this method requires a lot of manpower and time costs, reduces the update efficiency of the page in the Flutter application, and cannot meet the user's demand for page updates in the application. Summary of the invention
[0004] In view of this, the present application provides a page display method, device, computer-readable storage medium and electronic device, which to a certain extent solve the problem in the prior art that the Flutter development framework does not support the dynamic generation environment, so that the page style and content update of the application requires the re-release of the application version, which consumes a lot of manpower and time costs, resulting in low efficiency in updating the style and content of the page in the Flutter application.
[0005] According to a first aspect of the present application, a page display method is provided, which may include:
[0006] In response to a display instruction for a target page in a Flutter application, a component file of the target page is obtained from a server, where the component file includes at least: component construction information, a data interface address, and a binding relationship between component data and a page object;
[0007] Acquire component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information;
[0008] Merging the component data into corresponding component objects according to the binding relationship to construct the target page;
[0009] The target page is displayed.
[0010] Optionally, after displaying the target page, the method further includes:
[0011] In response to an update instruction for the target page, replacing the replacement symbol in the data interface address according to a page update policy corresponding to the target page;
[0012] Get updated data according to the replaced data interface address;
[0013] Re-execute the target page construction process according to the updated data to obtain an updated target page;
[0014] The updated target page is displayed.
[0015] Optionally, the update instruction includes at least: a target operation type, and the page update strategy includes: a correspondence between an operation type and an address character;
[0016] The replacing the replacement symbol in the data interface address according to the page update strategy corresponding to the target page includes:
[0017] Acquire the target address character corresponding to the target operation type according to the page update strategy;
[0018] The replacement characters in the data interface address are replaced with the target address characters.
[0019] Optionally, re-executing the target page construction process according to the updated data to obtain an updated target page includes:
[0020] Merging the update data with the component data to obtain merged data;
[0021] The target page construction process is re-executed according to the merged data to obtain an updated target page.
[0022] Optionally, after displaying the updated target page, the method further includes:
[0023] Store the target page before updating in the local cache;
[0024] When a switch instruction for the target page before the update is received within a preset time period, the target page before the update is obtained from the local cache for display;
[0025] When no switching instruction for the target page before updating is received within a preset time period, the target page before updating in the local cache is deleted.
[0026] Optionally, obtaining the component files of the target page from the server includes:
[0027] Obtain a component file of an AST data structure from a server, wherein the component file is obtained by converting a component file of a DART language into a JSON format using a language analyzer;
[0028] The component file is parsed according to the parsing rules of the AST data structure to obtain the component construction information, data interface address, component data and binding relationship between page objects of the target page.
[0029] Optionally, when the target page is a list page, the page object includes: a list entry;
[0030] The step of merging the component data into corresponding component objects according to the binding relationship to construct the target page includes:
[0031] The component data is added to the corresponding list entry according to the binding relationship to construct the list page.
[0032] According to a second aspect of the present application, a page display device is provided, which may include:
[0033] An acquisition module is configured to obtain a component file of a target page from a server in response to a display instruction for the target page in the Flutter application, wherein the component file includes at least: component construction information, a data interface address, and a binding relationship between component data and page objects;
[0034] a preparation module, configured to obtain component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information;
[0035] A construction module, configured to merge the component data into corresponding component objects according to the binding relationship to construct the target page;
[0036] The display module is configured to display the target page.
[0037] Optionally, the device further includes: an updating module configured to:
[0038] In response to an update instruction for the target page, replacing the replacement symbol in the data interface address according to a page update policy corresponding to the target page;
[0039] Get updated data according to the replaced data interface address;
[0040] Re-execute the target page construction process according to the updated data to obtain an updated target page;
[0041] The updated target page is displayed.
[0042] Optionally, the update instruction includes at least: a target operation type, and the page update strategy includes: a correspondence between an operation type and an address character;
[0043] Optionally, the update module is further configured to:
[0044] Acquire the target address character corresponding to the target operation type according to the page update strategy;
[0045] The replacement characters in the data interface address are replaced with the target address characters.
[0046] Optionally, the update module is further configured to:
[0047] Merging the update data with the component data to obtain merged data;
[0048] The target page construction process is re-executed according to the merged data to obtain an updated target page.
[0049] The update module is further configured to:
[0050] Store the target page before updating in the local cache;
[0051] When a switch instruction for the target page before the update is received within a preset time period, the target page before the update is obtained from the local cache for display;
[0052] When no switching instruction for the target page before updating is received within a preset time period, the target page before updating in the local cache is deleted.
[0053] Optionally, the acquisition module is further configured to:
[0054] Obtain a component file of an AST data structure from a server, wherein the component file is obtained by converting a component file of a DART language into a JSON format using a language analyzer;
[0055] The component file is parsed according to the parsing rules of the AST data structure to obtain the component construction information, data interface address, component data and binding relationship between page objects of the target page.
[0056] Optionally, when the target page is a list page, the page object includes: a list entry;
[0057] The building block is further configured to:
[0058] The component data is added to the corresponding list entry according to the binding relationship to construct the list page.
[0059] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the page display method described in the first aspect are implemented.
[0060] In a fourth aspect, the present application provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the page display method described in the first aspect are implemented.
[0061] Compared with the prior art, this application has the following advantages:
[0062] The embodiments of the present application provide a page display method, device, computer-readable storage medium, and electronic device. This solution constructs a target page by acquiring a page file used to construct the target page from a client when a Flutter application needs to display the target page, thereby achieving dynamic acquisition of page layout, and also achieving dynamic acquisition of page content by binding between component objects and component data in the page, so that the page displayed by the Flutter application can be updated more efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0064] Figure 1 It is a step flow chart of a page display method provided by an embodiment of the present application;
[0065] Figure 2 is a flowchart of another page display method provided by an embodiment of the present application;
[0066] Figure 3 is a flowchart of a data acquisition method provided by an embodiment of the present application;
[0067] Figure 4 is a flowchart of the steps of another page acquisition method provided by an embodiment of the present application;
[0068] Figure 5It is a software principle diagram of a page display method provided in an embodiment of the present application;
[0069] Figure 6 is a structural block diagram of a page display device provided in an embodiment of the present application;
[0070] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0072] The page display method in the embodiment of the present application is described in detail below.
[0073] Figure 1 is a flow chart of the steps of a page display method provided by an embodiment of the present application, such as Figure 1 As shown, the method may include:
[0074] Step 101, in response to a display instruction for a target page in a Flutter application, obtain a component file of the target page from a server, where the component file includes at least: component construction information, a data interface address, and a binding relationship between component data and page objects.
[0075] In the embodiment of the present application, Flutter is a cross-platform mobile terminal development framework, and the development language adopts DART, which supports Android, iOS, Web and other operating systems. However, for security reasons, Flutter itself does not provide the function of dynamically generating pages, and the embodiment of the present application is aimed at this defect, and realizes the dynamic generation of pages in applications developed based on Flutter. The display instruction can be an instruction generated by the user by inputting into the Flutter application to trigger the process of displaying the target page. The display instruction can also be an instruction for the process of automatically triggering the display of the target page by the application itself or the system during the operation of the Flutter application. Component construction information refers to all the information required to build a component hierarchy tree, such as component style elements, display location, display conditions, etc. Here, the component refers to the page component contained in the page. The data interface address refers to the address of the data interface used to provide component data, and the data interface can be called to obtain component data by accessing the data interface address. The binding relationship between component data and page objects can be composed of a URL (uniform resource locator) and JsonPath (a variable used to parse JSON format data). The URL is the data interface address, and JsonPath is used to describe the path for the page object to query the required data in the component data, thereby realizing the binding relationship between component data and page objects.
[0076] In actual applications, if the client of the Flutter application receives a display instruction for the target page, the Flutter application will automatically send a request to the server to obtain the component file. After verifying the identity of the client, the server will respond to the acquisition request and send the component file of the target page to the client of the Flutter application so that the client can continue to execute the display process of the target page.
[0077] Step 102: Acquire component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information.
[0078] In an embodiment of the present application, the client of the application calls the data interface related to the target page in the server by accessing the data interface address, so that the server generates component data and provides it to the client, thereby realizing dynamic acquisition of component data by the client of the application. The client of the application builds a hierarchical tree of component objects in the target page based on the component construction information, thereby generating component objects in the target page. The component object can be a widget in the target page, which is used to implement page style functions such as clocks, lists, and floating boxes. The construction process of the component object can refer to the existing conventional component construction method, which will not be repeated here. The main feature of the embodiment of the present application is to obtain component construction information from the server when the page is displayed, thereby realizing dynamic acquisition of component construction information.
[0079] Step 103: Merge the component data into corresponding component objects according to the binding relationship to construct the target page.
[0080] In an embodiment of the present application, the component object corresponding to each component data can be queried based on the binding relationship in the component file, and the target page is dynamically generated by mapping the component data to the component object, thereby realizing the dynamic layout of the page content. When the page in the Flutter application is updated, there is no need to re-release a new application version to update the component file in the page. The target page displayed in English can be dynamically generated based on the component file obtained in real time.
[0081] Step 104: display the target page.
[0082] In an embodiment of the present application, after the target page is built, the client of the Flutter application renders the target page and displays it on the display screen of the device where the client is located to achieve dynamic update of the content of the target page.
[0083] A page display method provided in an embodiment of the present application realizes dynamic acquisition of page layout by constructing a target page by acquiring a page file used to construct the target page from a client when a Flutter application needs to display the target page, and also realizes dynamic acquisition of page content by binding between component objects and component data in the page, so that the page displayed by the Flutter application can be updated more efficiently.
[0084] Figure 2 is a flowchart of another page display method provided by an embodiment of the present application. Figure 2 As shown, the method may include:
[0085] Step 201, in response to a display instruction for a target page in a Flutter application, a component file of an AST data structure is obtained from a server, wherein the component file is obtained by converting a component file of a DART language into a JSON format using a language analyzer.
[0086] In an embodiment of the present application, the developer of the Flutter application can first design and develop the component files of the target page based on the DART language, and then use the language analyzer (analyzer tool) provided by the DART language to convert the DART language into an AST data structure and then save it in JSON format and upload it to the server for storage, so that the client of the Flutter application can request to obtain it when displaying the target page.
[0087] Step 202, parse the component file according to the parsing rules of the AST data structure to obtain the component construction information, data interface address, component data and binding relationship between page objects of the target page.
[0088] In an embodiment of the present application, the client of the Flutter application has a built-in parser for the AST (Abstract Syntax Tree) data structure, which can parse the component file according to the AST parsing rules to obtain the component construction information, data interface address, component data and page object binding relationship that can be used by the client.
[0089] Step 203: Acquire component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information.
[0090] This step can refer to the detailed description of step 102 and will not be repeated here.
[0091] Step 204: merge the component data into the corresponding component object according to the binding relationship to construct the target page.
[0092] This step can refer to the detailed description of step 103 and will not be repeated here.
[0093] Step 205: display the target page.
[0094] This step can refer to the detailed description of step 104 and will not be repeated here.
[0095] Optionally, the update instruction at least includes: a target operation type, and the page update strategy includes: a correspondence between an operation type and an address character.
[0096] Step 206 : In response to the update instruction for the target page, replace the replacement symbol in the data interface address according to the page update policy corresponding to the target page.
[0097] In the embodiment of the present application, the update instruction is an instruction for instructing to update the content layout of the target page. For page update processes such as paging or page turning, the data interface address can be updated by adding a special replacement symbol to the data interface address.
[0098] Optionally, refer to Figure 3 , the step 206 may include:
[0099] Sub-step 2061 , in response to an update instruction for the target page, obtaining a target address character corresponding to the target operation type according to the page update policy.
[0100] In an embodiment of the present application, the target operation type is descriptive information used to characterize the generation method of generating the update instruction, such as generated by the user based on input such as click, long press, and sliding, or triggered by the system. According to different operation types, the client of the Flutter application pre-stores the corresponding target address string. The page update strategy can be set in the client by pre-setting it in the installation package of the Flutter application, or it can be obtained by the client in advance from the server. It can be set according to actual needs and is not limited here.
[0101] Sub-step 2062, replacing the replacement character in the data interface address with the target address character.
[0102] In the embodiment of the present application, for example, dat? page=\$page_index is the data interface address before the update. When the data of page 3 is to be loaded, the bound data interface address is replaced and expanded to an address similar to http: / / ***.com / data? page=3 by replacing the replacement symbol. Of course, this is only an exemplary description, and the specific setting can be based on actual needs, and is not limited here.
[0103] In the embodiment of the present application, a page update strategy for the data interface address is built into the client of the Flutter application to realize dynamic update of the data interface address, without the need to obtain the required data interface address from the server every time, thereby improving the efficiency of page content update.
[0104] Step 207, obtaining updated data according to the replaced data interface address.
[0105] In the embodiment of the present application, the updated data of the page content that needs to be updated can be obtained by using the replaced data interface address.
[0106] Step 208: merge the update data with the component data to obtain merged data.
[0107] In the embodiment of the present application, by merging the update data with the previously acquired component data, the loading process of the content in the target page can be implemented, so that the user can view more page content at the same time through the target page.
[0108] Step 209: re-execute the target page construction process according to the merged data to obtain an updated target page.
[0109] In an embodiment of the present application, by reconstructing the target page through the merged data obtained by merging, a target page containing more page content can be obtained. The process of constructing the updated target page through merging the data is similar to the page construction process in steps 203 to 204, and will not be repeated here.
[0110] Step 210: display the updated target page.
[0111] The embodiment of the present application updates the target page by reconstructing the page based on the updated data obtained from the replaced data interface address, without the need to re-obtain component files from the server each time, thereby improving the efficiency of page updates.
[0112] Optionally, refer to Figure 4 After step 210, the method further includes:
[0113] Step 211, storing the target page before updating in the local cache.
[0114] Step 212: when a switch instruction for the target page before updating is received within a preset time period, the target page before updating is obtained from the local cache for display.
[0115] Step 213: when no switching instruction for the target page before updating is received within a preset time period, deleting the target page before updating in the local cache.
[0116] In an embodiment of the present application, since each page construction consumes data processing resources of a certain device, and the user can repeatedly view the target page that has been displayed, the target page before the update can be stored in the cache of the device for a preset time period after the page is updated. The preset time period can be 20s, 1min, 5min, etc. When the target page before the update needs to be redisplayed, it does not need to be rebuilt, but can be directly read from the local cache for display, saving the data processing resources required for building the page. Of course, considering the storage resource limitations of the device, if the target page before the update does not need to be displayed after the preset time period, the target page in the cache can be directly cleared to ensure that the caching process of the target page does not take up too much data storage resources, and the application can run normally.
[0117] Optionally, when the target page is a list page, the page object includes: list entries. The step 204 may include: adding the component data to the corresponding list entries according to the binding relationship to construct the list page.
[0118] In the embodiment of the present application, for the entire ListView (list page), its component object is a group of list items. For each list item, the serial number of the list item can be added to the JsonPath to implement data binding. For example, for the third data, its corresponding JsonPath can be $['data'][3]['name']. Of course, this is just an exemplary description. The correspondence between the list item and the component data can be set according to actual needs, which is not limited here.
[0119] Reference Figure 5 In actual applications, developers implement local development of applications by writing Flutter code, and then store the developed applications and component files in the form of JSON files with AST data structures in a cloud server connected to the network. This allows users to download and install Flutter applications from cloud services through their devices. The client can be based on operating systems such as Android and IOS. When the client needs to display the interface, it downloads the component file from the cloud server and obtains the dynamic page content based on the binding relationship in the component file after AST parsing, thereby realizing dynamic update of the target page in the Flutter application.
[0120] Another page display method provided in an embodiment of the present application realizes dynamic acquisition of page layout by constructing a target page by acquiring a page file used to construct the target page from a client when the Flutter application needs to display the target page, and also realizes dynamic acquisition of page content by binding between component objects and component data in the page, so that the page displayed by the Flutter application can be updated more efficiently.
[0121] Figure 6 is a structural block diagram of a page display device 30 provided in an embodiment of the present application, such as Figure 4 As shown, the device 30 may include:
[0122] The acquisition module 301 is configured to obtain a component file of the target page from a server in response to a display instruction for the target page in the Flutter application, wherein the component file includes at least: component construction information, a data interface address, and a binding relationship between component data and page objects;
[0123] A preparation module 302 is configured to obtain component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information;
[0124] A construction module 303 is configured to merge the component data into corresponding component objects according to the binding relationship to construct the target page;
[0125] The display module 304 is configured to display the target page.
[0126] Optionally, the device further includes: an updating module configured to:
[0127] In response to an update instruction for the target page, replacing the replacement symbol in the data interface address according to a page update policy corresponding to the target page;
[0128] Get updated data according to the replaced data interface address;
[0129] Re-execute the target page construction process according to the updated data to obtain an updated target page;
[0130] The updated target page is displayed.
[0131] Optionally, the update instruction includes at least: a target operation type, and the page update strategy includes: a correspondence between an operation type and an address character;
[0132] Optionally, the update module is further configured to:
[0133] Acquire the target address character corresponding to the target operation type according to the page update strategy;
[0134] The replacement characters in the data interface address are replaced with the target address characters.
[0135] Optionally, the update module is further configured to:
[0136] Merging the update data with the component data to obtain merged data;
[0137] The target page construction process is re-executed according to the merged data to obtain an updated target page.
[0138] The update module is further configured to:
[0139] Store the target page before updating in the local cache;
[0140] When a switch instruction for the target page before the update is received within a preset time period, the target page before the update is obtained from the local cache for display;
[0141] When no switching instruction for the target page before updating is received within a preset time period, the target page before updating in the local cache is deleted.
[0142] Optionally, the acquisition module 301 is further configured to:
[0143] Obtain a component file of an AST data structure from a server, wherein the component file is obtained by converting a component file of a DART language into a JSON format using a language analyzer;
[0144] The component file is parsed according to the parsing rules of the AST data structure to obtain the component construction information, data interface address, component data and binding relationship between page objects of the target page.
[0145] Optionally, when the target page is a list page, the page object includes: a list entry;
[0146] The construction module 303 is further configured to:
[0147] The component data is added to the corresponding list entry according to the binding relationship to construct the list page.
[0148] The page display device provided in the embodiment of the present application has a functional module corresponding to the execution of the page display method, and can execute the page display method provided in any one of the embodiments 1 to 9 of the present application, and can achieve the same beneficial effects.
[0149] In another embodiment provided by the present application, an electronic device is also provided. The electronic device may include: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process of the above-mentioned page display method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here. For example, Figure 7 As shown, the electronic device may specifically include: a processor 401, a storage device 402, a display screen 403 with a touch function, an input device 404, an output device 405, and a communication device 406. The number of processors 401 in the electronic device may be one or more. Figure 7 A processor 401 is taken as an example. The processor 401, storage device 402, display screen 403, input device 404, output device 405 and communication device 406 of the electronic device can be connected via a bus or other means.
[0150] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the page display method described in any one of the above embodiments.
[0151] In another embodiment provided by the present application, a computer program product including instructions is also provided, and when the computer program product is run on a computer, the computer executes the page display method described in any one of the above embodiments.
[0152] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0153] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A page display method, characterized in that: The method comprises: In response to a display instruction for a target page in a Flutter application, a component file of an AST data structure is obtained from a server, wherein the component file is obtained by converting a component file of a DART language into a JSON format using a language analyzer; the component file is parsed according to a parsing rule of the AST data structure to obtain component construction information, a data interface address, and a binding relationship between component data and a page object of the target page; the component file at least includes: component construction information, a data interface address, and a binding relationship between component data and a page object; Acquire component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information; Merging the component data into corresponding component objects according to the binding relationship to construct the target page; Display the target page; In response to an update instruction for the target page, replacing the replacement symbol in the data interface address according to a page update policy corresponding to the target page; Get updated data according to the replaced data interface address; Re-execute the target page construction process according to the updated data to obtain an updated target page; Displaying the updated target page; The update instruction at least includes: a target operation type, and the page update strategy includes: a correspondence between an operation type and an address character; The replacing the replacement symbol in the data interface address according to the page update strategy corresponding to the target page includes: Acquire the target address character corresponding to the target operation type according to the page update strategy; The replacement characters in the data interface address are replaced with the target address characters.
2. The method according to claim 1, characterized in that The re-executing the target page construction process according to the updated data to obtain the updated target page includes: Merging the update data with the component data to obtain merged data; The target page construction process is re-executed according to the merged data to obtain an updated target page.
3. The method according to claim 1, characterized in that: After displaying the updated target page, the method further includes: Store the target page before updating in the local cache; When a switch instruction for the target page before the update is received within a preset time period, the target page before the update is obtained from the local cache for display; When no switching instruction for the target page before updating is received within a preset time period, the target page before updating in the local cache is deleted.
4. The method according to claim 1, characterized in that: When the target page is a list page, the page object includes: list entries; The step of merging the component data into corresponding component objects according to the binding relationship to construct the target page includes: The component data is added to the corresponding list entry according to the binding relationship to construct the list page.
5. A page display device using the page display method according to any one of claims 1 to 4, characterized in that: The device comprises: An acquisition module is configured to, in response to a display instruction for a target page in a Flutter application, acquire a component file of the target page from a server, wherein the component file includes at least: component construction information, a data interface address, and a binding relationship between component data and a page object; a preparation module, configured to obtain component data of the target page according to the data interface address, and construct a component object of the target page according to the component construction information; A construction module, configured to merge the component data into corresponding component objects according to the binding relationship to construct the target page; The display module is configured to display the target page.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the page display method according to any one of claims 1 to 4 are implemented.
7. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the page display method according to any one of claims 1 to 4 when executing the program.
Citation Information
Patent Citations
Page updating method and device
CN111475757A