WO2018014594A1 - 网络请求及响应的处理方法、装置、终端、服务器及存储介质 - Google Patents

网络请求及响应的处理方法、装置、终端、服务器及存储介质 Download PDF

Info

Publication number
WO2018014594A1
WO2018014594A1 PCT/CN2017/079671 CN2017079671W WO2018014594A1 WO 2018014594 A1 WO2018014594 A1 WO 2018014594A1 CN 2017079671 W CN2017079671 W CN 2017079671W WO 2018014594 A1 WO2018014594 A1 WO 2018014594A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource data
request
identifier
merge
merge request
Prior art date
Application number
PCT/CN2017/079671
Other languages
English (en)
French (fr)
Inventor
向洋君
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Priority to SG11201709927WA priority Critical patent/SG11201709927WA/en
Priority to EP17801316.5A priority patent/EP3393104B1/en
Priority to US15/579,266 priority patent/US10574773B2/en
Priority to AU2017268628A priority patent/AU2017268628A1/en
Priority to JP2017565714A priority patent/JP6525486B2/ja
Publication of WO2018014594A1 publication Critical patent/WO2018014594A1/zh

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/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • 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/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms

Definitions

  • the present application relates to the field of Internet technologies, and in particular, to a method, an apparatus, a terminal, a server, and a storage medium for processing a network request and response.
  • HTTP HyperText Transfer Protocol
  • HTTP HyperText Transfer Protocol
  • the server returns all the resources requested by the merged HTTP request at one time, and the client needs to receive all the resources before using the resource.
  • the client takes a long time to wait for all the resources to be received, which will cause the response speed of each request to be slow in the case of merging HTTP requests, and the web page display speed is also slow.
  • a method, an apparatus, a terminal, a server, and a storage medium for processing a network request and response are provided.
  • a method for processing a network request and response comprising:
  • a method for processing a network request and response comprising:
  • the boundary identifiers included in the resource data are extracted, and the resource data corresponding to each request in the merge request is extracted and processed according to the obtained boundary identifiers.
  • a device for processing a network request and response comprising:
  • a merge module for merging multiple requests to obtain a merge request
  • a sending module configured to send the merge request to a server
  • a detecting module configured to detect a current state identifier of the merge request
  • the resource receiving module is configured to: when the status indicated by the current status identifier is data transmission, receive resource data corresponding to each request in the merge request returned by the server, and detect the received resource data, and obtain a boundary identifier included in the received resource data;
  • a processing module configured to extract, according to the acquired boundary identifiers, resource data corresponding to each request in the merge request, for processing;
  • the stopping module is configured to stop receiving the resource data when the status indicated by the current status identifier is complete.
  • a device for processing a network request and response comprising:
  • a request receiving module configured to receive a merge request sent by the client
  • a parsing module configured to parse the merge request, and obtain resource data corresponding to each request in the merge request
  • a returning module configured to perform separation processing on resource data corresponding to each request in the merge request by using a boundary identifier, and return the separated resource data to the client, so that the client receives the
  • the boundary identifiers included in the resource data are obtained, and the resource data corresponding to each request in the merge request is extracted and processed according to the acquired boundary identifiers.
  • a terminal comprising a memory and a processor, the memory storing computer executable instructions, the computer executable instructions being executed by the processor, causing the processor to perform the following steps:
  • a server comprising a memory and a processor, the memory storing computer executable instructions, the computer executable instructions being executed by the processor, such that the processor performs the following steps:
  • the boundary identifiers included in the resource data are extracted, and the resource data corresponding to each request in the merge request is extracted and processed according to the obtained boundary identifiers.
  • One or more non-volatile readable storage media storing computer-executable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
  • One or more non-volatile readable storage media storing computer-executable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
  • the boundary identifiers included in the resource data are extracted, and the resource data corresponding to each request in the merge request is extracted and processed according to the obtained boundary identifiers.
  • FIG. 1 is an application scenario diagram of a method for processing a network request and response in an embodiment
  • 2A is a block diagram of a terminal in an embodiment
  • 2B is a block diagram of a server in one embodiment
  • FIG. 3 is a flow chart of a method for processing a network request and response in an embodiment
  • FIG. 4 is a flowchart of processing, by the client, according to the boundary identifier extraction and resource data corresponding to each request in the merge request in an embodiment
  • FIG. 5 is a graphical explanatory diagram of a server returning, to a client, resource data corresponding to each request in a merge request in an embodiment
  • FIG. 6 is a flow chart of a method for processing a network request and response in another embodiment
  • FIG. 7 is a flowchart of a server parsing a merge request in an embodiment
  • FIG. 8 is a functional block diagram of a processing apparatus for network request and response in an embodiment
  • FIG. 9 is a functional block diagram of a processing device for a network request and response in another embodiment
  • Figure 10 is a functional block diagram of a parsing module in one embodiment.
  • FIG. 1 is an application scenario diagram of a method for processing a network request and response in an embodiment.
  • the client 10 located on the terminal merges multiple requests to obtain a merge request, and sends the merge request to the server 20.
  • the server 20 located on the server receives the merge request sent by the client 10, parses the merge request, and acquires resource data corresponding to each request in the merge request.
  • the server 20 merges the acquired resource data, and separates the resource data corresponding to each request by the boundary identifier.
  • the server 20 returns the resource data corresponding to each request to the client 10.
  • the client 10 detects the current status identifier of the merge request, and when the status indicated by the current status identifier is data transmission, the resource data corresponding to each request in the merge request returned by the server 20 is received, and the received resource data is detected and acquired.
  • the boundary identifiers included in the received resource data are extracted by the client 10 according to the acquired boundary identifiers, and the resource data corresponding to each request in the merge request is processed.
  • the client 10 stops receiving resource data.
  • FIG. 2A is a block diagram of a terminal in which the client 10 is located in an embodiment.
  • the terminal includes a processor, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device connected by a system bus.
  • the non-volatile storage medium of the terminal stores an operating system and computer-executable instructions, and the computer-executable instructions are used to implement a processing method for a network request and response applicable to the terminal provided in the embodiment of the present application.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the internal memory in the terminal provides an environment for operating the operating system and computer executable instructions in the non-volatile storage medium, and the network interface is used for network communication with the server, such as sending a merge request to the server on the server, and receiving the server.
  • the display screen of the terminal may be a liquid crystal display or an electronic ink display screen, etc., and is used as one of the output devices of the terminal;
  • the input device may be a touch layer covered on the display screen, or may be a button and a track ball set on the terminal housing. Or the touchpad, it can also be an external keyboard, touchpad or mouse.
  • the terminal can be a mobile phone, a tablet or a personal digital assistant or a wearable device.
  • FIG. 2A is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied.
  • the terminal may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • FIG. 2B is a block diagram of a server in which the server 20 is located in an embodiment.
  • the above server includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected through a system bus.
  • the non-volatile storage medium of the server stores an operating system, a database, and computer-executable instructions, and the database stores the resource data and the like.
  • the computer-executable instructions are used to implement the server-provided embodiment provided in the embodiment of the present application. A method of processing network requests and responses.
  • the server's processor is used to provide computing and control capabilities that support the operation of the entire server.
  • the internal memory of the server provides a cached operating environment for operating systems and computer executable instructions in a non-volatile storage medium.
  • the network interface of the server is used for communicating with the terminal, for example, receiving a merge request sent by a client on the terminal, returning resource data corresponding to each request in the merge request, and the like to the client on the terminal.
  • the server can be implemented with a stand-alone server or a server cluster consisting of multiple servers.
  • FIG. 2B is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • a method for processing a network request and response is provided, which is applicable to the terminal shown in FIG. 2A, and the method includes the following steps:
  • Step S302 combining multiple requests to obtain a merge request.
  • the client accesses the page through the URL address on the client on the terminal, and the client can generate multiple requests to request the page resource from the server on the server, and the request can be an HTTP request, FTP (File Transfer Protocol, file transfer protocol), etc.
  • the client may merge the requests according to the type of resource data requested by each generated request, and the type of the resource data may include CSS (Cascading) Style Sheets, cascading style sheets) files, JS (JavaScript) script files, images, etc.
  • the requested resource data may be merged into a request of the same type in a preset manner to obtain a merge request.
  • the preset manner may be that the pre-defined delimiter separates the resource data requested by the different request, for example, before the merge,
  • the corresponding requests for two different CSS files are: www.ttlsa.com/static/css/ttsa_concat.css And www.ttlsa.com/static/css/a.css, the combined request is http://www.ttlsa.com/static??css/ttlsa_concat.css,css/a.css,"??” symbol This is followed by the request content section and uses "," to separate the resource data requested by the different requests.
  • the requested resource data may also be combined as a request for a CSS file and a JS script file, and is not limited thereto.
  • Step S304 the merge request is sent to the server.
  • the client may send the merge request to the server.
  • the server may parse the merge request to obtain the target parameter of each request in the merge request, and the target parameter refers to the requested resource data, and the server obtains the resource data according to the parsing.
  • the target parameters of each request may query the resource data corresponding to each request, and return the obtained resource data to the client.
  • step S306 the current state identifier of the merge request is detected.
  • step S308 is performed, and when the state indicated by the current state identifier is complete, step S312 is performed.
  • the merge request may be in multiple states, which may include uninitialization, initialization, data transmission, data transfer, and completion of five states, for example, when the client sends a merge request header to the server.
  • the merge request is in the state of sending data.
  • the server sends a response to the client and sends the requested resource data
  • the merge request is in the state of data transfer.
  • the current status identifier of the merge request can be
  • the readyState parameter, the readyState parameter can correspond to five different values and is used to represent different states of the merge request.
  • uninitialization, initialization, data transmission, data transfer, and completion of five states can correspond to 0, 1, 2, and 3, respectively. 4, but not limited to this.
  • the current state identifier can also be represented by a letter or symbol.
  • Step S308 when the status indicated by the current status identifier is data transmission, receiving resource data corresponding to each request in the merge request returned by the server, and detecting the received resource data, and acquiring the boundary identifier included in the received resource data.
  • the client When the client detects that the status indicated by the current status identifier of the merge request is in data transfer, it indicates that the client receives the response information sent by the server, and can start receiving the resource data returned by the server.
  • the client may detect the received resource data, and when detecting that the received resource data includes a boundary identifier, that is, the merge request is successfully received.
  • the complete resource data corresponding to a request can be extracted and processed for use.
  • the boundary identifier is used to separate the resource data corresponding to each request, and the boundary identifier may include a separation line and a timestamp.
  • the timestamp may be a sequence of characters, which is used to refer to the time when the server sends the resource data, and the boundary identifier includes the separation line and the time.
  • the stamp guarantees the uniqueness of the resource data.
  • Step S310 extracting resource data corresponding to each request in the merge request according to the acquired boundary identifiers for processing.
  • the resource data corresponding to the request may be extracted for processing.
  • the merge request contains two requests a and b, a request is used to request the a.css file, b request is used to request the b.css file, and the server obtains the a.css and b.css files and returns them to the client.
  • the returned data contains a boundary identifier for separating the a.css file and the b.css file.
  • the client When the client receives the data, when the boundary identifier is detected, it indicates that the a.css file has been successfully received or successfully received.
  • the .css file can be used to extract previously received data for processing.
  • the client can compile the extracted resource data into the template engine to generate the corresponding HTML (HyperText Markup Language, a super text markup language) string that renders the display page.
  • HTML HyperText Markup Language, a super text markup language
  • Step S312 when the status indicated by the current status identifier is completed, the receiving of the resource data is stopped.
  • the client After the server sends all the resource data, the client receives a segment with an end tag. At this time, the status indicated by the current status indicator of the merge request becomes complete, and the client stops receiving resource data. For the secondary resource data request, the client may choose to send the next merge request to the server to obtain the corresponding resource data, or may close the connection with the server.
  • the client merges multiple requests, obtains a merge request, and sends the merge request to the server.
  • the client detects the current status identifier of the merge request, and when the status indicated by the current status identifier is data transmission, receiving resource data corresponding to each request in the merge request returned by the server, and detecting that the acquired resource data is included
  • the boundary identifiers are extracted according to the acquired boundary identifiers, and the resource data corresponding to each request in the merge request is extracted one by one, and the resource data requested by each request is extracted for processing in the process of transmitting the resource data, without waiting for all resource data.
  • the response speed of each request can be accelerated in the case of a merge request, thereby speeding up the rendering and rendering of the page.
  • step S310 extracts resource data corresponding to each request in the merge request according to the acquired boundary identifier, and includes:
  • Step S402 it is determined whether the acquired boundary identifier is the first boundary identifier in the received resource data, and if yes, step S404 is performed, and if no, step S406 is performed.
  • the client In the process of receiving the resource data returned by the server, when the client detects that the received resource data includes a boundary identifier, it is determined whether the boundary identifier is the first boundary identifier, that is, whether the first detection is received.
  • the resource data contains a boundary identifier.
  • Step S404 extracting the previously received resource data for processing.
  • the acquired boundary identifier is the first boundary identifier in the received resource data, that is, when the client first detects that the received resource data includes a boundary identifier
  • the previously received resource data is corresponding to a request in the merge request.
  • the resource data is extracted and used to process the previously received resource data.
  • Step S406 extracting resource data received between the acquired boundary identifier and the previously acquired boundary identifier for processing.
  • the boundary identifier is included, indicating that the detected boundary identifier is detected last time.
  • the resource data received between the boundary identifiers is the resource data corresponding to a request in the merge request, and the resource data received between the acquired boundary identifier and the last acquired boundary identifier is extracted, for example, the client.
  • the second time the boundary identifier is acquired the resource data received between the first acquired boundary identifier and the second acquired boundary identifier is extracted for processing.
  • FIG. 5 is a graphic explanatory diagram of resource data returned by a client receiving server in an embodiment.
  • the client receives data 1, data 2, ... data 6 from the server.
  • the boundary identifier is detected for the first time, indicating that the previously received data 1 and data 2 are corresponding to a request in the merge request.
  • the resource data is extracted, and the resource data in the data 1 and the data 2 are extracted for processing.
  • the boundary identifier is detected for the second time, indicating that the boundary identifier is detected for the first time and the boundary identifier is detected for the second time.
  • the received data 3 and data 4 are resource data corresponding to another request in the merge request, and the resource data in the data 3 and the data 4 are extracted for processing.
  • the method further includes: extracting the resource data received after the last acquired boundary identifier for processing.
  • the resource data received after the last acquired boundary identifier may be extracted for processing, and the resource data received after the last acquired boundary identifier is a request in the merge request. Take the resource data.
  • the start identifier and the end identifier may be set, the start identifier is placed at the front end of all resource data, and the end identifier is placed at the end of all resource data.
  • the resource data received between the last acquired boundary identifier and the end identifier may be extracted for processing.
  • the acquired boundary identifier is the first boundary identifier of the received resource data
  • the boundary identifier of the start identifier and the acquired identifier may be extracted.
  • the received resource data is processed and is not limited to the above.
  • the client extracts the resource data corresponding to each request in the merge request according to the detected boundary identifier, and does not need to wait for all the resource data to be transmitted and then use the resource data.
  • the response speed of each request is accelerated, thereby speeding up the rendering of the page.
  • a method for processing a network request and response is provided, which is applicable to the server as described in FIG. 2B, and the method includes the following steps:
  • Step S610 receiving a merge request sent by the client.
  • the client on the terminal merges the generated multiple requests, obtains the merge request, and sends the merge request to the server on the server, and the server receives the merge request sent by the client.
  • Step S620 parsing the merge request, and acquiring resource data corresponding to each request in the merge request.
  • the server may parse the merge request, and obtain resource data corresponding to each request in the merge request according to the parsing result.
  • step S620 parses the merge request and acquires resource data corresponding to each request in the merge request, including:
  • Step S702 parsing the merge request according to the preset split symbol to obtain target parameters of each request.
  • the resource data requested by the different requests may be separated by a preset delimiter, for example, the resource data requested by the different requests is separated by using ",”, ",” or the like as a delimiter.
  • the server may parse the body part in the merge request information according to the pre-agreed separation symbol with the client, and obtain the target parameter of each request, and the target parameter may be used to refer to the requested resource data.
  • Step S704 querying resource data corresponding to each request according to target parameters of each request.
  • the server queries and obtains resource data corresponding to each request according to the target parameters of each request obtained by the parsing.
  • the target parameters obtained by the server parsing the merge request include a.css, b.css, and c.css, that is, the merge request is specified.
  • the obtained resource data is sent to the client.
  • Step S630 performing separation processing on the resource data corresponding to each request in the merge request by using the boundary identifier, and returning the separated resource data to the client, so that the client obtains the resource data included when receiving the resource data.
  • the boundary identifier is extracted, and the resource data corresponding to each request in the merge request is extracted one by one according to the obtained boundary identifier.
  • the server may send the response information to the client, and return the resource data corresponding to each request in the merge request to the client, and may add the boundary identifier after the resource data corresponding to the different requests in the merge request, and use the boundary identifier to identify each request.
  • the corresponding resource data is separated to separate resource data corresponding to different requests, and the server does not necessarily need to separate the resource data according to the order of each request in the merge request.
  • the boundary identifier may include a separation line and a timestamp, and the timestamp may be a sequence of characters used to refer to the time when the server sends the resource data.
  • the server may return the separated resource data to the client, and when the client receives the resource data corresponding to each request in the merge request returned by the server, the client may detect the received resource data, and when the received data is detected,
  • the resource data includes a boundary identifier, that is, the complete resource data corresponding to a request in the merge request has been successfully received, and the resource data of this part can be extracted and processed for use.
  • the server receives the merge request sent by the client, parses the merge request, and obtains the resource data corresponding to each request in the merge request, and separates the resource data corresponding to the different request by the boundary identifier, and then sends the resource data corresponding to the different request to the client.
  • the client detects and acquires the boundary identifier included in the received resource data, and extracts the resource data corresponding to each request in the merge request according to the acquired boundary identifier, and processes the client.
  • the terminal can extract the resource data requested by each request for processing in the process of transmitting the resource data, without waiting for all the resource data to be transmitted and then using the resource data, and can accelerate the response speed of each request in the case of the merge request, thereby Speed up the rendering of the page.
  • a network request and response processing apparatus including a merge module 810, a sending module 820, a detecting module 830, a resource receiving module 840, a processing module 850, and a stopping module 860.
  • the merging module 810 is configured to combine multiple requests to obtain a merge request.
  • the client accesses the page through the URL address on the client, and the client can generate multiple requests to request the page resource from the server on the server, and the request can be an HTTP request, an FTP request, or the like.
  • the client may merge the requests according to the type of resource data requested by each generated request, and the types of the resource data may include a CSS file, a JS script file, a picture, and the like.
  • the requested resource data may be merged into a request of the same type in a preset manner to obtain a merge request.
  • the preset manner may be that the pre-defined delimiter separates the resource data requested by the different request, for example, before the merge,
  • the corresponding requests for two different CSS files are: www.ttlsa.com/static/css/ttsa_concat.css And www.ttlsa.com/static/css/a.css, the combined request is http://www.ttlsa.com/static??css/ttlsa_concat.css,css/a.css,"??” symbol This is followed by the request content section and uses "," to separate the resource data requested by the different requests.
  • the requested resource data may also be combined as a request for a CSS file and a JS script file, and is not limited thereto.
  • the sending module 820 is configured to send a merge request to the server.
  • the client may send the merge request to the server.
  • the server may parse the merge request to obtain the target parameter of each request in the merge request, and the target parameter refers to the requested resource data, and the server obtains the resource data according to the parsing.
  • the target parameters of each request may query the resource data corresponding to each request, and return the obtained resource data to the client.
  • the detecting module 830 is configured to detect a current status identifier of the merge request.
  • the merge request may be in multiple states, which may include uninitialization, initialization, data transmission, data transfer, and completion of five states, for example, when the client sends a merge request header to the server.
  • the merge request is in the state of sending data.
  • the server sends a response to the client and sends the requested resource data
  • the merge request is in the state of data transfer.
  • the current status identifier of the merge request can be
  • the readyState parameter, the readyState parameter can correspond to five different values and is used to represent different states of the merge request.
  • uninitialization, initialization, data transmission, data transfer, and completion of five states can correspond to 0, 1, 2, and 3, respectively. 4, but not limited to this.
  • the current state identifier can also be represented by a letter or symbol.
  • the resource receiving module 840 is configured to: when the status indicated by the current status identifier is data transmission, receive resource data corresponding to each request in the merge request returned by the server, and detect the received resource data, and obtain the received resource data.
  • the client When the client detects that the status indicated by the current status identifier of the merge request is in data transfer, it indicates that the client receives the response information sent by the server, and can start receiving the resource data returned by the server.
  • the client may detect the received resource data, and when detecting that the received resource data includes a boundary identifier, that is, the merge request is successfully received.
  • the complete resource data corresponding to a request can be extracted and processed for use.
  • the boundary identifier is used to separate the resource data corresponding to each request, and the boundary identifier may include a separation line and a timestamp.
  • the timestamp may be a sequence of characters, which is used to refer to the time when the server sends the resource data, and the boundary identifier includes the separation line and the time.
  • the stamp guarantees the uniqueness of the resource data.
  • the processing module 850 is configured to extract, according to the acquired boundary identifiers, resource data corresponding to each request in the merge request, for processing.
  • the resource data corresponding to the request may be extracted for processing.
  • the merge request contains two requests a and b, a request is used to request the a.css file, b request is used to request the b.css file, and the server obtains the a.css and b.css files and returns them to the client.
  • the returned data contains a boundary identifier for separating the a.css file and the b.css file.
  • the client When the client receives the data, when the boundary identifier is detected, it indicates that the a.css file has been successfully received or successfully received.
  • the .css file can be used to extract previously received data for processing.
  • the client can compile the extracted resource data into the template engine to generate a corresponding HTML string and render the display page.
  • the stopping module 860 is configured to stop receiving resource data when the status indicated by the current status identifier is complete.
  • the client After the server sends all the resource data, the client receives a segment with an end tag. At this time, the status indicated by the current status indicator of the merge request becomes complete, and the client stops receiving resource data. For the secondary resource data request, the client may choose to send the next merge request to the server to obtain the corresponding resource data, or may close the connection with the server.
  • the processing device for the network request and response merges the multiple requests, obtains the merge request, and sends the merge request to the server.
  • the client detects the current status identifier of the merge request, and when the status indicated by the current status identifier is data transmission, receiving resource data corresponding to each request in the merge request returned by the server, and detecting that the acquired resource data is included
  • the boundary identifiers are extracted according to the acquired boundary identifiers, and the resource data corresponding to each request in the merge request is extracted one by one, and the resource data requested by each request is extracted for processing in the process of transmitting the resource data, without waiting for all resource data.
  • the response speed of each request can be accelerated in the case of a merge request, thereby speeding up the rendering and rendering of the page.
  • the processing module 850 is further configured to: when the acquired boundary identifier is the first boundary identifier in the received resource data, extract the previously received resource data for processing, where the acquired boundary identifier is not the received resource data. In the first boundary identifier, the resource data received between the acquired boundary identifier and the last acquired boundary identifier is extracted for processing.
  • the client In the process of receiving the resource data returned by the server, when the client detects that the received resource data includes a boundary identifier, it is determined whether the boundary identifier is the first boundary identifier, that is, whether the first detection is received.
  • the resource data contains a boundary identifier. If the acquired boundary identifier is the first boundary identifier in the received resource data, that is, when the client first detects that the received resource data includes a boundary identifier, the previously received resource data is corresponding to a request in the merge request.
  • the resource data is extracted and used to process the previously received resource data.
  • the boundary identifier is included, indicating that the detected boundary identifier is detected last time.
  • the resource data received between the boundary identifiers is the resource data corresponding to a request in the merge request, and the resource data received between the acquired boundary identifier and the last acquired boundary identifier is extracted, for example, the client.
  • the second time the boundary identifier is acquired the resource data received between the first acquired boundary identifier and the second acquired boundary identifier is extracted for processing.
  • the processing module 850 is further configured to extract resource data received after the last acquired boundary identifier for processing.
  • the resource data received after the last acquired boundary identifier may be extracted for processing, and the resource data received after the last acquired boundary identifier is a request in the merge request. Take the resource data.
  • the start identifier and the end identifier may be set, the start identifier is placed at the front end of all resource data, and the end identifier is placed at the end of all resource data.
  • the resource data received between the last acquired boundary identifier and the end identifier may be extracted for processing.
  • the acquired boundary identifier is the first boundary identifier of the received resource data
  • the boundary identifier of the start identifier and the acquired identifier may be extracted.
  • the received resource data is processed and is not limited to the above.
  • the client extracts the resource data corresponding to each request in the merge request according to the detected boundary identifier, and does not need to wait for all the resource data to be transmitted and then use the resource data.
  • the response speed of each request is accelerated, thereby speeding up the rendering of the page.
  • the merging module 810 may receive a URL address input by a user through an input device of the terminal, and merge the generated multiple requests by the processor to obtain a merge request, where the input device may be an overlay on the display screen.
  • the touch layer, the button provided on the terminal shell, the external keyboard, the touchpad or the mouse, etc., the processor may be the central processing unit (CPU), the microprocessor, etc.; the sending module 820 may pass through the terminal
  • the network interface sends a merge request to the server on the server, where the network interface can be an Ethernet card, a wireless network card, or the like.
  • the above modules may be embedded in the hardware of the terminal or may be stored in the memory of the terminal in the form of software, so that the processor can call the corresponding operations of the above modules.
  • a processing device for a network request and response including a request receiving module 910, a parsing module 920, and a return module 930.
  • the receiving module 910 is configured to receive a merge request sent by the client.
  • the client merges the generated multiple requests, obtains the merge request, and sends the merge request to the server, and the server receives the merge request sent by the client.
  • the parsing module 920 is configured to parse the merge request and acquire resource data corresponding to each request in the merge request.
  • the server may parse the merge request, and obtain resource data corresponding to each request in the merge request according to the parsing result.
  • the parsing module 920 includes a parsing unit 922 and a query unit 924.
  • the parsing unit 922 is configured to parse the merge request according to the preset split symbol to obtain target parameters of each request.
  • the resource data requested by the different requests may be separated by a preset delimiter, for example, the resource data requested by the different requests is separated by using ",”, ",” or the like as a delimiter.
  • the server may parse the body part in the merge request information according to the pre-agreed separation symbol with the client, and obtain the target parameter of each request, and the target parameter may be used to refer to the requested resource data.
  • the querying unit 924 is configured to query resource data corresponding to each request according to the target parameter of each request.
  • the server queries and obtains resource data corresponding to each request according to the target parameters of each request obtained by the parsing.
  • the target parameters obtained by the server parsing the merge request include a.css, b.css, and c.css, that is, the merge request is specified.
  • the obtained resource data is sent to the client.
  • the returning module 930 is configured to identify the resource data corresponding to each request in the merge request by using the boundary, and return the separated resource data to the client, so that the client obtains the resource data included when receiving the resource data.
  • the boundary identifier is extracted, and the resource data corresponding to each request in the merge request is extracted one by one according to the obtained boundary identifier.
  • the server may send the response information to the client, and return the resource data corresponding to each request in the merge request to the client, and may add the boundary identifier after the resource data corresponding to the different requests in the merge request, and use the boundary identifier to identify each request.
  • the corresponding resource data is separated to separate resource data corresponding to different requests, and the server does not necessarily need to separate the resource data according to the order of each request in the merge request.
  • the boundary identifier may include a separation line and a timestamp, and the timestamp may be a sequence of characters used to refer to the time when the server sends the resource data.
  • the server may return the separated resource data to the client, and when the client receives the resource data corresponding to each request in the merge request returned by the server, the client may detect the received resource data, and when the received data is detected,
  • the resource data includes a boundary identifier, that is, the complete resource data corresponding to a request in the merge request has been successfully received, and the resource data of this part can be extracted and processed for use.
  • the server receives the merge request sent by the client, parses the merge request, and obtains the resource data corresponding to each request in the merge request, and separates the resource data corresponding to the different requests by the boundary identifier, and then sends the resource data corresponding to the different requests to the client. Returning the processed resource data, so that when receiving the resource data, the client detects and acquires the boundary identifier included in the received resource data, and extracts the resource data corresponding to each request in the merge request according to the acquired boundary identifier, and processes the client.
  • the terminal can extract the resource data requested by each request for processing in the process of transmitting the resource data, without waiting for all the resource data to be transmitted and then using the resource data, and can accelerate the response speed of each request in the case of the merge request, thereby Speed up the rendering of the page.
  • the various modules in the above-described network request and response processing device may be implemented in whole or in part by software, hardware or a combination thereof.
  • the receiving module 910 can receive the merge request sent by the client on the terminal through the network interface on the server, where the network interface can be an Ethernet card, a wireless network card, etc.; the parsing unit 922 can process through the server.
  • the device parses the merge request to obtain the target parameters of each request, wherein the processor can be a central processing unit, a microprocessor, or the like.
  • the above modules may be embedded in the hardware of the server or may be stored in the memory of the server in a software form, so that the processor can call the corresponding operations of the above modules.
  • the storage medium may be a magnetic disk, an optical disk, or a read-only storage memory (Read-Only)
  • a nonvolatile storage medium such as a memory or a ROM, or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种网络请求及响应的处理方法,包括:将多个请求进行合并,得到合并请求;将所述合并请求发送给服务端;检测所述合并请求的当前状态标识;当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。

Description

网络请求及响应的处理方法、装置、终端、服务器及存储介质
本申请要求于 2016 年 7 月 20 日提交中国专利局、申请号为 2016105758522 、发明名称为' 网络请求及响应的处理方法和装置 '的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
【技术领域】
本申请涉及互联网技术领域,特别是涉及一种网络请求及响应的处理方法、装置、终端、服务器及存储介质。
【背景技术】
用户通过URL(Uniform Resource Locator,统一资源定位符)访问网页时,客户端会生成HTTP(HyperText Transfer Protocol,超文本传输协议)请求,并将HTTP 请求发送给服务端,从而获取页面相关的资源。为了优化客户端的性能,可以选择将客户端产生的多个HTTP请求进行合并,从而减少HTTP的请求数,这样能够减少DNS(Domain Name System,域名系统)请求所消耗的时间,减轻服务器压力,且因为减少了HTTP请求的头部信息,能提高带宽性能。
但是,在传统的方式中,当客户端合并HTTP请求并发送给服务端时,服务端会一次性返回合并的HTTP请求所请求的所有资源,客户端需要在接收完所有的资源后才能使用资源,客户端要耗费较长的时间等待接收完所有的资源,会造成在合并HTTP请求的情况下,各个请求的响应速度慢的问题,使得网页显示速度也变慢。
【发明内容】
根据本申请的各种实施例,提供一种网络请求及响应的处理方法、装置、终端、服务器及存储介质。
一种网络请求及响应的处理方法,包括:
将多个请求进行合并,得到合并请求;
将所述合并请求发送给服务端;
检测所述合并请求的当前状态标识;
当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
一种网络请求及响应的处理方法,包括:
接收客户端发送的合并请求;
解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
一种网络请求及响应的处理装置,包括:
合并模块,用于将多个请求进行合并,得到合并请求;
发送模块,用于将所述合并请求发送给服务端;
检测模块,用于检测所述合并请求的当前状态标识;
资源接收模块,用于当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
处理模块,用于根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
停止模块,用于当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
一种网络请求及响应的处理装置,包括:
请求接收模块,用于接收客户端发送的合并请求;
解析模块,用于解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
返回模块,用于通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
一种终端,包括存储器和处理器,所述存储器中储存有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,使得所述处理器执行以下步骤:
将多个请求进行合并,得到合并请求;
将所述合并请求发送给服务端;
检测所述合并请求的当前状态标识;
当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
一种服务器,包括存储器和处理器,所述存储器中储存有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,使得所述处理器执行以下步骤:
接收客户端发送的合并请求;
解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
一个或多个存储有计算机可执行指令的非易失性可读存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
将多个请求进行合并,得到合并请求;
将所述合并请求发送给服务端;
检测所述合并请求的当前状态标识;
当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
一个或多个存储有计算机可执行指令的非易失性可读存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
接收客户端发送的合并请求;
解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
本发明的一个或多个实施例的细节在下面的附图和描述中提出。本发明的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
【附图说明】
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中网络请求及响应的处理方法的应用场景图;
图2A为一个实施例中终端的框图;
图2B为一个实施例中服务器的框图;
图3为一个实施例中网络请求及响应的处理方法的流程图;
图4为一个实施例中客户端根据边界标识提取与合并请求中各个请求对应的资源数据进行处理的流程图;
图5为一个实施例中服务端向客户端返回与合并请求中的各个请求对应的资源数据的图形说明图;
图6为另一个实施例中网络请求及响应的处理方法的流程图;
图7为一个实施例中服务端解析合并请求的流程图;
图8为一个实施例中网络请求及响应的处理装置的功能模块图;
图9为另一个实施例中网络请求及响应的处理装置的功能模块图;
图10为一个实施例中解析模块的功能模块图。
【具体实施方式】
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。
图1为一个实施例中网络请求及响应的处理方法的应用场景图。如图1所示,位于终端上的客户端10将多个请求进行合并,得到合并请求,并将合并请求发送给服务端20。位于服务器上的服务端20接收客户端10发送的合并请求,解析该合并请求,并获取与合并请求中各个请求对应的资源数据。服务端20合并获取的资源数据,并通过边界标识分隔与各个请求对应的资源数据。服务端20向客户端10返回与各个请求对应的资源数据。客户端10检测合并请求的当前状态标识,当该当前状态标识指示的状态为数据传送中,则接收服务端20返回的与合并请求中各个请求对应的资源数据,并检测接收的资源数据,获取接收的资源数据中包含的边界标识,客户端10根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理。当当前状态标识指示的状态为完成时,则客户端10停止接收资源数据。
图2A为一个实施例中上述客户端10所在的终端的框图。如图2A所示,该终端包括通过系统总线连接的处理器、非易失性存储介质、内存储器、网络接口、显示屏和输入装置。其中,终端的非易失性存储介质存储有操作系统及计算机可执行指令,该计算机可执行指令用于实现本申请实施例中提供的适用于终端上的一种网络请求及响应的处理方法。该处理器用于提供计算和控制能力,支撑整个终端的运行。终端中的内存储器为非易失性存储介质中的操作系统及计算机可执行指令的运行提供环境,网络接口用于与服务器进行网络通信,如向服务器上的服务端发送合并请求、接收服务器上的服务端返回的与合并请求中各个请求对应的资源数据等。终端的显示屏可以是液晶显示屏或者电子墨水显示屏等,用于作为终端的输出装置之一;输入装置可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。该终端可以是手机、平板电脑或者个人数字助理或穿戴式设备等。本领域技术人员可以理解,图2A中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体地终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
图2B为一个实施例中上述服务端20所在的服务器的框图。如图2B所示,上述服务器包括通过系统总线连接的处理器、非易失性存储介质、内存储器和网络接口。其中,该服务器的非易失性存储介质存储有操作系统、数据库和计算机可执行指令,数据库中存储有资源数据等,该计算机可执行指令用于实现本申请实施例中提供的适用于服务器的一种网络请求及响应的处理方法。该服务器的处理器用于提供计算和控制能力,支撑整个服务器的运行。该服务器的内存储器为非易失性存储介质中的操作系统和计算机可执行指令提供高速缓存的运行环境。该服务器的网络接口用于与终端进行通信,例如接收终端上的客户端发送的合并请求、向终端上的客户端返回与合并请求中各个请求对应的资源数据等。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。本领域技术人员可以理解,图2B中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体地服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如图3所示,在一个实施例中,提供一种网络请求及响应的处理方法,可适用于如图2A所示的终端,该方法包括以下步骤:
步骤S302,将多个请求合并,得到合并请求。
用户在终端上的客户端通过URL地址访问页面,客户端可生成多个请求向服务器上的服务端请求页面资源,请求可为HTTP请求、FTP(File Transfer Protocol,文件传输协议)请求等。客户端可根据生成的各个请求所请求的资源数据的类型对请求进行合并,资源数据的类型可包括CSS(Cascading Style Sheets,层叠样式表)文件、JS(JavaScript)脚本文件、图片等。可将所请求的资源数据为同类型的请求按照预设的方式进行合并,得到合并请求,预设的方式可为预先定义分隔符号分隔不同的请求所请求的资源数据,例如,在合并之前,两个不同的CSS文件对应的请求分别为:www.ttlsa.com/static/css/ttsa_concat.css 及www.ttlsa.com/static/css/a.css,合并后的请求为http://www.ttlsa.com/static??css/ttlsa_concat.css,css/a.css,“??”符号后为请求内容部分,并利用“,”分隔不同的请求所请求的资源数据。在其它的实施例中,也可将请求的资源数据为CSS文件及JS脚本文件的请求进行合并,并不限于此。
步骤S304,将合并请求发送给服务端。
客户端可将合并请求发送给服务端,服务端接收到合并请求后,解析合并请求可得到合并请求中各个请求的目标参数,目标参数即指代所请求的资源数据,服务端根据解析得到的各个请求的目标参数可查询获取到各个请求对应的资源数据,并将获取的资源数据返回给客户端。
步骤S306,检测合并请求的当前状态标识,当当前状态标识指示的状态为数据传送中,则执行步骤S308,当当前状态标识指示的状态为完成时,则执行步骤S312。
客户端发送合并请求给服务端后,合并请求可能处于多个状态,可包括未初始化、初始化、发送数据、数据传送中及完成5个状态,例如当客户端向服务端发送合并请求的头部信息时,合并请求处于发送数据状态,当服务端向客户端回送应答,并发送所请求的资源数据时,合并请求处于数据传送中的状态。合并请求的当前状态标识可为 readyState参数,readyState参数可对应5个不同的值,用于代表合并请求的不同状态,例如,未初始化、初始化、发送数据、数据传送中及完成5个状态可分别对应0、1、2、3、4,但不限于此。除了用数字表示合并请求的当前状态,当前状态标识也可用字母或符号表示。
步骤S308,当当前状态标识指示的状态为数据传送中,则接收服务端返回的与合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取接收的资源数据中包含的边界标识。
当客户端检测到合并请求的当前状态标识指示的状态为数据传送中时,即表示客户端接收到服务端发送的应答信息,可开始接收服务端返回的资源数据。在接收服务端返回的与合并请求中的各个请求对应的资源数据时,客户端可检测接收的资源数据,当检测到接收的资源数据中包含边界标识,即表示已成功接收到合并请求中的某个请求对应的完整的资源数据,可将这部分的资源数据提取出来进行处理使用。边界标识用于分隔各个请求对应的资源数据,边界标识可包括分隔线及时间戳,时间戳可为一个字符序列,用于指代服务端发送该资源数据的时间,边界标识包括分隔线及时间戳可保证资源数据的唯一性。
步骤S310,根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理。
在客户端接收服务器返回的资源数据的过程中,每当检测到一个边界标识,即表示有合并请求中的某个请求对应的资源数据已接收完整,即可提取该请求对应的资源数据进行处理,例如,合并请求包含a及b两个请求,a请求用于请求a.css文件,b请求用于请求b.css文件,服务端获取a.css及b.css文件并返回给客户端,返回的数据中包含一个边界标识用于分隔a.css文件及b.css文件,客户端在接收数据的过程中,当检测到边界标识时,即表示已成功接收a.css文件或成功接收b.css文件,即可提取之前接收的数据进行处理。客户端可将提取的资源数据放入模板引擎中进行编译,生成相应的HTML(HyperText Markup Language,超级文本标记语言)字符串,渲染显示页面。
步骤S312,当当前状态标识指示的状态为完成时,则停止接收资源数据。
当服务端发送完所有的资源数据后,客户端会接收到一个带结束标记的报文段,此时,合并请求的当前状态标识指示的状态变为完成,客户端停止接收资源数据,完成本次资源数据请求,客户端可选择向服务端发送下一个合并请求获取相应的资源数据,也可选择关闭与服务端的连接。
上述网络请求及响应的处理方法,客户端将多个请求合并,得到合并请求,并将合并请求发送给服务端。客户端检测合并请求的当前状态标识,当该当前状态标识指示的状态为数据传送中,则接收服务端返回的与合并请求中的各个请求对应的资源数据,并检测获取接收的资源数据中包含的边界标识,根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理,能够在传输资源数据的过程中,提取各个请求所请求的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
如图4所示,在一个实施例中,步骤S310根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理,包括:
步骤S402,判断获取的边界标识是否为接收的资源数据中的第一个边界标识,若是,则执行步骤S404,若否,则执行步骤S406。
在客户端接收服务端返回的资源数据的过程中,每当检测到接收的资源数据中包含边界标识,则判断该边界标识是否为第一个边界标识,即是否是第一次检测到接收的资源数据中包含边界标识。
步骤S404,提取之前接收的资源数据进行处理。
若获取的边界标识是接收的资源数据中第一个边界标识,即当客户端第一次检测到接收的资源数据中包含边界标识,表示之前接收的资源数据为合并请求中某个请求对应的资源数据,则提取之前接收的资源数据进行处理使用。
步骤S406,提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
若获取的边界标识不是接收的资源数据中第一个边界标识,即当客户端不是第一次检测到接收的资源数据中包含边界标识,表示在本次检测到的边界标识与上一次检测到的边界标识之间接收的资源数据为合并请求中某一请求对应的资源数据,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理,例如,客户端第二次获取到边界标识,则提取在第一次获取的边界标识与第二次获取的边界标识之间接收的资源数据进行处理。如图5所示,图5为一个实施例中客户端接收服务端返回的资源数据的图形说明图。客户端接收来自服务端的数据1、数据2……数据6,当客户端接收到数据2时,第一次检测到边界标识,说明之前接收的数据1及数据2是合并请求中某个请求对应的资源数据,则提取数据1及数据2中的资源数据进行处理,当客户接收到数据4时第二次检测到边界标识,说明在第一次检测到边界标识到第二次检测到边界标识之间接收的数据3及数据4是合并请求中另一个请求对应的资源数据,则提取数据3及数据4中的资源数据进行处理。
在一个实施例中,在步骤S312当当前状态标识指示的状态为完成时,则停止接收资源数据之后,还包括:提取在最后一次获取的边界标识之后接收的资源数据进行处理。
当客户端全部接收完服务端发送的资源数据后,可提取在最后一次获取的边界标识之后接收的资源数据进行处理,在最后一次获取的边界标识之后接收的资源数据为合并请求中某个请求以应的资源数据。在其它的实施例中,可设置开始标识及结束标识,开始标识放在所有资源数据的最前端,结束标识放在所有资源数据的最末端,当客户端全部接收完服务端发送的资源数据后,可提取在最后一次获取的边界标识与结束标识之间接收的资源数据进行处理,当获取的边界标识为接收的资源数据的第一个边界标识,则可提取在开始标识与获取的边界标识之间接收的资源数据进行处理,并不仅限于上述方式。
在本实施例中,在传输资源数据的过程中,客户端根据检测获取到的边界标识提取合并请求中各个请求对应的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
如图6所示,提供一种网络请求及响应的处理方法,可适用于如图2B所述的服务器,该方法包括以下步骤:
步骤S610,接收客户端发送的合并请求。
终端上的客户端合并生成的多个请求,得到合并请求,并将合并请求发送给服务器上的服务端,服务端接收客户端发送的合并请求。
步骤S620,解析合并请求,并获取与合并请求中的各个请求对应的资源数据。
服务端接收到客户端发送的合并请求后,可解析合并请求,并根据解析结果获取与合并请求中的各个请求对应的资源数据。
如图7所示,在一个实施例中,步骤S620解析合并请求,并获取与合并请求中的各个请求对应的资源数据,包括:
步骤S702,根据预设的分隔符号解析合并请求得到各个请求的目标参数。
客户端在进行请求合并时,可通过预设的分隔符号分隔不同的请求所请求的资源数据,例如,利用“,”、“、”等作为分隔符号分隔不同的请求所请求的资源数据。服务端在解析合并请求时,可根据与客户端预先约定好的分隔符号解析合并请求信息中的主体部分,得到每个请求的目标参数,目标参数可用于指代所请求的资源数据。
步骤S704,根据各个请求的目标参数查询与各个请求对应的资源数据。
服务端根据解析得到的各个请求的目标参数查询并获取与各个请求对应的资源数据,例如,服务端解析合并请求得到的目标参数包括a.css、b.css及c.css,即说明合并请求中包含三个请求,分别请求a.css文件、b.css文件及c.css文件,则服务端根据目标参数查询并获取对应的a.css文件、b.css文件及c.css文件,并将获取到的资源数据发送给客户端。
步骤S630,通过边界标识对与合并请求中的各个请求对应的资源数据进行分隔处理,并向客户端返回分隔处理后的资源数据,以使客户端在接收资源数据时,获取资源数据中包含的边界标识,并根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理。
服务端可向客户端发送应答信息,并向客户端返回与合并请求中的各个请求对应的资源数据,可在合并请求中的不同请求对应的资源数据后添加边界标识,通过边界标识对各个请求对应的资源数据进行分隔处理,以此分隔不同请求对应的资源数据,服务器不一定需要按照合并请求中的各个请求的顺序对资源数据进行分隔处理。边界标识可包括分隔线及时间戳,时间戳可为一个字符序列,用于指代服务端发送该资源数据的时间。服务端可将分隔处理后的资源数据返回给客户端,在客户端接收服务端返回的与合并请求中的各个请求对应的资源数据时,客户端可检测接收的资源数据,当检测到接收的资源数据中包含边界标识,即表示已成功接收到合并请求中的某个请求对应的完整的资源数据,可将这部分的资源数据提取出来进行处理使用。
上述网络请求及响应的处理方法,服务端接收客户端发送的合并请求,解析合并请求后获取与合并请求中各个请求对应的资源数据,通过边界标识分隔不同请求对应的资源数据后,向客户端返回分隔处理后的资源数据,使得客户端在接收资源数据时,检测获取接收的资源数据中包含的边界标识,根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理,客户端能够在传输资源数据的过程中,提取各个请求所请求的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
如图8所示,在一个实施例中,提供一种网络请求及响应的处理装置,包括合并模块810、发送模块820、检测模块830、资源接收模块840、处理模块850及停止模块860。
合并模块810,用于将多个请求进行合并,得到合并请求。
用户在终端上的客户端通过URL地址访问页面,客户端可生成多个请求向服务器上的服务端请求页面资源,请求可为HTTP请求、FTP请求等。客户端可根据生成的各个请求所请求的资源数据的类型对请求进行合并,资源数据的类型可包括CSS文件、JS脚本文件、图片等。可将所请求的资源数据为同类型的请求按照预设的方式进行合并,得到合并请求,预设的方式可为预先定义分隔符号分隔不同的请求所请求的资源数据,例如,在合并之前,两个不同的CSS文件对应的请求分别为:www.ttlsa.com/static/css/ttsa_concat.css 及www.ttlsa.com/static/css/a.css,合并后的请求为http://www.ttlsa.com/static??css/ttlsa_concat.css,css/a.css,“??”符号后为请求内容部分,并利用“,”分隔不同的请求所请求的资源数据。在其它的实施例中,也可将请求的资源数据为CSS文件及JS脚本文件的请求进行合并,并不限于此。
发送模块820,用于将合并请求发送给服务端。
客户端可将合并请求发送给服务端,服务端接收到合并请求后,解析合并请求可得到合并请求中各个请求的目标参数,目标参数即指代所请求的资源数据,服务端根据解析得到的各个请求的目标参数可查询获取到各个请求对应的资源数据,并将获取的资源数据返回给客户端。
检测模块830,用于检测合并请求的当前状态标识。
客户端发送合并请求给服务端后,合并请求可能处于多个状态,可包括未初始化、初始化、发送数据、数据传送中及完成5个状态,例如当客户端向服务端发送合并请求的头部信息时,合并请求处于发送数据状态,当服务端向客户端回送应答,并发送所请求的资源数据时,合并请求处于数据传送中的状态。合并请求的当前状态标识可为 readyState参数,readyState参数可对应5个不同的值,用于代表合并请求的不同状态,例如,未初始化、初始化、发送数据、数据传送中及完成5个状态可分别对应0、1、2、3、4,但不限于此。除了用数字表示合并请求的当前状态,当前状态标识也可用字母或符号表示。
资源接收模块840,用于当当前状态标识指示的状态为数据传送中,则接收服务端返回的与合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取接收的资源数据中包含的边界标识。
当客户端检测到合并请求的当前状态标识指示的状态为数据传送中时,即表示客户端接收到服务端发送的应答信息,可开始接收服务端返回的资源数据。在接收服务端返回的与合并请求中的各个请求对应的资源数据时,客户端可检测接收的资源数据,当检测到接收的资源数据中包含边界标识,即表示已成功接收到合并请求中的某个请求对应的完整的资源数据,可将这部分的资源数据提取出来进行处理使用。边界标识用于分隔各个请求对应的资源数据,边界标识可包括分隔线及时间戳,时间戳可为一个字符序列,用于指代服务端发送该资源数据的时间,边界标识包括分隔线及时间戳可保证资源数据的唯一性。
处理模块850,用于根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理。
在客户端接收服务器返回的资源数据的过程中,每当检测到一个边界标识,即表示有合并请求中的某个请求对应的资源数据已接收完整,即可提取该请求对应的资源数据进行处理,例如,合并请求包含a及b两个请求,a请求用于请求a.css文件,b请求用于请求b.css文件,服务端获取a.css及b.css文件并返回给客户端,返回的数据中包含一个边界标识用于分隔a.css文件及b.css文件,客户端在接收数据的过程中,当检测到边界标识时,即表示已成功接收a.css文件或成功接收b.css文件,即可提取之前接收的数据进行处理。客户端可将提取的资源数据放入模板引擎中进行编译,生成相应的HTML字符串,渲染显示页面。
停止模块860,用于当当前状态标识指示的状态为完成时,则停止接收资源数据。
当服务端发送完所有的资源数据后,客户端会接收到一个带结束标记的报文段,此时,合并请求的当前状态标识指示的状态变为完成,客户端停止接收资源数据,完成本次资源数据请求,客户端可选择向服务端发送下一个合并请求获取相应的资源数据,也可选择关闭与服务端的连接。
上述网络请求及响应的处理装置,客户端将多个请求合并,得到合并请求,并将合并请求发送给服务端。客户端检测合并请求的当前状态标识,当该当前状态标识指示的状态为数据传送中,则接收服务端返回的与合并请求中的各个请求对应的资源数据,并检测获取接收的资源数据中包含的边界标识,根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理,能够在传输资源数据的过程中,提取各个请求所请求的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
在一个实施例中,处理模块850还用于当获取的边界标识是接收的资源数据中第一个边界标识时,则提取之前接收的资源数据进行处理,当获取的边界标识不是接收的资源数据中第一个边界标识时,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
在客户端接收服务端返回的资源数据的过程中,每当检测到接收的资源数据中包含边界标识,则判断该边界标识是否为第一个边界标识,即是否是第一次检测到接收的资源数据中包含边界标识。若获取的边界标识是接收的资源数据中第一个边界标识,即当客户端第一次检测到接收的资源数据中包含边界标识,表示之前接收的资源数据为合并请求中某个请求对应的资源数据,则提取之前接收的资源数据进行处理使用。若获取的边界标识不是接收的资源数据中第一个边界标识,即当客户端不是第一次检测到接收的资源数据中包含边界标识,表示在本次检测到的边界标识与上一次检测到的边界标识之间接收的资源数据为合并请求中某一请求对应的资源数据,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理,例如,客户端第二次获取到边界标识,则提取在第一次获取的边界标识与第二次获取的边界标识之间接收的资源数据进行处理。
处理模块850还用于提取在最后一次获取的边界标识之后接收的资源数据进行处理。
当客户端全部接收完服务端发送的资源数据后,可提取在最后一次获取的边界标识之后接收的资源数据进行处理,在最后一次获取的边界标识之后接收的资源数据为合并请求中某个请求以应的资源数据。在其它的实施例中,可设置开始标识及结束标识,开始标识放在所有资源数据的最前端,结束标识放在所有资源数据的最末端,当客户端全部接收完服务端发送的资源数据后,可提取在最后一次获取的边界标识与结束标识之间接收的资源数据进行处理,当获取的边界标识为接收的资源数据的第一个边界标识,则可提取在开始标识与获取的边界标识之间接收的资源数据进行处理,并不仅限于上述方式。
在本实施例中,在传输资源数据的过程中,客户端根据检测获取到的边界标识提取合并请求中各个请求对应的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
上述网络请求及响应的处理装置中的各个模块可全部或部分通过软件、硬件或其组合来实现。例如,在硬件实现上,上述合并模块810可通过终端的输入装置接收用户输入的URL地址,并通过处理器将生成的多个请求合并得到合并请求,其中,该输入装置可以是显示屏上覆盖的触摸层、终端外壳上设置的按键、外接的键盘、触控板或鼠标等,处理器可以是该处理器可以为中央处理单元(CPU)、微处理器等;发送模块820可通过终端的网络接口向服务器上的服务端发送合并请求,其中,网络接口可以是以太网卡、无线网卡等。上述各模块可以硬件形式内嵌于或独立于终端的处理器中,也可以以软件形式存储于终端的存储器中,以便于处理器调用执行以上各个模块对应的操作。
如图9所示,在一个实施例中,提供一种网络请求及响应的处理装置,包括请求接收模块910、解析模块920及返回模块930。
接收模块910,用于接收客户端发送的合并请求。
客户端合并生成的多个请求,得到合并请求,并将合并请求发送给服务端,服务端接收客户端发送的合并请求。
解析模块920,用于解析合并请求,并获取与合并请求中的各个请求对应的资源数据。
服务端接收到客户端发送的合并请求后,可解析合并请求,并根据解析结果获取与合并请求中的各个请求对应的资源数据。
如图10所示,在一个实施例中,解析模块920包括解析单元922及查询单元924。
解析单元922,用于根据预设的分隔符号解析合并请求得到各个请求的目标参数。
客户端在进行请求合并时,可通过预设的分隔符号分隔不同的请求所请求的资源数据,例如,利用“,”、“、”等作为分隔符号分隔不同的请求所请求的资源数据。服务端在解析合并请求时,可根据与客户端预先约定好的分隔符号解析合并请求信息中的主体部分,得到每个请求的目标参数,目标参数可用于指代所请求的资源数据。
查询单元924,用于根据各个请求的目标参数查询与各个请求对应的资源数据。
服务端根据解析得到的各个请求的目标参数查询并获取与各个请求对应的资源数据,例如,服务端解析合并请求得到的目标参数包括a.css、b.css及c.css,即说明合并请求中包含三个请求,分别请求a.css文件、b.css文件及c.css文件,则服务端根据目标参数查询并获取对应的a.css文件、b.css文件及c.css文件,并将获取到的资源数据发送给客户端。
返回模块930,用于通过边界标识对与合并请求中的各个请求对应的资源数据,并向客户端返回分隔处理后的资源数据,以使客户端在接收资源数据时,获取资源数据中包含的边界标识,并根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理。
服务端可向客户端发送应答信息,并向客户端返回与合并请求中的各个请求对应的资源数据,可在合并请求中的不同请求对应的资源数据后添加边界标识,通过边界标识对各个请求对应的资源数据进行分隔处理,以此分隔不同请求对应的资源数据,服务器不一定需要按照合并请求中的各个请求的顺序对资源数据进行分隔处理。边界标识可包括分隔线及时间戳,时间戳可为一个字符序列,用于指代服务端发送该资源数据的时间。服务端可将分隔处理后的资源数据返回给客户端,在客户端接收服务端返回的与合并请求中的各个请求对应的资源数据时,客户端可检测接收的资源数据,当检测到接收的资源数据中包含边界标识,即表示已成功接收到合并请求中的某个请求对应的完整的资源数据,可将这部分的资源数据提取出来进行处理使用。
上述网络请求及响应的处理装置,服务端接收客户端发送的合并请求,解析合并请求后获取与合并请求中各个请求对应的资源数据,通过边界标识分隔不同请求对应的资源数据后,向客户端返回分隔处理后的资源数据,使得客户端在接收资源数据时,检测获取接收的资源数据中包含的边界标识,根据获取的边界标识逐一提取与合并请求中各个请求对应的资源数据进行处理,客户端能够在传输资源数据的过程中,提取各个请求所请求的资源数据进行处理,无需等待所有的资源数据传输完再使用资源数据,能够在合并请求的情况下,加速各个请求的响应速度,从而加快页面的渲染显示速度。
上述网络请求及响应的处理装置中的各个模块可全部或部分通过软件、硬件或其组合来实现。例如,在硬件实现上,上述接收模块910可通过服务器上的网络接口接收终端上的客户端发送的合并请求,其中,网络接口可以是以太网卡、无线网卡等;解析单元922可通过服务器的处理器解析合并请求得到各个请求的目标参数,其中,处理器可以为中央处理单元、微处理器等。上述各模块可以硬件形式内嵌于或独立于服务器的处理器中,也可以以软件形式存储于服务器的存储器中,以便于处理器调用执行以上各个模块对应的操作。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种网络请求及响应的处理方法,包括:
    将多个请求进行合并,得到合并请求;
    将所述合并请求发送给服务端;
    检测所述合并请求的当前状态标识;
    当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
    根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
    当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
  2. 根据权利要求1所述的方法,其特征在于,所述根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理,包括:
    当获取的边界标识是接收的资源数据中第一个边界标识时,则提取之前接收的资源数据进行处理;及
    当获取的边界标识不是接收的资源数据中第一个边界标识时,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
  3. 根据权利要求1所述的方法,其特征在于,在所述当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据之后,所述方法还包括:
    提取在最后一次获取的边界标识之后接收的资源数据进行处理。
  4. 一种网络请求及响应的处理方法,包括:
    接收客户端发送的合并请求;
    解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
    通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
  5. 根据权利要求4所述的方法,其特征在于,所述解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据,包括:
    根据预设的分隔符号解析所述合并请求得到各个请求的目标参数;及
    根据所述各个请求的目标参数查询与各个请求对应的资源数据。
  6. 一种网络请求及响应的处理装置,包括:
    合并模块,用于将多个请求进行合并,得到合并请求;
    发送模块,用于将所述合并请求发送给服务端;
    检测模块,用于检测所述合并请求的当前状态标识;
    资源接收模块,用于当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
    处理模块,用于根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
    停止模块,用于当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
  7. 根据权利要求6所述的装置,其特征在于,所述处理模块还用于当获取的边界标识是接收的资源数据中第一个边界标识时,则提取之前接收的资源数据进行处理,当获取的边界标识不是接收的资源数据中第一个边界标识时,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
  8. 根据权利要求6所述的装置,其特征在于,所述处理模块还用于提取在最后一次获取的边界标识之后接收的资源数据进行处理。
  9. 一种网络请求及响应的处理装置,包括:
    请求接收模块,用于接收客户端发送的合并请求;
    解析模块,用于解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
    返回模块,用于通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
  10. 根据权利要求9所述的装置,其特征在于,所述解析模块包括:
    解析单元,用于根据预设的分隔符号解析所述合并请求得到各个请求的目标参数;及
    查询单元,用于根据所述各个请求的目标参数查询与各个请求对应的资源数据。
  11. 一种终端,包括存储器和处理器,所述存储器中储存有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,使得所述处理器执行以下步骤:
    将多个请求进行合并,得到合并请求;
    将所述合并请求发送给服务端;
    检测所述合并请求的当前状态标识;
    当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
    根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
    当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
  12. 根据权利要求11所述的终端,其特征在于,所述根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理,包括:
    当获取的边界标识是接收的资源数据中第一个边界标识时,则提取之前接收的资源数据进行处理;及
    当获取的边界标识不是接收的资源数据中第一个边界标识时,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
  13. 根据权利要求11所述的终端,其特征在于,所述计算机可执行指令被所述处理器执行时,还使得所述处理器在执行所述当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据的步骤之后,还执行:
    提取在最后一次获取的边界标识之后接收的资源数据进行处理的步骤。
  14. 一种服务器,包括存储器和处理器,所述存储器中储存有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,使得所述处理器执行以下步骤:
    接收客户端发送的合并请求;
    解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
    通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
  15. 根据权利要求14所述的服务器,所述解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据,包括:
    根据预设的分隔符号解析所述合并请求得到各个请求的目标参数;及
    根据所述各个请求的目标参数查询与各个请求对应的资源数据。
  16. 一个或多个存储有计算机可执行指令的非易失性可读存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    将多个请求进行合并,得到合并请求;
    将所述合并请求发送给服务端;
    检测所述合并请求的当前状态标识;
    当所述当前状态标识指示的状态为数据传送中,则接收所述服务端返回的与所述合并请求中的各个请求对应的资源数据,并检测接收的资源数据,获取所述接收的资源数据中包含的边界标识;
    根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理;及
    当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据。
  17. 根据权利要求16所述的非易失性可读存储介质,其特征在于,所述根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理,包括:
    当获取的边界标识是接收的资源数据中第一个边界标识时,则提取之前接收的资源数据进行处理;及
    当获取的边界标识不是接收的资源数据中第一个边界标识时,则提取在本次获取的边界标识与上一次获取的边界标识之间接收的资源数据进行处理。
  18. 根据权利要求16所述的非易失性可读存储介质,其特征在于,所述计算机可执行指令被一个或多个处理器执行时,还使得所述一个或多个处理器在执行所述当所述当前状态标识指示的状态为完成时,则停止接收所述资源数据的步骤之后,还执行:
    提取在最后一次获取的边界标识之后接收的资源数据进行处理的步骤。
  19. 一个或多个存储有计算机可执行指令的非易失性可读存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收客户端发送的合并请求;
    解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据;及
    通过边界标识对与所述合并请求中的各个请求对应的资源数据进行分隔处理,并向所述客户端返回分隔处理后的资源数据,以使所述客户端在接收所述资源数据时,获取所述资源数据中包含的边界标识,并根据获取的边界标识逐一提取与所述合并请求中各个请求对应的资源数据进行处理。
  20. 根据权利要求19所述的非易失性可读存储介质,其特征在于,所述解析所述合并请求,并获取与所述合并请求中的各个请求对应的资源数据,包括:
    根据预设的分隔符号解析所述合并请求得到各个请求的目标参数;及
    根据所述各个请求的目标参数查询与各个请求对应的资源数据。
PCT/CN2017/079671 2016-07-20 2017-04-07 网络请求及响应的处理方法、装置、终端、服务器及存储介质 WO2018014594A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
SG11201709927WA SG11201709927WA (en) 2016-07-20 2017-04-07 Method, device, terminal, server and storage medium of processing network request and response
EP17801316.5A EP3393104B1 (en) 2016-07-20 2017-04-07 Requests and responses processing methods, terminal, server and computer-readable media
US15/579,266 US10574773B2 (en) 2016-07-20 2017-04-07 Method, device, terminal, server and storage medium of processing network request and response
AU2017268628A AU2017268628A1 (en) 2016-07-20 2017-04-07 Method, device, terminal, server and storage medium of processing network request and response
JP2017565714A JP6525486B2 (ja) 2016-07-20 2017-04-07 ネットワークリクエスト及びレスポンスの処理方法、端末、サーバ及び記憶媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610575852.2 2016-07-20
CN201610575852.2A CN106993016B (zh) 2016-07-20 2016-07-20 网络请求及响应的处理方法和装置

Publications (1)

Publication Number Publication Date
WO2018014594A1 true WO2018014594A1 (zh) 2018-01-25

Family

ID=59414338

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079671 WO2018014594A1 (zh) 2016-07-20 2017-04-07 网络请求及响应的处理方法、装置、终端、服务器及存储介质

Country Status (7)

Country Link
US (1) US10574773B2 (zh)
EP (1) EP3393104B1 (zh)
JP (1) JP6525486B2 (zh)
CN (1) CN106993016B (zh)
AU (1) AU2017268628A1 (zh)
SG (1) SG11201709927WA (zh)
WO (1) WO2018014594A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733879A (zh) * 2017-09-29 2018-02-23 努比亚技术有限公司 客户端启动方法、移动终端和计算机储存介质
CN110047371B (zh) * 2018-01-15 2022-03-25 北京四维图新科技股份有限公司 一种矢量电子地图的渲染方法及装置
US20190253357A1 (en) * 2018-10-15 2019-08-15 Intel Corporation Load balancing based on packet processing loads
CN111355803A (zh) * 2020-03-04 2020-06-30 海南金盘智能科技股份有限公司 网页的传输方法、客户端和应用服务器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120054295A1 (en) * 2010-08-30 2012-03-01 International Business Machines Corporation Method and apparatus for providing or acquiring the contents of a network resource for a mobile device
CN103312803A (zh) * 2013-06-17 2013-09-18 杭州华三通信技术有限公司 一种Web访问体验优化方法及装置
CN103731399A (zh) * 2012-10-11 2014-04-16 北京百度网讯科技有限公司 基于cdn网络的数据访问方法、系统及装置
US20140172868A1 (en) * 2012-12-17 2014-06-19 General Electric Company System and method for storage, querying, and analysis service for time series data
CN104113564A (zh) * 2013-04-17 2014-10-22 中国移动通信集团公司 超文本传输协议连接复用方法、设备、系统及终端

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6845403B2 (en) * 2001-10-31 2005-01-18 Hewlett-Packard Development Company, L.P. System and method for storage virtualization
JP4704105B2 (ja) 2005-05-24 2011-06-15 株式会社リコー 通信装置、通信システム及び通信方法
CN101442675B (zh) * 2008-12-31 2012-01-11 中兴通讯股份有限公司 一种多媒体播放方法
JP5641921B2 (ja) * 2010-12-20 2014-12-17 キヤノン株式会社 画像処理装置、画像処理装置と外部装置を有するシステム、システムの制御方法、及びプログラム
CN103297452B (zh) * 2012-02-24 2016-08-24 北京对角巷科技发展有限公司 一种在互联网发布和直播流媒体的方法及系统
BR122015005210A2 (pt) 2012-06-28 2019-08-20 Ericsson Ab Método e sistema para inserção de anúncio em entrega de mídia ao vivo over the top
EP2750355A1 (en) 2012-12-28 2014-07-02 Koninklijke KPN N.V. Reducing a number of server-client sessions
WO2014123884A1 (en) * 2013-02-07 2014-08-14 Interdigital Patent Holdings, Inc. Methods and apparatuses for restful batch services
JP2015090511A (ja) * 2013-11-05 2015-05-11 株式会社日立システムズ 分散Webアップロードシステム
JP6287174B2 (ja) * 2013-12-24 2018-03-07 株式会社リコー 情報処理システム、情報処理装置、情報処理方法および情報処理プログラム
US9350484B2 (en) * 2014-03-18 2016-05-24 Qualcomm Incorporated Transport accelerator implementing selective utilization of redundant encoded content data functionality
US10075549B2 (en) * 2016-01-25 2018-09-11 Quest Software Inc. Optimizer module in high load client/server systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120054295A1 (en) * 2010-08-30 2012-03-01 International Business Machines Corporation Method and apparatus for providing or acquiring the contents of a network resource for a mobile device
CN103731399A (zh) * 2012-10-11 2014-04-16 北京百度网讯科技有限公司 基于cdn网络的数据访问方法、系统及装置
US20140172868A1 (en) * 2012-12-17 2014-06-19 General Electric Company System and method for storage, querying, and analysis service for time series data
CN104113564A (zh) * 2013-04-17 2014-10-22 中国移动通信集团公司 超文本传输协议连接复用方法、设备、系统及终端
CN103312803A (zh) * 2013-06-17 2013-09-18 杭州华三通信技术有限公司 一种Web访问体验优化方法及装置

Also Published As

Publication number Publication date
CN106993016B (zh) 2019-04-02
US20180309842A1 (en) 2018-10-25
US10574773B2 (en) 2020-02-25
AU2017268628A1 (en) 2018-02-08
EP3393104A1 (en) 2018-10-24
JP6525486B2 (ja) 2019-06-05
EP3393104B1 (en) 2021-06-16
CN106993016A (zh) 2017-07-28
JP2018533092A (ja) 2018-11-08
SG11201709927WA (en) 2018-05-30
EP3393104A4 (en) 2019-03-06

Similar Documents

Publication Publication Date Title
WO2018014594A1 (zh) 网络请求及响应的处理方法、装置、终端、服务器及存储介质
WO2016169410A1 (zh) 登录方法、服务器和登录系统
WO2019174090A1 (zh) 截屏文件分享的控制方法、装置、设备和计算机存储介质
WO2020147396A1 (zh) 服务域名的动态配置方法、装置、设备及存储介质
WO2018103315A1 (zh) 监控数据的处理方法、装置、服务器及存储设备
WO2014008858A1 (zh) 实现跨域跳转的方法以及浏览器、域名服务器
WO2020062644A1 (zh) Json劫持漏洞的检测方法、装置、设备及存储介质
WO2015103954A1 (en) Information sharing method, information sharing apparatus, and electronic device
WO2016101441A1 (zh) 一种进行文件同步的方法及系统
WO2021072881A1 (zh) 基于对象存储的请求处理方法、装置、设备及存储介质
WO2013180476A1 (ko) M2m 통신용 장치 및 방법
WO2015018243A1 (zh) 一种基于iOS设备的网页拦截方法和设备
WO2017190561A1 (zh) 通过虚拟键盘实现密码输入的方法、终端、服务器、系统和存储介质
WO2019109957A1 (zh) 基于esb的服务提供方法、装置、设备及可读存储介质
WO2020077832A1 (zh) 云桌面的访问方法、装置、设备及存储介质
WO2018035929A1 (zh) 一种验证码的处理方法及装置
WO2020062640A1 (zh) 终端应用动态文案的语言切换方法、服务器及存储介质
WO2020253120A1 (zh) 网页注册方法、系统、设备和计算机存储介质
WO2015199271A1 (en) Method and system for sharing files over p2p
WO2018036168A1 (zh) 数据处理任务执行方法、装置、执行服务器和存储介质
WO2020258672A1 (zh) 网络访问的异常检测方法和装置
WO2021027134A1 (zh) 数据存储方法、装置、设备和计算机存储介质
WO2015161644A1 (zh) 一种资源地址的生成方法、装置及系统
WO2015020259A1 (ko) 다국어 변환이 용이한 스마트기기
WO2020186780A1 (zh) 用户操作录制还原方法、装置、设备及可读存储介质

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 11201709927W

Country of ref document: SG

WWE Wipo information: entry into national phase

Ref document number: 15579266

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2017565714

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2017268628

Country of ref document: AU

Date of ref document: 20170407

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17801316

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE