CN108881501A - A kind of method and device realizing web application domain name and jumping - Google Patents

A kind of method and device realizing web application domain name and jumping Download PDF

Info

Publication number
CN108881501A
CN108881501A CN201710333391.2A CN201710333391A CN108881501A CN 108881501 A CN108881501 A CN 108881501A CN 201710333391 A CN201710333391 A CN 201710333391A CN 108881501 A CN108881501 A CN 108881501A
Authority
CN
China
Prior art keywords
domain name
compartmentalization
web application
uniform resource
resource locator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710333391.2A
Other languages
Chinese (zh)
Other versions
CN108881501B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710333391.2A priority Critical patent/CN108881501B/en
Publication of CN108881501A publication Critical patent/CN108881501A/en
Application granted granted Critical
Publication of CN108881501B publication Critical patent/CN108881501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

Disclosed herein is a kind of method and devices realizing web application domain name and jumping;The above method includes:The URL of the Web application of client access is obtained, and parses and obtains the first domain name;According to the compartmentalization configuration information of the URL and Web application, the second domain name is determined;According to the comparison result of the first domain name and the second domain name, it is determined whether carry out domain name and jump.Aspects disclosed herein can be compatible with to the access mode of Web application under single centre and multicenter deployment form, be seamlessly transitted so that Web be realized to apply between single centre deployment and multicenter deployment.

Description

A kind of method and device realizing web application domain name and jumping
Technical field
The present invention relates to network technique field more particularly to it is a kind of realize method that webpage (Web) is jumped using domain name and Device.
Background technique
Webpage (Web) application is can be by the application program of web page access.User can access Web by browser and answer With.Currently, Web apply according to deployment form can be divided into single centre deployment (being deployed in a region (Region)) and mostly in Center portion affixes one's name to (being deployed in multiple regions).Wherein, the Web application of single centre deployment only corresponds to a domain name;Using multicenter Web is disposed in application, different domain names can be possessed in the sub using being independent center applications of each regional deployment.Cause This, moves to multicenter deployment when Web is applied from single centre deployment, alternatively, when moving to single centre deployment from multicenter deployment, How compatible with single center deployment and multicenter deployment form under to Web application access mode, to realize that Web is applied in single centre Smooth transition is problem to be solved between deployment and multicenter deployment.
Summary of the invention
It is the general introduction to the theme being described in detail herein below.This general introduction is not the protection model in order to limit claim It encloses.
The embodiment of the present application provides a kind of method and device realizing Web application domain name and jumping, can be compatible with single centre and To the access mode of Web application under multicenter deployment form, to realize that Web is applied between single centre deployment and multicenter deployment Smooth transition.
The embodiment of the present application provides a kind of method realizing Web application domain name and jumping, including:
The uniform resource locator (URL) of the Web application of client access is obtained, and parses and obtains the first domain name;
According to the compartmentalization configuration information that the URL and Web is applied, the second domain name is determined;
According to the comparison result of first domain name and second domain name, it is determined whether carry out domain name and jump.
In the exemplary embodiment, the compartmentalization configuration information of the Web application, may include at least one of: It is the zone list of centralization state, Web application that the basic domain name of Web application, Web application are supported, described The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in zone list.
In the exemplary embodiment, the compartmentalization configuration information applied according to the URL and Web, really Determine the second domain name, may include:
If single centre is supported in the Web application, it is determined that entitled second domain name of ground field of the Web application;
If multicenter is supported in the Web application, and the first domain name of the URL can be matched to the Web application Enabled compartmentalization domain name in compartmentalization configuration information, it is determined that the compartmentalization domain name being matched to is the second domain name;
If multicenter, and the URL parameter carrier area information of the URL are supported in the Web application, then according to It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information that URL parameter carries Domain name is as the second domain name;
If multicenter is supported in the Web application, the first domain name of the URL is not matched to the area of the Web application Enabled compartmentalization domain name in the configuration information of domain, and the URL parameter of the URL does not have carrier area information, then according to visitor It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information recorded in the caching of family end Domain name as the second domain name.
In the exemplary embodiment, described from the compartmentalization configuration information that the Web is applied, obtain the region letter Corresponding domain name is ceased as the second domain name, may include:
In the compartmentalization configuration information of Web application, if the corresponding compartmentalization domain name of the area information has enabled, Then confirm that the compartmentalization domain name is the second domain name;
If the corresponding compartmentalization domain name of the area information does not enable, confirm that the ground field of the Web application is entitled Second domain name.
In the exemplary embodiment, the URL parameter may include at least one of:Hash (hash) parameter, road Diameter (path) parameter.
In the exemplary embodiment, after second domain name of determination, the above method can also include:In the client The area information is recorded in the caching of end.
In the exemplary embodiment, the comparison result according to first domain name and second domain name determines Whether carry out domain name to jump, may include:
If first domain name is identical with second domain name, it is determined that jumped without domain name;
If first domain name is different with second domain name, it is determined that jumped according to second domain name.
The embodiment of the present application also provides a kind of device realizing Web application domain name and jumping, including:
First domain name determining module, the URL of the Web application for obtaining client access, and parse and obtain the first domain name;
Second domain name determining module is determined for the compartmentalization configuration information according to the URL and Web application Second domain name;
Control module is jumped, for the comparison result according to first domain name and second domain name, it is determined whether into Row domain name jumps.
In the exemplary embodiment, the compartmentalization configuration information of the Web application, may include at least one of: It is the zone list of centralization state, Web application that the basic domain name of Web application, Web application are supported, described The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in zone list.
In the exemplary embodiment, the second domain name determining module can be used in the following manner according to The compartmentalization configuration information of URL and Web application, determines the second domain name:
If single centre is supported in the Web application, it is determined that entitled second domain name of ground field of the Web application;
If multicenter is supported in the Web application, and the first domain name of the URL can be matched to the Web application Enabled compartmentalization domain name in compartmentalization configuration information, it is determined that the compartmentalization domain name being matched to is the second domain name;
If multicenter, and the URL parameter carrier area information of the URL are supported in the Web application, then according to It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information that URL parameter carries Domain name is as the second domain name;
If multicenter is supported in the Web application, the first domain name of the URL is not matched to the area of the Web application Enabled compartmentalization domain name in the configuration information of domain, and the URL parameter of the URL does not have carrier area information, then according to visitor It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information recorded in the caching of family end Domain name as the second domain name.
In the exemplary embodiment, the second domain name determining module can be used in the following manner from the Web In the compartmentalization configuration information of application, the corresponding domain name of the area information is obtained as the second domain name:
In the compartmentalization configuration information of Web application, if the corresponding compartmentalization domain name of the area information has enabled, Then confirm that the compartmentalization domain name is the second domain name;
If the corresponding compartmentalization domain name of the area information does not enable, confirm that the ground field of the Web application is entitled Second domain name.
In the exemplary embodiment, above-mentioned apparatus can also include:Logging modle, in the client-cache Record the area information.
In the exemplary embodiment, the control module that jumps can be used in the following manner according to first domain The comparison result of name and second domain name, it is determined whether carry out domain name and jump:
If first domain name is identical with second domain name, it is determined that jumped without domain name;
If first domain name is different with second domain name, it is determined that jumped according to second domain name.
The embodiment of the present application also provides a kind of device, including:Memory and processor;Wherein, the memory is used for Store the program jumped for realizing Web application domain name;The program jumped for realizing Web application domain name is by the processing When device reads execution, following operation is executed:
The URL of the Web application of client access is obtained, and parses and obtains the first domain name;
According to the compartmentalization configuration information that the URL and Web is applied, the second domain name is determined;
According to the comparison result of first domain name and second domain name, it is determined whether carry out domain name and jump.
In the exemplary embodiment, the compartmentalization configuration information of the Web application, may include at least one of: It is the zone list of centralization state, Web application that the basic domain name of Web application, Web application are supported, described The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in zone list.
In the exemplary embodiment, the compartmentalization configuration information applied according to the URL and Web, really Determine the second domain name, may include:
If single centre is supported in the Web application, it is determined that entitled second domain name of ground field of the Web application;
If multicenter is supported in the Web application, and the first domain name of the URL can be matched to the Web application Enabled compartmentalization domain name in compartmentalization configuration information, it is determined that the compartmentalization domain name being matched to is the second domain name;
If multicenter, and the URL parameter carrier area information of the URL are supported in the Web application, then according to It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information that URL parameter carries Domain name is as the second domain name;
If multicenter is supported in the Web application, the first domain name of the URL is not matched to the area of the Web application Enabled compartmentalization domain name in the configuration information of domain, and the URL parameter of the URL does not have carrier area information, then according to visitor It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information recorded in the caching of family end Domain name as the second domain name.
The embodiment of the present application also provides a kind of computer-readable medium, is stored with multiple instruction, when the multiple instruction quilt One or more processors realize the method that above-mentioned realization Web application domain name jumps when executing.
In the embodiment of the present application, the URL of the Web application by obtaining client access, and parse and obtain the first domain name, root According to the compartmentalization configuration information that URL and Web are applied, the second domain name is determined, according to the comparison result of the first domain name and the second domain name, Determine whether that carrying out domain name jumps.In this way, the embodiment of the present application supports Web to apply between single centre deployment and multicenter deployment Smooth transition, and to the access mode of Web application under compatible single centre and multicenter deployment form.Moreover, Web apply into It will not influence existing business in deployment transition process between row single centre and multicenter, ensure that user experience.
Certainly, any product for implementing the application is not necessarily required to reach all of above advantage simultaneously.
After reading and understanding attached drawing and detailed description, it can be appreciated that other aspects.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram of implementation environment of the embodiment of the present application;
Fig. 2 is the flow chart for the method that realization Web application domain name provided by the embodiments of the present application jumps;
Fig. 3 is an example schematic of the embodiment of the present application;
Fig. 4 is the schematic diagram for the device that realization Web application domain name provided by the embodiments of the present application jumps.
Specific embodiment
The embodiment of the present application is described in detail below in conjunction with attached drawing, it should be understood that embodiments described below is only For instruction and explanation of the application, it is not used to limit the application.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.
It should be noted that each feature in the embodiment of the present application and embodiment can be tied mutually if do not conflicted It closes, within the scope of protection of this application.In addition, though logical order is shown in flow charts, but in certain situations Under, it can be with the steps shown or described are performed in an order that is different from the one herein.
In some embodiments, executes and realize that the calculating equipment of method that Web application domain name jumps may include one or more A processor (CPU), input/output interface, network interface and memory (memory).
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.Memory may include module 1, module 2 ... ..., module N (N is the integer greater than 2).
Computer-readable medium includes permanent and non-permanent, removable and non-movable storage medium.Storage medium It can be accomplished by any method or technique information storage.Information can be the mould of computer readable instructions, data structure, program Block or other data.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random-access is deposited Reservoir (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic Property storage equipment or any other non-transmission medium, can be used for storing and can be accessed by a computing device information.According to herein Define, computer-readable medium does not include non-temporary computer readable media (transitory media), such as modulation data Signal and carrier wave.
Fig. 1 is a kind of structural schematic diagram of implementation environment of the embodiment of the present application.As shown in Figure 1, the implementation of the present embodiment It include terminal 11 and application server 12 in environment.Wherein, terminal 11 can be such as mobile phone, tablet computer, desktop computer and The terminal comprising client 110 (for example, browser) of notebook etc.Terminal 11 can pass through cable network or wireless network It connect, is requested to realize that terminal 11 is sent to application server 12, and receive application server 12 and return with application server 12 The information returned.Application server 12 can be the high property of one or more connecting by cable network or wireless network with terminal 11 It can computer or cloud computing center.
In the present embodiment, the client 110 (for example, browser) in terminal 11 receives the unified money of user's input or selection After source finger URL (URL, Uniform Resource Locator), corresponding application clothes can be inquired from domain name resolution server Address network protocol (IP, Internet Protocol) of business device 12, and the application service returned according to domain name resolution server The IP address of device 12 sends access request to the application server 12, and the access that application server 12 receives client 110 is asked After asking, requested application page and application code are returned to client 110;Client 110 can show application server 12 The application page of return, and realization provided in this embodiment is implemented by the application code of the operation return of application server 12 The method that Web application domain name jumps.
It is provided in this embodiment realize the method that jumps of Web application domain name for support Web apply multicenter deployment with It is seamlessly transitted between single centre deployment.Wherein, in the Web application of single centre deployment, using URL parameter (for example, hash parameter Or path parameter) carry out different zones differentiation.For example, being directed to the Web of the entitled xxx.console.aliyun.com of ground field Using the Hangzhou region access address of Web application is:Xxx.console.aliyun.com/#/regionId= hangzhou;The Web application Shenzhen region access address be:Xxx.console.aliyun.com/#/regionId= shenzhen.Different zones are if desired accessed for Web application, need to change the regionId information in URL parameter.More In the Web application of center deployment, the mode of different domain names is generallyd use to indicate the access address of different zones, for example, by upper When the Web application extension for stating single centre deployment is multicenter deployment, the access address of Hangzhou region can be:xxx- The access address of hangzhou.console.aliyun.com, Shenzhen region can be:xxx- shenzhen.console.aliyun.com.From upper example as it can be seen that when Web is using multicenter deployment is become from single centre deployment, by Become multiple domain names in a domain name, exists and generated in such a way that URL parameter distinguishes different zones when being disposed with single centre The problem of conflict.The embodiment of the present application passes through the access mode under compatible single centre and multicenter deployment form to Web application, into And it supports Web to apply between single centre deployment and multicenter deployment and seamlessly transits.
Fig. 2 is the flow chart for the method that realization Web application domain name provided by the embodiments of the present application jumps.The reality of the present embodiment Existing Web application domain name jump method is implemented at client (for example, browser).As shown in Fig. 2, the method for the present embodiment include with Lower step:
Step 201:The URL of the Web application of client access is obtained, and parses and obtains the first domain name;
Step 202:According to the compartmentalization configuration information that URL and Web is applied, the second domain name is determined;
Step 203:According to the comparison result of the first domain name and the second domain name, it is determined whether carry out domain name and jump.
Wherein, the first domain name is parsed from the access URL got, and the second domain name is according to the URL got It is determined with the compartmentalization configuration information of Web application.The compartmentalization configuration information of Web application includes returning in application server In application code.
In some implementations, the compartmentalization configuration information of Web application may include at least one of:Web application The region in each region in the zone list of centralization state, Web application that basic domain name, Web application are supported, the zone list Change initiate mode, the compartmentalization domain name in each region.
Wherein, when a Web is applied using single centreization deployment, the compartmentalization configuration information of Web application be can wrap It includes:The centralization state (being at this time single centre) that the basic domain name of Web application, Web application are supported.It is answered in a Web When with using multicenterization deployment, the compartmentalization configuration information of Web application may include:The centralization that Web application is supported State (being at this time multicenter), the zone list of Web application, the compartmentalization in each region enables shape in the zone list State, the compartmentalization domain name in each region.Wherein, zone list can be used for recording the region that Web applies corresponding all areas Mark (for example, number or title).The compartmentalization initiate mode in each region is used to indicate whether the region is configured in one Whether the heart (enables the compartmentalization domain name in the region);The compartmentalization domain name in each region is used to indicate Web application and enables in mostly The domain name in the region when heartization is disposed.
It should be noted that being directed to a region, the compartmentalization initiate mode in the region indicates that the region is not matched When being set to a center, the compartmentalization domain name in the region is in the state that is not activated, and the only compartmentalization in the region enables shape When state indicates that the region is configured as a center, the compartmentalization domain name in the region is just in initiate mode.In some realization sides In formula, for a region, when the compartmentalization initiate mode when the region indicates that the region is not configured as a center, It can not include the compartmentalization domain name in the region in compartmentalization configuration information.However, the region that the application applies a Web The content for changing configuration information does not limit.In practical applications, the actual deployment situation that can be applied according to Web, is arranged the Web The compartmentalization configuration information of application.
In some implementations, step 202 may include:
If single centre is supported in Web application, it is determined that entitled second domain name of ground field of Web application;
If multicenter is supported in Web application, and the first domain name of the URL of step 201 acquisition can be matched to Web application Compartmentalization configuration information in enabled compartmentalization domain name, it is determined that the compartmentalization domain name being matched to be the second domain name;
If multicenter, and the URL parameter carrier area information in the URL of step 201 acquisition are supported in Web application, then root The corresponding domain of the area information is obtained from the compartmentalization configuration information that the Web is applied according to the area information that URL parameter carries Name is used as the second domain name;
If multicenter is supported in Web application, the first domain name for the URL that step 201 obtains is not matched to Web application Enabled compartmentalization domain name in compartmentalization configuration information, and the URL parameter of the URL does not have carrier area information yet, then basis It is corresponding to obtain the area information from the compartmentalization configuration information that the Web is applied for the area information recorded in client-cache Domain name is as the second domain name.
Wherein, from the compartmentalization configuration information that the Web is applied, the corresponding domain name of the area information is obtained as the second domain , may include:
In the compartmentalization configuration information of Web application, if the corresponding compartmentalization domain name of the area information has enabled, really Recognizing the compartmentalization domain name is the second domain name;
If the corresponding compartmentalization domain name of the area information does not enable, the ground field entitled second of Web application is confirmed Domain name.
In this implementation, when single centre is supported in Web application, Web application only corresponds to a domain name (that is, basic Domain name), then it can determine that the second domain name is basic domain name.It, can be first by the of URL when multicenter is supported in Web application Enabled compartmentalization domain name is matched in the compartmentalization configuration information that one domain name is applied with the Web;If being not matched to, know The area information that the URL parameter of the not URL carries, and the area information is obtained from the compartmentalization configuration information that the Web is applied Corresponding domain name;If the URL parameter of the URL does not have carrier area information, the area information recorded in client-cache is obtained, And the corresponding domain name of the area information is obtained (for example, the area information is corresponding from the compartmentalization configuration information that the Web is applied Enabled compartmentalization domain name, alternatively, the basic domain name of Web application).
Wherein, URL parameter may include at least one of:Hash parameter, path parameter.Wherein, hash parameter refers to URL In # identifier after content;For example, in following URL:Www.aliyun.com/#/regionId=cn-hangzhou, Hash parameter is:RegionId=cn-hangzhou, i.e. hash parameter carrier area mark, the region of area identification instruction For Hangzhou China.Path parameter refers to the path sections of a URL, also referred to as pathname;For example, in following URL:https:// Ecs.console.aliyun.com/detail.html#regionId=cn-hangzhou, domain name are: ecs.console.aliyun.com;Path parameter is:/detail.html;Hash parameter is:RegionId=cn- hangzhou。
In some implementations, after step 202, the method for the present embodiment can also include:In client-cache Record area information.Wherein, when client is browser, client-cache can be Cookie.Wherein, Cookie is to save Small text file on a web browser, may include the information of relevant user.For example, the Cookie in browser records the second domain The corresponding area identification of name.Wherein, it during determining the second domain name, can be corresponded to according to determining compartmentalization domain name Area information, alternatively, from URL parameter obtain area information, alternatively, obtaining area information according to record before;It is obtaining After area information, the region of storage before being updated in Cookie with the area information (for example, zone number or title) Information, in case use when jumping of the subsequent processing Web application domain name, or for when handling other Web application domain names and jumping It uses.
In some implementations, step 203 may include:
If the first domain name is identical with the second domain name, it is determined that jumped without domain name;
If the first domain name and the second domain name difference, it is determined that jumped according to the second domain name.
Wherein, if when the first domain name and the second domain name difference, can according to the URL parameter in the URL that step 201 obtains with And second domain name determine and need the URL that jumps to.For example, the URL that step 201 obtains is:ecs.console.aliyun.com? Query=instance1, the second domain name that step 202 determines are:Ecs-cn-hangzhou.console.aliyun.com, It then determines and needs the URL that jumps to be:ecs-cn-hangzhou.console.aliyun.com?Query=instance1.
After determining the URL that needs jump to, client can be inquired from domain name resolution server according to the URL and be corresponded to Application server IP address, and the IP address of the application server returned according to domain name resolution server is to the application service Device sends access request, and application server returns to application page and application code after receiving the access request of client, wherein It is applied for the same Web, the application code received before the application code and client returned at this time is identical, client It can show the application page that the application server returns, and can determine no longer progress domain name jump by executing the application code Turn.
The scheme of the application is illustrated below by an example.
In this example, to be said for a Cloud Server (ecs, Elastic Compute Service) application It is bright.Wherein, the compartmentalization configuration information of ecs application may include:Basic domain name, the centralization state of support, zone list, The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in the zone list.
Wherein, zone list can be stored using an array regionList, for example, regionList is: [{regionId:" cn-hangzhou " }, { regionId:" cn-shenzhen " }, { regionId:"ap-northeast- 1 " }, { regionId:" ap-southeast-1 " }], wherein regionId indicates area identification, in this example, regionId It may include following four value:Ap-northeast-1 (can in a few days this), ap-southeast-1 (can refer to Singapore), Cn-shenzhen (referring to China Shenzhen), cn-hanghzou (referring to Hangzhou China).
Wherein, the compartmentalization configuration information (regionSetting) of ecs application is configurable to:
Wherein, whether each region that " regions " partially records ecs application enables compartmentalization domain name, and corresponding Compartmentalization domain name.IsOpen is an open switch position, is used to indicate the compartmentalization initiate mode in a region, if " IsOpen " is true, then it represents that a region enables compartmentalization domain name, otherwise indicates that the region does not enable compartmentalization domain name, At this point, the corresponding domain name in the region can be ground field name.
It is disposed it should be noted that if the ecs is applied using single centre, then " isRegionalization " is false; At this point, the compartmentalization domain name of each region of the part " regions " record is in not enabled state.
As shown in figure 3, in this example, browser accesses esc application, answered for example, user inputs access esc in browser URL, browser to corresponding application server send access request, application server to browser return application page and Application code runs the application code of application server return in a browser to execute following steps:
Step 301, the URL that browser access is obtained by the tool method that browser provides, parsing obtain domain name A;
Step 302 judges whether to find matched enabled compartmentalization from the regionSetting that the esc is applied Domain name;
It should be noted that when regionSetting searches matched compartmentalization domain name, only from " regions " " IsOpen " is to be searched and (matched from enabled compartmentalization domain name) in the corresponding compartmentalization domain name of true;
If step 303 finds matched enabled compartmentalization domain name, it is determined that the compartmentalization domain name is corresponding RegionId information;
If step 304 does not find matched enabled compartmentalization domain name, whether the URL that judgment step 301 obtains is taken Whether band hash parameter, hash parameter carry regionId;
If the hash parameter of step 305, the URL carry regionId, regionId information is obtained from hash parameter;
If step 306, URL do not carry hash parameter or hash parameter does not carry regionId, from browser Cookies in obtain the regionId information recorded recently;
By step 303, step 305 or step 306, available regionId information;Later, in step 307, The corresponding domain name B of the regionId information is obtained from regionSetting;In step 308, it is somebody's turn to do in Cookies record RegionId information, for example, with the regionId information recorded before the regionId information update.Wherein, in step 307 In, if being unable to get corresponding compartmentalization domain name according to regionId information, obtain the basic domain name of esc application.
It should be noted that the application does not limit the sequencing of step 307 and step 308, with step in Fig. 3 For 307 execute prior to step 308.In other implementations, step 308 can be executed prior to step 307, alternatively, simultaneously It executes.
Step 309 judges whether domain name A and domain name B are identical;
If domain name A is identical with domain name B, without carrying out domain name challenge, browser is maintained at current page;If domain name A and Domain name B is not identical, then jumps to corresponding URL (such as step 310) of domain name B.It should be noted that if the URL obtained before takes Band URL parameter, then the corresponding URL of domain name B includes domain name B and URL parameter.
Multiple examples are illustrated below based on this example.
In example one, the URL for the esc application that step 301 obtains is:ecs.console.aliyun.com?Query= Instance1, then obtaining domain name A is:ecs.console.aliyun.com;According to above-mentioned regionSetting it is found that domain name A is not matched to enabled compartmentalization domain name, and URL also therefore can be from browser Cookies without carrying regionId The regionId information that records recently is obtained, for example, the regionId of Cookies record is cn-hangzhou, then basis RegionSetting can learn that cn-hangzhou has enabled compartmentalization domain name, accordingly, can determine that domain name B is:ecs-cn- hangzhou.console.aliyun.com.In this example, domain name A and domain name B is different, can determine and final jump URL For:ecs-cn-hangzhou.console.aliyun.com?Query=instance1.
In example two, the URL for the ecs application that step 301 obtains is:ecs.console.aliyun.com?Query= Instance1, then obtaining domain name A is:ecs.console.aliyun.com;According to above-mentioned regionSetting it is found that domain name A is not matched to enabled compartmentalization domain name, and URL also therefore can be from browser Cookies without carrying regionId The regionId information that records recently is obtained, for example, the regionId of Cookies record is ap-southeast-1, then basis RegionSetting can learn ap-southeast-1 not enabled compartmentalization domain name, accordingly, can determine that domain name B is ecs.console.aliyun.com;In this example, domain name B is identical as domain name A, jumps without domain name.
In example three, the URL that step 301 obtains is:Ecs-ap-northeast-1.console.aliyun.com, Then obtaining domain name A is:ecs-ap-northeast-1.console.aliyun.com;It can according to above-mentioned regionSetting Know, domain name A can be matched to " ap-northeast-1 " enabled compartmentalization domain name, accordingly, can determine that domain name B is " ap- The enabled compartmentalization domain name of northeast-1 ", i.e.,:ecs-ap-northeast-1.console.aliyun.com.At this In example, domain name B is identical as domain name A, jumps without domain name.
In example four, the URL that step 301 obtains ecs application is:ecs.console.aliyun.com/#/ RegionId=cn-hangzhou, then obtaining domain name A is:ecs.console.aliyun.com;According to above-mentioned RegionSetting is it is found that domain name A is not matched to enabled compartmentalization domain name, but URL carries regionId, and RegionId=cn-hangzhou;At this point, can learn that cn-hangzhou has enabled compartmentalization domain according to regionSetting Name, accordingly, can determine that domain name B is:ecs-cn-hangzhou.console.aliyun.com.In this example, domain name A and domain Name B is different, can determine that the final URL that jumps is:ecs-cn-hangzhou.console.aliyun.com/#/regionId =cn-hangzhou, alternatively, ecs-cn-hangzhou.console.aliyun.com.
The embodiment of the present application also provides a kind of device realizing Web application domain name and jumping, as shown in figure 4, the present embodiment mentions The device of confession includes:
First domain name determining module 401, the URL of the Web application for obtaining client access, and parse and obtain the first domain Name;
Second domain name determining module 402 determines the second domain for the compartmentalization configuration information according to URL and Web application Name;
Control module 403 is jumped, for the comparison result according to the first domain name and the second domain name, it is determined whether carry out domain name It jumps.
Device provided in this embodiment can be applied to client (for example, browser), the device about the present embodiment Implementation environment is referred to described in Fig. 1, therefore is repeated no more in this.
Wherein, the compartmentalization configuration information of Web application may include at least one of:The basic domain name of Web application, Web enables shape using the compartmentalization in each region in the centralization state of support, the zone list of Web application, the zone list State, the compartmentalization domain name in each region.
Wherein, the second domain name determining module 402 can be used for the region applied in the following manner according to URL and Web Change configuration information, determines the second domain name:
If single centre is supported in Web application, it is determined that entitled second domain name of ground field of Web application;
If Web application support multicenter, and the first domain name determining module 401 obtain URL the first domain name can It is fitted on enabled compartmentalization domain name in the compartmentalization configuration information of Web application, it is determined that the compartmentalization domain name being matched to For the second domain name;
If multicenter is supported in Web application, and the URL parameter in the URL of the first domain name determining module 401 acquisition carries area Domain information, the then area information carried according to URL parameter obtain region letter from the compartmentalization configuration information that the Web is applied Corresponding domain name is ceased as the second domain name;
If multicenter is supported in Web application, the first domain name for the URL that the first domain name determining module 401 obtains is not matched Enabled compartmentalization domain name in the compartmentalization configuration information applied to the Web, and the URL parameter of the URL does not have carrier area Information then obtains the area from the compartmentalization configuration information that the Web is applied according to the area information recorded in client-cache The corresponding domain name of domain information is as the second domain name.
Wherein, the compartmentalization that the second domain name determining module 402 can be used for applying from the Web in the following manner is with confidence In breath, the corresponding domain name of the area information is obtained as the second domain name:
In the compartmentalization configuration information of Web application, if the corresponding compartmentalization domain name of the area information has enabled, really Recognizing the compartmentalization domain name is the second domain name;
If the corresponding compartmentalization domain name of the area information does not enable, the ground field entitled second of Web application is confirmed Domain name.
Wherein, device provided in this embodiment can also include:Logging modle 404, for being recorded in client-cache Area information.
Wherein, jumping control module 403 can be used in the following manner according to the comparison of the first domain name and the second domain name As a result, it is determined whether carry out domain name and jump:
If the first domain name is identical with the second domain name, it is determined that jumped without domain name;
If the first domain name and the second domain name difference, it is determined that jumped according to the second domain name.
Related description about the present embodiment is referred to the description of embodiment illustrated in fig. 2, therefore repeats no more in this.
The embodiment of the present application also provides a kind of device, including:Memory and processor;Wherein, memory is for storing The program jumped for realizing Web application domain name;The program jumped for realizing Web application domain name is held being read out by the processor When row, following operation is executed:
The URL of the Web application of client access is obtained, and parses and obtains the first domain name;It is applied according to URL and Web Compartmentalization configuration information determines the second domain name;According to the comparison result of the first domain name and the second domain name, it is determined whether carry out domain name It jumps.
Wherein, the compartmentalization configuration information of Web application may include at least one of:The basic domain name of Web application, Web enables shape using the compartmentalization in each region in the centralization state of support, the zone list of Web application, the zone list State, the compartmentalization domain name in each region.
Wherein, the compartmentalization configuration information applied according to URL and Web, determines the second domain name, may include:
If single centre is supported in Web application, it is determined that entitled second domain name of ground field of Web application;
If multicenter is supported in Web application, and the first domain name of the URL obtained can be matched to the region of Web application Change enabled compartmentalization domain name in configuration information, it is determined that the compartmentalization domain name being matched to is the second domain name;
If multicenter, and the URL parameter carrier area information in the URL obtained are supported in Web application, then joined according to URL The area informations that number carries obtain the corresponding domain name of the area information as the from the compartmentalization configuration information that the Web is applied Two domain names;
If multicenter is supported in Web application, the first domain name of the URL of acquisition is not matched to the compartmentalization of Web application Enabled compartmentalization domain name in configuration information, and the URL parameter of the URL does not have carrier area information, then it is slow according to client The area information for depositing middle record obtains the corresponding domain name conduct of the area information from the compartmentalization configuration information that the Web is applied Second domain name.
In the present embodiment, the program jumped for realizing Web application domain name is performed when being read out by the processor execution Operation corresponds to the step 201 in embodiment illustrated in fig. 2 to step 203;Other details of operation performed by the program can join See above method embodiment.
In addition, the embodiment of the present application also provides a kind of computer-readable medium, it is stored with multiple instruction, when multiple instruction quilt One or more processors realize the method that above-mentioned realization Web application domain name jumps when executing.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program Related hardware (such as processor) is completed, and described program can store in computer-readable medium, such as read-only memory, disk Or CD etc..Optionally, one or more integrated circuits can be used also to realize in all or part of the steps of above-described embodiment. Correspondingly, each module/unit in above-described embodiment can take the form of hardware realization, such as be realized by integrated circuit Its corresponding function can also be realized in the form of software function module, such as be stored in memory by processor execution Program/instruction realize its corresponding function.The application is not limited to the combination of the hardware and software of any particular form.
The advantages of basic principles and main features and the application of the application have been shown and described above.The application is not by upper The limitation for stating embodiment, the above embodiments and description only describe the principles of the application, are not departing from the application Under the premise of spirit and scope, the application be will also have various changes and improvements, these changes and improvements both fall within claimed Within the scope of the application.

Claims (17)

1. a kind of method realizing web application domain name and jumping, which is characterized in that including:
The uniform resource locator of the web application of client access is obtained, and parses and obtains the first domain name;
According to the compartmentalization configuration information of the uniform resource locator and the web application, the second domain name is determined;
According to the comparison result of first domain name and second domain name, it is determined whether carry out domain name and jump.
2. the method according to claim 1, wherein the compartmentalization configuration information of the web application, including with It is at least one lower:Centralization state that the basic domain name of the web application, the web application are supported, the web application The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in zone list, the zone list.
3. according to the method described in claim 2, it is characterized in that, described according to the uniform resource locator and the net The compartmentalization configuration information of page application, determines the second domain name, including:
If the web application supports single centre, it is determined that entitled second domain name of the ground field of the web application;
If the web application supports multicenter, and the first domain name of the uniform resource locator can be matched to the net Enabled compartmentalization domain name in the compartmentalization configuration information of page application, it is determined that the compartmentalization domain name being matched to is second Domain name;
If the web application supports multicenter, and the uniform resource locator parameter of the uniform resource locator carries area Domain information, the then area information carried according to the uniform resource locator parameter are configured from the compartmentalization of the web application In information, the corresponding domain name of the area information is obtained as the second domain name;
If the web application supports multicenter, the first domain name of the uniform resource locator is not matched to the webpage Enabled compartmentalization domain name in the compartmentalization configuration information of application, and the uniform resource locator of the uniform resource locator Parameter does not have carrier area information, then according to the area information recorded in client-cache, from the compartmentalization of the web application In configuration information, the corresponding domain name of the area information is obtained as the second domain name.
4. according to the method described in claim 3, it is characterized in that, the compartmentalization configuration information from the web application In, the corresponding domain name of the area information is obtained as the second domain name, including:
In the compartmentalization configuration information of the web application, if the corresponding compartmentalization domain name of the area information has enabled, Confirm that the compartmentalization domain name is the second domain name;If the corresponding compartmentalization domain name of the area information does not enable, institute is confirmed State entitled second domain name of ground field of web application.
5. according to the method described in claim 3, it is characterized in that, the uniform resource locator parameter include it is following at least it One:Hash parameter, path parameter.
6. according to the method described in claim 3, it is characterized in that, after the second domain name of the determination, the method also includes: The area information is recorded in the client-cache.
7. method according to any one of claims 1 to 6, which is characterized in that described according to first domain name and described The comparison result of second domain name, it is determined whether it carries out domain name and jumps, including:
If first domain name is identical with second domain name, it is determined that jumped without domain name;If first domain name and institute State the second domain name difference, it is determined that jumped according to second domain name.
8. a kind of device realizing web application domain name and jumping, which is characterized in that including:
First domain name determining module, the uniform resource locator of the web application for obtaining client access, and parse and obtain First domain name;
Second domain name determining module, for matching confidence according to the compartmentalization of the uniform resource locator and the web application Breath, determines the second domain name;
Control module is jumped, for the comparison result according to first domain name and second domain name, it is determined whether carry out domain Name jumps.
9. device according to claim 8, which is characterized in that the compartmentalization configuration information of the web application, including with It is at least one lower:Centralization state that the basic domain name of the web application, the web application are supported, the web application The compartmentalization initiate mode in each region, the compartmentalization domain name in each region in zone list, the zone list.
10. device according to claim 9, which is characterized in that the second domain name determining module is used for by with lower section Formula determines the second domain name according to the compartmentalization configuration information of the uniform resource locator and the web application:
If the web application supports single centre, it is determined that entitled second domain name of the ground field of the web application;
If the web application supports multicenter, and the first domain name of the uniform resource locator can be matched to the net Enabled compartmentalization domain name in the compartmentalization configuration information of page application, it is determined that the compartmentalization domain name being matched to is second Domain name;
If the web application supports multicenter, and the uniform resource locator parameter of the uniform resource locator carries area Domain information, the then area information carried according to the uniform resource locator parameter are configured from the compartmentalization of the web application In information, the corresponding domain name of the area information is obtained as the second domain name;
If the web application supports multicenter, the first domain name of the uniform resource locator is not matched to the webpage Enabled compartmentalization domain name in the compartmentalization configuration information of application, and the uniform resource locator of the uniform resource locator Parameter does not have carrier area information, then according to the area information recorded in client-cache, from the compartmentalization of the web application In configuration information, the corresponding domain name of the area information is obtained as the second domain name.
11. device according to claim 10, which is characterized in that the second domain name determining module is used for by with lower section Formula obtains the corresponding domain name of the area information as the second domain name from the compartmentalization configuration information of the web application:
In the compartmentalization configuration information of the web application, if the corresponding compartmentalization domain name of the area information has enabled, Confirm that the compartmentalization domain name is the second domain name;If the corresponding compartmentalization domain name of the area information does not enable, institute is confirmed State entitled second domain name of ground field of web application.
12. device according to claim 10, which is characterized in that described device further includes:Logging modle, for described The area information is recorded in client-cache.
13. according to the described in any item devices of claim 8 to 12, which is characterized in that the control module that jumps is for passing through Following manner is according to the comparison result of first domain name and second domain name, it is determined whether carries out domain name and jumps:
If first domain name is identical with second domain name, it is determined that jumped without domain name;If first domain name and institute State the second domain name difference, it is determined that jumped according to second domain name.
14. a kind of device, which is characterized in that including:Memory and processor;Wherein, the memory is used for for storing Realize the program that web application domain name jumps;This reads for realizing the program that web application domain name jumps by the processor When execution, following operation is executed:
The uniform resource locator of the web application of client access is obtained, and parses and obtains the first domain name;
According to the compartmentalization configuration information of the uniform resource locator and the web application, the second domain name is determined;
According to the comparison result of first domain name and second domain name, it is determined whether carry out domain name and jump.
15. device according to claim 14, which is characterized in that the compartmentalization configuration information of the web application, including At least one of:Centralization state, the web application that basic domain name, the web application of the web application are supported Zone list, in the zone list each region compartmentalization initiate mode, the compartmentalization domain name in each region.
16. device according to claim 14, which is characterized in that described according to the uniform resource locator and described The compartmentalization configuration information of web application determines the second domain name, including:
If the web application supports single centre, it is determined that entitled second domain name of the ground field of the web application;
If the web application supports multicenter, and the first domain name of the uniform resource locator can be matched to the net Enabled compartmentalization domain name in the compartmentalization configuration information of page application, it is determined that the compartmentalization domain name being matched to is second Domain name;
If the web application supports multicenter, and the uniform resource locator parameter of the uniform resource locator carries area Domain information, the then area information carried according to the uniform resource locator parameter are configured from the compartmentalization of the web application In information, the corresponding domain name of the area information is obtained as the second domain name;
If the web application supports multicenter, the first domain name of the uniform resource locator is not matched to the webpage Enabled compartmentalization domain name in the compartmentalization configuration information of application, and the uniform resource locator of the uniform resource locator Parameter does not have carrier area information, then according to the area information recorded in client-cache, from the compartmentalization of the web application In configuration information, the corresponding domain name of the area information is obtained as the second domain name.
17. a kind of computer-readable medium, is stored with multiple instruction, when the multiple instruction is executed by one or more processors The method that realization web application domain name of the Shi Shixian as described in any one of claims 1 to 7 jumps.
CN201710333391.2A 2017-05-12 2017-05-12 Method and device for realizing webpage application domain name skip Active CN108881501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710333391.2A CN108881501B (en) 2017-05-12 2017-05-12 Method and device for realizing webpage application domain name skip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710333391.2A CN108881501B (en) 2017-05-12 2017-05-12 Method and device for realizing webpage application domain name skip

Publications (2)

Publication Number Publication Date
CN108881501A true CN108881501A (en) 2018-11-23
CN108881501B CN108881501B (en) 2021-07-06

Family

ID=64319583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710333391.2A Active CN108881501B (en) 2017-05-12 2017-05-12 Method and device for realizing webpage application domain name skip

Country Status (1)

Country Link
CN (1) CN108881501B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729288A (en) * 2008-10-31 2010-06-09 中国科学院计算机网络信息中心 Method and device for counting network access behaviours of internet users
CN103023787A (en) * 2011-09-26 2013-04-03 百度在线网络技术(北京)有限公司 Data center system, data center device and method for providing service
EP2611116A1 (en) * 2011-12-30 2013-07-03 Verisign, Inc. Providing privacy enhanced resolution system in the domain name system
CN103314566A (en) * 2010-11-05 2013-09-18 思杰系统有限公司 Systems and methods for managing domain name system security (DNSSEC)
CN103428179A (en) * 2012-05-18 2013-12-04 阿里巴巴集团控股有限公司 Method, system and device for logging into multi-domain-name website
CN103634314A (en) * 2013-11-28 2014-03-12 杭州华三通信技术有限公司 Service access control method and device based on VSR (virtual service router)
CN104170356A (en) * 2013-12-30 2014-11-26 华为技术有限公司 Method and device for processing domain name requests
CN105072211A (en) * 2015-08-12 2015-11-18 网宿科技股份有限公司 Domain name deployment system and domain name deployment method based on DNS (Domain Name Server)
CN106326260A (en) * 2015-06-29 2017-01-11 小米科技有限责任公司 Webpage access method and device
CN106453675A (en) * 2016-09-19 2017-02-22 网宿科技股份有限公司 302 jump method, method and system for generating URL, and method and system for resolving domain name resolution request

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729288A (en) * 2008-10-31 2010-06-09 中国科学院计算机网络信息中心 Method and device for counting network access behaviours of internet users
CN103314566A (en) * 2010-11-05 2013-09-18 思杰系统有限公司 Systems and methods for managing domain name system security (DNSSEC)
CN103023787A (en) * 2011-09-26 2013-04-03 百度在线网络技术(北京)有限公司 Data center system, data center device and method for providing service
EP2611116A1 (en) * 2011-12-30 2013-07-03 Verisign, Inc. Providing privacy enhanced resolution system in the domain name system
CN103428179A (en) * 2012-05-18 2013-12-04 阿里巴巴集团控股有限公司 Method, system and device for logging into multi-domain-name website
CN103634314A (en) * 2013-11-28 2014-03-12 杭州华三通信技术有限公司 Service access control method and device based on VSR (virtual service router)
CN104170356A (en) * 2013-12-30 2014-11-26 华为技术有限公司 Method and device for processing domain name requests
CN106326260A (en) * 2015-06-29 2017-01-11 小米科技有限责任公司 Webpage access method and device
CN105072211A (en) * 2015-08-12 2015-11-18 网宿科技股份有限公司 Domain name deployment system and domain name deployment method based on DNS (Domain Name Server)
CN106453675A (en) * 2016-09-19 2017-02-22 网宿科技股份有限公司 302 jump method, method and system for generating URL, and method and system for resolving domain name resolution request

Also Published As

Publication number Publication date
CN108881501B (en) 2021-07-06

Similar Documents

Publication Publication Date Title
US10257101B2 (en) Active application response delay time
CN110149423B (en) Domain name processing method and device, readable storage medium and electronic equipment
US10027742B2 (en) Techniques for sharing application states
CN104965848B (en) A kind of front end resource loading method and device
CN106294379A (en) The loading method of a kind of page, device and system
US9088462B2 (en) Common web accessible data store for client side page processing
CN103064989B (en) Webpage preservation, deployment method and device
CN103944994A (en) Distributed resource obtaining method and device
US20120084516A1 (en) Methods and apparatuses for data resource provision
CN104424225B (en) Document handling method based on document transmission process and device
US9503551B2 (en) Hybrid native networked applications
JP2017522638A (en) Multimedia display method, apparatus and device
JP6779307B2 (en) Method and device for page display
CN109710832B (en) Method and equipment for searching hosted program
US10516628B2 (en) Transfer device, transfer system, and transfer method
CN110020297A (en) A kind of loading method of web page contents, apparatus and system
CN106919595B (en) Cookie mapping method and device and electronic equipment
CN107704464A (en) Parse the method and device in the path of static resource
CN108011936A (en) Method and apparatus for pushed information
CN108241696A (en) Obtain the method, apparatus and system of map datum
CN108881501A (en) A kind of method and device realizing web application domain name and jumping
CN106230988A (en) A kind of processing method for playing video files and device
CN109101564A (en) A kind of method, apparatus and electronic equipment of page resource load simultaneously
CN114143230B (en) Dual-stack user DNS analysis duration calculation method and device
CN110476401A (en) Multimedia service content providing device and method

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
GR01 Patent grant
GR01 Patent grant