CN103944942B - A kind of data access method and device of more WEB environments - Google Patents

A kind of data access method and device of more WEB environments Download PDF

Info

Publication number
CN103944942B
CN103944942B CN201310023062.XA CN201310023062A CN103944942B CN 103944942 B CN103944942 B CN 103944942B CN 201310023062 A CN201310023062 A CN 201310023062A CN 103944942 B CN103944942 B CN 103944942B
Authority
CN
China
Prior art keywords
cookies
data
web
request
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310023062.XA
Other languages
Chinese (zh)
Other versions
CN103944942A (en
Inventor
龙丁奋
唐巧明
熊洁
方应杭
朱磊
郭学亨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310023062.XA priority Critical patent/CN103944942B/en
Publication of CN103944942A publication Critical patent/CN103944942A/en
Application granted granted Critical
Publication of CN103944942B publication Critical patent/CN103944942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention is suitable for internet arena, there is provided a kind of method and apparatus of the data access of more WEB environments, this method include:Client sends the data access request for including default COOKIES, and the COOKIES includes the environmental information of WEB products;Proxy server obtains the COOKIES of the access request, and the environmental information in the COOKIES searches corresponding data in data server;Data server is by the data sending of lookup to client.The embodiment of the present invention is by distinguishing the WEB products in varying environment with COOKIES, after proxy server obtains the access request with COOKIES, corresponding WEB products are found according to environmental information, access to WEB product data, can be from the trouble for the address information for recording and inputting complexity, facilitate user to access, can also improve the efficiency for accessing data.

Description

A kind of data access method and device of more WEB environments
Technical field
The invention belongs to internet arena, more particularly to a kind of data access method and device of more WEB environments.
Background technology
More WEB environments refer to that same website has more set codes, and the function, characteristic and issued state for often covering code may be endless It is exactly the same, the WEB products such as a certain website, it is understood that there may be have three sets of codes, corresponding state or environmental information are Environment on development environment, test environment and line.
To realize the access of the data code to the different conditions of the website, existing way includes:Match somebody with somebody for every set code Put in different hosts(HOST)Or different universal resource locator is configured in same host(English full name is Universal Resource Locator, English abbreviation URL), by accessing corresponding host IP address or input URL Chained address, realizes the data access to different WEB environments.
Using different chained addresses is set, particularly there is the situation of more set of environments, it is necessary to set and cover different links more Address, operation are more troublesome;And after chained address is set, it is necessary to user record and the corresponding main IP machines address of input or Person inputs chained address, and address information is inconvenient to remember, and makes the different address information of input more troublesome, is unfavorable for improving user Access efficiency.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of more WEB environments for being not required the multiple address informations of user record Data access method and device, it is intended to solve to need record input multiple and different when the prior art accesses the data of more WEB environments Address information the problem of, to improve the access efficiency of user.
The purpose of the embodiment of the present invention is to provide a kind of data access method of more WEB environments, the described method includes:
Client sends the data access request for including default COOKIES, accesses the domain name pair of the WEB products of data Multiple WEB environments are answered, the described method includes:
Client sends the data access request for including default COOKIES, and the COOKIES includes the ring of WEB products Border information;
Proxy server obtains the COOKIES of the access request, and the environmental information in the COOKIES is in data The corresponding data of whois lookup;
Data server is by the data sending of lookup to client.
The another object of the embodiment of the present invention is to provide a kind of data access device of more WEB environments, accesses data The domain names of WEB products correspond to multiple WEB environments, described device includes:
Request transmitting unit, for sending the data access request for including default COOKIES, the COOKIES is included The environmental information of WEB products;
Searching unit is obtained, for obtaining the COOKIES of the access request, the environmental information in COOKIES exists Data server searches corresponding data;
Data transmission unit, for by the data sending of lookup to client.
The data access method of more WEB environments described in the embodiment of the present invention, client are sent out according to the default COOKIES of selection Data access request is sent, due to being preset with the environmental information of WEB products in the COOKIES, is got in proxy server After the information of the COOKIES, corresponding data is found according to environmental information on data server, and will by data server Corresponding data sending realizes the data access in more WEB environments to client.Compared to the prior art, the embodiment of the present invention By being distinguished to the WEB products in varying environment with COOKIES, proxy server obtains the access with COOKIES please After asking, corresponding WEB products are found according to environmental information, are accessed to WEB product data, can be multiple from recording and inputting The trouble of miscellaneous address information, facilitates user to access, and can also improve the efficiency for accessing data.
Brief description of the drawings
Fig. 1 is that the data access for the more WEB environments that first embodiment of the invention provides realizes flow chart;
Fig. 2 is that the data access for the more WEB environments that second embodiment of the invention provides realizes flow chart;
Fig. 3 is that the data access for the more WEB environments that third embodiment of the invention provides realizes flow chart;
Fig. 4 is the interaction diagrams of the data access for more WEB environments that fourth embodiment of the invention provides;
Fig. 5 is the data access device structure diagram for more WEB environments that fifth embodiment of the invention provides.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, it is right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
In embodiments of the present invention, the COOKIES for the environmental information that WEB products are preset with client, client are passed through When accessing the data of data server, the environmental information of the WEB products in its COOKIES carried is selected on data server Different environment is selected, accesses corresponding data, for there are the product of multiple WEB environments, it is possible to achieve conveniently access, Improve access efficiency.
Embodiment one:
Fig. 1 shows that the data access of the more WEB environments of the present invention realizes flow, and details are as follows:
More WEB environments described in the present embodiment, the domain name for referring to access the WEB products of data correspond to multiple WEB environments, The domain name for accessing certain WEB product is www.a.com, which has three sets of codes, correspond to test environment, development environment and line respectively Upper environment, environment ID and server ip address information corresponding thereto are as shown in the table:
Environment ID Environment title WEB server IP
1 Test environment 192.1681.1
2 Development environment 192.168.2.1
3 Environment on line 192.168.3.1
According to above-mentioned concrete example, the flow of its data access is as follows:
In step S101, client sends the data access request for including default COOKIES, the COOKIES bags The environmental information of the product containing WEB.
Specifically, client can be the terminal device such as computer terminal or smart mobile phone, PAD.The number that client is sent According to access request, refer to that the data under a certain environment to WEB products access.The default COOKIES, including WEB The environmental information of product, environmental information can represent that such as present client needs access domain entitled with corresponding ID codes The data in test environment under www.a.com, the ID codes of its test environment are 1, can be believed set environment in COOKIES Breath, the environmental information for representing to carry in current COOKIE using variable env=1 is test environment, certainly, the ring of the WEB products In the information of border, include the domain name or domain name address information of the WEB products, with what is included when client sends and asks with request Domain name is matched.
In step s 102, proxy server obtains the COOKIES of the access request, according in the COOKIES Environmental information searches corresponding data in data server.
Specifically, proxy server obtains the access request that client is sent, can be intercepted and captured by way of Transparent Proxy The access data of particular port.For example accessed and asked come intercepted data by way of filtering the HTTP communication datas in 80 ports Ask.Certainly, the mode that access request is obtained by proxy server is not limited thereto, it is clear that can also include other agreements Mode completes the acquisition for the COOKIES data that proxy server includes access request.
After the COOKIES of access request is obtained, the environmental information carried in COOKIES can be read, since agency takes The address of the corresponding storage of environmental information is preset with business device, access request is forwarded to the storage address to visit by proxy server Ask corresponding data.
In step s 103, data server is by the data sending of lookup to client.
The access request forwarded according to proxy server, data server is by corresponding data sending to client.Such as visitor The data access request at family be www.a.com/a/bb/ab.jpg picture ask, data server under test environment catalogue, By domain name and corresponding path searching to the picture, and according to the address information of client, which is sent to client End.
The embodiment of the present invention is got by presetting the COOKIES including environmental information in client in proxy server After access request, the environmental information in COOKIES is read, the storage address of data access is selected by the environmental information, so as to Enough effective realizations are high to the data access under more WEB environments, access efficiency.
Embodiment two:
Fig. 2 realizes flow chart for the data access of the corresponding more WEB environments of second embodiment of the invention, and details are as follows:
WEB products described in the present embodiment, corresponding two domain names, the Main Domain of such as current WEB products are Www.a.com, its corresponding domain name addresses in CDN content distribution network is www.b.com/a, wherein the correspondence of three set of environments Relation is as shown in the table:
Its corresponding data access process is as follows:
In step s 201, client sends the request for setting COOKIES to proxy server, and the request includes client End selection accesses the environmental information of product.
It is complete, it is necessary to be configured to the COOKIES in client before client transmission includes the data access of COOKIES Setting into COOKIES is generally completed by proxy server.Client, which is sent, to be set in COOKIES requests, includes the need of selection The environmental information to be set, that is, need the environmental information accessed, as active client need access development environment, then send request Include the selection information of the development environment of selection, can be carried and represented with corresponding ID.
In step S202, proxy server is by comprising the WEB Product environments information and domain name address information COOKIES is sent to client.
The COOKIES for the environmental information that proxy server selects the domain name address information comprising the WEB products with it Send to client, when client accesses the WEB products afterwards, you can call the COOKIES, access request is directed toward in step Environmental information in being selected in rapid S201.
Wherein, domain name address information can be Main Domain, or domain name in CDN content distribution network Location, is selected WEB products under the domain name addresses, it directly carries the information in link by access request.
In upper table, include two domain name addresses for the WEB products, therefore, when COOKIES is set, it is necessary to Set corresponding COOKIES respectively to the domain name addresses on its Main Domain and CDN content distribution network, therefore will include The COOKIES data sendings of www.a.com and www.b.com/a and environmental information ID=2 to client stores.Domain name bag All domain names corresponding to the WEB products for needing to access are included, for the WEB products comprising multiple domain names, are being set accordingly , it is necessary to which the COOKIES of each domain name addresses and environmental information is sent to client during COOKIES, in case during client access Call.
Wherein, the step client is sent to proxy server sets the request of COOKIES specifically to may include:
Client, which is sent, obtains all environmental information requests of WEB products, can set and send access homepage by client The mode of request, includes the alternative all environmental informations of the WEB products to be accessed in the homepage.By such as scheming Choice box shown in 3, when receiving client access www.a.com or www.b.com/a, returns to homepage as depicted Interface is shown, the corresponding environmental information of personnel selection is accessed to remind, as shown in the figure, the choice box includes exploitation ring Border, test environment, issue environment, test environment two, formal environments in advance.
After all environmental informations that client receives the WEB products returned, client can receive user's input at this time Required access environmental information selection information.
In step S203, client sends the data access request for including default COOKIES, the COOKIES bags The environmental information of the product containing WEB;
In step S204, proxy server obtains the COOKIES of the access request, according in the COOKIES Environmental information searches corresponding data in data server;
In step S205, data server is by the data sending of lookup to client.
Similar with step S101-S103, client includes two COOKIES of selected WEB products at this time, in visitor When family end initiates to include the data access request of any domain name or domain name addresses, it can carry corresponding COOKIES data messages Send, after proxy server gets access request by ports filter or other manner, included according to request simultaneously COOKIES, access data from the corresponding store paths of the COOKIES.
When client re-initiates the data access request to varying environment, re-request proxy server sets its choosing The COOKIES for the environmental information selected, carries the access that the COOKIES set carries out corresponding data, and under to same environment Data when accessing, it is only necessary to select an environmental information, it realizes simple and convenient, it is not necessary to which memory and input are multiple Miscellaneous address date, can improve the access efficiency of client.
Realize example three:
Such as the block diagram of the data access device of Fig. 4 more WEB environments provided for third embodiment of the invention, details are as follows:
The data access device of more WEB environments described in the embodiment of the present invention, including request transmitting unit 401, acquisition are searched Unit 402 and data transmission unit 403, wherein
The request transmitting unit 401, it is described for sending the data access request for including default COOKIES COOKIES includes the environmental information of WEB products;
The acquisition searching unit 402, for receiving the request of the request transmitting unit, and obtains the access request COOKIES, environmental information in COOKIES searches corresponding data in data server;
The data transmission unit 403, for by the data sending searched of acquisition searching unit 402 to client.
The embodiment of the present invention sends the data access request for including default COOKIES by request transmitting unit, described COOKIES includes the environmental information of WEB products, and user carries the COOKIES when accessing the product, by proxy server The request is obtained, and the respective environment of data server is forwarded the request to according to COOKIES, so as to accurately and conveniently realize Access to data.
Example IV:
Such as the block diagram of the data access device of Fig. 5 more WEB environments provided for fourth embodiment of the invention, details are as follows:
FB(flow block) described in the embodiment of the present invention, including
Request transmitting unit 501, for sending the data access request for including default COOKIES, the COOKIES bags The environmental information of the product containing WEB;
Obtain searching unit 502, for obtaining the COOKIES of the access request, the environmental information in COOKIES Corresponding data are searched in data server;
Data transmission unit 503, for by the data sending of lookup to client
COOKIES request transmitting units 504 are set, the request of COOKIES is set for being sent to proxy server, it is described Request includes the environmental information that client selection accesses product;
COOKIES transmitting elements 505, for sending the COOKIES comprising the WEB Product environments information to client End;
Wherein, the setting COOKIES request transmitting units 504 specifically include:
Environmental information request transmission sub-unit 5041 is obtained, all environmental informations request of WEB products is obtained for sending;
Environmental information receives selection subelement 5042, for receiving the environmental information of all WEB products returned, and receives The selection information of the environmental information accessed required for input by user.
Above-mentioned acquisition environmental information request transmitting unit is specifically used for sending the request for accessing homepage, and the homepage includes The alternative all environmental informations of current WEB products, domain name include all corresponding to the WEB products that needs access Domain name.
Being carried when the present invention is by accessing the product under different environmental informations in user includes environmental information COOKIES, can be realized the differentiation to different pieces of information in data server by environmental information therein, and by selecting different rings Border information sets COOKIES, it is possible to achieve flexibly sets access to different environmental informations, it is not necessary to which record is different from input WEB product domain name address informations, the situations of multiple domain names, embodiment party using the present invention are corresponded to especially for identical product Formula, can obtain more preferable access efficiency, improve the convenience of access.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention All any modification, equivalent and improvement made within refreshing and principle etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of data access method of more WEB environments, the domain name for accessing the WEB products of data correspond to multiple WEB environments, its It is characterized in that, the described method includes:
Client sends the data access request for including default COOKIES, and the environment that the COOKIES includes WEB products is believed Breath;
Proxy server obtains the COOKIES of the access request, and the environmental information in the COOKIES is in data service Device searches corresponding data;
Data server is by the data sending of lookup to client.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
Client sends the request for setting COOKIES to proxy server, and the request includes client selection and accesses product Environmental information;
Proxy server sends the COOKIES comprising the WEB Product environments information and domain name address information to client.
3. according to the method described in claim 2, it is characterized in that, the client sends setting to proxy server The request of COOKIES specifically includes:
Client, which is sent, obtains all environmental information requests of WEB products;
Client receives all environmental informations of the WEB products returned, and receives the required environment letter accessed input by user The selection information of breath.
4. according to the method described in claim 3, it is characterized in that, the client, which is sent, obtains environmental information request specifically For:
Client sends the request for accessing homepage, and the WEB products that the homepage includes being accessed are alternative all Environmental information.
5. according to claim 1-4 any one of them methods, it is characterised in that domain name includes needing the WEB productions accessed All domain names corresponding to product.
6. a kind of data access device of more WEB environments, the domain name for accessing the WEB products of data correspond to multiple WEB environments, its It is characterized in that, described device includes:
Request transmitting unit, for sending the data access request for including default COOKIES, the COOKIES is produced comprising WEB The environmental information of product;
Searching unit is obtained, for obtaining the COOKIES of the access request, the environmental information in COOKIES is in data The corresponding data of whois lookup;
Data transmission unit, for by the data sending of lookup to client.
7. device according to claim 6, it is characterised in that described device further includes:
COOKIES request transmitting units are set, the request of COOKIES, the request bag are set for being sent to proxy server Include the environmental information that client selection accesses product;
COOKIES transmitting elements, for sending the COOKIES comprising the WEB Product environments information to client.
8. device according to claim 7, it is characterised in that the setting COOKIES request transmitting units specifically include:
Environmental information request transmission sub-unit is obtained, all environmental informations request of WEB products is obtained for sending;
Environmental information receives selection subelement, for receiving the environmental information of all WEB products returned, and receives user's input Required access environmental information selection information.
9. device according to claim 8, it is characterised in that the acquisition environmental information request transmission sub-unit is specifically used In the request for sending access homepage, the homepage includes the alternative all environmental informations of current WEB products.
10. according to claim 6-9 any one of them devices, it is characterised in that domain name includes needing the WEB productions accessed All domain names corresponding to product.
CN201310023062.XA 2013-01-22 2013-01-22 A kind of data access method and device of more WEB environments Active CN103944942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310023062.XA CN103944942B (en) 2013-01-22 2013-01-22 A kind of data access method and device of more WEB environments

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310023062.XA CN103944942B (en) 2013-01-22 2013-01-22 A kind of data access method and device of more WEB environments

Publications (2)

Publication Number Publication Date
CN103944942A CN103944942A (en) 2014-07-23
CN103944942B true CN103944942B (en) 2018-04-27

Family

ID=51192425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310023062.XA Active CN103944942B (en) 2013-01-22 2013-01-22 A kind of data access method and device of more WEB environments

Country Status (1)

Country Link
CN (1) CN103944942B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105376107B (en) * 2014-08-29 2020-02-28 腾讯科技(深圳)有限公司 Terminal testing method and proxy server
CN105939355A (en) * 2016-06-13 2016-09-14 乐视控股(北京)有限公司 Data access method and system, as well as client and server
CN108388657B (en) * 2018-03-06 2022-04-05 五八有限公司 Cookie storage method, device, equipment and readable storage medium
CN108536489B (en) * 2018-04-23 2022-03-25 腾讯科技(深圳)有限公司 Method, apparatus, and computer-readable storage medium for matching resource environments
CN110149423B (en) * 2019-07-04 2022-07-22 深圳市珍爱捷云信息技术有限公司 Domain name processing method and device, readable storage medium and electronic equipment
CN113608994A (en) * 2021-06-30 2021-11-05 天津五八到家货运服务有限公司 Request processing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090193129A1 (en) * 2008-01-26 2009-07-30 Puneet Agarwal Systems and Methods for Fine Grain Policy Driven Cookie Proxying
CN102184231A (en) * 2011-05-12 2011-09-14 广州市动景计算机科技有限公司 Method and device for acquiring page resources
CN102497454A (en) * 2011-12-31 2012-06-13 北京新媒传信科技有限公司 Method for realizing gray publication of application in application service platform system
CN102638580A (en) * 2012-03-30 2012-08-15 奇智软件(北京)有限公司 Webpage information processing method and webpage information processing device
CN102799636A (en) * 2012-06-26 2012-11-28 北京奇虎科技有限公司 Method and system for displaying webpage by mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090193129A1 (en) * 2008-01-26 2009-07-30 Puneet Agarwal Systems and Methods for Fine Grain Policy Driven Cookie Proxying
CN102184231A (en) * 2011-05-12 2011-09-14 广州市动景计算机科技有限公司 Method and device for acquiring page resources
CN102497454A (en) * 2011-12-31 2012-06-13 北京新媒传信科技有限公司 Method for realizing gray publication of application in application service platform system
CN102638580A (en) * 2012-03-30 2012-08-15 奇智软件(北京)有限公司 Webpage information processing method and webpage information processing device
CN102799636A (en) * 2012-06-26 2012-11-28 北京奇虎科技有限公司 Method and system for displaying webpage by mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Web环境的数据访问技术优化研究;张志强;《现代电子技术》;20090615;全文 *

Also Published As

Publication number Publication date
CN103944942A (en) 2014-07-23

Similar Documents

Publication Publication Date Title
CN103944942B (en) A kind of data access method and device of more WEB environments
CN102594896B (en) Electronic photo sharing method and system for same
CA2588476A1 (en) System and method for downloading and storing contact information and advertisements in a communication device
KR20150036624A (en) Method and apparatus for privacy protected clustering of user interest profiles
CN103944944A (en) Webpage link sharing method and system, and electronic device
CN107241372A (en) Configuration information generation, sending method and resource loading method and apparatus and system
CN101232468A (en) Request-answering system and method
CN102377617A (en) Systems, methods, and apparatus to monitor and authenticate mobile internet activity
CN105228140A (en) A kind of data access method and device
WO2021104458A1 (en) Domain name query method and related device
CN104978358A (en) Method for displaying web page fragment on desktop and system for capturing web page fragment to desktop for displaying
CN104065736B (en) A kind of URL reorientation methods, apparatus and system
US10931688B2 (en) Malicious website discovery using web analytics identifiers
CN106549989A (en) A kind of data transmission method and its system, user terminal, application server
CN106547769A (en) A kind of DOI display packings and device
CN110704158A (en) Method, apparatus and storage medium for forwarding access requests within a container cluster
CN108282455A (en) Web-page requests method, apparatus and domain-name information analysis result processing method, device
CN101551813A (en) Network connection apparatus, search equipment and method for collecting search engine data source
CN106547800A (en) The method and device of striding equipment synchronization user behavior
US11968166B2 (en) Server-side initiation of DNS resolution
KR101637016B1 (en) Method for providing user reaction web page
CN104702634A (en) Method, device and system for processing data operation request
CN106209584A (en) User profile processing method based on the Internet, client and server
CN104735174A (en) HTTP transparent proxy implementing method and device
CN104361004A (en) Browser favorite data processing method and browser

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant