Page navigation processing method, page content providing method, device and storage medium
By modifying the page source file to obtain the request, obtaining and replacing the target page content to the rendered DOM tree instance, the problem of page jumping takes time, and achieving faster page loading and higher traffic conversion rates.
Patent Information
- Application Number
- PCT/IB2025/050590
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-04
- Filing Date
- 2025-01-21
- Publication Date
- 2025-08-07
AI Technical Summary
In electronic trading platforms, the page redirection process takes a long time, resulting in lag and waste of resources, affecting consumer experience and traffic conversion rate.
By modifying the page source file to obtain the request, obtain the target page content and replace it to the corresponding position of the rendered DOM tree instance, directly load the second page, reducing the re-rendering process of the DOM tree.
It improves page loading speed, optimizes visual experience, increases the number of pages browsed per unit time, increases the conversion rate of transaction orders, and saves resource consumption.
Smart Images

Figure IB2025050590_07082025_PF_FP_ABST
Abstract
Description
[0001] This disclosure claims priority to Chinese patent application number 202410160622.4, filed with the Chinese Patent Office on February 4, 2024, entitled "Processing of Page Jumps, Method for Providing Page Content, Device, and Storage Medium," the entire contents of which are incorporated herein by reference. Technical Field: This disclosure relates to the field of information processing, and more particularly to methods for processing page jumps, methods for providing page content, methods for obtaining page files, electronic devices, and storage media. Background: Electronic trading platforms have developed rapidly in recent years and have become the preferred shopping channel for most users, providing great convenience for consumers. Consumers typically search for desired products and select purchase targets by navigating and comparing multiple web pages. When visiting a commodity trading website, the smoothness of web page loading is crucial for both the consumer experience and traffic conversion rate. Especially when internet speeds are slow, page transitions can take a long time, leading to page freezes and even blank screens. This results in a poor consumer experience and a slow browsing experience, hindering consumers from finding the products they need quickly. Page visits that don't result in transactions also result in excessive and meaningless consumption of hardware resources, such as consumer devices and website servers. The present disclosure provides methods for processing page transitions, providing page content, obtaining page files, electronic devices, and storage media to address one or more of the aforementioned technical issues. In a first aspect, an embodiment of the present disclosure provides a page jump processing method, which is applied to a page loading program. The method includes: in response to a page jump instruction, when it is determined that a first page before the jump and a second page after the jump meet a page association condition, obtaining target page content of the second page; wherein the target page content is obtained by sending a page source file acquisition request, and the page source file acquisition request is configured to simultaneously obtain the target page content of the second page; replacing the obtained target page content with a corresponding position of a DOM tree instance rendered by the first page; and loading the second page according to the replaced DOM tree instance.In a second aspect, embodiments of the present disclosure provide a method for providing page content, applied to a server. The method comprises: receiving a page source file acquisition request, the page source file acquisition request configured to simultaneously acquire target page content of a second page; returning target page content based on the page source file acquisition request, wherein the target page content is used, in response to a page jump instruction, to replace the target page content at a corresponding position in a DOM tree instance rendered by the first page if it is determined that a first page before the jump and a second page after the jump meet a page association condition, thereby loading the second page based on the replaced DOM tree instance. In a third aspect, embodiments of the present disclosure provide a method for acquiring page files. The method comprises: in response to a page content acquisition condition being met, calling a first API to configure the page source file acquisition request to simultaneously acquire target page content of the second page; acquiring target page content returned based on the configured page source file acquisition request; wherein the target page content is used, in response to the page jump instruction, to replace the target page content at a corresponding position in the DOM tree instance rendered by the first page if it is determined that a first page before the jump and a second page after the jump meet a page association condition, thereby loading the second page based on the replaced DOM tree instance. In a fourth aspect, embodiments of the present disclosure provide a method for processing page redirects, comprising: when displaying a first page, in response to a page content acquisition condition being met, acquiring target page content of another page and saving it in a cache of a page loader; in response to a page redirect instruction, upon determining that the first page before the redirect and the second page after the redirect meet a page association condition, extracting the target page content of the second page from the cache of the page loader; replacing the returned target page content with a corresponding position in a DOM tree instance rendered by the first page; and loading the second page based on the replaced DOM tree instance. In a fifth aspect, embodiments of the present disclosure provide a method for processing page redirects, comprising: in response to a page redirect instruction, upon determining that the first page before the redirect and the second page after the redirect meet a page association condition, determining that the target page content of the second page does not exist in the cache of the page loader; configuring a page source file acquisition request to simultaneously acquire the target page content of the second page, receiving the target page content of the second page returned in response to the page source file acquisition request; replacing the acquired target page content with a corresponding position in the DOM tree instance rendered by the first page; and loading the second page based on the replaced DOM tree instance.In a sixth aspect, embodiments of the present disclosure provide a method for processing page redirects, comprising: when displaying a first product details page, in response to satisfying a condition for obtaining the page content of other product details pages, obtaining the main content of at least one other product details page and saving it in a cache of a page loader; in response to a page redirect instruction, if determining that the page after redirection is a second product details page, extracting the main content of the second product details page from the cache of the page loader; and loading the second product details page based on the obtained target page content. In a seventh aspect, embodiments of the present disclosure provide an electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the aforementioned methods when executing the computer program. In an eighth aspect, embodiments of the present disclosure provide a computer-readable storage medium, wherein the computer program is stored therein, and when executed by the processor, the computer program implements any of the aforementioned methods. In a ninth aspect, embodiments of the present disclosure provide a computer program product, comprising a computer program / instructions, wherein when executed by the processor, the computer program / instructions implements any of the aforementioned methods. Compared with related technologies, the present disclosure has the following advantages: According to an embodiment of the present disclosure, a request for obtaining a page source file is modified. The page source file obtaining request is configured to obtain a portion of the page content in the page as the target page content while obtaining the page source file. In response to a page jump operation and when it is determined that the pages before and after the jump meet the page association conditions, the target page content obtained in this manner is replaced with the corresponding position in the DOM tree instance that has been rendered for the first page, so that the second page can be directly loaded based on the replaced DOM tree instance. As can be seen, the disclosed embodiments achieve partial retrieval of the second page's content by modifying the page source file retrieval request method. This partial content is then used as the basis for loading the second page, combined with the already loaded DOM tree instance of the first page. This eliminates the need to render the corresponding DOM tree instance for the second page, saving time and hardware resources required for rendering the DOM tree instance. This improves the speed of loading the second page and enhances the visual experience of page transitions. In e-commerce scenarios, this allows consumers to more quickly browse and select desired products, increasing the number of pages browsed per unit time and the likelihood of finding the desired product. This improves the conversion rate of page traffic into transaction orders and also generates more traffic for the page and platform. Directly retrieving the desired target page content eliminates the need to parse the content from the page source file, thus reducing the time spent loading the second page.The request to modify the page source file can be triggered before responding to the page jump instruction, when the conditions for obtaining the page content are met. This means that the target page content of the second page is obtained in advance before determining to jump to the second page. After responding to the jump instruction, the pre-obtained and saved target page content can be directly obtained, further shortening the time required to load the second page and achieving a smoother visual effect for page jumps. After providing the target page content of the second page, the server can save the target page content to the front-end server's cache. When other terminals request the target page content of the second page, they can directly obtain the target page content from the front-end server without further retrieval from the back-end server. This improves the efficiency of second page loading for multiple terminals. During the loading of the second page, a second API provided by the page loader can be called to load the animation effects in the cascading style sheet. This smooth fading animation of the first page and the entry of the second page creates a smooth and fluid page jump effect, improving the visual experience of page jumps, enhancing website stickiness, and attracting more traffic. Furthermore, upon determining that the first page belongs to a multi-page website, the multi-page website can be configured as a single-page website, allowing the modified single-page website to directly call the second API provided by the page loader, thus enabling the aforementioned effects to be applied to various types of page loader programs. The above description is merely an overview of the technical solutions of the present disclosure. To provide a clearer understanding of the technical solutions of the present disclosure, implementations can be made in accordance with the contents of this specification. To further enhance the understanding of the above and other objectives, features, and advantages of the present disclosure, specific embodiments of the present disclosure are described below. BRIEF DESCRIPTION OF THE DRAWINGS In the accompanying drawings, unless otherwise specified, identical reference numerals throughout the various figures denote identical or similar components or elements. The drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments of the present disclosure and should not be construed as limiting the scope of the present disclosure.FIG1 is a schematic diagram of data interaction for page jump in the related art; FIG2 is a schematic diagram of data interaction for page jump in an example of an embodiment of the present disclosure; FIG3 is a schematic diagram of data interaction for page jump in another example of an embodiment of the present disclosure; FIG4 is a flow chart of a method for processing page jump provided in an embodiment of the present disclosure; FIG5 is a flow chart of a method for providing page content provided in an embodiment of the present disclosure; FIG6 is a flow chart of a method for obtaining a page file provided in an embodiment of the present disclosure; FIG7 is a flow chart of a method for processing page jump provided in an embodiment of the present disclosure; FIG8 is a flow chart of a method for processing page jump provided in an embodiment of the present disclosure; FIG9 is a flow chart of a method for processing page jump provided in an embodiment of the present disclosure; FIG10 is a structural block diagram of a device for processing page jump provided in an embodiment of the present disclosure; FIG11 is a structural block diagram of a device for providing page content provided in an embodiment of the present disclosure; FIG12 is a structural block diagram of a device for obtaining a page file provided in an embodiment of the present disclosure; FIG13 is a structural block diagram of a device for processing page jump provided in an embodiment of the present disclosure; FIG14 is a structural block diagram of a device for processing page jump provided in an embodiment of the present disclosure; Figure 15 shows a block diagram of a page redirect processing device provided in an embodiment of the present disclosure; Figure 16 shows a block diagram of an electronic device used to implement an embodiment of the present disclosure. The following description briefly describes certain exemplary embodiments. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present disclosure. Therefore, the drawings and description are to be regarded as illustrative rather than restrictive in nature. To facilitate understanding of the technical solutions of the embodiments of the present disclosure, the following describes related technologies. The following related technologies are optional solutions that can be combined with the technical solutions of the embodiments of the present disclosure in any manner and fall within the scope of protection of the embodiments of the present disclosure. In related technologies, web page loading technologies are generally divided into SSR (server-side rendering) and CSR (client-side rendering).Taking a browser loading a web page as an example, SSR rendering involves the server assembling an HTML (HyperText Markup Language) file and sending it to the browser after the browser initiates a page request. The browser then parses the HTML file and renders the page with content. In CSR rendering, after a browser requests a page, the server first returns an HTML file without specific content to the browser as the page skeleton. The browser then generates a complete HTML file based on the page skeleton and dynamically renders the page content and data into the page, completing the page display. Because client-side rendering requires dynamically creating a complete HTML file, it requires executing a large amount of code, resulting in slower first-page performance. In contrast, server-based rendering allows the client to obtain a directly displayable HTML file from the server, optimizing the first-page display experience. Figure 1 shows a schematic diagram of the browser-server interaction during page transitions in related art. Taking the example of transitions between product detail pages (PDPs) on an e-commerce website, the product detail page for a product often recommends other products. Visiting other products opens their product detail pages. From the perspective of data interaction, when a user clicks on a product on a PDP page, the browser 11 executes 101 to initiate a request to obtain the corresponding PDP page. This request instructs the browser to obtain the source file for the PDP page. The front-end server 12 executes 102 to request the source file from the back-end server 13. The back-end server searches for the source file corresponding to the PDP page and responds to the front-end server 103. The front-end server executes 104 to send the source file to the browser, which then loads the PDP page based on the source file. The browser's loading process varies for different types of web pages. For multi-page websites, each page is a complete and independent page. When accessing a new page on the same website, each page must issue an HTTP request to the server to retrieve the corresponding source files, such as HTML, CSS (Cascading Style Sheets), and JS (JavaScript). The page after the redirect is then loaded based on the retrieved source files.Single-page websites, on the other hand, consist of a shell page and multiple page fragments, each sharing a common framework. When accessing a new page within the same website, the browser retrieves the corresponding page source file from the server. The browser extracts the page content that differs from the previous page and requires updating from the new HTML file, then loads the updated content into the previous page. This embodiment of the present disclosure provides a page redirection solution. Figure 2 illustrates the interaction between the browser and the server in an example of a page redirection solution in this embodiment of the present disclosure. When a website is accessed through a browser 21, the server returns the page source files corresponding to the website, including a JS (JavaScript) file, to the browser for executing page-related processing. When a user clicks on a product on a PDP page, the JS code executes a judgment. If it determines that the redirect is between PDP pages, the page source file acquisition request is further reconfigured at step 201. This request, sent to the front-end server 22, not only retrieves the HTML file of the page but also requests a portion of the page content (referred to as the target page content) of the redirected page. For example, the target page content includes content identified by keywords such as meta (used to describe HTML file attributes) and content (webpage content) in the page source file. The front-end server then searches the cache at step 202 to determine whether the page source file and target page content have already been retrieved. If it exists, the process proceeds to step 203 to organize the target page content into a JSON (JavaScript Object Notation) file format and return it to the browser along with the HTML file. The browser then executes step 208 to directly replace the JSON file with the corresponding location of the previously rendered Document Object Model (DOM) tree instance of the previously rendered PDP page, generating a new DOM tree instance. Hydrate injection is performed on the updated DOM tree instance to transform the string into a usable component. Step 209 loads the injected DOM tree instance and displays the redirected PDP page. If it does not exist, the process proceeds to step 204 to request the page source file and target page content from the backend server 23. After the backend server responds at step 205, the front-end server executes step 206 to return the page source file and the target page content organized into JSON format to the browser.In this way, by modifying the page source file acquisition request method, partial content of the redirected PDP page is directly acquired. This partial content is used as the basis for loading the page, and the second page is loaded in combination with the DOM tree instance of the previously loaded page. Compared to multi-page websites that directly re-render the DOM tree instance based on the HTML file of the redirected PDP page, this solution saves time and hardware resources consumed in rendering the DOM tree instance, improves page loading efficiency, and optimizes the visual experience of page transitions. In electronic transaction scenarios, this allows consumers to browse and select desired products more quickly, increasing the number of pages browsed per unit time, increasing the likelihood of finding the desired product, and improving the conversion rate of page traffic to transaction orders. It also generates more traffic for the page and the platform. Since the desired target page content is directly acquired, there is no need to parse the content from the page source file, which saves time spent loading the redirected PDP page. Compared to the page loading process of a single-page website, in the disclosed embodiment, the browser does not need to extract updated page content from an HTML file. Instead, it can directly request page content from the server that can be populated into the DOM tree instance of the previous PDP page. This saves the browser complex operations and improves page redirection efficiency. After providing the target page content of the redirected PDP page, the front-end server can execute 207 to save the target page content to the front-end server's cache. If the same terminal or another terminal subsequently requests the target page content of the PDP page, the target page content can be directly retrieved from the front-end server's cache without further retrieval from the back-end server. This improves the loading efficiency of the redirected PDP page for multiple terminals. Applied to this example, the aforementioned process first searches the cache to see if the target page content was previously saved when the same terminal or another terminal retrieved the PDP page. If so, the page source file and JSON file are returned without further retrieval from the back-end server, saving time and resources consumed by interacting with the back-end server. To achieve better visual effects during page transitions, pre-configured animation effects in CSS can be loaded before loading the redirected PDP page. For example, a smooth fade-out animation effect can be configured to fade out the first page and into the second page. This ensures smooth page transitions and a comfortable, natural visual experience, helping to enhance website engagement and attract more traffic. The animation effects added during page transitions can be implemented by calling pre-configured or native browser view transition effect APIs (Application Programming Interfaces).In some cases, the browser's native view transition API can only be applied to certain types of websites. For example, the Chrome browser's native View Transition API can only be applied to single-page websites. To apply the aforementioned animation effects to multi-page applications (MPAs) for a better user visual experience, if the previous PDP page is determined to be a multi-page website, the multi-page website can be configured as a single-page website. This modified single-page website can then directly call the browser's native View Transition API. FIG3 shows a data interaction diagram of a page jump processing method in another example of the present disclosure. After a user clicks on a PDP page in step 301, the browser 31 executes 302 to initiate an asynchronous request to the front-end server 32 to obtain the source file of the PDP page. This request is configured to simultaneously obtain the target page content of the PDP page. The front-end server executes 303. If the page content corresponding to the PDP page exists in the local cache, the front-end server executes 304 to return the HTML file in the cache and a JSON file containing the target page content. If the page content corresponding to the PDP page does not exist, step 305 is executed to initiate a request to the backend server 33. Based on the page data of the PDP page returned by the backend server after step 306, step 307 of server rendering is executed to generate an HTML file. Based on the generated JSON file corresponding to the target page content, the HTML file and the JSON file are returned to the browser. Step 308 is executed to cache the two files locally on the front-end server. The browser replaces the target page content in the JSON file with the DOM tree instance of the previous page and obtains the redirected PDP page by rendering the replaced DOM tree instance. When the page redirect processing solution corresponding to the embodiment of the present disclosure is implemented on the browser side, the corresponding virtual device module can be deployed in the JS code returned by the server to the website to which the page belongs, or can be deployed in the browser or the HTML file of the page. Taking the JS code as an example, the JS code can be mounted on the front-end server, the back-end server, or a CDN (Content Delivery Network) server closer to the terminal where the browser is located (to facilitate rapid execution of the JS code). The JS code is returned to the browser when the browser accesses the page or visits the website corresponding to the page for the first time.The modification operation on the page source file acquisition request can be implemented by calling an API pre-configured on the server or elsewhere, and the animation effect loaded in the CSS file can be implemented by calling the browser's native view switching effect API. Accordingly, when the page jump processing solution corresponding to the embodiments of the present disclosure is implemented on the server side, the corresponding virtual device module can be implemented as an application, service, instance, or software-based functional module, deployed on a virtual machine (VM), container, cloud server, or hardware device with data processing capabilities (such as a server or terminal device) or hardware chip (such as a CPU (Central Processing Unit), GPU (Graphics Processing Unit), or FPGA).
[0002] (Field-Programmable Gate Array, Field-Programmable Gate Array), NPU (Neural Processing Unit, Neural Processing Unit), AI (Artificial Intelligence, Artificial Intelligence) accelerator card or DPU (Data Processing Unit). It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of relevant data must comply with relevant laws, regulations, and standards in the relevant region, and corresponding operation portals are provided for users to choose to authorize or reject. The following specific embodiments describe in detail the technical solutions of this disclosure and how they solve the aforementioned technical problems. The several specific embodiments listed can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following is a detailed description of the embodiments of this disclosure in conjunction with the accompanying drawings. First embodiment: The present disclosure provides a method for processing page jumps. FIG4 is a flowchart of a method 400 for processing page jumps according to one embodiment of the present disclosure. Method 400 may include: In step S401, in response to a page jump instruction, upon determining that a first page before the jump and a second page after the jump meet a page association condition, obtaining target page content of the second page; the target page content is obtained by sending a page source file acquisition request, wherein the page source file acquisition request is configured to simultaneously obtain the target page content of the second page. The page jump instruction may be triggered in response to a page jump condition being met, such as a user clicking a product on a PDP page triggering a jump to another PDP page, or detecting a voice command instructing a page jump. The page before the jump is recorded as the first page, and the page after the jump is recorded as the second page. The first and second pages meeting the association condition means that the second page has the same or similar page frame or page content. This allows the second page to utilize the rendering results of the first page, such as the already rendered page frame or page content, during loading, thereby reducing the time spent on page loading.In one embodiment, the first and second pages can be two pages with the same page frame, with the same display content in the header, footer, and other locations related to the page frame. This eliminates the need to re-render the DOM tree instance during the rendering of the second page. Instead, the main body content, excluding the page frame, can be directly added to the already rendered DOM tree instance of the first page, simplifying the second page loading process and reducing the time consumed by page redirection. The first and second pages can be pages of a single-page website or a multi-page website. In response to a page redirection instruction, the first and second pages are first confirmed to meet page association conditions. If the page association conditions are met, it indicates that the rendering of the second page can borrow the rendering results of the first page. The target page content of the second page is obtained and combined with the rendering results of the first page, thereby accelerating the loading of the second page. The target page content is obtained by sending a page source file acquisition request. The page source file acquisition request originally indicates the acquisition of the page source file corresponding to the page. The disclosed embodiments improve this page source file acquisition request by configuring it to simultaneously acquire the target page content while acquiring the page source file. In one example, after receiving a page jump instruction, the target page content of the second page is obtained. In response to the page jump instruction, a page source file acquisition request is modified, and the page source file acquisition request to be sent is configured to simultaneously acquire the target page content of the second page while acquiring the page source file. The configured page source file acquisition request is then sent to the server. In another example, before receiving the page jump instruction, it is determined that a page content acquisition condition is satisfied, which triggers acquisition of the target page content below the second page. Upon detecting that the page content acquisition condition is currently satisfied, the page source file acquisition request is modified, and the page source file acquisition request is configured to simultaneously acquire the target page content of the second page while acquiring the page source file. The configured page source file acquisition request is then sent to the server to obtain the target page content returned simultaneously with the HTML file by the server. Subsequently, upon receiving the page jump instruction, the pre-acquired target page content is extracted for loading the second page.The target page content refers to the portion of content displayed on the second page, used to combine with the rendering results of the first page. The target page content to be retrieved can be indicated in the page source file retrieval request. For example, one or more pieces of information, such as the target page content's content type, HTML tags, and storage location, can be added to the page source file retrieval request as a page content identifier, thereby facilitating simultaneous retrieval of the target page content based on the page source file retrieval request. In one example, the target page content is the main body of the second page. HTML tags such as "meta" and "content" are added to the page source file retrieval request as page content identifiers. The meta tag is a key tag in HTML files, located between the head and title tags, and is used to describe HTML file attributes, such as the author, date and time, web page description, keywords, and page refresh. The "content" attribute is used to specify a value related to the http-equiv attribute or the name attribute. The "content" attribute is typically associated with a <meta> element and contains single-valued text specifying meta information. In step S402, the retrieved target page content is replaced with the corresponding position in the rendered DOM tree instance of the first page. The process of loading a page based on page source files such as HTML files, CSS files, and JS code generally includes: first, running JS code to parse the HTML file from top to bottom, building a DOM tree instance consisting of DOM element nodes, and including all elements of the page; second, parsing the CSS file to generate a CSS rule tree, and merging the DOM tree instance and the CSS rule tree. The merged DOM tree instance includes all visible elements in the page, with some header tags and invisible tags hidden; then, parsing the page tags in the DOM tree instance that reference external resources and those that do not reference external resources, filling the page content into the DOM tree instance, and drawing the page according to the filled DOM tree instance. The embodiment of the present disclosure improves the above rendering process, combining the target page content with the DOM tree instance after the first page has been rendered, and replacing the target page content obtained above with the corresponding position in the DOM tree instance of the first page. Specifically, the content to be replaced in the first page that needs to be replaced with the target page content of the second page can be configured to be hidden or directly deleted, and the target page content is written in the position of the content to be replaced. In step S403, the second page is loaded according to the replaced DOM tree instance.After the target page content is added to the DOM tree instance, a page can be loaded based on the replaced DOM tree instance. The loading of the second page is achieved by combining the target page content with the DOM tree instance of the first page. Compared to the page loading process of the aforementioned multi-page website, the solution of the disclosed embodiment simplifies the loading process of the second page. It does not require the step of re-rendering the DOM tree instance corresponding to the second page based on the HTML file corresponding to the second page. This saves the time and hardware resources consumed by rendering the DOM tree instance, improves page loading efficiency, and optimizes the visual experience of page jumps. In electronic transaction scenarios, this facilitates consumers to browse and select desired products more quickly. The number of pages browsed per unit time increases, increasing the likelihood of finding the desired product, improving the conversion rate of page traffic to transaction orders, and also bringing more traffic to the page and platform. Compared to the page loading process of a single-page website, since the target page content does not need to be extracted from the HTML file of the second page, the target page content can be obtained by modifying the page source file acquisition request, saving complex browser operations and improving page jump efficiency. This embodiment can be applied to a page loader, which is used to load pages and can be a browser or other application capable of loading website pages. In one embodiment, the operation of modifying the page source file acquisition request can be implemented by the page loader, by code inserted into the page, or by JavaScript code returned to the page loader when the website is accessed. Taking JavaScript code as an example, the JavaScript code monitors page-related triggering conditions or operations and executes this embodiment when a page jump instruction is detected. In one example of the disclosed embodiments, the step of obtaining the target page content of the second page can be to obtain the target page content from the server after receiving the page jump instruction. The target page content can be modified so that the page source file acquisition request carries a target page content identifier corresponding to the target page content and instructs the server to return the requested target page content along with the page source file.In another example, before receiving the page redirect instruction, the target page content may be pre-retrieved from the server in response to satisfying the conditions for obtaining the page content. In this case, the step of obtaining the target page content of the second page may include configuring the page source file retrieval request to simultaneously request the target page content in response to the set conditions for obtaining the page content. The returned target page content is then stored in the cache of the page loader, allowing the target page content to be retrieved from the cache upon subsequent receipt of the page redirect instruction. For both examples, the function of reconfiguring the page source file retrieval request sent to the server can be encapsulated as an API, referred to as a first API, which can be configured in the HTML file code, JS code, or a specific location in the page loader. By calling the first API, the request for obtaining the page source file is modified, so that the original request for obtaining only the page source file also indicates obtaining the target page content of the second page. To allow the modified page source file to specify the specific information to be obtained, the page source file obtaining request can be configured to carry a target page content identifier corresponding to the target page content. The server can obtain the corresponding target page content based on the target page content identifier. The page content identifier can be one or more of the following information: the content type, HTML tags, storage location, etc. The HTML tags can be one or more of "meta" and "content." The server can find the corresponding target page content based on the page content identifier carried in the page source file obtaining request, organize the target page content into a JSON file, and return it to the page loader. In one embodiment, after each page content is obtained, it can be stored in a storage location associated with the page loader. Therefore, the next time the same page content is requested, the target page content can be directly retrieved from the storage location associated with the page loader, without further requesting it from the server, thus saving time and hardware and software resources consumed by page redirection. Therefore, before calling the first API to modify the page source file acquisition request, the page loader's cache can be checked to see whether the target page content corresponding to the second page exists. If the target page content corresponding to the second page exists in the cache, the target page content can be directly retrieved from the cache. If not, the target page content is retrieved from the server by reconfiguring the page source file acquisition request. If the target page content does not exist in the page loader's cache and the target page content is obtained from the server, the obtained target page content can be stored in the page loader's cache for easy retrieval when the target page content is needed.The aforementioned set conditions for obtaining page content are satisfied, meaning that obtaining the page content is triggered upon detecting that the set conditions are satisfied. The obtained page content here may include the pages corresponding to one or more pages that may subsequently be redirected. The set conditions for obtaining page content can be set based on actual scenarios and needs. In one example, the set conditions may include detecting that the page focus is located at the location of a first-category data object on a first page. The page location where the mouse is hovering, the page location where a touch point is located on a touch screen, the page location where the user's face is facing, etc. may be used as the page focus. If the page focus is located at the location of a first-category data object on the first page, the location of the first-category data object may be the display location or access entry for the first-category data object. For example, in an electronic transaction scenario, the first-category data object may be a product object other than the displayed product object on a PDP page. If the page location where the mouse is hovering corresponds to the display location of a product object, which is typically also the access entry for the product object, then the conditions for obtaining the target page content on the PDP page for obtaining the product object are determined to be satisfied. In another example, the set conditions for obtaining page content may include detecting the presence of a second-category data object on the first page that meets the interaction conditions. Meeting the interaction condition indicates a high probability of further access to the second-category data object. Page redirection efficiency can be improved by pre-acquiring page content. For example, if the interaction condition is determined to be an access frequency exceeding a set threshold or belonging to a hot category, then when displaying the first page, by counting one or more product objects on the first page, excluding the displayed product object, that have a high historical access frequency or belong to a hot category, the target page content corresponding to the PDP page corresponding to the one or more product objects that meet the interaction condition can be pre-acquired and saved to the cache corresponding to the page loader. The set conditions for acquiring page content can include one or more of the above. Both the set conditions and the interaction conditions can be set according to actual needs, and this disclosure does not impose any restrictions on this.In one embodiment, the server may organize the target page content into a JSON file and return it to the page loader. When the target page content is replaced with the corresponding position in the DOM tree instance rendered by the first page, after obtaining the target page content returned according to the configured page source file acquisition request, the server may delete the page content corresponding to the target page content identifier from the DOM tree instance of the first page, or modify the page content corresponding to the target page content identifier to be hidden, and fill the target page content into the content area corresponding to the target page element. This allows the modified DOM tree instance corresponding to the first page to display the target page content corresponding to the second page after loading. In one embodiment, when loading the second page based on the replaced DOM tree instance, a Hydrate injection operation is first performed on the replaced DOM tree instance. Specifically, the string in the DOM tree instance is converted into an interactive component, so that the injected DOM tree instance can be loaded as an interactive page. An API (referred to as the second API) in the page loader is then called to load the animation effects in the CSS file. The second page is then loaded based on the injected DOM tree instance. The second API can be the View Transition API built into the Chrome browser. It pre-configures a page jump event monitoring function in the DOM tree instance. Upon detecting a page jump event, it replaces the animation effects in the CSS file for a portion of the content in the DOM tree instance. When switching between pages, the View Transition API adds animation to create a set of transition images, representing the image before and after the page state transition, such as a fade-in and fade-out transition effect. This reduces the cognitive load and perceived loading delay caused by page jumps. The first and second pages meet page association conditions, allowing the rendering of the second page to leverage the rendering results of the first page. In one embodiment, determining that the first page before the jump and the second page after the jump meet the page association conditions can include determining that the first page before the jump and the second page after the jump correspond to a predetermined page type, such as a PDP page. Other page association conditions may also be defined, such as determining whether the first and second pages belong to the same predetermined website, or whether the first and second pages have the same header and footer.In one embodiment, if it is determined that the first page before the redirect and the second page after the redirect meet page association conditions, and if it is determined that the second API (e.g., the View Transition API) cannot be called because the first page belongs to a multi-page website, the multi-page website can be configured as a single-page website, allowing the modified single-page website to directly call the browser's native second API. In one embodiment, after obtaining the target page content of the second page, it can be saved to the page loader's cache for direct retrieval the next time it is used, saving the time spent retrieving it from the server. Second embodiment: From the perspective of the server, an embodiment of the present disclosure provides a method for providing page content. FIG5 shows a flowchart of a method 500 for providing page content according to an embodiment of the present disclosure. This method 500 may include: In step 501, a page source file acquisition request is received, wherein the page source file acquisition request is configured to simultaneously obtain the target page content of the second page. In step 502, the target page content is returned based on the page source file acquisition request. In response to the page jump instruction, the target page content is replaced at the corresponding position of the DOM tree instance rendered by the first page, if it is determined that the first page before the jump and the second page after the jump meet the page association condition, so that the second page is loaded based on the replaced DOM tree instance. In one embodiment, when returning the target page content based on the page source file acquisition request, the target page content can be extracted from the page source file of the second page based on the target page content identifier indicated in the page source file acquisition request. The target page content is then encapsulated into a JSON file and returned to the page loader along with the page source file. In one embodiment, before extracting the target page content from the page source file of the second page based on the target page content identifier indicated in the page source file acquisition request, it is also possible to first determine whether the target page content corresponding to the second page exists in the server's local cache. If so, the target page content can be directly retrieved from the front-end server, saving the time spent retrieving files from the back-end server. If not, the target page content is further retrieved from the back-end server. In one embodiment, after obtaining the target page content corresponding to the second page, the target page content can also be saved in the cache of the front-end server, so that when the same terminal or a different terminal subsequently requests the target page content, the target page content can be directly retrieved from the cache of the front-end server.Third embodiment: The target page content can be obtained in response to a page jump instruction, or before receiving the page jump instruction. An embodiment is provided below from the perspective of obtaining the target page content. FIG6 is a flowchart of a method 600 for obtaining a page file according to an embodiment of the present disclosure. The method 600 may include: In step S601, in response to satisfying a condition for obtaining page content, calling a first API to configure a page source file acquisition request to simultaneously request the target page content of a second page. In step S602, the target page content fed back according to the configured page source file acquisition request is obtained. The target page content is used to replace the target page content at a corresponding position in the DOM tree instance rendered by the first page in response to the page jump instruction, if it is determined that the first page before the jump and the second page after the jump meet the page association condition, so as to load the second page according to the replaced DOM tree instance. Fourth embodiment: The following provides an embodiment for pre-acquiring target page content. FIG7 is a flowchart of a page redirect processing method 700 according to an embodiment of the present disclosure. Method 700 may include: In step S701, when displaying a first page, in response to satisfying a page content acquisition condition, acquiring target page content of another page and saving it in a cache of a page loader. In step S702, in response to a page redirect instruction, if it is determined that the first page before the redirect and the second page after the redirect meet a page association condition, extracting the target page content of the second page from the cache of the page loader. In step S703, replacing the returned target page content with the corresponding position of the DOM tree instance rendered by the first page. In step S604, loading the second page based on the replaced DOM tree instance. Fifth embodiment: The following provides an embodiment for a scheme for obtaining target page content in response to a page jump request. The embodiment of the present disclosure provides a method for processing page jumps. FIG8 is a flowchart of a method 800 for processing page jumps according to an embodiment of the present disclosure. The method 800 may include: In step S801, in response to a page jump instruction, when it is determined that the first page before the jump and the second page after the jump meet a page association condition, determining that the target page content of the second page does not exist in the cache of the page loader. In step S802, the page source file acquisition request is configured to simultaneously obtain the target page content of the second page, and the target page content of the second page returned in response to the page source file acquisition request is received. In step S803, the obtained target page content is replaced with the corresponding position of the DOM tree instance rendered by the first page.In step S804, the second page is loaded based on the replaced DOM tree instance. Sixth embodiment: The following provides an embodiment for the case where the first and second pages are PDP pages. FIG9 shows a flowchart of a method 900 for processing page redirection according to an embodiment of the present disclosure. Method 900 may include: In step S901, when displaying the first product details page, in response to satisfying a condition for obtaining the page content of other product details pages, obtaining the main content of at least one other product details page and saving it in a cache of a page loader. In step S902, in response to a page redirect instruction, if it is determined that the page after redirection is the second product details page, extracting the main content of the second product details page from the cache of the page loader. In step S903, loading the second product details page based on the obtained target page content. Seventh embodiment: Corresponding to the above examples and method embodiments provided in the present disclosure, the present disclosure also provides a device for processing page redirection. FIG10 is a block diagram of a page redirect processing device 1000 according to an embodiment of the present disclosure. Applicable to a page loading program, the device 1000 may include: a page content acquisition module 1001 for, in response to a page redirect instruction, acquiring target page content of the second page if it is determined that the first page before the redirect and the second page after the redirect meet a page association condition; the target page content is acquired by sending a page source file acquisition request configured to simultaneously acquire the target page content of the second page; a content replacement module 1002 for replacing the acquired target page content with a corresponding position in a DOM tree instance rendered by the first page; and a page loading module 1003 for loading the second page based on the replaced DOM tree instance. In one embodiment, the page content acquisition module includes: a request modification submodule for calling a first API to modify a request for acquiring a page source file so that the request simultaneously requests the target page content of a second page while simultaneously requesting the page source file, and the modified request carries a target page content identifier corresponding to the target page content; and a content reception submodule for receiving the target page content of the second page returned in response to the page source file acquisition request. In one embodiment, the page content acquisition module also includes: a cache determination submodule for determining that the target page content corresponding to the second page does not exist in a cache associated with a page loader before calling the first API to modify the request for acquiring the page source file.The method further includes: a cache saving module for saving the target page content of the second page to the cache of the page loader. In one embodiment, the page content acquisition module includes: a cache extraction submodule for extracting the target page content of the second page from the cache corresponding to the page loader, if the target page content of the second page exists in the cache corresponding to the page loader. In one embodiment, the method further includes: a request modification module for, in response to satisfying a set condition for acquiring page content, calling the first API to configure the page source file acquisition request to also request the target page content, and sending the configured page source file acquisition request; and a cache saving module for saving the target page content of the second page returned in response to the page source file acquisition request in the cache of the page loader. In one embodiment, the set condition for acquiring page content includes at least one of the following: detecting that the page focus is located at a first-category data object in the first page; detecting that a second-category data object that meets an interaction condition exists in the first page. In one embodiment, the content replacement module includes: a content acquisition module for acquiring the target page content returned in response to a configured page source file acquisition request; a content processing submodule for deleting or hiding the page content corresponding to the target page content identifier in the DOM tree instance of the first page, and filling the target page content into the content area corresponding to the target page element. In one embodiment, the page loading module includes: a watering submodule for performing a watering operation on the replaced DOM tree instance so that the watered DOM tree instance can be loaded as an interactive page; an animation loading submodule for invoking a second API in the page loading program to load animation effects in a cascading style sheet; and an instance loading submodule for loading a second page based on the watered DOM tree instance. In one embodiment, the page association conditions satisfied by the first page before the jump and the second page after the jump include: the first page before the jump and the second page after the jump each correspond to a set page type. In one embodiment, the method further includes: a page modification module configured to, upon determining that the first page before the redirection and the second page after the redirection meet a page association condition, configure the multi-page website as a single-page website if the first page belongs to a multi-page website. Eighth Embodiment: Corresponding to the above examples and method embodiments provided in the embodiments of the present disclosure, the embodiments of the present disclosure further provide an apparatus for providing page content.FIG11 is a block diagram of a page content providing apparatus 1100 according to an embodiment of the present disclosure. The apparatus 1100 can be deployed on a server. The apparatus 1100 may include: a request receiving module 1101 for receiving a page source file acquisition request, wherein the page source file acquisition request is configured to simultaneously acquire target page content for a second page; a page content returning module 1102 for returning target page content based on the page source file acquisition request. The target page content is replaced at the corresponding position of the rendered DOM tree instance of the first page in response to a page jump instruction, if it is determined that the first page before the jump and the second page after the jump meet page association conditions, so that the second page is loaded based on the replaced DOM tree instance. In one embodiment, the page content returning module includes: a page content extraction submodule for extracting the target page content from the page source file of the second page based on the target page content identifier indicated in the page source file acquisition request; and a file returning submodule for encapsulating the target page content into a JSON file and returning it to the page loader along with the page source file. In one embodiment, the page content return module further includes: a cache determination submodule for determining that the target page content corresponding to the second page does not exist in the server-side local cache before extracting the target page content from the page source file of the second page according to the target page content identifier indicated by the page source file acquisition request; and the device further includes: a cache module for saving the target page content corresponding to the second page to the cache of the front-end server. Ninth embodiment: Corresponding to the above-mentioned examples and method embodiments provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a device for acquiring page files. FIG12 is a block diagram of a device 1200 for acquiring page files according to an embodiment of the present disclosure. The device 1200 may include: a request configuration module 1201 for, in response to satisfying a page content acquisition condition, calling a first API to configure the page source file acquisition request to simultaneously request the target page content of the second page. The content acquisition module 1202 is configured to acquire target page content fed back in accordance with the configured page source file acquisition request. The target page content is used to replace the target page content at a corresponding position in the DOM tree instance rendered by the first page in response to the page jump instruction, if it is determined that the first page before the jump and the second page after the jump meet a page association condition, so as to load the second page according to the replaced DOM tree instance.Tenth Embodiment: Corresponding to the above-mentioned examples and method embodiments provided in the embodiments of the present disclosure, the embodiments of the present disclosure further provide a device for processing page jumps. FIG13 shows a block diagram of a device 1300 for processing page jumps according to one embodiment of the present disclosure. Device 1300 may include: a content acquisition module 1301 for, when displaying a first page, obtaining target page content of another page and storing it in a cache of a page loader in response to a page content acquisition condition being met; a content extraction module 1302 for, in response to a page jump instruction, extracting the target page content of the second page from the cache of the page loader if it is determined that the first page before the jump and the second page after the jump meet a page association condition; a content replacement module 1303 for replacing the returned target page content with the corresponding position of the DOM tree instance rendered by the first page; and a page loading module 1304 for loading the second page based on the replaced DOM tree instance. Eleventh Embodiment: Corresponding to the above-mentioned examples and method embodiments provided in the embodiments of the present disclosure, the embodiments of the present disclosure further provide a device for processing page jumps. FIG14 is a block diagram of a page redirect processing device 1400 according to an embodiment of the present disclosure. Device 1400 may include: a cache determination module 1401, configured to, in response to a page redirect instruction, determine that the target page content of the second page does not exist in the cache of the page loader if it is determined that the first page before the redirect and the second page after the redirect meet a page association condition; a request configuration module 1402, configured to configure a page source file acquisition request to simultaneously acquire the target page content of the second page; a content receiving module 1403, configured to receive the target page content of the second page returned in response to the page source file acquisition request; a content replacement module 1404, configured to replace the acquired target page content with a corresponding position in the DOM tree instance rendered by the first page; and a page loading module 1405, configured to load the second page based on the replaced DOM tree instance. Twelfth Embodiment: Corresponding to the above examples and method embodiments provided in the present disclosure, the present disclosure also provides a page redirect processing device. FIG15 is a block diagram of a page redirect processing device 1500 according to an embodiment of the present disclosure. Device 1500 may include: a content acquisition module 1501 configured to, when displaying a first product details page, acquire the main content of at least one other product details page in response to satisfying a condition for acquiring the page content of other product details pages; and a content storage module 1502 configured to store the content in a cache of a page loader.Cache extraction module 1503 is configured to, in response to a page jump instruction and upon determining that the page after the jump is the second product details page, extract the main content of the second product details page from the cache of the page loader. Page loading module 1504 is configured to load the second product details page based on the retrieved target page content. The functions of each module in each apparatus of the embodiments of the present disclosure can be found in the corresponding descriptions of the above-described methods, and they provide corresponding beneficial effects, so they are not further described here. Figure 16 is a block diagram of an electronic device for implementing the embodiments of the present disclosure. As shown in Figure 16, the electronic device includes a memory 1601 and a processor 1602. Memory 1601 stores a computer program executable by processor 1602. When processor 1602 executes the computer program, it implements the methods of the above-described embodiments. There may be one or more memory 1601 and processor 1602. The electronic device also includes a communication interface 1603 for communicating with external devices and exchanging data. If the memory 1601, processor 1602, and communication interface 1603 are implemented independently, they may be interconnected via a bus and communicate with each other. This bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG16 shows only one thick line, but this does not mean that there is only one bus or only one type of bus. Optionally, in a specific implementation, if the memory 1601, processor 1602, and communication interface 1603 are integrated on a single chip, the memory 1601, processor 1602, and communication interface 1603 may communicate with each other via an internal interface. Embodiments of the present disclosure provide a computer-readable storage medium storing a computer program. When executed by a processor, the program implements the methods provided in the embodiments of the present disclosure. Embodiments of the present disclosure also provide a computer program product including the computer program. When executed by a processor, the computer program implements the methods provided in any embodiment of the present disclosure.The present disclosure also provides a chip including a processor configured to retrieve and execute instructions stored in a memory, thereby enabling a communication device equipped with the chip to perform the methods provided in the present disclosure. The present disclosure also provides a chip including an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected via an internal connection path. The processor is configured to execute code in the memory. When the code is executed, the processor performs the methods provided in the present disclosure. It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture. Furthermore, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example and not limitation, many forms of RAM may be used.For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). In the above embodiments, they can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present disclosure are fully or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. In the description of this disclosure, reference to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of this disclosure. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and integrate the different embodiments or examples described in this disclosure, as well as features from different embodiments or examples, unless otherwise specified. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include at least one of those features. In the description of this disclosure, "plurality" means two or more, unless otherwise specifically defined.Any process or method described in a flowchart or otherwise herein can be understood to represent a module, segment, or portion of code comprising one or more executable instructions for implementing a specific logical function or process step. Furthermore, the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions substantially simultaneously or in reverse order depending on the functions involved. The logic and / or steps described in a flowchart or otherwise herein, for example, can be considered a sequenced list of executable instructions for implementing the logical functions and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such an instruction execution system, apparatus, or device. It should be understood that various aspects of the present disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the aforementioned embodiments, various steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the method in the above-described embodiments can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiment. Furthermore, the functional units in the various embodiments of the present disclosure can be integrated into a single processing module, each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated modules can be implemented in either hardware or software functional modules. If the integrated modules are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a magnetic disk, or an optical disk. The above are merely exemplary embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any person skilled in the art can easily conceive of various variations and substitutions within the technical scope of the present disclosure, and such variations and substitutions are intended to be encompassed by the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.
Claims
Claims 1. A page jump processing method, applied to a page loading program, comprising: In response to a page jump instruction, if it is determined that a first page before the jump and a second page after the jump meet a page association condition, target page content of the second page is obtained; wherein the target page content is obtained by sending a page source file acquisition request, and the page source file acquisition request is configured to simultaneously acquire the target page content of the second page; the acquired target page content is replaced at a corresponding position of a Document Object Model (DOM) tree instance rendered by the first page; and the second page is loaded according to the replaced DOM tree instance.
2. The method according to claim 1, wherein: Obtaining the target page content of the second page includes: calling a first API to modify a request for obtaining a page source file, so that the request for obtaining the target page content of the second page simultaneously requests obtaining the page source file, and the modified request for obtaining the page source file carries a target page content identifier corresponding to the target page content; and receiving the target page content of the second page returned in response to the request for obtaining the page source file.
3. The method according to claim 2, wherein: Before calling the first API to modify the request for obtaining the page source file, obtaining the target page content of the second page also includes: determining that the target page content corresponding to the second page does not exist in the cache related to the page loader; after obtaining the target page content of the second page, the method also includes: saving the target page content of the second page to the cache of the page loader.
4. The method according to claim 1, wherein: The acquiring the target page content of the second page includes: when the target page content of the second page exists in the cache corresponding to the page loader, extracting the target page content from the cache.
5. The method according to claim 4, wherein: The method further includes: in response to satisfying a set condition for obtaining page content, calling a first API to configure a page source file acquisition request to simultaneously request target page content, and sending the configured page source file acquisition request; and saving the target page content of the second page returned in response to the page source file acquisition request in a cache of the page loader.
6. The method according to claim 5, wherein: The set conditions for obtaining the page content include at least one of the following: detecting that the page focus is located at a position of a first type of data object in the first page; detecting that a second type of data object that meets the interaction condition exists in the first page.
7. The method according to any one of claims 1 to 6, wherein: The replacing of the obtained target page content to the corresponding position of the DOM tree instance rendered by the first page includes: obtaining the target page content returned by the configured page source file acquisition request; deleting or hiding the page content corresponding to the target page content identifier in the DOM tree instance of the first page; And fill the target page content into the content area corresponding to the target page element.
8. The method according to any one of claims 1 to 7, wherein: The loading of the second page according to the replaced DOM tree instance includes: performing a water injection operation on the replaced DOM tree instance so that the water-injected DOM tree instance can be loaded as an interactive page; calling a second API in a page loading program to load an animation effect in a cascading style sheet; and loading the second page according to the water-injected DOM tree instance.
9. The method according to any one of claims 1 to 8, wherein: The determining that the first page before the jump and the second page after the jump meet the page association condition includes: determining that the first page before the jump and the second page after the jump correspond to set page types respectively.
10. The method according to claim 9, wherein: The method further includes: when it is determined that the first page before the jump and the second page after the jump meet the page association condition, if the first page belongs to a multi-page website, configuring the multi-page website as a single-page website.
11. A method for providing page content, applied to a server, the method comprising: receiving a page source file acquisition request, wherein the page source file acquisition request is configured to simultaneously acquire target page content of a second page; Returning target page content according to the page source file acquisition request, the target page content is used to respond to the page jump instruction, and when it is determined that the first page before the jump and the second page after the jump meet a page association condition, replace the target page content at a corresponding position of the DOM tree instance rendered by the first page, so as to load the second page according to the replaced DOM tree instance.
12. The method according to claim 11, wherein: Returning the target page content according to the page source file acquisition request includes: extracting the target page content from the page source file of the second page according to the target page content identifier indicated by the page source file acquisition request; and encapsulating the target page content into a JSON file and returning it together with the page source file to the page loader.
13. The method according to claim 12, wherein: Before extracting the target page content from the page source file of the second page according to the target page content identifier indicated by the page source file acquisition request, returning the target page content according to the page source file acquisition request also includes: determining that the target page content corresponding to the second page does not exist in the local cache of the server; the method also includes: saving the target page content corresponding to the second page to the cache of the front-end server.
14. A method for obtaining a page file, the method comprising: In response to satisfying the acquisition conditions of the page content, calling the first API to configure the page source file acquisition request to simultaneously request the target page content of the second page; Obtain target page content fed back by the request based on the configured page source file, wherein the target page content is used to respond to the page jump instruction and, if it is determined that a first page before the jump and a second page after the jump meet a page association condition, replace the target page content at a corresponding position of the DOM tree instance rendered by the first page to load the second page according to the replaced DOM tree instance.
15. A method for processing page jumps, comprising: When displaying the first page, in response to satisfying the acquisition condition of the page content, acquiring the target page content of other pages and saving it in the cache of the page loader; In response to the page jump instruction, if it is determined that the first page before the jump and the second page after the jump meet the page association condition, extract the target page content of the second page from the cache of the page loader; replace the returned target page content with the corresponding position of the DOM tree instance rendered by the first page; Load the second page based on the replaced DOM tree instance.
16. A method for processing page jumps, comprising: In response to the page jump instruction, if it is determined that the first page before the jump and the second page after the jump meet a page association condition, determining that the target page content of the second page does not exist in the cache of the page loader; configuring the page source file acquisition request to simultaneously acquire the target page content of the second page, receiving the target page content of the second page returned in response to the page source file acquisition request; and replacing the acquired target page content with a corresponding position of the DOM tree instance rendered by the first page; Load the second page based on the replaced DOM tree instance.
17. A method for processing page jumps, comprising: When displaying the first product details page, in response to satisfying a condition for obtaining the page content of other product details pages, obtaining the main content of at least one other product details page and saving it in a cache of the page loader; In response to the page jump instruction, if it is determined that the page after the jump is the second product details page, extract the main content of the second product details page from the cache of the page loader; and load the second product details page according to the obtained target page content.
18. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 17 when executing the computer program.
19. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 17 is implemented.
20. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 17 is implemented.
Citation Information
Patent Citations
Page jump processing method and device, page content providing method and device and storage medium
CN118113398A
Page access method and device
CN102902805A
Web application page rendering optimization
CN104933078A
Page switching intelligent animation effect application method and system
CN108536832A
General WEB page layout generation device and method
CN111259286A
Cited By
Page processing method and system, electronic equipment, storage medium and program product
CN120763424A