CN106656920A - HTTP service processing method and device - Google Patents

HTTP service processing method and device Download PDF

Info

Publication number
CN106656920A
CN106656920A CN201510728862.0A CN201510728862A CN106656920A CN 106656920 A CN106656920 A CN 106656920A CN 201510728862 A CN201510728862 A CN 201510728862A CN 106656920 A CN106656920 A CN 106656920A
Authority
CN
China
Prior art keywords
http
response
request
processing
api
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510728862.0A
Other languages
Chinese (zh)
Other versions
CN106656920B (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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses an HTTP service processing method and device, relates to the technical field of telecommunication and solves low efficiency of processing HTTP requests/responses. The method comprises the following steps: intercepting hyper text transfer protocol (HTTP) requests initiated by a front end; performing unified batch processing on the intercepted HTTP requests; sending the processed HTTP requests to a server; intercepting HTTP responses returned by the server; performing unified batch processing on the intercepted HTTP responses; and sending the processed HTTP responses to the corresponding front end. The HTTP service processing method and device are mainly applied to the batch processing of HTTP requests/responses based on same or similar service logic.

Description

The processing method and processing device of HTTP service
Technical field
The present invention relates to technical field of telecommunications, more particularly to a kind of HTTP service processing method and Device.
Background technology
Existing Network Access Method is mostly based on HTTP (Hypertext Transfer Trotocol, abbreviation HTTP) realize.User end to server initiates a HTTP request, request Obtain certain data resource.Server is parsed to the content of HTTP request, according to querying condition Data query is carried out, and is returned to the data resource for inquiring by way of return http response Client.
When HTTP request is sent to server, it usually needs HTTP request is entered in client-side Row is processed, for example, the requesting method in HTTP request header (header) is rewritten, or Business demand of the person based on customization increases data etc. in HTTP request message body portion (body).And After the http response for receiving server return, it is also desirable to http response is processed, example The data form in http response header is such as changed, or to state in http response message Conditional code in row is modified.In prior art, client often initiate a HTTP request or When receiving a http response, all HTTP request/response can be carried out once by particular thread Process.
During above-mentioned process HTTP request/response, inventor has found, when HTTP request or When the quantity of response is more, substantial amounts of HTTP request/response is individually processed and is extremely expended client The process resource at end.Particularly it is all based on same or analogous business demand and patrols in these requests or response When volume realizing, same or analogous processing procedure can produce substantial amounts of redundant operation so that at HTTP The efficiency of reason is very low.
The content of the invention
The invention provides a kind of processing method and processing device of HTTP service, can solve the problem that prior art It is middle to process the low problem of HTTP request/response efficiency.
To solve aforementioned technical problem, on the one hand, the invention provides a kind of process of HTTP service Method, methods described includes:
The HTTP request that front end is initiated is intercepted;
HTTP request to intercepting carries out unifying batch processing;
HTTP request after process is sent into server;
Intercept the http response that the server is returned;
Http response to intercepting carries out unifying batch processing;
Http response after process is sent into corresponding front end.
On the other hand, present invention also offers a kind of processing meanss of HTTP service, described device bag Include:
First interception unit, for blocking to the HTTP request that front end is initiated Cut;
First processing units, for carrying out unifying batch processing to the HTTP request for intercepting;
First transmitting element, for the HTTP request after process to be sent into server;
Second interception unit, for intercepting the http response that the server is returned;
Second processing unit, for carrying out unifying batch processing to the http response for intercepting;
Second transmitting element, for the http response after process to be sent into corresponding front end.
The processing method and processing device of the HTTP service that the present invention is provided, can be sent to service to front end The HTTP request of device, and server returns to the http response of front end and intercepted respectively, and HTTP request/response to intercepting carries out unified batch processing.Then please by the HTTP after process Ask and be sent to server, and the http response after process is returned into front end.Compared with prior art, The present invention can carry out batch processing to the HTTP request/response based on same or similar service logic, Therefore save on and process one by one the produced redundant operation of HTTP request/response, lift the process of HTTP Efficiency.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the present invention's Technological means, and being practiced according to the content of specification, and in order to allow the above-mentioned of the present invention and Other objects, features and advantages can become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By the detailed description for reading hereafter preferred embodiment, various other advantage and benefit for Those of ordinary skill in the art will be clear from understanding.Accompanying drawing is only used for illustrating the mesh of preferred embodiment , and it is not considered as limitation of the present invention.And in whole accompanying drawing, with identical with reference to symbol Number represent identical part.In the accompanying drawings:
Fig. 1 shows a kind of process flow figure of HTTP service provided in an embodiment of the present invention;
Fig. 2 shows the process flow figure of another kind of HTTP service provided in an embodiment of the present invention;
Fig. 3 shows a kind of composition frame of the processing meanss of HTTP service provided in an embodiment of the present invention Figure.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing in accompanying drawing The exemplary embodiment of the disclosure is shown, it being understood, however, that may be realized in various forms the disclosure And should not be limited by embodiments set forth here.On the contrary, there is provided these embodiments are able to more Thoroughly understand the disclosure, and can be by the complete technology for conveying to this area of the scope of the present disclosure Personnel.
A kind of processing method of HTTP service is embodiments provided, as shown in figure 1, the party Method includes:
101st, the HTTP request that front end is initiated is intercepted.
The executive agent of the present embodiment can be mobile phone, notebook computer, PC, portable intelligence Can equipment etc. be with data-handling capacity and can carry out the client of man-machine interaction by peripheral hardware.It is described Front end is primarily referred to as the page/interface directly interacted with user.Generally, an application process is at least With a page, therefore an application process at least corresponds to a front end.
In practical application, a page can be based on the inquiry operation initiation HTTP request of user, this It is that user is appreciable to plant HTTP request.In addition the page can also initiate user on backstage can not perceive HTTP request, such as in browser renders webpage, browser kernel need according to cascading style Table (Cascading Style Sheets, abbreviation CSS) and HTML (Hyper Text Markup Language, abbreviation HTML) figure that shows in the server request page of source code The contents such as piece, word, this HTTP request generally will not be interacted with user.
For a client, the front end quantity that it is related to is generally multiple, and each front end Multiple HTTP requests can be simultaneously or successively initiated again, therefore client is needed to many in the present embodiment Individual HTTP request is processed, corresponding, and at step 104, client receives and needs to process Http response quantity be also multiple.
In the present embodiment, when HTTP request is initiated in front end, client is not to each HTTP Request is respectively processed, but HTTP request is intercepted, then multiple to what is intercepted HTTP request unification carries out batch processing.
102nd, the HTTP request to intercepting carries out unifying batch processing.
The processing mode being related in the present embodiment includes general procedure mode of the prior art, for example, repair Change the requesting method of HTTP request header, also include the business demand logic based on customization and enter Capable process, for example, increase timestamp or message digest algorithm 5 in the body portion of HTTP request message (Message-Digest Algorithm 5, abbreviation MD5) value.The present embodiment is not to the concrete of client Processing mode is limited.
In prior art, client is accomplished by calling once when a HTTP request is initiated in front end Thread resources are processed the HTTP request.And in the present embodiment, client can will be pending Send HTTP request to be intercepted, then multiple HTTP requests batch is entered by a thread resources Row is processed.Compared with prior art, the present embodiment can greatly reduce the call number of thread resources, Especially for the feelings for carrying out HTTP request process based on particular traffic requirements logic in corporate intranet Condition, due to HTTP request quantity it is more huge, and HTTP request process logic it is identical or compared with For similar, therefore HTTP request is carried out by the way of the present embodiment can save substantial amounts of repeatability Processing procedure (i.e. redundant operation), so as to greatly reduce the consumption of process resource.
Further, when the process logic of different HTTP requests is different, client can be according to Process logic HTTP request is classified, then respectively by with process amount of logic same number Process resource different classes of HTTP request is processed respectively.Due in practical application, locating The quantity of reason logic will be much smaller than the quantity of HTTP request, even if therefore tune of the increase to thread resources With the thread resources expended for this case hinge structure are also extremely limited.
103rd, the HTTP request after process is sent into server.
After batch processing is carried out to multiple HTTP requests, client is according in HTTP request message The requesting method of record, and HTTP request is sent to server by server info.Client can So that all HTTP requests to be sent simultaneously, it is also possible to according to different transmission rules to HTTP Request carries out priority transmission.In a kind of implementation of the present embodiment, it is described transmission rule can with but It is not limited to:1st, the sequencing for initiating HTTP request according to front end sends;2nd, according to front end Priority carries out priority transmission;3rd, the requirement height according to business to response delay carries out priority transmission.
In the present embodiment, as HTTP request recipient server can be one, or Multiple, the present embodiment is not limited to client and only all HTTP requests is sent into a server Situation.In practical application, it is by HTTP request which HTTP request is sent to which server Content (such as inquiry string) determine.
104th, the http response that intercept server is returned.
Server is parsed, according to it after the HTTP request for receiving client transmission to it In indicate requesting method, to wherein inquiry string link data content make a look up, then will The data content for finding is added in http response and returns to client.
105th, the http response to intercepting carries out unifying batch processing.
In prior art, client just calls a thread money after a http response is often received Source is processed the http response, then by the http response after process return to it is corresponding before End.And in the present embodiment, server is returned after http response, client is first by http response Intercepted, then called a thread resources, the multiple http responses to intercepting unify into Row batch processing, and return to different front ends.Similar with abovementioned steps 102, client also may be used To call several thread resources, the http response of different business logical type is respectively processed.
In the present embodiment, client can carry out general process to http response, for example, change shape Conditional code in state row.Can also be the process of the customization carried out based on the business demand logic of customization, Timestamp for for example being added from http response message body portion resolution server etc. is marked.The present embodiment The processing mode of client is not specifically limited.
106th, the http response after process is sent into corresponding front end.
After completing to http response process, client is believed according to the front end that http response is carried Different http responses is returned to different front ends by breath (such as front end title or mark), thus Complete once complete HTTP request flow process.
The method that the present embodiment is provided can apply to set up HTTP length company between client and server In the scene for connecing, it is also possible to be applied between client and server set up the scene of the short connections of HTTP In.
Further, as the refinement to method shown in Fig. 1, the embodiment of the present invention additionally provides one kind The processing method of HTTP service, as shown in Fig. 2 the method includes:
201st, when HTTP request is initiated in front end, call request intercepts Hook functions by primary request API hangs up.
In prior art, when HTTP request is initiated in front end, journey is applied in the primary request of client call Sequence interface (Application Programming Interface, abbreviation API) is carried out to HTTP request Individually process, be then sent to server.And in this step, client adopts hook Hook functions Realize the interception to HTTP request.When HTTP request is initiated in front end, client call request Hook Function hangs up primary request API.Then execution step 202, by default request API is processed HTTP request is carried out to unify batch processing.
202nd, call default request to process API carries out unifying batch processing to HTTP request.
Different from the primary API that system is carried, request processes API to be needed to be write by network manager. The request is processed in API with the customized logic for processing HTTP request, the customized logic can with it is existing There is the process logic of general procedure mode in technology unanimously, or according to different business demands certainly Define logic.More typical custom logic can be:In HTTP request message body portion (certainly Can also be head) addition timestamp.
Client processes the customized logic in API according to request and multiple HTTP requests is carried out to unify to criticize Amount process.
In an application scenarios of the present embodiment, customized logic can be to HTTP request message Header data is rewritten.Based on existing http protocol, the head of HTTP request includes requesting party Method, URL (Uniform Resource Locator, abbreviation URL) and HTTP Three parts of protocol version.In practical application, requesting method specifically have GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, CONNECT etc.;Polling character in URL Go here and there for the data content needed for whois lookup front end;The current more bag for using of http protocol version Include the versions such as HTTP 0.9, HTTP 1.0 and HTTP 1.1.Below with an example to rewriting HTTP The header information of request message is illustrated.
In the scene for locally shielding illegal external connection based on client, certain Yuan logs in Taobao website and carries out net Network is done shopping.When employee opens in a browser Taobao to be linked, browser front end to server is initiated The HTTP request of request Taobao homepage, the header contents of the HTTP request message are " GETwww.taobao.comHTTP 1.1”.According to the process logic that network manager is arranged, client is being cut After obtaining the HTTP request, by URL "www.taobao.com" an invalid domain name is rewritten as, by This header contents after being processed is " GETwww.xxxxxxx.comHTTP 1.1”.Then client The HTTP request is sent to network side server by end.Because the URL in HTTP request is invalid , network side server cannot return any useful page, therefore can realize to internet behavior Function of shielding.Certainly, by URL be rewritten as webmaster setting, forbid logging in outer net for prompting and carry Show that the URL of the page can also.
In another application scenarios of the present embodiment, customized logic can also be to HTTP request report The body portion data of text are increased, deleted or are rewritten.Additions and deletions to HTTP request message body portion data Changing operation needs to be performed based on the proprietary protocol reached an agreement in advance, so that amended data can be accorded with The field format for closing HTTP request message body portion is required.Below with an example in message body portion Increase data to illustrate.
In application scenes, server needs to obtain the time letter that client initiates HTTP request Breath.Client is obtained and remembered according to system clock after intercepting and capturing to the HTTP request that front end is initiated The time is initiated in the request of record, and then call request processes API, according to the customized logic in the API, By the time is written to HTTP request message body portion in the form of timestamp, certain has in advance been reached an agreement on HTTP request in field, after being processed.
Above-mentioned two application scenarios are only to process a HTTP request explanation for carrying out, reality Using in, the client in the present embodiment can process API to substantial amounts of HTTP request with basis request Carry out such as rewriting URL, the batch processing of addition timestamp one customized logic of equivalent.
It should be noted that the so-called implication being uniformly processed is referred in the present embodiment, it is ensured that to difference The uniformity of the process logic of HTTP request, and not only refer to the absolute identical of result.For example, In the scene of above-mentioned shielding illegal external connection, the URL of all HTTP requests can be revised as same Individual specifically and specifically URL is " for examplewww.xxxxxx.com", this process logic causes each URL in HTTP request becomes for same new URL;And in the field of above-mentioned addition timestamp Jing Zhong, the uniformity of process logic is embodied in and " is added into HTTP the time for producing HTTP request In request ", but the concrete numerical value of the timestamp added in different HTTP requests is different.
203rd, after carrying out unifying batch processing to HTTP request, by the HTTP request after process It is sent to server.
Client can process API and the HTTP request after process is sent into server by request, Primary request API can also be called to process API to request take over, will by primary request API HTTP request after process is sent to server.
204th, when server returns http response, response is called to intercept Hook functions by primary sound API is answered to hang up.
In prior art, when server returns http response, the primary response API of client call Http response is individually processed, front end is then returned to.And in this step, client is adopted The interception to http response is realized with hook Hook functions.When server returns http response, Client call request Hook functions hang up primary response API.Then execution step 205, pass through Default response processes API and http response is carried out to unify batch processing.
205th, call default response to process API carries out unifying batch processing to http response.
Different from the primary API that system is carried, response processes API to be needed to be write by network manager. The response is processed in API with the customized logic for processing http response, the customized logic can with it is existing There is the process logic of general procedure mode in technology unanimously, or according to different business demands certainly Define logic.More typical custom logic can be:Rewrite the conditional code in http response.
Client processes the customized logic in API according to response and multiple http responses is carried out to unify to criticize Amount process.
In an application scenarios of the present embodiment, the customized logic for processing http response can be right The header data of http response message is rewritten, for example, change the information in URL;Or can be with It is that the body portion data to http response message carry out additions and deletions changed handling, for example, increases server-assignment Response identification or timestamp.Again or can also be that the statusline data to http response message are carried out Rewrite, such as in the scene of shielding illegal external connection, conditional code 202 is revised as into conditional code 404.
206th, after carrying out unifying batch processing to http response, by the http response after process It is sent to corresponding front end.
Client can by response process API the http response after process is sent to it is corresponding before End, it is also possible to call primary response API to process API to response and take over, by primary response API Http response after process is sent into corresponding front end.
Further, for avoid because intercept and capture HTTP request/response, when causing longer HTTP service Prolong, in a kind of improvement project of the present embodiment, to the front end as the object intercepted and captured or can cut The time restriction for obtaining is configured.For arranging and intercepting and capturing front end, client can be set only to certain HTTP request/response that individual or certain several application front ends are related to is intercepted and captured, and to other application before HTTP request/response that end is related to is processed according to existing implementation.Specifically, client According to arranging the HTTP request that the first selected front end is initiated can be intercepted and processed, and be intercepted Processing server to second selectes the http response that front end returns, wherein, first selectes front end and the Two select front ends in content with quantity can it is consistent can also be inconsistent.HTTP is intercepted and captured due to reducing Front end quantitative range, therefore can reduce waiting and initiate HTTP request or return http response Probability, thus shortens the service time delay of HTTP.
For capture time is arranged, client can be to the HTTP request/sound in preset time period Should carry out intercepting and capturing process, and the HTTP request/response initiated after beyond the time period or return, then According to the process of existing processing mode.Specifically, client can be according to setting to the first scheduled time slot The HTTP request that Inner Front End is initiated carries out intercept process, and intercept process server in the second pre- timing The http response returned in section, wherein, the length of the first scheduled time slot and the second scheduled time slot can be with It is identical or different.Due to wait HTTP request/response time limited, therefore can in case The time delay for only causing because infinitely waiting certain HTTP request or http response increases.
Additionally, in practical application, can also be to the HTTP request of the disposable intercepting and capturing of client or HTTP The quantity of response is configured, and thus can equally reach the effect for preventing HTTP service time delay long.
Further, as the realization to method shown in Fig. 1 and Fig. 2, the embodiment of the present invention is also provided A kind of processing meanss of HTTP service, the device may be located inside client, it is also possible to independent In client, as the media device between client and server.It should be noted that this device Embodiment is corresponding with preceding method embodiment, can realize the full content in preceding method embodiment. For ease of reading, this device embodiment only carries out summary description to the content in preceding method embodiment, Detail content in embodiment of the method is not repeated one by one.As shown in figure 3, the device includes: First interception unit 31, first processing units 32, the first transmitting element 33, the second interception unit 34, The transmitting element 36 of second processing unit 35 and second.Wherein,
First interception unit 31, the HTTP request for initiating front end is carried out Intercept;
First processing units 32, for carrying out unifying batch processing to the HTTP request for intercepting;
First transmitting element 33, for the HTTP request after process to be sent into server;
Second interception unit 34, for intercepting the http response that the server is returned;
Second processing unit 35, for carrying out unifying batch processing to the http response for intercepting;
Second transmitting element 36, for the http response after process to be sent into corresponding front end.
Further, first interception unit 31, for when HTTP request is initiated in front end, adjusting Hook Hook functions are intercepted with request to hang up primary request applications interface API;
The first processing units 32, please to the HTTP for calling default request to process API Asking carries out unifying batch processing, and the request is processed in API and patrolled with the customization for processing HTTP request Volume.
Further, the first processing units 32, for processing determining in API according to the request Logic processed carries out unifying batch processing to the HTTP request, wherein, the unified batch processing bag Include following at least one processing modes:The header data of HTTP request message is rewritten, and The body portion data of HTTP request message are increased, deleted or rewritten.
Further, second interception unit 34, for returning http response when the server When, call response to intercept Hook functions and hang up primary response API;
The second processing unit 35, rings for calling default response to process API to the HTTP Should carry out unifying batch processing, the response is processed in API and patrolled with the customization for processing http response Volume.
Further, the second processing unit 35, for processing determining in API according to the response Logic processed carries out unifying batch processing to the http response, wherein, the unified batch processing bag Include following at least one processing modes:The header data of http response message is rewritten, and The statusline data of http response message are rewritten.
Further, first interception unit 31, is used for:
The HTTP request initiated front end is selected to first to intercept;
The HTTP request that first scheduled time slot Inner Front End is initiated is intercepted;
Second interception unit 34, is used for:
Intercept the server and select the http response that front end returns to second;
Intercept the http response that the server is returned in the second scheduled time slot.
The processing meanss of the HTTP service that the present embodiment is provided, can be sent to server to front end HTTP request, and server returns to the http response of front end and intercepted respectively, and to intercepting HTTP request/response carry out unified batch processing.Then the HTTP request after process is sent To server, and the http response after process is returned into front end.Compared with prior art, this reality Applying example can carry out batch processing to the HTTP request/response based on same or similar service logic, by This saves the redundant operation processed one by one produced by HTTP request/response, lifts the process effect of HTTP Rate.
The processing meanss of the HTTP service include processor and memory, above-mentioned first interception unit 31st, first processing units 32, the first transmitting element 33, the second interception unit 34, second processing unit 35 and second transmitting element 36 etc. store in memory, by computing device as program unit Storage said procedure unit in memory is realizing corresponding function.
Kernel is included in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can To arrange one or more, realize intercepting HTTP request/response by adjusting kernel parameter The purpose of batch processing.
Memory potentially includes the volatile memory in computer-readable medium, random access memory The form such as device (RAM) and/or Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM), memory includes at least one storage chip.
Present invention also provides a kind of computer program, when performing on data processing equipment, It is adapted for carrying out initializing the program code of there are as below methods step:The HTTP request that front end is initiated is entered Row is intercepted;HTTP request to intercepting carries out unifying batch processing;By the HTTP request after process It is sent to server;The http response that intercept server is returned;Http response to intercepting is carried out Unified batch processing;Http response after process is sent into corresponding front end.
Those skilled in the art it should be appreciated that embodiments herein can be provided as method, system, Or computer program.Therefore, the application can be implemented using complete hardware embodiment, complete software Example or with reference to the form of the embodiment in terms of software and hardware.And, the application can be adopted at one Or it is multiple wherein include computer usable program code computer-usable storage medium (including but not Be limited to magnetic disc store, CD-ROM, optical memory etc.) on the computer program implemented Form.
The application is with reference to the method according to the embodiment of the present application, equipment (system) and computer program The flow chart and/or block diagram of product is describing.It should be understood that can be realized flowing by computer program instructions In each flow process and/or square frame and flow chart and/or block diagram in journey figure and/or block diagram Flow process and/or square frame combination.Can provide these computer program instructions to all-purpose computer, specially With the processor of computer, Embedded Processor or other programmable data processing devices producing one Machine so that produced by the instruction of computer or the computing device of other programmable data processing devices It is raw to be used to realize in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple sides The device of the function of specifying in frame.
These computer program instructions may be alternatively stored in can guide computer or other programmable datas to process In the computer-readable memory that equipment works in a specific way so that be stored in the computer-readable and deposit Instruction in reservoir is produced and includes the manufacture of command device, and command device realization is in flow chart one The function of specifying in flow process or one square frame of multiple flow processs and/or block diagram or multiple square frames.
These computer program instructions can also be loaded into computer or other programmable data processing devices On so that series of operation steps is performed on computer or other programmable devices to produce computer The process of realization, so as to the instruction performed on computer or other programmable devices is provided for realizing Specify in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frames The step of function.
In a typical configuration, computing device include one or more processors (CPU), input/ Output interface, network interface and internal memory.
Memory potentially includes the volatile memory in computer-readable medium, random access memory The form such as device (RAM) and/or Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Memory is the example of computer-readable medium.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be with Information Store is realized by any method or technique.Information can be computer-readable instruction, data knot Structure, the module of program or other data.The example of the storage medium of computer includes, but are not limited to phase Become internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electricity can Erasable programmable read-only memory (EPROM) (EEPROM), fast flash memory bank or other memory techniques, read-only light Disk read-only storage (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic Cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-transmission medium, Can be used to store the information that can be accessed by a computing device.Define according to herein, computer-readable Medium does not include temporary computer readable media (transitory media), the such as data-signal and load of modulation Ripple.
Embodiments herein is these are only, the application is not limited to.For this area skill For art personnel, the application can have various modifications and variations.It is all spirit herein and principle it Interior made any modification, equivalent substitution and improvements etc., should be included in claims hereof model Within enclosing.

Claims (10)

1. a kind of processing method of HTTP service, it is characterised in that methods described includes:
The HTTP request that front end is initiated is intercepted;
HTTP request to intercepting carries out unifying batch processing;
HTTP request after process is sent into server;
Intercept the http response that the server is returned;
Http response to intercepting carries out unifying batch processing;
Http response after process is sent into corresponding front end.
2. method according to claim 1, it is characterised in that the HTTP that front end is initiated Request is intercepted, including:
When HTTP request is initiated in front end, call request intercepts hook Hook functions should by primary request Hung up with routine interface API;
The HTTP request of described pair of interception carries out unifying batch processing, including:
Call default request to process API carries out unifying batch processing to the HTTP request, described Request is processed in API with the customized logic for processing HTTP request.
3. method according to claim 2, it is characterised in that described to call at default request Reason API carries out unifying batch processing to the HTTP request, including:
The customized logic in API is processed according to the request to carry out unifying batch to the HTTP request Process, wherein, the unified batch processing includes following at least one processing modes:Please to HTTP The header data for seeking message is rewritten, and the body portion data of HTTP request message are increased, Delete or rewrite.
4. method according to claim 1, it is characterised in that the interception server is returned The http response returned, including:
When the server returns http response, response is called to intercept Hook functions by primary response API hangs up;
The http response of described pair of interception carries out unifying batch processing, including:
Call default response to process API carries out unifying batch processing to the http response, described Response is processed in API with the customized logic for processing http response.
5. method according to claim 4, it is characterised in that described to call at default response Reason API carries out unifying batch processing to the http response, including:
The customized logic in API is processed according to the response to carry out unifying batch to the http response Process, wherein, the unified batch processing includes following at least one processing modes:HTTP is rung The header data for answering message is rewritten, and the statusline data of http response message are changed Write.
6. method according to any one of claim 1 to 5, it is characterised in that described to front The HTTP request that end is initiated is intercepted, including:
The HTTP request initiated front end is selected to first to intercept;And/or,
The HTTP request that first scheduled time slot Inner Front End is initiated is intercepted;
It is described to intercept the http response that the server is returned, including:
Intercept the server and select the http response that front end returns to second;And/or,
Intercept the http response that the server is returned in the second scheduled time slot.
7. a kind of processing meanss of HTTP service, it is characterised in that described device includes:
First interception unit, for blocking to the HTTP request that front end is initiated Cut;
First processing units, for carrying out unifying batch processing to the HTTP request for intercepting;
First transmitting element, for the HTTP request after process to be sent into server;
Second interception unit, for intercepting the http response that the server is returned;
Second processing unit, for carrying out unifying batch processing to the http response for intercepting;
Second transmitting element, for the http response after process to be sent into corresponding front end.
8. device according to claim 7, it is characterised in that first interception unit, uses In when HTTP request is initiated in front end, call request intercepts hook Hook functions and applies primary request Routine interface API hangs up;
The first processing units, for calling default request to process API to the HTTP request Carry out unifying batch processing, the request is processed in API with the customized logic for processing HTTP request.
9. device according to claim 8, it is characterised in that the first processing units, uses In the customized logic processed in API according to the request HTTP request is carried out to unify at batch Reason, wherein, the unified batch processing includes following at least one processing modes:To HTTP request The header data of message is rewritten, and the body portion data of HTTP request message are increased, Delete or rewrite.
10. device according to claim 7, it is characterised in that second interception unit, For when the server returns http response, calling response to intercept Hook functions by primary response API hangs up;
The second processing unit, for calling default response to process API to the http response Carry out unifying batch processing, the response is processed in API with the customized logic for processing http response.
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 true CN106656920A (en) 2017-05-10
CN106656920B 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)

Cited By (8)

* 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
CN110535751A (en) * 2019-08-19 2019-12-03 深圳追一科技有限公司 A kind of message responding method, 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
CN111740996A (en) * 2020-06-22 2020-10-02 四川长虹电器股份有限公司 Method for rapidly splitting HTTP request and response in flow analysis scene
CN112965739A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end HTTP request processing method, device and system
CN114138507A (en) * 2021-11-09 2022-03-04 中国联合网络通信集团有限公司 Python program service method, device and computer readable storage medium
CN115277187A (en) * 2022-07-26 2022-11-01 新明珠集团股份有限公司 Method, device, storage medium and equipment for prompting request data verification result

Citations (4)

* 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
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

Patent Citations (4)

* 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
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

Cited By (11)

* 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
CN110535751A (en) * 2019-08-19 2019-12-03 深圳追一科技有限公司 A kind of message responding method, 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
CN111740996A (en) * 2020-06-22 2020-10-02 四川长虹电器股份有限公司 Method for rapidly splitting HTTP request and response in flow analysis scene
CN111740996B (en) * 2020-06-22 2021-06-22 四川长虹电器股份有限公司 Method for rapidly splitting HTTP request and response in flow analysis scene
CN112965739A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end HTTP request processing method, device and system
CN112965739B (en) * 2021-02-08 2024-02-09 中国工商银行股份有限公司 Front-end HTTP request processing method, device and system
CN114138507A (en) * 2021-11-09 2022-03-04 中国联合网络通信集团有限公司 Python program service method, device and computer readable storage medium
CN114138507B (en) * 2021-11-09 2024-05-17 中国联合网络通信集团有限公司 Python program service method, device and computer readable storage medium
CN115277187A (en) * 2022-07-26 2022-11-01 新明珠集团股份有限公司 Method, device, storage medium and equipment for prompting request data verification result

Also Published As

Publication number Publication date
CN106656920B (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN106656920A (en) HTTP service processing method and device
US20220276910A1 (en) Dynamically integrating a client application with third-party services
US11563674B2 (en) Content based routing method and apparatus
US8719421B2 (en) Cross domain interaction of a web application
US11765048B2 (en) Declarative and reactive data layer for component-based user interfaces
US9672140B1 (en) Processing special requests at dedicated application containers
WO2019042240A1 (en) Short-link parsing method, apparatus and device
US10015226B2 (en) Methods for making AJAX web applications bookmarkable and crawlable and devices thereof
US20210084019A1 (en) Secured rest execution inside headless web application
CN107454094A (en) A kind of data interactive method and system
CN108287839A (en) A kind of page loading method and equipment
US20140143647A1 (en) Method for improving browser cache by reducing duplicate stored content
US10810358B2 (en) Automatic and dynamic generation of customized computer user interface screens
US20200159917A1 (en) Distributed security introspection
US11281438B2 (en) Platform for web services development and method therefor
US20150222664A1 (en) Conflict resolution in extension induced modifications to web requests and web page content
CN113612686A (en) Traffic scheduling method and device and electronic equipment
CN110795741B (en) Method and device for carrying out security processing on data
CN109472127A (en) Permission processing method, device, using side apparatus and storage medium
CN108021564A (en) A kind of method and apparatus of page reorientation
CN113253999B (en) Plug-in data access method, data source management system and interface access method
CN105786476A (en) Data processing method and system based on mobile client and server
CN112926002A (en) Service request processing method and device
CN104144126B (en) Method and system, the client of flow optimization are realized by image procossing
EP3502925B1 (en) Computer system and method for extracting dynamic content from websites

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

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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant