CN110334297B - Terminal page loading method, terminal, server and storage medium - Google Patents
Terminal page loading method, terminal, server and storage medium Download PDFInfo
- Publication number
- CN110334297B CN110334297B CN201810191577.3A CN201810191577A CN110334297B CN 110334297 B CN110334297 B CN 110334297B CN 201810191577 A CN201810191577 A CN 201810191577A CN 110334297 B CN110334297 B CN 110334297B
- Authority
- CN
- China
- Prior art keywords
- module
- page
- target
- terminal
- loaded
- 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.)
- Active
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 195
- 230000004044 response Effects 0.000 claims abstract description 74
- 238000000034 method Methods 0.000 claims abstract description 30
- 238000013507 mapping Methods 0.000 claims description 22
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 6
- 238000010276 construction Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 239000000428 dust Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 125000002061 L-isoleucyl group Chemical group [H]N([H])[C@]([H])(C(=O)[*])[C@](C([H])([H])[H])([H])C(C([H])([H])[H])([H])[H] 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention provides a loading method of a terminal page, a terminal, a server and a storage medium, wherein the method comprises the following steps: a first page loading request for requesting a target page is sent to a server, and a module information file about the target page returned by the server in response to the first page loading request is received; generating page module information of a target page according to the module information file, comparing the page module information with local module information cached by the terminal, and determining a module identifier to be loaded of the target page; generating a second page loading request according to the identification of the target page and the identification of the module to be loaded, and sending the second page loading request to the server; and receiving response information returned by the server in response to the second page loading request, and loading and displaying the target page according to the module to be loaded and the local module cached by the terminal included in the response information. The embodiment of the invention can effectively improve the loading efficiency of the terminal page.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method for loading a terminal page, a terminal, a server, and a storage medium.
Background
With the development of internet (World Wide Web) technology, web applications of terminals are becoming wider, and at the same time, functions of the Web applications are becoming more powerful and complex, so that code amounts supporting implementation of the Web applications are also becoming larger, and a resource file to be loaded by a common Web application is generally about 200 KB. However, as a terminal application, a network environment in which a terminal may face is relatively complex, and the downloading speeds of network resources in different network environments are very different. In a 2G environment, a Wireless-fidelity (Wifi) environment with weak signals, a 3G environment or a 4G environment, the downloading speed of network resources is generally not ideal, and may be only about 30KBs, in this network case, when a terminal accesses a Web application page, about 7 seconds is required for loading a 200KB resource file by light, which definitely seriously affects the experience of a user. How to improve the page loading performance of the Web application is a problem to be solved at present.
Disclosure of Invention
The embodiment of the invention provides a loading method of a terminal page, a terminal, a server and a storage medium, which can effectively improve the loading efficiency of the terminal page.
An aspect of the present invention provides a method for loading a terminal page, including:
A first page loading request for requesting a target page is sent to a server, and a module information file about the target page returned by the server in response to the first page loading request is received;
generating page module information of the target page according to the module information file, comparing the page module information with local module information cached by a terminal, and determining a module identifier to be loaded of the target page;
generating a second page loading request according to the identification of the target page and the identification of the module to be loaded, and sending the second page loading request to the server;
and receiving response information returned by the server in response to the second page loading request, and loading and displaying the target page according to a module to be loaded and a local module cached by the terminal, which are included in the response information.
In one aspect, the embodiment of the invention provides another loading method of a terminal page, which comprises the following steps:
receiving a first page loading request sent by a terminal and used for requesting a target page;
returning a module information file related to the target page to the terminal in response to the first page loading request, wherein the module information file is used for indicating the terminal to determine a module identifier to be loaded;
Receiving a second page loading request, wherein the second page loading request is generated and sent by the terminal according to the identification of the target page and the identification of the module to be loaded;
and responding to the second page loading request, and returning response information to the terminal, wherein the response information comprises a module to be loaded indicated by the module to be loaded identifier.
An aspect of the present invention provides a loading device for a terminal page, including:
a sending unit, configured to send a first page loading request for requesting a target page to a server;
the receiving unit is used for receiving a module information file about the target page returned by the server in response to the first page loading request;
the execution unit is used for generating page module information of the target page according to the module information file, comparing the page module information with local module information cached by the terminal, and determining a module identifier to be loaded of the target page;
the request generation unit is used for generating a second page loading request according to the identification of the target page and the identification of the module to be loaded;
the sending unit is further configured to send the second page loading request to the server;
The receiving unit is further used for receiving response information returned by the server in response to the second page loading request;
and the loading display unit is used for loading and displaying the target page according to the module to be loaded and the local module cached by the terminal, which are included in the response information.
An aspect of the present invention provides another loading device for a terminal page, including:
the receiving unit is used for receiving a first page loading request which is sent by the terminal and used for requesting a target page;
the sending unit is used for responding to the first page loading request and returning a module information file related to the target page to the terminal, wherein the module information file is used for indicating the terminal to determine a module identifier to be loaded;
the receiving unit is further configured to receive a second page loading request, where the second page loading request is generated and sent by the terminal according to the identifier of the target page and the identifier of the module to be loaded;
the sending unit is further configured to respond to the second page loading request, and return response information to the terminal, where the response information includes a module to be loaded indicated by the module to be loaded identifier.
A first aspect of an embodiment of the present invention provides a terminal, including: the system comprises a processor, a network interface and a memory, wherein the memory stores executable program codes, the network interface is controlled by the processor to send and receive messages, and the processor is used for calling the executable program codes and executing the terminal implementation mode described in the loading method of the terminal page.
In one aspect, an embodiment of the present invention provides a server, including: the system comprises a processor, a network interface and a memory, wherein the memory stores executable program codes, the network interface is controlled by the processor to send and receive messages, and the processor is used for calling the executable program codes and executing the implementation mode of the server described in the loading method of the terminal page.
In one aspect, an embodiment of the present invention provides a storage medium, where instructions are stored, when the storage medium runs on a computer, to cause the computer to execute the loading method of the terminal page.
In one aspect, an embodiment of the present invention provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for loading a terminal page described above.
According to the embodiment of the invention, the page module information of the target page can be generated according to the module information file returned by the server, then the to-be-loaded module identification of the target page is determined according to the page module information and the local module information cached by the terminal, further the to-be-loaded module is obtained from the server according to the to-be-loaded module identification, and the target page is loaded and displayed according to the to-be-loaded module and the local module cached by the terminal, so that only the to-be-loaded module is loaded by the network, and the loading efficiency of the terminal page is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic diagram of a loading system for a terminal page according to an embodiment of the present invention;
fig. 1b is a schematic flow chart of a loading method of a terminal page according to an embodiment of the present invention;
fig. 2 is a flow chart of a loading method of a terminal page according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of a dependency relationship between a page and a page module according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of a dependency relationship between a page and a page module according to an embodiment of the present invention;
FIG. 3c is a schematic diagram of a dependency relationship between a page and a page module according to an embodiment of the present invention;
FIG. 3d is a schematic diagram of a dependency relationship between a page and a page module according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a loading device for a terminal page according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a loading device for a terminal page according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminal described in the embodiments of the present invention may specifically include a smart phone, a tablet computer, a notebook, a desktop, a mobile internet device (Mobile Internet Device, MID), an intelligent wearable device, a vehicle-mounted terminal, and the like.
Referring to fig. 1a and fig. 1b, fig. 1a is a schematic architecture diagram of a loading system of a terminal page according to an embodiment of the present invention, where the loading system of a terminal page according to an embodiment of the present invention includes a terminal 1001, a server 1002, and a local building tool 1003, and the terminal 1001, the server 1002, and the local building tool 1003 are connected through a network (e.g. the internet). The local construction tool 1003 is configured to establish a module dependency file and a module version number file related to the target page, and send the established module dependency file and module version number file to the server 1002. The server 1002 is configured to provide the terminal 1001 with a module dependency file, a module version number file, and module resources regarding a target page. The terminal 1001 is configured to receive an operation instruction input by a user, and determine a target page according to the operation instruction input by the user; and then, obtaining the module on which the target page depends from the local caches of the server 1002 and the terminal 1001, and loading the module on which the target page depends, thereby realizing the loading of the target page, namely the terminal page.
Specifically, referring to fig. 1b, fig. 1b is a flowchart of a loading method of a terminal page according to an embodiment of the present invention, which includes the following steps, 101, a local construction tool 1003 establishes a module dependency file and a module version number file related to a target page, and deploys the module dependency file and the module version number file related to the target page to a server 1002. 102. When the server 1002 receives a load request for requesting a target page sent by the terminal 1001, the server 1002 sends a module dependency file and a version number file of the target page to the terminal 1001 in response to the load request, and the terminal 1001 obtains the identity and the version number of the module on which the target page depends according to the module dependency file and the version number file of the target page. 103. The terminal 1001 detects whether the modules on which the target page depends are cached in the terminal 1001, respectively, according to the identifications of the modules on which the target page depends. 104. The terminal 1001 detects whether the module relied on by the target page locally cached by the terminal 1001 is updated according to the version number of the module relied on by the target page. 105. Terminal 1001 determines whether terminal 1001 is locally uncached or whether terminal 1001 has a cached but version number updated target page dependent module. 106. Terminal 1001 determines the modules on which the target page on which terminal 1001 has a cache locally and the version number is not updated depends. 107. For the module on which the target page without cache locally of the terminal 1001 depends, the terminal 1001 acquires the latest version resource from the server 1002 and caches the latest version resource; for a module on which a target page having a cache but an updated version number locally to terminal 1001 depends, terminal 1001 acquires the latest version resource from server 1002 and updates the module. 108. Terminal 1001 loads the module on which the target page depends, thereby loading and displaying the target page. By adopting the mode, for the modules on which the target pages with the local caches and the version numbers not updated depend, version resources do not need to be acquired from a server, and only the modules on which the local caches are not needed or the target pages with the local caches and the version numbers not updated depend are loaded by a network, so that repeated acquisition of module files is avoided, and the loading efficiency of the terminal pages is effectively improved.
Referring to fig. 2, fig. 2 is a flowchart of a loading method of a terminal page according to an embodiment of the present invention. The loading method of the terminal page described in the embodiment includes:
201. the terminal sends a first page loading request for requesting a target page to the server.
Correspondingly, the server receives the first page loading request.
In the embodiment of the present invention, the first page loading request includes an identifier of the target page, where the identifier of the target page may be an interface path (for example, a path value of the entry module or a web page link) of the target page. When the terminal receives an access request about a target page, a first page loading request of the target page is generated, and the first page loading request is sent to a server.
202. And the server responds to the first page loading request and returns a module information file related to the target page to the terminal.
Correspondingly, the terminal receives the module information file related to the target page.
In the embodiment of the invention, after receiving a first page loading request sent by a terminal, a server firstly acquires an identification of a target page included in the first page loading request, and then acquires a module information file related to the target page from a server side according to the identification of the target page. The module information file comprises a module dependency relation file and a module version number file about a target page. The server can embed the module dependency relation file and the module version number file of the target page in the static page and return the static page to the terminal. The server may also return the module dependency file and the module version number file of the target page to the terminal in other manners, which is not limited by the embodiment of the present invention. The module dependency relationship file and the module version number file of the target page are generated by a page construction tool when the target page is generated, and the page construction tool deploys the module dependency relationship file and the module version number file of the target page to a server after generating the module dependency relationship file and the module version number file of the target page. It should be noted that, the page building tool may be an application development tool of an application to which the target page belongs, or may be a development tool specifically used for configuring the page module dependency relationship file and the module version number file. The module dependency relationship file and the module version number file of the target page may be separate files, the module dependency relationship of the target page may be included in the file storing the module dependency relationship of all pages of the application to which the target page belongs, and the module version number of the module required by the target page may be included in the file storing the module version numbers of all modules of the application to which the target page belongs.
203. And the terminal generates page module information of the target page according to the module information file.
In the embodiment of the invention, the terminal carries out recursion inquiry in the module dependency relationship file and the module version number file of the target page according to the identification of the target page to obtain the page module information of the target page. The page module information of the target page comprises a page module identification of a module required by the target page, or further comprises a page module version number of the module required by the target page. Specifically, the terminal carries out recursive query in the module dependency relationship file according to the identification of the target page, and obtains the page module identification of the module required by the target page; further, the terminal recursively inquires in the module version number file of the target page according to the page module identification of the module required by the target page, and obtains the version number of the page module indicated by the page module identification of the module required by the target page. It should be noted that the loading of the target page depends on one or more page modules.
In the embodiment of the invention, the page module identification of the module required by the target page can be obtained from the module dependency relationship file of the target page, namely, the page module identifications of all the modules on which the target page depends are obtained. The module dependency file may be in the form of a mapping table, may be in the form of a code, or may be in other forms, and embodiments of the present invention are not limited. The module identification may be a path value of the module. When the application is developed, the page construction tool generates a configuration of a module dependency relationship for each page of the application, namely generates a module dependency relationship file of each page, which represents a module required to be used when each page is loaded, and the following code examples are illustrated by taking the module dependency relationship file as codes:
dust.config({relation:{"/res/weixin/wxremit/js/mod/login.js":["/res/g/js/lib/zepto.js","/res/g/js/mobile/weixin/tools.js","/res/g/js/mobile/weixin/login.js","/res/g/js/mob ile/weixin/weixin.js","/res/weixin/wxremit/js/mod/config.js"],"/res/g/js/mod/speed.js":[],"/res/g/js/mod/log.js":[],"/res/weixin/wxremit/js/remittance.js":["/res/weixin/wxre mit/js/mod/ajax.js","/res/g/js/mobile/global/touch.js","/res/g/js/mod/form.js","/res/g/js/mobile/weixin/box_skin.js"]}})。
As can be seen from the above code, the page: the modules relied on by "/res/weixin/wxremit/js/mod/logic. Js" include: and (3) a module: "/res/g/js/lib/zepto. Js), module: "/res/g/js/mobile/weixin/tools. Js", module: "/res/g/js/mobile/weixin/logic. Js", module: "/res/g/js/mobile/weixin. Js", module: "/res/weixin/wxremit/js/mod/config. Js".
In the embodiment of the invention, the page module version number of the module required by the target page can be obtained from the module version number file of the target page. The module version number is a target character string with a preset number of bits which is intercepted after encrypting the content data of the module. Specifically, the current content data of the module is compressed first, then the compressed content data of the module is encrypted by adopting a message digest algorithm (Message Digest Algorithm, MD5) to obtain a character string, finally a target character string with a preset bit number (for example, 10 bits) is calculated from the character string by adopting an interception algorithm, and the target character string with the preset bit number is used as the module version number of the module. By adopting the mode, on one hand, the module version number of the module can be ensured not to be changed as long as the content data of the module is unchanged, otherwise, the module version number of the module can be ensured to be changed as soon as the content data of the module is changed; on the other hand, the bit number of the module version number is fixed, so that the storage space can be saved, and the comparison efficiency of the module version number can be improved. It should be noted that, the module version number of the module may be generated by a local building tool and sent to the server, or may be generated by the server, which is not limited by the embodiment of the present invention.
The module version number file may include a mapping relation between a module identifier and a module version number, and the module version number file may be in a mapping table form or a code form. The following is an example of code in the form of a module version number file:
dust.config({onlineVersion:{"/res/g/js/lib/zepto.js":2734861976,"/res/g/js/mobil e/global/flipiscroll.js":1210436869,"/res/g/js/mobile/global/iscroll-lite.js":8164426042,"/res/g/js/mobile/global/jsencrypt.js":1225414850,"/res/g/js/mobile/global/touch.js":11294694608,"/res/g/js/mobile/weixin/box.js":5590605662,"/res/g/js/mobile/weixin/box_skin.js":4753484566}})。
as can be seen from the above code, the module: the corresponding module version numbers of "/res/g/js/lib/zepto. Js" are: 2734861976 the module version number corresponding to the module "/res/g/js/mobile/global/flip-flop. Js" is 1210436869 and the module version number corresponding to the module "/res/g/js/mobile/global/iscrol-lite. Js" is 8164426042.
In some possible embodiments, the page module information of the target page may also be generated by the server according to the module information file of the target page. Specifically, after receiving a first page loading request sent by a terminal and used for requesting a target page, a server firstly acquires a module dependency relationship file and a module version number file of the target page; then recursively inquiring in the module dependency relation file and the module version number file of the target page according to the identification of the target page to obtain page module information of the target page; and finally, the server returns the page module information of the target page to the terminal, and correspondingly, the terminal receives the page module information of the target page sent by the server.
204. And the terminal compares the page module information with local module information cached by the terminal to determine the module identification to be loaded of the target page.
In some possible embodiments, the page module information includes a page module identifier of a module required by the target page, and the local module information includes a local module identifier of a local module cached by the terminal. Specifically, the terminal performs identification comparison query in the local module identification according to a first target identification in the page module identification; if the result of the identifier comparison query is that the second target identifier which is the same as the first target identifier does not exist in the local module identifier, the fact that the page module terminal indicated by the first target identifier is not cached locally is indicated, and the terminal determines the first target identifier as the module identifier to be loaded. The first target mark is any one of page module marks, the second target mark is any one of local module marks, and the module indicated by the first target mark is the module to be loaded.
In some possible embodiments, the page module information includes a page module identifier and a page module version number of a module required by the target page, and the local module information includes a local module identifier and a local module version number of a local module cached by the terminal. Specifically, the terminal firstly performs identification comparison query in a local module identification according to a first target identification in the page module identification; if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, the terminal further detects whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification; if the version number of the page module corresponding to the first target identifier is different from the version number of the local module corresponding to the second target identifier, the content data of the local module indicated by the second target identifier, which is locally cached by the terminal, needs to be updated, and the terminal determines the first target identifier as the module identifier to be loaded.
If the version number of the page module corresponding to the first target identifier is the same as the version number of the local module corresponding to the second target identifier, the terminal further detects whether the content data of the local module indicated by the second target identifier of the local cache of the terminal meets the loading condition, for example, detects whether the content data of the local module indicated by the second target identifier of the local cache of the terminal is complete, if the data of the local module is incomplete, it is determined that the loading condition is not met, and if the data of the local module is complete, it is determined that the loading condition is met. If the content data of the local module indicated by the second target identifier does not meet the loading condition, the content data cache of the local module indicated by the second target identifier is invalid, and the terminal determines the first target identifier as the module identifier to be loaded; if the content data of the local module indicated by the second target identifier meets the loading condition, the terminal determines that the content data of the local module indicated by the second target identifier is valid in a cached mode, and reloading is not needed.
In some possible embodiments, the page module information includes first mapping relation information of a page module identifier and a page module version number of a module required by the target page, and the local module information includes second mapping relation information of a local module identifier and a local module version number cached by the terminal. Wherein the first mapping relation and the second mapping relation may be in the form of mapping tables. Specifically, the terminal compares and inquires the first mapping relation information and the second mapping relation information according to the module identifier of the module to obtain the module identifier to be loaded. It should be noted that, the specific process of determining the identity of the module to be loaded may refer to the above description, and will not be repeated herein.
205. And the terminal generates a second page loading request according to the identification of the target page and the identification of the module to be loaded.
In the embodiment of the invention, the second page loading request is used for requesting the module to be loaded. The second page loading request may include a resource request link, where the resource request link is generated according to the identifier of the target page, the identifier of the module to be loaded, and a preset rule. Wherein the resource request link may include two parts of content, one part of the content being an interface path of the target page, for example, a web page link of the target page, as follows: https:// mqq-imgcach. The other part of the content is resource demand parameters generated by the terminal according to the module identification to be loaded. Assuming that the determined module to be loaded is identified as a.js, b.js, c.js and d.js, combining the two parts of content to form a resource request link for requesting the module to be loaded: https:// mqq-imgchache. It should be noted that the resource request link may also be formed by other parameters, and the resource request link may also be in other forms, which are not limited by the embodiment of the present invention.
206. And the terminal sends the second page loading request to the server.
Accordingly, the server receives the second page load request.
207. And the server responds to the second page loading request and returns response information to the terminal, wherein the response information comprises a module to be loaded indicated by the module to be loaded identifier.
Correspondingly, the terminal receives the response information.
In the embodiment of the invention, after receiving the second page loading request, the server firstly acquires a resource request link included in the second page loading request; then, respectively finding out a module file of each module to be loaded at a server according to resource demand parameters included in the resource request link or according to a module to be loaded identifier included in the resource request link, wherein the module file comprises information such as content data and a module version number of the module to be loaded; and finally, carrying the acquired module file of the module to be loaded in response information and sending the response information to the terminal. It should be noted that, the server may independently carry the module files of each module to be loaded in the response information and send the response information to the terminal; the module files of the module to be loaded can be carried in response information after being combined and compressed and then sent to the terminal.
208. And the terminal loads and displays the target page according to the module to be loaded and the local module cached by the terminal, which are included in the response information.
In the embodiment of the invention, after receiving response information returned by a server responding to a second page loading request, a terminal firstly acquires content data of a module to be loaded, which is included in the response information, acquires other module identifiers except the module identifier to be loaded in page module information of a target page, and acquires the content data of a module indicated by the other module identifiers from a local cache of the terminal; and then loading the content data of the module to be loaded and the content data of the module indicated by the other module identifiers, namely, loading the content data of the module indicated by all the module identifiers in the page module information of the target page, thereby realizing the loading of the target page and displaying the target page.
In some possible embodiments, after receiving response information returned by the server in response to the second page loading request, the terminal first extracts content data and a module version number of a module to be loaded included in the response information; and then caching the content data and the module version number of the module to be loaded into a local storage space of the terminal according to the module identifier of the module to be loaded. Specifically, if the module to be loaded is not cached locally by the terminal, the terminal creates a module file, and caches the content data and the module version number of the module to be loaded into the created module file. If the terminal locally caches a local module with the same module identifier as the module to be loaded, but the version number of the local module is different from the version number of the module to be loaded, the terminal correspondingly covers the content data of the local module with the content data of the module to be loaded, and updates the version number of the local module to the version number of the module to be loaded. If the terminal locally caches a local module with the same module identifier as the module to be loaded, and the version number of the local module is the same as the version number of the module to be loaded, but the content data of the local module does not accord with the loading condition, the terminal correspondingly covers the content data of the local module with the content data of the module to be loaded. It should be noted that, the above steps may also be performed after the terminal loads and displays the target page. By adopting the mode, the accurate management of the page module cache can be realized, the utilization rate of the page module cache can be effectively improved, and the page loading performance of Web application is improved.
It should be noted that if the terminal detects that the modules required by the target page are all cached in the local storage space of the terminal according to the page module information of the target page and the local module information cached by the terminal, and the content data of the modules required by the target page do not need to be updated and all meet the loading condition, the terminal does not generate the second page loading request, directly acquires the content data of the modules required by the target page from the local cache of the terminal, and loads and displays the target page.
In order to facilitate understanding of the technical solution in the embodiments of the present invention, the following description is given by way of example, and please refer to fig. 3a, 3b, 3c and 3d together. Fig. 3a, 3B, 3C and 3d are schematic diagrams of the dependency relationship between the application Page and the Page module, as shown in fig. 3a, 3B, 3C or 3d, the application a (APP-a) is composed of pages Page a, page B, page C and Page X, and the application B (APP-B) is composed of pages Page a and Page X. Each Page needs to load a number of Page modules, some of which are specific to a certain Page, such as the Page module in fig. 3 a; some page modules are common to all pages of the current APP, such as the APP module in fig. 3 a; still other page modules are generic to Web applications, such as the bottom layer module in fig. 3 a. The Page modules relied upon by Page A in the loading process comprise the Page modules in the dashed line boxes in FIG. 3a, and the Page modules relied upon by Page C in the loading process comprise the Page modules in the dashed line boxes in FIG. 3 b. It can be seen that the modules on which Page A and Page C depend include modules A-Mod X and Mod Y, as shown in the black areas in FIG. 3a or FIG. 3 b.
Assuming that all pages included in APP-a are not loaded, when the terminal accesses the Page a Page of APP-a for the first time, the terminal needs to acquire and cache all Page modules shown in the dashed box in fig. 3a from the server. When the terminal accesses the Page C of the APP-A for the first time, the terminal only needs to acquire and cache all Page modules shown in a dotted line frame in FIG. 3C from the server because the modules A-Mod X and Mod Y are cached locally in the modules on which the Page C depends. By adopting the mode, when the terminal loads the page, only the page module which is not cached locally by the terminal is acquired from the server, repeated acquisition of the page module can be avoided, network loading redundancy is effectively reduced, and loading efficiency of the page is improved.
Further, when all the page modules shown in the dashed line frame in fig. 3d need to be updated, in the scheme of the present invention, the terminal only needs to obtain the content data and the version number corresponding to the page module shown in the dashed line frame in fig. 3d and needing to be updated from the server, so as to update the page module shown in the dashed line frame in fig. 3d and needing to be updated. As can be seen from fig. 3a and 3b, the Page modules to be updated shown in the dashed box in fig. 3d include both Page modules on which pages a and C depend and other modules. In the existing manner, the terminal needs to acquire content data and version numbers of all Page modules on which Page a, page C and other pages depend from the server, so as to update the Page module which is shown in the dashed line box in 3d and needs to be updated. Therefore, in the scheme of the invention, when the terminal updates the page module, only the page module needing to be updated is acquired from the server, so that the phenomenon of acquiring the page module which does not need to be updated can be avoided, the network loading redundancy is effectively reduced, the network flow and time required by updating the page module are saved, and the loading efficiency of the page is improved.
In the embodiment of the invention, the page module can be js module, and the modularization is a method for separating the application page into independent functional parts, so that the application page can be divided into a plurality of independent page modules, each page module has different functions, and each page module can be independently cached. By adopting js module, each page module can be independently processed, such as updating, modifying and other operations. The terminal caches the page module in a localtorage mode, wherein localtorage is an object used for storing temporary information of the terminal and can only store a character string type object. The localStorage lifecycle is permanent, and localStorage information will always exist unless the user clears the localStorage information manually or by a developer using an associated interface. The page module cache is made by using the localtorage, so that the time for updating the page module cache can be flexibly controlled.
In the embodiment of the invention, firstly, a terminal sends a first page loading request for requesting a target page to a server, the server responds to the first page loading request to return page module information of the target page to the terminal, then the terminal compares the page module information with local module information cached by the terminal to determine the to-be-loaded module identification of the target page, and determines a second page loading request according to the identification of the target page and the to-be-loaded module identification, secondly, the terminal sends the second page loading request to the server, the server responds to the second page loading request to return response information to the terminal, and finally, the terminal loads and displays the target page according to the to-be-loaded module included in the response information and the local module cached by the terminal, so that only the to-be-loaded module is needed to be loaded by a network, and the loading efficiency of the terminal page is effectively improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a loading device for a terminal page according to an embodiment of the present invention. The loading device of the terminal page described in this embodiment corresponds to the terminal described above, and the loading device of the terminal page includes:
a sending unit 401, configured to send a first page loading request for requesting a target page to a server;
a receiving unit 402, configured to receive a module information file about the target page returned by the server in response to the first page loading request;
the execution unit 403 is configured to generate page module information of the target page according to the module information file, and compare the page module information with local module information cached by the terminal to determine a module identifier to be loaded of the target page;
a request generating unit 404, configured to generate a second page loading request according to the identifier of the target page and the identifier of the module to be loaded;
the sending unit 401 is further configured to send the second page loading request to the server;
the receiving unit 402 is further configured to receive response information returned by the server in response to the second page loading request;
And the loading display unit 405 is configured to load and display the target page according to a module to be loaded included in the response information and a local module cached by the terminal.
In some possible embodiments, the module information file includes a module dependency file and a module version number file related to the target page, and the executing unit 403 is specifically configured to:
and generating page module information of the target page according to the module dependency relation file and the module version number file.
In some possible embodiments, the module dependency file and the module version number file related to the target page are generated by a page building tool when the target page is generated, and the specific manner in which the execution unit 403 generates the page module information of the target page according to the module dependency file and the module version number file is as follows:
and recursively inquiring in the module dependency relation file and the module version number file according to the identification of the target page to obtain page module information of the target page.
In some possible embodiments, the page module information includes a page module identifier of a module required by the target page, the local module information includes a local module identifier of a local module cached by the terminal, and the executing unit 403 is specifically configured to:
Performing identification comparison query in the local module identification according to a first target identification in the page module identification;
and if the result of the identifier comparison query is that the second target identifier which is the same as the first target identifier does not exist in the local module identifier, determining the first target identifier as the module identifier to be loaded.
In some possible implementations, the page module information includes a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier and a local module version number of a local module cached by the terminal, and the execution unit 403 is specifically configured to:
performing identification comparison query in the local module identification according to a first target identification in the page module identification;
if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification;
and if the first target identifiers are not the same, determining the first target identifiers as the module identifiers to be loaded.
In some possible implementations, the page module information includes a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier and a local module version number of a local module cached by the terminal, and the execution unit 403 is specifically configured to:
performing identification comparison query in the local module identification according to a first target identification in the page module identification;
if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification;
if the content data of the local module indicated by the second target identifier are the same, whether the content data of the local module indicated by the second target identifier meet the loading condition is detected;
and if the loading condition is not met, determining the first target identifier as a module identifier to be loaded.
In some possible embodiments, the page module information includes a first mapping relationship information of a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier cached by the terminal and second mapping relationship information of a local module version number, and the execution unit 403 is specifically configured to:
And comparing the first mapping relation information with the second mapping relation information to obtain a module identifier to be loaded.
In some possible implementations, the loading device of the terminal page further includes:
an extracting unit 406, configured to extract content data and a module version number of a module to be loaded included in the response information;
the caching unit 407 is configured to cache, according to the module identifier of the module to be loaded, content data and a module version number of the module to be loaded.
In some possible embodiments, the module version number is a target string of a preset number of bits that is intercepted after encrypting the content data of the module.
It may be understood that the functions of each functional unit of the loading device of the terminal page in the embodiment of the present invention may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
In the embodiment of the invention, the sending unit 401 sends a first page loading request for requesting a target page to the server, the receiving unit 402 receives a module information file about the target page returned by the server in response to the first page loading request, the executing unit 403 generates page module information of the target page according to the module information file, compares the page module information with local module information cached by the terminal, determines a to-be-loaded module identifier of the target page, the request generating unit 404 determines a second page loading request according to the identifier of the target page and the to-be-loaded module identifier, and triggers the sending unit 401 to send the second page loading request to the server, the receiving unit 402 receives response information returned by the server in response to the second page loading request, and the loading display unit 405 loads and displays the target page according to the to-be-loaded module included in the response information and the local module cached by the terminal, so that only the to-be-loaded module is loaded by the network, and the loading efficiency of the terminal page is effectively improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of another loading device for a terminal page according to an embodiment of the present invention. The loading device of the terminal page described in this embodiment corresponds to the server described above, and the loading device of the terminal page includes:
a receiving unit 501, configured to receive a first page loading request sent by a terminal and used for requesting a target page;
a sending unit 502, configured to respond to the first page loading request, and return a module information file related to the target page to the terminal, where the module information file is used to instruct the terminal to determine a module identifier to be loaded;
the receiving unit 501 is further configured to receive a second page loading request, where the second page loading request is generated and sent by the terminal according to the identifier of the target page and the identifier of the module to be loaded;
the sending unit 502 is further configured to respond to the second page loading request, and return response information to the terminal, where the response information includes a module to be loaded indicated by the module to be loaded identifier.
In some possible implementations, the module information file includes a module dependency file and a module version number file for the target page.
In some possible implementations, the module dependency file and the module version number file of the target page are generated by a page building tool at the time the target page is generated.
In some possible implementations, the loading device of the terminal page further includes:
an obtaining unit 503, configured to obtain, from a server cache according to the to-be-loaded module identifier, content data and a module version number of the to-be-loaded module indicated by the to-be-loaded module identifier;
the sending unit 502 is specifically configured to send the content data and the module version number of the module to be loaded to the terminal by carrying the content data and the module version number in response information.
It may be understood that the functions of each functional unit of the loading device of the terminal page in the embodiment of the present invention may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
In the embodiment of the invention, the receiving unit 501 receives a first page loading request sent by a terminal and used for requesting a target page, the sending unit 502 responds to the first page loading request to return a module information file related to the target page to the terminal, the module information file is used for indicating the terminal to determine a module identifier to be loaded, the receiving unit 501 receives a second page loading request, the second page loading request is generated and sent by the terminal according to the identifier of the target page and the module identifier to be loaded, the sending unit 502 responds to the second page loading request to return response information to the terminal, and the response information comprises the module to be loaded indicated by the module identifier to be loaded, so that only the module to be loaded is required to be loaded by a network, and the loading efficiency of the terminal page is effectively improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal described in this embodiment includes: processor 601, user interface 602, network interface 603 and memory 604. The processor 601, the user interface 602, the network interface 603, and the memory 604 may be connected by a bus or other means, for example, in the embodiment of the present invention.
The processor 601 (or CPU (Central Processing Unit, central processing unit)) is a computing core and a control core of the terminal, which can parse various instructions in the terminal and process various data of the terminal, for example: the CPU can be used for analyzing a startup and shutdown instruction sent by a user to the terminal and controlling the terminal to perform startup and shutdown operation; and the following steps: the CPU can transmit various kinds of interactive data between the internal structures of the terminal, and so on. The user interface 602 is a medium for implementing interaction and information exchange between a user and a terminal, and may specifically include a Display screen (Display) for output, a Keyboard (Keyboard) for input, and the like, where the Keyboard may be a physical Keyboard, a virtual Keyboard with a touch screen, or a Keyboard with a combination of a physical and a virtual touch screen. The network interface 603 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.), controlled by the processor 601 for transceiving data. The Memory 604 (Memory) is a Memory device in the terminal for storing programs and data. It will be appreciated that the memory 604 herein may include both built-in memory of the terminal and extended memory supported by the terminal. Memory 604 provides storage space that stores the operating system of the terminal, which may include, but is not limited to: android systems, iOS systems, windows Phone systems, etc., the invention is not limited in this regard.
In an embodiment of the present invention, the processor 601 performs the following operations by executing executable program code in the memory 604:
sending a first page loading request for requesting a target page to a server through a network interface 603, and receiving a module information file about the target page returned by the server in response to the first page loading request;
generating page module information of the target page according to the module information file, comparing the page module information with local module information cached by a terminal, and determining a module identifier to be loaded of the target page;
generating a second page loading request according to the identification of the target page and the identification of the module to be loaded, and sending the second page loading request to the server through a network interface 603;
and receiving response information returned by the server in response to the second page loading request through a network interface 603, and loading and displaying the target page according to a module to be loaded and a local module cached by the terminal, which are included in the response information.
In some possible embodiments, the module information file includes a module dependency file and a module version number file related to the target page, and the processor 601 is specifically configured to:
And generating page module information of the target page according to the module dependency relation file and the module version number file.
In some possible embodiments, the module dependency file and the module version number file related to the target page are generated by a page building tool when the target page is generated, and the specific manner in which the processor 601 generates the page module information of the target page according to the module dependency file and the module version number file is as follows:
and recursively inquiring in the module dependency relation file and the module version number file according to the identification of the target page to obtain page module information of the target page.
In some possible embodiments, the page module information includes a page module identifier of a module required by the target page, the local module information includes a local module identifier of a local module cached by the terminal, and the processor 601 is specifically configured to:
performing identification comparison query in the local module identification according to a first target identification in the page module identification;
and if the result of the identifier comparison query is that the second target identifier which is the same as the first target identifier does not exist in the local module identifier, determining the first target identifier as the module identifier to be loaded.
In some possible embodiments, the page module information includes a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier and a local module version number of a local module cached by the terminal, and the processor 601 is specifically configured to:
performing identification comparison query in the local module identification according to a first target identification in the page module identification;
if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification;
and if the first target identifiers are not the same, determining the first target identifiers as the module identifiers to be loaded.
In some possible embodiments, the page module information includes a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier and a local module version number of a local module cached by the terminal, and the processor 601 is specifically configured to:
Performing identification comparison query in the local module identification according to a first target identification in the page module identification;
if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification;
if the content data of the local module indicated by the second target identifier are the same, whether the content data of the local module indicated by the second target identifier meet the loading condition is detected;
and if the loading condition is not met, determining the first target identifier as a module identifier to be loaded.
In some possible embodiments, the page module information includes a first mapping relationship information of a page module identifier and a page module version number of a module required by the target page, the local module information includes a local module identifier cached by the terminal and second mapping relationship information of a local module version number, and the processor 601 is specifically configured to:
and comparing the first mapping relation information with the second mapping relation information to obtain a module identifier to be loaded.
In some possible embodiments, the processor 601 is further configured to:
extracting content data and a module version number of a module to be loaded, which are included in the response information;
and caching the content data and the module version number of the module to be loaded according to the module identifier of the module to be loaded.
In some possible embodiments, the module version number is a target string of a preset number of bits that is intercepted after encrypting the content data of the module.
In a specific implementation, the processor 601, the user interface 602, the network interface 603, and the memory 604 described in the embodiments of the present invention may execute the implementation of the terminal described in the method for loading a terminal page provided in the embodiments of the present invention, or may execute the implementation described in the apparatus for loading a terminal page provided in fig. 3 in the embodiments of the present invention, which is not described herein again.
In the embodiment of the invention, the processor 601 firstly sends a first page loading request for requesting a target page to the server through the network interface 603, receives a module information file about the target page returned by the server in response to the first page loading request, then generates page module information of the target page according to the module information file, compares the page module information with local module information cached by the terminal, determines a to-be-loaded module identification of the target page, determines a second page loading request according to the target page identification and the to-be-loaded module identification, sends the second page loading request to the server through the network interface 603, finally receives response information returned by the server in response to the second page loading request, and loads and displays the target page according to the to-be-loaded module included in the response information and the local module cached by the terminal, thereby only needing network loading of the to-be-loaded module, and effectively improving the loading efficiency of the terminal page.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention. The server described in the present embodiment includes: a processor 701, a network interface 702, and a memory 703. The processor 701, the network interface 702, and the memory 703 may be connected by a bus or other means, for example, in embodiments of the present invention.
The processor 701 (or central processing unit (Central Processing Unit, CPU)) is a computing core and a control core of the server. The network interface 702 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.), controlled by the processor 701 for transceiving data. The Memory 703 (Memory) is a Memory device of the server for storing programs and data. It is appreciated that the memory 703 herein may be either a high speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, at least one memory device located remotely from the aforementioned processor 701. Memory 703 provides storage space that stores the operating system and executable program code of the server, which may include, but is not limited to: windows (an operating system), linux (an operating system), etc., the present invention is not limited in this regard.
In an embodiment of the present invention, the processor 701 performs the following operations by executing executable program code in the memory 703:
receiving a first page loading request sent by a terminal through a network interface 702, wherein the first page loading request is used for requesting a target page;
returning page module information about the target page to the terminal through a network interface 702 in response to the first page loading request, wherein the page module information is used for indicating the terminal to determine a module identifier to be loaded;
receiving a second page loading request through the network interface 702, wherein the second page loading request is generated and sent by the terminal according to the identification of the target page and the identification of the module to be loaded;
and responding to the second page loading request, and returning response information to the terminal through a network interface 702, wherein the response information comprises a module to be loaded indicated by the module to be loaded identifier.
In some possible implementations, the module information file includes a module dependency file and a module version number file for the target page.
In some possible implementations, the module dependency file and the module version number file of the target page are generated by a page building tool at the time the target page is generated.
In some possible embodiments, the processor 701 is specifically configured to:
acquiring content data and a module version number of the module to be loaded, which are indicated by the module to be loaded, from a server cache according to the module to be loaded;
and the content data and the module version number of the module to be loaded are carried in response information and returned to the terminal through the network interface 702.
In a specific implementation, the processor 701, the network interface 702, and the memory 703 described in the embodiments of the present invention may execute an implementation manner of the server described in the loading method of the terminal page provided in the embodiments of the present invention, or may execute an implementation manner described in the loading device of the terminal page provided in fig. 4 in the embodiments of the present invention, which is not described herein again.
In the embodiment of the invention, the processor 701 receives a first page loading request sent by a terminal and used for requesting a target page through the network interface 702, and returns a module information file related to the target page to the terminal in response to the first page loading request, wherein the module information file is used for indicating the terminal to determine a module identifier to be loaded, and receives a second page loading request, the second page loading request is generated and sent by the terminal according to the identifier of the target page and the module identifier to be loaded, and returns response information to the terminal in response to the second page loading request, wherein the response information comprises the module to be loaded indicated by the module identifier to be loaded, so that only the module to be loaded is required to be loaded by a network, and the loading efficiency of the terminal page is effectively improved.
The embodiment of the invention also provides a storage medium, wherein instructions are stored in the storage medium, and when the instructions run on a computer, the computer is caused to execute the loading method of the terminal page executed by the terminal according to the embodiment of the invention, or the computer is caused to execute the loading method of the terminal page executed by the server according to the embodiment of the invention.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present invention is not limited by the order of action described, as some steps may be performed in other order or simultaneously according to the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing describes in detail a loading method, a terminal, a server and a storage medium of a terminal page provided by the embodiments of the present invention, and specific examples are applied to describe the principles and implementations of the present invention, where the descriptions of the foregoing embodiments are only used to help understand the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (10)
1. The loading method of the terminal page is characterized by comprising the following steps:
a first page loading request for requesting a target page is sent to a server, wherein the first page loading request is used for indicating the server to carry out recursion query in a module dependency relationship file and a module version number file of the target page according to the identification of the target page so as to obtain page module information of the target page; the page module information comprises one or two of a page module identifier and a page module version number of a module required by the target page, the page module identifier comprises a path value of the module, the page module version number is a target character string with a preset number of bits intercepted after encrypting content data of the module, and when the content data of the module is changed, the page module version number is also changed;
Receiving page module information of the target page sent by the server, wherein the page module information comprises a page module identifier and a page module version number of a module required by the target page, and the local module information comprises a local module identifier and a local module version number of a local module cached by a terminal; performing identification comparison query in the local module identification according to a first target identification in the page module identification; if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification; if the first target identifiers are different, determining the first target identifiers as module identifiers to be loaded;
generating a second page loading request according to the identification of the target page and the identification of the module to be loaded, and sending the second page loading request to the server;
receiving response information returned by the server in response to the second page loading request, and loading and displaying the target page according to a module to be loaded and a local module cached by the terminal, which are included in the response information;
Extracting content data and a module version number of the module to be loaded, which are included in the response information;
if the module to be loaded is not cached locally, a module file is newly created, and the content data and the module version number of the module to be loaded are cached in the newly created module file;
if a local module with the same module identifier as the module to be loaded is locally cached and the module version number of the local module is different from the module version number of the module to be loaded, the content data of the module to be loaded is correspondingly covered with the content data of the local module, and the module version number of the local module is updated to the module version number of the module to be loaded;
and if the local cache has a local module with the same module identifier as the module to be loaded, the module version number of the local module is the same as the module version number of the module to be loaded, and the content data of the local module does not accord with the loading condition, correspondingly covering the content data of the local module with the content data of the module to be loaded.
2. The method of claim 1, wherein the module dependency file and the module version number file for the target page are generated by a page building tool at the time the target page is generated.
3. The method according to claim 1, wherein the method further comprises:
and if the result of the identifier comparison query is that the second target identifier which is the same as the first target identifier does not exist in the local module identifier, determining the first target identifier as the module identifier to be loaded.
4. The method according to claim 1, wherein the method further comprises:
if the page module version number corresponding to the first target identifier is the same as the local module version number corresponding to the second target identifier, detecting whether the content data of the local module indicated by the second target identifier meets a loading condition;
and if the loading condition is not met, determining the first target identifier as a module identifier to be loaded.
5. The method of claim 1, wherein the page module information further includes first mapping relationship information of a page module identifier and a page module version number of a module required by the target page, and the local module information further includes second mapping relationship information of a local module identifier and a local module version number cached by the terminal; the method further comprises the steps of:
and comparing the first mapping relation information with the second mapping relation information to obtain a module identifier to be loaded.
6. The loading method of the terminal page is characterized by comprising the following steps:
receiving a first page loading request sent by a terminal and used for requesting a target page;
responding to the first page loading request, and carrying out recursion inquiry in a module dependency relationship file and a module version number file of the target page according to the identification of the target page to obtain page module information of the target page; the page module information comprises one or two of a page module identifier and a page module version number of a module required by the target page, the page module identifier comprises a path value of the module, the page module version number is a target character string with a preset number of bits intercepted after encrypting content data of the module, and when the content data of the module is changed, the page module version number is also changed;
the method comprises the steps that page module information of a target page is sent to a terminal, the page module information comprises page module identifiers and page module version numbers of modules required by the target page, and the local module information comprises local module identifiers and local module version numbers of local modules cached by the terminal; performing identification comparison query in the local module identification according to a first target identification in the page module identification through the terminal; if the identification comparison query result is that a second target identification which is the same as a first target identification in the page module identifications exists in the local module identifications, detecting whether the page module version number corresponding to the first target identification is the same as the local module version number corresponding to the second target identification; if the first target identifiers are different, determining the first target identifiers as module identifiers to be loaded;
Receiving a second page loading request, wherein the second page loading request is generated and sent by the terminal according to the identification of the target page and the identification of the module to be loaded;
responding to the second page loading request, and returning response information to the terminal, wherein the response information comprises the content data and the module version number of the module to be loaded indicated by the module to be loaded identifier, so that if the terminal does not cache the module to be loaded locally, a new module file is created, and the content data and the module version number of the module to be loaded are cached in the new module file; if a local module with the same module identifier as the module to be loaded is locally cached and the module version number of the local module is different from the module version number of the module to be loaded, the content data of the module to be loaded is correspondingly covered with the content data of the local module, and the module version number of the local module is updated to the module version number of the module to be loaded; and if the local cache has a local module with the same module identifier as the module to be loaded, the module version number of the local module is the same as the module version number of the module to be loaded, and the content data of the local module does not accord with the loading condition, correspondingly covering the content data of the local module with the content data of the module to be loaded.
7. The method of claim 6, wherein the returning response information to the terminal comprises:
acquiring content data and a module version number of the module to be loaded, which are indicated by the module to be loaded, from a server cache according to the module to be loaded;
and carrying the content data and the module version number of the module to be loaded in response information and returning the response information to the terminal.
8. A terminal, comprising: a processor, a network interface and a memory, the memory storing executable program code, the network interface being controlled by the processor to send and receive messages, the processor to invoke the executable program code to perform the loading method of the terminal page according to any of claims 1 to 5.
9. A server, comprising: a processor, a network interface and a memory, said memory storing executable program code, said network interface being controlled by said processor for transceiving messages, said processor for invoking said executable program code for performing a loading method of a terminal page as claimed in claim 6 or 7.
10. A storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the loading method of a terminal page as claimed in any one of claims 1 to 5 or the loading method of a terminal page as claimed in claim 6 or 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810191577.3A CN110334297B (en) | 2018-03-08 | 2018-03-08 | Terminal page loading method, terminal, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810191577.3A CN110334297B (en) | 2018-03-08 | 2018-03-08 | Terminal page loading method, terminal, server and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110334297A CN110334297A (en) | 2019-10-15 |
CN110334297B true CN110334297B (en) | 2024-03-01 |
Family
ID=68138811
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810191577.3A Active CN110334297B (en) | 2018-03-08 | 2018-03-08 | Terminal page loading method, terminal, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110334297B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990733B (en) * | 2019-10-31 | 2023-03-17 | 合肥美的电冰箱有限公司 | Page loading method and device, electronic equipment and medium |
CN112784195A (en) * | 2019-11-07 | 2021-05-11 | 北京沃东天骏信息技术有限公司 | Page data publishing method and system |
CN110889061A (en) * | 2019-11-12 | 2020-03-17 | 望海康信(北京)科技股份公司 | Webpage loading method and device |
CN111221862B (en) * | 2019-12-31 | 2023-08-11 | 五八有限公司 | Request processing method and device |
CN111538889A (en) * | 2020-03-30 | 2020-08-14 | 中国平安人寿保险股份有限公司 | Interface request method, device, equipment and computer readable storage medium |
CN111694550B (en) * | 2020-04-28 | 2024-06-21 | 北京奇艺世纪科技有限公司 | Page display control method, device and system |
CN114115652A (en) * | 2020-08-10 | 2022-03-01 | 腾讯科技(武汉)有限公司 | Information display method, device, equipment and storage medium |
CN112069386B (en) * | 2020-09-07 | 2023-09-05 | 北京奇艺世纪科技有限公司 | Request processing method, device, system, terminal and server |
CN112434237A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Page loading method and device, electronic equipment and storage medium |
CN113094141A (en) * | 2021-04-23 | 2021-07-09 | 北京达佳互联信息技术有限公司 | Page display method and device, electronic equipment and storage medium |
CN114217878A (en) * | 2021-12-23 | 2022-03-22 | 中国建设银行股份有限公司 | Object loading method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104516973A (en) * | 2014-12-26 | 2015-04-15 | 北京奇虎科技有限公司 | Method and device for accessing page |
CN105022750A (en) * | 2014-04-28 | 2015-11-04 | 腾讯科技(北京)有限公司 | Resource file loading method and apparatus |
CN106682176A (en) * | 2016-12-29 | 2017-05-17 | 北京五八信息技术有限公司 | Page loading method, equipment and device |
CN107508895A (en) * | 2017-08-30 | 2017-12-22 | 武汉斗鱼网络科技有限公司 | page loading method, device and storage medium |
-
2018
- 2018-03-08 CN CN201810191577.3A patent/CN110334297B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105022750A (en) * | 2014-04-28 | 2015-11-04 | 腾讯科技(北京)有限公司 | Resource file loading method and apparatus |
CN104516973A (en) * | 2014-12-26 | 2015-04-15 | 北京奇虎科技有限公司 | Method and device for accessing page |
CN106682176A (en) * | 2016-12-29 | 2017-05-17 | 北京五八信息技术有限公司 | Page loading method, equipment and device |
CN107508895A (en) * | 2017-08-30 | 2017-12-22 | 武汉斗鱼网络科技有限公司 | page loading method, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110334297A (en) | 2019-10-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110334297B (en) | Terminal page loading method, terminal, server and storage medium | |
US10412176B2 (en) | Website access method, apparatus, and website system | |
CN109976667B (en) | Mirror image management method, device and system | |
US10200507B2 (en) | Creation of a binding based on a description associated with a server | |
CN106970790B (en) | Application program creating method, related equipment and system | |
CN107861713B (en) | Data calling method and device and computer readable storage medium | |
CN103229478B (en) | A kind of method and apparatus determining virtual-machine drift | |
US20120185529A1 (en) | Application server management system, application server management method, management apparatus, application server and computer program | |
CN108959384B (en) | Webpage data acquisition method and device, computer equipment and storage medium | |
CN109343983B (en) | Information interaction method, device, equipment and storage medium between function modules | |
CN112328301B (en) | Method and device for maintaining consistency of operating environments, storage medium and electronic equipment | |
CN110990008B (en) | Page updating method and device, storage medium and electronic equipment | |
CN112134908B (en) | Application adaptation method, server, medium and vehicle-mounted multimedia system | |
CN114489690A (en) | Distributed system deployment method and device, electronic equipment and storage medium | |
CN112491940B (en) | Request forwarding method and device of proxy server, storage medium and electronic equipment | |
CN115617417A (en) | Micro front-end architecture sub-application management method, device, equipment and storage medium | |
CN112416698B (en) | Expansion method and device of monitoring system, storage medium and electronic equipment | |
CN112182083A (en) | File generation method, device, equipment and storage medium | |
CN112000313A (en) | Request response method, device, equipment and storage medium | |
CN111666596A (en) | Data processing method, device and medium | |
CN117883789B (en) | Data acquisition method, apparatus, device, readable storage medium, and program product | |
CN112015406A (en) | Data processing method, page access method, device, terminal and server | |
CN117827369A (en) | Virtual machine decryption method and device, electronic equipment and storage medium | |
CN117861225A (en) | Virtual prop display method and device, electronic equipment and storage medium | |
CN111124923A (en) | Running state query method and device, server 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 |