The content of the invention
The present invention provides a kind of service background recognition methods, proxy server and computer-readable storage medium, existing to solve
Have and the too high technical problem of proxy server cost in technology be present.
The first aspect of the embodiment of the present invention, there is provided a kind of service background recognition methods, applied to proxy server, bag
Include:Based on the first service request from ustomer premises access equipment, first service ID values are obtained;ID values, service mark are serviced based on including
The background service list of corresponding relation between the address information three of knowledge and service background, from least the two of at least two background services
First address information on first service backstage corresponding with the first service ID values is determined in individual address information.
It is described based on being set from user terminal with reference in a first aspect, in the first possible embodiment of first aspect
Standby first service request, obtains first service ID values, including:Judge whether to have in the cookie of first service request the
One service ID items;Wherein, the first service ID items are used to store the first service ID values determined based on the first operation;It is being yes
When, the first service ID items are read, to obtain the first service ID values.
With reference to the first possible embodiment of first aspect, in second of possible embodiment of first aspect
In, after whether having first service ID items in the cookie for judging the first service request, methods described also includes:
For it is no when, the response message asked based on the first service is returned into the user equipment end;Wherein, the response message
In include user's background service lists of the service identifiers and the service ID value corresponding relations.
It is described based on including service ID values with reference in a first aspect, in the third possible embodiment of first aspect
The background service list of corresponding relation between the address information of service background, from least two addresses of at least two background services
After the first address information that first service backstage corresponding with the first service ID values is determined in information, methods described is also
Including:The address information of the proxy server during the first service is asked is revised as first address information, with
Obtain the first modified service request;The described first modified service request is sent to first service backstage.
With reference to the third possible embodiment of first aspect, in the 4th kind of possible embodiment of first aspect
In, after the transmission first modified service request to the first service backstage, methods described also includes:Receive
The first service response message that the first service backstage is returned based on the described first modified service request;Judge described
Whether there are Set-Cookie items in the head response of one service response information;When to be, based on first address information from institute
State background service list and obtain the first service mark;First service mark is inserted into the head response, to obtain the
One response message;First response message is returned to the ustomer premises access equipment;For it is no when, the first service mark will be carried
The Set-Cookie items of knowledge insert the head response, to obtain the second response message;Second response message is returned described in
Ustomer premises access equipment.
The second aspect of the embodiment of the present invention, there is provided a kind of proxy server, including:Acquiring unit, for based on from
The first service request of ustomer premises access equipment, obtains first service ID values;Determining unit, for based on include service ID values, service
The background service list of corresponding relation between the address information three of mark and service background, from least two background services at least
First address information on first service backstage corresponding with the first service ID values is determined in two address informations.
With reference to second aspect, in the first possible embodiment of second aspect, the acquiring unit, including:Sentence
Break subelement, whether has first service ID items in the cookie for judging the first service request;Wherein, first clothes
ID items be engaged in for storing the first service ID values determined based on the first operation;Subelement is obtained, for when to be, described in reading
First service ID items, to obtain the first service ID values.
With reference to the first possible embodiment of second aspect, in second of possible embodiment of second aspect
In, the proxy server also includes:Transmitting element, for for it is no when, by the response asked based on the first service believe
Breath returns to the user equipment end;Wherein, the service identifiers and the service ID values pair are included in the response message
The user's background service list that should be related to.
With reference to second aspect, in the third possible embodiment of second aspect, the proxy server also includes:
Unit is changed, the address information for the proxy server during the first service is asked is revised as first address
Information, to obtain the first modified service request;Transmitting element, for sending the described first modified service request to described
One service background.
With reference to the third possible embodiment of second aspect, in the 4th kind of possible embodiment of second aspect
In, the proxy server also includes:Receiving unit, the described first modified clothes are based on for receiving the first service backstage
The first service response message that business is asked and returned;Judging unit, for judging the head response of the first service response message
In whether have Set-Cookie items;When to be, obtained based on first address information from the background service list described
First service identifies;First service mark is inserted into the head response, to obtain the first response message;Return to described first
Response message is to the ustomer premises access equipment;For it is no when, by the Set-Cookie items identified with the first service insert institute
Head response is stated, to obtain the second response message;Second response message is returned to the ustomer premises access equipment.
The third aspect of the embodiment of the present invention, there is provided a kind of computer-readable recording medium, including instruction, when the instruction
When running on computers so that the computer is performed such as the 4th kind of possible embodiment of first aspect to first aspect
Method described in any embodiment.
By the technical scheme in the said one of the embodiment of the present invention or multiple embodiments, the embodiment of the present invention at least has
There is following technique effect:
1st, in the embodiment that the application provides, can quickly be known by a background service list and first service ID values
The type of service of other user's request, and then allow proxy server accurately to identify the clothes required for user from more service backgrounds
Business backstage, then allow user to obtain the data of all service backgrounds by accessing 1 proxy server, improve user's body
Test;Further, enterprise can act on behalf of the business of all service backgrounds by 1 proxy server, so as to effectively reduce
Hardware cost.
2nd, in the embodiment that the application provides, the first service of user is allowed to carry first in asking by using cookie
ID values are serviced, and then allow proxy server easily to determine the demand of user by reading first service ID values, and due to
Cookie is really the browser that user equipment end is sent to after being generated by proxy server, and cookie is no more than 4kb
Low-volume information, this allow for proxy server for user carry out multiple business service during, only need to transmit a small amount of letter
Breath can provide the user diversified service, and then effectively improve Consumer's Experience.
3rd, in the embodiment that the application provides, described in being asked by the first service for only sending user
The address information of proxy server is revised as first address information of first background service, can fast-forwarding user
First service request, and then effectively saved the system resource of the proxy server, improved operating efficiency.Further
, because the proxy server is before the first service of forwarding user asks to first background service, just in advance
The address information of proxy server during the first service is asked is changed for the first address information, and then allows described first
Background service is only communicated with the proxy server all the time, it is achieved thereby that maintaining the original industry of the first background service
The technique effect for flow of being engaged in.
4th, in the embodiment that the application provides, the first of first service backstage is voluntarily judged by the proxy server
Whether there are Set-Cookie items in the head response of service response information, and the first service is inserted when there are Set-Cookie items
Mark obtains the first response message, and the Set-Cookie items that insert band has the first service mark when no obtain the second sound
Information is answered, first response message is just returned afterwards or second response message gives user equipment end.Whole modification process
Completed alone by the proxy server, so as to allow first background service when returning to the first service response message,
The technique effect of its original operation flow need not be changed by realizing.
Embodiment
In order that the purpose, technical scheme and advantage of the embodiment of the present invention are clearer, below in conjunction with accompanying drawing to this hair
Bright embodiment is described in further detail.
Technology described herein is not limited to use in server, can be also used for computer, work station, large scale computer, information
Stand, server rack etc..
The technical background of the embodiment of the present invention is introduced first.
In the prior art, in order to ensure the safety of service background, while and can efficiently provides the user service, generally
Can be that every service background configures a proxy server, user by access proxies, then allow proxy server on behalf of
Access service background and response data is transmitted to user, to obtain the data of service background.
At present, proxy server is only responsible for the forwarding of data, and is typically only capable to identify single service background, and with
User's increasingly multiple demands, various new business are continuously increased, the service background configured for these new business
It is being continuously increased, matched proxy server is also being continuously increased, so that the hardware cost of enterprise also constantly carries therewith
It is high.It follows that being continuously increased with the type of service of enterprise, the problem of hardware cost constantly increases be present.
In view of this, in an embodiment of the present invention, only by establishing a background service list in proxy server,
Allow in background service list and comprise at least the address information of all service backgrounds, and be that each address information establishment is corresponding in table
Service ID values, the demand for services of user is converted into service ID values when user performs the first operation, proxy server passes through
The corresponding address information of user's required service is determined in service ID values and background service list, and then corresponding to reference address information
Service background.I.e. embodiments of the invention are corresponding with address information by the service ID values of service background in background service list
Relation, the quick service type for identifying user's request, service background is determined, so as to can be with a proxy server simultaneously
Act on behalf of more service backgrounds, and then the purpose of effectively save cost.
Technical scheme provided in an embodiment of the present invention is introduced below in conjunction with the accompanying drawings.
Fig. 1 is referred to, the embodiment of the present invention provides a kind of service background and knows method for distinguishing, and the processing procedure of this method is such as
Under.
Step 101:Based on the first service request from ustomer premises access equipment, first service ID values are obtained.
When user browses the page of proxy server, first service request, generation are produced by clicking on the service on the page
Reason server therefrom obtains first service ID values by being asked by the first service received.
For example, user when browsing the homepage of Sina, clicks on " video " service on the page, just generating first service please
The solicited message for Video service is sought, first service ID values corresponding to the Video service are 001, and the first service request is asked
The value for containing that first service ID values are ADBC001 in information is sought, after proxy server receives the first service request
Just it is ADBC001 therefrom to read first service ID values.
Step 102:Based on corresponding relation between the address information three comprising service ID values, service identifiers and service background
Background service list, determined from least two address informations of at least two background services and the first service ID values pair
First address information on the first service backstage answered.
After the proxy server obtains the first service ID values, from the backstage being stored in the proxy server
In service list, the first address information corresponding to the first service ID values is found, and then identifies first service backstage.
Continue the example above, exemplary background service list is as shown in table 1.
Table 1
Service identifiers |
Service ID |
Address information |
Video service |
ADBC001 |
adress1 |
Microblogging service |
ADBC002 |
adress2 |
Blog services |
ADBC003 |
adress3 |
Sports service |
ADBC004 |
adress4 |
Shopping service |
ADBC005 |
adress5 |
After proxy server obtains first service ID values ADBC001, just being searched in the service ID of background service list is
No to have ADBC001, address information corresponding to reading ADBC001 is adress1 after finding, and now, proxy server is just from numerous
Service background in have identified user so the address information on first service backstage corresponding to the service needed is adress1,
And then send service request to first service backstage.
In the embodiment that the application provides, can quickly it be identified by a background service list and first service ID values
The type of service of user's request, and then allow proxy server accurately to identify the service required for user from more service backgrounds
From the background, then allow user to obtain the data of all service backgrounds by accessing 1 proxy server, improve user's body
Test;Further, enterprise can act on behalf of the business of all service backgrounds by 1 proxy server, so as to effectively reduce
Hardware into.
In one embodiment, it is described based on the first service request from ustomer premises access equipment, obtain first service ID
Value, including:
Judge whether there are first service ID items in the cookie of the first service request;Wherein, the first service ID
Item is used to store the first service ID values determined based on the first operation;
When to be, the first service ID items are read, to obtain the first service ID values.
In Internet, cookie (browser rs cache) actually generally refers to the low-volume information no more than 4kb, and it is
Browser is sent to by server end generation, cookie key/value can be saved in the text under some catalogue by browser
In file, ask next time just to send the cookie to server during same website.
When proxy server receives first service request, it can judge whether there is generation in the cookie of first service request
The first service ID items that reason server is previously written, it is judged as then reading the value of first service ID items when there are first service ID items,
And then obtain first service ID values.
It should be noted that first service ID items can be understood as a variable, for depositing the first behaviour based on user
Make the first service ID values determined.
In the embodiment that the application provides, the first service of user is allowed to carry the first clothes in asking by using cookie
It is engaged in ID values, and then allows proxy server easily to determine the demand of user by reading first service ID values, and due to
Cookie is really the browser that user equipment end is sent to after being generated by proxy server, and cookie is no more than 4kb
Low-volume information, this allow for proxy server for user carry out multiple business service during, only need to transmit a small amount of letter
Breath can provide the user diversified service, and then effectively improve Consumer's Experience.
In one embodiment, whether there are first service ID items in the cookie for judging the first service request
Afterwards, methods described also includes:
For it is no when, the response message asked based on the first service is returned into the user equipment end;Wherein, institute
State the user's background service list for including the service identifiers and the service ID value corresponding relations in response message.
When user is accesses the proxy server for the first time, because the equipment end of user does not deposit the agency
User's background service list of server generation, wherein, user's background service list is institute in the background service list
State service identifiers and the service ID value parts.So produced when user implements the first operation to the page of the proxy server
First service ID items are not had in raw first service request, therefore, now need user backstage proxy server
Service list and JS (javascript) script are sent to user equipment end.
Further, the browser at user equipment end takes user backstage after receiving the user backstage and taking list
Service identifiers in business list are shown in the page, when user performs the first operation to one of service identifiers in the page
When, it is first service ID values just to determine the service ID values corresponding to it, and then triggers the generation of JS (javascript) script and include
The first service for having the first service ID values is asked, and is sent to the proxy server.
In one embodiment, it is described based on corresponding relation between the address information comprising service ID values and service background
Background service list, determined from least two address informations of at least two background services and the first service ID values pair
After first address information on the first service backstage answered, methods described also includes:
The address information of the proxy server during the first service is asked is revised as first address information,
To obtain the first modified service request;
The described first modified service request is sent to first service backstage.
Believed in the proxy server by the first service ID values from least two address of at least two background service
After the first address information that first service backstage corresponding with the first service ID values is determined in breath, just by user equipment
The address information of the proxy server in the first service request that end is sent is revised as the first service backstage
First address information, and then obtain the first modified service request that can be sent to first service backstage.
As an example it is assumed that the address information of proxy server is www.proxyserver.com, first service backstage
Address information is www.server001.com, then the bag asked when user equipment end to the first service that proxy server is sent
URL in header is www.proxyserver.com, i.e. the Internet at user equipment end passes through
Www.proxyserver.com finds proxy server, after proxy server receives first service request, by searching first
The first service ID values carried in solicited message whether there is in the background service list, to determine first service ID values pair
The first address information answered.
In the embodiment that the application provides, the generation in being asked by the first service for only sending user
The address information of reason server is revised as first address information of first background service, can fast-forwarding user
First service is asked, and then has effectively been saved the system resource of the proxy server, improved operating efficiency.Further
, because the proxy server is before the first service of forwarding user asks to first background service, just in advance
The address information of proxy server during the first service is asked is changed for the first address information, and then allows described first
Background service is only communicated with the proxy server all the time, so as to maintain the original Business Stream of the first background service
Journey.
In one embodiment, the first modified service request is sent to the first service backstage described
Afterwards, methods described also includes:
Receive the first service response letter that the first service backstage is returned based on the described first modified service request
Breath;
Judge whether there are Set-Cookie items in the head response of the first service response message;
When to be, the first service mark is obtained from the background service list based on first address information;
First service mark is inserted into the head response, to obtain the first response message;First response message is returned to institute
State ustomer premises access equipment;
For it is no when, the Set-Cookie items identified with the first service are inserted into the head response, to obtain the
Two response messages;Second response message is returned to the ustomer premises access equipment.
After first service backstage receives the first modified request sent by the proxy server, just
The request can be directed to and send corresponding first service response message to the proxy server.Believe because the first service responds
Breath is caused by the first service request sent for user, so the proxy server also needs to take described first
Business response message is transmitted to user equipment end.
But Set-Cookie items may be included in the first service response message of first service backstage transmission
It may not include, and only contain the response message of the Set-Cookie items of first service mark corresponding to first service request
It could be identified by user equipment end, so whether proxy server is needed to having Set-Cookie items to enter in the first response message
Row judges.
When having Set-Cookie items during judged result is the head response of the first service response message, agency's clothes
Business device needs first service mark corresponding to first service ID values in the background service list being inserted into Set-Cookie items
In, the first response message is formed, and first response message is returned into user equipment end, such user equipment end can just be obtained
Obtain the first service response message on the first service backstage.
When there is no Set-Cookie items during judged result is the head response of the first service response message, the agency
Server needs to insert the Set-Cookie items for carrying the first service mark into the head response of first response message
In, the second response message is formed, and second response message is returned into user equipment end, such user equipment end can just be obtained
Obtain the first service response message on the first service backstage.
In the embodiment that the application provides, first clothes on first service backstage are voluntarily judged by the proxy server
Whether there are Set-Cookie items in the head response for response message of being engaged in, and the first service mark is inserted when there are Set-Cookie items
Knowledge obtains the first response message, and the Set-Cookie items that insert band has the first service mark when no obtain the second response
Information, just returns to first response message afterwards or second response message gives user equipment end.Whole modification process by
The proxy server is completed alone, so as to allow first background service when returning to the first service response message,
Its original operation flow need not be changed.
Fig. 2 is referred to, based on same present inventive concept, one embodiment of the invention provides a kind of proxy server, the agency
Server includes processing unit 201, receiving unit 202, transmitting element 203.
Wherein, processing unit 201 can include central processing unit (CPU) or ASIC (Application
Specific Integrated Circuit, ASIC), one or more integrated electricity for being used for control program and performing can be included
Road, the hardware that can be developed including the use of field programmable gate array (Field Programmable Gate Array, FPGA)
Circuit.
In possible embodiment, processing unit 201 is used to, based on the first service request from ustomer premises access equipment, obtain
Obtain first service ID values;Processing unit 201 is additionally operable to based on comprising service ID values pass corresponding between the address information of service background
The background service list of system, determined from least two address informations of at least two background services and the first service ID
First address information on first service backstage corresponding to value.
In possible embodiment, processing unit 201 be additionally operable to judge in the cookie of the first service request be
It is no to have first service ID items;Wherein, the first service ID items are used to store the first service ID values determined based on the first operation;
Processing unit 201 is additionally operable to when to be, reads the first service ID items, to obtain the first service ID values.
In possible embodiment, in addition to transmitting element 203, for for it is no when, the first service will be based on
The response message of request returns to the user equipment end;Wherein, the service identifiers and institute are included in the response message
State user's background service list of service ID value corresponding relations.
In possible embodiment, the agency that processing unit 201 is additionally operable to during the first service is asked takes
The address information of business device is revised as first address information, to obtain the first modified service request;Transmitting element 203, also
For sending the described first modified service request to first service backstage.
In possible embodiment, receiving unit 202, for receiving the first service backstage based on the described first warp
The first service response message changed service request and returned;Processing unit 201 is additionally operable to judge the first service response letter
Whether Set-Cookie item is had in the head response of breath;When to be, arranged based on first address information from the background service
Table obtains the first service mark;First service mark is inserted into the head response, to obtain the first response message;Hair
Unit 203 is sent to be used to return to first response message to the ustomer premises access equipment;Processing unit 201 be additionally operable to for it is no when,
The Set-Cookie items identified with the first service are inserted into the head response, to obtain the second response message;Send single
Member 203 is used to return to second response message to the ustomer premises access equipment.
The embodiment of the present invention also provides a kind of computer-readable storage medium, wherein, the computer-readable storage medium can be stored with journey
Sequence, including the whole step performed by the proxy server described in the embodiment of the method as shown in preceding Fig. 1 when the program performs
Suddenly.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program production
Product.Therefore, in terms of the embodiment of the present invention can use complete hardware embodiment, complete software embodiment or combine software and hardware
Embodiment form.Moreover, the embodiment of the present invention can use wherein includes computer available programs generation in one or more
The meter implemented in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code
The form of calculation machine program product.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Flow chart and/or block diagram describe.It should be understood that can be by computer program instructions implementation process figure and/or block diagram
Each flow and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These calculating can be provided
Processing of the machine programmed instruction to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices
Device is to produce a machine so that the instruction for passing through computer or the computing device of other programmable data processing devices produces
For realizing the function of being specified in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
Device.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.