Page refreshing method, electronic equipment, storage medium and program product
By creating a callback link list when the web page is initialized and inserting the callback function pointer information according to the refresh weight of the page components, the problem that embedded web pages in the APP cannot flexibly and dynamically refresh multiple page components is solved, and more efficient resource utilization and refresh operations are achieved.
Patent Information
- Application Number
- CN202510355113.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-27
AI Technical Summary
When the embedded web page in the APP jumps from one page to another and returns to the original page, multiple page components cannot be refreshed flexibly and dynamically. Only the page components that bind the callback function can be refreshed.
When the web page is initialized, a callback link list is created, and the corresponding callback function pointer information is inserted into the callback link list according to the refresh weight of each target page component. When returning to the web page after jumping, the callback function is executed in the order in the callback link list to achieve flexible and dynamic refresh of multiple page components.
It realizes that when the web page is redirected and returns, multiple page components are refreshed flexibly and dynamically, avoiding unnecessary component refreshes and improving resource utilization efficiency.
Smart Images

Figure CN120216801A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a page refresh method, an electronic device, a storage medium, and a program product. Background Art
[0002] With the development of the mobile Internet and the continuous update and iteration of technologies on major technology platforms, the scenarios of enterprises placing advertisements on mobile devices are becoming increasingly complex. For example, a web page can be embedded in an APP, such as an H5 page, so that the APP can utilize the powerful functions of Web technology to achieve complex interactive functions, such as animations, video playback, form submission, etc. By embedding the web page, it is not necessary to rely entirely on native development.
[0003] Generally, when a user browses a web page embedded in an APP, they may jump from the currently browsed web page A to another page B. After viewing the content displayed on another page B, they need to return to web page A. When returning to web page A, a callback function is required to refresh web page A. However, currently, there is only one callback function for the web page, which can only refresh the page component that finally binds this callback function, and it is impossible to flexibly and dynamically refresh multiple page components. Summary of the Invention
[0004] Embodiments of this application provide a page refresh method, an electronic device, a storage medium, and a program product, which can flexibly and dynamically refresh multiple page components included in a web page when returning to the web page after jumping from the web page to other pages.
[0005] Embodiments of this application provide a page refresh method, which is applied to a target application. The target application embeds a web page, and the web page includes multiple page components. The multiple page components include at least two target page components that need to be refreshed by callback. Each target page component is associated with a callback function, and different target page components have different refresh weights. The method includes: during the initialization process of the web page, creating a callback linked list in the memory space of the web page. The callback linked list is used to store pointer information of the callback functions required when calling back the web page. The pointer information points to the storage location of the corresponding callback function in the memory space; according to the refresh weights of the target page components associated with each callback function, inserting the pointer information corresponding to each callback function into the callback linked list; when calling back the web page after jumping from the web page to other pages, executing the callback functions corresponding to each pointer information in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the process of calling back the web page.
[0006] An embodiment of the present application further provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the above-mentioned various methods.
[0007] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the above-mentioned various methods.
[0008] An embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above-mentioned various methods.
[0009] In an embodiment of the present application, during the initialization process of a web page, a callback linked list is created in the memory space of the web page, and according to the refresh weights of at least two target page components that need to be called back and refreshed in the web page, pointer information corresponding to the callback functions associated with each target page component is inserted into the callback linked list. Further, when the web page is called back after jumping from the web page to another page, the callback functions corresponding to each pointer information are executed in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the callback of the web page. Thus, it is possible to flexibly and dynamically refresh multiple page components included in the web page when the web page is called back after jumping from the web page to another page. Description of the Drawings
[0010] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0011] Figure 1 It is a schematic flowchart of a page refresh method provided by an exemplary embodiment of the present application;
[0012] Figure 2 It is a schematic flowchart of another page refresh method provided by another exemplary embodiment of the present application;
[0013] Figure 3 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application. Detailed Embodiments
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments of this application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0015] It should be noted that in the case where the embodiments of this application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data that have been authorized by the user or fully authorized by all parties. Additionally, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject. Moreover, various models (including but not limited to language models or large models) involved in this application comply with relevant laws and standards.
[0016] In addition, it should be noted that in the case where the embodiments of this application involve user interaction operations or trigger operations, the user interaction operations or trigger operations involved in the embodiments of this application include but are not limited to: interaction operations in various ways such as touch operations, gesture operations, voice operations, head movement operations, eye movement operations, etc.; among them, touch operations include but are not limited to: click operations, double-click operations, long-press operations, slide operations, pinch operations, or mouse hover operations, etc. Slide operations include but are not limited to: linear slides, curved slides, etc.
[0017] Furthermore, it should be noted that in the case where the embodiments of this application involve the jump between the first interface and the second interface, the jump methods involved in the embodiments of this application include but are not limited to: directly jumping from the first interface to the second interface, first jumping from the first interface to the task interface and then jumping to the second interface when the corresponding task operations are completed on the task interface; the completion of the corresponding task operations on the task interface includes but is not limited to: when the task interface is implemented as a game interface, completing game operations on the game interface; when the task interface is implemented as an identity authentication interface, completing identity authentication on the identity authentication interface; when the task interface is implemented as a recharge interface, completing recharge operations on the recharge interface; and so on.
[0018] Continuing with the above background art, when a user browses a web page embedded in an APP and jumps from the currently browsed web page A to another page B, when returning to web page A again, the web page A needs to be refreshed through a callback function. Currently, for returning to web page A, there is only one callback function that can take effect for the same web page A. That is, when web page A includes multiple components and each of the multiple components needs to add a callback function for page return, only the last added callback function can be executed normally, and other page components cannot be refreshed. Or, web page A corresponds to a callback function. When returning to web page A, this callback function is executed, and all components on web page A are refreshed simultaneously, and components that do not need to be refreshed will also be refreshed simultaneously, wasting operating resources and storage resources. All in all, when returning to web page A, it is impossible to flexibly and dynamically refresh multiple page components.
[0019] To address the above technical problem that it is impossible to flexibly and dynamically refresh multiple page components when returning to web page A, in the embodiments of the present application, during the initialization process of the web page, a callback linked list is created in the memory space of the web page, and according to the refresh weights of at least two target page components that need to be callback-refreshed in the web page, pointer information corresponding to the callback functions associated with each target page component is inserted into the callback linked list. Further, when the web page is called back after jumping from the web page to other pages, the callback functions corresponding to each pointer information are executed in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the process of calling back the web page. Thus, it is possible to flexibly and dynamically refresh multiple page components included in the web page when the web page is called back after jumping from the web page to other pages.
[0020] The following will, with reference to the accompanying drawings, elaborate on the technical solutions provided by the embodiments of the present application in detail.
[0021] Figure 1 It is a flowchart of a page refresh method provided by an exemplary embodiment of the present application. Figure 2 It is a flowchart of another page refresh method provided by another exemplary embodiment of the present application. As Figure 1 and Figure 2 shown, this page refresh method is applied to a target application. The target application embeds a web page, and the web page includes multiple page components. The multiple page components include at least two target page components that need to be callback-refreshed. Each target page component is associated with a callback function, and different target page components have different refresh weights. This method includes:
[0022] 101. During the initialization process of a web page, a callback linked list is created in the memory space of the web page. The callback linked list is used to store pointer information of callback functions required for callback of the web page. The pointer information points to the storage location of the corresponding callback function in the memory space.
[0023] 102. According to the refresh weights of the target page components associated with each callback function, insert the pointer information corresponding to each callback function into the callback linked list.
[0024] 103. In the case of callback of the web page after jumping from the web page to other pages, execute the callback functions corresponding to each pointer information in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the callback of the web page.
[0025] In this embodiment, the implementation form of the target application is not limited. For example, the target application can be an independently running APP, or a small program that depends on the APP to run. An APP refers to a mobile application service, which is an application program service developed for mobile services such as mobile phones connected to the Internet or wireless network card services. In addition, the type of the target application is not limited in this embodiment. For example, the application program can be a news application, an e-commerce application, a housekeeping application, a taxi application, a video playback application, and so on.
[0026] In this embodiment, the target application can be installed and run on a terminal device. The type of the terminal device is not limited in this embodiment. For example, the terminal device can be a smart handheld device, such as a smart phone, a tablet computer, a notebook computer, or a desktop computer, and so on; or for another example, the terminal device can also be a smart wearable device, such as a smart watch, a smart bracelet, and so on; for yet another example, the terminal device can also be various smart home appliances with display screens, such as a smart TV, a smart large screen, or a smart robot, and so on.
[0027] In the embodiment of the present application, the target application includes application pages, and the application pages are the native pages of the target application, and the application pages can implement display functions and interaction functions. For example, the application pages include but are not limited to: a startup page, a login / registration page, a home page, and so on.
[0028] To provide richer page functions, web pages can be embedded in the target application. In this embodiment, the type of the web page is not limited. For example, the web page can be an HTML page, an HTML5 page, etc. HTML5, abbreviated as H5, is a HTML standard specifically designed to carry rich web content and has new semantic, graphic, and multimedia elements. HTML5 is cross-platform and is designed to run on different types of hardware (PCs, tablets, mobile phones, televisions, etc.). By embedding web pages, the target application can utilize web technologies to provide richer functions without relying entirely on native development. For example, web pages can provide rich interactive functions, rapid iteration and update, cross-platform consistency, integration of third-party services, improvement of user experience, reduction of development costs, dynamic configuration, and personalized services, etc. Among them, in terms of rich interactive functions, web pages have functions such as animation, video playback, form submission, etc. In terms of rapid iteration and update, the content of web pages can be dynamically updated by the server without the user having to redownload the target application, which enables developers to rapidly iterate functions and fix problems while reducing the impact on users. For example, news applications can update news content in real time by embedding web pages without the user having to wait for the target application to be updated. Another example is that the product detail pages of e-commerce applications can be quickly updated by embedding web pages, reducing the update frequency of the target application. In terms of cross-platform consistency, H5 and JavaScript are cross-platform technologies, and web pages can maintain a consistent user experience on different operating systems (such as iOS, Android). Thus, the target application can reduce the complexity of cross-platform development while maintaining functional consistency. For example, the pages implemented by an enterprise application through a WebView can maintain a consistent interface and functions on multiple platforms (such as iOS, Android, Web). Another example is that hybrid application development frameworks such as React Native, Flutter, etc. also allow developers to embed web content through a WebView to achieve cross-platform functions. In terms of integration of third-party services, third-party services (such as payment, advertising, social media, etc.) provide web interfaces. By embedding web pages, the target application can easily integrate these services without directly interacting with native code. For example, by embedding a payment page through a WebView, users can complete payment operations within the target application without having to jump to an external browser. Another example is that the advertisement display embeds the web content provided by an advertising software development kit (SDK) to achieve the display and interaction of advertisements. In terms of improving user experience, embedding web pages can provide a smoother user experience, especially in scenarios where a large amount of content or complex interactions need to be displayed. For example, in article reading, by embedding an article page through a WebView, users can enjoy a better reading experience within the target application.For another example, in terms of video playback, by leveraging the video playback function of H5, a smoother video playback experience can be achieved. In terms of reducing development costs, by embedding web pages, developers can utilize the existing Web development technology stack, reducing development time and costs. For example, form submission can be achieved through web forms for collecting and submitting user information without native development. For another example, simple functional pages such as user agreement and privacy policy pages can be implemented through web embedding. In terms of dynamic configuration and personalized services, web pages can be dynamically loaded and configured by the server to achieve personalized content display. For example, by loading a user-exclusive content recommendation page through WebView, personalized recommendations can be realized. For another example, different page themes can be dynamically loaded according to user preferences or device status to achieve dynamic themes.
[0029] In the embodiments of the present application, at least one web page is embedded in the target application, and each web page may include multiple page components. The type of the page components is not limited in this embodiment. For example, the page components may be basic structure components, navigation components, form components, multimedia components, dynamic and interactive components, data display components, user interface enhancement components, responsive design components, third-party inheritance components, and so on. Among them, the basic structure components include: Header, which usually contains the website's Logo, navigation menu, etc.; Main Content, which is used to display the core information or functional area of the page; Sidebar, which is used to provide additional information or navigation options; Footer, which contains copyright information, contact information, social media links, etc. The navigation components include: Navigation Bar, which is used to guide users to browse different pages or parts; Breadcrumb Navigation, which is used to display the path of the user's current position in the website hierarchy; Pagination, which is used to display content in pages in a long list. The form components include: Text Input, which allows users to input text; Dropdown Menu, which is used to provide a set of options for users to select; Checkbox, which allows users to select one or more options; RadioButton, which allows users to select one from a set of mutually exclusive options; Button, which triggers specific operations, such as submitting a form, opening a dialog box, etc. The multimedia components include: Image, which is used to display static images; VideoPlayer, which is used to embed and play video content; Audio Player, which is used to embed and play audio files. The dynamic and interactive components include: Modal Dialog, which is a pop-up window covering the current page and is used to display important information or request user input; Tooltip, which is used to display short help information when the user hovers over an element; Carousel, which is used to automatically or manually switch to display a series of pictures or other content; Accordion, which is used to expand or collapse the content area by clicking on the title. The data display components include: Table, which is used to display data in rows and columns; Chart, which is used to display data trends in a graphical way, such as bar charts, line charts, pie charts, etc.; Card, which is a small container for organizing relevant information together and is often used to display product lists, article summaries, etc.The user interface enhancement components include: a progress bar (Progress Bar) for showing the progress of task completion; a slider (Slider) that allows users to select a numerical range by dragging the slider; and a notification for displaying temporary messages or warnings at the top of the page or a specific location. The responsive design components include: a grid system (GridSystem) for helping the layout adapt to different screen sizes to ensure a good user experience; and media queries (MediaQueries) for applying different style rules according to device characteristics. The third-party integration components include: social sharing buttons (Social Sharing Buttons) that allow users to easily share the page to social media platforms; a commenting system (Commenting System), such as Disqus, for providing a discussion space for users; and a payment gateway (PaymentGateway) for integrating third-party payment services such as PayPal, Stripe, etc. Each component has its specific use and can be implemented and customized through HTML, CSS, JavaScript, and various front-end frameworks (such as React, Vue.js, Angular, etc.). Reasonably combining these components can help build a powerful and user-friendly web page.
[0030] It should be noted that the multiple page components and at least two target page components in the following embodiments all refer to the components in the same web page.
[0031] In the embodiments of this application, the multiple page components in a web page may include at least two target page components that need to be callback-refreshed. To implement the callback-refresh of each target page component among the at least two target page components, the association relationship between each target page component and the corresponding callback function can be pre-maintained, that is, each target page component is associated with a callback function. When the web page is callbacked, the relevant data of the corresponding target page component can be callbacked through the callback function associated with each target page component in the web page to achieve the callback-refresh of each target page component. Among them, a callback function is a function that is passed as a parameter to other code (usually a library function or an asynchronous operation) and is used to be called when the web page is callbacked. For implementing the refresh mechanism of the target page component, the callback function can re-render or refresh the corresponding target page component when the data is updated or other trigger conditions are met.
[0032] In the embodiments of the present application, during the initialization process of a web page, the page components on the page are loaded, and at the same time, a callback linked list can be created in the memory space of the web page. The callback linked list is used to store the pointer information of the callback functions required to load the target page components when the web page is called back. The pointer information points to the storage location of the corresponding callback function in the memory space. Among them, the initialization of the web page refers to a series of operations and settings performed when the web page is loaded to ensure that the web page can be correctly and efficiently displayed and has the expected functions. This initialization process usually includes loading resources, setting the initial state, binding event listeners, etc. It should be noted that the initialization of the web page is not limited to once. After each time the web page is closed and reopened, the web page will be re-initialized. Or, after each time the target application is closed and the web page of the target application is reopened, the web page will be re-initialized. It should be noted that if after the web page A is initialized and jumps from the currently browsed web page A to another page B, when returning to the web page A again, the components that do not need to be refreshed do not need to be reloaded because they have been loaded during initialization.
[0033] Among them, the callback linked list has a linked list structure. Optionally, the structure of the callback linked list can be a singly linked list. A singly linked list is a linear data structure with the characteristics of dynamic storage, efficient insertion and deletion operations. Dynamic storage means that the size of the linked list can change dynamically and is not limited by the initial allocation size. Efficient insertion and deletion operations mean that when inserting or deleting a node (i.e., the target page component), only the pointer needs to be modified without moving other nodes. Each node in a singly linked list contains two parts: a data field and a pointer field. The data field is used to store data, and the pointer field is used to store the pointer to the next node. Usually, the pointer field of the last node is null, indicating the end of the linked list. The structure of the singly linked list can be represented as: Node1->Node2->Node3->...->NodeN->null.
[0034] In some alternative embodiments, creating a callback linked list in the memory space of the web page includes: searching for the callback linked list corresponding to the web page in the memory space of the web page; if the callback linked list is not found, creating a callback linked list in the memory space.
[0035] In some alternative embodiments, to avoid repeatedly creating a callback linked list for the same web page, which may cause resource waste and affect the initialization efficiency of the web page, it is possible to check whether a callback linked list for the web page already exists before creating the callback linked list for the web page. Then, creating a callback linked list in the memory space of the web page includes: searching for the callback linked list corresponding to the web page in the memory space of the web page; if the callback linked list is not found, creating a callback linked list in the memory space. Thus, resource waste can be reduced and the initialization efficiency of the web page can be improved. Among them, each web page has a web page ID, and the callback linked list corresponding to the web page can be associated with the web page ID. When searching for the callback linked list corresponding to the web page, it can be searched according to the ID of the web page, but it is not limited to this.
[0036] In the embodiments of the present application, different target page components in a web page have different refresh weights. The refresh weight determines the refresh order of each target page component when the web page is called back. The greater the refresh weight, the earlier the refresh order of the corresponding target page component, and the smaller the refresh weight, the later the refresh order of the corresponding target page component. Based on this, the pointer information corresponding to each callback function can be inserted into the callback linked list according to the refresh weights of the target page components associated with the respective callback functions. In other words, the greater the refresh weight of the target page component, the more forward the position of the corresponding callback function in the callback linked list, so that when the web page is called back, the corresponding callback function can be called and executed according to the arrangement order of the pointer information of each callback function in the callback linked list. The corresponding callback functions can be sequentially called and executed according to the arrangement order of the pointer information in the callback linked list. The calling method is simple and not prone to errors, improving the efficiency and accuracy of the refresh of the target page components.
[0037] In an alternative embodiment, when the callback web page is called, all target page components on the web page may need to be refreshed. Based on this, according to the refresh weights of the target page components associated with each callback function, the pointer information corresponding to each callback function is inserted into the callback list, including: monitoring the display status of each target page component on the web page; if it is detected that the first target page component is displayed on the web page, determining the first insertion position in the callback list corresponding to the first callback function associated with the first target page component according to the refresh weight of the first target page component; and inserting the pointer information of the first callback function into the callback list according to the first insertion position. During the initialization process of the web page, by monitoring the display status of each target page component on the web page and inserting the pointer information of the callback function associated with it into the corresponding position in the callback list according to the refresh weight of the target page component displayed on the web page, it is possible to add only the pointer information corresponding to the target page components displayed on the web page to the callback list, avoiding adding redundant pointer information corresponding to page components to the callback list. When the callback web page is called, only the target page components corresponding to the pointer information included in the callback list are refreshed according to the callback list, and other page components do not need to be refreshed, so as to reduce resource waste and improve the initialization efficiency of the web page.
[0038] In another alternative embodiment, when the callback web page is called, only some of all target page components on the web page may need to be refreshed, and the other target page components do not need to be refreshed. Based on this, according to the refresh weights of the target page components associated with each callback function, the pointer information corresponding to each callback function is inserted into the callback list, including: determining the first target page component that needs to be refreshed when the callback web page is called according to the business requirements; determining the first insertion position in the callback list corresponding to the first callback function associated with the first target page component according to the refresh weight of the first target page component; and inserting the pointer information of the first callback function into the callback list according to the first insertion position. During the initialization process of the web page, according to the business requirements, only the pointer information corresponding to the target page components that need to be refreshed when the callback web page is called is inserted into the corresponding position in the callback list, and the pointer information corresponding to the target page components that do not need to be refreshed does not need to be inserted into the callback list. Thus, it is possible to avoid adding redundant pointer information corresponding to target page components to the callback list. When the callback web page is called, only the target page components that need to be refreshed are refreshed according to the callback list, and the target page components that do not need to be refreshed and other page components do not need to be refreshed, which can further reduce resource waste and improve the initialization efficiency of the web page.
[0039] In some alternative embodiments, different target page components in the same web page can be associated with the same callback function. However, regardless of whether a callback function in the same callback linked list is associated with different target page components, the callback function can only be executed once during a callback of the web page. Based on this, inserting the pointer information of the first callback function into the callback linked list according to the first insertion position includes: identifying whether the pointer information of the first callback function already exists in the callback linked list; if it already exists, obtaining the refresh weight of the third target page component, where the third target page component is the target page component corresponding to the pointer information of the first callback function that already exists in the callback linked list. In other words, the third target page component is another target page component different from the first target page component associated with the first callback method; if the refresh weight of the first target page component is less than the refresh weight of the third target page component, insert the pointer information of the first callback function at the first insertion position and delete the already existing pointer information of the first callback function; if the refresh weight of the first target page component is greater than or equal to the refresh weight of the third target page component, reject inserting the pointer information of the first callback function at the first insertion position and retain the already existing pointer information of the first callback function.
[0040] For example, when calling back a web page, two target page components with different refresh weights may have a dependency relationship during refreshing. If the refresh data of target page component A depends on the refresh data of target page component B, then when calling back the web page, target page component B needs to be refreshed first, and based on the refreshed target page component B, target page component A is refreshed. In other words, the refresh weight of target page component A is less than that of target page component B. Based on this, if target page component A and target page component B are associated with the same callback function, and the pointer information of the first callback function corresponding to target page component A already exists in the callback linked list, then the pointer information of the first callback function is inserted at the first insertion position (the insertion position corresponding to target page component B), and the existing pointer information of the first callback function (the pointer information corresponding to target page component A) is deleted, so as to use the first callback function to refresh target page component B first according to the refresh order of the two target page components, and then refresh target page component A based on the refresh data of target page component B; or, in the case where there is no refresh dependency between target page component A and target page component B, the first callback function can be used to refresh target page component A and target page component B simultaneously. Another example, if the refresh weight of target page component A is greater than or equal to that of target page component B, and target page component A and target page component B are associated with the same callback function, and the pointer information of the first callback function corresponding to target page component A already exists in the callback linked list, then the insertion of the pointer information of the first callback function at the first insertion position (the insertion position corresponding to target page component B) is rejected, and the existing pointer information of the first callback function (the pointer information corresponding to target page component A) is retained, so as to use the first callback function to refresh target page component A first according to the refresh order of the two target page components, and then refresh target page component B based on the refresh data of target page component A; or, in the case where there is no refresh dependency between target page component A and target page component B, the first callback function can be used to refresh target page component A and target page component B simultaneously.
[0041] Further optionally, if the pointer information of the first callback function is inserted into the callback linked list according to the first insertion position, in the callback linked list, it is also necessary to add the association relationship between the pointer information of the first callback function and the first target page component and the third target page component; or, in the callback linked list, it is also necessary to add the association relationship between the pointer information of the first callback function and the third target page component. More specifically, if the refresh weight of the first target page component is less than the refresh weight of the third target page component, when inserting the pointer information of the first callback function at the first insertion position and deleting the already existing pointer information of the first callback function, in the callback linked list, it is also necessary to add the association relationship between the pointer information of the first callback function and the first target page component and the third target page component. Or, if the refresh weight of the first target page component is greater than or equal to the refresh weight of the third target page component, when refusing to insert the pointer information of the first callback function at the first insertion position and retaining the already existing pointer information of the first callback function, in the callback linked list, add the association relationship between the pointer information of the first callback function and the third target page component.
[0042] In this embodiment, the specific implementation manner of adding the association relationship between the pointer information of the first callback function and the first target page component and the third target page component in the callback linked list is not limited, and the optional implementation manners are as follows.
[0043] In an alternative embodiment, adding the association relationship between the pointer information of the first callback function and the first target page component and the third target page component in the callback linked list includes: adding the identification information of the first target component and the identification information of the third target component, and establishing the association relationship between the identification information of the first target component and the identification information of the third target component and the pointer information of the first callback method.
[0044] In another alternative embodiment, adding the association relationship between the pointer information of the first callback function and the third target page component in the callback linked list includes: creating a component list for the pointer information of the first callback function, and adding the identification information of the first target component and the identification information of the third target component to the component list.
[0045] In addition, in addition to adding the association relationship between the pointer information of the first callback function and the first target page component and the third target page component in the callback linked list, it is also possible to query the association relationship between the first target page component, the second target page component and the first callback method from the association relationship between the pre-maintained target page components and the callback methods in the above embodiments.
[0046] The exemplary embodiments of adding the association relationship between the pointer information of the first callback function and the third target page component in the callback linked list, or querying the association relationship between the first target page component, the second target page component and the first callback method from the pre-maintained association relationships between each target page component and the callback method, can improve the refresh efficiency of the target page component, thereby making the callback web page more efficient.
[0047] Further optionally, the target page components in the web page have different implementation forms. The implementation forms of some target page components are hidden controls, such as target page components displayed in the form of floating layers, small windows or drop-down menus. Then, after the floating layer, small window or drop-down menu is closed, these target page components are in a hidden or disappeared state. Based on this, if it is monitored that the second target page component displayed on the web page disappears from the web page, determine the second insertion position corresponding to the second callback function associated with the second target page component in the callback linked list according to the refresh weight of the second target page component; delete the pointer information of the second callback function from the callback linked list according to the second insertion position.
[0048] In the embodiments of the present application, when the web page is called back after jumping from the web page to other pages, the callback functions corresponding to each pointer information can be executed in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the callback of the web page. Among them, the other page can be a web page or a native page of the target application.
[0049] In some optional embodiments, when the web page is called back after jumping from the web page to other pages, before executing the callback functions corresponding to each pointer information in the order of the pointer information stored in the callback linked list, it is necessary to first read the callback linked list from the storage area of the web page, that is, first determine whether there is a callback linked list. If it exists, read the callback linked list. In the case of reading the callback linked list, load and run the callback function at the storage position pointed to by the pointer information in turn according to the order of the pointer information, so as to implement the refresh operation on the corresponding target page component.
[0050] In some alternative embodiments, a web page corresponds to a web page container, and the web page container is associated with a status change monitoring event for monitoring the visibility status of the web page. When the web page is called back after jumping to another page, the development toolkit of the target application can be loaded. The development toolkit provides a page jump monitoring event. If the development toolkit is successfully loaded, the page jump monitoring event is used to monitor the jump situation of the web page. When the page jump monitoring event monitors the callback of the web page, the callback linked list of the web page is obtained to facilitate the calling of corresponding callback methods according to the callback linked list. In the case where the development toolkit fails to load, the status change monitoring event is used to degrade and monitor the visibility status of the web page. When the status change monitoring event monitors that the visibility status of the web page changes from hidden to visible, the callback linked list of the web page is obtained to facilitate the calling of corresponding callback methods according to the callback linked list. Among them, the status change monitoring event can be the visibilitychange event, the development toolkit can be the SDK, and the page jump monitoring event can be the Action, but it is not limited thereto. The visibilitychange event is triggered on the page container when the target page component of the web page is visible or hidden, and is usually used to monitor the display status of the web page. Action refers to the ability of JavaScript in the target application to interact with the target application, which enables front-end developers to call some native controls of the target application or obtain stored data, etc. JavaScript, abbreviated as JS, is a lightweight, interpreted or just-in-time compiled programming language with function priority.
[0051] In an alternative embodiment, when all target page components in the web page can be fully displayed on the current display screen, the callback functions corresponding to each pointer information are executed in the order of the pointer information stored in the callback linked list to perform a refresh operation on each target page component during the callback of the web page, including: loading the callback linked list from the memory space of the web page, and sequentially traversing each pointer information existing in the callback linked list; loading and executing the fourth callback function pointed to by the traversed pointer information to perform a refresh operation on the fourth target page component associated with the fourth callback function during the callback of the web page.
[0052] In another alternative embodiment, when all the target page components in the web page cannot be fully displayed on the current display screen, in response to the sliding display operation on the web page, the target page components in the web page are slid and displayed on the current display screen, and as the sliding display operation on the web page is performed, some target page components will disappear from the current display screen. Based on this, in the order of the respective pointer information stored in the callback linked list, the callback functions corresponding to the respective pointer information are executed to perform a refresh operation on each target page component during the callback of the web page, including: monitoring the page area of the web page located on the current display screen, and obtaining the fifth target page component located in the page area; when there are multiple fifth target page components, according to the order of the pointer information of the fifth callback functions associated with the multiple fifth target page components in the callback linked list, load and execute each fifth callback function to perform a refresh operation on each fifth target page component during the callback of the web page. In addition, some of the fifth callback functions may be associated with only one fifth target component.
[0053] Optionally, load and execute the fourth callback function pointed to by the traversed pointer information to perform a refresh operation on the fourth target page component associated with the fourth callback function during the callback of the web page, including: querying the pre-maintained mapping table or callback linked list between the callback function and the target page component to determine the fourth target page component associated with the fourth callback function pointed to by the traversed pointer information; if the fourth callback function is associated with at least two fourth target page components, load and execute the fourth callback function to perform a refresh operation on at least two fourth target page components simultaneously during the callback of the web page, or, according to the magnitudes of the refresh weights of the at least two fourth target page components, sequentially refresh the at least two fourth target page components. Load and execute the fourth callback function to perform a refresh operation on at least two fourth target page components simultaneously during the callback of the web page, or, according to the magnitudes of the refresh weights of the at least two fourth target page components, sequentially refresh the at least two fourth target page components. For specific exemplary embodiments, reference may be made to the relevant descriptions of target page component A and target page component B in the above embodiments, which will not be elaborated here.
[0054] Correspondingly, load and execute each fifth callback function to perform a refresh operation on each fifth target page component during the callback of the web page, including: querying the pre-maintained mapping table or callback linked list between the callback function and the target page component to determine the fifth target page component associated with each fifth callback function; for the fifth callback function associated with at least two fifth target page components, load and execute the fifth callback function to perform a refresh operation on at least two fifth target page components simultaneously during the callback of the web page.
[0055] Further optionally, in response to the closing operation of the web page, the callback linked list is deleted from the memory space of the web page.
[0056] Further optionally, in response to the re-opening operation of the web page, the callback linked list of the web page is re-created. For the specific implementation manner of creating the callback linked list, reference may be made to the relevant descriptions of the above embodiments, which will not be elaborated here.
[0057] In the technical solutions provided by the above embodiments of the present application, during the initialization process of the web page, a callback linked list is created in the memory space of the web page, and according to the refresh weights of at least two target page components that need to be callback-refreshed in the web page, the pointer information corresponding to the callback function associated with each target page component is inserted into the callback linked list. Further, when the web page is callback after jumping from the web page to other pages, the callback functions corresponding to each pointer information are executed in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the callback of the web page. Thus, it is possible to flexibly and dynamically refresh multiple page components included in the web page when the web page is callback after jumping from the web page to other pages.
[0058] Figure 3 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application. As Figure 3 shown, the electronic device includes: a memory 30a and a processor 30b; the memory 30b is used to store a computer program; the processor 30b is coupled to the memory 30a and is used to execute the computer program to implement the following steps:
[0059] 101. During the initialization process of the web page, create a callback linked list in the memory space of the web page. The callback linked list is used to store the pointer information of the callback functions required when the web page is callback, and the pointer information points to the storage location of the corresponding callback function in the memory space;
[0060] 103. According to the refresh weights of the target page components associated with each callback function, insert the pointer information corresponding to each callback function into the callback linked list;
[0061] 103. When the web page is callback after jumping from the web page to other pages, execute the callback functions corresponding to each pointer information in the order of the pointer information stored in the callback linked list, so as to perform a refresh operation on each target page component during the callback of the web page.
[0062] In an embodiment of the present application, a web page is embedded in a target application. The web page includes multiple page components, and the multiple page components include at least two target page components that need to be callback-refreshed. Each target page component is associated with a callback function, and different target page components have different refresh weights.
[0063] In some alternative embodiments, when creating a callback linked list in the memory space of the web page, the processor is specifically configured to: search for the callback linked list corresponding to the web page in the memory space of the web page; if the callback linked list is not found, create a callback linked list in the memory space.
[0064] In some alternative embodiments, when inserting the pointer information corresponding to each callback function into the callback linked list according to the refresh weights of the target page components associated with the respective callback functions, the processor is specifically configured to: monitor the display status of each target page component on the web page; if it is detected that a first target page component is displayed on the web page, determine a first insertion position in the callback linked list corresponding to a first callback function associated with the first target page component according to the refresh weight of the first target page component; and insert the pointer information of the first callback function into the callback linked list according to the first insertion position.
[0065] Further optionally, if the processor detects that a second target page component displayed on the web page disappears from the web page, determine a second insertion position in the callback linked list corresponding to a second callback function associated with the second target page component according to the refresh weight of the second target page component; and delete the pointer information of the second callback function from the callback linked list according to the second insertion position.
[0066] Optionally, when inserting the pointer information of the first callback function into the callback linked list according to the first insertion position, the processor is specifically configured to: identify whether the pointer information of the first callback function already exists in the callback linked list; if it already exists, obtain the refresh weight of a third target page component, where the third target page component is the target page component corresponding to the pointer information of the first callback function that already exists in the callback linked list; if the refresh weight of the first target page component is less than the refresh weight of the third target page component, insert the pointer information of the first callback function at the first insertion position and delete the pointer information of the first callback function that already exists; if the refresh weight of the first target page component is greater than or equal to the refresh weight of the third target page component, reject inserting the pointer information of the first callback function at the first insertion position and retain the pointer information of the first callback function that already exists.
[0067] Further optionally, the processor is further configured to add the association relationship between the pointer information of the first callback function and the first target page component and the third target page component in the callback linked list; or add the association relationship between the pointer information of the first callback function and the third target page component in the callback linked list.
[0068] In some alternative embodiments, when the processor executes the callback functions corresponding to each pointer information in the order of the pointer information stored in the callback linked list to perform a refresh operation on each target page component during the callback of the web page, it is specifically configured to: load the callback linked list from the memory space of the web page, and sequentially traverse each pointer information existing in the callback linked list; load and execute the fourth callback function pointed to by the traversed pointer information to perform a refresh operation on the fourth target page component associated with the fourth callback function during the callback of the web page; or, monitor the page area of the web page located in the current display screen, and obtain the fifth target page component located in the page area; in the case where there are multiple fifth target page components, load and execute each fifth callback function according to the order of the pointer information of the fifth callback functions associated with the multiple fifth target page components in the callback linked list to perform a refresh operation on each fifth target page component during the callback of the web page.
[0069] Optionally, when the processor loads and executes the fourth callback function pointed to by the traversed pointer information to perform a refresh operation on the fourth target page component associated with the fourth callback function during the callback of the web page, it is specifically configured to: query the pre-maintained mapping table or callback linked list between the callback function and the target page component to determine the fourth target page component associated with the fourth callback function pointed to by the traversed pointer information; if the fourth callback function is associated with at least two fourth target page components, load and execute the fourth callback function to perform a refresh operation on at least two fourth target page components simultaneously during the callback of the web page.
[0070] Correspondingly, when the processor loads and executes each fifth callback function to perform a refresh operation on each fifth target page component during the callback of the web page, it is specifically configured to: query the pre-maintained mapping table or callback linked list between the callback function and the target page component to determine the fifth target page component associated with each fifth callback function; for the fifth callback function associated with at least two fifth target page components, load and execute the fifth callback function to perform a refresh operation on at least two fifth target page components simultaneously during the callback of the web page.
[0071] Further optionally, the processor is further configured to respond to the closing operation of the web page and delete the callback linked list from the memory space of the web page.
[0072] Further, as Figure 3 shown, the server further includes: other page components such as a communication page component 30c, a display 30d, a power page component 30e, an audio page component 30f, etc. Figure 3 Only some page components are schematically shown, and it does not mean that the electronic device only includes Figure 3The page component shown
[0073] The detailed implementation manners and beneficial effects of the electronic device provided in the embodiments of the present application have been described in detail in the foregoing embodiments, and will not be elaborated herein
[0074] An exemplary embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to implement the steps in the foregoing method embodiments
[0075] An exemplary embodiment of the present application further provides a computer program product. The computer program product includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the foregoing method embodiments
[0076] The foregoing memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc
[0077] The foregoing communication page component is configured to facilitate communication between the device where the communication page component is located and other devices in a wired or wireless manner. The device where the communication page component is located can access a wireless network based on a communication standard, such as a mobile communication network such as 2G, 3G, 4G / LTE, 5G, or a combination thereof. In an exemplary embodiment, the communication page component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel
[0078] The above-mentioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from users. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations.
[0079] The above-mentioned power page component supplies power to various page components of the device where the power page component is located. The power page component may include a power management system, one or more power supplies, and other page components associated with generating, managing, and distributing power for the device where the power page component is located.
[0080] The above-mentioned audio page component can be configured to output and / or input audio signals. For example, the audio page component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio page component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in a memory or transmitted via a communication page component. In some embodiments, the audio page component further includes a speaker for outputting audio signals.
[0081] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to be able to implement the steps in the above method embodiments. Among them, the computer-readable storage medium can be implemented by volatile or non-volatile or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, Phase-change Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), flash memory or other memory technologies, Compact Disc Read Only Memory (CD-ROM), Digital Video Disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium
[0082] Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is caused to implement each step in the above method embodiment. It should be understood that each process or a combination of multiple processes in the above method flow can be implemented by the computer program or instructions. In addition, these computer programs or instructions can be applied to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices, so that the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices can be used as devices to implement the corresponding functions in the above method embodiment.
[0083] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the element.
[0084] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A page refresh method, characterized in that: Applied to a target application, the target application has a web page embedded therein, the web page includes multiple page components, the multiple page components include at least two target page components that need to be refreshed by callback, each target page component is associated with a callback function, and different target page components have different refresh weights, the method includes: During the web page initialization process, a callback linked list is created in the memory space of the web page, the callback linked list is used to store pointer information of the callback function required when calling back the web page, and the pointer information points to the storage location of the corresponding callback function in the memory space; According to the refresh weight of the target page component associated with each callback function, inserting the pointer information corresponding to each callback function in the callback linked list; When the web page is called back after jumping from the web page to other pages, the callback functions corresponding to the pointer information are executed in the order of the pointer information stored in the callback linked list, so as to refresh the target page components during the process of calling back the web page.
2. The method according to claim 1, characterized in that Creating a callback linked list in the memory space of the web page includes: Searching for a callback linked list corresponding to the web page in the memory space of the web page; If the callback linked list is not found, the callback linked list is created in the memory space.
3. The method according to claim 1, characterized in that According to the refresh weight of the target page component associated with each callback function, the pointer information corresponding to each callback function is inserted into the callback linked list, including: Monitoring the display status of each target page component on the web page; If it is monitored that a first target page component is displayed on the web page, determining a first insertion position corresponding to a first callback function associated with the first target page component in the callback linked list according to a refresh weight of the first target page component; According to the first insertion position, the pointer information of the first callback function is inserted into the callback linked list.
4. The method according to claim 3, characterized in that Also includes: If it is monitored that the second target page component displayed on the web page disappears from the web page, according to the refresh weight of the second target page component, determine the second callback function associated with the second target page component at the second insertion position corresponding to the callback linked list; According to the second insertion position, the pointer information of the second callback function is deleted from the callback linked list.
5. The method according to claim 3, characterized in that: Inserting the pointer information of the first callback function into the callback linked list according to the first insertion position includes: Identify whether pointer information of the first callback function already exists in the callback linked list; If it already exists, obtaining a refresh weight of a third target page component, wherein the third target page component is a target page component corresponding to the pointer information of the first callback function already existing in the callback linked list; If the refresh weight of the first target page component is less than the refresh weight of the third target page component, inserting the pointer information of the first callback function at the first insertion position, and deleting the existing pointer information of the first callback function; If the refresh weight of the first target page component is greater than or equal to the refresh weight of the third target page component, the pointer information of the first callback function is refused to be inserted at the first insertion position, and the existing pointer information of the first callback function is retained.
6. The method according to claim 5, characterized in that Also includes: In the callback linked list, adding the association relationship between the pointer information of the first callback function and the first target page component and the third target page component; or In the callback linked list, an association relationship between the pointer information of the first callback function and the third target page component is added.
7. The method according to claim 1, characterized in that Executing callback functions corresponding to the pointer information in the order of the pointer information stored in the callback linked list, so as to refresh the target page components in the process of calling back the web page, including: Loading the callback linked list from the memory space of the web page, and traversing each pointer information in the callback linked list in order; loading and executing the fourth callback function pointed to by the traversed pointer information, so as to perform a refresh operation on the fourth target page component associated with the fourth callback function during the process of calling back the web page; or Monitor the page area of the web page located in the current display screen, and obtain the fifth target page component located in the page area; when there are multiple fifth target page components, load and execute each fifth callback function according to the order of pointer information of the fifth callback functions associated with the multiple fifth target page components in the callback linked list, so as to refresh each fifth target page component in the process of calling back the web page.
8. The method according to claim 7, characterized in that Loading and executing the fourth callback function pointed to by the traversed pointer information, so as to perform a refresh operation on the fourth target page component associated with the fourth callback function during the process of calling back the web page, includes: Querying a pre-maintained mapping table between callback functions and target page components or the callback linked list to determine a fourth target page component associated with a fourth callback function pointed to by the traversed pointer information; If the fourth callback function is associated with at least two fourth target page components, then the fourth callback function is loaded and executed to simultaneously refresh the at least two fourth target page components during the process of calling back the web page; Accordingly, each fifth callback function is loaded and executed to refresh each fifth target page component during the process of calling back the web page, including: Querying a pre-maintained mapping table between callback functions and target page components or the callback chain table to determine the fifth target page component associated with each fifth callback function; For the fifth callback function associated with at least two fifth target page components, the fifth callback function is loaded and executed to simultaneously perform a refresh operation on the at least two fifth target page components during the process of calling back the web page.
9. The method according to claim 7, characterized in that: Also includes: In response to the closing operation of the web page, the callback linked list is deleted from the memory space of the web page.
10. An electronic device, characterized in that: include: Memory and processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the method according to any one of claims 1 to 9.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to implement the steps in the method according to any one of claims 1 to 9.
12. A computer program product, characterized in that The computer program product comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of any one of the methods of claims 1 to 9.