CN110196724A - File loading method, terminal, server, computer equipment and storage medium - Google Patents

File loading method, terminal, server, computer equipment and storage medium Download PDF

Info

Publication number
CN110196724A
CN110196724A CN201810939198.8A CN201810939198A CN110196724A CN 110196724 A CN110196724 A CN 110196724A CN 201810939198 A CN201810939198 A CN 201810939198A CN 110196724 A CN110196724 A CN 110196724A
Authority
CN
China
Prior art keywords
file
target
update date
server
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810939198.8A
Other languages
Chinese (zh)
Inventor
吴启
童希望
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810939198.8A priority Critical patent/CN110196724A/en
Publication of CN110196724A publication Critical patent/CN110196724A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

This application discloses a kind of file loading method, terminal, server, computer equipment and storage medium, the js file that server side is newly updated effectively is loaded, so that the function of newly-increased js file can be used effectively.Wherein method part includes: to send the request of js file update date to server, and js file update date requested for the first update date to target js file corresponding to server request feedback target weblication;It receives server and requests the feedback information sent according to js file update date, feedback information includes the first update date of target js file;The update date of target js file is obtained from the local cache of terminal, the update date of the target js file of local cache is as the second update date;Determine whether target js file has update according to the first update date and the second update date;If it is determined that target js file has update, then the target js file updated is obtained from server and loaded.

Description

File loading method, terminal, server, computer equipment and storage medium
Technical field
This application involves computer field more particularly to a kind of file loading method, terminal, server, computer equipments And storage medium.
Background technique
A kind of literal translation formula scripting language of JavaScript, is a kind of regime type, weak type, the language based on prototype, interior Set support type.Its interpreter is referred to as JavaScript engine, is a part of browser, is widely used in the foot of client This language is known as JavaScript file (abbreviation js file) with the file of written in JavaScript.
Wide area network (world wide web, web) application program is that a kind of application program that can be accessed by web is (simple Claim web application), the largest benefit of web application is that user is easy to access application, and user only needs browser and can visit It asks.Above-mentioned web application is usually made of js file namely web application is usually write by JavaScript language.And web system In the above-mentioned web of application in application, it is generally necessary to quoting js file is just able to achieve the corresponding function of js file.
Traditionally, a kind of js file loading method is proposed, in this method implementation procedure, is loaded to js file When, because there is the js file of caching, web system thinks that the js file of buffering is exactly newest js file, so that load has cached Js file, that is to say, that js file that server side newly updates and capable of not being buffered effectively updates, to be easy to cause new The js file of update is not loaded by web system, causes function corresponding to newly-increased js file that can not be used.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of js file that server side can be made newly to update Can effectively load so that the function of newly-increased js file can be used effectively file loading method, terminal, service Device, computer equipment and storage medium.
A kind of file loading method, comprising the following steps: when terminal loads target wide area network web application journey using browser When sequence, the request of js file update date is sent to server, js file update date requests for requesting feedback mesh to server Mark the first update date of target js file corresponding to weblication;Terminal receives server and updates day according to js file The feedback information that phase request is sent, feedback information include the first update date of target js file;Terminal is slow from the local of terminal The update date for obtaining target js file is deposited, the update date of the target js file of local cache is as the second update date;Eventually End determines whether target js file has update according to the first update date and the second update date;If terminal determines target js text Part has update, then terminal obtains the target js file updated from server, and loads the target js of the update obtained from server File.
A kind of terminal, comprising: sending module, for loading target wide area network weblication using browser when terminal When, the request of js file update date is sent to server, js file update date requests for requesting feedback target to server First update date of target js file corresponding to weblication;Receiving module, for receiving server according to transmission mould The js file update date that block is sent requests the feedback information sent, and feedback information includes the first update day of target js file Phase;First obtains module, for obtaining the update date of target js file, the target js of local cache from the local cache of terminal The update date of file is as the second update date;Determining module, for being included according to the received feedback information of receiving module The first update date and first acquisition module obtain the second update date determine whether target js file has update;Second Module is obtained, for if it is determined that module determines that target js file has update, then from the target js file of server acquisition update;Add Module is carried, for loading the target js file of the update obtained from server.
A kind of file loading method, comprising the following steps: the js file update date that server receiving terminal is sent requests, What js file update date sent when requesting as terminal using browser load object web application program, js file update date It requests for the first update date to target js file corresponding to server request feedback target weblication;Service Device is according to the first update date of js file update date request target js file;Server sends feedback letter to terminal Breath, feedback information included the first update date, so that terminal determines mesh according to the first update date and the second update date When mark js file has update, the target js file updated is obtained from server and loads the target js of the update obtained from server File, the update date of the target js file of terminal local caching is as the second update date.
A kind of server, comprising: receiving module, the literal translation formula scripting language js file for receiving terminal transmission update day Phase request, what js file update date sent when requesting as terminal using browser load target wide area network weblication, js The request of file update date for target js file corresponding to server request feedback target weblication first more New date;Module is obtained, for according to the first of the received js file update date request target js file of receiving module Update date;Sending module, for sending feedback information to terminal, feedback information included the first update date, so that terminal When determining that target js file has update according to the first update date and the second update date, the target updated is obtained from server Js file and the target js file for loading the update obtained from server, the update date of the target js file of terminal local caching As the second update date.
A kind of computer equipment, including memory, processor and be stored in the memory and can be on the processor The computer program of operation, the processor realize terminal or server in above-mentioned file loading method when executing the computer program The step of realized.A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter Calculation machine program realizes in above-mentioned file loading method the step of terminal or realized server when being executed by processor.
Thus, when the js file of server side has update, terminal is available and to download to server newest Js file, so that the js file that server side newly updates can effectively be loaded by terminal, so that newly-increased js file Function be used effectively.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below by institute in the description to the embodiment of the present application Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the application Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is an application environment schematic diagram of file loading method in the application;
Fig. 2 is one embodiment flow diagram of file loading method in the application;
Fig. 3 is another embodiment flow diagram of file loading method in the application;
Fig. 4 is one embodiment structural schematic diagram of terminal in the application;
Fig. 5 is another example structure schematic diagram of terminal in the application;
Fig. 6 is one embodiment structural schematic diagram of server in the application;
Another example structure schematic diagram of server in Fig. 7 the application;
Fig. 8 is one embodiment structural schematic diagram of computer equipment in the application;
Fig. 9 is another example structure schematic diagram of computer equipment in the application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on this Shen Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall in the protection scope of this application.
Firstly, when introducing the application, first to environment applied by file loading method provided herein and phase It closes wording to be introduced, file loading method provided by the present application can be applicable in application environment as shown in Figure 1, including clothes Business device, terminal, and can realize the network that server and terminal are communicated.Terminal can be, but not limited to various individual calculus Machine, laptop, smart phone, tablet computer etc., specifically without limitation, in addition, the server can be a server The either server cluster of multiple servers composition realizes that specifically also without limitation, which is to provide one or more The server of a weblication, weblication are a kind of application programs that can be accessed by web, and terminal passes through browsing The accessible weblication of device.And JavaScript is the programming language of weblication, the foot of written in JavaScript Language namely js file are walked, is commonly used to add miscellaneous dynamic function for webpage, provides the clear of more smooth beauty for user It lookes at effect, the corresponding function of weblication is realized by js file.
It is introduced below by the file loading method that embodiment proposes the application, is first retouched from terminal side It states:
In one embodiment, as shown in Fig. 2, providing a kind of file loading method, include the following steps:
S10, when terminal using browser load object web application program when, to server send js file update date Request, js file update date request for feeding back target js corresponding to the object web application program to server request First update date of file;
In the present solution, terminal is equipped with browser, when terminal is using browser load object web application program, to Server sends the request of js file update date.
Wherein, which requests for right to server request feedback target weblication institute First update date of the target js file answered;, wherein first update date is the target js of current server storage The update date of file, the server are to provide the server of the object web application program, which is should One of weblication on server, target js file are the corresponding one of js text of the object web application program Part.
As an example it is assumed that server B for providing weblication A, stores in server B and runs the web application journey The js file 1,2 of sequence A timing reference, when that need to update the function of weblication A, server need to be to weblication A's Js file 1,2 is updated, and is updated every time and have corresponding update date.
S20, terminal receive server and request the feedback information sent according to js file update date, and feedback information includes mesh Mark first update date of js file;
In the present solution, server can be according to the js after server receives above-mentioned js file update date request First update date of file update date request target js file, and sending to the terminal included the first update day The feedback information of phase is to terminal, and terminal can receive the feedback letter that this includes the first update date of target js file Breath.
S30, terminal obtain the update date of target js file, the target js file of local cache from the local cache of terminal Update date as the second update date;
S40, terminal determine whether target js file has update according to the first update date and the second update date;
It is appreciated that receive server feedback include target js file the first update date feedback information Afterwards, terminal device can determine the first update date of target js file by feedback information.And it is updated according to described first Date and the second update date determine whether the target js file has update.
Wherein, the second update date was the update day of the target js file of local cache when terminal device uses browser Phase.
It should be understood that when terminal device uses some weblication of browser execution every time, when successfully loading the web When application program, the js file of the weblication, that is, the js file of local cache, local js would generally be cached at this time For file due to buffered, terminal can be directly obtained the update date of the js file of local cache.
If S50, terminal determine whether target js file has update, terminal obtains the target js file updated from server, And load the target js file of the update obtained from server.
Wherein, in the present solution, being obtained under target js file refers to directly from the server directly from server Carry target js file.
In order to make it easy to understand, carrying out citing description to the above process here, it is assumed that have weblication A, server B, clothes Business device B is to provide the server B of weblication A, and in terminal side, buffering has 1.0 versions of the js file 1,2, and a version is more New date is 2018-5-11, is stored with 1.1 versions of js file 1,2 in server B, the update date of b version is 2018-6- 11, wherein 1.1 versions have increased function newly relative to 1.0 versions.Js file need to be referred to when terminal loads weblication A 1,2.At this point, terminal will be unable to using b version js file in weblication A if being loaded directly into the js file 1,2 of a version 1, function new brought by 2.And in the present solution, terminal is not direct when terminal loads weblication A with browser The js file 1,2 of a version of using terminal side caching, but send js file to server B and update request to determine js text The update date 2018-6-11 of part 1,2, then be compared with the update date 2018-5-11 of the js file 1,2 of local cache, May thereby determine that js file 1,2 has update, then from server B obtain js file 1,2, thus obtain the js file 1 of b version, 2。
In one embodiment, in step S40 namely terminal is true according to first update date and the second update date Whether the fixed target js file has update, however, it is determined that the target js file is without update, then the terminal directly acquires local The target js file of caching is simultaneously loaded.
In order to make it easy to understand, carrying out citing description to the above process here, it is assumed that have weblication A, server B, clothes Business device B is to provide the server B of weblication A, and in terminal side, buffering has 1.0 versions of the js file 1,2, and a version is more New date is 2018-5-11, in server B storage and js file 1,2 1.0 versions, then similarly, obtaining in server B The js file 1 that takes, 2 update dates are also 2018-5-11, at this point, terminal be loaded directly by browser a version js file 1, 2.It can be seen, when the provided object web application program of server does not update, terminal device is not necessarily to from clothes The corresponding js file of device downloading object web application program of being engaged in, is loaded directly into the corresponding js of object web application program of local cache File can effectively reduce the waste of bandwidth resources.
It in one embodiment, further include as follows when terminal loads the object web application program using the browser Step:
S60, terminal determine the file type of the target js file, if the target js file is functionality js file, Then follow the steps S70;
Wherein, the file type of js file is divided into front end basic framework js file and functionality js file two types, In, front end basic framework file is basic document needed for load weblication, and functional js file is to realize web application The js file of the function of program first determines target js before in the present solution, sending the request of js file update date to server The file type of file, when target js file be functionality js file, then follow the steps S70.
S70, the step of sending the request of js file update date to server is triggered.
In the present solution, terminal from the server obtain target js file before, however, it is determined that target js file be function Property js file, then the step of triggering obtains the target js file from the server, change sentence and say, however, it is determined that target js file is Functional js file just executes to send the request of js file update date to server and sent js file update date and requests it Follow-up process afterwards does not repeat specifically to repeat here.
In some embodiments, in step S50, the target js file for the update that terminal loads are obtained from server, comprising: The target js file of the update is loaded using js file loading frame.Specifically, in some schemes, frame is loaded using seajs Frame loads the target js file of above-mentioned update.Seajs loading frame be one kind follow (Common Module Definition, CMD) the loading frame of the JavaScript module standardized, may be implemented the Development of Modular and load mechanism of JavaScript, It is loaded, rapidly the target js file of update can be loaded by js file loading frame, improve loading efficiency.
Specifically, in some embodiments of this programme, using following code realize above-mentioned functionality js file and The process of the target js file of the update is loaded using js file loading frame:
Seajs.config ({ map:[[/ (.*?) pawa-cswaring (.*?) (.js) $/i, " $ 1pawa- Cswaring $ 2.js? version="+regExp]] }) //, wherein seajs.config indicates used js file load Frame namely seajs loading frame, the key of map indicate the js file type for needing to update, and the key assignments expression of map needs to update Document location, that is, " pawa-cswaring " find out from this document folder and meet the target js of regular expression regExp File, and load the target js file of the update.
From the present embodiment as can be seen that since the file type of js file is divided into front end basic framework js file and functionality Js file two types, and front end basic framework js file be in practical applications it is fixed, do not need to update, therefore, can be with The process flow for efficiently reducing terminal, lowers the loss of terminal, to improve whole loading efficiency.
In one embodiment, as shown in figure 3, providing a kind of file loading method, include the following steps:
S100, server receiving terminal send js file update date request, js file update date request for Server requests the first update date of target js file corresponding to feedback target weblication;
Wherein, which requests to send when loading object web application program using browser for the terminal , which requests for requesting to feed back target js corresponding to the object web application program to the server First update date of file, wherein first update date is the update of the target js file of current server storage Date, the server are to provide the server of the object web application program, the object web application program be the server on its In a weblication, target js file be the corresponding one of js file of the object web application program.
S200, server are according to the first update date of js file update date request target js file;
In the present solution, obtain target js file first updates day after receiving js file update date and requesting Phase.As an example it is assumed that object web application program is weblication A, operation weblication A is stored in server Timing reference js file 1,2, when the function of weblication A need to be updated, server need to weblication A js text Part 1,2 is updated, and is updated every time and have corresponding update date.Wherein, update date 2018-5-11 works as service After the js file update date that device receives the first update date for obtaining js file 1,2 of terminal transmission requests, service The update date 2018-5-11 of device acquisition js file 1,2.
S300, server to terminal send feedback information, feedback information include the first update date so that terminal according to When first update date and the second update date determine that target js file has update, the target js text updated is obtained from server Part and the target js file for loading the update obtained from server, the update date conduct of the target js file of terminal local caching Second update date.
As can be seen from the above technical solutions, when there is update, terminal is available and downloads to server update, Namely newest js file, so that the js file that server side newly updates can effectively be loaded by terminal, so that newly The function of the js file of increasing is used effectively.
In one embodiment, step S200 namely server are according to js file update date request target js file The first update date, specifically comprise the following steps:
S201, it is receiving after js file update date requests, server determines the date information expression of target js file Format;
It is appreciated that different js files, the date information expression format of the update date of js file is different, also It is to say, the date information expression format of the update date of target js file also can be different, in application scenes, date information Expression format is specifically as follows: " X1X1X1X1-X2X3-X4X5”、“X1X1X1X1.X2X3.X4X5", or are as follows: " X1X1-X2X3- X3X4”、“X1X1.X2X3.X3X4", wherein X1For any one number of 0-9, X2For any one number of 0-1, work as X2When being 0, X3 For any one number in 1-9, work as X2When being 1, X3For any one number in 0-2;X4For any one number in 0-3, work as X4 When being 0, X5For any one number in 1-9;Work as X4When being 1 or 2, X3For any one number in 0-9;Work as X4When being 3, X5For 0- Any one number in 1.Certainly, other than above-mentioned several date information expression formats, there can also be other date information tables Up to format, such as: " X1X1X1X1-X2X3-X4X5X6X7: X8X9" and " X1X1X1X1-X2X3-X4X5X6X7: X8X9", wherein X1For 0-9 Any one number, X2For any one number of 0-1;Work as X2When being 0, X3For any one number in 1-9;Work as X2When being 1, X3For Any one number in 0-2;X4For any one number in 0-3, work as X4When being 0, X5For any one number in 1-9;Work as X4For When 1 or 2, X3For any one number in 0-9;Work as X4When being 3, X5For any one number in 0-1;X6For any one number of 0-2 Word, X6When being 0 or 1, X7For any one number, X in 0-96When being 2, X7For any one number, X in 0-48It is any in 0-5 One number, X9For any one number in 0-9.In the present solution, server can determine the date letter of target js file Cease expression format.In application scenes, server can be at random by any one of which of above-mentioned date information expression format Date information expression format as target js file.
S202, server are using date information expression format as the matching rule of target regular expression;
Wherein, regular expression describes a kind of mode of string matching, can be used for carrying out text matches, text With the part for referring to that the matching rule for the regular expression found and given in given character string matches.For example, If any such a regular expression: .A=*COMEON [0-9] { 10 }, then it represents that needs find this in text to be matched The character string of sample, the character string are characterized in text to be matched the character string for having a COMEON, follow directly after thereafter Some any numerical character between 10 0-9.In this case, it is assumed that text to be matched are as follows: http: // COMEON201412547.html/~index, " COMEON201412547 " therein are exactly this canonical that can be matched The character string of expression formula.Wherein, in the present solution, in order to search out the character string in target js file including date information, A character string for meeting above-mentioned date information expression format is found, server is using date information expression format as target canonical table Up to the matching rule of formula.
S203, server carry out canonical matching to target js file by target regular expression, to determine to be matched to The character string of matching rule;
S204, server are using the character string as the first update date.
That is, by the regular expression using the date information expression format of target js file as matching rule, service Device can determine the first update date of target js file.As can be seen that the present embodiment, which specifically proposes one kind, passes through canonical Expression formula determines the mode of the first update date of target js file, improves the exploitativeness of the application.
In one embodiment, if the date information expression format of the target js file is X1X1X1X1-X2X3-X4X5, step S203 namely server pass through target regular expression and carry out canonical matching to target js file, specifically include;
Server carries out canonical matching to target js file as target regular expression by following regular expression:
Var reg=/^ [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) $/, In, var reg indicates that target regular expression ,/^ indicate the first symbol of matching string, $/expression matching string Ending symbol, matching string are corresponding character string in target js file, [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) indicate matching rule.
In order to make it easy to understand, above-mentioned target regular expression is carried out an explanation here, wherein/^ indicates character string With starting point;[1-9] d { 3 } expression matches continuous 4 numbers, which can be any one number in 0-9, (0 [1-9] | 1 [0-2]) in vertical bar " | " indicate or the meaning, grouping expression can take any one number of 0-9 or 11-12 any one Number, grouping (0 [1-9] | [1-2] [0-9] | 3 [0-1]) it indicates that any one number of 0-9 or any one number of 10-19 can be taken, or Any one number of 20-29 or any one number of 30-31.In general, the purpose of above-mentioned target regular expression is from target It is looked in js file and meets " X1X1X1X1-X2X3-X4X5" character string, such as: 2018-05-31 is then meeting above-mentioned target just The then matching rule of expression formula.
It should be noted that in addition to this, according to the difference of the date information expression format of target js file, there are also other To target js file carry out regular expression matching mode, specifically without limitation, such as: if the date of target js file Information representation format is X1X1X1X1.X2X3.X4X5, regular expression is carried out to target js file using following regular expression Match:
Var reg=/^ [1-9] d { 3 } (0 [1-9] | 1 [0-2]) (0 [1-9] | [1-2] [0-9] | 3 [0-1]) $/.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
In one embodiment, a kind of terminal, the phase of terminal and the terminal in file loading method in above-described embodiment are provided It is corresponding.As shown in figure 4, the terminal 40 includes sending module 401, the acquisition module 403 of receiving module 402, first, determining module 404, second module 405 and loading module 406 are obtained.Detailed description are as follows for each functional module:
Sending module 401 is used for when terminal is using browser load target wide area network weblication, to server The request of js file update date is sent, js file update date requests for requesting feedback target weblication to server First update date of corresponding target js file;
Receiving module 402 requests to send for receiving server according to the js file update date that sending module 401 is sent Feedback information, feedback information include target js file the first update date;
First obtains module 403, for obtaining the update date of target js file, local cache from the local cache of terminal Target js file update date as the second update date;
Determining module 404, the first update date for being included according to the received feedback information of receiving module 402 and The second update date that first acquisition module 403 obtains determines whether target js file has update;
Second obtains module 405, is used for if it is determined that module 404, determines that target js file has update, then from server acquisition The target js file of update;
Loading module 406, for loading the target js file for the update that the second acquisition module 405 is obtained from server.
In some embodiments, loading module 406 is also used to, however, it is determined that the determining target js file of module 404 is without update, then Load the target js file of local cache.
As shown in figure 5, in some embodiments, terminal further includes trigger module 407;
Determining module 404 is also used to:
When the terminal loads the object web application program using the browser, the text of target js file is determined Part type;
Trigger module 407 is used for if it is determined that module 404 determines that target js file for functionality js file, is then triggered to clothes Business device sends the step of js file update date request.
As can be seen from the above technical solutions, a kind of terminal is proposed here, when the js file of server side has update, Terminal is available and downloads to the newest js file of server, so that the js file that server side newly updates can be by terminal It effectively loads, so that the function of newly-increased js file is used effectively.
In one embodiment, a kind of server, the service in server and above-described embodiment in file loading method are provided Device it is corresponding.As shown in fig. 6, the server 60 includes receiving module 601, obtains module 602 and sending module 401.Each function Detailed description are as follows for energy module:
Receiving module 601, the literal translation formula scripting language js file update date for receiving terminal transmission request, js file Update date request is that terminal is sent when loading target wide area network weblication using browser, js file update date It requests for the first update date to target js file corresponding to server request feedback target weblication;
Module 602 is obtained, for according to 601 received js file update date request target js text of receiving module First update date of part;
Sending module 603, for sending feedback information to terminal, feedback information included the first update date, so that eventually When end determines that the target js file has update according to first update date and the second update date, from the server It obtains the target js file updated and loads the target js file of the update obtained from the server, it is described The update date of the target js file of terminal local caching is as second update date.
As shown in fig. 7, in one embodiment, obtaining module 602 and specifically including determination unit 6021 and matching unit 6022;
Wherein it is determined that unit 6021, for receiving after js file update date asks in receiving module 601, target is determined The date information expression format of js file;Using date information expression format as the matching rule of target regular expression;
Matching unit 6022 carries out canonical matching to target js file by target regular expression, to determine to match To the character string of matching rule;
Determination unit 6021 is also used to using character string as the first update date.
In some embodiments, matching unit 6022 is specifically used for:
Canonical matching is carried out to target js file as target regular expression by following regular expression:
Var reg=/^ [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) $/, In, var reg indicates that target regular expression ,/^ indicate the first symbol of matching string, $/expression matching string Ending symbol, matching string are corresponding character string in target js file, [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) indicate matching rule.
Specific restriction about terminal, server may refer to above for counterpart terminal, clothes in file loading method Business device limits, and details are not described herein.Modules in above-mentioned terminal, server can fully or partially through software, hardware and A combination thereof is realized.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also Be stored in the memory in computer equipment in a software form, in order to which processor calls the above modules of execution corresponding Operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in Figure 8.The computer equipment includes processor, the memory, network interface, display connected by system bus Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The network interface of machine equipment is used to communicate with external server by network connection.When the computer program is executed by processor with Realize the method that terminal is realized in a kind of above-mentioned file loading method.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor, which performs the steps of to work as when executing computer program, utilizes browsing When device loads target wide area network weblication, the request of js file update date is sent to server, js file update date asks It asks for the first update date to target js file corresponding to server request feedback target weblication;Receive clothes Business device requests the feedback information sent according to js file update date, and feedback information includes the first update day of target js file Phase;The update date of target js file is obtained from the local cache of terminal, the update date of the target js file of local cache is made For the second update date;Determine whether target js file has update according to the first update date and the second update date;If really The js file that sets the goal has update, then the target js file updated is obtained from server, and load the update obtained from server Target js file.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program is performed the steps of when being executed by processor when using browser load target wide area network weblication, to clothes Business device sends the request of js file update date, and js file update date requests for applying to server request feedback target web First update date of target js file corresponding to program;It receives server and the anti-of transmission is requested according to js file update date Feedforward information, feedback information include the first update date of target js file;Target js file is obtained from the local cache of terminal Update date, the update date of the target js file of local cache is as the second update date;According to the first update date and Second update date determined whether target js file has update;If it is determined that target js file has update, then obtained more from server New target js file, and load the target js file of the update obtained from server.
It should be noted that the correlative detail in the file loading method that above-mentioned processor is realized, sees aforementioned text The corresponding description in middle terminal side, does not repeat to repeat here in part loading method embodiment.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 9.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is used to store the associated documents of weblication, such as js file.The network interface of the computer equipment is used It is communicated in passing through network connection with external terminal.To realize that a kind of above-mentioned file adds when the computer program is executed by processor The method that server is realized in support method.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor performs the steps of when executing computer program receives terminal hair The js file update date sent requests, and js file update date requests to load object web application program using browser for terminal When send, js file update date requests for target js corresponding to server request feedback target weblication First update date of file;According to the first update date of js file update date request target js file;To terminal Feedback information is sent, feedback information included the first update date, so that terminal is updated according to the first update date and second When date determines that target js file has update, the target js file updated is obtained from server and is loaded from server acquisition more New target js file, the update date of the target js file of terminal local caching is as the second update date.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of reception terminal transmission js file update date when being executed by processor requests, and js file updates Date request is that terminal is sent when loading object web application program using browser, js file update date request for Server requests the first update date of target js file corresponding to feedback target weblication;It is updated according to js file First update date of date request target js file;Feedback information is sent to terminal, feedback information includes the first update Date, so that when terminal determines that target js file has update according to the first update date and the second update date, from service Device obtains the target js file updated and loads the target js file of the update obtained from server, the target of terminal local caching The update date of js file is as the second update date.
It should be noted that the correlative detail in the file loading method that above-mentioned processor is realized, sees aforementioned text The corresponding description of server side, does not repeat to repeat here in part loading method embodiment.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program being somebody's turn to do can be stored in a non-volatile computer can It reads in storage medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, originally Any reference used in each embodiment provided by applying to memory, storage, database or other media, can wrap Include non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (10)

1. a kind of file loading method characterized by comprising
When terminal is using browser load target wide area network weblication, asked to server transmission js file update date It asks, the js file update date request to server request for feeding back corresponding to the object web application program First update date of target js file;
The terminal receives the feedback information that the server is sent according to js file update date request, the feedback letter Breath includes first update date of the target js file;
The terminal obtains the update date of the target js file, the institute of the local cache from the local cache of the terminal The update date of target js file is stated as the second update date;
The terminal determines whether the target js file has update according to first update date and the second update date;
If the terminal determines that the target js file has update, the terminal obtains the mesh updated from the server Js file is marked, and loads the target js file of the update obtained from the server.
2. file loading method as described in claim 1, which is characterized in that if the terminal determine the target js file without It updates, then the target js file of the terminal loads local cache.
3. file loading method as claimed in claim 2, which is characterized in that when the terminal loads institute using the browser When stating object web application program, the method also includes:
The terminal determines the file type of the target js file, if the target js file is functionality js file, touches It is sent to the step of server sends the request of js file update date.
4. a kind of file loading method characterized by comprising
The js file update date that server receiving terminal is sent requests, and the js file update date request is the terminal benefit It is sent when loading object web application program with browser, the js file update date request to the server for asking It negates and presents the first update date of target js file corresponding to the object web application program;
First update date of server target js file according to the js file update date request;
The server sends feedback information to the terminal, and the feedback information includes first update date, so that When the terminal determines that the target js file has update according to first update date and the second update date, from described The target js text that server obtains the target js file updated and loads the update obtained from the server Part, the update date of the target js file of the terminal local caching is as second update date.
5. file loading method as claimed in claim 4, which is characterized in that the server updates day according to the js file First update date of target js file described in phase request, comprising:
After receiving the js file update date request, the server determines the date information table of the target js file Up to format;
The server is using the date information expression format as the matching rule of target regular expression;
The server carries out canonical matching to the target js file by the target regular expression, to determine to match To the character string of the matching rule;
The server is using the character string as first update date.
6. file loading method as claimed in claim 5, which is characterized in that if the date information of the target js file is expressed Format is X1X1X1X1.X2X3.X4X5, the server by the target regular expression to the target js file carry out just Then match, comprising:
The server carries out just the target js file as the target regular expression by following regular expression Then match:
Var reg=/^ [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) $/, wherein The var reg indicates that the target regular expression, described/^ indicate the first symbol of matching string, the $/expression The matching string ending symbol, the matching string is corresponding character string in the target js file, described [1-9] d { 3 }-(0 [1-9] | 1 [0-2])-(0 [1-9] | [1-2] [0-9] | 3 [0-1]) indicate the matching rule.
7. a kind of terminal characterized by comprising
Sending module, for being sent to server when the terminal is using browser load target wide area network weblication Js file update date requests, and the js file update date request is for feeding back the target web to server request First update date of target js file corresponding to application program;
Receiving module, the js file update date request hair sent for receiving the server according to the sending module The feedback information sent, the feedback information include first update date of the target js file;
First obtains module, for obtaining the update date of the target js file from the local cache of the terminal, described The update date of the target js file of ground caching is as the second update date;
Determining module, first update date for being included according to the received feedback information of the receiving module with And second update date that the first acquisition module obtains determines whether the target js file has update;
Second acquisition module obtains if determining that the target js file has update for the determining module from the server Take the target js file of update;
Loading module, for loading the target js of the update obtained from the second acquisition module from the server File.
8. a kind of server characterized by comprising
Receiving module, the literal translation formula scripting language js file update date for receiving terminal transmission request, and the js file is more New date is sent when requesting the terminal using browser load target wide area network weblication, and the js file is more New date request is for feeding back first of target js file corresponding to the object web application program to server request Update date;
Module is obtained, for the text of the target js according to the receiving module received js file update date request First update date of part;
Sending module, for sending feedback information to the terminal, the feedback information includes first update date, so that Terminal when determining that the target js file has update according to first update date and the second update date, from institute Server is stated to obtain the target js file updated and load the target js of the update obtained from the server File, the update date of the target js file of the terminal local caching is as second update date.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 6 file loading method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In the step of realization file loading method as described in any one of claim 1 to 6 when the computer program is executed by processor Suddenly.
CN201810939198.8A 2018-08-17 2018-08-17 File loading method, terminal, server, computer equipment and storage medium Pending CN110196724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810939198.8A CN110196724A (en) 2018-08-17 2018-08-17 File loading method, terminal, server, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810939198.8A CN110196724A (en) 2018-08-17 2018-08-17 File loading method, terminal, server, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110196724A true CN110196724A (en) 2019-09-03

Family

ID=67751397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810939198.8A Pending CN110196724A (en) 2018-08-17 2018-08-17 File loading method, terminal, server, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110196724A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988208A (en) * 2019-12-18 2021-06-18 腾讯科技(深圳)有限公司 Data updating method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102109989A (en) * 2009-12-29 2011-06-29 阿里巴巴集团控股有限公司 Method, device and system for controlling browser cache
CN103763340A (en) * 2013-12-24 2014-04-30 杭州华三通信技术有限公司 Web access optimizing device and method
CN104519081A (en) * 2013-09-27 2015-04-15 阿里巴巴集团控股有限公司 Page access method and device
CN107301051A (en) * 2017-06-27 2017-10-27 深圳市金立通信设备有限公司 The caching of terminal dynamic data and exchange method, terminal, system and computer-readable recording medium
CN107590145A (en) * 2016-07-06 2018-01-16 北京神州泰岳软件股份有限公司 A kind for the treatment of method and apparatus of page static resource

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102109989A (en) * 2009-12-29 2011-06-29 阿里巴巴集团控股有限公司 Method, device and system for controlling browser cache
CN104519081A (en) * 2013-09-27 2015-04-15 阿里巴巴集团控股有限公司 Page access method and device
CN103763340A (en) * 2013-12-24 2014-04-30 杭州华三通信技术有限公司 Web access optimizing device and method
CN107590145A (en) * 2016-07-06 2018-01-16 北京神州泰岳软件股份有限公司 A kind for the treatment of method and apparatus of page static resource
CN107301051A (en) * 2017-06-27 2017-10-27 深圳市金立通信设备有限公司 The caching of terminal dynamic data and exchange method, terminal, system and computer-readable recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988208A (en) * 2019-12-18 2021-06-18 腾讯科技(深圳)有限公司 Data updating method, device, equipment and storage medium
CN112988208B (en) * 2019-12-18 2023-06-30 腾讯科技(深圳)有限公司 Data updating method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112073405B (en) Webpage data loading method and device, computer equipment and storage medium
CN100535900C (en) Method and system for rendering asynchronous portal page
US9690568B2 (en) Client-side script bundle management system
CN109582899A (en) Page loading method, device, computer equipment and storage medium
CN110083383A (en) Browser style compatibility method, device, computer equipment and storage medium
US20050070259A1 (en) Method and system for accessing applications and data, and for tracking of key indicators on mobile handheld devices
CN108287839A (en) A kind of page loading method and equipment
US20140006487A1 (en) Methods for making ajax web applications bookmarkable and crawable and devices thereof
US20150188999A1 (en) System and method to extend the capabilities of a web browser to improve the web application performance
CN101799821B (en) Method and system for realizing webpage application by widget
CN108491367A (en) Method, apparatus, computer equipment and the storage medium that report file generates
CN107301137A (en) RSET interface realizing methods and device and electronic equipment and computer-readable recording medium
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN103634393A (en) IVR (interactive voice response) and realization method thereof
CN109819014B (en) Project deployment method and device, computer equipment and storage medium
CN102156697A (en) Method and terminal equipment for realizing webpage application through widget
CN110196724A (en) File loading method, terminal, server, computer equipment and storage medium
CN103347069A (en) Method and device for realizing network access
CN112926002A (en) Service request processing method and device
CN111767053A (en) Front-end page data acquisition method and device
CN110472169A (en) Cached configuration method, apparatus, computer equipment and storage medium
CN113449216A (en) File processing method and device and storage medium
CN116208676A (en) Data back-source method, device, computer equipment, storage medium and program product
CN106254411A (en) For providing the system of service, server system and method
CN107103001B (en) Method, device and system for acquiring target front-end resource file based on browser

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