CN110505258A - Webpage load and response method, device, computer equipment and storage medium - Google Patents

Webpage load and response method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110505258A
CN110505258A CN201810474122.2A CN201810474122A CN110505258A CN 110505258 A CN110505258 A CN 110505258A CN 201810474122 A CN201810474122 A CN 201810474122A CN 110505258 A CN110505258 A CN 110505258A
Authority
CN
China
Prior art keywords
data
request
web
data service
web page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810474122.2A
Other languages
Chinese (zh)
Other versions
CN110505258B (en
Inventor
汤进伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810474122.2A priority Critical patent/CN110505258B/en
Publication of CN110505258A publication Critical patent/CN110505258A/en
Application granted granted Critical
Publication of CN110505258B publication Critical patent/CN110505258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

This application involves a kind of webpage loading method, device, computer equipment and storage mediums, send web-page requests, and web-page requests carry web page address;Receive the web page files that response web-page requests return;According to each data service in web page files, the corresponding data service request of each data service is packaged into a request of data, and send request of data;Receive the response data packet that piecemeal returns, the data packet that response data packet returns for each data service request in the request of piecemeal response data.The webpage loading method, device, computer equipment and storage medium can reduce server stress and timely respond to client.The application also provides one kind webpage response method corresponding with webpage loading method, device, computer equipment and storage medium, device, computer equipment and storage medium.

Description

Webpage load and response method, device, computer equipment and storage medium
Technical field
This application involves information technology fields, set more particularly to a kind of load of webpage and response method, device, computer Standby and storage medium.
Background technique
With the development of computer information technology, the application of webpage has been deep into the every aspect of life, as user can With by web page browsing news, check social network sites, search information, carry out internet trade, viewing network video etc..
Traditional webpage loading method will be each on webpage by way of serial or parallel when carrying out webpage load Data service request is sent to server request data.Serial manner refers to that each data service is corresponding and sends a data Service request is to server, and by way of multiple response data packet returned datas;Parallel form refers to multiple data industry Business only sends a request of data to server, and by way of a response data packet returned data.In this way, by serial Mode request data to will lead to server end requested more, cause server stress excessive;Pass through parallel form number of request According to will lead to client end response overlong time.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of reduction server stress and timely respond to client Webpage load and response method, device, computer equipment and storage medium.
A kind of webpage loading method, which comprises
Web-page requests are sent, the web-page requests carry web page address;
It receives and responds the web page files that the web-page requests return;
According to each data service in the web page files, the corresponding data service request of each data service is encapsulated At a request of data, and send the request of data;
The response data packet that piecemeal returns is received, the response data packet responds each institute in the request of data for piecemeal The data packet stating data service request and returning.
A kind of webpage response method, which comprises
Web-page requests are received, and return to web page files according to the web-page requests;
Receive request of data;
The request of data is parsed to obtain at least one data service request, and according to the data service request Acquisition request data;
Piecemeal responds each data service request in the request of data, returns to the response including the request data Data packet.
A kind of webpage loading device, described device include:
Web-page requests sending module, for sending web-page requests, the web-page requests carry web page address;
Web page files receiving module, for receiving the web page files for responding the web-page requests and returning;
Request of data sending module, for according to each data service in the web page files, by each data service Corresponding data service request is packaged into a request of data, and sends the request of data;
Response data receiving module, for receiving the response data packet of piecemeal return, the response data packet is rung for piecemeal The data packet answering each data service request in the request of data and returning.
A kind of webpage responding device, described device, comprising:
Web page files return module returns to web page files for receiving web-page requests, and according to the web-page requests;
Request of data receiving module, is requested for receiving data;
Data parsing obtains module, obtains at least one data service request for being parsed to the request of data, And according to the data service request acquisition request data;
Deblocking respond module responds each data service request in the request of data for piecemeal, returns Response data packet including the request data.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing The step of device realizes above-mentioned webpage loading method when executing the computer program.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing The step of device realizes above-mentioned webpage response method when executing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor The step of above-mentioned webpage loading method is realized when row.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor The step of above-mentioned webpage response method is realized when row.
Above-mentioned webpage load and response method, device, computer equipment and storage medium, terminal send web-page requests, institute It states web-page requests and carries web page address;Server receives web-page requests, and returns to web page files according to the web-page requests;Terminal It receives and responds the web page files that the web-page requests return;According to each data service in the web page files, by each number It is packaged into a request of data according to the corresponding data service request of business, and sends the request of data;Server receives data Request;The request of data is parsed to obtain at least one data service request, and is obtained according to the data service request Take request data;Piecemeal responds each data service request in the request of data, and returning includes the request data Response data packet.Terminal receives the response data packet that piecemeal returns, and the response data packet is that piecemeal responds the request of data In each data service request and the data packet that returns.On the one hand, since no matter how many data service all only needs A request of data is received, therefore, server end can be reduced and made because multiple data services need to receive multiple request of data At access pressure.On the other hand, since terminal receives the response data packet that piecemeal returns, it can be in a part of data After service request is completed, the response data packet for responding the data service request is just received, client can be timely responded to.From And above-mentioned webpage load and response method, device, computer equipment and storage medium can reduce server stress and ring in time Answer client.
Detailed description of the invention
Fig. 1 is the applied environment figure of webpage load and response method in one embodiment;
Fig. 2 is the flow diagram of webpage loading method in one embodiment;
Fig. 3 is the flow diagram of a step of the webpage loading method of Fig. 2;
Fig. 4 is the flow diagram of another step of the webpage loading method of Fig. 2;
Fig. 5 is the flow diagram of webpage response method in one embodiment;
Fig. 6 is the flow diagram of webpage response method in another embodiment;
Fig. 7 is the timing diagram of webpage load and response method in one embodiment;
Fig. 8 is page example figure in one embodiment;
Fig. 9 is the structural block diagram of webpage loading device in one embodiment;
Figure 10 is the structural block diagram of webpage loading device in another embodiment;
Figure 11 is the structural block diagram of webpage responding device in one embodiment;
Figure 12 is the structural block diagram of webpage responding device in another embodiment;
Figure 13 is the internal structure chart of computer equipment in one embodiment;
Figure 14 is the internal structure chart of computer equipment in another embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Webpage load provided by the present application and response method, can be applied in application environment as shown in Figure 1.Wherein, Terminal 102 is communicated by network with server 104.Terminal 102 sends web-page requests to server 104 by network;Clothes Business device 104 receives the web-page requests, and returns to web page files according to web-page requests;Terminal 102 receives response web-page requests and returns Web page files the corresponding data service request of each data service is packaged into one according to each data service in web page files A request of data, and send request of data;Server 104 receives request of data, is parsed to obtain at least one to request of data A data service request, and each data service according to data service request acquisition request data, in the request of piecemeal response data Request returns to the response data packet including request data.Terminal 102 receives the response data packet that piecemeal returns.Wherein, terminal 102 can be, but not limited to be various personal computers, laptop, smart phone, tablet computer and portable wearable set It is standby, stratum server 104 is accessed, can be realized with the server cluster of the either multiple server compositions of independent server.
In one embodiment, as shown in Fig. 2, providing a kind of webpage loading method, it is applied in Fig. 1 in this way It is illustrated for terminal 102, comprising the following steps:
S202 sends web-page requests.
Web-page requests carry web page address.The web-page requests are sent to the corresponding server of web page address.The web-page requests For to the corresponding server requested webpage of web page address.
S204 receives the web page files that response web-page requests return.
After server receives web-page requests, responds the web-page requests and return to the corresponding web page files of web page address, terminal Receive the web page files.The web page files can be HTML (Hyper Text Markup Language, hypertext markup language Speech) file.
The corresponding data service request of each data service is packaged by S206 according to each data service in web page files One request of data, and send request of data.
After receiving the web page files of return, the web page files are executed.During executing the web page files, root is needed According to each data service in web page files, the corresponding data service request of each data service is packaged into a request of data, and The request of data is sent to the corresponding server of the request of data.Each data service in web page files can pass through web page files In literal translation formula scripting language (e.g., JavaScript, a kind of literal translation formula scripting language) realize.The corresponding service of the request of data Device can be the corresponding server of web page address, be also possible to the corresponding server of data service request.
It is to be appreciated that the corresponding data service request of a data service, a data request packet include at least one Data service request.
S208 receives the response data packet that piecemeal returns.
The data packet that response data packet returns for each data service request in the request of piecemeal response data.
Server parses request of data to obtain at least one data service request, and root according to the request of data According to data service request acquisition request data.The mode of acquisition request data, can be data service request being forwarded to data The corresponding server of service request, from acquisition request data on the corresponding server of the data service request;It is also possible in number According on the server where request, request data is directly acquired.After server gets request data, the request of piecemeal response data In each data service request, return include request data response data packet.Terminal receives the response data packet.
Above-mentioned webpage loading method, sends web-page requests, and web-page requests carry web page address;Response web-page requests are received to return The web page files returned;According to each data service in web page files, the corresponding data service request of each data service is packaged into One request of data, and send request of data;The response data packet that piecemeal returns is received, response data packet is piecemeal response data Each data service request in request and the data packet returned.On the one hand, since no matter how many data service all only needs A request of data is received, therefore, server end can be reduced and made because multiple data services need to receive multiple request of data At access pressure.On the other hand, since terminal receives the response data packet that piecemeal returns, it can be in a part of data After service request is completed, the response data packet for responding the data service request is just received, client can be timely responded to.From And above-mentioned webpage loading method can reduce server stress and timely respond to client.
As shown in figure 3, in one embodiment, request of data includes the request of intranet page.According in web page files The corresponding data service request of each data service is packaged into a request of data, and sends request of data by each data service Step, comprising:
S302 creates document frame in web page files.
The corresponding data service request of each data service is packaged into one according to data service each in web page files by S304 A internal web-page requests, and internal web-page requests are sent in document frame, internal web-page requests are web page files internal request The request of webpage.
I.e. in the present embodiment, the form of request of data is internal web-page requests.It is to be appreciated that the inside web-page requests In carry the corresponding data service request of each data service.It can be carried in address parameter by being sent in document frame Portion's web-page requests, to send each data service request.It can be by using each data service request as internal web-page requests Address parameter, to send each data service request.Step can be realized by the literal translation formula scripting language in web page files S302 and S304.
Address parameter can be transmitted by the scr attribute (path attribute) of document frame, which can be URL (Uniform Resource Locator, uniform resource locator), which transmitting address parameter length by URL length Degree limitation.Whether document frame allows the attribute for executing literal translation formula scripting language to be positioned to allow for, that is, allows to execute JS (abbreviation of JavaScript, a kind of literal translation formula scripting language).So as to pass through the literal translation formula scripting language in web page files It is realized in document frame and sends internal web-page requests.
Document frame is also known as inline frame or row inner frame, can be created by iframe (document frame) label.In , can be by the hiding document frame of literal translation formula scripting language dynamic creation one in one of specific embodiment, and it should Document frame is added in web page files.
Wherein in an embodiment, response data packet includes internal web page files;The coding transfer method of internal web page files For block transmission coding, internal web page files are the subnet page file inside web page files.
It can be by specifying transfer-encoding (coding transfer method) in HTTP (hypertext transfer protocol) head Attribute value is the mode of chunked (block transmission coding), sets piecemeal for the coding transfer method of internal web page files and passes Defeated coding.Block transmission coding is one of HTTP data transmission mechanism, and HTTP is allowed to be sent to client by web page server The data of end application (usually web browser) are segmented into multiple portions.
It should be noted that must be by a web page files, i.e., inside web page files in present embodiment, Cai Nengli With the characteristic of the coding transfer method of web page files: block transmission coding mode.
Document frame can be a sandbox environment, since sandbox environment has security restriction, it is thus possible to improve webpage Security attribute.It can set husky for document box frame by setting sandbox (sandbox environment) for the attribute of document frame Case environment.
Webpage text can be called directly in document frame the case where one domain is belonged to for document frame and web document Function in shelves carries out the transmitting of data, in this way, piecemeal can be realized by the function in multiple invoking web page file Response data is into web page files.Wherein, domain (Domain) is independently operated unit in window networking.For document box Frame and web document belong to the case where not same area, can be realized by PostMessage function, and PostMessage function is A common mathematical function in Windows API (application programming interfaces), for a piece of news to be put into message queue.
In a wherein specific embodiment, the address parameter by document frame is needed to be set as the net of piecemeal response Page address, the i.e. coding transfer method of the corresponding webpage of the web page address are block transmission codings.
As shown in figure 4, in one embodiment, it is according to data service each in web page files, each data service is corresponding Data service request be packaged into an internal web-page requests, and the step of sending in document frame internal web-page requests, packet It includes:
S402 creates list in web page files, and sets document frame for the opening destination of list.
S404 creates input object, the value point of each input object according to each data service in web page files in list It is not set as the corresponding data service request of each data service.
S406 forms an internal web-page requests, and send the request of intranet page by calling the submission function of list.
Such as, a hiding list can be created by form label, sets the submission attribute (method) of list to POST method (method for transmitting sectionally), and be added in web document, while using document frame as the opening destination of list Location (target attribute).That is the target attribute of list is set as content identical with (name) name attribute of document frame. Using POST method, terminal will be established with the sheet disposal server specified in action attribute (action attributes) and be contacted, and be established After connection, terminal will send the data to server by the method for segment transmissions.In server end, in the application of POST pattern When program starts to execute, just parameter should be read from a mark position, and after reading parameter, these tables are used in application program Before monodrome, it is necessary to be decoded to these parameters.
Using the characteristic of list, opening destination address can be set to a document frame.The number that needs can be transmitted According to being put into the hiding field in list, by calling the submission method (submit) of list, to generate a POST type The request of document frame, to send internal web-page requests, can transmit mass data.
In one embodiment, according to each data service in web page files, by the corresponding data industry of each data service Business request is packaged into a request of data, and the step of sending request of data, comprising:
According to the module division mode of each data service in web page files, the corresponding data service of each data service is asked It asks and is packaged into a request of data, and send request of data.
Response data packet is each data service request according to module division mode, in the request of piecemeal response data and returns Data packet.
It in the present embodiment, can be according to module division mode, by the corresponding data of data service at least one module Service request is packaged into a request of data.It should be noted that the quantity of module depends on the division mode of module in webpage, How many a modules no matter have been divided, a request of data is all packaged into, a module returns to a response data packet.Based on this reality Data service request in web page files is packaged into a request of data by the webpage loading method for applying mode, and can be by mould Block division mode receives response data packet, thus, it is possible to reduce server stress and timely respond to client.
The module division mode can be the delineation of activities with data dependence relation in the same module.It can pass through The form of array saves the data and interface IP address of each data service request.Without relying on the data service of other data services Request can be used as the element in array, and the data service request for needing to rely on other data services can be used as in corresponding element One nested structural body.
In a wherein specific embodiment, the data of data service request and interface can be merged into a JSON number Group can distribute a unique identity to distinguish different data service requests for each element in array, Component identification can be referred to as.The component identification can be sent to server with request of data, to realize the number of server and terminal It is corresponding according to service request.
A document frame is created in web document, and by the document framework hides, it can be by by the document frame Display mode be set as hiding mode and realize, code can be with are as follows: style display:none.Then, in net A list is created in page document, POST method is set by the submission attribute (method) of the list, by the opening of the list Destination address is set as the document frame.One or more input objects are added in list, which can be hiding Form, code can be with are as follows: input type=hidden.JSON (the JavaScript that needs can be transmitted Object Notation, JS object numbered musical notation, is a kind of data interchange format of lightweight) after array serialized, as defeated Enter the value of object, finally calls the submission method of list, a POST request is initiated, to send request of data.
Server needs to parse the data after receiving JSON array, and the data of an element are completed in processing, Just piecemeal is back to terminal.The data format that piecemeal returns can be one section of JS and call, for example,<script> parent.postMessage(${pack},"*");</script>, realize the monitoring information in father's document (i.e. web document) (message) event gets response data packet (pack) in father's document, then carries out unserializing to response data packet again, Obtain the data of server return.
In one embodiment, as shown in figure 5, providing a kind of webpage responder corresponding with above-mentioned webpage loading method Method is applied to be illustrated for the server 104 in Fig. 1 in this way, comprising the following steps:
S502 receives web-page requests, and returns to web page files according to web-page requests.
Web-page requests carry web page address.Server can return to web page files to terminal according to the web page address.
S504 receives request of data.
The request of data is terminal according to each data service in web page files, by the corresponding data service of each data service Request is packaged into and is formed and sent.Server receives the request of data.
S506 parses request of data to obtain at least one data service request, and is obtained according to data service request Take request data.
One item data business corresponds to a data service request, and a data request packet includes at least one data service and asks It asks.The mode of acquisition request data can be also possible to forward data service request to data industry to obtain in local server Corresponding particular server is requested in business, and is received the data of particular server return and obtained.
S508, piecemeal response data request in each data service request, return include request data response data packet.
The data packet that response data packet returns for each data service request in the request of piecemeal response data.Piecemeal response Mode refer to whenever getting the corresponding data of a part of data service request, be returned to a response data packet.One Divided data service request can be a data service request, be also possible to the module divided according to module division mode Data service request.Module division mode can be divided using any way, in a preferred embodiment, will be had The data service request of data dependence relation is divided in the same module.
Above-mentioned webpage response method, on the one hand, since no matter how many data service all only needs to receive a data Request, therefore, accesses pressure caused by can reducing server end due to multiple data services need to receive multiple request of data. On the other hand, due to server piecemeal returning response data packet, can after the completion of a part of data service request, Just the data service request is responded, client can be timely responded to.To which above-mentioned webpage response method can reduce server pressure Power and timely respond to client.
Referring to Fig. 6, in one embodiment, request of data is parsed to obtain at least one data service and is asked It asks, and the step of according to data service request acquisition request data, comprising:
S6062, parse request of data, obtain module division mode and at least one according to module division mode data industry Business request.
S6064, according to module division mode and data service request, piecemeal acquisition request data.
The module division mode can be carries out module division in any way, will in a preferred embodiment Delineation of activities with data dependence relation is in the same module, to reduce the dependence between module.
In the present embodiment, according to module division mode, piecemeal acquisition request data.The mode of piecemeal acquisition request data It can be that sub-module is obtained in local server in such a way that module divides, be also possible to divide mould in such a way that module divides Block forwards data service request to the corresponding particular server of data service request, and receives the data of particular server return And it obtains.The mode that piecemeal obtains, enables request data to obtain parallel, can be further reduced the response time.
Please continue to refer to Fig. 6, in one embodiment, each data service request in the request of piecemeal response data is returned Return the response data packet for including the steps that request data, comprising:
S608, when often getting the request data of a module, data service request in response data request in module, Returning response data packet.
In the present embodiment, it is returned it into whenever getting the request data of a module according to module division mode To terminal, to timely respond to the client in terminal.
The application is further described with the timing diagram in Fig. 7 below.
Firstly, terminal sends web-page requests.Server receives the web-page requests, and returns to webpage text according to web-page requests Part.
Then, terminal receives the web page files that response web-page requests return, and according to each data service in web page files, The corresponding data service request of each data service is packaged into a request of data, and sends request of data.
Then, server receives request of data, is parsed to obtain at least one data service request to request of data, and According to data service request acquisition request data, each data service request in the request of piecemeal response data, returning includes request The response data packet of data.
Finally, terminal receives the response data packet that piecemeal returns.
It is illustrated below with beneficial effect of the specific example to the application.In the page of the specific example, such as Fig. 8 institute Show, includes 4 modules: modules A, module B, module C and module D.Assuming that network request time-consuming be 100ms, modules A, module B, The module C and module D corresponding background process time is respectively 100ms, 200ms, 300ms and 400ms.
Serial manner is divided according to by module, i.e., data service one data service of corresponding transmission of one module is asked It asks to server and by way of multiple response data packet returned datas, terminal will send 4 data demand files to service Device, and server passes through 4 response data packet returned datas.Modules A is available after 200ms, and module B can be used after 300ms, Module C can be used after 400ms, and module D can be used after 500ms.It can be seen that the corresponding server of the webpage more for amount of access will Face biggish access pressure.
Parallel form is divided according to by module, i.e., the data service of multiple modules only sends a request of data to clothes It is engaged in device, and by way of a response data packet returned data, terminal will send a request of data to server, and take Device be engaged in after the data of 4 modules obtain, passes through a response data packet returned data.The time that the response data packet returns By response time longest limitation in 4 modules, modules A, module B, module C and module D can be used simultaneously after 500ms.Thus may be used See, even if the time that modules A obtains data is shorter, it also requires can be just returned after the data acquisition of module D is complete, Therefore, client end response overlong time.
According to the mode of the application, according to the module division mode of each data service in web page files, by each data The corresponding data service request of business is packaged into a request of data, and sends request of data.So, terminal will send a number According to request to server, and server passes through 4 response data packet returned datas after the data of 4 modules obtain. Modules A is available after 200ms, and module B can be used after 300ms, and module C can be used after 400ms, and module D can be used after 500ms.Due to, no matter How many module of the page, terminal only send a request of data to server, the more webpage of amount of access can be effectively reduced The access pressure of corresponding server, simultaneously as being returned to corresponding after the data that server gets a module Response data packet can timely respond to client.
It should be understood that although each step in the flow chart of Fig. 2-6 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-6 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in figure 9, providing a kind of webpage loading device, comprising:
Web-page requests sending module 902, for sending web-page requests, the web-page requests carry web page address.
Web page files receiving module 904, for receiving the web page files for responding the web-page requests and returning.
Request of data sending module 906, for according to each data service in the web page files, by each data industry Corresponding data service request of being engaged in is packaged into a request of data, and sends the request of data.
Response data receiving module 908, for receiving the response data packet of piecemeal return, the response data packet is piecemeal The data packet for responding each data service request in the request of data and returning.
Above-mentioned webpage loading device, sends web-page requests, and web-page requests carry web page address;Response web-page requests are received to return The web page files returned;According to each data service in web page files, the corresponding data service request of each data service is packaged into One request of data, and send request of data;The response data packet that piecemeal returns is received, response data packet is piecemeal response data Each data service request in request and the data packet returned.On the one hand, since no matter how many data service all only needs A request of data is received, therefore, server end can be reduced and made because multiple data services need to receive multiple request of data At access pressure.On the other hand, since terminal receives the response data packet that piecemeal returns, it can be in a part of data After service request is completed, the response data packet for responding the data service request is just received, client can be timely responded to.From And above-mentioned webpage loading device can reduce server stress and timely respond to client.
In one embodiment, the request of data includes the request of intranet page, described device, further includes: document box Frame establishes module 1005.
The document frame establishes module 1005, for creating document frame in the web page files.
The request of data sending module 1006, for according to the data service each in the web page files, Jiang Gesuo It states the corresponding data service request of data service and is packaged into an internal web-page requests, and in the document frame described in transmission Internal web-page requests, the internal web-page requests are the request of the web page files internal request webpage.
In one embodiment, the response data packet includes internal web page files.The volume of the internal web page files Code transmission mode is block transmission coding, and the internal web page files are the subnet page file inside the web page files.
In one embodiment, the request of data sending module 1006, comprising:
List creating unit 1062, for creating list in the web page files, and by the opening purpose of the list Ground is set as the document frame.
Input object setting unit 1064, for according to each data service in the web page files, in the list Input object is created, the value of each input object, which is respectively set to the corresponding data service of each data service, asks It asks.
Web-page requests transmission unit 1066 forms an internal webpage for the submission function by calling the list Request, and send the internal web-page requests.
In one embodiment, the request of data sending module, for according to each data in the web page files The corresponding data service request of each data service is packaged into a request of data, concurrently by the module division mode of business Send the request of data.
The response data packet is according to the module division mode, and piecemeal responds each number in the request of data The data packet returned according to service request.
Specific about webpage loading device limits the restriction that may refer to above for webpage loading method, herein not It repeats again.Modules in above-mentioned webpage loading device can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
As shown in figure 11, the application also provides a kind of webpage responding device, described device, comprising:
Web page files return module 1102 returns to web page files for receiving web-page requests, and according to the web-page requests.
Request of data receiving module 1104, is requested for receiving data.
Data parsing obtains module 1106, asks for being parsed to obtain at least one data service to the request of data It asks, and according to the data service request acquisition request data.
Deblocking respond module 1108 responds each data service request in the request of data for piecemeal, Return to the response data packet including the request data.
Above-mentioned webpage responding device, on the one hand, since no matter how many data service all only needs to receive a data Request, therefore, accesses pressure caused by can reducing server end due to multiple data services need to receive multiple request of data. On the other hand, due to server piecemeal returning response data packet, can after the completion of a part of data service request, Just the data service request is responded, client can be timely responded to.To which above-mentioned webpage responding device can reduce server pressure Power and timely respond to client.
As shown in figure 12, in one embodiment, the data parsing obtains module, comprising:
Request of data resolution unit 1262, for parsing the request of data, obtain module division mode and at least one According to the data service request of the module division mode.
Deblocking acquiring unit 1264, for according to the module division mode and the data service request, piecemeal Acquisition request data.
In one embodiment, the deblocking respond module, for often getting the request an of module When data, the data service request in module described in the request of data, returning response data packet are responded.
Specific about webpage responding device limits the restriction that may refer to above for webpage response method, herein not It repeats again.Modules in above-mentioned webpage responding device can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in figure 13.The computer equipment includes processor, memory and the network interface connected by system bus. Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory of the computer equipment includes non-easy The property lost storage medium, built-in storage.The non-volatile memory medium is stored with operating system and computer program.The built-in storage Operation for operating system and computer program in non-volatile memory medium provides environment.The network of the computer equipment connects Mouth with external terminal by network connection for being communicated.To realize that a kind of webpage is rung when the computer program is executed by processor Induction method.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in figure 14.The computer equipment includes the processor connected by system bus, memory, network interface, shows Display screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment Memory includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer Program.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The meter The network interface for calculating machine equipment is used to communicate with external terminal by network connection.When the computer program is executed by processor To realize a kind of webpage loading method.The display screen of the computer equipment can be liquid crystal display or electric ink is shown Screen, the input unit of the computer equipment can be the touch layer covered on display screen, be also possible on computer equipment shell Key, trace ball or the Trackpad of setting can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that Figure 13, structure shown in 14, only portion relevant to application scheme The block diagram of separation structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer Equipment may include perhaps combining certain components or with different component cloth than more or fewer components as shown in the figure It sets.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory Computer program, the processor perform the steps of when executing computer program
Web-page requests are sent, the web-page requests carry web page address;
It receives and responds the web page files that the web-page requests return;
According to each data service in the web page files, the corresponding data service request of each data service is encapsulated At a request of data, and send the request of data;
The response data packet that piecemeal returns is received, the response data packet responds each institute in the request of data for piecemeal The data packet stating data service request and returning.
The request of data includes the request of intranet page in one of the embodiments,;It is described according to the web page files In each data service, the corresponding data service request of each data service is packaged into a request of data, and send institute The step of stating request of data, comprising:
Document frame is created in the web page files;
According to the data service each in the web page files, the corresponding data service request of each data service is sealed An internal web-page requests are dressed up, and send the internal web-page requests in the document frame, the internal web-page requests For the request of the web page files internal request webpage.
The response data packet includes internal web page files in one of the embodiments,;The internal web page files Coding transfer method is block transmission coding, and the internal web page files are the subnet page file inside the web page files.
It is described according to the data service each in the web page files in one of the embodiments, by each data The corresponding data service request of business is packaged into an internal web-page requests, and sends the intranet in the document frame The step of page request, comprising:
List is created in the web page files, and sets the document frame for the opening destination of the list;
According to each data service in the web page files, input object, each input pair are created in the list The value of elephant is respectively set to the corresponding data service request of each data service;
By calling the submission function of the list, an internal web-page requests are formed, and send the internal webpage and ask It asks.
Each data service according in the web page files in one of the embodiments, by each data industry Corresponding data service request of being engaged in is packaged into a request of data, and the step of sending the request of data, comprising:
According to the module division mode of each data service in the web page files, by the corresponding number of each data service It is packaged into a request of data according to service request, and sends the request of data;
The response data packet is according to the module division mode, and piecemeal responds each number in the request of data The data packet returned according to service request.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory Computer program, the processor perform the steps of when executing computer program
Web-page requests are received, and return to web page files according to the web-page requests;
Receive request of data;
The request of data is parsed to obtain at least one data service request, and according to the data service request Acquisition request data;
Piecemeal responds each data service request in the request of data, returns to the response including the request data Data packet.
In one of the embodiments, it is described the request of data is parsed to obtain at least one data service ask It asks, and the step of according to the data service request acquisition request data, comprising:
Parse the request of data, obtain module division mode and at least one according to the module division mode data Service request;
According to the module division mode and the data service request, piecemeal acquisition request data.
The piecemeal responds each data service request in the request of data in one of the embodiments, returns Return the response data packet for including the steps that the request data, comprising:
When often getting the request data of a module, the number in module described in the request of data is responded According to service request, returning response data packet.
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 when being executed by processor
Web-page requests are sent, the web-page requests carry web page address;
It receives and responds the web page files that the web-page requests return;
According to each data service in the web page files, the corresponding data service request of each data service is encapsulated At a request of data, and send the request of data;
The response data packet that piecemeal returns is received, the response data packet responds each institute in the request of data for piecemeal The data packet stating data service request and returning.
The request of data includes the request of intranet page in one of the embodiments,;It is described according to the web page files In each data service, the corresponding data service request of each data service is packaged into a request of data, and send institute The step of stating request of data, comprising:
Document frame is created in the web page files;
According to the data service each in the web page files, the corresponding data service request of each data service is sealed An internal web-page requests are dressed up, and send the internal web-page requests in the document frame, the internal web-page requests For the request of the web page files internal request webpage.
The response data packet includes internal web page files in one of the embodiments,;The internal web page files Coding transfer method is block transmission coding, and the internal web page files are the subnet page file inside the web page files.
It is described according to the data service each in the web page files in one of the embodiments, by each data The corresponding data service request of business is packaged into an internal web-page requests, and sends the intranet in the document frame The step of page request, comprising:
List is created in the web page files, and sets the document frame for the opening destination of the list;
According to each data service in the web page files, input object, each input pair are created in the list The value of elephant is respectively set to the corresponding data service request of each data service;
By calling the submission function of the list, an internal web-page requests are formed, and send the internal webpage and ask It asks.
Each data service according in the web page files in one of the embodiments, by each data industry Corresponding data service request of being engaged in is packaged into a request of data, and the step of sending the request of data, comprising:
According to the module division mode of each data service in the web page files, by the corresponding number of each data service It is packaged into a request of data according to service request, and sends the request of data;
The response data packet is according to the module division mode, and piecemeal responds each number in the request of data The data packet returned according to service request.
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 when being executed by processor
Web-page requests are received, and return to web page files according to the web-page requests;
Receive request of data;
The request of data is parsed to obtain at least one data service request, and according to the data service request Acquisition request data;
Piecemeal responds each data service request in the request of data, returns to the response including the request data Data packet.
In one of the embodiments, it is described the request of data is parsed to obtain at least one data service ask It asks, and the step of according to the data service request acquisition request data, comprising:
Parse the request of data, obtain module division mode and at least one according to the module division mode data Service request;
According to the module division mode and the data service request, piecemeal acquisition request data.
The piecemeal responds each data service request in the request of data in one of the embodiments, returns Return the response data packet for including the steps that the request data, comprising:
When often getting the request data of a module, the number in module described in the request of data is responded According to service request, returning response data packet.
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 can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including 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..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (15)

1. a kind of webpage loading method, which comprises
Web-page requests are sent, the web-page requests carry web page address;
It receives and responds the web page files that the web-page requests return;
According to each data service in the web page files, the corresponding data service request of each data service is packaged into one A request of data, and send the request of data;
The response data packet that piecemeal returns is received, the response data packet is that piecemeal responds each number in the request of data The data packet returned according to service request.
2. the method according to claim 1, wherein the request of data includes the request of intranet page;Described According to each data service in the web page files, the corresponding data service request of each data service is packaged into a data Request, and the step of sending the request of data, comprising:
Document frame is created in the web page files;
According to the data service each in the web page files, the corresponding data service request of each data service is packaged into One internal web-page requests, and the internal web-page requests are sent in the document frame, the internal web-page requests are institute State the request of web page files internal request webpage.
3. according to the method described in claim 2, it is characterized in that, the response data packet includes internal web page files;It is described The coding transfer method of internal web page files is block transmission coding, and the internal web page files are inside the web page files Subnet page file.
4. according to the method described in claim 2, it is characterized in that, described according to the data industry each in the web page files The corresponding data service request of each data service is packaged into an internal web-page requests by business, and in the document frame Middle the step of sending the internal web-page requests, comprising:
List is created in the web page files, and sets the document frame for the opening destination of the list;
According to each data service in the web page files, input object is created in the list, each input object Value is respectively set to the corresponding data service request of each data service;
By calling the submission function of the list, an internal web-page requests are formed, and send the internal web-page requests.
5. the method according to claim 1, which is characterized in that described according in the web page files The corresponding data service request of each data service is packaged into a request of data, and sends the number by each data service The step of according to request, comprising:
According to the module division mode of each data service in the web page files, by the corresponding data industry of each data service Business request is packaged into a request of data, and sends the request of data;
The response data packet is according to the module division mode, and piecemeal responds each data industry in the request of data The data packet of business request and return.
6. a kind of webpage response method, which comprises
Web-page requests are received, and return to web page files according to the web-page requests;
Receive request of data;
The request of data is parsed to obtain at least one data service request, and is obtained according to the data service request Request data;
Piecemeal responds each data service request in the request of data, returns to the response data including the request data Packet.
7. according to the method described in claim 6, it is characterized in that, described parsed to obtain at least one to the request of data A data service request, and the step of according to the data service request acquisition request data, comprising:
Parse the request of data, obtain module division mode and at least one according to the module division mode data service Request;
According to the module division mode and the data service request, piecemeal acquisition request data.
8. the method according to the description of claim 7 is characterized in that the piecemeal responds each number in the request of data According to service request, the response data packet for including the steps that the request data is returned, comprising:
When often getting the request data of a module, the data industry in module described in the request of data is responded Business request, returning response data packet.
9. a kind of webpage loading device, described device include:
Web-page requests sending module, for sending web-page requests, the web-page requests carry web page address;
Web page files receiving module, for receiving the web page files for responding the web-page requests and returning;
Request of data sending module, for according to each data service in the web page files, each data service to be corresponded to Data service request be packaged into a request of data, and send the request of data;
Response data receiving module, for receiving the response data packet of piecemeal return, the response data packet responds institute for piecemeal The data packet stating each data service request in request of data and returning.
10. device according to claim 9, which is characterized in that the request of data includes the request of intranet page;The dress It sets, further includes: document frame establishes module;
The document frame establishes module, for creating document frame in the web page files;
The request of data sending module is used for according to the data service each in the web page files, by each data industry Corresponding data service request of being engaged in is packaged into an internal web-page requests, and the internal webpage is sent in the document frame Request, the internal web-page requests are the request of the web page files internal request webpage.
11. device according to claim 10, it is characterised in that:
The response data packet includes internal web page files;The coding transfer method of the internal web page files is block transmission volume Code, the internal web page files are the subnet page file inside the web page files;
The request of data sending module, comprising:
List creating unit is set as creating list in the web page files, and by the opening destination of the list The document frame;
Input object setting unit, for creating input in the list according to each data service in the web page files Object, the value of each input object are respectively set to the corresponding data service request of each data service;
Web-page requests transmission unit forms an internal web-page requests, concurrently for the submission function by calling the list Send the internal web-page requests.
12. according to device described in claim 9 to 11 any one, it is characterised in that:
The request of data sending module will for the module division mode according to each data service in the web page files The corresponding data service request of each data service is packaged into a request of data, and sends the request of data;
The response data packet is according to the module division mode, and piecemeal responds each data industry in the request of data The data packet of business request and return.
13. a kind of webpage responding device, described device, comprising:
Web page files return module returns to web page files for receiving web-page requests, and according to the web-page requests;
Request of data receiving module, is requested for receiving data;
Data parsing obtains module, obtains at least one data service request, and root for being parsed to the request of data According to the data service request acquisition request data;
Deblocking respond module responds each data service request in the request of data for piecemeal, and return includes The response data packet of the request data.
14. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 8 the method when executing the computer program.
15. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any item of the claim 1 to 8 is realized when being executed by processor.
CN201810474122.2A 2018-05-17 2018-05-17 Webpage loading and responding method and device, computer equipment and storage medium Active CN110505258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810474122.2A CN110505258B (en) 2018-05-17 2018-05-17 Webpage loading and responding method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810474122.2A CN110505258B (en) 2018-05-17 2018-05-17 Webpage loading and responding method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110505258A true CN110505258A (en) 2019-11-26
CN110505258B CN110505258B (en) 2021-12-14

Family

ID=68585024

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810474122.2A Active CN110505258B (en) 2018-05-17 2018-05-17 Webpage loading and responding method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110505258B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143650A (en) * 2019-12-16 2020-05-12 东软集团股份有限公司 Method, device, medium and electronic equipment for acquiring page data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888456A (en) * 2014-03-18 2014-06-25 国家电网公司 Webpage client side, server side and data processing device and method
CN104199951A (en) * 2014-09-12 2014-12-10 百度在线网络技术(北京)有限公司 Webpage processing method and webpage processing device
US20160124920A1 (en) * 2014-10-31 2016-05-05 Douglas A. Golay Combination web browser based dental practice management software system with embedded web browser based dental imaging software
CN106549989A (en) * 2015-09-17 2017-03-29 腾讯科技(深圳)有限公司 A kind of data transmission method and its system, user terminal, application server
CN107145490A (en) * 2016-03-01 2017-09-08 腾讯科技(深圳)有限公司 Webpage loads methods of exhibiting and webpage loading exhibiting device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888456A (en) * 2014-03-18 2014-06-25 国家电网公司 Webpage client side, server side and data processing device and method
CN104199951A (en) * 2014-09-12 2014-12-10 百度在线网络技术(北京)有限公司 Webpage processing method and webpage processing device
US20160124920A1 (en) * 2014-10-31 2016-05-05 Douglas A. Golay Combination web browser based dental practice management software system with embedded web browser based dental imaging software
CN106549989A (en) * 2015-09-17 2017-03-29 腾讯科技(深圳)有限公司 A kind of data transmission method and its system, user terminal, application server
CN107145490A (en) * 2016-03-01 2017-09-08 腾讯科技(深圳)有限公司 Webpage loads methods of exhibiting and webpage loading exhibiting device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143650A (en) * 2019-12-16 2020-05-12 东软集团股份有限公司 Method, device, medium and electronic equipment for acquiring page data
CN111143650B (en) * 2019-12-16 2024-04-26 东软集团股份有限公司 Method, device, medium and electronic equipment for acquiring page data

Also Published As

Publication number Publication date
CN110505258B (en) 2021-12-14

Similar Documents

Publication Publication Date Title
CN107622135B (en) Method and apparatus for displaying information
CN103942225B (en) A kind of resource transfer method, client and the system of mixed type applications client
CN110069297B (en) SPRING MVC-based exception handling method, SPRING MVC-based exception handling device, computer equipment and storage medium
CN110688598B (en) Service parameter acquisition method and device, computer equipment and storage medium
CN109284454B (en) Page rendering method, device, computer equipment and storage medium
CN103970760B (en) A kind of web-page requests processing method and processing device
WO2017088509A1 (en) Page customization method and device
WO2020151333A1 (en) Page loading method, apparatus, computer device and storage medium
CN105718313A (en) Application operation method and device
CN110647699A (en) Web page rendering method and device, computer equipment and storage medium
CN110020329B (en) Method, device and system for generating webpage
CN104301443A (en) Method and system for calling end capacity ports on web page
CN110221871B (en) Webpage acquisition method and device, computer equipment and storage medium
CN113382083B (en) Webpage screenshot method and device
CN104317570B (en) The apparatus and method of dynamic analysis Web applications
CN113010827A (en) Page rendering method and device, electronic equipment and storage medium
CN107315646A (en) Data flow control method and device between page assembly
CN105955714A (en) Mixed development front end MVC frame implementation method and system
CN111880789A (en) Page rendering method, device, server and computer-readable storage medium
CN112631564A (en) Content management system-based interface generation method, device, equipment and storage medium
CN106487662B (en) Information sharing method and device
CN111079048A (en) Page loading method and device
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN104156421B (en) The page shows method, apparatus and system
TW201441837A (en) System and method of loading control

Legal Events

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