Page loading method and device, electronic equipment and storage medium

文档序号:1963873 发布日期:2021-12-14 浏览:19次 中文

阅读说明:本技术 页面加载方法、装置、电子设备及存储介质 (Page loading method and device, electronic equipment and storage medium ) 是由 郭鹏杰 于 2021-10-18 设计创作,主要内容包括:本发明实施例涉及一种页面加载方法、装置、电子设备及存储介质,其中所述方法包括以下步骤:发起目标页面资源加载请求;触发向目标云端查询所述目标页面嵌有的预设待检内容的变更信息;接收所述查询的返回结果,并根据所述返回结果,从本地拉取所述待检内容对应的预设元素。相比现有技术,本发明实施例通过极大减少对代理服务器的通信数据量,实现诸如网络环境不理想时,同样能够确保web页面获得接近原生页面呈现的流畅度,具有高效、低成本及提高用户粘性的有益处。(The embodiment of the invention relates to a page loading method, a page loading device, electronic equipment and a storage medium, wherein the method comprises the following steps: initiating a target page resource loading request; triggering to inquire change information of preset to-be-detected content embedded in the target page from a target cloud; and receiving a return result of the query, and locally pulling a preset element corresponding to the content to be detected according to the return result. Compared with the prior art, the embodiment of the invention greatly reduces the communication data volume of the proxy server, can also ensure that the web page obtains fluency close to the presentation of the original page when the network environment is not ideal, and has the advantages of high efficiency, low cost and improvement of user stickiness.)

1. A page loading method is characterized by comprising the following steps:

initiating a target page resource loading request;

triggering to inquire change information of preset to-be-detected content embedded in the target page from a target cloud;

and receiving a return result of the query, and locally pulling a preset element corresponding to the content to be detected according to the return result.

2. The page loading method according to claim 1, wherein before said initiating a target page resource loading request, further comprising:

adding the target page into an expected high-frequency use page by a user through an application terminal; or when the use frequency of the target page is detected to reach a preset frequency threshold value;

and in response, downloading the target page resource from a preset server and storing the target page resource to the local.

3. The page loading method according to claim 2, wherein the downloading and saving the target page resource from a preset server to the local as a local page resource further comprises:

the target page resource comprises the preset element; the preset elements comprise two or more than two presentation information corresponding to the content to be detected, and the presentation information at least comprises style information.

4. The page loading method according to claim 1, wherein the content to be checked embedded in the target page at least includes personalized information associated with the application terminal and/or the user, and further comprising:

the personalized information comprises the identity information, the identity verification information and/or the state information of the user;

the state information is contained in a preset information base of the cloud end, and can be modified or related to the state information corresponding to other users according to a preset mechanism, so that the change is generated.

5. The page loading method according to claim 1, wherein said querying change information of the preset content to be checked embedded in the target page further comprises:

the query information is carried in the loading request information; and

and the server receives the query information, accesses the information base and returns a return result, wherein the return result comprises the change information, and the change at least comprises update and abnormity.

6. The page loading method according to claim 5, wherein after returning the returned result, further comprising:

if the return result contains a return value refresh, representing that interface change exists in the target page, triggering the target page to be loaded from the preset server, and further updating the locally stored target page resource; and

and if the speed of loading the target page from the preset server is lower than a preset speed threshold value, suspending the loading from the preset server, and loading the target page resource from the local according to the return value except the return value refresh contained in the return result.

7. The page loading method according to claim 1, wherein after said initiating a target page resource loading request, further comprising:

triggering the local preloading of the target page resources except the content to be checked;

alternatively, the first and second electrodes may be,

triggering the local preloading of the target page resource, and pulling a preset element from the local corresponding to the return result if the change exists in the content to be detected according to the return result; and if the change does not exist in the content to be detected, finishing loading the target page resource.

8. A page loading apparatus, comprising:

the page resource module is used for determining a target page, downloading and storing the target page resource from a preset server to the local through triggering, wherein the target page resource comprises preset elements, the preset elements comprise two or more than two and comprise presentation information corresponding to the content to be detected in front of the target page, and the presentation information at least comprises style information;

a loading request module, configured to initiate the target page resource loading request to the server through an application terminal, where the loading request carries query information;

the query return module is used for triggering a preset information base contained in a query target cloud before the loading request responds, and returning a corresponding return result according to a preset query strategy contained in the information base;

the information retrieval module is arranged to comprise the information base and the preset query strategy;

and the loading display module is used for analyzing the returned result and executing local pulling of the corresponding preset element according to the analyzed result so that the content to be detected is presented as a corresponding display state and/or display content.

9. An electronic device comprising a memory, a processor;

the memory is used for storing program codes and transmitting the program codes to the processor;

the processor is used for executing the page loading method of any one of claims 1-7 according to instructions in the program code;

the electronic equipment further comprises a scanning device and a communication device.

10. A computer-readable storage medium for storing program code for performing the page loading method of any one of claims 1-7.

Technical Field

The present invention relates to the field of internet technologies, and in particular, to a page loading method and apparatus, an electronic device, and a storage medium.

Background

Currently, when a user accesses a page, a mobile terminal generally loads the whole page resources of the page. In order to increase the page loading speed, in the prior art, a page is cached and loaded from a mobile terminal to respond to a page access request, and meanwhile, the code difference between the locally stored page resource and the corresponding page resource stored by the proxy server is compared, so that the locally stored page resource is downloaded and updated by the server side according to the code difference.

However, when the network environment is poor, the user traffic is over-limited and the speed is forced to be reduced, or the memory of the mobile terminal is too tight to load the relevant program and the running is slow, the speed of the network resource downlink and the communication with the server are generally not ideal. And for a specific high-frequency use page such as a health code presentation page, the proxy server is exposed to a high load or even a downtime risk in the peak period of work, so that the response time of the server is increased, the page access speed is reduced, and the experience is poor.

Therefore, the method and the device can reduce the occupation duration of the proxy server, optimize the response speed and the downtime occurrence rate in the period of accessing high load, adapt to the scenes of non-ideal network environment and the like, and improve the fluency of page presentation, and are the problems to be solved.

Disclosure of Invention

Therefore, it is necessary to provide a page loading method, an apparatus, an electronic device, and a storage medium, which greatly reduce the amount of communication data to a proxy server, significantly reduce the duration occupied by the proxy server, further avoid the problem of poor network environment, ensure that a web page obtains fluency close to the presentation of a native page, reduce the peak load and downtime of a server, and improve the user stickiness, in view of the above technical problems.

In a first aspect, an embodiment of the present invention provides a page loading method, where the method includes the following steps:

initiating a target page resource loading request;

triggering to inquire change information of preset to-be-detected content embedded in the target page from a target cloud;

and receiving a return result of the query, and locally pulling a preset element corresponding to the content to be detected according to the return result.

In a second aspect, an embodiment of the present invention provides a page loading apparatus, including:

the page resource module is used for determining a target page, downloading and storing the target page resource from a preset server to the local through triggering, wherein the target page resource comprises preset elements, the preset elements comprise two or more than two and comprise presentation information corresponding to the content to be detected in front of the target page, and the presentation information at least comprises style information;

a loading request module, configured to initiate the target page resource loading request to the server through an application terminal, where the loading request carries query information;

the query return module is used for triggering the information base contained in the query target cloud before the loading request responds, and returning a corresponding return result according to a preset query strategy contained in the information base;

the information retrieval module is arranged to comprise the information base and the preset query strategy;

and the loading display module is used for analyzing the returned result and executing local pulling of the corresponding preset element according to the analyzed result so that the content to be detected is presented as a corresponding display state and/or display content.

In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes a memory, a processor:

the memory is used for storing program codes and transmitting the program codes to the processor;

the processor is used for executing the page loading method of the first aspect of the invention according to instructions in the program code;

the electronic equipment further comprises a scanning device and a communication device.

In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium is used to store a program code, and the program code is used to execute the page loading method according to the first aspect of the present invention.

Has the advantages that:

compared with the prior art, the embodiment of the invention provides the page and the composition of the page resource, the duration occupied by the proxy server is obviously reduced by greatly reducing the communication data volume of the proxy server, the bandwidth is saved, the load and downtime occurrence rate of the proxy server can be greatly reduced particularly when the page access volume is increased, and the web page can be ensured to obtain the smoothness close to the presentation of the original page when the network environment is not ideal, so that the invention has the advantages of high efficiency, low cost and improvement of user stickiness.

Drawings

Fig. 1 is a schematic flowchart of a page loading method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present 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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without any inventive step, are within the scope of the present invention.

As shown in fig. 1, the page loading method provided in the embodiment of the present invention may include the following steps S11 to S13:

step S11, initiating a target page resource loading request;

step S12, triggering to inquire change information of preset to-be-detected content embedded in the target page from a target cloud;

and S13, receiving a return result of the query, and locally pulling a preset element corresponding to the content to be detected according to the return result.

Specifically, a user initiates a target page resource loading request through an application terminal, and a corresponding implementation way may be that a specific identification code is scanned and identified through the application terminal, or a client in the application terminal logs in the target page; the method can also be based on web address link or jump of target page triggered by search item, or jump of target page triggered by a certain control in a page. The application terminal comprises a mobile phone terminal, intelligent wearable equipment and the like. Optionally, when the application terminal is identified as the smart wearable device, the target page may only present the preset content to be checked when the target page is loaded in the execution of steps S11 to S13.

In one embodiment, the page loading method is applied to a client, and a user can initiate a target page resource loading request to the local or target cloud through an application terminal; and in response, triggering to inquire the target cloud end about the change information of the preset to-be-detected content embedded in the target page. The target cloud includes, but is not limited to, a server, a proxy server, a web page resource management server, or an accessible location.

Further, before initiating the target page resource loading request in step S11, the method further includes the following sub-steps:

s111, adding the target page into an expected high-frequency use page by a user through an application terminal; or when the use frequency of the target page is detected to reach a preset frequency threshold value;

and step S112, as a response, downloading the target page resource from a preset server and storing the target page resource to the local.

Specifically, the target page can be managed to take effect and be cleaned through a preset white list.

Optionally, when a preset time threshold is exceeded and the load request of the target page is not obtained, the locally stored target page resources are cleared.

In one embodiment, if the user adds the target page as an expected high-frequency usage page, a background can be triggered to execute downloading and saving the target page resource from the server to the local; or when the target page is loaded by the server for the first time, obtaining a cache and storing the cache to the local time effectively.

Further, the downloading and saving the target page resource from the preset server to the local in step S112 as a local page resource further includes:

the target page resource comprises the preset element; the preset elements comprise two or more than two presentation information corresponding to the content to be detected, and the presentation information at least comprises style information.

Specifically, the presentation information is used to present the content to be examined in different display states and/or display contents. Further, preset elements comprise two or more, and when the preset elements corresponding to the content to be detected are locally pulled according to the return result, the preset elements can be pulled one at a time and correspond to one display state, or the preset elements can be pulled a plurality of at a time and correspond to one display state. The method has the advantages of providing the page and the composition of the page resource, and a local cache mode, a page rendering mode and/or a preset element configuration mode when the page is loaded. And the optimization of a specific high-frequency use page such as a health code presentation webpage and the loading mode thereof is realized.

Illustratively, the preset content to be checked may be a display sub-area corresponding to the page layout of the target page, or a first sub-content embedded in the sub-area. The first sub-content may include personal information corresponding to a user who logs in the target page, so that different application terminals load different first sub-contents corresponding to the target page. The sub-area may further include a second sub-content other than the first sub-content, for example, a second sub-content other than the first sub-content and used for presenting the style information, and the second sub-content corresponding to different users logging in and loading the target page may be different or the same; and for the same user to log in and load the second sub-content corresponding to the target page, the second sub-content corresponding to different periods can be the same or different.

For example, the target page is a health code presentation page, has a page layout within a certain period and relative stability of display contents thereof, but has different display contents corresponding to different users logging in the target page after logging in the client, and mainly represents state information associated with personal information corresponding to a sub-region of the target page, and the presentation contents corresponding to the state information have a difference and serve as the content to be detected; and, the same user may also have different presented contents corresponding to the sub-area at different time periods, for example, the health code of the same user is changed from green to yellow or red to indicate or represent the user health risk status difference. Generally, the health code presenting webpage is required to be presented when a user enters a specific place such as a subway or a public indoor space, wherein the network environment in the subway or the public indoor space is relatively poor, or the flow of the user is over-limit and the speed is reduced, and when the user queues a gate or performs security inspection, corresponding proofs need to be presented smoothly, quickly or with low delay, so that the method has obvious benefits.

In an embodiment, when the target page is added as an expected high-frequency usage page, or when it is detected that the usage frequency of the target page reaches a preset frequency threshold, the target page resource is triggered to be downloaded by a preset server and stored locally, and then the target page resource is used as a local page resource, which may be executed in a background, or executed synchronously when the target page is accessed and loaded. Optionally, the local page resource is stored in a local page resource library, where the local page resource library is used to manage the local page resource, and the management includes, but is not limited to, downloading, loading, aging management, updating, and cleaning corresponding to the target page resource.

It should be noted that, the target page resource corresponding to the download includes two or more preset elements, and is acquired from the server and stored locally at one time during the download execution, and only one corresponding preset element may be presented when the target page is loaded at one time, and at this time, the remaining preset elements may be in an idle state or an unloaded state.

Further, the content to be checked embedded in the target page in step S12 at least includes personalized information associated with the application terminal and/or the user, and further includes:

the personalized information comprises the identity information, the identity verification information and/or the state information of the user;

the state information is contained in a preset information base of the cloud end, and can be modified or related to the state information corresponding to other users according to a preset mechanism, so that the change is generated.

In an embodiment, the preset information base may be modified by a third party organization with public trust or related to the state information corresponding to other users according to a preset mechanism, and is synchronized with a proxy server, so as to obtain the change information.

In one embodiment, the status information is contained in a preset information base of the cloud, specifically, only one piece of status information exists in one user in the information base at one time; and two or more than two pieces of state information corresponding to the preset elements exist in the locally stored target page resource, and the state information corresponding to one of the preset elements is pulled according to the return result of the query, or the two or more than two preset elements are pulled to render the target page together.

Further, the querying, in step S12, the changing information of the preset content to be checked embedded in the target page further includes:

the query information is carried in the loading request information; and

and the server receives the query information, accesses the information base and returns a return result, wherein the return result comprises the change information, and the change at least comprises update and abnormity.

Specifically, the information corresponding to the query is carried in the information corresponding to the loading request.

Further, after the above "returning the return result", the method further includes:

if the return result contains a return value refresh, representing that interface change exists in the target page, triggering the target page to be loaded from the preset server, and further updating the locally stored target page resource; and

and if the speed of loading the target page from the preset server is lower than a preset speed threshold value, suspending the loading from the preset server, and loading the target page resource from the local according to the return value except the return value refresh contained in the return result.

Specifically, the return value refresh is included in the information base and is used for returning when the query is received. In one embodiment, if the target page has an interface change, all users included in the information base trigger the target page to be loaded from the preset server when a target page resource loading request is initiated through a mobile terminal. The return value refresh may also be a preset value, and when the target page generates the interface change by a technician, the technician then adds the interface change information to the information base. Wherein the interface change may include, but is not limited to, a page layout, an embedded element, and/or a display text change; the variation of the contents to be checked can also be included, and further the contents to be checked can be the corresponding variation of the state information.

Furthermore, particularly, even if the interface change is generated without adding the interface change information to the information base, the return value of the contents to be checked is not affected, thereby ensuring at least the normal execution of the instruction function of the contents to be checked; or, for example, obtaining a return value refresh and a return value 0, but detecting that the network environment of the application terminal is poor and the loading of the page is slow, the loading of the target page resource from the preset server may not be performed for the time being, where the return value 0 may represent that the content to be checked does not have the change, and then the preset element corresponding to the return value 0 is pulled locally for loading the target page resource stored locally.

The embodiment has the advantages that by returning the value, the extremely small communication data volume between the application terminal and the preset server is realized, so that the page presentation can be responded more quickly, and the locally stored target page resources can be updated more flexibly and at low cost. Compared with the existing method, the code difference between the local cache page and the corresponding cloud page is detected without presetting a time period or when a loading request is initiated every time. By applying the embodiment of the invention, the load of the server access peak and the downtime rate thereof are reduced, the implementation cost and the waiting time of the user are reduced, the presentation smoothness close to the original page is obtained when the target page attribute is the web page, and the user viscosity is improved.

Further, after the initiating the target page resource loading request in step S11, the method further includes:

triggering the local preloading of the target page resources except the content to be checked;

alternatively, the first and second electrodes may be,

triggering the local preloading of the target page resource, and pulling a preset element from the local corresponding to the return result if the change exists in the content to be detected according to the return result; and if the change does not exist in the content to be detected, finishing loading the target page resource.

Specifically, "according to the return result, if for wait to examine the content and exist the change, then correspond to the return result is followed locally pull wait to examine the preset element of content", wherein, if exist the change, then according to the return result, and follow locally pull wait to examine the preset element of content, correspondingly resolve into the execution replacement present in advance wait to examine the content, or, correspondingly change present in advance examine the display state of content. The preset element can be one of the existing forms of the content to be detected, and can also be a component for rendering the content to be detected to present different display states or display contents.

Illustratively, the returned result is a returned value indicating different change information. The return values include 0, 1, 2, and 3, wherein: if the target page resource is preloaded from the local place and the embedded content to be detected, for example, comprises green corresponding to the style information, the return value 0 represents that the preloading is accurate, namely, the response of the target page resource loading request is completed; analyzing the return value 1 to be changed into change information 1 corresponding to the change, for example, if the change information 1 is yellow corresponding to the style information, displaying the content to be detected as yellow from green to represent the current state information of the user; the return value 2 is analyzed to be that the change information 2 corresponding to the change exists, for example, the change information 2 is red corresponding to the style information, and the content to be detected is represented as red from green to represent the current state information of the user; and analyzing the return value 3 into the interface change of the target page, wherein the interface change can be irrelevant or relevant to the content to be detected, and triggering the target page to be loaded or downloaded from the preset server and stored. It is advantageous in that, since the query and return value has a very small traffic, for example, the contents to be examined are replaced by yellow or red from green, even if the network environment is not ideal, the query and return value will be completed at a very fast speed and will be hardly noticeable to the user.

Optionally, when a network environment is poor or an application terminal runs in insufficient memory, the content to be detected is preferentially loaded and presented.

In summary, compared with the prior art, the embodiments of the present invention provide a page and a structure of page resources thereof, and by greatly reducing the amount of communication data to a network server, only query statements and corresponding return values carried in a page loading request can be included, so that the server occupies a very small time, and the bandwidth is saved; particularly, when the page access amount is increased, the pressure and downtime occurrence rate of the proxy server can be greatly reduced; and when the network environment is not ideal, the smoothness of the web page close to the original page presentation can be ensured, and the method has the advantages of high efficiency, low cost and improvement on the user stickiness.

The present invention also provides embodiments of a page loading apparatus, an electronic device, and a storage medium, which correspond to the specific implementation manners of the page loading method provided by the embodiments of the present invention. The page loading apparatus will be described in detail from the viewpoint of functional modularization. For details that are not disclosed in the embodiments of the page loading apparatus, the electronic device and the storage medium of the present invention, please refer to the method embodiment of the present invention.

As shown in fig. 2, a page loading apparatus provided in an embodiment of the present invention includes the following modules:

the page resource module is used for determining a target page, downloading and storing the target page resource from a preset server to the local through triggering, wherein the target page resource comprises preset elements, the preset elements comprise two or more than two and comprise presentation information corresponding to the content to be detected in front of the target page, and the presentation information at least comprises style information;

a loading request module, configured to initiate the target page resource loading request to the server through an application terminal, where the loading request carries query information;

the query return module is used for triggering a preset information base contained in a query target cloud before the loading request responds, and returning a corresponding return result according to a preset query strategy contained in the information base;

the information retrieval module is arranged to comprise the information base and the preset query strategy;

and the loading display module is used for analyzing the returned result and executing local pulling of the corresponding preset element according to the analyzed result so that the content to be detected is presented as a corresponding display state and/or display content.

In one embodiment, the page resource module includes a target page management unit, the target page management unit has a white list, and a user adds the target page to an expected high-frequency usage page through an application terminal, or adds the target page to the white list in response to detecting that the usage frequency of the target page reaches a preset frequency threshold. And the target page management unit is used for dynamically managing the target page.

Illustratively, the page loading apparatus may be applied to a client installed in an electronic device, and when a user opens the target page in the client, and retrieves the target page from the white list, the page loading apparatus of the embodiment of the present application will be automatically invoked.

The embodiment of the invention also provides a page loading device, which comprises a memory and a processor; wherein the content of the first and second substances,

the memory is used for storing program codes and transmitting the program codes to the processor;

the processor is configured to execute any one implementation manner of the page loading method in the foregoing embodiments according to an instruction in the program code;

the electronic equipment further comprises a scanning device and a communication device.

The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium is used to store a program code, and the program code is used to execute any one implementation manner of the page loading method described in the foregoing embodiments.

It should be noted that, the step numbers in the specification, the claims and the drawings of the present invention are only for convenience of explanation of the specific embodiments, and do not serve to limit the execution sequence of the steps. The terms "first," "second," "third," and the like (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Further, the term "above" means two or more. The term "plurality" means two or more than two. The terms "comprising," "including," and "having," and any variations thereof, are intended to cover non-exclusive inclusions.

It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the above-described flowcharts may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a portion of the sub-steps or stages of other steps.

The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention; embodiments of the present invention and features of the embodiments may be combined with each other without conflict.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:网页数据处理方法及装置、存储介质和电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!