CN118113398A - Page jump processing method, page content providing device and storage medium - Google Patents

Page jump processing method, page content providing device and storage medium Download PDF

Info

Publication number
CN118113398A
CN118113398A CN202410160622.4A CN202410160622A CN118113398A CN 118113398 A CN118113398 A CN 118113398A CN 202410160622 A CN202410160622 A CN 202410160622A CN 118113398 A CN118113398 A CN 118113398A
Authority
CN
China
Prior art keywords
page
content
target
source file
jump
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410160622.4A
Other languages
Chinese (zh)
Inventor
安德烈马卡霍夫
王然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Singapore Holdings Pte Ltd
Filing date
Publication date
Application filed by Alibaba Singapore Holdings Pte Ltd filed Critical Alibaba Singapore Holdings Pte Ltd
Publication of CN118113398A publication Critical patent/CN118113398A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a processing method, a device and a storage medium for page skip, wherein a request for acquiring a page source file is modified, the page source file acquisition request is configured to acquire partial page contents in a page as target page contents while the page source file is acquired, and when page skip operation is responded and the condition that pages before and after skip meet page association conditions is determined, the target page contents are replaced to corresponding positions in a DOM tree instance which is already rendered by a first page, and a second page is directly loaded according to the replaced DOM tree instance. According to the embodiment of the application, the acquisition of partial content of the second page is realized by modifying the page source file acquisition request, the second page is loaded by combining the DOM tree instance of the loaded first page by taking the partial content as the basis of loading the page, the DOM tree corresponding to the second page is not required to be rendered, and the time and software and hardware resources consumed by DOM tree rendering are saved.

Description

Page jump processing method, page content providing device and storage medium
Technical Field
The present application relates to the field of information processing, and in particular, to a processing method for page skip, a page content providing method, an acquisition method for a page file, an electronic device, and a storage medium.
Background
Electronic trading platforms have evolved rapidly in recent years to provide great convenience to consumers, who typically select objects of purchase by retrieving desired goods and by jumping and comparing between web pages, as a shopping channel that most users will choose.
In the process of accessing commodity transaction websites, the loading fluency of the webpages is very important to consumer experience and flow conversion rate, particularly in the process of jumping from one webpage to another webpage under the condition of low internet speed, the consumption time is long, the phenomenon of blocking or even white screen is easy to occur, the consumer experience is poor, the whole website browsing process is very slow, the consumers are not easy to find required commodities as soon as possible, and excessive meaningless consumption of various hardware service resources such as equipment at the consumer end, a website server and the like is caused by the webpage access without transaction conversion.
Disclosure of Invention
The embodiment of the application provides a processing method for page skip, a page content providing method, an acquisition method for page files, electronic equipment and a storage medium, which are used for solving one or more of the technical problems.
In a first aspect, an embodiment of the present application provides a method for processing a page jump, which is applied to a page loader, where the method includes: responding to a page jump instruction, and acquiring target page content of a second page under the condition that the first page before jump and the second page after jump meet page association conditions; the target page content is obtained by sending a page source file obtaining request, wherein the page source file obtaining request is configured to obtain target page content of a second page at the same time; replacing the obtained target page content to the corresponding position of the DOM tree instance rendered by the first page; and loading a second page according to the replaced DOM tree instance.
In a second aspect, an embodiment of the present application provides a method for providing page content, which is applied to a server, where the method includes: receiving a page source file acquisition request, wherein the page source file acquisition request is configured to acquire target page contents of a second page at the same time; and returning target page content according to the page source file acquisition request, wherein the target page content is used for responding to a page jump instruction, and replacing the target page content to the corresponding position of the DOM tree instance rendered by the first page under the condition that the first page before jumping and the second page after jumping meet page association conditions, so as to load the second page according to the replaced DOM tree instance.
In a third aspect, an embodiment of the present application provides a method for acquiring a page file, where the method includes: in response to meeting the acquisition condition of the page content, calling a first API to configure a page source file acquisition request to simultaneously request target page content of a second page; and acquiring target page contents fed back according to the configured page source file acquisition request, wherein the target page contents are used for responding to a page jump instruction, and replacing the target page contents to the 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 under the condition that the first page before the jump and the second page after the jump meet page association conditions.
In a fourth aspect, an embodiment of the present application provides a method for processing a page jump, including: when a first page is displayed, acquiring target page contents of other pages in response to the condition that the acquisition of the page contents is met, and storing the target page contents in a cache of a page loader; responding to a page jump instruction, and extracting target page content of a first page before jump and a second page after jump from a cache of the page loader under the condition that the first page and the second page meet page association conditions; replacing the returned target page content to the corresponding position of the DOM tree instance of the first page rendering; and loading a second page according to the replaced DOM tree instance.
In a fifth aspect, an embodiment of the present application provides a method for processing a page jump, including: responding to a page jump instruction, and determining that target page content of a second page does not exist in a cache of a page loader under the condition that the first page before jump and the second page after jump meet page association conditions; configuring a page source file acquisition request to acquire target page contents of a second page at the same time, and receiving the target page contents of the second page returned by aiming at the page source file acquisition request; replacing the obtained target page content to the corresponding position of the DOM tree instance rendered by the first page; and loading a second page according to the replaced DOM tree instance.
In a sixth aspect, an embodiment of the present application provides a method for processing a page jump, including: when the first commodity detail page is displayed, acquiring main body contents of at least one other commodity detail page and storing the main body contents in a cache of a page loader in response to the condition that the acquisition condition of page contents of other commodity detail pages is met; responding to a page jump instruction, and under the condition that the page after jump is determined to be a second commodity detail page, extracting main content of the second commodity detail page from a cache of the page loader; and loading the second commodity detail page according to the acquired target page content.
In a seventh aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory, the processor implementing the method of any one of the preceding claims when the computer program is executed.
In an eighth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program implementing the method of any one of the preceding claims when executed by a processor.
In a ninth aspect, embodiments of the present application provide a computer program product comprising a computer program/instruction which, when executed by a processor, implements a method as claimed in any preceding claim.
Compared with the related art, the application has the following advantages:
According to the embodiment of the application, the request for acquiring the page source file is modified, the page source file acquisition request is configured to acquire part of page contents in the page as target page contents while acquiring the page source file, and when the page jump operation is responded and the page before and after the jump is determined to meet the page association condition, the target page contents acquired through the mode are replaced to the corresponding positions in the DOM tree instance where the first page is already rendered, so that the second page can be directly loaded according to the replaced DOM tree instance. Therefore, the embodiment of the application realizes the acquisition of partial content of the second page by modifying the page source file acquisition request, takes the partial content as the basis of loading the page, loads the second page by combining the DOM tree instance of the loaded first page without rendering the DOM tree instance corresponding to the second page, saves the time and software and hardware resources consumed by rendering the DOM tree instance, can improve the speed of loading the second page, optimizes the visual experience of page jump, is convenient for consumers to browse and select required commodities more quickly in an electronic transaction scene, increases the number of pages browsed in unit time, increases the possibility of finding the required commodities, improves the conversion rate of page flow to transaction orders, and simultaneously introduces more flow for the pages and the platform. Because the required target page content is directly obtained, a mode of analyzing the content from the page source file is not needed, and the time consumed by loading the second page can be saved.
The modified page source file obtaining request can be triggered when the setting condition for obtaining the page content is met before responding to the page jump instruction, that is, the target page content of the second page is obtained in advance before determining to jump to the second page, and the target page content which is obtained and stored in advance can be directly obtained after responding to the instruction for jumping to the second page, so that the time consumed for loading the second page is further shortened, and the visual effect of page jump is smoother.
The server can store the target page content into the cache of the front-end server after providing the target page content of the second page, and other terminals can directly acquire the target page content from the front-end server when requesting the target page content of the second page, so that the loading efficiency of the plurality of terminals to the second page can be improved without further calling from the rear-end server.
In the process of loading the second page, the animation effect in the cascading style sheet can be loaded by the second API of the page loader, the smooth and silky effect of the page jump can be formed by smoothly fading out the first page and entering the animation of the second page, the visual experience of the page jump is improved, the viscosity of a website is enhanced, and more access flow is introduced.
And when the first page is determined to belong to a multi-page website, the multi-page website can be configured into a single-page website, so that the modified single-page website can directly call a second API of the page loader, and the effect can be applied to various types of page loaders.
The foregoing description is only an overview of the present application, and is intended to provide a better understanding of the technical means of the present application, as it is embodied in the present specification, and is intended to provide a better understanding of the above and other objects, features and advantages of the present application, as it is embodied in the following description.
Drawings
In the drawings, the same reference numerals refer to the same or similar parts or elements throughout the several views unless otherwise specified. The figures are not necessarily drawn to scale. It is appreciated that these drawings depict only some embodiments according to the application and are not therefore to be considered limiting of its scope.
FIG. 1 is a diagram showing data interaction of page jumps in the related art;
FIG. 2 illustrates a data interaction diagram of a page jump in one example of an embodiment of the application;
FIG. 3 shows a data interaction diagram of a page jump in another example of an embodiment of the application;
FIG. 4 is a flowchart of a method for processing a page jump according to an embodiment of the present application;
FIG. 5 is a flowchart of a method for providing page content according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for acquiring a page file according to an embodiment of the present application;
FIG. 7 is a flowchart of a method for processing a page jump according to an embodiment of the present application;
FIG. 8 is a flowchart of a method for processing a page jump provided in an embodiment of the present application;
FIG. 9 is a flowchart of a method for processing a page jump provided in an embodiment of the present application;
FIG. 10 is a block diagram of a page jump processing device according to an embodiment of the present application;
fig. 11 is a block diagram showing a configuration of a page content providing apparatus provided in an embodiment of the present application;
FIG. 12 is a block diagram showing a construction of a device for acquiring a page file according to an embodiment of the present application;
FIG. 13 is a block diagram of a page skip processing device according to an embodiment of the present application;
FIG. 14 is a block diagram of a page skip processing device according to an embodiment of the present application;
FIG. 15 is a block diagram of a page skip processing device according to an embodiment of the present application;
Fig. 16 shows a block diagram of an electronic device for implementing an embodiment of the application.
Detailed Description
Hereinafter, only certain exemplary embodiments are briefly described. As will be recognized by those skilled in the pertinent art, the described embodiments may be modified in numerous different ways without departing from the spirit or scope of the present application. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
In order to facilitate understanding of the technical solutions of the embodiments of the present application, the following describes related technologies of the embodiments of the present application. The following related technologies may be optionally combined with the technical solutions of the embodiments of the present application, which all belong to the protection scope of the embodiments of the present application.
In the related art, web page loading techniques are generally classified into SSR (server rendering, server-SIDE RENDERING) and CSR (client rendering, CLIENT SIDE RENDERING). Taking a browser loading webpage as an example, after the browser initiates a page request, the SSR rendering finishes the splicing of an HTML (HyperText Markup Language ) file by a server and sends the HTML file to the browser, and the browser renders a page with content after analyzing the HTML file; in the CSR rendering process, after the browser requests the page, the server returns an HTML file without specific content to the browser as a page frame, the browser further generates a complete HTML file according to the page frame, and dynamically renders the page content and data into the page, so that the display of the page is completed. Because the client side rendering needs to dynamically create a complete HTML file, more codes need to be executed, and the first screen performance is slower, compared with the method, the client side can acquire the HTML file which can be directly displayed from the server under the server rendering scheme, and the display experience of the first screen can be optimized.
Referring to fig. 1, a schematic diagram of interaction between a browser and a server in a page skip process in the related art is shown, taking skip between Product detail pages (PDP, product DETAIL PAGES) of an electronic transaction website as an example, other products are usually recommended in the Product detail page corresponding to one Product, and the Product detail page of the other Product can be further opened by accessing the other Product. From the perspective of data interaction, the user clicks on a commodity in one PDP page, the browser 11 executes 101 to initiate an acquisition request for another PDP page corresponding to the commodity, the acquisition request indicates to acquire a page source file of the PDP page, the page source file is requested from the back-end server 13 through the front-end server 12 executes 102, the back-end server searches for the page source file corresponding to the PDP page and the front-end server executes 103 responds to the front-end server, the front-end server executes 104 sends the page source file to the browser, and the browser loads the PDP page according to the page source file.
The loading process of the browser end is different for different types of web pages. For a multi-page website, each page is an independent complete page, when a new page is accessed in the same website, each page needs to send an HTTP request to a server, and page source files such as corresponding HTML, CSS (CASCADING STYLE SHEETS ), JS (JavaScript) and the like are acquired again, and further the jumped page is loaded according to the acquired page source files. The single-page website consists of a shell page and a plurality of page fragments, a common basic framework is arranged among the pages, when a new page is accessed in the same website, a corresponding page source file is re-acquired from a server, a browser extracts page contents which are different from a previous page and need to be updated from the new HTML file, and the page contents which need to be updated are loaded into the previous page.
The embodiment of the application provides a processing scheme of page skip, and an interaction schematic diagram of a browser and a server in the processing scheme of page skip is shown in fig. 2. When a certain website is accessed through the browser 21, the server returns to the browser that the page source file corresponding to the website includes JS (JavaScript) files for executing processing related to the page, after the user clicks on a commodity in a PDP page, the JS code executes judgment to determine that the page source file is a jump between PDP pages, and further executes 201 to reconfigure the page source file acquisition request, so that the page source file acquisition request sent to the front-end server 22 requests part of page contents (recorded as target page contents) in the page after the jump while acquiring the page HTML files, for example, the target page contents include contents corresponding to identifiers of meta (used for describing HTML file attributes), content (web page contents) and other keywords in the page source file. The front end server execution 202 looks up whether there is an already acquired page source file and target page content in the cache. If so, the execution 203 organizes the content of the target page into a JSON file format, and returns the JSON file and the HTML file to the browser, the browser execution 208 can directly replace the JSON file to the corresponding position of the DOM tree instance of the page document object model, the previous PDP page has been rendered, a new DOM tree instance is generated, the DOM tree instance can be changed into a usable component from a character string by performing the water filling process on the updated DOM tree instance, and the execution 209 loads the water filled DOM tree instance to display the skipped PDP page. If not, execution 204 is performed, the page source file and target page content are requested from the back-end server 23, and after the back-end server executes 205 a response, the front-end server executes 206 to return the page source file and target page content organized in JSON format to the browser.
In this way, by modifying the page source file obtaining request, part of the content of the PDP page after the jump is directly obtained, the obtained part of the content is used as the basis of the loaded page, and the second page is loaded by combining the DOM tree instance of the previous page which has been loaded. Compared with the scheme that the DOM tree instance is directly re-rendered according to the HTML file of the PDP page after the multi-page website jumps, the time and software and hardware resources consumed by rendering the DOM tree instance are saved, the page loading efficiency can be improved, the visual experience of page jumps is optimized, under the electronic transaction scene, a consumer can conveniently and rapidly browse and select required commodities, the number of pages browsed in unit time is increased, the possibility of finding the required commodities is increased, the conversion rate of page traffic to transaction orders is improved, and more traffic is introduced to the pages and the platform. Because the required target page content is directly acquired, the operation of analyzing the content from the page source file is not required to be executed, and the time consumed for loading the skipped PDP page can be saved. Compared with the page loading process of a single-page website, the browser in the embodiment of the application does not need to extract updated page contents from the HTML file, but can directly request the page contents of the DOM tree instance capable of being filled with the previous PDP page from the server, thereby saving the complex operation of the browser and improving the efficiency of page skip.
After the target page content of the PDP page after the jump is provided, the front-end server may execute 207 to store the target page content in the cache of the front-end server, and if the same terminal or other terminals request the target page content of the PDP page later, the target page content may be directly extracted from the cache of the front-end server, without further acquisition from the back-end server, so that loading efficiency of the multiple terminals on the PDP page after the jump is improved. And correspondingly applying to the example, searching whether the same terminal or other terminals acquire the target page content stored when the PDP page is acquired in the cache, and if so, executing the return of the page source file and the JSON file without further acquisition from a back-end server, thereby saving the time and resources consumed by interaction with the back-end server.
In order to achieve a better visual effect in the page jumping process, in the process of loading the skipped PDP page, pre-configured animation effects in the CSS, such as animation effects configured to fade out the first page and enter the second page smoothly, so that the page jumping is smooth and silky, the visual experience is comfortable and natural, the enhancement of website viscosity is facilitated, and more access flow is introduced. The animation effect added during the page switch can be implemented by calling a pre-configured or browser-owned view switch effect API (Application Programming Interface ).
In some cases, the browser self-View switching effect API may be applied to only part of the types of websites, for example, the Chrome browser self-View Transition View switching API may be applied to only a single-Page website, in order to apply the above animation effect to a Multi-Page website (MPA) to obtain a better user visual experience, in the case that it is determined that the previous PDP Page belongs to the Multi-Page website, the Multi-Page website may be configured as a single-Page website, so that the modified single-Page website may directly call View Transition API of the browser self-Page website.
As shown in fig. 3, a data interaction schematic diagram of a processing method of page skip in another example of the embodiment of the present application is given, after a user executes step 301 to click on a PDP page, a browser 31 executes 302 an asynchronous request for obtaining a page source file of the PDP page to a front-end server 32, where the request is configured to obtain target page contents of the PDP page at the same time, and the front-end server executes 303 to execute 304 a JSON file that returns HTML in a cache file and the target page contents if it is determined that there is a page content corresponding to the PDP page in the local cache. And under the condition that the page content corresponding to the PDP page does not exist, executing 305 to initiate a request to a back-end server 33, executing 307 the step of server rendering according to the page data of the PDP page returned after the back-end server executes 306 the response, generating an HTML file, returning the HTML file and the JSON file to a browser together according to the JSON file corresponding to the generated target page content, executing 308 to cache the two files to the front-end server locally, replacing the target page content in the JSON file into a DOM tree instance of the previous page by the browser, and obtaining the jumped PDP page by rendering the replaced DOM tree instance.
When the processing scheme of page skip corresponding to the embodiment of the application is implemented at the browser end, the corresponding virtual device module can be deployed in JS codes returned by the server for the website to which the page belongs, and also can be deployed in the browser or the page HTML file, taking JS codes as an example, the JS codes can be mounted on a front-end server, a rear-end server or a CDN server (convenient for quickly executing the JS codes) at a position closer to the terminal where the browser is located, and the JS codes are returned to the browser when the browser accesses the page or accesses the website corresponding to the page for the first time. The modification operation of the page source file obtaining request can be achieved by calling an API (application program interface) pre-configured at a server or other positions, and the animation effect in the CSS file can be achieved by calling a view switching effect API of a browser. Correspondingly, when the processing scheme of page skip corresponding to the embodiment of the present application is implemented at the server, the corresponding Virtual device module may be implemented as a functional module in an application program, a service, an instance, or a software form, and deployed on a Virtual Machine (VM), a container, a cloud server, or a hardware device (such as a server or a terminal device) or a hardware chip (such as CPU, GPU, FPGA, NPU, AI accelerator card or DPU) with a data processing function.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the foregoing technical problems in detail with specific embodiments. The specific embodiments illustrated may be combined with one another and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
First embodiment:
An embodiment of the present application provides a method for processing a page jump, as shown in fig. 4, which is a flowchart of a method 400 for processing a page jump according to an embodiment of the present application, where the method 400 may include:
In step S401, in response to the page jump instruction, acquiring target page content of the second page under the condition that the first page before the jump and the second page after the jump are determined to meet the page association condition; the target page content is obtained by sending a page source file obtaining request, wherein the page source file obtaining request is configured to obtain target page content of a second page at the same time.
The page skip instruction may be triggered in response to a condition that satisfies a page skip, for example, the user clicking on a commodity in a PDP page triggers a skip to another PDP page, or a voice instruction indicating a page skip is detected, etc. And marking the page before the jump as a first page, marking the page after the jump as a second page, wherein the fact that the first page and the second page meet the association condition means that the second page has the same or similar page frame or page content, so that the rendering result of the first page, such as the rendered page frame or page content, can be borrowed in the second page loading process, and the time consumed by loading the page can be reduced. In an embodiment, the first page and the second page may be two pages with the same page frame, and the header, the tail and the relevant positions of the page frame have the same display content, so that the DOM tree instance does not need to be re-rendered in the second page rendering process, the text body content except for the page frame can be directly added into the DOM tree instance which is already rendered by the first page, the second page loading process is simplified, and the time consumed by page skip is reduced. The first page and the second page may be pages of a single-page website or pages of a multi-page website.
In response to the page jump instruction, firstly, confirming that the first page and the second page meet page association conditions, and under the condition that the page association conditions are met, describing that the rendering of the second page can borrow the rendering result of the first page, and combining the target page content with the rendering result of the first page by acquiring the target page content of the second page, so that the acceleration of the loading process of the second page is realized.
The above target page content is obtained by sending a page source file obtaining request, which is originally used for indicating to obtain a page source file corresponding to a page, and the embodiment of the application improves the page source file obtaining request and configures the page source file obtaining request to obtain the target page content while obtaining the page source file. In one example, target page content of the second page is acquired after receiving the page jump instruction, a page source file acquisition request is modified in response to the page jump instruction, the page source file acquisition request to be sent is configured to acquire the target page content of the second page while acquiring the page source file, and then the configured page source file acquisition request is sent to the server. In another example, before receiving the page jump instruction, it is determined that the acquisition condition of the page content is met, then the acquisition of the target page content lower than that of the second page is triggered, after detecting that the acquisition condition of the page content is currently met, the page source file acquisition request is modified, the page source file acquisition request is configured to acquire the target page content of the second page while acquiring the page source file, then the configured page source file acquisition request is sent to the server, so as to obtain the target page content returned by the server while returning the HTML file, and subsequently after receiving the page jump instruction, the pre-acquired target page content is extracted for loading of the second page.
The target page content refers to a part of content displayed in the second page and is used for being combined with the rendering result of the first page, and the target page content required to be acquired can be indicated in the page source file acquisition request, for example, one or more information such as the content type, the HTML tag, the storage position and the like of the target page content is added in the page source file acquisition request as a page content identifier for identifying the target page content, so that the target page content can be acquired simultaneously according to the page source file acquisition request. In one example, the target page content is the body content of the second page, and HTML tags such as meta, content, etc. are added to the page source file acquisition request as page content identifiers, where the meta tag is an important tag in the HTML file, and is located between the head tag and the title tag, and is used to describe attributes of the HTML file, such as author, date and time, description of the web page, keywords, page refresh, etc., and content attributes are used to give a value related to an http-equivalent attribute or a name attribute, where the content attributes are typically associated with < meta > elements, and include a single-value text for specifying meta information content.
In step S402, the obtained target page content is replaced to the corresponding position of the DOM tree instance of the first page rendering.
The process of loading pages from page source files such as HTML files, CSS files, JS codes, etc. generally includes: firstly, a JS code is operated to analyze an HTML file from top to bottom, a DOM tree instance composed of DOM element nodes is constructed, and all elements of a page are included in the DOM tree instance; secondly, analyzing the CSS file to generate a CSS rule tree, combining a DOM tree instance and the CSS rule tree, wherein the combined DOM tree instance comprises all visible elements in the page, and some head labels and invisible labels are hidden; then, the page labels of the external resource and the external resource which are not referenced in the DOM tree instance are analyzed, the page content is filled into the DOM tree instance, and the page is drawn according to the filled DOM tree instance. The embodiment of the application improves the rendering process, combines the target page content with the DOM tree instance after the first page rendering, and replaces the obtained target page content to the corresponding position in the DOM tree instance of the first page. Specifically, the content to be replaced of the target page content to be replaced with the second page in the first page can be configured to be displayed in a hidden mode or be deleted directly, and the target page content is written in the position of the content to be replaced.
In step S403, a second page is loaded according to the replaced DOM tree instance.
The target page content is added into the DOM tree instance, and page loading can be further performed based on the replaced DOM tree instance. Compared with the page loading process of the multi-page website, the method simplifies the loading process of the second page, does not need to re-render the DOM tree instance corresponding to the second page according to the HTML file corresponding to the second page, saves time and software and hardware resources consumed by rendering the DOM tree instance, improves page loading efficiency, optimizes the visual experience of page skip, facilitates consumers to browse and select required commodities more quickly in an electronic transaction scene, increases the number of pages browsed in unit time, increases the possibility of finding the required commodities, improves the conversion rate of page flow to transaction orders, and introduces more flow to the pages and the platform. Compared with the page loading process of a single-page website, the method has the advantages that the target page content is acquired by changing the page source file acquisition request without extracting the target page content from the HTML file of the second page, so that the complex operation of a browser is saved, and the page skip efficiency is improved.
The embodiment can be applied to a page loading program, wherein the page loading program is used for realizing page loading, and can be a browser or other application programs capable of loading website pages. In an embodiment, the operation of modifying the page source file obtaining request may be implemented by a page loader, or implemented by a code inserted in a page, or implemented by a JS code returned to the page loader when accessing a website, taking the JS code implementation as an example, the JS code monitors a trigger condition or operation related to the page, and when a page skip is triggered, a page skip instruction is detected, the embodiment is executed.
In an example of the embodiment of the present application, the step of obtaining the target page content of the second page may be obtaining the target page content from the server after receiving the page jump instruction, and modifying the page source file obtaining request to make the page source file obtaining request carry the target page content identifier corresponding to the target page content, and instruct the server to return the requested target page content while returning the page source file. In another example, before the page jump instruction is received, in response to meeting an acquisition condition for acquiring the page content, acquiring the target page content from the server in advance, where the step of acquiring the target page content of the second page may be to configure a page source file acquisition request to simultaneously request the target page content in response to a setting condition for acquiring the page content, and store the returned target page content in a cache of the page loader for extracting the target page content from the cache after the page jump instruction is subsequently received.
For both examples, the functionality of reconfiguring the page source file fetch request sent to the server may be encapsulated as an API, noted as a first API, may be configured in the code of the HTML file, JS code, or the set location of the page loader. The first API is called to modify a request for acquiring the page source file, so that the request for acquiring the page source file is only originally acquired, and meanwhile, the acquisition of target page content of a second page is indicated, in order to enable the modified page source file to specify the acquired specific information, the page source file acquisition request can be configured to carry a target page content identifier corresponding to the target page content, the server can acquire the corresponding target page content according to the target page content identifier, and the page content identifier can be one or more of information such as a content type, an HTML tag, a storage position and the like of the page content, wherein the HTML tag can be one or more of meta and content. The server can find the corresponding target page content according to the page content identifier carried by the page source file acquisition request, and can organize the target page content into a JSON file and return the JSON file to the page loader.
In an embodiment, after the page content is obtained each time, the page content can be stored in a storage position related to the page loader, so that the target page content can be directly extracted from the storage position related to the page loader when the same page content is requested next time, the further request from a server is not needed, and the time and the software and hardware resources consumed by the page skip are saved. Therefore, before the first API is called to modify the request for acquiring the page source file, whether the cache related to the page loader has the target page content corresponding to the second page or not can be searched, if so, the target page content can be directly extracted from the cache, and if not, the target page content can be acquired from the server by reconfiguring the request for acquiring the page source file. After the target page content does not exist in the cache related to the page loader and is acquired from the server, the acquired target page content can be stored in the cache related to the page loader so as to be conveniently called when the target page content is needed.
The above meeting the set condition for acquiring the page content means that the acquisition of the page content can be triggered when the meeting of the set condition is detected, where the acquired page content may include one or more pages corresponding to one or more subsequent possible jumps
The setting conditions for acquiring the page content can be set according to the actual scene and the requirement. In an example, the setting condition may include detecting that the focus of attention of the page is located at a position of a first type of data object in the first page, and the position of the first type of data object may be a presentation position or an access entry of the first type of data object if the focus of attention of the page is located at a position of the first type of data object in the first page, where the position of the page where the touch point on the touch screen is located, a position of the page where the face of the user is pointed, and the like may be regarded as the focus of attention of the page. Taking an electronic transaction scenario as an example, the first type of data object may be other commodity objects except for the displayed commodity object in the PDP page, and if the position of the page where the mouse stays is opposite to the display position of a certain commodity object, the display position is usually also an access entry of the commodity object, then it is determined that the acquisition condition for acquiring the target page content in the PDP page of the commodity object is satisfied. In another example, obtaining the set condition of the page content may include detecting that there is a second type of data object in the first page that satisfies the interaction condition. The probability of further accessing the second class data object is higher when the interaction condition characterization is met, the page skip efficiency can be improved by acquiring page contents in advance, for example, when the interaction condition is determined that the access frequency exceeds a set threshold or belongs to a hot spot category, and when the first page is displayed, the target page contents corresponding to the PDP pages corresponding to the one or more commodity objects meeting the interaction condition can be acquired in advance and stored in a cache corresponding to the page loader by counting the historical access frequency of one or more commodity objects in the first page except the commodity objects displayed in the first page or the commodity objects belonging to the hot spot category. The setting conditions for obtaining the page content may include one or more of the foregoing, and the setting conditions and the interaction conditions may be set according to actual needs, which is not limited by the present application.
In an embodiment, the server may organize the target page content into JSON files and return the JSON files to the page loader, replace the obtained target page content to the corresponding position of the DOM tree instance of the first page rendering, after obtaining the target page content returned according to the configured page source file obtaining request, delete the page content corresponding to the target page content identifier in the DOM tree instance of the first page, or modify the page content corresponding to the target page content identifier into hidden display, and fill the target page content into the content area corresponding to the target page element, so that the DOM tree instance corresponding to the modified first page is loaded and then the target page content corresponding to the second page is displayed.
In an embodiment, in the process of loading the second page according to the replaced DOM tree instance, performing hydrate water injection operation on the replaced DOM tree instance, that is, changing the character string of the DOM tree instance into an interactable component, so that the waterinjected DOM tree instance can be correspondingly loaded as an interaction page, then calling an API (noted as a second API) in a page loader to load an animation effect in the CSS file, and then loading the second page according to the waterinjected DOM tree instance. The second API may be a View Transition View switching API of the Chrome browser, and a monitoring function of a page jump event is preconfigured in the DOM tree instance, and when the occurrence of the page jump event is detected, an animation effect of a part of content under the DOM tree instance in the CSS file is replaced. View Transition API when switching between pages, adding animation to create a group of transition images respectively representing images before page state conversion and images after page state conversion, for example, with a transition effect of fading out and fading in, so as to reduce cognitive load and perceived loading delay generated by page jumping.
The first page and the second page meet page association conditions, so that rendering of the second page can borrow a rendering result of the first page. In an embodiment, determining that the first page before the jump and the second page after the jump meet the page association condition may be determining that the first page before the jump and the second page after the jump respectively correspond to set page types, for example, are both PDP pages. Other page association conditions may be defined, such as determining whether the first page and the second page belong to the same website, whether the first page and the second page have the same header and the same tail, and so on.
In an embodiment, if it is determined that the first page before the jump and the second page after the jump meet the page association condition, if it is determined that the second API (for example View Transition API) cannot be called according to that the first page belongs to the multi-page website, the multi-page website may be configured as a single-page website, so that the modified single-page website may directly call the second API of the browser.
In an embodiment, after the target page content of the second page is obtained, the target page content can be stored in a cache of the page loader, so that the target page content can be conveniently and directly fetched when being used next time, and the time consumed by fetching from the server is saved.
Second embodiment:
From the perspective of the server, an embodiment of the present application provides a method for providing page content, as shown in fig. 5, which is a flowchart of a method 500 for providing page content according to an embodiment of the present application, where the method 500 may include:
In step 501, a page source file acquisition request is received, the page source file acquisition request configured to simultaneously acquire target page content of a second page.
In step 502, a target page content is returned according to the page source file obtaining request, where the target page content is used to respond to a page jump instruction, and replace the target page content to a corresponding position of the DOM tree instance rendered by the first page under the condition that 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.
In an embodiment, when the target page content is returned according to the page source file obtaining request, the target page content may be extracted from the page source file of the second page according to the target page content identifier indicated by the page source file obtaining request, so as to further package the target page content into a JSON file and return the JSON file to the page loader together with the page source file.
In an embodiment, 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 obtaining request, it may be determined whether the target page content corresponding to the second page exists in the server local cache, if so, the target page content may be directly locally fetched from the front end server, so that time consumed for fetching the file from the back end server is saved, and if not, the target page content is further fetched from the back end server.
In an embodiment, after the target page content corresponding to the second page is obtained, the target page content may be further stored in a cache of the front-end server, so that when the same terminal or different terminals subsequently request the target page content, the target page content is directly extracted from the cache of the front-end server.
Third embodiment:
The target page content may be obtained in response to the page jump instruction, or may be obtained before the page jump instruction is received, and an embodiment is given from the perspective of obtaining the target page content, as shown in fig. 6, which is a flowchart of a method 600 for obtaining a page file according to an embodiment of the present application, where the method 600 may include:
In step S601, in response to the acquisition condition of the page content being satisfied, the first API is called to configure a page source file acquisition request to simultaneously request target page content of the second page.
In step S602, obtaining target page content that is fed back according to the configured page source file obtaining request, where the target page content is used to replace to a corresponding position of a DOM tree instance rendered by the first page to load the second page according to the replaced DOM tree instance in response to the page jump instruction when it is determined that the first page before the jump and the second page after the jump meet the page association condition.
Fourth embodiment:
An embodiment is given below for a scheme of pre-acquiring target page content, and as shown in fig. 7, a flowchart of a processing method 700 of page skip according to an embodiment of the present application is shown, where the method 700 may include:
In step S701, when the first page is displayed, in response to satisfaction of the acquisition condition of the page content, the target page content of the other pages is acquired and stored in the cache of the page loader. In step S702, in response to the page jump instruction, in a case where it is determined that the first page before the jump and the second page after the jump meet the page association condition, target page content of the second page is extracted from the cache of the page loader. In step S703, the returned target page content is replaced to the corresponding position of the DOM tree instance of the first page rendering. In step S604, a second page is loaded according to the replaced DOM tree instance.
Fifth embodiment:
An embodiment of a method for processing a page jump is provided in the present application according to the following scheme for obtaining target page content in response to a page jump request, and as shown in fig. 8, a flowchart of a method 800 for processing a page jump according to an embodiment of the present application is shown, where the method 800 may include:
In step S801, in response to the page jump instruction, in a case where it is determined that the first page before the jump and the second page after the jump satisfy the page association condition, it is determined that the target page content of the second page does not exist in the cache of the page loader. In step S802, a page source file obtaining request is configured to obtain target page contents of a second page at the same time, and target page contents of the second page returned by the page source file obtaining request are received. In step S803, the obtained target page content is replaced to the corresponding position of the DOM tree instance of the first page rendering. In step S804, a second page is loaded according to the replaced DOM tree instance.
Sixth embodiment:
an embodiment is given below for the case that the first page and the second page are PDP pages, and as shown in fig. 9, a flowchart of a processing method 900 for page skip according to an embodiment of the present application is shown, where the method 900 may include:
In step S901, when the first item detail page is displayed, in response to satisfaction of the acquisition condition of the page contents of the other item detail pages, the main body contents of at least one other item detail page are acquired and saved in the cache of the page loader. In step S902, in response to the page jump instruction, in a case where it is determined that the page after the jump is the second item detail page, the main body content of the second item detail page is extracted from the cache of the page loader. In step S903, the second item detail page is loaded according to the obtained target page content.
Seventh embodiment:
Corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide a processing apparatus for page skip. Referring to fig. 10, which is a block diagram illustrating a processing apparatus 1000 for page skip according to an embodiment of the present application, the apparatus 1000 may include:
the page content obtaining module 1001 is configured to obtain, in response to a page jump instruction, target page content of a second page if it is determined that a first page before a jump and a second page after the jump meet page association conditions; the target page content is obtained by sending a page source file obtaining request, wherein the page source file obtaining request is configured to obtain target page content of a second page at the same time. And a content replacing module 1002, configured to replace the obtained target page content to a corresponding position of the DOM tree instance of the first page rendering. The page loading module 1003 is configured to load the second page according to the replaced DOM tree instance.
In one embodiment, the page content acquisition module includes: the request modification submodule is used for calling a first API to modify a page source file acquisition request so that the page source file acquisition request requests to acquire target page content of a second page while requesting to acquire a page source file, and the modified page source file acquisition request carries a target page content identifier corresponding to the target page content; and the content receiving sub-module is used for receiving target page content of the second page returned by the page source file acquisition request.
In an embodiment, the page content acquisition module further includes: and the cache determining submodule is used for determining that target page content corresponding to the second page does not exist in a cache related to the page loader before the first API is called to modify the acquisition request for the page source file. The method further comprises the steps of: and the cache storage module is used for storing the target page content of the second page into a cache of the page loader.
In one embodiment, the page content acquisition module includes: and the cache extraction sub-module is used for extracting the target page content of the second page from the cache under the condition that the target page content of the second page exists in the cache corresponding to the page loader.
In one embodiment, the method further comprises: the request modification module is used for calling the first API to configure a page source file acquisition request to simultaneously request target page content in response to the condition that the setting condition for acquiring page content is met, and sending the configured page source file acquisition request; and the cache storage module is used for storing the target page content of the second page returned by the page source file acquisition request into the cache of the page loader.
In an embodiment, the setting condition for acquiring the page content includes at least one of the following: detecting that a focus of attention of a page is positioned at a position of a first type of data object in a first page; it is detected that a second type of data object satisfying the interaction condition exists in the first page.
In one embodiment, the content replacement module includes: the content acquisition module is used for acquiring target page content returned according to the configured page source file acquisition request; and the content processing sub-module is used 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: the water injection sub-module is used for executing water injection operation on the replaced DOM tree instance so that the water injected DOM tree instance can be correspondingly loaded as an interactive page; the animation loading sub-module is used for calling a second API in the page loading program to load the animation effect in the cascading style sheet; and the instance loading sub-module is used for loading the second page according to the waterfilled DOM tree instance.
In an embodiment, the page association condition satisfied by the first page before the jump and the second page after the jump includes: the first page before the jump and the second page after the jump are respectively corresponding to the set page types.
In one embodiment, the method further comprises: and the page modification module is used for configuring the multi-page website as a single-page website if the first page belongs to the multi-page website under the condition that the first page before the jump and the second page after the jump meet the page association condition.
Eighth embodiment:
Corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide a device for providing page content. Fig. 11 is a block diagram of a device 1100 for providing page content according to an embodiment of the present application, which may be deployed on a server, where the device 1100 may include:
The acquisition request receiving module 1101 is configured to receive a page source file acquisition request, where the page source file acquisition request is configured to simultaneously acquire target page content of a second page. The page content returning module 1102 is configured to return, according to the page source file obtaining request, target page content, where the target page content is configured to replace, in response to a page jump instruction, a first page before the jump and a second page after the jump, where the first page and the second page after the jump meet page association conditions, to a corresponding position of a DOM tree instance rendered by the first page, so as to load the second page according to the replaced DOM tree instance.
In one embodiment, the page content returning module includes: the page content extraction submodule is used for 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 file return sub-module is used for packaging the target page content into a JSON file and returning the JSON file and the page source file to the page loader.
In an embodiment, the page content returning module further includes: the cache determining submodule is used for determining that the target page content corresponding to the second page does not exist in the local cache of the server side before the target page content identification indicated by the page source file acquisition request is extracted from the page source file of the second page;
The apparatus further comprises: and the caching module is used for storing the target page content corresponding to the second page into a cache of the front-end server.
Ninth embodiment:
Corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide an apparatus for acquiring a page file. Referring to fig. 12, which is a block diagram illustrating a device 1200 for acquiring a page file according to an embodiment of the present application, the device 1200 may include:
the request configuration module 1201 is configured to call the first API to configure a page source file acquisition request to simultaneously request target page content of the second page in response to satisfaction of an acquisition condition of the page content. The content acquisition module 1202 is configured to acquire target page content fed back according to the configured page source file acquisition request, where the target page content is configured to replace a corresponding position of a DOM tree instance rendered by the first page to load the second page according to the replaced DOM tree instance 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 page association conditions.
Tenth embodiment:
corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide a processing apparatus for page skip. Referring to fig. 13, which is a block diagram illustrating a page skip processing apparatus 1300 according to an embodiment of the present application, the apparatus 1300 may include:
The content obtaining module 1301 is configured to obtain, when the first page is displayed, target page contents of other pages in response to satisfaction of an obtaining condition of the page contents, and store the target page contents in a cache of the page loader. The content extraction module 1302 is configured to, in response to a page jump instruction, extract, in a case where it is determined that a first page before a jump and a second page after a jump meet a page association condition, target page content of the second page from a cache of the page loader. And the content replacing module 1303 is configured to replace the returned target page content to a corresponding position of the DOM tree instance of the first page rendering. The page loading module 1304 is configured to load a second page according to the replaced DOM tree instance.
Eleventh embodiment:
Corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide a processing apparatus for page skip. Referring to fig. 14, which is a block diagram illustrating a page skip processing apparatus 1400 according to an embodiment of the present application, the apparatus 1400 may include:
The cache determining module 1401 is configured to determine, in response to a page jump instruction, that, in a case where it is determined that a first page before a jump and a second page after a jump meet a page association condition, no target page content of the second page exists in a cache of the page loader. A request configuration module 1402 is configured to configure the page source file obtaining request to simultaneously obtain target page content of the second page. The content receiving module 1403 is configured to receive target page content of the second page returned by the page source file acquisition request. A content replacing module 1404, configured to replace the obtained target page content to a corresponding position of the DOM tree instance of the first page rendering. The page loading module 1405 is configured to load the second page according to the replaced DOM tree instance.
Twelfth embodiment:
corresponding to the above examples and method embodiments provided by the embodiments of the present application, the embodiments of the present application further provide a processing apparatus for page skip. Referring to fig. 15, which is a block diagram illustrating a processing apparatus 1500 for page skip according to an embodiment of the present application, the apparatus 1500 may include:
A content acquiring module 1501 is configured to acquire, when the first item detail page is displayed, the subject content of at least one other item detail page in response to an acquisition condition of the page content of the other item detail page being satisfied. The content saving module 1502 is configured to save in a cache of the page loader. And the cache extracting module 1503 is configured to, in response to the page jump instruction, extract, in a case where it is determined that the page after the jump is the second item detail page, a main content of the second item detail page from the cache of the page loader. And the page loading module 1504 is configured to load the second item detail page according to the obtained target page content.
The functions of each module in each device of the embodiment of the present application may be referred to the corresponding descriptions in the above methods, and have corresponding beneficial effects, which are not described herein.
Fig. 16 is a block diagram of an electronic device used to implement an embodiment of the application. As shown in fig. 16, the electronic device includes: a memory 1601 and a processor 1602, the memory 1601 stores a computer program executable on the processor 1602. The processor 1602, when executing the computer program, implements the methods of the embodiments described above. The number of memories 1601 and processors 1602 may be one or more.
The electronic device further includes: the communication interface 1603 is used for communicating with external devices for data interactive transmission.
If the memory 1601, the processor 1602, and the communication interface 1603 are implemented independently, the memory 1601, the processor 1602, and the communication interface 1603 may be interconnected and communicate with each other via a bus. The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 16, but not only one bus or one type of bus.
Alternatively, in a specific implementation, if the memory 1601, the processor 1602 and the communication interface 1603 are integrated on a single chip, the memory 1601, the processor 1602 and the communication interface 1603 may communicate with each other through internal interfaces.
The embodiment of the application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the method provided in the embodiment of the application.
Embodiments of the application also provide a computer program product comprising a computer program which, when executed by a processor, implements the method provided in any of the embodiments of the application.
The embodiment of the application also provides a chip, which comprises a processor and is used for calling the instructions stored in the memory from the memory and running the instructions stored in the memory, so that the communication equipment provided with the chip executes the method provided by the embodiment of the application.
The embodiment of the application also provides a chip, which comprises: the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method provided by the embodiment of the application.
It should be appreciated that the Processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be a processor supporting an advanced reduced instruction set machine (ADVANCED RISC MACHINES, ARM) architecture.
Further alternatively, the memory may include a read-only memory and a random access memory. The memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), programmable ROM (PROM), erasable Programmable ROM (EPROM), electrically Erasable EPROM (EEPROM), or flash Memory, among others. Volatile memory can include random access memory (Random Access Memory, RAM), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, static random access memory (STATIC RAM, SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATE SDRAM, DDR SDRAM), enhanced Synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNC LINK DRAM, SLDRAM), and Direct memory bus random access memory (DR RAM).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The 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 in accordance with the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. Computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Any process or method described in flow charts or otherwise herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process. And the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed in a substantially simultaneous manner or in an opposite order from that shown or discussed, including in accordance with the functions that are involved.
Logic and/or steps described in the flowcharts or otherwise described herein, e.g., may be considered a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the methods of the embodiments described above may be performed by a program that, when executed, comprises one or a combination of the steps of the method embodiments, instructs the associated hardware to perform the method.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules described above, if implemented in the form of software functional modules and sold or used as a stand-alone product, may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The above description is merely an exemplary embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of various changes or substitutions within the technical scope of the present application, and these should be covered in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (20)

1. A method for processing a page jump, applied to a page loader, the method comprising:
Responding to a page jump instruction, and acquiring target page content of a second page under the condition that the first page before jump and the second page after jump meet page association conditions; the target page content is obtained by sending a page source file obtaining request, wherein the page source file obtaining request is configured to obtain target page content of a second page at the same time;
replacing the obtained target page content to the corresponding position of the DOM tree instance rendered by the first page;
and loading a second page according to the replaced DOM tree instance.
2. The method of claim 1, wherein the obtaining target page content for the second page comprises:
Calling a first API to modify a page source file acquisition request so that the page source file acquisition request requests to acquire target page content of a second page while requesting to acquire a page source file, wherein the modified page source file acquisition request carries a target page content identifier corresponding to the target page content;
and receiving target page content of a second page returned by the page source file acquisition request.
3. The method of claim 2, wherein prior to the invoking the first API modifying the get request for page source file, the obtaining target page content for the second page further comprises:
Determining that target page content corresponding to the second page does not exist in a cache related to the page loader;
after the target page content of the second page is acquired, the method further includes:
And storing the target page content of the second page into a cache of a page loader.
4. The method of claim 1, wherein the obtaining target page content for the second page comprises:
And under the condition that 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 of claim 4, wherein the method further comprises:
in response to meeting the setting condition for acquiring the page content, calling the first API to configure a page source file acquisition request to simultaneously request the target page content, and sending the configured page source file acquisition request;
and storing target page content of a second page returned by the page source file acquisition request into a cache of the page loader.
6. The method of claim 5, wherein the setting conditions for acquiring page content include at least one of:
detecting that a focus of attention of a page is positioned at a position of a first type of data object in a first page;
it is detected that a second type of data object satisfying the interaction condition exists in the first page.
7. The method of claim 1, wherein said replacing the retrieved target page content to the corresponding location of the DOM tree instance of the first page rendering comprises:
acquiring target page contents returned according to the configured page source file acquisition request;
Deleting or hiding page content corresponding to a target page content identifier in a DOM tree instance of the first page, and filling the target page content into a content area corresponding to the target page element.
8. The method of claim 1, wherein the loading the second page according to the replaced DOM tree instance comprises:
Performing water injection operation on the replaced DOM tree instance so that the watered DOM tree instance can be correspondingly loaded as an interactive page;
calling a second API in the page loader to load the animation effect in the cascading style sheet;
and loading a second page according to the watered DOM tree instance.
9. The method of claim 1, wherein the determining that the first page before the jump and the second page after the jump satisfy a page association condition comprises:
And determining that the first page before the jump and the second page after the jump respectively correspond to the set page types.
10. The method of claim 9, wherein the method further comprises:
and under the condition 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 is applied to a server, and comprises the following steps:
receiving a page source file acquisition request, wherein the page source file acquisition request is configured to acquire target page contents of a second page at the same time;
And returning target page content according to the page source file acquisition request, wherein the target page content is used for responding to a page jump instruction, and replacing the target page content to the corresponding position of the DOM tree instance rendered by the first page under the condition that the first page before jumping and the second page after jumping meet page association conditions, so as to load the second page according to the replaced DOM tree instance.
12. The method of claim 11, wherein the returning target page content in accordance with the page source file fetch request comprises:
Extracting 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 packaging the target page content into a JSON file and returning the JSON file and the page source file to a page loader.
13. The method of claim 12, wherein before extracting the target page content from the page source file of the second page according to the target page content identification indicated by the page source file acquisition request, the returning the target page content according to the page source file acquisition request further comprises:
Determining that target page content corresponding to the second page does not exist in the local cache of the server side;
The method further comprises the steps of:
And storing the target page content corresponding to the second page into a cache of a front-end server.
14. A method of acquiring a page file, the method comprising:
In response to meeting the acquisition condition of the page content, calling a first API to configure a page source file acquisition request to simultaneously request target page content of a second page;
And acquiring target page contents fed back according to the configured page source file acquisition request, wherein the target page contents are used for responding to a page jump instruction, and replacing the target page contents to the 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 under the condition that the first page before the jump and the second page after the jump meet page association conditions.
15. A method for processing a page jump, comprising:
When a first page is displayed, acquiring target page contents of other pages in response to the condition that the acquisition of the page contents is met, and storing the target page contents in a cache of a page loader;
Responding to a page jump instruction, and extracting target page content of a first page before jump and a second page after jump from a cache of the page loader under the condition that the first page and the second page meet page association conditions;
Replacing the returned target page content to the corresponding position of the DOM tree instance of the first page rendering;
and loading a second page according to the replaced DOM tree instance.
16. A method for processing a page jump, comprising:
responding to a page jump instruction, and determining that target page content of a second page does not exist in a cache of a page loader under the condition that the first page before jump and the second page after jump meet page association conditions;
configuring a page source file acquisition request to acquire target page contents of a second page at the same time, and receiving the target page contents of the second page returned by aiming at the page source file acquisition request;
replacing the obtained target page content to the corresponding position of the DOM tree instance rendered by the first page;
and loading a second page according to the replaced DOM tree instance.
17. A method for processing a page jump, comprising:
When the first commodity detail page is displayed, acquiring main body contents of at least one other commodity detail page and storing the main body contents in a cache of a page loader in response to the condition that the acquisition condition of page contents of other commodity detail pages is met;
Responding to a page jump instruction, and under the condition that the page after jump is determined to be a second commodity detail page, extracting main content of the second commodity detail page from a cache of the page loader;
And loading the second commodity detail page according to the acquired target page content.
18. An electronic device comprising a memory, a processor and a computer program stored on the memory, the processor implementing the method of any one of claims 1-17 when the computer program is executed.
19. A computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-17.
20. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1-17.
CN202410160622.4A 2024-02-04 Page jump processing method, page content providing device and storage medium Pending CN118113398A (en)

Publications (1)

Publication Number Publication Date
CN118113398A true CN118113398A (en) 2024-05-31

Family

ID=

Similar Documents

Publication Publication Date Title
US20190251143A1 (en) Web page rendering method and related device
KR102436987B1 (en) Method and terminal device for extracting web page content
TWI690812B (en) Method, device and client for dynamic layout of page elements
US8839087B1 (en) Remote browsing and searching
CN105094786B (en) Method and system based on JavaScript customized web page
US8996711B2 (en) Controlling web page advertisement through incentives and restrictions
CN110245069B (en) Page version testing method and device and page display method and device
CN103577596B (en) Keyword search methodology and device based on current browse webpage
CN103577392B (en) Keyword method for pushing and device based on current browse webpage
US9336321B1 (en) Remote browsing and searching
CN104981800A (en) Delivery and display of page previews during page retrieval events
US20130339840A1 (en) System and method for logical chunking and restructuring websites
CN106598972A (en) Information display method and device as well as intelligent terminal
US9747382B1 (en) Measuring page value
JP2014514629A (en) A kind of web page recomposition method
CN112631591B (en) Method, apparatus, device and computer readable storage medium for table element linkage
CN104750851A (en) Webpage content lazy loading method and system
CN105955714A (en) Mixed development front end MVC frame implementation method and system
US20170076008A1 (en) Dynamic file concatenation
CN108595697A (en) Webpage integrated approach, apparatus and system
CN104423991A (en) Webpage loading and webpage data providing method and device of mobile terminal
US9092405B1 (en) Remote browsing and searching
US20130227391A1 (en) Method and apparatus for displaying webpage
US20230409398A1 (en) Resource pre-fetch using age threshold
CN108319474B (en) Page information generation method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication