Page display method, device, equipment and storage medium based on distributed system

By using contributor terminals in a distributed system to report page resource addresses for preloading, the resource waste and instability problems caused by page preloading are solved, and more efficient page display is achieved.

CN116450962BActive Publication Date: 2025-09-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210009378.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-06
Publication Date
2025-09-16
Estimated Expiration
2042-01-06

AI Technical Summary

Technical Problem

In the prior art, page preloading leads to a waste of memory and network resources, and the page display process is unstable, which increases the display time.

Method used

In a distributed system, the contributor terminal reports the page resource address to the management server, and the user terminal preloads the page resource according to the address and displays the page resource when the display instruction is triggered.

Benefits of technology

It improves the utilization of memory and network resources, ensures the stability of the page display process, and improves the page display speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450962B_ABST
    Figure CN116450962B_ABST
Patent Text Reader

Abstract

The present application provides a page display method, apparatus, device, storage medium and computer program product based on a distributed system; the method comprises: determining the role of the terminal in the distributed system for a target page of a terminal to load page resources; when the role of the terminal for the target page is a user terminal, preloading the page resources of the target page according to the page resource address of the target page at the management server; wherein the page resource address is reported to the management server by the contributor terminal after loading the page resources; when a page display instruction for the target page is triggered, displaying the target page based on the preloaded page resources; through the present application, the utilization rate of memory and network resources can be improved, the stability of the page display process can be guaranteed, and the page display speed can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a page display method, apparatus, device, storage medium, and computer program product based on a distributed system. Background Art

[0002] With the rapid development of Internet technology, more and more users browse media information (such as news, promotional information, etc.) through pages (such as web pages). In related technologies, page code is usually pre-executed and the page is loaded in advance to achieve the purpose of page pre-loading, and then the loaded page is hidden to be displayed when the user views it. However, executing the page code in advance to load the page and hide it not only wastes memory and network resources, but also causes instability in the page display process and increases the time required for page display. Summary of the Invention

[0003] The embodiments of the present application provide a page display method, apparatus, device, storage medium and computer program product based on a distributed system, which can improve the utilization of memory and network resources, ensure the stability of the page display process, and increase the page display speed.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present invention provides a page display method based on a distributed system, wherein the distributed system includes: a contributor terminal, a user terminal, and a management server. The method includes:

[0006] For a target page of a page resource to be loaded by a terminal, determining a role of the terminal in the distributed system;

[0007] When the role of the terminal is a user terminal for the target page, preloading the page resources of the target page according to the page resource address of the target page at the management server;

[0008] The page resource address is reported to the management server by the contributor terminal after loading the page resource;

[0009] When a page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources.

[0010] The present application also provides a page display device based on a distributed system, wherein the distributed system includes: a contributor terminal, a user terminal, and a management server, and the device includes:

[0011] A determination module, configured to determine a role of the terminal in the distributed system for a target page of a page resource to be loaded by the terminal;

[0012] a preloading module, configured to preload page resources of the target page according to the page resource address of the target page at the management server when the role of the terminal is a user terminal for the target page;

[0013] The page resource address is reported to the management server by the contributor terminal after loading the page resource;

[0014] A display module is used to display the target page based on the preloaded page resources when a page display instruction for the target page is triggered.

[0015] In the above scheme, the determination module is also used to send an acquisition request for the page resource address to the management server, and receive a response message returned by the management server based on the acquisition request; when the response message does not include the page resource address, it is determined that the role of the terminal in the distributed system is the contributor terminal; when the response message includes the page resource address, it is determined that the role of the terminal in the distributed system is the user terminal.

[0016] In the above scheme, the determination module is also used to obtain the number of terminal displays of the target page; when the number of terminal displays is lower than the number threshold, the role of the terminal in the distributed system is determined to be the contributor terminal; when the number of terminal displays is not lower than the number threshold, the role of the terminal in the distributed system is determined to be the user terminal.

[0017] In the above scheme, the distributed system also includes: at least two reporter terminals; the determination module is also used to obtain the result that the target page belongs to the preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to the preloaded page is determined by the management server based on the number of reporter terminals that report the page loading timeout message; wherein, the page loading timeout message is used to indicate that the time for the corresponding reporter terminal to load the page resource of the target page exceeds the time threshold.

[0018] In the above scheme, the determination module is also used to load the page resources of the target page and obtain the corresponding loading time in response to the page display instruction for the target page when the role of the terminal is the reporter terminal for the target page; when the loading time exceeds the time threshold, report the page loading timeout message to the management server.

[0019] In the above scheme, the determination module is also used to load the page resources of the target page and record the page resource address of the page resources in response to the page display instruction for the target page when the role of the terminal is a contributor terminal for the target page; and report the page resource address of the target page to the management server.

[0020] In the above scheme, the determination module is also used to splice the at least two page resource addresses when there are at least two page resource addresses to obtain a resource address list corresponding to the target page; and report the resource address list corresponding to the target page to the management server.

[0021] In the above scheme, the distributed system also includes: a reporter terminal; the determination module is also used to obtain the result that the target page belongs to a preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to a preloaded page is determined by the management server based on the data size of the page resource reported by the reporter terminal.

[0022] In the above scheme, the determination module is also used to load the page resources of the target page and obtain the data size of the page resources in response to the page display instruction for the target page when the role of the terminal is the reporter terminal for the target page; and report the data size of the page resources to the management server.

[0023] In the above solution, the display module is further used to obtain a resource acquisition request for the page resource, where the resource acquisition request is generated based on the page display instruction of the target page; and intercept and process the resource acquisition request.

[0024] In the above solution, the display module is further used to load the page structure of the target page; based on the page structure, fill the preloaded page resources to display the target page.

[0025] In the above solution, the display module is also used to determine whether the page display instruction is triggered within the target time length and obtain a corresponding result; when the result indicates that the page display instruction is not triggered within the target time length, the preloaded page resources are released.

[0026] In the above scheme, the preloading module is also used to determine the first version of the preloaded page resources and obtain the second version of the page resources at the management server; when the second version is inconsistent with the first version, the second version of the page resources is preloaded according to the page resource address of the target page at the management server, and the preloaded first version of the page resources is cleared.

[0027] An embodiment of the present application further provides an electronic device, including:

[0028] a memory for storing executable instructions;

[0029] The processor is used to implement the page display method based on the distributed system provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0030] An embodiment of the present application also provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by a processor, the page display method based on a distributed system provided in an embodiment of the present application is implemented.

[0031] An embodiment of the present application also provides a computer program product, including a computer program or instructions. When the computer program or instructions are executed by a processor, the page display method based on a distributed system provided in an embodiment of the present application is implemented.

[0032] The embodiments of the present application have the following beneficial effects:

[0033] Applying the above-mentioned embodiment of the present application, based on a distributed system including a contributor terminal, a user terminal and a management server, through the contributor terminal in the distributed system, after loading the page resources of the target page, the page resource address of the target page is reported to the management server; when the terminal determines that the role of the terminal is a user terminal for the target page of the terminal to load the page resources, the terminal preloads the page resources of the target page according to the page resource address of the target page at the management server, so that when the page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources. In this way, when preloading a page, only the page resources of the page need to be loaded, and when the page display instruction for the page is triggered, the page is generated based on the preloaded page resources for display, which can improve the utilization rate of memory and network resources, ensure the stability of the page display process, and improve the page display speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 1 is a schematic diagram of the architecture of a distributed system-based page display system 100 provided in an embodiment of the present application;

[0035] Figure 21 is a schematic structural diagram of an electronic device 500 implementing a page display method based on a distributed system provided in an embodiment of the present application;

[0036] Figure 3 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0037] Figure 4 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0038] Figure 5 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0039] Figure 6 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0040] Figure 7 This is a schematic diagram of the page structure of the target page provided in the embodiment of the present application;

[0041] Figure 8 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0042] Figure 9 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application;

[0043] Figure 10 This is a schematic diagram showing the target page provided in the embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0045] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0046] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0048] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0049] 1) Client: An application running in a terminal to provide various services, such as a browser client or a media information client.

[0050] 2) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be real-time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0051] 3) Landing Page: This is the webpage that is displayed to potential users when they click on a promotional message or search using a search engine. This page will generally display extended content related to the promotional message or search result link that was clicked, and this page should be search engine optimized for a specific keyword (or phrase).

[0052] 4) A web page is a plain text file containing HTML tags that can be stored in a computer somewhere in the world. It is a "page" on the World Wide Web and is in Hypertext Markup Language format. It usually uses image files to provide pictures and can be read through a web browser.

[0053] 5) Cascading Style Sheets (CSS) files are a computer language used to express the styles of files such as HTML. They can not only statically modify web pages, but also dynamically format various elements of web pages in conjunction with various scripting languages.

[0054] 6) JavaScript script files, also known as JS files, are used for web application development and can add a variety of dynamic functions to web pages. JavaScript scripts implement their own functions by being embedded in HTML. The interactive logic of web pages and HTML5-based clients is driven by JavaScript.

[0055] 7) Hypertext Markup Language (HTML) is a markup language that includes a series of tags. Through these tags, the document format on the Internet can be unified and scattered Internet resources can be connected into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animation, sound, tables, links, etc.

[0056] The embodiments of the present application provide a page display method, apparatus, device, storage medium and computer program product based on a distributed system, which can improve the utilization of memory and network resources, ensure the stability of the page display process, and increase the page display speed.

[0057] The following describes the implementation scenario of the page display method based on the distributed system provided by the embodiment of the present application. Figure 1 , Figure 1 : It is an architectural diagram of a page display system 100 based on a distributed system provided in an embodiment of the present application. In an embodiment of the present application, the distributed system includes a contributor terminal, a user terminal and a management server. In order to support an exemplary application, the terminal (exemplarily showing terminal 400-1 and terminal 400-2) is connected to the management server 200 via a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is achieved using a wireless or wired link. In actual applications, a client can be provided on the terminal (exemplarily showing terminal 400-1 and terminal 400-2), such as a browser client, a media information client (such as a news client). When the terminal receives an operating instruction for the client, the target page can be displayed by running the client. In the process of displaying the target page, the terminal needs to load the page resources of the target page. Therefore, the target page can also be recorded as the target page of the terminal to load the page resources.

[0058] In some embodiments, for the target page of the page resource to be loaded by the terminal, the role of the terminal in the distributed system can be determined. Here, the role of terminal 400-1 in the distributed system is determined to be a contributor terminal, and the role of terminal 400-2 in the distributed system is determined to be a user terminal. When a page display instruction for the target page is triggered at terminal 400-1, terminal 400-1 loads the page resource of the target page online and displays the target page based on the page resource loaded online; at the same time, after the page resource is loaded, terminal 400-1 reports the page resource address of the page resource to the management server 200;

[0059] Based on this, terminal 400-2 sends a request to obtain the page resource address of the target page for the terminal to load page resources to the management server 200; the management server 200 receives and responds to the request to obtain the page resource address of the target page, and returns the page resource address of the target page to terminal 400-2; terminal 400-2 receives the page resource address of the target page, and preloads the page resources of the target page based on the page resource address of the target page; when the page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources.

[0060] In some embodiments, the page display method based on the distributed system provided in the embodiments of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal alone, it can also be implemented by a server alone, or it can be implemented by a terminal and a server in collaboration. For example, the terminal alone executes the page display method based on the distributed system provided in the embodiments of the present application, or the terminal and the server collaborate to execute the page display method based on the distributed system provided in the embodiments of the present application.

[0061] In some embodiments, the electronic device for implementing the page display based on the distributed system provided by the embodiment of the present application can be various types of terminal devices or servers, wherein the server (such as server 200) can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal (such as terminal 400) can be a smart phone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device (such as smart speaker), smart home appliance (such as smart TV), smart watch, car terminal, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and the embodiment of the present application does not limit this. The embodiment of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0062] In some embodiments, the terminal or server can implement the page display method based on the distributed system provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that can be run only by downloading it into a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0063] In some embodiments, multiple servers may form a blockchain, with the servers being nodes on the blockchain. Information connections may exist between each node in the blockchain, and information may be transmitted between nodes via the aforementioned information connections. Data related to the distributed system-based page display method provided in embodiments of the present application (e.g., page resources of a target page) may be stored on the blockchain.

[0064] The following describes an electronic device that implements a page display method based on a distributed system provided by an embodiment of the present application. Figure 2 , Figure 2 Schematic diagram of the structure of the electronic device 500 for implementing the page display method based on the distributed system provided in the embodiment of the present application. Figure 1 Taking the terminal shown as an example, the electronic device 500 for implementing the page display method based on a distributed system provided in an embodiment of the present application includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 2 Various buses are labeled as bus system 540 .

[0065] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0066] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0067] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 550 may optionally include one or more storage devices that are physically remote from the processor 510.

[0068] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0069] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0070] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0071] A network communication module 552 for reaching other computing devices via one or more (wired or wireless) network interfaces 520 , exemplary network interfaces 520 including Bluetooth, WiFi, and USB;

[0072] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripheral devices and displaying content and information);

[0073] The input processing module 554 is configured to detect one or more user inputs or interactions from one of the one or more input devices 532 and to translate the detected inputs or interactions.

[0074] In some embodiments, the page display device based on the distributed system provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A page display device 555 based on a distributed system stored in a memory 550 is shown, which can be software in the form of programs and plug-ins, including the following software modules: a determination module 5551, a preloading module 5552 and a display module 5553. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0075] In other embodiments, the page display device based on a distributed system provided in the embodiments of the present application can be implemented in a combination of software and hardware. As an example, the page display device based on a distributed system provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the page display method based on a distributed system provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.

[0076] The following describes a page display method based on a distributed system provided by an embodiment of the present application. A distributed system is a system composed of a group of computing nodes that communicate over a network and coordinate their work to complete a common task. The distributed system provided by an embodiment of the present application includes: a contributor terminal, a user terminal, and a management server. Here, the contributor terminal, the user terminal, and the management server are respectively computing nodes in the distributed system, and are used to coordinate their work to implement the page display method based on a distributed system provided by an embodiment of the present application.

[0077] In some embodiments, the page display method based on the distributed system provided in the embodiments of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal alone, or by a server alone, or by a terminal and a server in collaboration. Figure 3 , Figure 3 : is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application. The page display method based on a distributed system provided in an embodiment of the present application includes:

[0078] Step 101: The terminal determines the role of the terminal in the distributed system for a target page of a page resource to be loaded by the terminal.

[0079] Here, the terminal is provided with an application client, such as a browser client or a client with a built-in browser kernel, such as a media information client (e.g., a news client), an instant messaging client, and the like. The target page can be a web page, which can include information such as images, text, sound, and video. In actual applications, when the terminal receives a run instruction for the application client, it runs the application client, thereby displaying the target page through the application client. In actual implementation, the terminal needs to load the page resources of the target page to display the target page. The page resources may include text resources, image resources, sound resources, video resources, CSS files, JS files, and the like of the target page.

[0080] In an embodiment of the present application, when loading the page resources of the target page, the page resource loading methods include online loading and preloading. Among them, online loading means that when the user triggers the display instruction for the target page, the terminal loads the page resources of the target page online; preloading means that when the user does not trigger the display instruction for the target page, the page resources of the target page to be displayed are preloaded, so that when the user triggers the display instruction for the target page, the terminal displays the target page based on the preloaded page resources. In actual applications, preloading can increase the display speed of the target page and avoid page display delays caused by network problems during online loading.

[0081] In an embodiment of the present application, when the terminal displays the target page, the role of the terminal in the distributed system can be determined for the target page of the page resource to be loaded by the terminal. Here, the distributed system includes a contributor terminal, a user terminal and a management server. The role of the terminal in the distributed system also includes a contributor terminal and a user terminal. That is, the terminal can be a contributor terminal or a user terminal in the distributed system. In actual implementation, when the terminal is a contributor terminal in the distributed system, the user terminal is a terminal other than the terminal; when the terminal is a user terminal in the distributed system, the contributor terminal can be the terminal or a terminal other than the terminal; that is, in the distributed system, the terminal has and only has one role for the target page at the same time, that is, the terminal is a user terminal or a contributor terminal at a certain moment. In actual applications, the terminal can have different roles for different target pages, for example, the terminal is a contributor terminal for target page 1, and the terminal is a user terminal for target page 2.

[0082] In an embodiment of the present application, when displaying a target page, the contributor terminal loads the page resources of the target page by online loading, and at the same time, records the page resource address of the page resources during the online loading process, and reports the page resource address to the management server; then the target page is displayed based on the page resources of the target page loaded online. Based on this, the user terminal can preload the page resources of the target page to be displayed based on the page resource address of the page resources at the management server, and when the target page needs to be displayed (for example, the user triggers a display instruction for the target page), the target page is displayed based on the page resources of the preloaded target page, thereby speeding up the display speed of the target page on the user terminal and improving the user's experience of browsing the target page.

[0083] Here, the target page of the terminal's to-be-loaded page resources, such as the target page to be displayed when the terminal runs a client, can also be recorded as the target page of the terminal's to-be-loaded page resources, since displaying the target page requires loading page resources. Because terminals in a distributed system have different loading methods for page resources corresponding to different roles, the terminal can first determine its role in the distributed system for the target page of the terminal's to-be-loaded page resources.

[0084] In some embodiments, the terminal may determine its role in the distributed system in the following manner: sending a request for obtaining a page resource address to a management server, and receiving a response message returned by the management server based on the obtaining request; when the response message does not include the page resource address, determining that the terminal's role in the distributed system is a contributor terminal; when the response message includes the page resource address, determining that the terminal's role in the distributed system is a user terminal.

[0085] See also Figure 4 , Figure 4 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application, including: step 201: the terminal sends a request to obtain the page resource address to the management server; step 202: the management server receives the request to obtain the page resource address, and returns a response message to the terminal; step 203: the terminal receives the response message returned by the management server based on the acquisition request; step 204: the terminal determines whether the response message includes the page resource address, if so, executes step 205, if not, executes step 206; step 205: determines that the role of the terminal in the distributed system is a user terminal; step 206: determines that the role of the terminal in the distributed system is a contributor terminal.

[0086] Here, when determining the role of the terminal in the distributed system, the terminal may first send a request to obtain the page resource address to the management server; the management server receives the request to obtain the page resource address and returns a response message to the terminal; the terminal receives the response message returned by the management server based on the obtain request, parses the response message, and determines whether the response message includes the page resource address;

[0087] When the response message does not include the page resource address, it is determined that the role of the terminal in the distributed system is a contributor terminal, that is, the management server has not recorded the page resource address of the target page, and the terminal needs to load the page resources of the target page online and report the corresponding page resource address to the management server; when the response message includes the page resource address, it is determined that the role of the terminal in the distributed system is a user terminal, that is, the terminal can preload the page resources of the target page based on the page resource address of the page resource at the management server.

[0088] By applying the above embodiment, by determining whether the page resource address exists on the management server and determining the role of the terminal in the distributed system, the role of the terminal can be quickly determined, and the page resource address of the target page can be directly obtained when the terminal is determined to be a user terminal, thereby improving the efficiency of obtaining the page resource address and thus improving the efficiency of preloading.

[0089] In some embodiments, the terminal may also determine the role of the terminal in the distributed system in the following manner: obtaining the number of terminal displays of the target page; when the number of terminal displays is lower than a threshold number, determining that the role of the terminal in the distributed system is a contributor terminal; when the number of terminal displays is not lower than a threshold number, determining that the role of the terminal in the distributed system is a user terminal.

[0090] Here, when the terminal determines the role of the terminal in the distributed system, it can first obtain the terminal display count of the target page. It should be noted that the terminal in the terminal display count is a terminal in a broad sense, not a specific terminal. Then determine whether the terminal display count is lower than the number threshold. The number threshold can be pre-set, such as 1 time, 3 times; the number threshold can also be dynamically changed, such as determined according to the data size of the page resource of the target page. The larger the data size of the page resource, the higher the number threshold. Of course, the number threshold can also be an upper limit value, that is, when the number threshold reaches this upper limit, even if the data size of the page resource increases, the number threshold will maintain the upper limit value unchanged; the number threshold can also be trained with the historical terminal display count of the target page and the reporting data of the page resource address (such as whether the page resource address is complete) as samples. The machine learning model is then predicted based on the pre-trained machine learning model.

[0091] When it is determined that the number of terminal display times is lower than the number threshold, the role of the terminal in the distributed system is determined to be a contributor terminal, that is, the terminal needs to load the page resources of the target page online and report the corresponding page resource address to the management server; when the number of terminal display times is not lower than the number threshold, the role of the terminal in the distributed system is determined to be a user terminal, and the terminal needs to load the page resources of the target page online and report the corresponding page resource address to the management server.

[0092] By applying the above embodiment, the role of the terminal in the distributed system is determined by determining whether the number of terminal displays of the target page is lower than the number threshold. In this way, when the target page is displayed with the number of terminal displays lower than the number threshold, the terminal reports the page resource address as a contributor to ensure the integrity and reliability of the page resource address, thereby improving the reliability and integrity of page resource preloading.

[0093] In some embodiments, the terminal can report the page resource address of the target page to the management server in the following manner: when the role of the terminal is a contributor terminal for the target page, in response to the page display instruction for the target page, the page resources of the target page are loaded, and the page resource address of the page resources is recorded; the page resource address of the target page is reported to the management server.

[0094] Here, when the role of the terminal is a contributor terminal for the target page, in response to the page display instruction for the target page, the page resources of the target page are loaded, and the page resource address of the page resources is recorded. In actual implementation, the page resources can be stored in the background server corresponding to the target page, or in a database. When the terminal loads the page resources of the target page, it sends a request to obtain the page resources to the background server. The background server returns the page resource address of the corresponding page resource for the acquisition request. The terminal can then load the page resources based on the page resource address and record the page resource address of the page resource. In actual application, when the role of the terminal is a contributor terminal, the page resources of the target page are loaded online.

[0095] After the terminal has loaded the page resources of the target page, it reports the page resource address of the target page to the management server. In some embodiments, the terminal may report the page resource address of the target page to the management server in the following manner: when there are at least two page resource addresses, concatenate the at least two page resource addresses to obtain a resource address list corresponding to the target page; and report the resource address list corresponding to the target page to the management server.

[0096] In actual applications, the page resources of the target page may include multiple page resources, such as image resources, text resources, video resources, etc. Different page resources correspond to different page resource addresses. Therefore, there may be at least two page resource addresses. When there are at least two page resource addresses, the at least two page resource addresses are concatenated to obtain a resource address list corresponding to the target page, and then the resource address list corresponding to the target page is reported to the management server.

[0097] In some embodiments, the distributed system also includes: at least two reporter terminals; based on this, the terminal can determine the role of the terminal in the distributed system in the following manner: obtain the result that the target page belongs to the preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to the preloaded page is determined by the management server based on the number of reporter terminals that report the page loading timeout message; wherein, the page loading timeout message is used to indicate that the loading time of the page resource of the target page loaded by the corresponding reporter terminal exceeds the time threshold.

[0098] In some embodiments, the terminal may report a page loading timeout message to the management server in the following manner: when the terminal is a reporter terminal for the target page, it responds to a page display instruction for the target page, loads the page resources of the target page, and obtains the corresponding loading time; when the loading time exceeds a time threshold, it reports a page loading timeout message to the management server.

[0099] Here, the distributed system also includes at least two reporter terminals, which are used to obtain the time it takes for the page resources of the target page to be loaded online (i.e., the page loading time), and report a page loading timeout message to the management server when the loading time of the page resources of the target page exceeds a time threshold. In actual applications, when the terminal plays the role of a reporter terminal in the distributed system for the target page, the terminal responds to the page display instruction for the target page, loads the page resources of the target page, and obtains the corresponding loading time at the same time. When the loading time exceeds the time threshold, a page loading timeout message is reported to the management server.

[0100] After receiving the page load timeout information reported by the reporter terminal, the management server determines the number of reporter terminals that reported the page load timeout message. When the number exceeds a threshold (e.g., 50), the target page is determined to be a preloaded page. The threshold can be pre-set and fixed, or it can be dynamically adjusted. At this point, the terminal obtains a result from the management server indicating that the target page is a preloaded page, and continues to determine the terminal's role in the distributed system, that is, whether the terminal's role in the distributed system is a user terminal or a contributor terminal.

[0101] Based on this, the management server determines whether the target page is a preloaded page based on the number of reporter terminals that report page load timeout messages, and when the number of reporter terminals that report page load timeout messages exceeds a threshold, the target page is determined to be a preloaded page. Therefore, for any target page, the terminal can determine whether the terminal is a reporter terminal in the following manner: obtain at least one preloaded page from the management server; when at least one preloaded page includes the target page, determine that the terminal's role in the distributed system is not a reporter terminal for the target page; when at least one preloaded page does not include the target page, determine that the terminal's role in the distributed system is a reporter terminal for the target page.

[0102] See also Figure 5 , Figure 5 306: the management server receives the page loading timeout message, and when the number of reporter terminals that report the page loading timeout message exceeds the number threshold, determines that the target page is a preloaded page; and step 307: adds the target page to the preloaded page list.

[0103] In some embodiments, the distributed system also includes: a reporter terminal; based on this, the terminal can determine the role of the terminal in the distributed system in the following manner: obtain the result that the target page belongs to the preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to the preloaded page is determined by the management server based on the data size of the page resource reported by the reporter terminal.

[0104] In some embodiments, the terminal can report the data size of the page resource to the management server in the following manner: when the role of the terminal is a reporter terminal for the target page, in response to the page display instruction for the target page, the page resource of the target page is loaded, and the data size of the page resource is obtained; the data size of the page resource is reported to the management server.

[0105] Here, the distributed system also includes a reporter terminal, which is used to report the data size of the page resources loaded by itself to the management server. In actual application, when the terminal plays the role of a reporter terminal for a target page, it responds to a page display instruction for the target page, loads the page resources of the target page online, obtains the data size of the page resources, and then reports the data size of the page resources to the management server.

[0106] The management server receives the data size of the page resource reported by the reporter terminal. If the data size of the page resource reported by the reporter terminal exceeds a data size threshold, the management server determines that the target page is a preloaded page. At this point, the terminal receives a result from the management server indicating that the target page is a preloaded page and proceeds to determine the terminal's role in the distributed system, namely, whether the terminal's role in the distributed system is a user terminal or a contributor terminal.

[0107] See also Figure 6 , Figure 6 This is a flow chart of a page display method based on a distributed system provided by an embodiment of the present application, including: step 401: the terminal sends a request to obtain a preloaded page list to the management server, and the preloaded page list is used to store preloaded pages; step 402: the management server receives the request to obtain the preloaded page list, and returns the preloaded page list to the terminal; step 403: when the preloaded page list does not include the target page, for the target page, determine that the role of the terminal in the distributed system is a reporter terminal; step 404: in response to the page display instruction for the target page, load the page resource of the target page, and obtain the data size of the page resource; step 405: report the data size of the page resource to the management server; step 406: the management server receives the data size of the page resource, and when the data size of the page resource exceeds the data size threshold, determines that the target page is a preloaded page; step 407: adds the target page to the preloaded page list.

[0108] Step 102: When the role of the terminal is a user terminal for the target page, preload the page resources of the target page according to the page resource address of the target page at the management server.

[0109] The page resource address is reported to the management server by the contributor terminal after loading the page resource.

[0110] Here, when the role of the terminal is a user terminal for the target page, the terminal can manage the page resource address of the target page at the server and preload the page resources of the target page. In actual implementation, the terminal can send an acquisition request for the page resource address to the management server; the management server receives the acquisition request for the page resource address and returns the page resource address of the target page to the terminal; the terminal receives the returned page resource address of the target page and preloads the page resources of the target page based on the page resource address of the target page. Among them, the page resource address is the page resource address of the loaded page resource recorded when the contributor terminal loads the page resource of the target page online, and is reported to the management server after the page resource loading is completed.

[0111] In actual implementation, the page resources of the preloaded target page can be stored in the local storage area of ​​the terminal. When the display instruction for the target page is triggered, the target page can be displayed based on the preloaded page resources, thereby improving the display speed of the target page.

[0112] In some embodiments, after the terminal preloads the page resources of the target page, it can also determine whether the page display instruction is triggered within the target time length and obtain the corresponding result; when the result indicates that the page display instruction is not triggered within the target time length, the preloaded page resources are released.

[0113] Here, after preloading the page resources of the target page, the terminal can also determine whether the page display instruction is triggered within the target duration to obtain the corresponding result. In actual implementation, it is possible to detect in real time whether the page display instruction is triggered within the target duration, or it is possible to periodically detect whether the page display instruction is triggered within the target duration. When the result indicates that the page display instruction is not triggered within the target duration, the preloaded page resources are released. In actual implementation, the target duration can be pre-set, or it can be a sample training machine learning model based on the historical display data corresponding to the target page (such as how long the page display instruction is triggered), and then predicted based on the pre-trained machine learning model.

[0114] By applying the above embodiment, by determining whether the page display instruction is triggered within the target time length, and releasing the preloaded page resources when it is determined that the page display instruction is not triggered within the target time length, the memory usage can be reduced and the utilization rate of the storage space can be improved.

[0115] In some embodiments, after the terminal preloads the page resources of the target page, it can also determine the first version of the preloaded page resources and obtain the second version of the page resources at the management server; when the second version is inconsistent with the first version, the second version of the page resources is preloaded according to the page resource address of the target page at the management server, and the preloaded first version of the page resources is cleared.

[0116] Here, after preloading the page resources of the target page, the terminal can also determine the first version of the preloaded page resources and obtain the second version of the page resources at the management server. In actual implementation, the second version of the page resources at the management server can be obtained in real time or periodically; then the first version and the second version are compared to obtain a comparison result; when the comparison result indicates that the second version is inconsistent with the first version, it means that the version of the page resource has been updated. At this time, the second version of the page resource is preloaded based on the page resource address of the target page at the management server to ensure that the page resources of the preloaded target page are the latest version. At the same time, the preloaded first version of the page resources can also be cleared to reduce memory usage and improve storage space utilization.

[0117] By applying the above embodiment, by obtaining the second version of the page resource at the management server and the first version of the preloaded page resource, and comparing the first version and the second version, it is determined whether the page resource has been updated, and after the update, the second version of the page resource is preloaded in time through the page resource address to ensure that the page resource of the preloaded target page is the latest version; at the same time, the preloaded first version of the page resource is cleared to reduce memory usage and improve storage space utilization.

[0118] Step 103: When a page display instruction for a target page is triggered, the target page is displayed based on the preloaded page resources.

[0119] Here, after the terminal has preloaded the page resources of the target page, the user can trigger a page display instruction for the target page to trigger the display of the target page based on the page display instruction. At this time, when the page display instruction for the target page is triggered, the terminal responds to the page display instruction and displays the target page based on the preloaded page resources.

[0120] In some embodiments, the terminal may obtain a resource acquisition request for a page resource, where the resource acquisition request is generated based on a page display instruction of a target page; and intercept and process the resource acquisition request.

[0121] Here, when the terminal displays the target page in response to the page display instruction, in actual circumstances, when the page display instruction for the target page is triggered, the terminal will generate a resource acquisition request for the page resource based on the page display instruction of the target page to obtain the page resource of the target page. The resource acquisition request is a network request for obtaining (for example, from the background server of the target page) page resources. Since the terminal has already preloaded the page resources of the target page, there is no need to obtain the page resources of the target page again. Therefore, the terminal can intercept and process the resource acquisition request after obtaining the resource acquisition request for the page resource. Thus, the target page can be displayed based on the preloaded page resources.

[0122] By applying the above embodiment, when the terminal obtains a resource acquisition request generated based on a page display instruction for a target page, the resource acquisition request is intercepted and processed to avoid serial loading of page resources.

[0123] In some embodiments, the terminal may display the target page based on the preloaded page resources in the following manner: loading the page structure of the target page; and filling the preloaded page resources based on the page structure to display the target page.

[0124] Here, when the terminal displays the target page based on the preloaded page resources, it can first load the page structure of the target page, such as loading the HTML structure of the page online; then, based on the page structure, it populates the preloaded page resources and completes the rendering of the target page to display the target page. In actual implementation, the page structure can include a title section, an image section, a video section, a body section, a navigation link section, and so on. The page resources corresponding to each section in the page resources can be filled into the corresponding section of the page structure to display the target page.

[0125] Taking the HTML structure as an example, the HTML structure can include: 1) header part: represents the title of a content block of the page or the entire page; 2) nav part: represents the navigation link part of the page; 3) article part: represents an independent content in the page that is not related to the context; 4) section part: represents a content block in the page, such as the header and footer of the chapter, and can also indicate the structure of the document; 5) aside part: represents auxiliary information related to the content other than the content of the article element; 6) footer part: represents the footer of the page or an area in the page.

[0126] For example, see Figure 7 , Figure 7 This is a schematic diagram of the structure of the target page provided by the embodiment of the present application. Here, the page structure includes: a title part, a picture part, and a text part, such as Figure 7 As shown in Figure A; in this way, the page resources corresponding to each part in the page resources can be filled into the corresponding parts in the page structure. For example, the page resource "XX Auto Show Welcomes You" corresponding to the title part in the page resources can be filled into the title part in the page structure, the page resource "Picture 1" corresponding to the picture part in the page resources can be filled into the picture part in the page structure, and the page resource "Welcome to XX Auto Show, here are various cars such as Model Y, Model Z..." corresponding to the text part in the page resources can be filled into the text part in the page structure, as shown in Figure A. Figure 7 As shown in Figure B.

[0127] Applying the above embodiment, based on preloaded page resources and online loading of page structure to display the target page, compared with the method of loading the target page in advance (including code execution of the target page) and hiding it, reduces the waste of memory and network resources and avoids the problem of client instability.

[0128] See also Figure 8 , Figure 8 : is a flow chart of a page display method based on a distributed system provided by an embodiment of the present application. Here, the page display method based on a distributed system provided by an embodiment of the present application includes:

[0129] Step 501: The terminal runs a client, and sends a request for obtaining a preloaded page list to a management server for a target page of a page resource to be loaded in the client.

[0130] Here, the preloaded page list is used to store preloaded pages.

[0131] Step 502: The management server receives the request for obtaining the preloaded page list and returns the preloaded page list to the terminal.

[0132] Step 503 : The terminal receives the preloaded page list and determines whether the target page is included in the preloaded page list. If not, step 504 is executed. If so, step 507 is executed.

[0133] Step 504: For the target page, the terminal plays the role of a reporter terminal in the distributed system. In response to the page display instruction for the target page, the terminal loads the page resource of the target page and obtains the corresponding loading time.

[0134] Step 505: When the loading time exceeds the time threshold, the terminal reports a page loading timeout message to the management server.

[0135] Step 506: The management server receives the page loading timeout message, and when the number of reporter terminals reporting the page loading timeout message exceeds a threshold, determines that the target page is a preloaded page and adds it to the preloaded page list.

[0136] Step 507: The terminal sends an acquisition request for the page resource address to the management server.

[0137] Step 508: The management server receives the request for obtaining the page resource address and returns a response message to the terminal.

[0138] Step 509 : The terminal receives a response message returned by the management server based on the acquisition request and determines whether the response message includes the page resource address. If not, step 510 is executed; if so, step 513 is executed.

[0139] Step 510: For the target page, the terminal plays the role of a contributor terminal in the distributed system. In response to the page display instruction for the target page, the terminal loads the page resource of the target page and records the page resource address of the page resource.

[0140] Step 511: The terminal reports the page resource address of the target page to the management server.

[0141] Step 512: The management server receives and stores the page resource address of the target page.

[0142] Step 513: For the target page, the terminal plays the role of a user terminal in the distributed system, and preloads the page resources of the target page according to the page resource address of the target page.

[0143] Step 514: When a page display instruction for a target page is triggered, the terminal displays the target page based on the preloaded page resources.

[0144] Applying the above-mentioned embodiment of the present application, based on a distributed system including a contributor terminal, a user terminal and a management server, through the contributor terminal in the distributed system, after loading the page resources of the target page, the page resource address of the target page is reported to the management server; when the terminal determines that the role of the terminal is a user terminal for the target page of the terminal to load the page resources, the terminal preloads the page resources of the target page according to the page resource address of the target page at the management server, so that when the page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources. In this way, when preloading a page, only the page resources of the page need to be loaded, and when the page display instruction for the page is triggered, the page is generated based on the preloaded page resources for display, which can improve the utilization rate of memory and network resources, ensure the stability of the page display process, and improve the page display speed.

[0145] The following will illustrate an exemplary application of the embodiment of the present application in an actual application scenario. Taking the target page as an example, the page display method based on a distributed system provided by the embodiment of the present application will be described. First, the terms involved in the embodiment of the present application are explained, including:

[0146] 1) Unsupervised preloading: The embodiments of the present application provide a preloading solution based on a distributed system for solving the problems of "determining whether a landing page needs to be preloaded" and "the source of the page resource address of the preloaded landing page".

[0147] In related technologies, page code is typically pre-executed and the page is loaded in advance to achieve the purpose of page preloading. The loaded page is then hidden and displayed when the user views it. This not only leads to premature reporting of page click data, which, for many businesses (such as promotional businesses), can significantly affect billing due to the confusion in page click data reporting, but also leads to waste of memory and network resources, and even causes instability in the client that displays the landing page.

[0148] Based on this, an embodiment of the present application provides a page preloading solution based on a distributed system, which organizes the client (or the terminal where the client is located) into a distributed system to collaboratively implement the preloading of the landing page. It can automatically determine whether a landing page needs to be preloaded, and automatically determine the page resource address of the landing page that needs to be preloaded.

[0149] In the embodiment of the present application, the landing page is preloaded by preloading the page resources of the landing page in advance, which is essentially different from the method of hiding, opening the Webview in advance and loading the landing page. In the embodiment of the present application, what is loaded in advance are the page resources of the landing page (such as the image resources and file resources in the landing page), and the execution of the page code is not involved. It will not affect the reporting of page click data, nor will it cause the problem of waste of memory and network resources, and will not cause instability of the client displaying the landing page.

[0150] After the page resources of the landing page are preloaded, when the user triggers the page display instruction for the landing page, the terminal (client) loads the page structure (such as the page HTML structure) online, and at the same time intercepts the resource acquisition request of Webview, and returns the page resources of the locally preloaded landing page to Webview. The rendering and display of the landing page are completed through Webview, which can improve the page display speed and the opening speed is very stable.

[0151] In the embodiment of the present application, the following methods can be used: 1) determining whether the landing page is a page that needs to be preloaded to minimize device resource waste; and 2) determining the page resource address of the landing page. Detailed description is given below.

[0152] In the embodiment of the present application, the entire user group (i.e., the terminal corresponding to the user group) and the management server are regarded as a distributed system. The page display solution based on the distributed system provided by the embodiment of the present application includes three stages, namely, the timeout reporting stage, the resource address reporting stage, and the preloading stage. At the same time, the terminals in the distributed system can be divided into three categories, namely, the reporter terminal, the contributor terminal, and the user terminal. Next, combined with Figure 9 Explain them separately. Figure 9 This is a flow chart of a page display method based on a distributed system provided in an embodiment of the present application, including:

[0153] The first stage is the timeout reporting stage, and the terminal acts as the reporter terminal in the distributed system. At this time, for each landing page in the client running on the terminal, the terminal determines whether the online loading time of the landing page exceeds the time threshold (for example, 3 seconds). If so, it is considered that the page loading of the landing page has exceeded the time threshold, triggering the reporting operation, and reporting the page loading timeout message corresponding to the landing page to the management server, and carrying the page identifier of the landing page (for example, the link of the page, the MD5 of the link, the order number, or a combination of the three, etc.); It should be noted that the page loading timeout here refers to exceeding the time threshold, not the timeout of the page that cannot be opened. The page may be opened after waiting for a long time, or it may not be opened.

[0154] The management server uses the page identifier of the landing page as the KEY to count the reported page loading timeout messages. In actual implementation, the reports from different reporting terminals are cumulatively counted, and the reports from the same reporting terminal are not cumulative. When the management server determines that the count corresponding to the page identifier of a target landing page meets the preloading trigger condition, such as exceeding the counting threshold t (for example, 50 times), the target landing page is determined as a preloading page that needs to be preloaded.

[0155] The second phase is the resource address reporting phase, where the terminal acts as a contributor in the distributed system. During this phase, while loading the target landing page online, the contributor terminal records the page resource address of the target landing page, concatenates the page resource addresses, and generates a page resource address list, which it then reports to the management server.

[0156] The third stage is the preloading stage, where the terminal acts as a user terminal in a distributed system. For the target landing page, the user terminal that subsequently opens the target landing page obtains the page resource address list of the target landing page from the management server and preloads the page resources based on the page resource addresses in the page resource address list. When a page display instruction for the target landing page is triggered, the resource request in the Webview is intercepted and the locally preloaded page resources are provided for page display.

[0157] The above three stages are the processing of a single landing page. Any terminal can have all three roles, performing different tasks for different web page information pulled from the management server. Therefore, in the above three stages, the terminal needs to execute a request to the management server when the client is started to obtain a landing page list including at least one preloaded page, and then determine the role of the terminal in the distributed system for the target landing page based on the landing page list.

[0158] If the landing page list does not include the target landing page, the terminal's role in the distributed system is that of a reporter terminal. If the landing page list includes the target landing page, the terminal obtains a list of page resource addresses from the management server. If the list is empty, the terminal's role in the distributed system is that of a contributor terminal. If the list is not empty, the terminal's role in the distributed system is that of a user terminal. Different processes are performed based on different roles, as described in the three stages above.

[0159] In practice, the aforementioned parameters can be adjusted. For example, the page load time threshold of "3 seconds" can be modified as needed, for example, to 5 seconds. The count threshold t used by the management server to determine whether a landing page is a preloaded page can also be modified, for example, to 30. Of course, the aforementioned parameters can also be adjusted dynamically.

[0160] See also Figure 10 , Figure 10 This is a schematic diagram showing the target page provided by the embodiment of the present application. Figure 10 As shown in Figure A, the terminal receives a trigger operation (such as a click operation) for media information 1 in the media information stream and presents the target page corresponding to the media information 1, that is, the web landing page, as shown in FIG. Figure 10 As shown in Figure B. The embodiment of the present application can be applied to the scenario where the client opens a web landing page, has a wide range of applications, improves the opening speed of the landing page and the user experience, and also improves the arrival rate of the landing page, which is conducive to improving the effect data of the promotion information.

[0161] By applying the above-mentioned embodiments of the present application, the reporter terminal, contributor terminal, and user terminal included in the distributed system can automatically determine the landing page that needs to be preloaded, obtain the page resource address of the page resource of the landing page that needs to be preloaded, and realize the preloading of the page resource of the landing page, which can significantly improve the opening speed of the landing page, improve the user experience and page arrival rate.

[0162] It is understandable that in the embodiments of the present application, when user information and other related data are involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0163] The following continues to describe the exemplary structure of the distributed system-based page display device 555 provided in the embodiment of the present application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the distributed system-based page display device 555 of the memory 550 may include:

[0164] A determination module 5551 is configured to determine the role of the terminal in the distributed system for a target page of a page resource to be loaded by the terminal;

[0165] A preloading module 5552 is configured to preload page resources of the target page according to the page resource address of the target page at the management server when the role of the terminal is a user terminal for the target page;

[0166] The page resource address is reported to the management server by the contributor terminal after loading the page resource;

[0167] The display module 5553 is configured to display the target page based on the preloaded page resources when a page display instruction for the target page is triggered.

[0168] In some embodiments, the determination module 5551 is also used to send an acquisition request for the page resource address to the management server, and receive a response message returned by the management server based on the acquisition request; when the response message does not include the page resource address, it is determined that the role of the terminal in the distributed system is the contributor terminal; when the response message includes the page resource address, it is determined that the role of the terminal in the distributed system is the user terminal.

[0169] In some embodiments, the determination module 5551 is also used to obtain the number of terminal displays of the target page; when the number of terminal displays is lower than the number threshold, it is determined that the role of the terminal in the distributed system is the contributor terminal; when the number of terminal displays is not lower than the number threshold, it is determined that the role of the terminal in the distributed system is the user terminal.

[0170] In some embodiments, the distributed system also includes: at least two reporter terminals; the determination module 5551 is also used to obtain the result that the target page belongs to the preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to the preloaded page is determined by the management server based on the number of reporter terminals that report the page loading timeout message; wherein, the page loading timeout message is used to indicate that the time for the corresponding reporter terminal to load the page resource of the target page exceeds the time threshold.

[0171] In some embodiments, the determination module 5551 is also used to, when the role of the terminal is a reporter terminal for the target page, load the page resources of the target page in response to a page display instruction for the target page, and obtain the corresponding loading time; when the loading time exceeds the time threshold, report the page loading timeout message to the management server.

[0172] In some embodiments, the determination module 5551 is also used to, when the role of the terminal for the target page is a contributor terminal, load the page resources of the target page in response to a page display instruction for the target page, and record the page resource address of the page resource; and report the page resource address of the target page to the management server.

[0173] In some embodiments, the determination module 5551 is also used to, when there are at least two page resource addresses, concatenate the at least two page resource addresses to obtain a resource address list corresponding to the target page; and report the resource address list corresponding to the target page to the management server.

[0174] In some embodiments, the distributed system also includes: a reporter terminal; the determination module 5551 is also used to obtain the result that the target page belongs to a preloaded page from the management server; when the result indicates that the target page is a preloaded page, determine the role of the terminal in the distributed system; wherein, the result that the target page belongs to a preloaded page is determined by the management server based on the data size of the page resource reported by the reporter terminal.

[0175] In some embodiments, the determination module 5551 is also used to, when the role of the terminal is a reporter terminal for the target page, load the page resources of the target page in response to a page display instruction for the target page, and obtain the data size of the page resources; and report the data size of the page resources to the management server.

[0176] In some embodiments, the display module 5553 is further used to obtain a resource acquisition request for the page resource, where the resource acquisition request is generated based on the page display instruction of the target page; and intercept and process the resource acquisition request.

[0177] In some embodiments, the display module 5553 is further used to load the page structure of the target page; based on the page structure, fill the preloaded page resources to display the target page.

[0178] In some embodiments, the display module 5553 is also used to determine whether the page display instruction is triggered within the target time length and obtain a corresponding result; when the result indicates that the page display instruction is not triggered within the target time length, the preloaded page resources are released.

[0179] In some embodiments, the preloading module 5552 is also used to determine the first version of the preloaded page resource and obtain the second version of the page resource at the management server; when the second version is inconsistent with the first version, the second version of the page resource is preloaded according to the page resource address of the target page at the management server, and the preloaded first version of the page resource is cleared.

[0180] Applying the above-mentioned embodiment of the present application, based on a distributed system including a contributor terminal, a user terminal and a management server, through the contributor terminal in the distributed system, after loading the page resources of the target page, the page resource address of the target page is reported to the management server; when the terminal determines that the role of the terminal is a user terminal for the target page of the terminal to load the page resources, the terminal preloads the page resources of the target page according to the page resource address of the target page at the management server, so that when the page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources. In this way, when preloading a page, only the page resources of the page need to be loaded, and when the page display instruction for the page is triggered, the page is generated based on the preloaded page resources for display, which can improve the utilization rate of memory and network resources, ensure the stability of the page display process, and improve the page display speed.

[0181] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the distributed system-based page display method provided in the present application.

[0182] An embodiment of the present application also provides a computer-readable storage medium, which stores executable instructions. When the executable instructions are executed by a processor, the processor will execute the page display method based on a distributed system provided in an embodiment of the present application.

[0183] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.

[0184] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0185] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0186] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0187] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A page display method based on a distributed system, characterized in that: The distributed system includes: a contributor terminal, a user terminal, a reporter terminal and a management server, and the method includes: For a target page of a page resource to be loaded by a terminal, determining a role of the terminal in the distributed system; The result that the target page belongs to the preloaded page is determined by the management server in at least one of the following ways: when the number of the reporter terminals whose loading time of the target page exceeds a time threshold exceeds a quantity threshold, the target page is determined to be the preloaded page; when the data size of the page resource loaded by the reporter terminal for the target page exceeds a data size threshold, the target page is determined to belong to the preloaded page; When the role of the terminal is a user terminal and the target page is the preloaded page, preloading the page resource of the target page according to the page resource address of the target page at the management server; The page resource address is reported to the management server by the contributor terminal in the following manner: in response to a page display instruction for the target page, the page resource of the target page is loaded, the page resource address of the page resource is recorded, and the page resource address of the target page is reported to the management server; When a page display instruction for the target page is triggered, the target page is displayed based on the preloaded page resources.

2. The method according to claim 1, wherein The determining the role of the terminal in the distributed system includes: Sending an acquisition request for the page resource address to the management server, and receiving a response message returned by the management server based on the acquisition request; When the response message does not include the page resource address, determining that the role of the terminal in the distributed system is the contributor terminal; When the response message includes the page resource address, it is determined that the role of the terminal in the distributed system is the user terminal.

3. The method according to claim 1, wherein The determining the role of the terminal in the distributed system includes: Obtaining the number of terminal displays of the target page; When the terminal display count is lower than a count threshold, determining that the role of the terminal in the distributed system is the contributor terminal; When the terminal display times are not less than a times threshold, it is determined that the role of the terminal in the distributed system is the user terminal.

4. The method according to claim 1, wherein The distributed system further includes: at least two reporter terminals; and determining the roles of the terminals in the distributed system includes: Obtaining from the management server a result that the target page belongs to a preloaded page; When the result indicates that the target page is a preloaded page, determining a role of the terminal in the distributed system; The result that the target page belongs to a preloaded page is determined by the management server based on the number of reporter terminals that report page loading timeout messages; The page loading timeout message is used to indicate that the time taken by the corresponding reporter terminal to load the page resource of the target page exceeds a time threshold.

5. The method according to claim 4, wherein The method further comprises: When the role of the terminal is a reporter terminal for the target page, in response to a page display instruction for the target page, the page resource of the target page is loaded, and the corresponding loading time is obtained; When the loading time exceeds the time threshold, the page loading timeout message is reported to the management server.

6. The method according to claim 1, wherein The method further comprises: When there are at least two page resource addresses, concatenating the at least two page resource addresses to obtain a resource address list corresponding to the target page; Report the resource address list corresponding to the target page to the management server.

7. The method according to claim 1, wherein The method further comprises: Obtaining from the management server a result that the target page belongs to a preloaded page; When the result indicates that the target page is a preloaded page, a role of the terminal in the distributed system is determined.

8. The method according to claim 7, wherein The method further comprises: When the role of the terminal is a reporter terminal for the target page, in response to a page display instruction for the target page, the page resource of the target page is loaded, and the data size of the page resource is obtained; Report the data size of the page resource to the management server.

9. The method according to claim 1, wherein The method further comprises: Obtaining a resource acquisition request for the page resource, where the resource acquisition request is generated based on a page display instruction of the target page; The resource acquisition request is intercepted and processed.

10. The method according to claim 1, wherein The displaying of the target page based on the preloaded page resource includes: Loading the page structure of the target page; Based on the page structure, the preloaded page resources are filled to display the target page.

11. The method according to claim 1, wherein After preloading the page resources of the target page, the method further includes: Determine whether the page display instruction is triggered within the target duration and obtain a corresponding result; When the result indicates that the page display instruction is not triggered within the target duration, the preloaded page resource is released.

12. The method according to claim 1, wherein After preloading the page resources of the target page, the method further includes: Determining a preloaded first version of the page resource and obtaining a second version of the page resource at the management server; When the second version is inconsistent with the first version, the page resources of the second version are preloaded according to the page resource address of the target page at the management server, and the preloaded page resources of the first version are cleared.

13. A page display device based on a distributed system, characterized in that: The distributed system includes: a contributor terminal, a user terminal, a reporter terminal and a management server, and the device includes: A determination module, configured to determine a role of the terminal in the distributed system for a target page of a page resource to be loaded by the terminal; The result that the target page belongs to the preloaded page is determined by the management server in at least one of the following ways: when the number of the reporter terminals whose loading time of the target page exceeds a time threshold exceeds a quantity threshold, the target page is determined to be the preloaded page; when the data size of the page resource loaded by the reporter terminal for the target page exceeds a data size threshold, the target page is determined to belong to the preloaded page; a preloading module for preloading page resources of the target page according to the page resource address of the target page at the management server when the role of the terminal is a user terminal and the target page is the preloaded page; The page resource address is reported to the management server by the contributor terminal in the following manner: in response to a page display instruction for the target page, the page resource of the target page is loaded, the page resource address of the page resource is recorded, and the page resource address of the target page is reported to the management server; A display module is used to display the target page based on the preloaded page resources when a page display instruction for the target page is triggered.

14. The device according to claim 13, wherein The determining the role of the terminal in the distributed system includes: Sending an acquisition request for the page resource address to the management server, and receiving a response message returned by the management server based on the acquisition request; When the response message does not include the page resource address, determining that the role of the terminal in the distributed system is the contributor terminal; When the response message includes the page resource address, it is determined that the role of the terminal in the distributed system is the user terminal.

15. The device according to claim 13, wherein The determining the role of the terminal in the distributed system includes: Obtaining the number of terminal displays of the target page; When the terminal display count is lower than a count threshold, determining that the role of the terminal in the distributed system is the contributor terminal; When the terminal display times are not less than a times threshold, it is determined that the role of the terminal in the distributed system is the user terminal.

16. An electronic device, characterized in that: The electronic device comprises: a memory for storing executable instructions; The processor is configured to implement the page display method based on a distributed system as described in any one of claims 1 to 12 when executing the executable instructions stored in the memory.

17. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the page display method based on the distributed system described in any one of claims 1 to 12 is implemented.

18. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the page display method based on a distributed system as described in any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Resource preloading method and device and storage medium

    CN111639276A