CN112073405A - Webpage data loading method and device, computer equipment and storage medium - Google Patents

Webpage data loading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112073405A
CN112073405A CN202010916505.8A CN202010916505A CN112073405A CN 112073405 A CN112073405 A CN 112073405A CN 202010916505 A CN202010916505 A CN 202010916505A CN 112073405 A CN112073405 A CN 112073405A
Authority
CN
China
Prior art keywords
target
character string
url address
content character
hash code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010916505.8A
Other languages
Chinese (zh)
Other versions
CN112073405B (en
Inventor
彭娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010916505.8A priority Critical patent/CN112073405B/en
Publication of CN112073405A publication Critical patent/CN112073405A/en
Application granted granted Critical
Publication of CN112073405B publication Critical patent/CN112073405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of data loading, and discloses a webpage data loading method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a webpage access request, wherein the webpage access request comprises a target URL address; querying a localstorage memory based on the target URL address, and judging whether the localstorage memory stores a local content character string corresponding to the target URL address; if the localstorage memory stores the local content character string, loading local static resource data corresponding to the local content character string based on the local content character string, and rendering and displaying the local static resource data on a current display page. The method can load the local static resource data corresponding to the local content character string cached in the localstorage memory, improve the loading efficiency of the static resource data in the target webpage data corresponding to the target URL address, and avoid wasting communication resources.

Description

Webpage data loading method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data loading technologies, and in particular, to a method and an apparatus for loading web page data, a computer device, and a storage medium.
Background
The existing web technology is based on three front-end core technologies of HTML, CSS and JavaScript, a front-end module is specifically embodied as a xxx.html file, a xxx.css file and a xxx.js file, and these code files and their related resource files such as pictures, audio and video are generally called static resource data. The static resource data are usually key elements essential for smooth loading of a front-end page, and some parts of the static resource data are missing, which may cause abnormality of a web page, but in the existing web technology, the static resource data are stored in a server in a unified manner, each page loading needs to load related static resource data from the server through an http request, the loading speed is slow, and under the conditions of network abnormality or server failure and the like, problems of abnormal request, incapability of normally displaying related contents, influence on user experience and the like occur.
Disclosure of Invention
The embodiment of the invention provides a webpage data loading method and device, computer equipment and a storage medium, and aims to solve the problem that the existing static resource data loading speed is low.
A webpage data loading method comprises the following steps executed by a client:
acquiring a webpage access request, wherein the webpage access request comprises a target URL address;
querying a localstorage memory based on the target URL address, and judging whether the localstorage memory stores a local content character string corresponding to the target URL address;
if the localstorage memory stores the local content character string, loading local static resource data corresponding to the local content character string based on the local content character string, and rendering and displaying the local static resource data on a current display page;
if the localstorage memory does not store the local content character string, establishing a WebSocket communication link with a server, sending a content access request corresponding to the target URL address to the server, and acquiring a target content character string and a target hash code which are returned by the server and correspond to the target URL address;
and loading target static resource data corresponding to the target content character string based on the target content character string, rendering and displaying the target static resource data on a current display page, and storing the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
A webpage data loading method comprises the following steps executed by a server:
acquiring a content access request sent by a client through a WebSocket communication link, wherein the content access request comprises a target URL (uniform resource locator) address;
inquiring a background database according to the target URL address to acquire a target content character string and a target hash code corresponding to the target URL address;
and sending a target content character string and a target hash code corresponding to the target URL address to the client through a WebSocket communication link, so that the client loads target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on a current display page, and stores the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
A web page data loading apparatus comprising:
the webpage access request acquisition module is used for acquiring a webpage access request, and the webpage access request comprises a target URL address;
the local character string judging module is used for inquiring a localstorage memory based on the target URL address and judging whether the localstorage memory stores a local content character string corresponding to the target URL address;
a local data loading module, configured to load, if the localstorage memory stores the local content character string, local static resource data corresponding to the local content character string based on the local content character string, and render and display the local static resource data on a current display page;
the content access processing module is used for establishing a WebSocket communication link with a server if the localstorage memory does not store the local content character string, sending a content access request corresponding to the target URL address to the server, and acquiring the target content character string and the target hash code which are returned by the server and correspond to the target URL address;
and the target data loading module is used for loading target static resource data corresponding to the target content character string based on the target content character string, rendering and displaying the target static resource data on a current display page, and storing the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
A web page data loading apparatus comprising:
the content access request acquisition module is used for acquiring a content access request sent by a client through a WebSocket communication link, and the content access request comprises a target URL address;
the target information query module is used for querying a background database according to the target URL address and acquiring a target content character string and a target hash code corresponding to the target URL address;
and the target information sending module is used for sending a target content character string and a target hash code corresponding to the target URL address to the client through a WebSocket communication link, so that the client loads target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on a current display page, and stores the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned web page data loading method when executing the computer program.
A computer-readable storage medium, which stores a computer program, which, when executed by a processor, implements the above-described web page data loading method.
According to the webpage data loading method, the webpage data loading device, the computer equipment and the storage medium, by utilizing the characteristic that the data cached by the localstorage memory has no expiration time and is not sent to the server along with the interactive request triggered by the browser, when the localstorage memory stores the local content character string corresponding to the target URL address, the local static resource data corresponding to the local content character string can be loaded, the loading efficiency of the static resource data in the target webpage data corresponding to the target URL address is improved, and the waste of communication resources is avoided; when the target content character string corresponding to the target URL address is not stored in the localstorage memory, a WebSocket communication link is created with the server, through WebSocket communication link, obtaining target content character string from server and loading corresponding target static resource data, the WebSocket communication link can be used for bidirectional data communication, so that the data exchange process is simpler, the data transmission efficiency between the client and the server is improved, and storing the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner, the loading efficiency of the static resource data in the target webpage data corresponding to the target URL address is improved in the next access process, and the situation that the static resource data in the target webpage data corresponding to the target URL address cannot be normally loaded and displayed under the conditions of network abnormity, server failure and the like is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of a method for loading web page data according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 3 is another flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 4 is another flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 5 is another flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 6 is another flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 7 is another flowchart of a method for loading web page data according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating a web page data loading apparatus according to an embodiment of the present invention;
FIG. 9 is another schematic diagram of a web page data loading apparatus according to an embodiment of the invention;
FIG. 10 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The webpage data loading method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. Specifically, the webpage data loading method is applied to a webpage data loading system, the webpage data loading system comprises a client and a server shown in fig. 1, and the client and the server are communicated through a network and used for realizing rapid loading of static resource data in a target webpage and improving loading efficiency of the static resource data. The client is also called a user side, and refers to a program corresponding to the server and providing local services for the client. The client may be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a method for loading web page data is provided, which is described by taking the method as an example applied to the client in fig. 1, and the method for loading web page data includes the following steps executed by the client:
s201: and acquiring a webpage access request, wherein the webpage access request comprises a target URL address.
The webpage access request is a request triggered by a client and used for accessing a target webpage. The target URL address is the URL address which needs to be accessed by the webpage access request, and the URL address is a character string which is used for describing information resources on the Internet and is mainly used on various WWW client programs and server programs. The URL can be used for describing various information resources in a uniform format, including files, addresses and directories of servers and the like.
In this example, the user may input a target URL address on the browsing interface of the client, and form a web page access request based on the target URL address, so that the client may obtain the web page access request, so as to load and display target web page data corresponding to the target URL address on the browsing interface of the client, where the target web page data includes static resource data and dynamic resource data.
S202: and querying a localstorage memory based on the target URL address, and judging whether the localstorage memory stores the local content character string corresponding to the target URL address.
The local content character string is a character string which is cached in the localstorage memory and formed by converting static resource data in target webpage data corresponding to the target URL address. Generally speaking, in the process of accessing a webpage, interaction with a server is needed, and data acquired from the server are dynamic resource data; the data which can be directly acquired without interaction with the server is static resource data. The static resource data includes, but is not limited to, code files including xxx.
In this embodiment, when receiving a web page access request triggered by a user, a client queries a localstorage memory based on a target URL address, and determines whether a local content character string corresponding to the target URL address is stored in the localstorage memory, that is, whether the localstorage memory stores a local content character string formed by converting static resource data in target web page data corresponding to the target URL address, so as to execute step S203 or step S204 according to a determination result, so as to load static resource data in the target web page data corresponding to the target URL address in different manners.
It can be understood that the localstorage memory is used as a local memory for caching the local content character string corresponding to the target URL address, and the data cached in the localstorage memory has no expiration time and cannot be sent to the server along with the interaction request triggered by the browser of the client, that is, the data cached in the process of sending the interaction request to the server by the browser is not sent to the server along with the interaction request, so that waste of communication resources can be avoided. Compared with the data cached in the cookie storage, the cached data is appended to the interaction request every time the browser requests the server, which causes waste of communication resources between the browser and the server at the client. Compared with the sessionStorage memory which can release the cached data when the current display page is closed, the cached data in the localstorage memory has no expiration time, and the cached data cannot be released when the current display page is closed, so that the local content character string formed by caching the static resource data in the target webpage data corresponding to the URL address by using the localstorage memory is realized, and technical support is provided for loading the corresponding local static resource data by using the local content character string.
S203: and if the localstorage memory stores the local content character string, loading local static resource data corresponding to the local content character string based on the local content character string, and rendering and displaying the local static resource data on the current display page.
In this embodiment, if the localstorage memory stores the local content character string, it indicates that the client does not communicate with the server for the first time, and the localstorage memory already stores the local content character string acquired in the process of accessing the target URL address before the current time of the system, and at this time, the client may load local static resource data corresponding to the local content character string based on the local content character string, that is, perform reverse conversion on the local content character string to acquire and load the target static resource data; and then, rendering and displaying the local static resource data on the current display page, thereby achieving the purpose of quickly loading and displaying the static resource data in the target webpage data corresponding to the URL address. It can be understood that, because there is no expiration time in the data cached in the localstorage memory, in case of a network anomaly or a server failure, the static resource data in the target webpage data corresponding to the URL address can still be rendered and displayed through the current display page, so that the influence on user experience due to screen blank or error reporting is avoided.
S204: and if the localstorage memory does not store the local content character string, establishing a WebSocket communication link with the server, sending a content access request corresponding to the target URL address to the server, and acquiring the target content character string and the target hash code which are returned by the server and correspond to the target URL address.
The target content character string is formed by converting static resource data in target webpage data corresponding to the target URL address and corresponding to the URL address. The target hash code is formed by processing the target content character string by using an MD5 algorithm. The MD5 is a hash algorithm, and the MD5 is adopted to process the target content character string, so that the formed target hash code can effectively guarantee the integrity of the target content character string. In this example, each target content character string corresponds to only one target hash code, and the target content character string cannot be derived from the target hash code, and there is no possibility that two target content character strings with different contents correspond to the same target hash code.
In this embodiment, if the localstorage memory does not store the local content character string, it indicates that the client has not communicated with the server, and at this time, the client needs to send a request for creating a communication link to the server, and create a WebSocket communication link that communicates with the server based on response information of the server, so that communication interaction between the client and the server is realized by using the WebSocket communication link. WebSocket is a protocol provided by HTML5 for full-duplex communication over a single TCP connection. WebSocket enables data exchange between a client and a server to be simpler, and allows the server to actively push data to the client. In the WebSocket API, a client and a server only need to complete one handshake, namely the client sends a request for establishing a communication link to the server, the server sends response information to the client, and a fast communication channel with persistent connection can be established between the client and the server for bidirectional data transmission.
In this embodiment, after the client creates the WebSocket communication link in bidirectional communication with the server, the client may send a content access request including the target URL address to the server through the WebSocket communication link, where the content access request may be understood as a request sent by the client to the server to request to acquire static resource data in target web page data corresponding to the target URL address. After receiving the content access request, the server needs to query a background database according to the target URL address to acquire a target content character string and a target hash code corresponding to the target URL address so as to send the target content character string and the target hash code to the client through the WebSocket communication link, so that bidirectional data communication is performed by using the WebSocket communication link, and the data exchange process is simpler; moreover, the WebSocket communication link can be permanently connected after being established through one-time handshake, so that the situation that the WebSocket communication link needs to be established again in the subsequent data transmission process is avoided, and the data transmission efficiency is improved.
S205: and loading target static resource data corresponding to the target content character string based on the target content character string, rendering and displaying the target static resource data on the current display page, and storing the target URL address, the target content character string and the target hash code in a localstorage memory in an associated manner.
In this embodiment, after receiving a target content character string and a target hash code through a WebSocket communication link, a client needs to load target static resource data corresponding to the target content character string based on the target content character string, and render and display the target static resource data on a current display page, so as to achieve the purpose of loading and displaying the target static resource data; and the client stores the received target content character string, the target hash code and the target URL address in the localstorage memory in a correlated manner, so that when the client receives a page access request corresponding to the target URL address next time, the step S203 can be executed to achieve the purpose of quickly loading and displaying local static resource data.
In the webpage data loading method provided by this embodiment, by using the characteristic that data cached in the localstorage memory has no expiration time and is not sent to the server along with an interaction request triggered by the browser, when the localstorage memory stores the local content character string corresponding to the target URL address, local static resource data corresponding to the local content character string can be loaded, the loading efficiency of static resource data in the target webpage data corresponding to the target URL address is improved, and waste of communication resources is avoided; when the target content character string corresponding to the target URL address is not stored in the localstorage memory, a WebSocket communication link is created with the server, through WebSocket communication link, obtaining target content character string from server and loading corresponding target static resource data, the WebSocket communication link can be used for bidirectional data communication, so that the data exchange process is simpler, the data transmission efficiency between the client and the server is improved, and the target URL address, the target content character string and the target hash code are stored in a localstorage memory in an associated manner, the loading efficiency of the static resource data in the target webpage data corresponding to the target URL address is improved in the next access process, and the situation that the static resource data in the target webpage data corresponding to the target URL address cannot be normally loaded and displayed under the conditions of network abnormity, server failure and the like is avoided.
In an embodiment, as shown in fig. 3, after step S203, that is, if the localstorage memory stores the local content string, the method for loading the web page data further includes, after the local static resource data corresponding to the local content string is loaded based on the local content string and rendered and displayed on the current display page, the following steps executed by the client:
s301: and generating an updating access request, wherein the updating access request comprises a target URL address and a local hash code.
The update access request is a request for accessing the server formed after the local static resource data is loaded based on the local content character string in the localstorage memory, so as to judge whether the local static resource data has an update. The local hash code refers to a hash code corresponding to the target URL address and cached in the localstorage memory before the current time of the system, and the local hash code may be a target hash code which is first issued by the server and cached, or an update hash code which is issued by the server before the current time of the system.
In this embodiment, after the client loads and renders and displays the local static resource data based on the local content character string cached by the localstorage memory, because the access time interval between the webpage access request received by the client this time and the webpage access request received last time is uncertain, if the access time interval is long, it cannot be guaranteed that the local static resource data loaded and rendered and displayed by the webpage access request this time is the latest static resource data, therefore, after the client renders and displays the local static resource data on the current display page, the client generates an update access request including a target URL address and a local hash code, so as to verify whether the static resource data in the target webpage data corresponding to the target URL address is updated or not through the target URL address and the local hash code.
As an example, when the localstorage memory stores the local content character string, the client acquires the latest update time corresponding to the local content character string, that is, the time of accessing the target webpage corresponding to the target URL address for the latest time; determining the difference between the current time and the latest updating time of the system as an access time interval; if the access time interval is larger than the preset time interval, an update access request is generated, so that the update access request is generated based on the webpage access request with the longer access time interval, the static resource data is updated based on the update access request, the real-time performance of the target webpage data is ensured, the update access request generated by the webpage access request with the smaller access time interval is avoided, frequent interaction between the client and the server is avoided, and the network communication resource is saved. The preset time interval is a standard threshold value which is preset for evaluating whether the access time interval is longer.
S302: and sending an updating access request to the server through a pre-established WebSocket communication link, and acquiring updating result data triggered by the server when content updating exists, wherein the updating result data comprises an updating content character string corresponding to the target URL address and an updating hash code.
Because the WebSocket communication link between the client and the server is already established when the client sends the webpage access request corresponding to the target URL address to the server for the first time, the persistent connection and the bidirectional data communication between the client and the server can be realized, after the client generates the update access request, the update access request can be sent to the server through the pre-established WebSocket communication link, and the transmission efficiency of the update access request is improved.
The updated content character string is a content character string stored in a background database of the server and corresponding to the target URL address, and the updated content character string is inconsistent with the local content character string cached in the localstorage memory, namely, content updating exists. The updated hash code is stored in a background database of the server and corresponds to the target URL address, and is inconsistent with the local hash code cached in the localstorage memory.
In this embodiment, the client receives the update result data sent by the server only when the server determines that the content update exists, for example, when the local hash code corresponding to the target URL address is not consistent with the historical hash code in the background database, so as to obtain the update content character string and the update hash code in the update result data.
S303: and loading the updated static resource data corresponding to the updated content character string based on the updated content character string, rendering and displaying the updated static resource data on the current display page, and storing the target URL address, the updated content character string and the updated hash code in a localstorage memory in an associated manner.
In the embodiment, after receiving the update result data, the client needs to load the update static resource data corresponding to the update content character string based on the update content character string, and render and display the update static resource data on the current display page, so that the update display of the static resource data in the target webpage data is completed, and the display accuracy of the target webpage data is ensured; and the target URL address, the updated content character string and the updated hash code are stored in the localstorage memory in a correlated mode to complete the information updating of the cache of the localstorage memory, and the accuracy and the integrity of the local static resource data loaded by the next webpage access request are improved. It can be understood that, after the client loads, renders and displays the local static resource data based on the local content character string cached in the localstorage memory, the client may trigger an update access request in the process of browsing the web page to obtain the update result data fed back by the server in real time, and update the static resource data displayed on the current display page and the data cached in the localstorage memory based on the update result data, so as to ensure the real-time performance of the data and improve the page performance, so as to enhance the user viscosity.
In an embodiment, as shown in fig. 4, before step S201, that is, before acquiring the web page access request, the web page data loading method further includes the following steps performed by the client:
s401: and acquiring a webpage configuration request, wherein the webpage configuration request comprises a configuration URL address and configuration static resource data.
The webpage configuration request is a request for webpage configuration information, which is triggered by a developer after any webpage development test is completed. The configuration URL address is the URL address of the web page for which configuration is desired. The static resource data is configured to be static resource data of a configuration webpage corresponding to the configuration URL address, and includes but is not limited to code files such as xxx. In this embodiment, after a developer completes a configuration web page in a development test, the developer may trigger a web page configuration request based on the configuration web page, so as to determine web page configuration information corresponding to the configuration web page according to the web page configuration request.
S402: and converting the configured static resource data to obtain a configuration content character string corresponding to the configured static resource data.
In this embodiment, the client performs string conversion on the code content in the configured static resource data, that is, the code content in the code files such as xxx.html file, xxx.css file, and xxx.js file, to obtain the configuration content string corresponding to the configured static resource data.
As an example, the client obtains the configuration content string in the configuration static resource data through the general API of the JS obtaining DOM node to convert the configuration static resource data into the content string format. In this example, the nodes refer to all objects and contents in the web page, such as documents, elements, texts, attributes, annotations, and the like, and the nodes are the most basic units of the DOM, and different types of nodes are derived to jointly form a tree structure model of the web page.
S403: and processing the configuration content character string by adopting an MD5 algorithm to obtain a configuration hash code.
MD5 is a hash algorithm, which can correspond to a hash value for a piece of information, and cannot derive the piece of information by the hash value, and it is also necessary to ensure that there are no two different pieces of information corresponding to the same hash value, so as to ensure the integrity of the information. The configuration hash code is formed by processing the configuration content character string by using an MD5 algorithm.
In this embodiment, the client processes the configuration content character strings by using an MD5 algorithm to obtain the configuration hash codes, so that each configuration content character string corresponds to only one configuration hash code, and the configuration content character strings cannot be derived from the configuration hash codes, and there is no possibility that two configuration content character strings with different contents correspond to the same configuration hash code.
S404: and forming webpage configuration information based on the configuration URL address, the configuration content character string and the configuration hash code, and sending the webpage configuration information to the server.
In this embodiment, the client may form the web page configuration information based on the configuration URL address, the configuration content character string, and the configuration hash code, so as to send the web page configuration information to the server, so that the server stores the web page configuration information in the background database, and completes a response to a web page access request first triggered by the client according to the web page configuration information stored in the background database, that is, returns a target content character string and a target hash code corresponding to the target URL address; or responding to the updating access request which is not triggered for the first time, namely returning the updating content character string and the updating hash code corresponding to the target URL address.
In the webpage data loading method provided by this embodiment, the static resource configuration data is converted into a configuration content character string in a character string format to ensure the feasibility of MD5 algorithm processing; and then, processing the configuration content character string by adopting an MD5 algorithm to acquire a configuration hash code, so that information verification is carried out by using the configuration hash code in the following process, and the integrity of the configuration content character string is ensured.
In an embodiment, as shown in fig. 5, a method for loading web page data is provided, which is described by taking an application of the method in a server as an example, and the method for loading web page data includes the following steps executed by the server:
s501: and establishing a WebSocket communication link with the client, and acquiring a content access request sent by the client through the WebSocket communication link, wherein the content access request comprises a target URL address.
In this embodiment, the server receives a request for creating a communication link sent by the client, responds based on the request for creating the communication link, forms response information, and feeds the response information back to the client, so as to create a WebSocket communication link with the client, and thus, communication interaction between the client and the server is realized by using the WebSocket communication link. It can be understood that the client sends a request for creating a communication link to the server, and the server sends response information to the client, so that one-time handshake is completed between the client and the server, and a WebSocket communication link with persistent connection can be created between the client and the server, and bidirectional data transmission is performed, so that the communication process between the client and the server is simpler.
The content access request is a request sent by a client to a server for requesting to acquire static resource data corresponding to a target URL address. In this embodiment, after the server and the client create the WebSocket communication link, the server may receive the content access request containing the target URL address sent by the client through the WebSocket communication link, so as to perform subsequent response according to the received content access request, that is, perform the response operations in steps S502 and S503.
In this embodiment, the content access request received by the server is a request for accessing static resource data in target web page data corresponding to a target URL address in the server, which is triggered after the client loads local static resource data corresponding to the local content character string based on the local content character string and renders and displays the local static resource data on the current display page.
S502: and querying a background database according to the target URL address to acquire a target content character string and a target hash code corresponding to the target URL address.
In this embodiment, in the process of creating each web page, a developer needs to form web page configuration information based on the URL address and the static resource data corresponding to each web page, where the web page configuration information includes a configuration URL address, a configuration content character string, and a configuration hash code, and is stored in a background database. Correspondingly, after receiving the content access request, the server may query the background database by using the target URL address, obtain the configuration URL address corresponding to the target URL address, determine the configuration content character string in the webpage configuration information corresponding to the configuration URL address as the target content character string, and determine the configuration hash code in the webpage configuration information corresponding to the configuration URL address as the target hash code. The target content character string is formed by converting static resource data in target webpage data corresponding to the target URL address. The target hash code is formed by processing the target content character string by using an MD5 algorithm.
S503: and sending the target content character string and the target hash code corresponding to the target URL address to the client through a WebSocket communication link, so that the client loads target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on the current display page, and stores the target URL address, the target content character string and the target hash code in a localstorage memory in an associated manner.
In this embodiment, after acquiring the target content character string and the target hash code corresponding to the target URL address, the server needs to send the target content character string and the target hash code to the client through the WebSocket communication link, so that the client loads the target static resource data corresponding to the target content character string based on the target content character string, and stores the target URL address, the target content character string, and the target hash code in the localstorage memory in an associated manner, thereby completing the loading of the static resource data in the target web page data, facilitating the fast loading of the static resource data in the next target web page data, and improving the efficiency of loading the static resource data next time.
In the webpage data loading method provided by this embodiment, the server and the client create a WebSocket communication link, and bidirectional data communication can be performed by using the WebSocket communication link, so that the data exchange process is simpler, and the data transmission efficiency between the client and the server is improved; the server inquires a target content character string and a target hash code according to a target URL address in the content access request, and sends the target content character string and the target hash code to the client so as to finish a target static resource data loading process by using the target content character string, and stores the target URL address and the target content character string and the target hash code corresponding to the target URL address in a localstorage memory, and utilizes the characteristic that data cached by the localstorage memory has no expiration time and is sent to the server along with an interactive request triggered by a browser so as to rapidly improve the static resource data loading efficiency in next target webpage data, and ensures the integrity of static resource data in the loaded target webpage data by using the target hash code.
In an embodiment, as shown in fig. 6, after step S503, that is, after the target content character string and the target hash code corresponding to the target URL address are sent to the client through the WebSocket communication link, the method for loading web page data further includes:
s601: and acquiring an update access request sent by a client through a WebSocket communication link, wherein the update access request comprises a target URL address and a local hash code.
The server can receive an update access request sent by the client through the WebSocket communication link, wherein the update access request comprises a target URL address and a local hash code, so that the server can be inquired through the target URL address and the local hash code, and whether static resource data in target webpage data corresponding to the target URL address are updated or not is verified.
S602: and querying a background database according to the target URL address to acquire a historical hash code corresponding to the target URL address.
The historical hash code refers to a hash code which is stored in a background database and corresponds to the target URL address before the current time of the system.
In this embodiment, the server queries the background database according to the target URL address in the received update access request to obtain the historical hash code corresponding to the target URL address, so as to verify the local hash code by using the historical hash code, thereby determining whether the local content character strings cached in the localstorage memory are updated, because each content character string corresponds to only one hash code, and the corresponding content character strings cannot be derived through the hash code, and there is no possibility that two content character strings with different contents correspond to the same hash code, so that it is determined whether the content update exists by comparing whether the local hash code cached in the localstorage memory and the historical hash code stored in the background database are consistent.
S603: and if the local hash code is inconsistent with the historical hash code, content updating exists, the historical hash code is determined as an updating hash code, a historical content character string corresponding to the historical hash code is determined as an updating content character string, updating result data is formed based on the updating hash code and the updating content character string, and the updating result data is sent to the client through a WebSocket communication link.
Because each content character string only corresponds to one hash code, the corresponding content character string cannot be deduced through the hash code, and the possibility that two content character strings with different contents correspond to the same hash code does not exist, when the local hash code cached in the localstorage memory is inconsistent with the historical hash code stored in the background database, the local content character string cached in the localstorage memory is determined to be different from the historical content character string stored in the background database, and the content is updated. After the server determines that the content updating exists, the historical hash code is determined as the updating hash code, the historical content character string corresponding to the historical hash code is determined as the updating content character string, and updating result data are formed on the basis of the updating hash code and the updating content character string. And then, sending the update result data to the client through a WebSocket communication link so that the client loads the update static resource data corresponding to the update content character string based on the update content character string, rendering and displaying the update static resource data on the current display page, and storing the target URL address, the update content character string and the update hash code in a localstorage memory in an associated manner, thereby completing update display of the static resource data, ensuring the accuracy of static resource data display, and updating the information cached in the localstorage memory, which is beneficial to improving the accuracy and integrity of the static resource data loaded by next webpage access request received.
In the webpage data loading method provided by this embodiment, a characteristic that a content string uniquely corresponds to one hash code is used to determine whether a local hash code cached in a localstorage memory is consistent with a historical hash code stored in a background database, and when the two hash codes are inconsistent, it is determined that content update exists to obtain update result data including an updated content string and an updated hash code, and the update result data is sent to a client through a WebSocket communication link, so that the update result data is used to complete update display of static resource data, accuracy of static resource data display is guaranteed, and information cached in the localstorage memory is updated, which is beneficial to improving accuracy and integrity of static resource data loaded by next received webpage access request. The server can receive the update access request sent by the client in real time, update result data fed back in real time based on the update access request, and update the static resource data displayed on the current display page and the data cached in the localstorage memory based on the update result data, so that the real-time performance of the data is ensured, and the page performance is improved, thereby enhancing the user viscosity.
In an embodiment, as shown in fig. 7, before step S501, that is, before acquiring a content access request sent by a client through a WebSocket communication link, the web page data loading method further includes:
s701: and acquiring webpage configuration information sent by the client, wherein the webpage configuration information comprises a configuration URL address, a configuration content character string and a configuration hash code.
The webpage configuration information is information which is sent to the server by the client and used for reflecting the correspondence of the configuration webpage. The configuration URL address is the URL address of the web page for which configuration is desired. The configuration content character string is a content character string formed by converting the configuration static resource data. And configuring the static resource data into the static resource data of the configuration webpage corresponding to the configuration URL address. The configuration hash code is formed by processing the configuration content character string by using an MD5 algorithm, and information verification can be performed by using the configuration hash code to ensure the integrity of the configuration content character string.
S702: and inquiring a background database based on the configuration URL address, and judging whether historical configuration information corresponding to the URL address exists or not, wherein the historical configuration information comprises a historical URL address, a historical content character string and a historical hash code.
The historical configuration information is webpage configuration information of an existing webpage which is stored in a background server in advance. The historical URL address is the URL address of the existing webpage. The historical content character string is formed by converting static resource data of the existing webpage. The history hash code is formed by processing the history content character string by using an MD5 algorithm.
In the embodiment, the server queries the background database according to the configuration URL address to judge whether the configuration URL address is consistent with the historical URL address in the background database, and if the configuration URL address is consistent with any historical URL address, the server determines that historical configuration information corresponding to the URL address exists; if the configuration URL address is not consistent with all historical URL addresses, determining that no historical configuration information corresponding to the URL address exists.
S703: and if the historical configuration information corresponding to the URL address exists, judging whether the configuration hash code is consistent with the historical hash code.
In this embodiment, if there is history configuration information corresponding to the URL address, that is, if the configured URL address is consistent with any history URL address, it is necessary to determine whether the history hash code and the configuration hash code in the history configuration information corresponding to the URL address are consistent to determine whether there is a content change in the history content character string and the configuration content character string. Namely, if the historical hash code is consistent with the configuration hash code, the historical content character string and the configuration content character string have no content change; and if the historical hash code is not consistent with the configuration hash code, the content of the historical content character string and the configuration content character string is changed.
S704: and if the configuration hash code is inconsistent with the historical hash code, updating the historical configuration information by adopting the configuration content character string and the configuration hash code.
In this embodiment, if the configured hash code is not consistent with the historical hash code, that is, the historical content character string and the configured content character string have content change, at this time, the configured content character string and the configured hash code are used to update the historical configuration information, that is, the historical content character string is updated to the configured content character string, and the historical hash code is updated to the configured hash code, so that the historical configuration information in the background database is updated in real time, and the timeliness of updating the webpage data is ensured.
In the webpage data loading method provided by this embodiment, historical configuration information of a background database needs to be queried according to webpage configuration information of a configured webpage, and when a configured URL address is consistent with a historical URL address and a configured hash code is inconsistent with the historical hash code, the historical configuration information is updated by using a configuration content character string and the configured hash code, so that the historical configuration information in the background database is updated in real time, and the timeliness of updating webpage data is ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a web page data loading device is provided, and the web page data loading device corresponds to the web page data loading method in the above embodiments one to one. As shown in fig. 8, the web page data loading apparatus includes a web page access request obtaining module 801, a local character string determining module 802, a local data loading module 803, a content access processing module 804, and a target data loading module 805. The functional modules are explained in detail as follows:
a web page access request obtaining module 801, configured to obtain a web page access request, where the web page access request includes a target URL address.
The local string determining module 802 is configured to query the localstorage memory based on the target URL address, and determine whether the localstorage memory stores a local content string corresponding to the target URL address.
The local data loading module 803 is configured to, if the localstorage memory stores the local content character string, load local static resource data corresponding to the local content character string based on the local content character string, and render and display the local static resource data on the current display page.
And the content access processing module 804 is configured to create a WebSocket communication link with the server if the localstorage memory does not store the local content character string, send a content access request corresponding to the target URL address to the server, and acquire the target content character string and the target hash code, which are returned by the server and correspond to the target URL address.
The target data loading module 805 is configured to load target static resource data corresponding to the target content character string based on the target content character string, render and display the target static resource data on the current display page, and store the target URL address, the target content character string, and the target hash code in the localstorage memory in an associated manner.
Preferably, the web page data loading device further includes:
and the updating access request generating module is used for generating an updating access request, and the updating access request comprises a target URL address and a local hash code.
And the update result data acquisition module is used for sending an update access request to the server through a pre-established WebSocket communication link and acquiring update result data triggered by the server when content update exists, wherein the update result data comprises an update content character string corresponding to the target URL address and an update hash code.
And the update data loading module is used for loading the update static resource data corresponding to the update content character string based on the update content character string, rendering and displaying the update static resource data on the current display page, and storing the target URL address, the update content character string and the update hash code in a localstorage memory in an associated manner.
Preferably, the web page data loading device further includes:
and the webpage configuration request acquisition module is used for acquiring a webpage configuration request, and the webpage configuration request comprises a configuration URL address and configuration static resource data.
And the configuration character string acquisition module is used for converting the configuration static resource data and acquiring a configuration content character string corresponding to the configuration static resource data.
And the configuration hash code acquisition module is used for processing the configuration content character string by adopting an MD5 algorithm to acquire the configuration hash code.
And the webpage configuration information sending module is used for forming webpage configuration information based on the configuration URL address, the configuration content character string and the configuration hash code and sending the webpage configuration information to the server.
In an embodiment, a web page data loading device is provided, and the web page data loading device corresponds to the web page data loading method in the above embodiments one to one. As shown in fig. 9, the web page data loading apparatus includes a content access request obtaining module 901, a target information query module 902, and a target information sending module 903. The functional modules are explained in detail as follows:
a content access request obtaining module 901, configured to obtain a content access request sent by a client through a WebSocket communication link, where the content access request includes a target URL address.
And the target information query module 902 is configured to query the background database according to the target URL address, and obtain a target content character string and a target hash code corresponding to the target URL address.
And the target information sending module 903 is configured to send the target content character string and the target hash code corresponding to the target URL address to the client through the WebSocket communication link, so that the client loads the target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on the current display page, and stores the target URL address, the target content character string, and the target hash code in the localstorage memory in an associated manner.
Preferably, the web page data loading device further includes:
and the update access request acquisition module is used for acquiring an update access request sent by the client through the WebSocket communication link, wherein the update access request comprises a target URL address and a local hash code.
And the historical hash code acquisition module is used for inquiring the background database according to the target URL address and acquiring the historical hash code corresponding to the target URL address.
And the content updating processing module is used for determining the historical hash code as the updating hash code if the local hash code is inconsistent with the historical hash code, determining the historical content character string corresponding to the historical hash code as the updating content character string, forming updating result data based on the updating hash code and the updating content character string, and sending the updating result data to the client through a WebSocket communication link.
Preferably, the web page data loading device further includes:
the webpage configuration information acquisition module is used for acquiring webpage configuration information sent by the client, and the webpage configuration information comprises a configuration URL address, a configuration content character string and a configuration hash code.
And the historical configuration information query module is used for querying the background database based on the configured URL address and judging whether historical configuration information corresponding to the URL address exists or not, wherein the historical configuration information comprises a historical URL address, a historical content character string and a historical hash code.
And the Hash code judging module is used for judging whether the configured Hash code is consistent with the historical Hash code if the historical configuration information corresponding to the URL address exists.
And the historical configuration information updating module is used for updating the historical configuration information by adopting the configuration content character string and the configuration hash code if the configuration hash code is inconsistent with the historical hash code.
For specific limitations of the web page data loading device, reference may be made to the above limitations on the web page data loading method, which is not described herein again. The modules in the web page data loading device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for executing data adopted or generated in the webpage data loading process. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of loading web page data.
In an embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the method for loading web page data in the foregoing embodiment is implemented, for example, S201 to S205 shown in fig. 2, or shown in fig. 3 to fig. 7, which is not described herein again to avoid repetition. Alternatively, the processor implements the functions of each module/unit in the embodiment of the web page data loading apparatus when executing the computer program, for example, the functions of each module of the web page data loading apparatus shown in fig. 8 or fig. 9, and are not described herein again to avoid repetition.
In an embodiment, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for loading web page data in the foregoing embodiment is implemented, for example, S201 to S205 shown in fig. 2, or shown in fig. 3 to fig. 7, which is not described herein again to avoid repetition. Alternatively, when being executed by the processor, the computer program implements functions of each module/unit in the embodiment of the web page data loading apparatus, for example, functions of each module of the web page data loading apparatus shown in fig. 8 or fig. 9, and in order to avoid repetition, details are not described here again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A webpage data loading method is characterized by comprising the following steps executed by a client:
acquiring a webpage access request, wherein the webpage access request comprises a target URL address;
querying a localstorage memory based on the target URL address, and judging whether the localstorage memory stores a local content character string corresponding to the target URL address;
if the localstorage memory stores the local content character string, loading local static resource data corresponding to the local content character string based on the local content character string, and rendering and displaying the local static resource data on a current display page;
if the localstorage memory does not store the local content character string, establishing a WebSocket communication link with a server, sending a content access request corresponding to the target URL address to the server, and acquiring a target content character string and a target hash code which are returned by the server and correspond to the target URL address;
and loading target static resource data corresponding to the target content character string based on the target content character string, rendering and displaying the target static resource data on a current display page, and storing the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
2. The web page data loading method according to claim 1, wherein after loading, if the localstorage memory stores the local content string, local static resource data corresponding to the local content string based on the local content string, and rendering and displaying the local static resource data on a current display page, the web page data loading method further comprises:
generating an updating access request, wherein the updating access request comprises a target URL address and a local hash code;
sending an updating access request to a server through a pre-established WebSocket communication link, and acquiring updating result data triggered by the server when content updating exists, wherein the updating result data comprises an updating content character string corresponding to the target URL address and an updating hash code;
loading updated static resource data corresponding to the updated content character string based on the updated content character string, rendering and displaying the updated static resource data on a current display page, and storing the target URL address, the updated content character string and the updated hash code in the localstorage memory in an associated manner.
3. The web page data loading method according to claim 1, wherein before the acquiring the web page access request, the web page data loading method further comprises:
acquiring a webpage configuration request, wherein the webpage configuration request comprises a configuration URL address and configuration static resource data;
converting the configured static resource data to obtain a configured content character string corresponding to the configured static resource data;
processing the configuration content character string by adopting an MD5 algorithm to obtain a configuration hash code;
and forming webpage configuration information based on the configuration URL address, the configuration content character string and the configuration hash code, and sending the webpage configuration information to the server.
4. A webpage data loading method is characterized by comprising the following steps executed by a server:
acquiring a content access request sent by a client through a WebSocket communication link, wherein the content access request comprises a target URL (uniform resource locator) address;
inquiring a background database according to the target URL address to acquire a target content character string and a target hash code corresponding to the target URL address;
and sending a target content character string and a target hash code corresponding to the target URL address to the client through a WebSocket communication link, so that the client loads target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on a current display page, and stores the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
5. The web page data loading method according to claim 4, wherein after the target content character string and the target hash code corresponding to the target URL address are transmitted to the client via a WebSocket communication link, the web page data loading method further comprises:
acquiring an update access request sent by a client through a WebSocket communication link, wherein the update access request comprises a target URL (uniform resource locator) address and a local hash code;
inquiring a background database according to the target URL address to acquire a historical hash code corresponding to the target URL address;
if the local hash code is inconsistent with the historical hash code, content updating exists, the historical hash code is determined as an updating hash code, a historical content character string corresponding to the historical hash code is determined as an updating content character string, updating result data is formed based on the updating hash code and the updating content character string, and the updating result data is sent to the client through the WebSocket communication link.
6. The web page data loading method of claim 4, wherein before the obtaining of the content access request sent by the client over the WebSocket communication link, the web page data loading method further comprises:
acquiring webpage configuration information sent by a client, wherein the webpage configuration information comprises a configuration URL address, a configuration content character string and a configuration hash code;
querying a background database based on the configuration URL address, and judging whether historical configuration information corresponding to the URL address exists or not, wherein the historical configuration information comprises a historical URL address, a historical content character string and a historical hash code;
if the historical configuration information corresponding to the URL address exists, judging whether the configuration hash code is consistent with the historical hash code;
and if the configuration hash code is not consistent with the historical hash code, updating the historical configuration information by adopting the configuration content character string and the configuration hash code.
7. A web page data loading apparatus, comprising:
the webpage access request acquisition module is used for acquiring a webpage access request, and the webpage access request comprises a target URL address;
the local character string judging module is used for inquiring a localstorage memory based on the target URL address and judging whether the localstorage memory stores a local content character string corresponding to the target URL address;
a local data loading module, configured to load, if the localstorage memory stores the local content character string, local static resource data corresponding to the local content character string based on the local content character string, and render and display the local static resource data on a current display page;
the content access processing module is used for establishing a WebSocket communication link with a server if the localstorage memory does not store the local content character string, sending a content access request corresponding to the target URL address to the server, and acquiring the target content character string and the target hash code which are returned by the server and correspond to the target URL address;
and the target data loading module is used for loading target static resource data corresponding to the target content character string based on the target content character string, rendering and displaying the target static resource data on a current display page, and storing the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
8. A web page data loading apparatus, comprising:
the content access request acquisition module is used for acquiring a content access request sent by a client through a WebSocket communication link, and the content access request comprises a target URL address;
the target information query module is used for querying a background database according to the target URL address and acquiring a target content character string and a target hash code corresponding to the target URL address;
and the target information sending module is used for sending a target content character string and a target hash code corresponding to the target URL address to the client through a WebSocket communication link, so that the client loads target static resource data corresponding to the target content character string based on the target content character string, renders and displays the target static resource data on a current display page, and stores the target URL address, the target content character string and the target hash code in the localstorage memory in an associated manner.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the web page data loading method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the web page data loading method according to any one of claims 1 to 6.
CN202010916505.8A 2020-09-03 2020-09-03 Webpage data loading method and device, computer equipment and storage medium Active CN112073405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010916505.8A CN112073405B (en) 2020-09-03 2020-09-03 Webpage data loading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010916505.8A CN112073405B (en) 2020-09-03 2020-09-03 Webpage data loading method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112073405A true CN112073405A (en) 2020-12-11
CN112073405B CN112073405B (en) 2024-02-06

Family

ID=73666360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010916505.8A Active CN112073405B (en) 2020-09-03 2020-09-03 Webpage data loading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112073405B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559927A (en) * 2020-12-23 2021-03-26 上海哔哩哔哩科技有限公司 Webpage loading method and device
CN112685671A (en) * 2021-01-21 2021-04-20 百度在线网络技术(北京)有限公司 Page display method, device, equipment and storage medium
CN112839247A (en) * 2021-01-04 2021-05-25 聚好看科技股份有限公司 Content display method, display device and cloud server
CN113051448A (en) * 2021-03-17 2021-06-29 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN113220396A (en) * 2021-05-11 2021-08-06 北京达佳互联信息技术有限公司 Embedded page management method and device, electronic equipment and storage medium
CN113312577A (en) * 2021-06-01 2021-08-27 平安证券股份有限公司 Webpage resource processing method and device, electronic equipment and storage medium
CN113392349A (en) * 2021-06-11 2021-09-14 北京沃东天骏信息技术有限公司 Page loading method, device, equipment and computer readable storage medium
CN113420237A (en) * 2021-05-21 2021-09-21 北京沃东天骏信息技术有限公司 Information processing method and device and storage medium
CN113568752A (en) * 2021-07-29 2021-10-29 上海浦东发展银行股份有限公司 Static resource loading method, device, equipment and storage medium
CN113626127A (en) * 2021-08-20 2021-11-09 广州酷狗计算机科技有限公司 Content item display method, device, terminal and storage medium
CN113704654A (en) * 2021-07-30 2021-11-26 北京达佳互联信息技术有限公司 Page display method and device, electronic equipment and storage medium
CN114205678A (en) * 2021-11-16 2022-03-18 湖南新云网科技有限公司 Video access method, access device, terminal and computer readable storage medium
CN114422491A (en) * 2021-12-20 2022-04-29 福州佳软软件技术有限公司 Method and terminal for improving page acquisition efficiency
CN114884917A (en) * 2022-04-26 2022-08-09 北京华信傲天网络技术有限公司 Control system and method for address resolution protocol message
WO2023272858A1 (en) * 2021-06-28 2023-01-05 未鲲(上海)科技服务有限公司 Page resource caching method and apparatus, device, and medium
CN117574015A (en) * 2023-12-05 2024-02-20 北京中宏立达科技发展有限公司 Webpage updating method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329910A (en) * 2017-06-27 2017-11-07 中南大学 A kind of web front end data based on localStorage are locally stored and access method
CN108228282A (en) * 2018-04-04 2018-06-29 北京三快在线科技有限公司 For the method and device of Website page loading
CN110263275A (en) * 2019-06-14 2019-09-20 深圳前海桔子信息技术有限公司 A kind of method, apparatus, mobile terminal and storage medium accessing webpage
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN110674444A (en) * 2019-09-20 2020-01-10 青岛海信移动通信技术股份有限公司 Method and terminal for downloading dynamic webpage
CN110866198A (en) * 2019-09-27 2020-03-06 上海硬通网络科技有限公司 Static resource caching method, system, device, computer equipment and storage medium
CN110990736A (en) * 2019-12-05 2020-04-10 秒针信息技术有限公司 Page loading method and device, terminal equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329910A (en) * 2017-06-27 2017-11-07 中南大学 A kind of web front end data based on localStorage are locally stored and access method
CN108228282A (en) * 2018-04-04 2018-06-29 北京三快在线科技有限公司 For the method and device of Website page loading
CN110263275A (en) * 2019-06-14 2019-09-20 深圳前海桔子信息技术有限公司 A kind of method, apparatus, mobile terminal and storage medium accessing webpage
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN110674444A (en) * 2019-09-20 2020-01-10 青岛海信移动通信技术股份有限公司 Method and terminal for downloading dynamic webpage
CN110866198A (en) * 2019-09-27 2020-03-06 上海硬通网络科技有限公司 Static resource caching method, system, device, computer equipment and storage medium
CN110990736A (en) * 2019-12-05 2020-04-10 秒针信息技术有限公司 Page loading method and device, terminal equipment and storage medium

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559927A (en) * 2020-12-23 2021-03-26 上海哔哩哔哩科技有限公司 Webpage loading method and device
CN112839247A (en) * 2021-01-04 2021-05-25 聚好看科技股份有限公司 Content display method, display device and cloud server
CN112685671A (en) * 2021-01-21 2021-04-20 百度在线网络技术(北京)有限公司 Page display method, device, equipment and storage medium
CN113051448A (en) * 2021-03-17 2021-06-29 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN113220396A (en) * 2021-05-11 2021-08-06 北京达佳互联信息技术有限公司 Embedded page management method and device, electronic equipment and storage medium
CN113220396B (en) * 2021-05-11 2024-04-16 北京达佳互联信息技术有限公司 Embedded page management method and device, electronic equipment and storage medium
CN113420237A (en) * 2021-05-21 2021-09-21 北京沃东天骏信息技术有限公司 Information processing method and device and storage medium
CN113312577A (en) * 2021-06-01 2021-08-27 平安证券股份有限公司 Webpage resource processing method and device, electronic equipment and storage medium
CN113312577B (en) * 2021-06-01 2024-06-25 平安证券股份有限公司 Webpage resource processing method and device, electronic equipment and storage medium
CN113392349A (en) * 2021-06-11 2021-09-14 北京沃东天骏信息技术有限公司 Page loading method, device, equipment and computer readable storage medium
WO2023272858A1 (en) * 2021-06-28 2023-01-05 未鲲(上海)科技服务有限公司 Page resource caching method and apparatus, device, and medium
CN113568752A (en) * 2021-07-29 2021-10-29 上海浦东发展银行股份有限公司 Static resource loading method, device, equipment and storage medium
CN113704654A (en) * 2021-07-30 2021-11-26 北京达佳互联信息技术有限公司 Page display method and device, electronic equipment and storage medium
CN113626127A (en) * 2021-08-20 2021-11-09 广州酷狗计算机科技有限公司 Content item display method, device, terminal and storage medium
CN113626127B (en) * 2021-08-20 2024-09-13 广州酷狗计算机科技有限公司 Content item display method, device, terminal and storage medium
CN114205678A (en) * 2021-11-16 2022-03-18 湖南新云网科技有限公司 Video access method, access device, terminal and computer readable storage medium
CN114422491A (en) * 2021-12-20 2022-04-29 福州佳软软件技术有限公司 Method and terminal for improving page acquisition efficiency
CN114422491B (en) * 2021-12-20 2024-01-30 福州佳软软件技术有限公司 Method and terminal for improving page acquisition efficiency
CN114884917A (en) * 2022-04-26 2022-08-09 北京华信傲天网络技术有限公司 Control system and method for address resolution protocol message
CN114884917B (en) * 2022-04-26 2023-07-28 北京华信傲天网络技术有限公司 Control system and method for address resolution protocol message
CN117574015A (en) * 2023-12-05 2024-02-20 北京中宏立达科技发展有限公司 Webpage updating method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112073405B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN112073405B (en) Webpage data loading method and device, computer equipment and storage medium
US10412176B2 (en) Website access method, apparatus, and website system
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
WO2022242023A1 (en) Resource acquisition method and system, webvpn proxy server and server
CN107181779B (en) Method, device and system for processing access request
CN102882974A (en) Method for saving website access resource by website identification version number
CN105743945A (en) Method and system for downloading files on the basis of switching download sources
CN102567339A (en) Method, device and system for acquiring start page
CN112685669A (en) Page rendering method and system
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN110674435A (en) Page access method, server, terminal, electronic equipment and readable storage medium
CN110768974B (en) Control method for single-page application real-time view authority
CN112926002A (en) Service request processing method and device
US20160117392A1 (en) Information search method and apparatus
CN112149017A (en) Webpage access method, device and system, electronic equipment and storage medium
CN111552643A (en) Multi-browser webpage access synchronization method and system
CN103561068A (en) Method and device for improving speed of web page browsing
CN115640471A (en) Short link generation method and device, computer equipment and storage medium
CN113254753B (en) Page rollback method, device, electronic equipment and storage medium
CN115563412A (en) Access method, proxy server, electronic device, and storage medium
CN103701844A (en) User information management method and system
CN102937982A (en) Method and system for creating collection contents
CN104869182A (en) Domain name resolution method and device
CN112015406A (en) Data processing method, page access method, device, terminal and server
CN110196724A (en) File loading method, terminal, server, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant