Page refresh method, device, computer equipment and storage medium
By determining the identification and path information of the page entity module, data is updated only for the modules that need to be updated, which solves the performance impact and resource waste problems caused by the overall page refresh in the existing technology and achieves more efficient page refresh.
Patent Information
- Application Number
- CN202111515530.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Existing page refresh technology requires reloading the entire page, resulting in performance impact and resource waste, and is unable to flexibly and synchronously update changes in sub-modules at the same level.
By determining the identifier of the refreshed page entity module, the identifier and path information of the page entity module to be refreshed are determined based on the identifier, and data is only updated for the module that needs to be updated to avoid overall reconstruction.
It improves the page refresh speed, reduces unnecessary resource waste, and enhances the flexibility and efficiency of page refresh, especially in the linked refresh of pages with multi-level layouts.
Smart Images

Figure CN114201707B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of page display technology, and in particular to a page refresh method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] With the development of web page display technology, page refresh technology has emerged. Refresh refers to the process of correcting data after entering new data. Page refresh technology provides a "refresh button" or "pull-down refresh" method on the page, allowing users to manually refresh the entire page, thereby generating a certain instruction to refresh the entire page based on the instruction.
[0003] However, the current traditional method is to refresh the entire page, which requires reloading all data in the page and recreating each object. Refreshing the entire page will affect the overall performance and cause unnecessary waste of resources. Summary of the Invention
[0004] Based on this, it is necessary to provide a page refresh method, apparatus, computer device, computer-readable storage medium and computer program product that can efficiently update data in response to the above technical problems.
[0005] In a first aspect, the present application provides a page refresh method, the method comprising:
[0006] In response to a page refresh instruction, determining an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0007] Based on the identifier of the refreshed page entity module, determining the identifier of the corresponding page entity module to be refreshed;
[0008] Determine path information of the entity module of the page to be refreshed, wherein the path information is used to determine the location of the entity module of the page to be refreshed;
[0009] Based on the path information, the updated data is applied to refresh the data of the page entity module to be refreshed.
[0010] In one embodiment, the step of generating the refreshed page entity module includes:
[0011] Determine metadata, and generate an initial page entity module based on the metadata, wherein the initial page entity module includes an identifier of the initial page entity module and business data;
[0012] Detecting a business data update instruction, determining a target page entity module in the initial page entity module, wherein the identifier of the target page entity module is the identifier of the refreshed page entity module;
[0013] Based on the business data update instruction, the business data of the target page entity module is updated, and the updated business data is the updated data.
[0014] In one embodiment, after generating the initial page entity module based on the metadata, the method further includes:
[0015] Determine an initial entity jump path for jumping from a preset page to the initial page entity module, wherein the initial entity jump path is used to determine the position of the initial page entity module;
[0016] The initial physical jump path is stored in the page cache of the preset page.
[0017] In one embodiment, determining the identifier of the corresponding to-be-refreshed page entity module based on the identifier of the refreshed page entity module includes:
[0018] Determine target metadata corresponding to the refreshed page entity module, where the target metadata is used to generate an identifier and business logic of the refreshed page entity module;
[0019] In the page cache, the unupdated page entity module generated by the target metadata is determined, and the identifier of the unupdated page entity module is determined as the identifier of the page entity module to be refreshed.
[0020] In one embodiment, determining the path information of the entity module of the page to be refreshed includes:
[0021] Determining a preset page for jumping to the refreshed page entity module, the preset page including a page cache;
[0022] A target entity jump path from the preset page to the entity module of the page to be refreshed is determined from the page cache, and the target entity jump path is used to determine the position of the entity module of the page to be refreshed relative to the preset page entity module.
[0023] In one embodiment, the refreshed page entity module is embedded in the current page, the to-be-refreshed page entity module is embedded in the to-be-displayed page, and both the current page and the to-be-displayed page are pages of a target program. Based on the path information, applying the updated data to refresh the data of the to-be-refreshed page entity module includes:
[0024] Detecting the current page close instruction, and determining the location of the to-be-refreshed page entity module based on the path information in the page cache of the homepage of the target program;
[0025] In the page to be displayed, based on the updated data and the position of the entity module of the page to be refreshed, the data in the entity module of the page to be refreshed is updated.
[0026] In one embodiment, the refreshed page entity module is located on the parent page, and the to-be-refreshed page entity module is located on the child page;
[0027] The applying the updated data to refresh the data of the to-be-refreshed page entity module based on the path information includes:
[0028] Determining the location of the page entity module to be refreshed based on the path information in the page cache of the parent page;
[0029] In the sub-page, based on the updated data and the position of the entity module of the page to be refreshed, the data of the entity module of the page to be refreshed in the sub-page is refreshed.
[0030] In a second aspect, the present application further provides a page refresh device, the device comprising:
[0031] a refreshed entity determination module, configured to determine, in response to a page refresh instruction, an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0032] An identification determination module, configured to determine an identification of a corresponding entity module of a page to be refreshed based on the identification of the entity module of the refreshed page;
[0033] A location determination module, configured to determine path information of a page entity module to be refreshed, wherein the path information is used to determine the location of the page entity module to be refreshed;
[0034] A data refresh module is used to apply the updated data to refresh the data of the page entity module to be refreshed based on the path information.
[0035] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0036] In response to a page refresh instruction, determining an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0037] Based on the identifier of the refreshed page entity module, determining the identifier of the corresponding page entity module to be refreshed;
[0038] Determine path information of the entity module of the page to be refreshed, wherein the path information is used to determine the location of the entity module of the page to be refreshed;
[0039] Based on the path information, the updated data is applied to refresh the data of the page entity module to be refreshed.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0041] In response to a page refresh instruction, determining an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0042] Based on the identifier of the refreshed page entity module, determining the identifier of the corresponding page entity module to be refreshed;
[0043] Determine path information of the entity module of the page to be refreshed, wherein the path information is used to determine the location of the entity module of the page to be refreshed;
[0044] Based on the path information, the updated data is applied to refresh the data of the page entity module to be refreshed.
[0045] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0046] In response to a page refresh instruction, determining an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0047] Based on the identifier of the refreshed page entity module, determining the identifier of the corresponding page entity module to be refreshed;
[0048] Determine path information of the entity module of the page to be refreshed, wherein the path information is used to determine the location of the entity module of the page to be refreshed;
[0049] Based on the path information, the updated data is applied to refresh the data of the page entity module to be refreshed.
[0050] The above-mentioned page refresh method, apparatus, computer equipment, storage medium and computer program product determine the identifier of the refreshed page entity module, and based on the identifier of the refreshed page entity module, determine the identifier of the corresponding page entity module to be refreshed; determine the path information of the page entity module to be refreshed, and the path information is used to determine the location of the page entity module to be refreshed; based on the path information, use the refreshed page entity module to carry the updated data to refresh the data of the page entity module to be refreshed. Thus, the page entity module is used as a specific refresh unit, and the location of the page entity module to be refreshed is determined by the path information of the page entity module to be refreshed, thereby decoupling the complete page into individual page entity modules. After a certain data is updated, the data is updated in units of page entity modules, rather than relying on the modified data in the database to recreate the entity, thereby improving the speed of page refresh. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A diagram showing an application environment of a page refresh method in one embodiment;
[0052] Figure 2 Schematic diagram of a page refresh method according to an embodiment;
[0053] Figure 3 A schematic diagram of a process for generating a refreshed page entity module in one embodiment;
[0054] Figure 4 A schematic diagram of a process for generating path information in another embodiment;
[0055] Figure 5 A schematic diagram of a process for determining an identifier of an entity module of a page to be refreshed in another embodiment;
[0056] Figure 6 A schematic diagram of a process for determining path information of an entity module of a page to be refreshed in another embodiment;
[0057] Figure 7 is a schematic diagram of a process for updating data in another embodiment;
[0058] Figure 8 is a schematic diagram of a process for updating data in another embodiment;
[0059] Figure 9 A structural block diagram of a path of a page entity in another embodiment;
[0060] Figure 10 A schematic diagram of a flow chart of path information in a page cache of a home page in another embodiment;
[0061] Figure 11 This is a flow chart of entering page A from the home page in another embodiment;
[0062] Figure 12 This is a flow chart of how page A enters page E in another embodiment;
[0063] Figure 13 This is a structural block diagram of a page refresh device in one embodiment;
[0064] Figure 14 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0065] Traditionally, manual global refresh can be used. However, this requires the user to manually trigger the refresh, impacting the user's interactive experience with the program. Refreshing the entire page can also affect overall performance, resulting in unnecessary resource waste. Automatic global refresh can also be used, but this also affects overall performance and wastes resources. When sub-modules at the same level change, it's not possible to synchronize updates to only the associated sub-modules, making the overall refresh mechanism inflexible.
[0066] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0067] The page refresh method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers. The embodiment of the present application can be implemented by the terminal 102, or it can be implemented by the terminal 102 and the server 104 in collaboration.
[0068] In one embodiment, Figure 2 As shown, a page refresh method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:
[0069] Step 202: In response to the page refresh instruction, determine the identifier of the refreshed page entity module, which carries updated data.
[0070] A page entity module, used for inputting, debugging, controlling, and / or displaying certain information, is a data structure generated based on stored data. This data structure can be an element of a page or the page itself. For example, in terminals like personal computers and smart TVs, where larger pages are required, the page entity module is often just an element of the page. In contrast, in terminals like smartphones and smartwatches, where smaller pages are required, the page entity module can be treated as a separate page.
[0071] In an optional embodiment, after the user performs a certain operation on the terminal, a page refresh instruction will be generated. The page refresh instruction carries the user's input data. After the data is entered, the current page will be refreshed. If the input data updates certain data corresponding to a certain page entity module, the updated data will be obtained, and it is determined that the page entity module has been refreshed.
[0072] In an optional embodiment, when a user uses a terminal to browse data, the data in the refreshed page entity module is added or modified based on factors such as effectiveness, thereby determining the refreshed page entity module; for example: when multiple parties cooperate to assist in processing a document page, after a user modifies a certain data in the page, the pages of other users can be updated synchronously.
[0073] Step 204: Based on the identifier of the refreshed page entity module, determine the identifier of the corresponding page entity module to be refreshed.
[0074] The page entity module to be refreshed is a page entity module that has a corresponding relationship with the refreshed entity. The page entity module to be refreshed can be a separate page, a portion of a page, a portion of a group of pages, or a series of pages. The identifiers of the refreshed page entity module, the identifiers of the page entity module to be refreshed, and the corresponding relationship between the two are all stored in the page cache.
[0075] In an optional embodiment, determining the identification of the corresponding page entity module to be refreshed based on the identification of the refreshed page entity module is an iterative or recursive process. After a page entity module to be refreshed updates its data, it will also identify a combination of certain related data to form a chain to facilitate this process.
[0076] In an optional embodiment, there is an association relationship between the identifier of the refreshed page entity module and the identifier of the to-be-refreshed page entity module. The association relationship can be represented by a mapping table or the like, and the association relationship can be established based on a certain type of data. When the refreshed page entity module and the to-be-refreshed page entity module correspond to the same type of data, the identifier of the corresponding to-be-refreshed page entity module can be determined based on the identifier of the refreshed page entity module; if the refreshed page entity module and the to-be-refreshed page entity module are generated based on the same metadata, there is a mapping relationship between the identifier of the refreshed page entity module and the identifier of the to-be-refreshed page entity module; it can be generated by filling in the same or corresponding data template.
[0077] Step 206: Determine the path information of the entity module of the page to be refreshed. The path information is used to determine the location of the entity module of the page to be refreshed.
[0078] In an optional embodiment, the path information is stored in the page cache and changes as more pages are added. Because it is difficult for a computer to determine the pages a user accesses and the order in which they are accessed, in most cases, the order in which a user opens pages is unpredictable, which in turn causes the positional relationships between the various page entity modules to change synchronously. Therefore, in some cases, it is necessary to specifically determine the path information of the page entity modules to be refreshed in order to determine the data to be updated.
[0079] In an optional embodiment, the path information is the path information of the entity module of the page to be refreshed relative to the preset page, and when jumping between the entity module of the page to be refreshed and the preset page, the jumping order of the page entity modules passed through constitutes the path information of the entity module of the page to be refreshed, and the position of the entity module of the page to be refreshed relative to the preset page can be determined by the jumping order of the page entity modules passed through. Among them, the path information is stored in the page cache of the preset page, and the preset page can be selected as the page that is least likely to be closed in the program; the preset page can be the homepage of a program, and the homepage can jump to each page of the program. On the one hand, each page of the program can be jumped to through the homepage, which is not easy to omission or bug. On the other hand, some programs will release the page cache of the homepage after closing, and it is not easy for the path information to become invalid due to the generation or cancellation of other page entity modules.
[0080] Step 208: Based on the path information, apply the updated data to refresh the data of the page entity module to be refreshed.
[0081] In an optional implementation, the refreshed page entity module and the to-be-refreshed page entity module are located in the same page. After the refreshed page entity module updates the data, the to-be-refreshed page entity module will also be updated synchronously, thereby ensuring user experience and data consistency.
[0082] In an optional implementation, the refreshed page entity module and the to-be-refreshed page entity module are located on different pages. After the refreshed page entity module has updated its data, the to-be-refreshed page entity module can be updated synchronously. Alternatively, in order to avoid an excessively large budget, the page where the to-be-refreshed page entity module is located can be updated after the page where the refreshed page entity module is located is closed.
[0083] In the above page refresh method, the identifier of the refreshed page entity module is determined, and based on the identifier of the refreshed page entity module, the identifier of the corresponding page entity module to be refreshed is determined; the path information of the page entity module to be refreshed is determined, and the path information is used to determine the location of the page entity module to be refreshed; based on the path information, the refreshed page entity module is used to carry the updated data to refresh the data of the page entity module to be refreshed. Thus, the page entity module is used as a specific refresh unit, and the location of the page entity module to be refreshed is determined by the path information of the page entity module to be refreshed, thereby decoupling the complete page into individual page entity modules. After a certain data is updated, the data is updated in units of page entity modules, rather than relying on the modified data in the database to recreate the entity, thereby improving the speed of page refresh.
[0084] By reducing the overall layout granularity of each page, we can flexibly manage each "minimum layout unit," synchronizing updates only for modules that need to be updated, reducing the coupling between sub-modules and avoiding the performance waste caused by excessive and unnecessary synchronization. This method is particularly effective when refreshing pages in a multi-level layout.
[0085] In one embodiment, Figure 3 As shown, the steps for generating the refreshed page entity module include:
[0086] Step 302: determine metadata, and generate an initial page entity module based on the metadata. The initial page entity module includes an identifier of the initial page entity module and business data.
[0087] Metadata is the data used to generate the initial page entity module. It can also be called descriptive data or data template. Metadata is used to describe the data structure, business logic, business data and other data of other data in order to build the required page entity module.
[0088] In an optional embodiment, when a page display instruction is detected, the page to be displayed is determined from the page display instruction, and then an initial page entity module is generated based on the metadata corresponding to the page to be displayed. In the process of generating the initial page entity module, an identifier and business data of the initial page entity module are generated; the identifier of the initial page entity module is an identifier corresponding to the initial page entity module, which is used to represent a certain initial page entity module. It should be noted that when the same metadata is used to generate the initial page entity module, the content and style displayed by multiple initial page entity modules may be consistent, but each initial page entity module has its own identifier, so as to facilitate the determination of the path information of each initial page entity module and directly update the data in the page entity module.
[0089] Step 304: Detect the business data update instruction, determine the target page entity module in the initial page entity module, and the identifier of the target page entity module is the identifier of the refreshed page entity module.
[0090] Step 306: Based on the business data update instruction, the business data of the target page entity module is updated, and the updated business data is the updated data.
[0091] In this embodiment, the initial page entity module is constructed through metadata. When the business data is updated, the data in the initial page entity module is directly updated instead of modifying the data in a data storage device such as a database. As a result, the page entity module can be displayed more quickly, and the updated page entity module can be obtained, thereby improving the speed of page data loading.
[0092] In one embodiment, Figure 4 As shown, after generating the initial page entity module based on the metadata, the method further includes:
[0093] Step 402: determining an initial entity jump path from a preset page to an initial page entity module, wherein the initial entity jump path is used to determine a location of the initial page entity module;
[0094] The initial entity jump path is based on one instruction after another. In the process of jumping from the preset page to the initial page entity module, the various page entity modules passed through and the order of passing through each page entity module are related to the order of the terminal display pages. Since the order of the terminal display pages is generated based on the instructions triggered by the user, the initial entity jump paths are also determined based on the instructions triggered by the user.
[0095] In an optional embodiment, the preset page is the parent page of the initial page entity module, the initial page entity module is the child page of the preset page, and the initial page entity module is displayed based on the initial page. After receiving the display instruction of the initial page entity module, a title or character in the preset page establishes a data dependency relationship based on the mapping relationship, thereby generating the initial page entity module. For example, after a program is started, the homepage as the preset page will be displayed. The homepage includes the initial page entity module. At this time, the initial entity jump path can only include the initial page entity module in the initial page. For another example, after the homepage is displayed, in response to a certain instruction, a page of the next level will be formed on the homepage; if the page of the next level is the initial page entity module, then the initial entity jump path is: the path from the homepage to this page can include the homepage and the initial page; if the page of the next level includes the initial page entity module, then the initial entity jump path can be to jump from the homepage to the page of the next level, and then jump from the page of the next level to the initial page entity module.
[0096] Step 404: store the initial physical jump path in the page cache of the preset page.
[0097] In this embodiment, by setting the initial entity jump path, the location of the initial page entity module can be determined more conveniently, and the initial entity jump path is stored in the page cache of the preset page because each initial page entity module is obtained based on the preset page jump, and after browsing the initial page entity module, the initial page entity module will be destroyed. Therefore, page caching based on the preset page can increase the stability of the path information, reduce the possibility of errors caused by the initial entity jump path, and thereby improve the efficiency of the page entity module display.
[0098] In one embodiment, Figure 5 As shown, based on the identifier of the refreshed page entity module, determining the identifier of the corresponding to-be-refreshed page entity module includes:
[0099] Step 502: Determine the target metadata corresponding to the refreshed page entity module. The target metadata is used to generate the identifier and business logic of the refreshed page entity module.
[0100] The target metadata is one or more metadata selected from the metadata collection, and is used to generate an identifier for the refreshed page entity module and its business logic. In an optional embodiment, the refreshed page entity module is derived based on the initial page entity module and updated data. The refreshed page entity module uses the identifier and business logic of the initial page entity module, but only updates the business data.
[0101] In an optional implementation, there is a data dependency between the refreshed page entity module and the target metadata. After the refreshed page entity module is updated using the data in the refresh instruction, the corresponding business data portion of the target metadata will be updated, but the relationship between the target metadata and the generated page entity module will not be changed. In order to further increase the update speed, only the data is modified, rather than directly destroying the generated page entity module, and then updating based on the updated target metadata.
[0102] Step 504 : determining in the page cache the unupdated page entity module generated by the target metadata, and determining the identifier of the unupdated page entity module as the identifier of the page entity module to be refreshed.
[0103] In this embodiment, a corresponding relationship is constructed through the target metadata to directly determine the generated non-updated page entity module, but the target metadata will not be directly used to reconstruct the non-updated page entity module, which improves the flexibility of the data synchronization refresh mechanism, facilitates the expansion of pages, and thereby enhances the update efficiency of the page.
[0104] In one embodiment, Figure 6 As shown, the path information of the entity module of the page to be refreshed includes:
[0105] Step 602: Determine a preset page for jumping to the refreshed page entity module, where the preset page includes a page cache.
[0106] Step 604: Determine a target entity jump path from the preset page to the entity module of the page to be refreshed from the page cache. The target entity jump path is used to determine the position of the entity module of the page to be refreshed relative to the preset page entity module.
[0107] In an optional implementation, the refreshed page entity module can be obtained based on multiple page jumps, and the to-be-refreshed page entity module can be obtained based on multiple page jumps, and both the refreshed page entity module and the to-be-refreshed page entity module are generated based on the same preset page. Before the preset page is destroyed, the page cache of the preset page always exists. Since both the refreshed page entity module and the to-be-refreshed page entity module have a certain data dependency relationship with the preset page, using the same preset page for data caching is not likely to cause data loss, and stability can be improved.
[0108] In this embodiment, the path information of the entity module of the page to be refreshed is stored through the page cache of the preset page, which can ensure that a variety of path information is stored in a unified manner, avoiding the loss of path information due to the creation and destruction of the refreshed page entity module or the page entity module to be refreshed, thereby ensuring the effect of page refresh.
[0109] In one embodiment, Figure 7 As shown, the refreshed page entity module is embedded in the current page, and the to-be-refreshed page entity module is embedded in the to-be-displayed page. Both the current page and the to-be-displayed page are pages of the target program. Based on the path information, the updated data is applied to refresh the data of the to-be-refreshed page entity module, including:
[0110] Step 702: Detect the current page close instruction, and determine the location of the page entity module to be refreshed based on the path information in the page cache of the target program's homepage.
[0111] In an optional implementation, the current page closing instruction is used as a refresh condition for the page entity modules in other pages, and the current page closing is used as a condition so that the page entity module to be refreshed corresponding to the refreshed page entity module will synchronously update the data; and then the path information is obtained from the page cache of the main page of the current page program, and the position of the page entity module to be refreshed relative to the homepage is determined based on the path information, which can be a link path or multiple link paths.
[0112] Step 704: In the page to be displayed, based on the updated data and the position of the entity module of the page to be refreshed, update the data in the entity module of the page to be refreshed.
[0113] In an optional embodiment, the data of the entity modules of the page to be refreshed can be updated based on the same updated data and the positions of multiple entity modules of the page to be refreshed; the data of the entity modules of the page to be refreshed can be updated based on the position of one entity module of the page to be refreshed based on multiple updated data; and the data can be updated based on the positions of the entity modules of the page to be refreshed corresponding to multiple updated data. It should be noted that during the update process, only the data of the entity to be updated is updated, rather than updating the data or rebuilding the entity of the entire page to be displayed, so as to reduce the computing power consumed by the update and thereby increase the speed of page refresh.
[0114] In one embodiment, Figure 8 As shown, the refreshed page entity module is located on the parent page, and the to-be-refreshed page entity module is located on the child page; based on the path information, applying the updated data to refresh the data of the to-be-refreshed page entity module includes:
[0115] Step 802: Determine the location of the page entity module to be refreshed based on the path information in the page cache of the parent page.
[0116] In an optional implementation, the parent page can be the program main page, or it can be a secondary main page generated based on the program main page. The secondary main page is used to represent a certain range of data in the program. Through the secondary main page, the total page cache of the program main page can be reduced, and the efficiency of data acquisition can be guaranteed when the number of pages is too large.
[0117] In an optional embodiment, the position of the entity module of the page to be refreshed may be the position of the entity module of the page to be refreshed relative to the parent page, and may be determined by the order of the pages and / or page entity modules passed through in the process of jumping from the parent page to the entity module of the page to be refreshed. The position of the entity module of the page to be refreshed may also be the position of the entity module of the page to be refreshed relative to other preset pages, or may be the position of the entity module of the page to be refreshed relative to the homepage of the target program.
[0118] Step 804 : In the sub-page, based on the updated data and the position of the page entity module to be refreshed, the data of the page entity module to be refreshed in the sub-page is refreshed.
[0119] In this embodiment, by setting the parent page and the child page, the page entity modules located on different pages can be better associated with each other, and the observer mode can indirectly improve the page refresh efficiency.
[0120] The above embodiments focus on the description of the innovative points of the present application. In order to more clearly understand the overall picture of the present application, you can refer to the present embodiments. Figure 9 As shown, the page entity module is referred to as module for short. When each module page is initialized, the pageId of all its sub-module pages will be registered in the pageCache of the top-level page according to the path link of its sub-page module. When an operation or change occurs in a sub-module, the [sub-module path chain] and [module page pageId] of the "associated sub-module" in the upper parent page are registered in the pageCache of the current page. When the current page is closed, a unified synchronous refresh is performed; for sub-modules in the same-level page, after the operation and change, the associated sub-modules are synchronously updated; as shown in the following example: Figure 10 As shown, the page cache of the home page includes an initialization path, which is the initial entity jump path. When the page and page entity modules are generated, the initialization path corresponding to the home page will be included; and in the secondary main page, the corresponding initialization path can also be included.
[0121] This resolves the impact on the interactive experience caused by the "manual refresh" interaction method. By reducing the granularity of the overall page layout, the performance impact of refreshing the entire page using "automatic overall refresh" is effectively improved: when sub-modules at the same level change, the "associated sub-modules" can be updated synchronously in real time, while "unrelated sub-modules" will not be affected. When a sub-module changes, the "associated sub-modules" in the affected parent page are recorded in the pageCache of the current page. When the page is closed, the recorded modules are uniformly updated. This greatly improves the flexibility of the "data synchronization refresh mechanism" of the overall application page and also has good scalability for incremental pages and modules.
[0122] In an optional embodiment, if Figure 11 and Figure 12 As shown in the figure, a specific application scenario is described, in which clicking on module A on the homepage will get page A, and clicking on module A will lead to page E. The three sub-module pages of the hypothetical module a1, e1, and e4 marked with asterisks are interrelated, and the order of opening the pages is from the homepage to page A and then to page E. When the sub-module entities in the three pages are initialized, they will automatically register their page module paths and page entity pageIds in the pageCache of the top-level homepage.
[0123] When an operation occurs in the e1 submodule page of the E page, the following steps are included:
[0124] (a) Obtain the pageId of the associated e4 submodule page in the same-level E page from the top-level homepage pageCache. After the operation of the e1 submodule in the E page is successful, the e4 submodule page in the E page is synchronously updated.
[0125] (b) Obtain the pageIds of the parent page homepage and the associated sub-module pages a1 and e4 in page A from the top-level homepage pageCache, and record their pageIds in the pageCache in page E.
[0126] (c) When the E page is closed, all associated sub-module pages in the parent page that need to be updated and recorded in the E page pageCache are updated synchronously.
[0127] Therefore, a registration configuration method is adopted to use a chain path method in the top-level page pageCache to centrally manage all sub-module pages. Each page uses the "observer mode" to record the parent sub-module pageId that needs to be updated synchronously when the current page is closed, and for the sub-modules at the same level, the synchronous update is triggered immediately. The layout granularity of each page is reduced, so that each "minimum layout unit" can be managed flexibly, and only the modules that need to be updated are updated synchronously, reducing the coupling between sub-modules, so as to avoid performance waste caused by excessive unnecessary synchronization. In the case of linked refresh of pages with multi-level layouts, the effect of this method is more obvious.
[0128] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiments of the present application also provide a page refresh device for implementing the page refresh method involved above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more page refresh device embodiments provided below can be referred to the limitations of the page refresh method above and will not be repeated here.
[0130] In one embodiment, Figure 13 As shown, a page refresh device is provided, the device comprising:
[0131] A refreshed entity determination module 1302 is configured to determine, in response to a page refresh instruction, an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data;
[0132] The identification determination module 1304 is used to determine the identification of the corresponding entity module of the page to be refreshed based on the identification of the entity module of the refreshed page;
[0133] A location determination module 1306 is configured to determine path information of a page entity module to be refreshed, wherein the path information is used to determine a location of the page entity module to be refreshed;
[0134] The data refresh module 1308 is used to apply the updated data to refresh the data of the page entity module to be refreshed based on the path information.
[0135] In one embodiment, the apparatus further includes a refreshed entity construction module, wherein the refreshed entity construction module includes:
[0136] An initial entity generating unit, configured to determine metadata and generate an initial page entity module based on the metadata, wherein the initial page entity module includes an identifier of the initial page entity module and business data;
[0137] An entity identifier generating unit, configured to detect a business data update instruction and determine a target page entity module in the initial page entity module, wherein the identifier of the target page entity module is the identifier of the refreshed page entity module;
[0138] A data updating unit is configured to update the business data of the target page entity module based on the business data updating instruction, wherein the updated business data is the updated data.
[0139] In one embodiment, the refreshed entity building module further includes:
[0140] An initial path determining unit, configured to determine an initial entity jump path from a preset page to the initial page entity module, wherein the initial entity jump path is used to determine a position of the initial page entity module;
[0141] The initial path storage unit is configured to store the initial physical jump path in the page cache of the preset page.
[0142] In one embodiment, the identification determination module 1304 includes:
[0143] a target metadata determining unit, configured to determine target metadata corresponding to the refreshed page entity module, wherein the target metadata is used to generate an identifier and business logic of the refreshed page entity module;
[0144] The corresponding relationship obtaining unit is used to determine the unupdated page entity module generated by the target metadata in the page cache, and determine the identifier of the unupdated page entity module as the identifier of the page entity module to be refreshed.
[0145] In one embodiment, the location determination module 1306 includes:
[0146] a preset page determining unit, configured to determine a preset page for jumping to the refreshed page entity module, wherein the preset page includes a page cache;
[0147] The target entity jump path determination unit is used to determine the target entity jump path from the preset page to the page entity module to be refreshed from the page cache, and the target entity jump path is used to determine the position of the page entity module to be refreshed relative to the preset page entity module.
[0148] In one embodiment, the refreshed page entity module is embedded in the current page, the to-be-refreshed page entity module is embedded in the to-be-displayed page, and both the current page and the to-be-displayed page are pages of the target program. The data refresh module 1308 includes:
[0149] A first location determining unit is configured to detect the current page close instruction and determine the location of the to-be-refreshed page entity module based on the path information in the page cache of the homepage of the target program;
[0150] The first data updating unit is configured to update the data in the entity module of the page to be refreshed based on the updated data and the position of the entity module of the page to be refreshed in the page to be displayed.
[0151] In one embodiment, the refreshed page entity module is located in the parent page, and the to-be-refreshed page entity module is located in the child page; the data refresh module 1308 includes:
[0152] A second location determining unit, configured to determine the location of the to-be-refreshed page entity module based on path information in the page cache of the parent page;
[0153] The second position determining unit is configured to refresh the data of the to-be-refreshed page entity module in the sub-page based on the updated data and the position of the to-be-refreshed page entity module in the sub-page.
[0154] Each module in the above-mentioned page refresh device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0155] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 14As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a page refresh method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0156] Those skilled in the art will understand that Figure 14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0157] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0159] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0160] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0161] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0162] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A page refresh method, characterized in that: The method comprises: In response to a page refresh instruction, determining an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data; Based on the identifier of the refreshed page entity module, determining the identifier of the to-be-refreshed page entity module corresponding to the refreshed page entity module; Determining a preset page for jumping to the refreshed page entity module, the preset page including a page cache; determining a target entity jump path from the preset page to the entity module of the page to be refreshed from the page cache, the target entity jump path being used to determine a position of the entity module of the page to be refreshed relative to the preset page entity module, the target entity jump path being path information of the entity module of the page to be refreshed; the path information being used to determine the position of the entity module of the page to be refreshed; Based on the path information, the updated data is applied to refresh the data of the page entity module to be refreshed.
2. The method according to claim 1, characterized in that The steps of generating the refreshed page entity module include: Determine metadata, and generate an initial page entity module based on the metadata, wherein the initial page entity module includes an identifier of the initial page entity module and business data; Detecting a business data update instruction, determining a target page entity module in the initial page entity module, wherein the identifier of the target page entity module is the identifier of the refreshed page entity module; Based on the business data update instruction, the business data of the target page entity module is updated, and the updated business data is the updated data.
3. The method according to claim 2, characterized in that After generating the initial page entity module based on the metadata, the method further includes: Determine an initial entity jump path for jumping from a preset page to the initial page entity module, wherein the initial entity jump path is used to determine the position of the initial page entity module; The initial physical jump path is stored in the page cache of the preset page.
4. The method according to claim 1, wherein The determining, based on the identifier of the refreshed page entity module, the identifier of the corresponding to-be-refreshed page entity module includes: Determine target metadata corresponding to the refreshed page entity module, where the target metadata is used to generate an identifier and business logic of the refreshed page entity module; In the page cache, the unupdated page entity module generated by the target metadata is determined, and the identifier of the unupdated page entity module is determined as the identifier of the page entity module to be refreshed.
5. The method according to any one of claims 1 to 4, characterized in that The refreshed page entity module is embedded in the current page, the to-be-refreshed page entity module is embedded in the to-be-displayed page, the current page and the to-be-displayed page are both pages of a target program, and applying the updated data to refresh the data of the to-be-refreshed page entity module based on the path information includes: Detecting the current page close instruction, and determining the location of the to-be-refreshed page entity module based on the path information in the page cache of the homepage of the target program; In the page to be displayed, based on the updated data and the position of the entity module of the page to be refreshed, the data in the entity module of the page to be refreshed is updated.
6. The method according to any one of claims 1 to 4, characterized in that The refreshed page entity module is located on the parent page, and the to-be-refreshed page entity module is located on the child page; The applying the updated data to refresh the data of the to-be-refreshed page entity module based on the path information includes: Determining the location of the page entity module to be refreshed based on the path information in the page cache of the parent page; In the sub-page, based on the updated data and the position of the entity module of the page to be refreshed, the data of the entity module of the page to be refreshed in the sub-page is refreshed.
7. A page refresh device, characterized in that: The device comprises: a refreshed entity determination module, configured to determine, in response to a page refresh instruction, an identifier of a refreshed page entity module, the refreshed page entity module carrying updated data; an identification determination module, configured to determine, based on the identification of the refreshed page entity module, an identification of a corresponding to-be-refreshed page entity module corresponding to the refreshed page entity module; a position determination module, configured to determine a preset page for jumping to the refreshed page entity module, the preset page including a page cache; determine a target entity jump path from the preset page to the to-be-refreshed page entity module from the page cache, the target entity jump path being used to determine the position of the to-be-refreshed page entity module relative to the preset page entity module; the target entity jump path being path information of the to-be-refreshed page entity module, the path information being used to determine the position of the to-be-refreshed page entity module; A data refresh module is used to apply the updated data to refresh the data of the page entity module to be refreshed based on the path information.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Component data management method and device, electronic equipment and storage medium
CN111258670A