CN104253783A - Web application realization code loading method, device, system and server - Google Patents

Web application realization code loading method, device, system and server Download PDF

Info

Publication number
CN104253783A
CN104253783A CN201310256285.0A CN201310256285A CN104253783A CN 104253783 A CN104253783 A CN 104253783A CN 201310256285 A CN201310256285 A CN 201310256285A CN 104253783 A CN104253783 A CN 104253783A
Authority
CN
China
Prior art keywords
code
request
client terminal
page
attribute
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
CN201310256285.0A
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.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201310256285.0A priority Critical patent/CN104253783A/en
Publication of CN104253783A publication Critical patent/CN104253783A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a web application realization code loading method, a device, a system and a server. The method comprises steps that: a client sends a page access request to the server; the server returns a request page to the client, and the request page comprises a request code of a realization code used for requesting loading a web application; the client receives and loads the request page returned by the server, the request code operates, and a loading request of the realization code used for requesting loading the web application is sent to the server; the server returns the realization coder of the web application to the client, and the client receives and loads the realization coder of the web application returned by the server. The method solves a problem of a low loading speed when a page embedded with the realization coder of the web application is loaded in the prior art. The method relates to the network communication field.

Description

Web application code loading method, device, system and server
Technical field
The present invention relates to network communication technology field, particularly relate to web application code loading method, device, system and server.
Background technology
Network (Web) application is a kind of application can accessed by web, and compared with traditional application, web application can have following characteristics:
First, web application is general based on browser/server (B/S) pattern, uses this web of browser execution apply, and do not need other softwares (traditional application needs are for this tradition application mounting software) that installation is applied for this web;
Secondly, after the web server that provides web apply processes the related data in web application, by the result generating web page after processing, the browser returning to client shows.And usually, because web application shows in the form of a web page, web application entrance can be made to be arranged in portal page, and user needs first to open this portal page, is conducted interviews to this web application by the web application entrance in portal page.
Further, in webpage, page-describing information can be comprised, the code (such as, JavaScript code) that needs are run by browser-interpreted can also be comprised.This code did not need the compiling through server before mailing to browser execution from server, but the character code of text formatting is sent to browser, was run by browser-interpreted.In prior art, the code (can be realized by JavaScript code) of usual embedded web application in above-mentioned portal page, so, the code that this web applies can be loaded when browser loads this portal page, when browser receives the instruction by web application entrance access web application that user sends, run the code that this web applies, realize the access to web application.
Be applied as example with the real time communication (RTCWeb, Real-Time Communications Web) based on web, the flow process that client is applied by browser access RTCWeb can comprise the steps:
Step 1, user end to server send entrance accessing page request;
Step 2, server return entrance requests for page to client, comprise the code of RTCWeb application entrance and RTCWeb application in this entry request page;
Step 3, client, by the RTCWeb application entrance in portal page, conduct interviews to RTCWeb application.
But, in prior art, for the embedded webpage of code, because code embedded in this webpage may relate to the dynamic change of webpage when showing, for guaranteeing correctly presenting of webpage, during browser Web page loading, first can load embedded code in the web page, and in loading procedure, block the loading of other elements in this webpage.Therefore, in above-mentioned steps 2, browser load RTCWeb application code process in, by the loading of other elements in block inlet ports requests for page, after the code loaded of RTCWeb application, reload other elements in the entry request page.
Further, browser, when running the code be embedded in webpage, needs to provide corresponding application programming interface (API, Application Programming Interface) function.Example is applied as with RTCWeb, the code of RTCWeb application operationally, need to call client local device (such as: microphone, make a video recording first-class), different browsers provides different API to realize this function, such as, the API calling local device that Google (chrome) browser provides is webkitGetUserMedia, and the API calling local device that red fox leopard cat (Firefox) browser provides is mozGetUserMedia, and IE browser does not support that RTCWEB applies.In addition, the function calling client local device that the different editions of same browser provides is also different, such as, version is in the Chrome browser of 23.0.1271.97, the API calling client local device is webkitGetUserMedia, in Chrome browser before this version, the API calling client local device is PeerConnection00 and DeprecatedPeerConnection.
Therefore, in the code of RTCWeb application, the different editions needing to comprise for various types of browser and often kind of browser realizes the code of RTCWeb application, make the browser receiving RTCWeb code, according to self type and version number, the RTCWeb code of self correspondence is selected to run.Therefore, in prior art, the code volume of RTCWeb application is very large, again as previously mentioned, browser is in the process of code loading RTCWeb application, by the download of other elements in block inlet ports requests for page, make the loading velocity of the entry request page slow, reduce the efficiency of user's access entrance requests for page.
Summary of the invention
Embodiments provide web application code loading method, device, system and server, in order to solve in prior art, when loading comprises the requests for page of RTCWeb application entrance, the problem that loading velocity is slow.
Based on the problems referred to above, a kind of web application code loading method that the embodiment of the present invention provides, is applied to server side, comprises:
Receive the accessing page request that client sends;
Requests for page is returned to described client, wherein, request code is comprised in the described request page, described request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server;
Receive the load request of the code of the described web application that client sends;
Returning to described client the code that described web applies, completing loading to described code for making described client.
A kind of web application code loading method that the embodiment of the present invention provides, is applied to client-side, comprises:
Accessing page request is sent to server;
Receive and load the requests for page that described server returns, wherein, in the described request page, comprising request code;
Run described request code, send the load request of the code that described web applies to described server;
Receive and load the code of the described web application that described server returns.
One of a kind of web application code charger that the embodiment of the present invention provides, comprising:
First receiver module, for receiving the accessing page request that client sends;
First sending module, for returning requests for page to described client, wherein, request code is comprised in the described request page, described request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server;
Second receiver module, for receiving the load request of the code of the described web application that client sends;
Second sending module, for returning the code that described web applies to described client, completes loading to described code for making described client.
A kind of web application code charger two that the embodiment of the present invention provides, comprising:
First sending module, for sending accessing page request to server;
First load-on module, for receiving and loading the requests for page that described server returns, wherein, comprises request code in the described request page;
Second sending module, for running described request code, sends the load request of the code that described web applies to described server;
Second load-on module, for receiving and loading the code of the described web application that described server returns.
The server that the embodiment of the present invention provides, comprises one of above-mentioned web application code charger that the embodiment of the present invention provides.
The web application code loading system that the embodiment of the present invention provides, comprising: server and client side;
Described server, for receiving the accessing page request that client sends; Return requests for page to described client, wherein, in the described request page, comprise the request code of the code for request of loading web application; The load request of the code of web application described in the request of loading that reception client sends; The code of described web application is returned to described client;
Described client, for sending accessing page request to server; Receive and load the requests for page that described server returns; Run described request code, send request the load request of the code loading described web application to described server; Receive and load the code of the described web application that described server returns.
The beneficial effect of the embodiment of the present invention comprises:
Web application code loading method, device, system and server that the embodiment of the present invention provides, user end to server sends accessing page request; Server returns requests for page to client, wherein, comprises the request code of the code for request of loading web application in requests for page; Client receives the requests for page that also load server returns, and runs request code, sends request the load request of the code loading web application to server; Server returns the code of web application to client, and client receives the code of the web application that also load server returns.In the requests for page that server returns to client, do not comprise the code of web application, but comprise the request code of the code for request of loading web application, after the client load request page is complete, rerun this request code, the load request of the code loading web application is sent request to server, receive the code of the web application that also load server returns, with prior art, the code that in requests for page, embedded huge web applies, client is made to need the code first loading this web application to compare when the load request page, client does not need the code loading web application when loading and comprising the requests for page of RTCWeb application entrance, improve the loading velocity of requests for page, for the user of the access request page, improve the access efficiency to this requests for page.
Accompanying drawing explanation
One of flow chart of a kind of web application code loading method that Fig. 1 provides for the embodiment of the present invention;
The flow chart two of a kind of web application code loading method that Fig. 2 provides for the embodiment of the present invention;
The flow chart of a kind of web application code loading method that Fig. 3 provides for the embodiment of the present invention one;
The flow chart of a kind of web application code loading method that Fig. 4 provides for the embodiment of the present invention two;
The flow chart of a kind of web application code loading method that Fig. 5 provides for the embodiment of the present invention three;
The flow chart of a kind of web application code loading method that Fig. 6 provides for the embodiment of the present invention four;
The flow chart of a kind of web application code loading method that Fig. 7 provides for the embodiment of the present invention five;
The flow chart of a kind of web application code loading method that Fig. 8 provides for the embodiment of the present invention six;
The flow chart of a kind of web application code loading method that Fig. 9 provides for the embodiment of the present invention seven;
The structural representation of one of a kind of web application code charger that Figure 10 provides for the embodiment of the present invention;
The structural representation of a kind of web application code charger two that Figure 11 provides for the embodiment of the present invention.
Embodiment
Embodiments provide web application code loading method, device, system and server, below in conjunction with Figure of description, the preferred embodiments of the present invention are described, be to be understood that, preferred embodiment described herein, only for instruction and explanation of the present invention, is not intended to limit the present invention.And when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
The embodiment of the present invention provides a kind of web application code loading method, is applied to server side, as shown in Figure 1, comprises:
The accessing page request that S101, reception client send.
S102, return requests for page to client, wherein, request code is comprised in requests for page, this request code is used for being supplied to above-mentioned client, run after the above-mentioned requests for page of loading, and the result running above-mentioned request code is the load request sending the code that above-mentioned web applies to server.
The load request of the code that S103, the above-mentioned web receiving client transmission apply.
S104, returning the code of web application to client, completing loading to code for making client.
In the embodiment of the present invention, client can for carrying out communicating with web server and show the software of the webpage that web server returns, such as browser.
Further, in above-mentioned steps S102, the access entrance of web application in requests for page, can be comprised, but not comprise the code of this web application, therefore, it is possible to accelerate the loading velocity of this requests for page, improve the access efficiency of user; Also comprise the request code of the code for request of loading web application in requests for page, this request code automatically runs after the client load request page, or triggers operation when receiving the instruction of the access web application that user sends.
Corresponding to method shown in above-mentioned Fig. 1, the embodiment of the present invention also provides a kind of web application code loading method, is applied to client-side, as shown in Figure 2, comprises:
S201, to server send accessing page request.
S202, to receive and the requests for page that returns of load server, wherein, in this requests for page, comprise request code.
S203, operation request code, send the load request of the code of web application to server.
The code that S204, the reception web that also load server returns applies.
Below in conjunction with accompanying drawing, with specific embodiment, method provided by the invention, device, system and server are described in detail.
Embodiment 1:
In the embodiment of the present invention 1, a kind of web application code loading method is provided, is applied to server side, as shown in Figure 3, specifically comprises the steps:
The accessing page request that S301, reception client send.
S302, requests for page is returned to client, wherein, request code is comprised in requests for page, this request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server, detection of attribute code is also comprised in requests for page, this detection of attribute code is used for being supplied to described client, after the loading described request page, run before running described request code, and the result running described detection of attribute code is for obtaining client terminal attribute.
Further, in this step, detection of attribute code automatically can run after the client load request page, obtains client terminal attribute.And automatically request code can be run after operation detection of attribute code.
The load request of the code that S303, the above-mentioned web receiving client transmission apply, carries client terminal attribute in this load request.
S304, from load request, obtain client terminal attribute.
S305, according to client terminal attribute, determine the code of corresponding with client terminal attribute web application.
Further, client terminal attribute can comprise title and the version number of browser, because the developer of web application does not know which kind of browser is client be in advance, and the browser of which version, therefore, in prior art, in the code of RTCWeb application, need to comprise the code of the RTCWeb application that the different editions for various types of browser and often kind of browser realizes, the code volume that RTCWeb is applied is very large, in embodiment provided by the invention, the detection of attribute code for detecting client terminal attribute is comprised in the requests for page sending to client, and after client loads this requests for page, run detection of attribute code, detect client terminal attribute, this client terminal attribute is carried in the load request sending to server, server is according to client terminal attribute, select the code of the web application corresponding with client terminal attribute.Such as, it is Chrome browser that detection of attribute code detection goes out client, and version number is 23.0.1271.97, this attribute information is carried in load request, server is according to this client terminal attribute, determine that version number is the code of the web application that the Chrome browser of 23.0.1271.97 is corresponding, the detection of code detecting client terminal attribute is separated with the code that web applies, send to the web application code volume of client little, accelerate the loading velocity of the code of web application.
S306, returning the code of web application to client, completing loading to code for making client.
Further, in this step, if server does not find the code of the web application corresponding with client terminal attribute, the code of the web application of flash plug-in component operation then can be passed back through to client, make client by flash plug-in unit access web application, or error message can be returned to client.
Embodiment 2:
Corresponding to method shown in above-mentioned Fig. 3, the embodiment of the present invention also provides a kind of web application code loading method, is applied to client-side, as shown in Figure 4, specifically comprises the steps:
S401, to server send accessing page request.
S402, to receive and the requests for page that returns of load server, wherein, in this requests for page, comprise request code, in this requests for page, also comprise detection of attribute code.
S403, operation detection of attribute code, obtain client terminal attribute.
In this step, can automatically run this detection of attribute code after the load request page, obtain client terminal attribute.
S404, operation request code, send the load request of the code of the web application comprising client terminal attribute to server.
The code that S405, the reception web that also load server returns applies.
In this step, the code of the web application received, for the code applied for the web of client terminal attribute, with prior art, in the code of the RTCWeb application received, the code that the different editions comprised for various types of browser and often kind of browser realizes RTCWeb application is compared, and the code volume of web application is less, makes loading velocity faster.
Embodiment 3:
In the embodiment of the present invention 3, a kind of web application code loading method is provided, is applied to server side, as shown in Figure 5, specifically comprises the steps:
The accessing page request that S501, reception client send.
S502, requests for page is returned to client, wherein, request code is comprised in requests for page, this request code is used for being supplied to described client, run after the above-mentioned requests for page of loading, and the result running above-mentioned request code is the load request sending the code that above-mentioned web applies to server, detection of attribute code is also comprised in requests for page, this detection of attribute code is used for being supplied to above-mentioned client, after the instruction receiving the described web application of access that user sends from above-mentioned requests for page, run before running above-mentioned request code, and the result running above-mentioned detection of attribute code is for obtaining client terminal attribute.
Further, in this step, detection of attribute code can after the client load request page, the instruction triggers sent by user performs, such as, after user sends the instruction of access web application, detect client terminal attribute, obtain client terminal attribute, and then run above-mentioned request code.
The load request of the code that S503, the web receiving client transmission apply, carries client terminal attribute in this load request.
S504, from load request, obtain client terminal attribute.
S505, according to client terminal attribute, determine the code of corresponding with client terminal attribute web application.
Further, client terminal attribute can comprise the title of client and/or the version number of client; When client terminal attribute is the title of client, according to the corresponding relation between the code that title and the described web of client apply, determine the code that the web corresponding with the title of client applies; When client terminal attribute is the version number of client, according to the corresponding relation between the code that version number and the described web of client apply, determine the code that the web corresponding with the version number of client applies; When client terminal attribute is title and the version number of client, according to the corresponding relation between the code that the title of client and version number and described web apply, determine the code that the web corresponding with the title of client and version number applies.
S506, returning the code of web application to client, completing loading to code for making client.
Embodiment 4:
Corresponding to method shown in above-mentioned Fig. 5, the embodiment of the present invention also provides a kind of web application code loading method, is applied to client-side, as shown in Figure 6, specifically comprises the steps:
S601, to server send accessing page request.
S602, to receive and the requests for page that returns of load server, wherein, in this requests for page, comprise request code, in this requests for page, also comprise detection of attribute code.
The instruction that S603, the access web receiving user's transmission apply.
Further, in this step, when receiving the instruction of the access web application that user sends, follow-up step can be performed, namely running detection of attribute code, carrying out the detection of client terminal attribute.In requests for page, the access entrance of web application can be various ways, such as, can be the link of web application, so, user can send the instruction of accessing web application by clicking this link to client, or the access entrance of web application is the subpage frame in requests for page, so, user directly can input relevant authentication information in subpage frame, is sent the instruction of access web application by button click to client.
S604, operation detection of attribute code, obtain client terminal attribute.
Further, in this step, the operation of the instruction triggers detection of attribute code that the access web that can send by receiving user applies.
S605, operation request code, send the load request of the code of the web application comprising client terminal attribute to server.
The code that S606, the reception web that also load server returns applies.
Embodiment 5:
In the embodiment of the present invention 5, a kind of web application code loading method is provided, is applied to server side, as shown in Figure 7, specifically comprises the steps:
The accessing page request that S701, reception client send.
S702, return requests for page to client, wherein, request code is comprised in requests for page, detection of attribute code is also comprised in this requests for page, small-size text file (cookie) detection of code is also comprised in this requests for page, this cookie detection of code is used for being supplied to described client, after the above-mentioned requests for page of loading, run before running above-mentioned detection of attribute code, and the result running above-mentioned cookie detection of code is detect client whether to preserve the cookie information characterizing client terminal attribute.
The load request of the code that S703, the web receiving client transmission apply, carries client terminal attribute in this load request.
S704, determine whether to comprise in load request the cookie information characterizing client terminal attribute, and this cookie information is not out of date, if not, enters step S705, if so, enters step S706.
S705, from load request, except carrying cookie information territory except part, obtain client terminal attribute.Enter step S707.
In this step, determining in described load request, in the territory of carrying cookie information, do not comprising the cookie information characterizing described client terminal attribute; Or, determine in described load request, in the territory of carrying cookie information, comprise the cookie information characterizing described client terminal attribute, and execution when described cookie information is expired.
Further, in this step, client terminal attribute information by other territories carrying in load request, or can be carried by content (body as the http protocol) part that load request is carried.
S706, to carry from load request in the territory of cookie information, obtain client terminal attribute.
In this step, when determining in described load request, in the territory of carrying cookie information, comprising the cookie information characterizing described client terminal attribute, and performing this step when described cookie information is not out of date.
S707, according to client terminal attribute, determine the code of corresponding with client terminal attribute web application.
S708, returning the code of web application to client, completing loading to code for making client.
Embodiment 6:
Corresponding to method shown in above-mentioned Fig. 7, the embodiment of the present invention also provides a kind of web application code loading method, is applied to client-side, as shown in Figure 8, specifically comprises the steps:
S801, to server send accessing page request.
S802, to receive and the requests for page that returns of load server, wherein, in this requests for page, comprise request code, in this requests for page, also comprise detection of attribute code, in this requests for page, also comprise cookie detection of code.
S803, operation cookie detection of code, determine whether client saves the cookie information characterizing client terminal attribute, if not, then enters step S804, if so, then enters step S807.
Further, in this step, running cookie detection of code can be automatic operation, also can trigger after client receives the instruction of the access web application that user sends and run.
S804, operation detection of attribute code, obtain client terminal attribute.
Further, this step, when running cookie detection of code, when determining that client does not preserve the cookie information characterizing client terminal attribute, is run detection of attribute code, is detected client terminal attribute;
Further, in this step, running detection of attribute code can be automatic operation, also can trigger after user sends the instruction of access web application and run.That is, when sending the operation of operation or the detection of attribute code of accessing the instruction triggers cookie detection of code that web applies by user to client, in above-mentioned steps S803 and S804, execution sequence can be: automatically run cookie detection of code, receive the instruction of the access web application that user sends, run detection of attribute code; Or, receiving the instruction that the access web for sending applies, running cookie detection of code, run detection of attribute code.
S805, establishment cookie preserve client terminal attribute.
Further, this step does not have sequencing with the execution of step S806, can first perform step S805 and perform step S806 again, can first perform step S806 yet and perform step S805 again.
Further, can not this step being performed, so always can obtain client terminal attribute by running detection of attribute code.
S806, operation request code, send the load request of the code of the web application comprising client terminal attribute to server.Enter step S809.
S807, acquisition cookie information.
This step, when running cookie detection of code, is determined that client preserves the cookie information characterizing client terminal attribute, is obtained this cookie information.
S808, operation request code, send the load request of the code of the web application comprising cookie information to server.
In this step, server receives the load request that client sends, and can obtain client terminal attribute from the cookie information characterizing client terminal attribute.
The code that S809, the reception web that also load server returns applies.
Embodiment 7:
The embodiment of the present invention also provides a kind of web application code loading method, is applied to server side and client-side, as shown in Figure 9, specifically comprises the steps:
S901, client send accessing page request to third-party server.
Further, in this step, to dynamic web page, can by coming to send accessing page request to third-party server in the address field input page network address (such as: total.jsp) of browser, for static Web page, can by coming to send accessing page request to third-party server in the address field input page network address (such as: total.html) of browser.
Further, receive the server of accessing page request, it can be third-party server, also can for providing the server of web application service, that is, the entrance of web application access can be provided, and the code providing web to apply by web application server, the code that also not only the entrance of web application access can be provided but also provide web to apply by web application server by third-party server.
S902, third-party server receive the accessing page request that client sends, and return requests for page, wherein, comprise request code in requests for page to client, and detection of attribute code.
Further, in this step, the interface comprising this requests for page in the requests for page that third-party server returns presents the entrance of information and access web application, the code of not embedded web application.That is, the code of web application can be separated with the requests for page that third-party server returns, when upgrade when needing the code applied web or optimization etc. is revised, do not need to upgrade the related content of third-party server, the use that web is applied more flexibly, conveniently, and for only needing the access request page, and do not need the user accessing web application, when loading this requests for page, owing to not comprising the code of web application in requests for page, make requests for page loading velocity fast, improve the access efficiency of user.
Further, for dynamic web page, the page request that third-party server can be sent by response object customer in response end, for static Web page, third-party server listens to the access request of client, can respond this page request by XMLHttpRequest.
S903, client receive the requests for page that also loading third-party server returns, and run detection of attribute code, obtain client terminal attribute.
Further, for dynamic web page and static Web page, client can by calling navigator.appVersion and navigator.appName, and the return value obtained judges version number and the title of client browser.
For dynamic web page, after detecting client terminal attribute, cookie can be created to preserve title and the version number of browser, and be added into the response object in step S902, as:
Cookie browsername=new Cookie (" Browsername ", browser); This statement creates the title that cookie preserves browser;
Cookie browserversion=new Cookie (" Browserversion ", browserversion); This statement creates the version number that cookie preserves browser;
Response.addCookie (browsername); The title of browser is added into response object by this statement;
Response.addCookie (browserversion); The version number of browser is added into response object by this statement.
S904, client run request code, send the load request of the code of the web application comprising client terminal attribute to web application server.
In this step, the server in server and step S901 ~ S903 can be same server, and also can be different servers, such as, the server in step S901 ~ S903 also can for providing the server of web application service.
Further, for static Web page, the title of browser and version number by websocket and server communication, can be sent to web application server by browser, such as:
Var browsername=navigator.appVersion (); This statement obtains browser version number;
Var browserversion=navigator.appName (); This statement obtains browser title;
WebSocket websocket=new WebSocket (hostURL); The newly-built winsocket of this statement;
websocket.onmessage=function(msg){
websocket.send(browsername+browserversion);
The title of browser and version number send to web application server by this statement.
S905, web application server receives the load request of the code of the web application that client sends, and from this load request, obtains client terminal attribute.
In this step, to dynamic web page, web application server can obtain browser title and version number by following statement:
To static Web page, web application server can obtain title and the version number of client browser by the onmessage method of WebSocket object, such as:
S906, web application server, according to client terminal attribute, determines the code of the web application corresponding with client terminal attribute.
S907, web application server returns the code of web application to client.
S908, client receive and load the code of the web application that web application server returns.
In this step, client just can be accessed this web after loading the code of the web application that web application server returns and be applied.Such as, for RTCWeb application, after this step performs, the real time communication that browser can be undertaken based on browser by RTC gateway and other browsers.
Based on same inventive concept, the embodiment of the present invention additionally provides web application code charger, system and server, the principle of dealing with problems due to these devices, system and server is similar to aforementioned web application code loading method, therefore the enforcement of this device, system and server see the enforcement of preceding method, can repeat part and repeats no more.
The embodiment of the present invention provides one of a kind of web application code charger, as shown in Figure 10, comprises as lower module:
First receiver module 1001, for receiving the accessing page request that client sends;
First sending module 1002, for returning requests for page to described client, wherein, request code is comprised in the described request page, described request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server;
Second receiver module 1003, for receiving the load request of code of web application described in request of loading that client sends;
Second sending module 1004, for returning the code that described web applies to described client, completes loading to described code for making described client.
Further, detection of attribute code is also comprised in the described request page that described first sending module 1002 sends, described detection of attribute code is used for being supplied to described client, after the loading described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in the described load request that described second receiver module receives;
Described device, also comprises: acquisition module 1005, for before the code returning described web application to described client, from described load request, obtains described client terminal attribute;
Determination module 1006, for according to described client terminal attribute, determines the code that the described web corresponding with described client terminal attribute applies.
Further, detection of attribute code is also comprised in the described request page that described first sending module 1002 sends, described detection of attribute code is used for being supplied to described client, after the instruction receiving the described web application of access that user sends from the described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in the described load request that described second receiver module receives;
Described device, also comprises: acquisition module 1005, for before the code returning described web application to described client, from described load request, obtains described client terminal attribute;
Determination module 1006, for according to described client terminal attribute, determines the code that the described web corresponding with described client terminal attribute applies.
Further, cookie detection of code is also comprised in the described request page that described first sending module 1002 sends, described cookie detection of code is used for being supplied to described client, after the loading described request page, run before running described detection of attribute code, and the result running described cookie detection of code is detect described client whether to preserve the cookie information characterizing described client terminal attribute;
Described acquisition module 1005, determines not comprise the cookie information characterizing described client terminal attribute in described load request specifically for working as; Or when determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is expired, from described load request, except the part except the territory of the described cookie information of carrying, obtain described client terminal attribute.
Further, described acquisition module 1005 is also for according to described client terminal attribute, before determining the code that the described web corresponding with described client terminal attribute applies, when determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is not out of date, carry in the territory of described cookie information from described load request, obtain described client terminal attribute.
Further, described determination module 1006, specifically for when described client terminal attribute is the title of described client, according to the corresponding relation between the code that title and the described web of described client apply, determine the code that the described web corresponding with the title of described client applies; Or
When described client terminal attribute is the version number of described client, according to the corresponding relation between the code that version number and the described web of described client apply, determine the code that the described web corresponding with the version of described client applies; Or
When described client terminal attribute is title and the version number of described client, according to the corresponding relation between the code that the title of described client and version number and described web apply, determine the code that the described web corresponding with the title of described client and version applies.
The embodiment of the present invention provides a kind of web application code charger two, as shown in figure 11, comprises as lower module:
First sending module 1101, for sending accessing page request to server;
First load-on module 1102, for receiving and loading the requests for page that described server returns, wherein, comprises request code in the described request page;
Second sending module 1103, for running described request code, sends the load request of the code of web application to described server;
Second load-on module 1104, for receiving and loading the code of the described web application that described server returns.
Further, in the described request page that described first load-on module 1102 receives, also comprise detection of attribute code,
Described device, also comprises: detection of attribute module 1105, for after loading the requests for page that returns of described server, and before running described request code, runs described detection of attribute code, obtains client terminal attribute;
Described second sending module 1103, specifically for running described request code, sends the load request of the code of the described web application comprising described client terminal attribute to described server.
Further, said apparatus, also comprises: command reception module 1106, for after loading the requests for page that returns of described server, and before running described detection of code, receives the instruction of the described web application of access that user sends.
Further, cookie detection of code is also comprised in the described request page that described first load-on module 1102 receives;
Described detection of attribute module, specifically for when running described cookie detection of code, when determining that described client does not preserve the cookie information characterizing described client terminal attribute, running described detection of attribute code, detecting described client terminal attribute;
Described device, also comprises:
Cookie creation module 1107, for running described detection of attribute code, after detecting described client terminal attribute, creating cookie and preserving described client terminal attribute.
Further, said apparatus, also comprise: cookie acquisition module 1108, for to receive and before loading the code of the described web application that described server returns, when the described cookie detection of code of operation, determine that described client preserves the cookie information characterizing described client terminal attribute, obtain described cookie information;
Described second sending module 1103, specifically for running described request code, sends the load request of the code of the described web application comprising described cookie information to described server.
A kind of server that the embodiment of the present invention provides, comprises one of above-mentioned a kind of web application code charger.
A kind of web application code loading system that the embodiment of the present invention provides, comprising: server and client side;
Described server, for receiving the accessing page request that client sends; Return requests for page to described client, wherein, in the described request page, comprise the request code of the code for request of loading web application; The load request of the code of web application described in the request of loading that reception client sends; The code of described web application is returned to described client;
Described client, for sending accessing page request to server; Receive and load the requests for page that described server returns; Run described request code, send request the load request of the code loading described web application to described server; Receive and load the code of the described web application that described server returns.
Web application code loading method, device, system and server that the embodiment of the present invention provides, user end to server sends accessing page request; Server returns requests for page to client, wherein, comprises the request code of the code for request of loading web application in requests for page; Client receives the requests for page that also load server returns, and runs request code, sends request the load request of the code loading web application to server; Server returns the code of web application to client, and client receives the code of the web application that also load server returns.In the requests for page that server returns to client, do not comprise the code of web application, but comprise the request code of the code for request of loading web application, after the client load request page is complete, rerun this request code, the load request of the code loading web application is sent request to server, receive the code of the web application that also load server returns, with prior art, the code that in requests for page, embedded huge web applies, client is made to need the code first loading this web application to compare when the load request page, client does not need the code loading web application when the load request page, improve the loading velocity of requests for page, for the user of the access request page, improve the access efficiency to this requests for page.
The function of above-mentioned each unit may correspond to the respective handling step in flow process shown in Fig. 1 to Fig. 9, does not repeat them here.
Through the above description of the embodiments, those skilled in the art can be well understood to the embodiment of the present invention can by hardware implementing, and the mode that also can add necessary general hardware platform by software realizes.Based on such understanding, the technical scheme of the embodiment of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions and perform method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (24)

1. a web application code loading method, is characterized in that, comprising:
Receive the accessing page request that client sends;
Requests for page is returned to described client, wherein, request code is comprised in the described request page, described request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server;
Receive the load request of the code of the described web application that client sends;
Returning to described client the code that described web applies, completing loading to described code for making described client.
2. the method for claim 1, it is characterized in that, detection of attribute code is also comprised in the described request page, described detection of attribute code is used for being supplied to described client, after the loading described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in described load request;
Described method, before the code returning described web application to described client, also comprises:
From described load request, obtain described client terminal attribute;
According to described client terminal attribute, determine the code that the described web corresponding with described client terminal attribute applies.
3. the method for claim 1, it is characterized in that, detection of attribute code is also comprised in the described request page, described detection of attribute code is used for being supplied to described client, after the instruction receiving the described web application of access that user sends from the described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in described load request;
Described method, before the code returning described web application to described client, also comprises:
From described load request, obtain described client terminal attribute;
According to described client terminal attribute, determine the code that the described web corresponding with described client terminal attribute applies.
4. method as claimed in claim 2 or claim 3, it is characterized in that, small-size text file cookie detection of code is also comprised in the described request page, described cookie detection of code is used for being supplied to described client, after the loading described request page, run before running described detection of attribute code, and the result running described cookie detection of code is detect described client whether to preserve the cookie information characterizing described client terminal attribute;
Described method, from described load request, obtains described client terminal attribute, specifically comprises:
When determining not comprise the cookie information characterizing described client terminal attribute in described load request, or, when determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is expired, from described load request, except the part except the territory of the described cookie information of carrying, obtain described client terminal attribute.
5. method as claimed in claim 4, is characterized in that, according to described client terminal attribute, before determining the code that the described web corresponding with described client terminal attribute applies, also comprise:
When determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is not out of date, carries in the territory of described cookie information from described load request, obtains described client terminal attribute.
6. method as claimed in claim 2 or claim 3, it is characterized in that, described client terminal attribute comprises the title of described client and/or the version number of described client;
According to described client terminal attribute, determine specifically to comprise the code that the described web corresponding with described client terminal attribute applies:
When described client terminal attribute is the title of described client, according to the corresponding relation between the code that title and the described web of described client apply, determine the code that the described web corresponding with the title of described client applies;
When described client terminal attribute is the version number of described client, according to the corresponding relation between the code that version number and the described web of described client apply, determine the code that the described web corresponding with the version of described client applies;
When described client terminal attribute is title and the version number of described client, according to the corresponding relation between the code that the title of described client and version number and described web apply, determine the code that the described web corresponding with the title of described client and version applies.
7. a code loading method for web application, is characterized in that, comprising:
Accessing page request is sent to server;
Receive and load the requests for page that described server returns, wherein, in the described request page, comprising request code;
Run described request code, send the load request of the code of web application to described server;
Receive and load the code of the described web application that described server returns.
8. method as claimed in claim 7, is characterized in that, also comprise detection of attribute code in the described request page,
Described method, after the requests for page that the described server of loading returns, and before running described request code, also comprises:
Run described detection of attribute code, obtain client terminal attribute;
Run described request code, send the load request of the code of web application to described server, specifically comprise:
Run described request code, send the load request of the code of the described web application comprising described client terminal attribute to described server.
9. method as claimed in claim 8, is characterized in that, after the requests for page that the described server of loading returns, and before running described detection of code, also comprises:
Receive the instruction of the described web application of access that user sends.
10. method as claimed in claim 8 or 9, is characterized in that, also comprise small-size text file cookie detection of code in the described request page;
Described method, run described detection of attribute code, obtain described client terminal attribute, specifically comprise:
When the described cookie detection of code of operation, when determining that described client does not preserve the cookie information characterizing described client terminal attribute, run described detection of attribute code, detect described client terminal attribute;
Run described detection of attribute code, after detecting described client terminal attribute, also comprise:
Create cookie and preserve described client terminal attribute.
11. methods as claimed in claim 10, is characterized in that, are receiving and before loading the code of the described web application that described server returns, are also comprising:
When the described cookie detection of code of operation, determine that described client preserves the cookie information characterizing described client terminal attribute, obtain described cookie information;
Run described request code, send the load request of the code of the described web application comprising described cookie information to described server.
12. 1 kinds of web application code chargers, is characterized in that, comprising:
First receiver module, for receiving the accessing page request that client sends;
First sending module, for returning requests for page to described client, wherein, request code is comprised in the described request page, described request code is used for being supplied to described client, run after the loading described request page, and the result running described request code is the load request sending the code that described web applies to server;
Second receiver module, for receiving the load request of the code of the described web application that client sends;
Second sending module, for returning the code that described web applies to described client, completes loading to described code for making described client.
13. devices as claimed in claim 12, it is characterized in that, detection of attribute code is also comprised in the described request page that described first sending module sends, described detection of attribute code is used for being supplied to described client, after the loading described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in the described load request that described second receiver module receives;
Described device, also comprises:
Acquisition module, for before the code returning described web application to described client, from described load request, obtains described client terminal attribute;
Determination module, for according to described client terminal attribute, determines the code that the described web corresponding with described client terminal attribute applies.
14. devices as claimed in claim 12, it is characterized in that, detection of attribute code is also comprised in the described request page that described first sending module sends, described detection of attribute code is used for being supplied to described client, after the instruction receiving the described web application of access that user sends from the described request page, run before running described request code, and the result running described detection of attribute code is for obtaining described client terminal attribute; Described client terminal attribute is carried in the described load request that described second receiver module receives;
Described device, also comprises:
Acquisition module, for before the code returning described web application to described client, from described load request, obtains described client terminal attribute;
Determination module, for according to described client terminal attribute, determines the code that the described web corresponding with described client terminal attribute applies.
15. devices as described in claim 13 or 14, it is characterized in that, small-size text file cookie detection of code is also comprised in the described request page that described first sending module sends, described cookie detection of code is used for being supplied to described client, after the loading described request page, run before running described detection of attribute code, and the result running described cookie detection of code is detect described client whether to preserve the cookie information characterizing described client terminal attribute;
Described acquisition module, determine in described load request, not comprise the cookie information characterizing described client terminal attribute specifically for working as, or, when determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is expired, from described load request, except the part except the territory of the described cookie information of carrying, obtain described client terminal attribute.
16. devices as claimed in claim 15, it is characterized in that, described acquisition module is also for according to described client terminal attribute, before determining the code that the described web corresponding with described client terminal attribute applies, when determining to comprise the cookie information characterizing described client terminal attribute in described load request, and described cookie information is not out of date, carry from described load request in the territory of described cookie information, obtain described client terminal attribute.
17. devices as described in claim 12 or 13, it is characterized in that, described determination module, specifically for when described client terminal attribute is the title of described client, according to the corresponding relation between the code that title and the described web of described client apply, determine the code that the described web corresponding with the title of described client applies; Or
When described client terminal attribute is the version number of described client, according to the corresponding relation between the code that version number and the described web of described client apply, determine the code that the described web corresponding with the version of described client applies; Or
When described client terminal attribute is title and the version number of described client, according to the corresponding relation between the code that the title of described client and version number and described web apply, determine the code that the described web corresponding with the title of described client and version applies.
The code charger of 18. 1 kinds of web application, is characterized in that, comprising:
First sending module, for sending accessing page request to server;
First load-on module, for receiving and loading the requests for page that described server returns, wherein, comprises request code in the described request page;
Second sending module, for running described request code, sends the load request of the code of web application to described server;
Second load-on module, for receiving and loading the code of the described web application that described server returns.
19. devices as claimed in claim 18, is characterized in that, also comprise detection of attribute code in the described request page that described first load-on module receives,
Described device, also comprises:
Detection of attribute module, for after loading the requests for page that returns of described server, and before running described request code, runs described detection of attribute code, obtains client terminal attribute;
Described second sending module, specifically for running described request code, sends the load request of the code of the described web application comprising described client terminal attribute to described server.
20. devices as claimed in claim 19, is characterized in that, also comprise: command reception module, for after loading the requests for page that returns of described server, and before running described detection of code, receive the instruction of the described web application of access that user sends.
21. devices as described in claim 19 or 20, is characterized in that, also comprise small-size text file cookie detection of code in the described request page that described first load-on module receives;
Described detection of attribute module, specifically for when running described cookie detection of code, when determining that described client does not preserve the cookie information characterizing described client terminal attribute, running described detection of attribute code, detecting described client terminal attribute;
Described device, also comprises:
Cookie creation module, for running described detection of attribute code, after detecting described client terminal attribute, creating cookie and preserving described client terminal attribute.
22. devices as claimed in claim 21, is characterized in that, also comprise:
Cookie acquisition module, for to receive and before loading the code of the described web application that described server returns, when the described cookie detection of code of operation, determine that described client preserves the cookie information characterizing described client terminal attribute, obtain described cookie information;
Described second sending module, specifically for running described request code, sends the load request of the code of the described web application comprising described cookie information to described server.
23. 1 kinds of servers, is characterized in that, comprising: the device as described in any one of claim 12-17.
24. 1 kinds of web application code loading systems, is characterized in that, comprising: server and client side;
Described server, for receiving the accessing page request that client sends; Return requests for page to described client, wherein, in the described request page, comprise the request code of the code applied for request of loading network web; The load request of the code of web application described in the request of loading that reception client sends; The code of described web application is returned to described client;
Described client, for sending accessing page request to server; Receive and load the requests for page that described server returns; Run described request code, send request the load request of the code loading described web application to described server; Receive and load the code of the described web application that described server returns.
CN201310256285.0A 2013-06-25 2013-06-25 Web application realization code loading method, device, system and server Pending CN104253783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310256285.0A CN104253783A (en) 2013-06-25 2013-06-25 Web application realization code loading method, device, system and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310256285.0A CN104253783A (en) 2013-06-25 2013-06-25 Web application realization code loading method, device, system and server

Publications (1)

Publication Number Publication Date
CN104253783A true CN104253783A (en) 2014-12-31

Family

ID=52188329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310256285.0A Pending CN104253783A (en) 2013-06-25 2013-06-25 Web application realization code loading method, device, system and server

Country Status (1)

Country Link
CN (1) CN104253783A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959278A (en) * 2016-04-28 2016-09-21 北京网康科技有限公司 Method, device and system for calling VPN
WO2018068658A1 (en) * 2016-10-13 2018-04-19 阿里巴巴集团控股有限公司 Device component loading method, apparatus and internet of things system
CN109492183A (en) * 2018-11-12 2019-03-19 郑州云海信息技术有限公司 A kind of data processing method and device
CN109936601A (en) * 2017-12-18 2019-06-25 厦门本能管家科技有限公司 A kind of block chain duplex communication network based on WebSocket connection
CN112597423A (en) * 2021-01-04 2021-04-02 聚好看科技股份有限公司 Webpage content display method, terminal and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060248166A1 (en) * 2005-04-29 2006-11-02 Jovan Milosevic System and method for client side rendering of a web page
CN101645090A (en) * 2009-08-04 2010-02-10 成都市华为赛门铁克科技有限公司 Page display method, server and network system
CN101669114A (en) * 2007-04-27 2010-03-10 微软公司 dynamically loading scripts
CN102567516A (en) * 2011-12-28 2012-07-11 华为技术有限公司 Script loading method and device
CN102799640A (en) * 2012-06-27 2012-11-28 用友软件股份有限公司 Page loading device and page loading method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060248166A1 (en) * 2005-04-29 2006-11-02 Jovan Milosevic System and method for client side rendering of a web page
CN101669114A (en) * 2007-04-27 2010-03-10 微软公司 dynamically loading scripts
CN101645090A (en) * 2009-08-04 2010-02-10 成都市华为赛门铁克科技有限公司 Page display method, server and network system
CN102567516A (en) * 2011-12-28 2012-07-11 华为技术有限公司 Script loading method and device
CN102799640A (en) * 2012-06-27 2012-11-28 用友软件股份有限公司 Page loading device and page loading method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
METEORSEED: "Js学习笔记(一)——JS的阻塞特性", 《HTTP://WWW.CNBLOGS.COM/METEORSEED/ARTICLES/2283629.HTML》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959278A (en) * 2016-04-28 2016-09-21 北京网康科技有限公司 Method, device and system for calling VPN
WO2018068658A1 (en) * 2016-10-13 2018-04-19 阿里巴巴集团控股有限公司 Device component loading method, apparatus and internet of things system
CN109936601A (en) * 2017-12-18 2019-06-25 厦门本能管家科技有限公司 A kind of block chain duplex communication network based on WebSocket connection
CN109936601B (en) * 2017-12-18 2022-10-25 本无链科技(深圳)有限公司 Block chain duplex communication method based on WebSocket connection
CN109492183A (en) * 2018-11-12 2019-03-19 郑州云海信息技术有限公司 A kind of data processing method and device
CN112597423A (en) * 2021-01-04 2021-04-02 聚好看科技股份有限公司 Webpage content display method, terminal and server
CN112597423B (en) * 2021-01-04 2023-11-03 聚好看科技股份有限公司 Webpage content display method, terminal and server

Similar Documents

Publication Publication Date Title
CN104767775B (en) Web application information push method and system
CN109618176B (en) Processing method, equipment and storage medium for live broadcast service
US10725751B2 (en) Generating a predictive data structure
CN105100003A (en) Method and device for preloading webpage game at client
US10084637B2 (en) Automatic task tracking
CN104253783A (en) Web application realization code loading method, device, system and server
CN108134816B (en) Access to data on remote device
CN111913738A (en) Access request processing method, device, computing equipment and medium
CN104834588A (en) Permanent residence cross site script vulnerability detection method and apparatus
CN113900834A (en) Data processing method, device, equipment and storage medium based on Internet of things technology
US20130325960A1 (en) Client-side sharing of event information
CN103970882A (en) Method and device for rendering page
CN112965916B (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN103684823A (en) Weblog recording method, network access path determining method and related devices
CN112152879A (en) Network quality determination method and device, electronic equipment and readable storage medium
CN111338928A (en) Chrome-based browser testing method and device
CN113407229B (en) Method and device for generating offline scripts
CN104516883A (en) Webpage sharing method, device and system
CN110278133B (en) Checking method, device, computing equipment and medium executed by server
CN112749078B (en) Buried point testing method and device
CN112966167A (en) Data crawling method, device, computer system and computer readable storage medium
CN114302207A (en) Bullet screen display method, device, system, equipment and storage medium
WO2014161338A1 (en) Method, apparatus, and system for webgame interaction
CN111163138B (en) Method, device and server for reducing network load during game
CN113407440B (en) Testing system and method for wireless communication module

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20141231

RJ01 Rejection of invention patent application after publication