CN106656920B - Processing method, device, storage medium and the processor of HTTP service - Google Patents

Processing method, device, storage medium and the processor of HTTP service Download PDF

Info

Publication number
CN106656920B
CN106656920B CN201510728862.0A CN201510728862A CN106656920B CN 106656920 B CN106656920 B CN 106656920B CN 201510728862 A CN201510728862 A CN 201510728862A CN 106656920 B CN106656920 B CN 106656920B
Authority
CN
China
Prior art keywords
http
processing
response
request
http request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510728862.0A
Other languages
Chinese (zh)
Other versions
CN106656920A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510728862.0A priority Critical patent/CN106656920B/en
Publication of CN106656920A publication Critical patent/CN106656920A/en
Application granted granted Critical
Publication of CN106656920B publication Critical patent/CN106656920B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or 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
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention discloses a kind of processing method and processing devices of HTTP service, are related to technical field of telecommunications, to solve the problems, such as processing HTTP request/response efficiency is low and invents.The method comprise the steps that the HTTP request initiated front end intercepts;Unified batch processing is carried out to the HTTP request of interception;By treated, HTTP request is sent to server;Intercept the http response that the server returns;Unified batch processing is carried out to the http response of interception;By treated, http response is sent to corresponding front end.During carrying out batch processing to the HTTP request based on same or similar service logic/response.

Description

Processing method, device, storage medium and the processor of HTTP service
Technical field
The present invention relates to technical field of telecommunications more particularly to a kind of processing method and processing devices of HTTP service.
Background technique
Existing Network Access Method be mostly based on hypertext transfer protocol (Hypertext Transfer Trotocol, Abbreviation HTTP) it realizes.User end to server initiates a HTTP request, some data resource of request.Server pair The content of HTTP request is parsed, and carries out data query according to querying condition, and will look by way of returning to http response The data resource ask returns to client.
When sending HTTP request to server, it usually needs handle in client-side HTTP request, such as right Requesting method in HTTP request header (header) is rewritten, or based on the business demand of customization to HTTP request Increase data etc. in message body portion (body).And after the http response for receiving server return, it is also desirable to http response It is handled, such as the data format in modification http response header, or in statusline in http response message Status code is modified.In the prior art, a client HTTP request of every initiation or when receiving a http response, all Single treatment can be carried out to HTTP request/response by particular thread.
During above-mentioned processing HTTP request/response, inventors have found that when HTTP request or the quantity of response are more When, the process resource for very expending client is individually handled a large amount of HTTP request/response.Especially in these requests Or response, when being all based on the same or similar business demand logic and realizing, the same or similar treatment process can generate a large amount of superfluous Remaining operation, so that the efficiency of HTTP processing is very low.
Summary of the invention
The present invention provides a kind of processing method and processing device of HTTP service, it is able to solve processing HTTP in the prior art and asks Seek/low the problem of response efficiency.
To solve aforementioned technical problem, on the one hand, the present invention provides a kind of processing method of HTTP service, the methods Include:
The HTTP request initiated front end intercepts;
Unified batch processing is carried out to the HTTP request of interception;
By treated, HTTP request is sent to server;
Intercept the http response that the server returns;
Unified batch processing is carried out to the http response of interception;
By treated, http response is sent to corresponding front end.
On the other hand, the present invention also provides a kind of processing unit of HTTP service, described device includes:
First interception unit, for being intercepted to the HTTP request that front end is initiated;
First processing units, for carrying out unified batch processing to the HTTP request of interception;
First transmission unit, for HTTP request to be sent to server by treated;
Second interception unit, the http response returned for intercepting the server;
The second processing unit, for carrying out unified batch processing to the http response of interception;
Second transmission unit, for http response to be sent to corresponding front end by treated.
The processing method and processing device of HTTP service provided by the invention, the HTTP that server can be sent to front end are asked It asks and server returns to the http response of front end and intercepted respectively, and unification is carried out to HTTP request/response of interception Batch processing.Then by treated, HTTP request is sent to server, and http response returns to front end by treated. Compared with prior art, the present invention can carry out batch processing to the HTTP request based on same or similar service logic/response, It therefore saves on and handles redundant operation caused by HTTP request/response one by one, promote the treatment effeciency of HTTP.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of processing method flow chart of HTTP service provided in an embodiment of the present invention;
Fig. 2 shows the processing method flow charts of another HTTP service provided in an embodiment of the present invention;
Fig. 3 shows a kind of composition block diagram of the processing unit of HTTP service provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of processing methods of HTTP service, as shown in Figure 1, this method comprises:
101, the HTTP request initiated front end intercepts.
The executing subject of the present embodiment, which can be mobile phone, laptop, PC, portable intelligent device etc., to be had Data-handling capacity and the client that human-computer interaction can be carried out by peripheral hardware.The front end is primarily referred to as directly carrying out with user The interactive page/interface.In general, an application process at least has a page, therefore an application process at least corresponding one A front end.
In practical application, a page can initiate HTTP request based on the inquiry operation of user, and this HTTP request is User is appreciable.Furthermore the page can also initiate the non HTTP request of user on backstage, such as render in browser When webpage, browser kernel is needed according to cascading style sheets (Cascading Style Sheets, abbreviation CSS) and hypertext mark The figure that note language (Hyper Text Markup Language, abbreviation HTML) source code is shown into requesting page server face The contents such as piece, text, this HTTP request will not usually be interacted with user.
For a client, the front end quantity being related to is generally multiple, and each front end can be successive Or multiple HTTP requests are initiated simultaneously, therefore client needs to handle multiple HTTP requests in the present embodiment, it is corresponding, At step 104, client receives and http response quantity to be treated is also multiple.
In the present embodiment, when HTTP request is initiated in front end, client not carries out each HTTP request respectively Processing, but HTTP request is intercepted, batch processing is uniformly then carried out to the multiple HTTP requests intercepted.
102, unified batch processing is carried out to the HTTP request of interception.
Processing mode involved in the present embodiment includes general procedure mode in the prior art, such as modification HTTP request The requesting method of header also includes the business demand logic based on customization and the processing that carries out, such as in HTTP request report The body portion of text increases timestamp or message digest algorithm 5 (Message-Digest Algorithm 5, abbreviation MD5) value.This Embodiment does not limit the specific processing mode of client.
In the prior art, client just needs to call a thread resources to this when a HTTP request is initiated in front end HTTP request is handled.And in the present embodiment, client can intercept HTTP request to be sent, then pass through one A thread resources handle multiple HTTP request batches.Compared with prior art, the present embodiment can greatly reduce thread The call number of resource, especially for the feelings for carrying out HTTP request processing based on particular traffic requirements logic in corporate intranet Condition, since HTTP request quantity is more huge, and the processing logic of HTTP request is identical or more similar, therefore uses this reality The mode for applying example, which carries out HTTP request, can save a large amount of repeated treatment process (i.e. redundant operation), thus greatly reduce into The consumption of Cheng Ziyuan.
Further, when the processing logic difference of different HTTP requests, client can be according to processing logic pair HTTP request is classified, then respectively by the process resource with processing amount of logic same number respectively to different classes of HTTP request is handled.Due in practical application, handle logic quantity will be much smaller than HTTP request quantity, therefore even if Increase the calling to thread resources, the thread resources expended for this case compared with the prior art are also extremely limited.
103, by treated, HTTP request is sent to server.
After carrying out batch processing to multiple HTTP requests, client is according to the requesting party recorded in HTTP request message HTTP request is sent to server by method and server info.Client can be sent all HTTP requests simultaneously, HTTP request can also successively be sent according to different transmission rules.In a kind of implementation of the present embodiment, institute State send rule can be, but not limited to be: 1, according to front end initiate HTTP request sequencing send;2, according to the excellent of front end First grade is successively sent;3, the requirement height according to business to response delay is successively sent.
In the present embodiment, the server as HTTP request recipient can be one, be also possible to multiple, the present embodiment It is not limited to the case where all HTTP requests are only sent to a server by client.In practical application, which HTTP is asked Asking and which server be sent to is determined by the content (such as inquiry string) of HTTP request.
104, the http response that intercept server returns.
Server parses it after the HTTP request for receiving client transmission, according to wherein dated request Method searches the data content of wherein inquiry string link, the data content found is then added to HTTP Client is returned in response.
105, unified batch processing is carried out to the http response of interception.
In the prior art, client just calls a thread resources to ring the HTTP after often receiving a http response It should be handled, then by treated, http response returns to corresponding front end.And in the present embodiment, server returns After http response, client is first intercepted http response, then calls a thread resources, multiple to what is intercepted Http response uniformly carries out batch processing, and returns to different front ends.Similar with abovementioned steps 102, client can also be with Several thread resources are called, the http response of different business logical type is respectively processed.
In the present embodiment, client can carry out the state in general processing, such as modification statusline to http response Code.It is also possible to the processing for the customization that the business demand logic based on customization carries out, such as is solved from http response message body portion Analyse the label such as timestamp added by server.The present embodiment does not limit the processing mode of client specifically.
106, by treated, http response is sent to corresponding front end.
After being completed to http response processing, front-end information that client is carried according to http response (such as front end Claim or mark) different http responses is returned to different front ends, thus complete primary complete HTTP request process.
Method provided in this embodiment can be applied between client and server in the scene for establishing HTTP long connection, Also it can be applied in the scene for establishing the short connection of HTTP between client and server.
Further, as the refinement to method shown in Fig. 1, the embodiment of the invention also provides a kind of HTTP services Processing method, as shown in Fig. 2, this method comprises:
201, when HTTP request is initiated in front end, call request intercepts Hook function and hangs up primary request API.
In the prior art, when HTTP request is initiated in front end, the primary request applications interface of client call (Application Programming Interface, abbreviation API) individually handles HTTP request, is then sent to Server.And in this step, client realizes the interception to HTTP request using hook Hook function.When HTTP is initiated in front end When request, client call request Hook function hangs up primary request API.Then step 202 is executed, is asked by preset Processing API is asked to carry out unified batch processing to HTTP request.
202, preset request processing API is called to carry out unified batch processing to HTTP request.
Different from the primary API that system carries, request processing API needs are write by network administrator.The request handles API In with processing HTTP request customized logic, which can be with the processing logic of general procedure mode in the prior art Unanimously, it is also possible to according to different business demand custom logics.More typical custom logic may is that asks in HTTP Message body portion (can certainly be head) be asked to add timestamp.
Client carries out unified batch processing to multiple HTTP requests according to the customized logic in request processing API.
In an application scenarios of the present embodiment, customized logic can be the header data progress to HTTP request message It rewrites.Based on existing http protocol, the head of HTTP request includes requesting method, uniform resource locator (Uniform Resource Locator, abbreviation URL) and three parts of HTTP protocol version.In practical application, requesting method specifically has GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, CONNECT etc.;Inquiry string in URL is used for server Data content needed for searching front end;Http protocol version at present it is more use include HTTP 0.9, HTTP 1.0 and HTTP The versions such as 1.1.The header information for rewriting HTTP request message is illustrated with an example below.
In based on the client locally scene of shielding illegal external connection, certain member logs in Taobao website and carries out shopping at network.When When employee opens Taobao's link in a browser, browser front end initiates the HTTP request of request Taobao's homepage to server, The header contents of the HTTP request message are " GETwww.taobao.comHTTP 1.1".According to network administrator's setting Handle logic, client after intercepting and capturing the HTTP request, by URL "www.taobao.com" it is rewritten as an invalid domain name, by It is " GET that this, which obtains treated header contents,www.xxxxxxx.comHTTP 1.1".Then client is by the HTTP request It is sent to network side server.Due to the URL in HTTP request be it is invalid, network side server can not return any useful The page, therefore the function of shielding to internet behavior may be implemented.Certainly, by URL be rewritten as network management setting, be used for prompt forbid The URL for logging in the prompt page of outer net can also be with.
In another application scenarios of the present embodiment, customized logic can also be the body portion data to HTTP request message Increased, deleted or is rewritten.Change operation to the additions and deletions of HTTP request message body portion data to need based on the private reached an agreement in advance There is agreement execution, so that modified data can meet the field format requirement in HTTP request message body portion.Below with one A example in message body portion increase data be illustrated.
In application scenes, server needs to obtain the temporal information that client initiates HTTP request.Client exists After being intercepted and captured to the HTTP request that front end is initiated, obtains and the time is initiated according to the request that system clock records, then call and ask Ask processing API that the time is written to HTTP request message body portion in the form of timestamp according to the customized logic in the API Some in advance in field for reach an agreement on, acquisition treated HTTP request.
Above-mentioned two application scenarios are only the explanation to carry out to the processing of HTTP request, in practical application, this reality Applying the client in example basic can request processing API rewrite URL, add timestamp etc. to a large amount of HTTP request The batch processing of same customized logic.
It should be noted that the so-called meaning being uniformly processed refers in the present embodiment, guarantee the place to different HTTP requests The consistency for managing logic, rather than just the absolute identical of finger processing result.For example, in the scene of above-mentioned shielding illegal external connection In, the URL of all HTTP requests can be revised as same specific and specific URL " such aswww.xxxxxx.com", this Kind processing logic makes the URL in each HTTP request become the same new URL;And in above-mentioned addition timestamp In scene, the consistency for handling logic is embodied in " time for generating HTTP request is added in HTTP request ", but different The specific value of the timestamp added in HTTP request is different.
203, after carrying out unified batch processing to HTTP request, by treated, HTTP request is sent to server.
Client can by treated, HTTP request be sent to server by request processing API, can also call original Raw request API takes over request processing API, and by primary request API, by treated, HTTP request is sent to server.
204, it when server returns to http response, calls response to intercept Hook function and hangs up primary response API.
In the prior art, when server return http response when, the primary response API of client call to http response into Row individually processing, is then returned to front end.And in this step, client is realized using hook Hook function to http response It intercepts.When server returns to http response, client call request Hook function hangs up primary response API.Then it executes Step 205, API is handled by preset response and unified batch processing is carried out to http response.
205, preset response processing API is called to carry out unified batch processing to http response.
Different from the primary API that system carries, response processing API needs are write by network administrator.The response handles API In with processing http response customized logic, which can be with the processing logic of general procedure mode in the prior art Unanimously, it is also possible to according to different business demand custom logics.More typical custom logic, which may is that, rewrites HTTP Status code in response.
Client carries out unified batch processing to multiple http responses according to the customized logic in response processing API.
In an application scenarios of the present embodiment, the customized logic for handling http response be can be to http response report The header data of text is rewritten, such as the information in modification URL;Or can be to the body portion data of http response message into Row additions and deletions changed handling, such as increase the response identification or timestamp of server distribution.Again or it can also be to http response report The statusline data of text are rewritten, such as in the scene of shielding illegal external connection, status code 202 is revised as status code 404.
206, after carrying out unified batch processing to http response, will treated http response is sent to it is corresponding before End.
Client can by treated, http response be sent to corresponding front end by response processing API, can also adjust Response processing API is taken over primary response API, by primary response API general, treated that http response is sent to pair The front end answered.
Further, for avoid because intercept and capture HTTP request/response, longer HTTP service time delay is caused, in the present embodiment A kind of improvement project in, can the time restriction of front end or intercepting and capturing to the object as intercepting and capturing be configured.For setting Set for intercepting and capturing front end, can be set HTTP request that client is only related to the front end of some or certain several applications/respond into Row is intercepted and captured, and is handled according to existing implementation HTTP request/response that other application front end is related to.Specifically, Client can be intercepted and be handled according to the HTTP request that the first selected front end is initiated in setting, and intercept process server The http response returned to the second selected front end, wherein the first selected front end and the second selected front end can in content sum number amount With unanimously can also be inconsistent.The front end quantitative range that HTTP is intercepted and captured due to reducing can reduce waiting and initiate HTTP Request or the probability for returning to http response, thus shorten the service time delay of HTTP.
For capture time is arranged, client can be intercepted and captured HTTP request/response in preset time period Processing, and the HTTP request/response initiated or returned after exceeding the period, then handled according to existing processing mode.Tool Body, client can carry out intercept process to the HTTP request that the first predetermined period Inner Front End is initiated according to setting, and intercept The http response that processing server returns in the second predetermined period, wherein the length of the first predetermined period and the second predetermined period It is short can be identical or different.Due to that can prevent because unlimited etc. to waiting HTTP request/response time to be limited Time delay caused by some HTTP request or http response increases.
In addition, in practical application, can also to the quantity of HTTP request or the HTTP response that client is disposably intercepted and captured into Row setting, thus equally can achieve the effect for preventing HTTP service time delay too long.
Further, as the realization to method shown in Fig. 1 and Fig. 2, the embodiment of the invention also provides a kind of HTTP clothes The processing unit of business, the device can be located inside client, can also independently of client, as client and server it Between media device.It should be noted that present apparatus embodiment is corresponding with preceding method embodiment, preceding method reality can be realized Apply the full content in example.To be easy to read, present apparatus embodiment only carries out summary to the content in preceding method embodiment Description, does not repeat the detail content in embodiment of the method one by one.As shown in figure 3, the device includes: the first interception unit 31, first processing units 32, the first transmission unit 33, the second interception unit 34, the second processing unit 35 and second send single Member 36.Wherein,
First interception unit 31, for being intercepted to the HTTP request that front end is initiated;
First processing units 32, for carrying out unified batch processing to the HTTP request of interception;
First transmission unit 33, for HTTP request to be sent to server by treated;
Second interception unit 34, the http response returned for intercepting the server;
The second processing unit 35, for carrying out unified batch processing to the http response of interception;
Second transmission unit 36, for http response to be sent to corresponding front end by treated.
Further, first interception unit 31, for when HTTP request is initiated in front end, call request to intercept hook Hook function hangs up primary request applications interface API;
The first processing units 32, for calling preset request processing API to carry out unified batch to the HTTP request Amount processing, the request are handled in API with the customized logic of processing HTTP request.
Further, the first processing units 32, for handling the customized logic in API to described according to the request HTTP request carries out unified batch processing, wherein the unified batch processing includes following at least one processing modes: to HTTP The header data of request message is rewritten, and the body portion data of HTTP request message are increased, deleted or rewritten.
Further, second interception unit 34, for calling response to block when the server returns to http response Hook function is cut to hang up primary response API;
Described the second processing unit 35, for calling preset response processing API to carry out unified batch to the http response Amount processing, the response are handled in API with the customized logic of processing http response.
Further, described the second processing unit 35, for handling the customized logic in API to described according to the response Http response carries out unified batch processing, wherein the unified batch processing includes following at least one processing modes: to HTTP The header data of response message is rewritten, and is rewritten to the statusline data of http response message.
Further, first interception unit 31, is used for:
The HTTP request initiated the first selected front end intercepts;
The HTTP request initiated the first predetermined period Inner Front End intercepts;
Second interception unit 34, is used for:
Intercept the http response that the server is returned to the second selected front end;
Intercept the http response that the server returns in the second predetermined period.
The processing unit of HTTP service provided in this embodiment can be sent to the HTTP request of server to front end, with And server returns to the http response of front end and is intercepted respectively, and to batch that HTTP request/response of interception is unified Amount processing.Then by treated, HTTP request is sent to server, and http response returns to front end by treated.With it is existing There is technology to compare, the present embodiment can carry out batch processing to the HTTP request based on same or similar service logic/response, by This is saved handles redundant operation caused by HTTP request/response one by one, promotes the treatment effeciency of HTTP.
The processing unit of the HTTP service includes processor and memory, and above-mentioned first interception unit 31, first is handled Unit 32, the first transmission unit 33, the second interception unit 34, the second processing unit 35 and second transmission unit 36 etc. are made In memory for program unit storage, above procedure unit stored in memory is executed by processor to realize accordingly Function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one Or more, by adjusting kernel parameter come realize to HTTP request/response carry out intercept batch processing purpose.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited Store up chip.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program code of beginningization there are as below methods step: the HTTP request initiated front end intercepts;To the HTTP request of interception into The unified batch processing of row;By treated, HTTP request is sent to server;The http response that intercept server returns;To interception Http response carry out unified batch processing;By treated, http response is sent to corresponding front end.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculate equipment include one or more processors (CPU), input/output interface, Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable Except programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD- ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetism are deposited Equipment or any other non-transmission medium are stored up, can be used for storage can be accessed by a computing device information.According to boundary herein Fixed, computer-readable medium does not include temporary computer readable media (transitory media), such as the data-signal of modulation and Carrier wave.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art, Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement, Improve etc., it should be included within the scope of the claims of this application.

Claims (10)

1. a kind of processing method of HTTP service, which is characterized in that the described method includes:
The HTTP request initiated front end intercepts;
Unified batch processing is carried out to the HTTP request of interception;
By treated, HTTP request is sent to server;
Intercept the http response that the server returns;
Unified batch processing is carried out to the http response of interception;
By treated, http response is sent to corresponding front end;The HTTP request initiated front end intercepts, comprising:
When HTTP request is initiated in front end, call request intercepts hook Hook function and hangs primary request applications interface API It rises;
The HTTP request of described pair of interception carries out unified batch processing, comprising:
Call preset request processing API to carry out unified batch processing to the HTTP request, the request handle in API with Handle the customized logic of HTTP request.
2. the method according to claim 1, wherein described call preset request processing API to the HTTP Request carries out unified batch processing, comprising:
Unified batch processing is carried out to the HTTP request according to the customized logic in the request processing API, wherein the system Batch processing includes following at least one processing modes: being rewritten to the header data of HTTP request message and right The body portion data of HTTP request message are increased, deleted or are rewritten.
3. the method according to claim 1, wherein the http response for intercepting the server and returning, packet It includes:
When the server returns to http response, calls response to intercept Hook function and hang up primary response API;
The http response of described pair of interception carries out unified batch processing, comprising:
Call preset response processing API to carry out unified batch processing to the http response, the response handle in API with Handle the customized logic of http response.
4. according to the method described in claim 3, it is characterized in that, described call preset response processing API to the HTTP Response carries out unified batch processing, comprising:
Unified batch processing is carried out to the http response according to the customized logic in the response processing API, wherein the system Batch processing includes following at least one processing modes: being rewritten to the header data of http response message and right The statusline data of http response message are rewritten.
5. method according to claim 1 to 4, which is characterized in that the HTTP request initiated front end It is intercepted, comprising:
The HTTP request initiated the first selected front end intercepts;And/or
The HTTP request initiated the first predetermined period Inner Front End intercepts;
The http response for intercepting the server and returning, comprising:
Intercept the http response that the server is returned to the second selected front end;And/or
Intercept the http response that the server returns in the second predetermined period.
6. a kind of processing unit of HTTP service, which is characterized in that described device includes:
First interception unit, for being intercepted to the HTTP request that front end is initiated;
First processing units, for carrying out unified batch processing to the HTTP request of interception;
First transmission unit, for HTTP request to be sent to server by treated;
Second interception unit, the http response returned for intercepting the server;
The second processing unit, for carrying out unified batch processing to the http response of interception;
Second transmission unit, for http response to be sent to corresponding front end by treated;
First interception unit, for when HTTP request is initiated in front end, call request intercepts hook Hook function will be primary Request applications interface API is hung up;
The first processing units, for calling preset request processing API to carry out unified batch processing to the HTTP request, With the customized logic of processing HTTP request in the request processing API.
7. device according to claim 6, which is characterized in that the first processing units, at according to the request Customized logic in reason API carries out unified batch processing to the HTTP request, wherein the unified batch processing includes following At least one processing mode: rewriting the header data of HTTP request message, and to the body portion number of HTTP request message According to being increased, deleted or rewritten.
8. device according to claim 6, which is characterized in that second interception unit, for being returned when the server When returning http response, calls response to intercept Hook function and hang up primary response API;
Described the second processing unit, for calling preset response processing API to carry out unified batch processing to the http response, With the customized logic of processing http response in the response processing API.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require 1 to the HTTP service described in any one of claim 5 Processing method.
10. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run Benefit require 1 to the HTTP service described in any one of claim 5 processing method.
CN201510728862.0A 2015-10-30 2015-10-30 Processing method, device, storage medium and the processor of HTTP service Active CN106656920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510728862.0A CN106656920B (en) 2015-10-30 2015-10-30 Processing method, device, storage medium and the processor of HTTP service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510728862.0A CN106656920B (en) 2015-10-30 2015-10-30 Processing method, device, storage medium and the processor of HTTP service

Publications (2)

Publication Number Publication Date
CN106656920A CN106656920A (en) 2017-05-10
CN106656920B true CN106656920B (en) 2019-09-06

Family

ID=58810949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510728862.0A Active CN106656920B (en) 2015-10-30 2015-10-30 Processing method, device, storage medium and the processor of HTTP service

Country Status (1)

Country Link
CN (1) CN106656920B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108322470A (en) * 2018-02-07 2018-07-24 链家网(北京)科技有限公司 A kind of network request processing method and processing device
CN110535751B (en) * 2019-08-19 2023-01-24 深圳追一科技有限公司 Message response method and device, computer equipment and storage medium
CN110740132A (en) * 2019-10-10 2020-01-31 苏州浪潮智能科技有限公司 method and device for detecting web page application firewall
CN111162879A (en) * 2019-12-23 2020-05-15 五八有限公司 Data transmission method and device, electronic equipment and storage medium
CN111740996B (en) * 2020-06-22 2021-06-22 四川长虹电器股份有限公司 Method for rapidly splitting HTTP request and response in flow analysis scene
CN112965739B (en) * 2021-02-08 2024-02-09 中国工商银行股份有限公司 Front-end HTTP request processing method, device and system
CN115277187A (en) * 2022-07-26 2022-11-01 新明珠集团股份有限公司 Method, device, storage medium and equipment for prompting request data verification result

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102387206A (en) * 2011-10-20 2012-03-21 镇江睿泰信息科技有限公司 Synthesis method and system of concurrent request of Web service
CN103229486A (en) * 2012-12-03 2013-07-31 华为技术有限公司 Batch file transmission method and device
CN104980421A (en) * 2014-10-15 2015-10-14 腾讯科技(深圳)有限公司 Method and system for processing batch requests

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066676A1 (en) * 2009-09-14 2011-03-17 Vadim Kleyzit Method and system for reducing web page download time

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102387206A (en) * 2011-10-20 2012-03-21 镇江睿泰信息科技有限公司 Synthesis method and system of concurrent request of Web service
CN103229486A (en) * 2012-12-03 2013-07-31 华为技术有限公司 Batch file transmission method and device
CN104980421A (en) * 2014-10-15 2015-10-14 腾讯科技(深圳)有限公司 Method and system for processing batch requests

Also Published As

Publication number Publication date
CN106656920A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106656920B (en) Processing method, device, storage medium and the processor of HTTP service
US11711420B2 (en) Automated management of resource attributes across network-based services
WO2017190641A1 (en) Crawler interception method and device, server terminal and computer readable medium
WO2019042240A1 (en) Short-link parsing method, apparatus and device
US10397051B1 (en) Configuration and testing of network-based service platform resources using a service platform specific language
US9088462B2 (en) Common web accessible data store for client side page processing
CN111026982A (en) Intelligent contract processing method, computer equipment and storage medium
US20200374280A1 (en) Secure web application delivery platform
US10182104B1 (en) Automatic propagation of resource attributes in a provider network according to propagation criteria
CN110213105A (en) It is a kind of cross-platform micro- using creation method
CN108650093A (en) A kind of interface realizing method based on idempotence
US9942267B1 (en) Endpoint segregation to prevent scripting attacks
CN109213824B (en) Data capture system, method and device
CN105556918B (en) A kind of resource downloading method and electronic equipment
CN108156009B (en) Service calling method and device
CN113722114A (en) Data service processing method and device, computing equipment and storage medium
CN110795741B (en) Method and device for carrying out security processing on data
US9665732B2 (en) Secure Download from internet marketplace
WO2018189736A1 (en) System and method for dynamic management of private data
CN112492055A (en) Method, device and equipment for redirecting transmission protocol and readable storage medium
CN113452733A (en) File downloading method and device
CN116150513A (en) Data processing method, device, electronic equipment and computer readable storage medium
Huang et al. Achieving fast page load for websites across multiple domains
CN115686663A (en) Online file preview method and device and computer equipment
CN114637508A (en) VUE-based label parameter transfer method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant