CN107528843A - The processing method and processing unit of a kind of network request - Google Patents
The processing method and processing unit of a kind of network request Download PDFInfo
- Publication number
- CN107528843A CN107528843A CN201710735132.2A CN201710735132A CN107528843A CN 107528843 A CN107528843 A CN 107528843A CN 201710735132 A CN201710735132 A CN 201710735132A CN 107528843 A CN107528843 A CN 107528843A
- Authority
- CN
- China
- Prior art keywords
- network request
- acknowledgement information
- application program
- monitored
- token
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 11
- 230000015572 biosynthetic process Effects 0.000 claims abstract description 14
- 230000005540 biological transmission Effects 0.000 claims description 24
- 238000000034 method Methods 0.000 claims description 10
- 108010001267 Protein Subunits Proteins 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0807—Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/321—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
- H04L9/3213—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention provides a kind of processing method of network request and processing unit, including:At least one first network that record is sent to external service end by application program to be monitored is asked, and obtains at least one first acknowledgement information that external service end asks to return to application program according at least one first network;Determine in each first acknowledgement information, if the current accessed token that at least one second acknowledgement information sign application program to be monitored be present is expired;When at least one second acknowledgement information be present, refresh the current accessed token of application program to be monitored to form target access token;Using target access token replace each second acknowledgement information institute respectively corresponding to first network ask in the current accessed token that carries, to form at least one second network request;Each second network request of formation is sent to external service end.This programme repeats to send identical network request without application program.
Description
Technical field
The present invention relates to field of computer technology, the processing method and processing unit of more particularly to a kind of network request.
Background technology
Application program refers to that it operates in user model, can to complete the computer program of a certain or multinomial particular job
To be interacted with user, there is visual user interface, such as Word, Photoshop, wechat.
At present, after application program sends network request to service end, service end can be applied journey according to network request
Response message corresponding to sequence.But when response message be application program access token it is expired when, it is necessary to wait application program again
After refreshing access token, then resend identical network request.
The content of the invention
The embodiments of the invention provide a kind of processing method of network request and processing unit, repeats to send out without application program
Send identical network request.
In a first aspect, the embodiments of the invention provide a kind of processing method of network request, including:
At least one first network that record is sent to external service end by application program to be monitored is asked, and obtains outside
At least one first acknowledgement information that service end asks to return to the application program according at least one first network, its
In, at least one first acknowledgement information corresponds with least one first network request;
Determine in each first acknowledgement information, if it is described to be monitored to there is at least one second acknowledgement information sign
The current accessed token of application program is expired;
When at least one second acknowledgement information be present, refresh the current accessed token of the application program to be monitored
To form target access token;
Using the target access token replace each second acknowledgement information distinguish corresponding to first network ask
The current accessed token of middle carrying, to form at least one second network request;
Each second network request of formation is sent to the external service end.
Preferably, when at least one second acknowledgement information be present,
In the current accessed token for refreshing the application program to be monitored before forming target access token, to enter one
Step includes:
Detect whether the application program to be monitored is refreshing the current accessed token;
When the application program to be monitored does not refresh the current accessed token, then it is described to be monitored to perform the refreshing
The current accessed token of application program is to form target access token.
Preferably, it is described record by application program to be monitored be sent to external service end at least one first network please
After asking, it is described each second network request of formation is sent to the external service end before, further comprise:
According at least one first network request of record, determine that the reception of each first network request is suitable
Sequence;
According to reception order, the transmission of at least one second network request is determined sequentially;
It is described that each second network request of formation is sent to the external service end, including:
According to transmission order, at least one second network request is sent to the external service end successively.
Preferably, asked at the acquisition external service end according at least one first network to the application program
After at least one first acknowledgement information returned, in each first acknowledgement information of determination, if exist at least
One the second acknowledgement information characterize the application program to be monitored current accessed token it is expired before, further comprise:
Record the return order of at least one first acknowledgement information;
Then, it is described to determine in each first acknowledgement information, if at least one second acknowledgement information to be present and characterize institute
It is expired to state the current accessed token of application program to be monitored, including:
According to return first acknowledgement information of sequential selection one;
Judge first acknowledgement information whether carry characterize the application program to be monitored current accessed token it is expired
Target identification;
The current accessed token that the sign application program to be monitored is carried in first acknowledgement information of selection is expired
Target identification when, determine at least one 3rd from each first network request of record according to reception order
Network request;
Then, it is described using the target access token replace each second acknowledgement information distinguish corresponding to the first net
The current accessed token carried in network request, to form at least one second network request, including:
The current accessed token carried in each 3rd network request is replaced using the target access token,
To form at least one second network request.
Preferably, it is described each second network request of formation is sent to external service end after, further
Including:
The external service end is obtained according to corresponding at least one second receipt returned of each second network request
Information;
Determine the receipt order of each second acknowledgement information;
According to receipt order, each described second acknowledgement information is sent to described to be monitored applies journey successively
Sequence.
Second aspect, the embodiments of the invention provide a kind of processing unit of network request, including:
Acquiring unit, at least one first network for being sent to external service end by application program to be monitored for recording please
Ask, and obtain external service end asks to return to the application program according at least one first network at least one the
One acknowledgement information, wherein, at least one first acknowledgement information corresponds with least one first network request;
Processing unit, in first acknowledgement information obtained for determining each acquiring unit, if exist to
The current accessed token that few second acknowledgement information characterizes the application program to be monitored is expired;
Refresh unit, for when second acknowledgement information that at least one processing unit determines be present, refreshing
The current accessed token of the application program to be monitored is to form target access token;
Replacement unit, it is single that the target access token for being refreshed using the refresh unit replaces each acquisition
Second acknowledgement information institute of member record respectively corresponding to first network ask in the current accessed token that carries, with shape
Into at least one second network request;
Transmitting element, each second network request for the replacement unit to be formed are sent to the outside clothes
Business end.
Preferably, when at least one second acknowledgement information be present,
The processing unit, it is further used for detecting whether the application program to be monitored is refreshing the current accessed order
Board;
The refresh unit, it is further used for when the application program to be monitored does not refresh the current accessed token,
The current accessed token for refreshing the application program to be monitored is then performed to form target access token.
Preferably, the acquiring unit, it is further used at least one first network request according to record, it is determined that
The reception order of each first network request;
The replacement unit, be further used for according to the acquiring unit determine the reception order, it is determined that it is described extremely
The transmission order of few second network request;
Preferably, the processing unit, including:Select subelement, judgment sub-unit and determination subelement;
The acquiring unit, it is further used for recording the return order of at least one first acknowledgement information;
The selection subelement, for the return sequential selection one described first recorded according to the acquiring unit
Acknowledgement information;
The judgment sub-unit, for judge it is described selection subelement selection first acknowledgement information whether carrying table
Levy the expired target identification of the current accessed token of the application program to be monitored;
The determination subelement, first acknowledgement information for judging selection in the judgment sub-unit, which carries, to be characterized
During the expired target identification of the current accessed token of the application program to be monitored, according to reception order from each of record
At least one 3rd network request is determined in the first network request;
The replacement unit, it is further used for replacing in each 3rd network request using the target access token
The current accessed token carried, to form at least one second network request.
Preferably, the acquiring unit, it is further used for obtaining the external service end according to each second network
Corresponding at least one second acknowledgement information returned of request;Determine the receipt order of each second acknowledgement information;
The transmitting element, it is further used for the receipt order obtained according to the acquiring unit, successively will be each
Second acknowledgement information that the individual acquiring unit obtains is sent to the application program to be monitored.
In embodiments of the present invention, according to each first acknowledgement information returned by external service end, it may be determined that wait to supervise
Whether expired control the current accessed token of application program, when it is determined that the current accessed token of application program to be monitored is out of date,
Need to refresh current accessed token and form target access token, then the target access token after refreshing is replaced into each first net
Current accessed token out of date in network request, and corresponding at least one second network request is formed, finally by each net
Network request is sent to external service end.As fully visible, when it is determined that the current accessed token of application program to be monitored is expired, without
Application program repeats to send identical network request.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 is a kind of flow chart of the processing method for network request that one embodiment of the invention provides;
Fig. 2 is the flow chart of the processing method for another network request that one embodiment of the invention provides;
Fig. 3 is a kind of structural representation of the processing unit for network request that one embodiment of the invention provides;
Fig. 4 is the structural representation of the processing unit for another network request that one embodiment of the invention provides.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiments of the invention provide a kind of processing method of network request, including:
Step 101:At least one first network that record is sent to external service end by application program to be monitored is asked, and
Obtain at least one first time that external service end asks to return to the application program according at least one first network
Information is held, wherein, at least one first acknowledgement information corresponds with least one first network request;
Step 102:Determine in each first acknowledgement information, if at least one second acknowledgement information be present and characterize institute
The current accessed token for stating application program to be monitored is expired;
Step 103:When at least one second acknowledgement information be present, refresh the current of the application program to be monitored
Access token is to form target access token;
Step 104:Using the target access token replace each second acknowledgement information distinguish corresponding to first
The current accessed token carried in network request, to form at least one second network request;
Step 105:Each second network request of formation is sent to the external service end.
In embodiments of the present invention, according to each first acknowledgement information returned by external service end, it may be determined that wait to supervise
Whether expired control the current accessed token of application program, when it is determined that the current accessed token of application program to be monitored is out of date,
Need to refresh current accessed token and form target access token, then the target access token after refreshing is replaced into each first net
Current accessed token out of date in network request, and corresponding at least one second network request is formed, finally by each net
Network request is sent to external service end.As fully visible, when it is determined that the current accessed token of application program to be monitored is expired, without
Application program repeats to send identical network request.
In the current accessed token for refreshing the application program to be monitored before forming target access token, to enter one
Step includes:
Detect whether the application program to be monitored is refreshing the current accessed token;
When the application program to be monitored does not refresh the current accessed token, then it is described to be monitored to perform the refreshing
The current accessed token of application program is to form target access token.
In embodiments of the present invention, it is necessary to first examine when in the presence of the second expired acknowledgement information of sign current accessed token
Survey whether application program to be monitored has refreshed current accessed token, avoid refreshing current accessed token simultaneously and causing resource
Waste, when detecting that application program to be monitored does not refresh current accessed token, then can refresh current accessed token as early as possible, with up to
To refreshing after current accessed token the purpose that resends network request.
For example, when detecting that application program Z to be monitored is not refreshing current accessed token A, by pre-setting
Refreshing access token common class, current accessed token A can be refreshed, and formed refresh after target access token B.
In an embodiment of the present invention, at least the one of external service end is sent to by application program to be monitored in the record
After the request of individual first network, it is described by each second network request of formation be sent to the external service end it
Before, further comprise:
According at least one first network request of record, determine that the reception of each first network request is suitable
Sequence;
According to reception order, the transmission of at least one second network request is determined sequentially;
It is described that each second network request of formation is sent to the external service end, including:
According to transmission order, at least one second network request is sent to the external service end successively.
In embodiments of the present invention, due to there is logical order between each second network request, and the second network request with
First network request is corresponding, so the reception order asked according to each first network, it may be determined that corresponding each second
The transmission order of network request, then is sent to external service end successively by each second network request according to transmission order, can be with
Avoid the situation of logical order mistake occur when sending the second network request.
For example, A, B, C are asked according to the first network of record, it may be determined that first network request A reception order
For 1, first network request B reception order is 2, and first network request C reception order is 3, the second network request A corresponding the
One network request A, the second network request B, which corresponds to first network, asks B, the second network request C to correspond to first network request C, institute
With can be with the second network request A transmission order for 1, the second network request B transmission order be 2, the second network request C hair
It is 3 to send order.
In an embodiment of the present invention, it is described acquisition external service end according at least one first network ask to
After at least one first acknowledgement information that the application program returns, in each first acknowledgement information of determination,
With the presence or absence of at least one second acknowledgement information characterize the application program to be monitored current accessed token it is expired before, enter one
Step includes:
Record the return order of at least one first acknowledgement information;
Then, it is described to determine in each first acknowledgement information, if at least one second acknowledgement information to be present and characterize institute
It is expired to state the current accessed token of application program to be monitored, including:
According to return first acknowledgement information of sequential selection one;
Judge first acknowledgement information whether carry characterize the application program to be monitored current accessed token it is expired
Target identification;
The current accessed token that the sign application program to be monitored is carried in first acknowledgement information of selection is expired
Target identification when, determine at least one 3rd from each first network request of record according to reception order
Network request;
Then, it is described using the target access token replace each second acknowledgement information distinguish corresponding to the first net
The current accessed token carried in network request, to form at least one second network request, including:
The current accessed token carried in each 3rd network request is replaced using the target access token,
To form at least one second network request.
In embodiments of the present invention, can be according to by arriving first according to the return of each first acknowledgement information of record order
Afterwards return order, successively according to each first acknowledgement information determine application program to be monitored current accessed token whether mistake
Phase, when the current accessed token that application program to be monitored can be determined according to some first acknowledgement information is out of date, it is necessary to from
The 3rd network request corresponding with first acknowledgement information is searched in each first network request, you can by the 3rd network request
Current accessed token out of date replaces with the target access token after refreshing and forms the second network request.Although what is formed is each
Individual second network request, which can be resend, gives external service end, but is sent without application program, so as to avoid application program
Resend identical network request.
For example, the return order for recording the first acknowledgement information A respectively is 1, and the first acknowledgement information B return order is
2, the first acknowledgement information C return order are 3, according to by the return order after arriving first, determine each first acknowledgement information successively
A, B and C, if it is expired to characterize application program Z to be monitored current accessed token, if it is determined that the first acknowledgement information C is table
Levy application program Z to be monitored current accessed token it is expired when, from the request of each first network of record A, B, C, it is determined that with
Second network request C corresponding to first acknowledgement information C.
In an embodiment of the present invention, each second network request of formation is sent to external service end described
Afterwards, further comprise:
The external service end is obtained according to corresponding at least one second receipt returned of each second network request
Information;
Determine the receipt order of each second acknowledgement information;
According to receipt order, each described second acknowledgement information is sent to the application program to be monitored.
In embodiments of the present invention, the receipt order of each second acknowledgement information returned according to external service end, will be outer
Each second acknowledgement information that portion's service end returns is sent to application program to be monitored successively, can avoid application program to be monitored
Occur when receiving each second acknowledgement information of logic entanglement abnormal.
For example, the second acknowledgement information A, the second acknowledgement information B and the second receipt letter that external service end returns are obtained
C is ceased, and the return order for recording second acknowledgement information A, B, C is followed successively by 1,2,3, according to by the return order after arriving first, difference
Second acknowledgement information A, the second acknowledgement information B and the second acknowledgement information C are sent to application program Z to be monitored.
In order to more clearly illustrate technical scheme and advantage, answered below so that application program to be monitored is to be monitored
Exemplified by how sending network request to service end with program Z, a kind of processing method of network request provided by the invention is carried out
Describe in detail, as shown in Fig. 2 specifically may comprise steps of:
Step 201:At least one first network that record is sent to service end by application program Z to be monitored is asked, and is remembered
Record the reception order of each first network request.
Specifically, record each first network sent by application program Z-direction service end to be monitored to ask, record simultaneously
The reception order of each first network request, so that when first network asks failure, can be from each first net of record
The second network request resend is determined in network request, and each second net is sent to service end successively according to reception order
Network is asked.
For example, first network request A, B, C that service end is sent to by application program Z to be monitored are recorded and replicate,
And the reception order for recording first network request A, B, C is followed successively by 1,2,3.
Step 202:Service end is obtained to ask to return at least to application program Z to be monitored according at least one first network
One the first acknowledgement information, and record the return order of each the first acknowledgement information.
Specifically, each first acknowledgement information returned by service end is recorded, while records each first receipt letter
The return order of breath, so that according to return order, determine whether each first acknowledgement information characterizes successively and to be monitored apply journey
Sequence Z current accessed token is out of date, may thereby determine that whether application program Z to be monitored current accessed token is expired.
For example, record by service end return first acknowledgement information a, b, c, and record first acknowledgement information a, b,
C return order is followed successively by 1,2,3.
Step 203:According to return one the first acknowledgement information of sequential selection.
Specifically, in order to find out characterize earliest application program to be monitored current accessed token it is out of date the first receipt letter
Breath, it is necessary to determine the content of each the first acknowledgement information according to return order successively.
For example, according to the return order from 1 to 3, the first acknowledgement information a is first selected.
Step 204:Judge the first acknowledgement information whether carry characterize application program Z to be monitored current accessed token it is expired
Target identification, if it is, perform step 205, otherwise, perform step 206.
Specifically, after the first acknowledgement information is selected, application to be monitored can be determined according to first acknowledgement information
Whether program Z current accessed token is out of date, if it is, needing to find out and first from each first network request of record
Second network request corresponding to acknowledgement information, if it is not, then first acknowledgement information is sent to application program Z to be monitored,
Continue to select next first acknowledgement information further according to return order.
For example, the first acknowledgement information a of selection is judged, if carry the current visit for characterizing application program Z to be monitored
Ask token expired target identification, if it is, first network request A, first network request B, first network request C from record
In, it may be determined that it is first network request A to go out corresponding with a of the first acknowledgement information, and forms the second network request A1, if
First acknowledgement information a does not carry the expired target identification of current accessed token for characterizing application program Z to be monitored, then by first time
Hold information a and be sent to application program Z to be monitored, and continue according to return order, judge next first acknowledgement information.
Step 205:At least one second network is determined from each first network request of record according to reception order
Request.
Specifically, when the first acknowledgement information of selection is to carry the current accessed token mistake for characterizing application program Z to be monitored
, it is necessary to find out the second network corresponding with the first acknowledgement information from each first network request of record during the target identification of phase
Request.
For example, when the first acknowledgement information b and the first acknowledgement information c of selection are to carry to characterize application program to be monitored
During the expired target identification of Z current accessed token, from the first network request A, first network request B, first network of record
Ask in C, it may be determined that it is that first network asks B and forms the second network request B1 to go out corresponding with the b of the first acknowledgement information,
It is corresponding with the c of the first acknowledgement information to be first network request C and form the second network request C1.
Step 206:Detect whether application program Z to be monitored is refreshing current accessed token, if it is, step 207 is performed,
Otherwise step 208 is performed.
Specifically, it is determined that in the presence of the expired target identification of the current accessed token for carrying sign application program Z to be monitored
The first acknowledgement information after, first detect application program Z to be monitored whether refresh current accessed token, if application to be monitored
Program Z is refreshing current accessed token, then the current token after refreshing is defined as into target access token, if to be monitored should
Do not refresh access token with program Z, then perform refreshing current accessed token immediately.
For example, detect whether application program Z to be monitored is refreshing current accessed token X, if it is, after refreshing
Current accessed token X be defined as target access token X1, if application program Z to be monitored not refresh current accessed token X,
The common class pre-set is then called, refreshes current accessed token X, and the current accessed token X after refreshing is defined as mesh
Mark access token X1.
Step 207:Current accessed token after refreshing is defined as target access token, and performs step 209.
Specifically, will be current after refreshing if detecting that application program Z to be monitored is refreshing current accessed token
Access token is defined as target access token.
Step 208:Perform and refresh application program Z to be monitored current accessed token to form target access token.
Specifically, when detecting that application program Z to be monitored is not refreshing current accessed token, it is current to be immediately performed refreshing
Access token, and the current accessed token after refreshing is defined as target access token.
Step 209:Using target access token replace each first acknowledgement information distinguish corresponding to the second network request
The current accessed token of middle carrying, to form at least one complete second network request.
Specifically, by the second network request corresponding to each first acknowledgement information difference, current accessed out of date makes
Board replaces with the target access token after refreshing, and forms each complete second network request.
For example, the current accessed token X carried in the second network request B1 is replaced with into target access token X1, will
The current accessed token X carried in second network request C1 replaces with target access token X1.
Step 210:According to reception order, the transmission of at least one second network request is determined sequentially.
Specifically, due to the possible more than one of the second network request, and there is logic pass between each second network request
System, so the reception order asked according to first network, it may be determined that go out the transmission order of the second network request, according still further to transmission
Sequentially, each second network request is sent successively.
For example, because the reception order of first network request B corresponding to the second network request B1 is 2, it is possible to
The transmission order for determining the second network request B1 is 2, and the reception order of the second network request C corresponding to the second network request C1 is
3, it is possible to which the transmission order for determining the second network request C1 is 3.
Step 211:According to transmission order, at least one second network request is sent to service end successively.
Specifically, in order to avoid causing after sending each second network request to service at random, application program Z clothes to be monitored
Business occurs abnormal, it is necessary to according to the transmission of each second network request sequentially, each second network request is sent into clothes successively
Business end.
For example, because the second network request B1 transmission order is 2, the second network request C1 reception order is 3,
Need small to big transmission order according to having, the second network request B1 and the second network request C1 are sent to service end successively.
Step 212:Service end is obtained according to corresponding at least one second acknowledgement information returned of each second network request.
Specifically, after each second network request is sent into service end, each of service end return can be got
Second acknowledgement information.
For example, service end is obtained according to the second network request B1 the second acknowledgement information b1 returned and obtains service end
The the second acknowledgement information c1 returned according to the second network request C1.
Step 213:The receipt order of each the second acknowledgement information is determined, and according to receipt order, successively by each
Second acknowledgement information is sent to application program Z to be monitored.
Specifically, it is necessary to first determine each before each second acknowledgement information is sent into application program Z to be monitored
The receipt order of two acknowledgement informations, according to receipt order, is sent to application program to be monitored by each second acknowledgement information successively
Z, application program Z to be monitored is avoided to occur when receiving the second acknowledgement information of sequence error abnormal.
For example, because the second acknowledgement information b1 receipt order is 1, the second acknowledgement information c1 receipt order is 2,
So it is small to big receipt order according to having, the second acknowledgement information b1 and the second acknowledgement information c1 are sent to be monitored answer successively
B and first network request C is asked to be deleted from record with program Z, and by corresponding first network.
Step 214:First acknowledgement information is sent to service end, continues executing with step 203.
Specifically, when first acknowledgement information do not carry characterize application program Z to be monitored current accessed token it is expired
During target identification, first acknowledgement information is sent to application program Z to be monitored, and by record and first acknowledgement information pair
The first network request answered is deleted from record, and according to return order, continues to judge next first acknowledgement information.
For example, it is determined that the first acknowledgement information a, which is not carried, characterizes application program Z to be monitored current accessed token mistake
During the target identification of phase, the first acknowledgement information a is sent to application program Z to be monitored, and by corresponding to the first acknowledgement information a
One network request A, deleted from each first network request of record.
As shown in figure 3, the embodiments of the invention provide a kind of processing unit of network request, including:
Acquiring unit 301, at least one first net at external service end is sent to by application program to be monitored for recording
Network ask, and obtain external service end according at least one first network ask to the application program return at least one
Individual first acknowledgement information, wherein, a pair of at least one first acknowledgement information and at least one first network request 1
Should;
Processing unit 302, in first acknowledgement information obtained for determining each acquiring unit 301, if
The current accessed token that at least one second acknowledgement information sign application program to be monitored be present is expired;
Refresh unit 303, for when second acknowledgement information that at least one determination of the processing unit 302 be present
When, refresh the current accessed token of the application program to be monitored to form target access token;
Replacement unit 304, the target access token for being refreshed using the refresh unit 303 are replaced each described
Second acknowledgement information institute that acquiring unit 301 records respectively corresponding to first network ask in the current accessed that carries
Token, to form at least one second network request;
Transmitting element 305, each second network request for the replacement unit to be formed are sent to described outer
Portion's service end.
In an embodiment of the present invention, when at least one second acknowledgement information be present,
The processing unit, it is further used for detecting whether the application program to be monitored is refreshing the current accessed order
Board;
The refresh unit, it is further used for when the application program to be monitored does not refresh the current accessed token,
The current accessed token for refreshing the application program to be monitored is then performed to form target access token.
In an embodiment of the present invention, the acquiring unit, it is further used for described at least one first according to record
Network request, determine the reception order of each first network request;
The replacement unit, be further used for according to the acquiring unit determine the reception order, it is determined that it is described extremely
The transmission order of few second network request;
Based on a kind of processing unit of network request shown in Fig. 1, in one embodiment of the invention, as shown in figure 4, the device
In the processing unit 302, including:Select subelement 3021, judgment sub-unit 3022 and determination subelement 3023;
The acquiring unit 301, it is further used for recording the return order of at least one first acknowledgement information;
The selection subelement 3021, for the return sequential selection one recorded according to the acquiring unit 301
First acknowledgement information;
The judgment sub-unit 3022, for judge it is described selection subelement 3021 select first acknowledgement information be
It is no to carry the expired target identification of current accessed token for characterizing the application program to be monitored;
The determination subelement 3023, for judging first acknowledgement information of selection in the judgment sub-unit 3022
When carrying the expired target identification of current accessed token for characterizing the application program to be monitored, according to reception order from note
At least one 3rd network request is determined in each first network request of record;
The replacement unit 304, being further used for please using each 3rd network of target access token replacement
The current accessed token of middle carrying is sought, to form at least one second network request.
In an embodiment of the present invention, the acquiring unit, it is further used for obtaining the external service end according to each
Corresponding at least one second acknowledgement information returned of second network request;Determine returning for each second acknowledgement information
Hold order;
The transmitting element, it is further used for the receipt order obtained according to the acquiring unit, successively will be each
Second acknowledgement information that the individual acquiring unit obtains is sent to the application program to be monitored.
The each embodiment of the present invention at least has the advantages that:
1st, in one embodiment of the invention, according to each first acknowledgement information returned by external service end, it may be determined that treat
Whether expired the current accessed token of application program is monitored, it is determined that the current accessed token of application program to be monitored is out of date
When, it is necessary to refresh current accessed token and form target access token, then the target access token after refreshing replaced each the
Current accessed token out of date in one network request, and corresponding at least one second network request is formed, finally will be each
Individual network request is sent to external service end.As fully visible, when it is determined that the current accessed token of application program to be monitored is expired,
Repeat to send identical network request without application program.
2nd, in one embodiment of the invention, it is necessary to elder generation when in the presence of the second expired acknowledgement information of sign current accessed token
Detect whether application program to be monitored has refreshed current accessed token, avoid refreshing current accessed token simultaneously and causing to provide
Source wastes, and when detecting that application program to be monitored does not refresh current accessed token, then can refresh current accessed token as early as possible, with
Reach the purpose that network request is resend after current accessed token is refreshed.
3rd, in one embodiment of the invention, due to having logical order, and the second network request between each second network request
It is corresponding with first network request, so the reception order asked according to each first network, it may be determined that corresponding each the
The transmission order of two network requests, then each second network request is sent to external service end successively according to transmission order, can
To avoid the situation of logical order mistake occur when sending the second network request.
4th,, can be according to by elder generation according to the return of each first acknowledgement information of record order in one embodiment of the invention
After arriving return order, successively according to each first acknowledgement information determine application program to be monitored current accessed token whether mistake
Phase, when the current accessed token that application program to be monitored can be determined according to some first acknowledgement information is out of date, it is necessary to from
The 3rd network request corresponding with first acknowledgement information is searched in each first network request, you can by the 3rd network request
Current accessed token out of date replaces with the target access token after refreshing and forms the second network request.Although what is formed is each
Individual second network request, which can be resend, gives external service end, but is sent without application program, so as to avoid application program
Resend identical network request.
5th, in one embodiment of the invention, the receipt order of each second acknowledgement information returned according to external service end will
Each second acknowledgement information that external service end returns is sent to application program to be monitored successively, can avoid to be monitored applying journey
Sequence occurs abnormal when receiving each second acknowledgement information of logic entanglement.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation makes a distinction with another entity or operation, and not necessarily require or imply and exist between these entities or operation
Any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-
It is exclusive to include, so that process, method, article or equipment including a series of elements not only include those key elements,
But also the other element including being not expressly set out, or also include solid by this process, method, article or equipment
Some key elements.In the absence of more restrictions, by sentence " including the key element that a 〃 〃 " is limited, it is not excluded that
Other identical factor in the process including the key element, method, article or equipment also be present.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made within the spirit and principles of the invention,
Equivalent substitution, improvement etc., are all contained in protection scope of the present invention.
Claims (10)
- A kind of 1. processing method of network request, it is characterised in that including:At least one first network that record is sent to external service end by application program to be monitored is asked, and obtains external service At least one first acknowledgement information that end asks to return to the application program according at least one first network, wherein, At least one first acknowledgement information corresponds with least one first network request;Determine in each first acknowledgement information, if at least one second acknowledgement information be present and characterize the application to be monitored The current accessed token of program is expired;When at least one second acknowledgement information be present, refresh the current accessed token of the application program to be monitored with shape Into target access token;Each second acknowledgement information institute is replaced using the target access token to take during corresponding first network is asked respectively The current accessed token of band, to form at least one second network request;Each second network request of formation is sent to the external service end.
- 2. according to the method for claim 1, it is characterised in thatWhen at least one second acknowledgement information be present,In the current accessed token for refreshing the application program to be monitored with before forming target access token, further bag Include:Detect whether the application program to be monitored is refreshing the current accessed token;When the application program to be monitored does not refresh the current accessed token, then the refreshing application to be monitored is performed The current accessed token of program is to form target access token.
- 3. according to the method for claim 1, it is characterised in thatAfter the record is sent at least one first network request at external service end by application program to be monitored, in institute State before each second network request of formation is sent into the external service end, further comprise:According at least one first network request of record, the reception of each first network request is determined sequentially;According to reception order, the transmission of at least one second network request is determined sequentially;It is described that each second network request of formation is sent to the external service end, including:According to transmission order, at least one second network request is sent to the external service end successively.
- 4. according to the method for claim 3, it is characterised in thatAsk to return at least to the application program according at least one first network at the acquisition external service end After one the first acknowledgement information, in each first acknowledgement information of determination, if exist at least one second time Hold application program to be monitored described in information representation current accessed token it is expired before, further comprise:Record the return order of at least one first acknowledgement information;Then, it is described to determine in each first acknowledgement information, if to exist and treated described at least one second acknowledgement information sign It is expired to monitor the current accessed token of application program, including:According to return first acknowledgement information of sequential selection one;Judge whether first acknowledgement information carries the expired mesh of current accessed token for characterizing the application program to be monitored Mark mark;In the mesh that the current accessed token of first acknowledgement information carrying sign application program to be monitored of selection is expired During mark mark, at least one 3rd network is determined from each first network request of record according to reception order Request;Then, it is described using the target access token replace each second acknowledgement information distinguish corresponding to first network ask The current accessed token of middle carrying is sought, to form at least one second network request, including:The current accessed token carried in each 3rd network request is replaced using the target access token, with shape Into at least one second network request.
- 5. according to any described method in Claims 1-4, it is characterised in thatIt is described each second network request of formation is sent to external service end after, further comprise:The external service end is obtained according to corresponding at least one second acknowledgement information returned of each second network request;Determine the receipt order of each second acknowledgement information;According to receipt order, each described second acknowledgement information is sent to the application program to be monitored successively.
- A kind of 6. processing unit of network request, it is characterised in that including:Acquiring unit, at least one first network for being sent to external service end by application program to be monitored for recording are asked, And obtain external service end according at least one first network ask to the application program return at least one first Acknowledgement information, wherein, at least one first acknowledgement information corresponds with least one first network request;Processing unit, in first acknowledgement information obtained for determining each acquiring unit, if having at least one The current accessed token that individual second acknowledgement information characterizes the application program to be monitored is expired;Refresh unit, for when second acknowledgement information that at least one processing unit determines be present, described in refreshing The current accessed token of application program to be monitored is to form target access token;Replacement unit, the target access token for being refreshed using the refresh unit replace each acquiring unit note Second acknowledgement information institute of record respectively corresponding to the current accessed token that carries in first network request, with formation extremely Few second network request;Transmitting element, each second network request for the replacement unit to be formed are sent to the external service End.
- 7. processing unit according to claim 6, it is characterised in thatWhen at least one second acknowledgement information be present,The processing unit, it is further used for detecting whether the application program to be monitored is refreshing the current accessed token;The refresh unit, it is further used for when the application program to be monitored does not refresh the current accessed token, then holding The current accessed token for refreshing the application program to be monitored go to form target access token.
- 8. processing unit according to claim 6, it is characterised in thatThe acquiring unit, it is further used at least one first network request according to record, determines described in each The reception order of first network request;The replacement unit, it is further used for the reception order determined according to the acquiring unit, it is determined that described at least one The transmission order of individual second network request.
- 9. processing unit according to claim 8, it is characterised in that the processing unit, including:Selection subelement, sentence Disconnected subelement and determination subelement;The acquiring unit, it is further used for recording the return order of at least one first acknowledgement information;The selection subelement, for first receipt of the return sequential selection one recorded according to the acquiring unit Information;The judgment sub-unit, whether first acknowledgement information for judging the selection subelement selection, which carries, characterizes institute State the expired target identification of the current accessed token of application program to be monitored;The determination subelement, for judging that first acknowledgement information of selection is carried described in sign in the judgment sub-unit During the expired target identification of the current accessed token of application program to be monitored, according to reception order from record it is each described in At least one 3rd network request is determined in first network request;The replacement unit, it is further used for carrying using in each 3rd network request of target access token replacement The current accessed token, to form at least one second network request.
- 10. according to any described processing unit in claim 6 to 9, it is characterised in thatThe acquiring unit, it is further used for obtaining the external service end according to the corresponding return of each second network request At least one second acknowledgement information;Determine the receipt order of each second acknowledgement information;The transmitting element, it is further used for the receipt order obtained according to the acquiring unit, successively by each institute Second acknowledgement information for stating acquiring unit acquisition is sent to the application program to be monitored.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710735132.2A CN107528843A (en) | 2017-08-24 | 2017-08-24 | The processing method and processing unit of a kind of network request |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710735132.2A CN107528843A (en) | 2017-08-24 | 2017-08-24 | The processing method and processing unit of a kind of network request |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107528843A true CN107528843A (en) | 2017-12-29 |
Family
ID=60682032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710735132.2A Pending CN107528843A (en) | 2017-08-24 | 2017-08-24 | The processing method and processing unit of a kind of network request |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107528843A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109814942A (en) * | 2018-12-19 | 2019-05-28 | 北京城市网邻信息技术有限公司 | A kind of parameter processing method and device |
CN110955871A (en) * | 2018-09-26 | 2020-04-03 | 北京国双科技有限公司 | Data acquisition method and device |
CN113781255A (en) * | 2021-08-06 | 2021-12-10 | 广西电网有限责任公司 | Block chain-based safe data storage method and system for electric power transaction system |
CN115426156A (en) * | 2022-08-30 | 2022-12-02 | 北京商银微芯科技有限公司 | Method and device for processing multiple concurrent asynchronous characteristic network requests |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581140A (en) * | 2012-08-03 | 2014-02-12 | 腾讯科技(深圳)有限公司 | Authorization control method, device and system and authorization request method and device |
CN104980925A (en) * | 2015-06-01 | 2015-10-14 | 走遍世界(北京)信息技术有限公司 | Authentication method and authentication device for user request |
CN105577691A (en) * | 2016-02-03 | 2016-05-11 | 飞天诚信科技股份有限公司 | Security access method and server |
CN106295394A (en) * | 2016-07-22 | 2017-01-04 | 飞天诚信科技股份有限公司 | Resource authorization method and system and authorization server and method of work |
CN106411825A (en) * | 2015-08-03 | 2017-02-15 | 天脉聚源(北京)科技有限公司 | WeChat access token acquisition method and system thereof |
-
2017
- 2017-08-24 CN CN201710735132.2A patent/CN107528843A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581140A (en) * | 2012-08-03 | 2014-02-12 | 腾讯科技(深圳)有限公司 | Authorization control method, device and system and authorization request method and device |
CN104980925A (en) * | 2015-06-01 | 2015-10-14 | 走遍世界(北京)信息技术有限公司 | Authentication method and authentication device for user request |
CN106411825A (en) * | 2015-08-03 | 2017-02-15 | 天脉聚源(北京)科技有限公司 | WeChat access token acquisition method and system thereof |
CN105577691A (en) * | 2016-02-03 | 2016-05-11 | 飞天诚信科技股份有限公司 | Security access method and server |
CN106295394A (en) * | 2016-07-22 | 2017-01-04 | 飞天诚信科技股份有限公司 | Resource authorization method and system and authorization server and method of work |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110955871A (en) * | 2018-09-26 | 2020-04-03 | 北京国双科技有限公司 | Data acquisition method and device |
CN109814942A (en) * | 2018-12-19 | 2019-05-28 | 北京城市网邻信息技术有限公司 | A kind of parameter processing method and device |
CN113781255A (en) * | 2021-08-06 | 2021-12-10 | 广西电网有限责任公司 | Block chain-based safe data storage method and system for electric power transaction system |
CN115426156A (en) * | 2022-08-30 | 2022-12-02 | 北京商银微芯科技有限公司 | Method and device for processing multiple concurrent asynchronous characteristic network requests |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107528843A (en) | The processing method and processing unit of a kind of network request | |
CN104468363B (en) | Page reorientation method, routing device, terminal device and system | |
CN105446827B (en) | Date storage method and equipment when a kind of database failure | |
CN107402880A (en) | A kind of method of testing and electronic equipment | |
JP4849929B2 (en) | Scenario creation program | |
CN106294094A (en) | The method of testing of game server, client, server and system | |
CN104796240A (en) | Fuzz testing system for stateful network protocol | |
CN104683181B (en) | A kind of method for monitoring performance, equipment and system | |
CN105099801B (en) | The test system of information management system and test environment analogy method | |
CN108521459A (en) | Diagnostic method, relevant device and the system of the vehicles | |
CN107436818A (en) | A kind of red packet acquisition of information and the method and apparatus sent | |
CN110147327A (en) | A kind of web automatic test management method based on more granularities | |
CN105808619A (en) | Task redoing method based on influence analysis, influence analysis calculation device and one-key reset device | |
CN106815137A (en) | Ui testing method and apparatus | |
CN104363257B (en) | A kind of user interface data method for refreshing and equipment | |
CN103428171B (en) | The processing method of a kind of session, application server and system | |
CN103312554B (en) | A kind of method of testing of multiserver interactive service and system | |
CN105630960B (en) | The method and apparatus of testing field Task conversational system | |
US6898793B1 (en) | Method for controlling activation of agent and computer | |
CN109831335A (en) | A kind of data monitoring method, monitor terminal, storage medium and data monitoring system | |
CN107483294B (en) | Method and device for monitoring network request | |
CN114338451B (en) | Controller local area network bus test system, method and storage medium | |
CN109120691A (en) | Condition detection method, system, device and the computer-readable medium of operation system | |
CN107967363A (en) | A kind of data processing method, device and electronic equipment | |
CN107566216A (en) | A kind of monitoring method, device and operation system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171229 |
|
RJ01 | Rejection of invention patent application after publication |