CN108881501B - Method and device for realizing webpage application domain name skip - Google Patents

Method and device for realizing webpage application domain name skip Download PDF

Info

Publication number
CN108881501B
CN108881501B CN201710333391.2A CN201710333391A CN108881501B CN 108881501 B CN108881501 B CN 108881501B CN 201710333391 A CN201710333391 A CN 201710333391A CN 108881501 B CN108881501 B CN 108881501B
Authority
CN
China
Prior art keywords
domain name
web application
regionalized
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.)
Active
Application number
CN201710333391.2A
Other languages
Chinese (zh)
Other versions
CN108881501A (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

Images

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

The text discloses a method and a device for realizing webpage application domain name skip; the method comprises the following steps: the method comprises the steps of obtaining a URL (uniform resource locator) of a Web application accessed by a client, and analyzing to obtain a first domain name; determining a second domain name according to the URL and the regionalized configuration information of the Web application; and determining whether to carry out domain name skipping or not according to a comparison result of the first domain name and the second domain name. The scheme disclosed by the invention can be compatible with access modes of the Web application under single-center and multi-center deployment forms, so that smooth transition of the Web application between single-center deployment and multi-center deployment is realized.

Description

Method and device for realizing webpage application domain name skip
Technical Field
The invention relates to the technical field of networks, in particular to a method and a device for realizing webpage (Web) application domain name skipping.
Background
A Web page (Web) application is an application program that can be accessed through a Web page. A user may access a Web application through a browser. Currently, Web applications can be divided into single-center deployments (i.e., deployments in one area (Region)) and multi-center deployments (i.e., deployments in multiple areas) according to the deployment form. The Web application deployed in the single center only corresponds to one domain name; when the multi-center deployment Web application is adopted, the sub-applications deployed in each area are independent center applications and can have different domain names. Therefore, when the Web application is migrated from the single-center deployment to the multi-center deployment, or from the multi-center deployment to the single-center deployment, how to be compatible with the access mode of the Web application in the form of the single-center deployment and the multi-center deployment to realize the smooth transition of the Web application between the single-center deployment and the multi-center deployment is a problem to be solved.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the application provides a method and a device for realizing domain name skipping of Web application, which can be compatible with access modes of the Web application in single-center and multi-center deployment modes so as to realize smooth transition between single-center deployment and multi-center deployment of the Web application.
The embodiment of the application provides a method for realizing Web application domain name skipping, which comprises the following steps:
acquiring a Uniform Resource Locator (URL) of a Web application accessed by a client, and analyzing to obtain a first domain name;
determining a second domain name according to the URL and the regionalized configuration information of the Web application;
and determining whether to carry out domain name skipping or not according to the comparison result of the first domain name and the second domain name.
In an exemplary embodiment, the regionalized configuration information of the Web application may include at least one of: the domain name of the Web application, the centralization state supported by the Web application, the zone list of the Web application, the regionalization enabling state of each zone in the zone list, and the regionalization domain name of each zone.
In an exemplary embodiment, the determining a second domain name according to the URL and the regionalized configuration information of the Web application may include:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentralization and the first domain name of the URL can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining the matched regionalized domain name as a second domain name;
if the Web application supports multicentralization and the URL parameter of the URL carries region information, acquiring a domain name corresponding to the region information from regional configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentralization, the first domain name of the URL is not matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, the domain name corresponding to the region information is acquired from the regionalized configuration information of the Web application as a second domain name according to the region information recorded in the cache of the client.
In an exemplary embodiment, the obtaining, from the regionalization configuration information of the Web application, a domain name corresponding to the region information as a second domain name may include:
in the regionalization configuration information of the Web application, if a regionalization domain name corresponding to the regional information is enabled, confirming that the regionalization domain name is a second domain name;
and if the regionalized domain name corresponding to the regional information is not enabled, confirming that the basic domain name of the Web application is the second domain name.
In an exemplary embodiment, the URL parameters may include at least one of: hash (hash) parameter, path (path) parameter.
In an exemplary embodiment, after determining the second domain name, the method may further include: and recording the area information in the client cache.
In an exemplary embodiment, the determining whether to perform domain name hopping according to a comparison result of the first domain name and the second domain name may include:
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping;
and if the first domain name is different from the second domain name, determining to skip according to the second domain name.
The embodiment of the present application further provides a device for implementing domain name hopping for Web applications, including:
the first domain name determining module is used for acquiring a URL (uniform resource locator) of a Web application accessed by a client and analyzing the URL to obtain a first domain name;
the second domain name determining module is used for determining a second domain name according to the URL and the regionalized configuration information of the Web application;
and the skipping control module is used for determining whether to skip the domain name according to the comparison result of the first domain name and the second domain name.
In an exemplary embodiment, the regionalized configuration information of the Web application may include at least one of: the domain name of the Web application, the centralization state supported by the Web application, the zone list of the Web application, the regionalization enabling state of each zone in the zone list, and the regionalization domain name of each zone.
In an exemplary embodiment, the second domain name determining module may be configured to determine the second domain name according to the URL and the regionalized configuration information of the Web application by:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentralization and the first domain name of the URL can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining the matched regionalized domain name as a second domain name;
if the Web application supports multicentralization and the URL parameter of the URL carries region information, acquiring a domain name corresponding to the region information from regional configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentralization, the first domain name of the URL is not matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, the domain name corresponding to the region information is acquired from the regionalized configuration information of the Web application as a second domain name according to the region information recorded in the cache of the client.
In an exemplary embodiment, the second domain name determining module may be configured to obtain, as the second domain name, a domain name corresponding to the region information from the regionalization configuration information of the Web application by:
in the regionalization configuration information of the Web application, if a regionalization domain name corresponding to the regional information is enabled, confirming that the regionalization domain name is a second domain name;
and if the regionalized domain name corresponding to the regional information is not enabled, confirming that the basic domain name of the Web application is the second domain name.
In an exemplary embodiment, the apparatus may further include: and the recording module is used for recording the area information in the client cache.
In an exemplary embodiment, the jump control module may be configured to determine whether to perform domain name jump according to a comparison result of the first domain name and the second domain name by:
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping;
and if the first domain name is different from the second domain name, determining to skip according to the second domain name.
An embodiment of the present application further provides a device, including: a memory and a processor; the memory is used for storing a program for realizing Web application domain name jumping; when being read and executed by the processor, the program for realizing the Web application domain name jump executes the following operations:
the method comprises the steps of obtaining a URL (uniform resource locator) of a Web application accessed by a client, and analyzing to obtain a first domain name;
determining a second domain name according to the URL and the regionalized configuration information of the Web application;
and determining whether to carry out domain name skipping or not according to the comparison result of the first domain name and the second domain name.
In an exemplary embodiment, the regionalized configuration information of the Web application may include at least one of: the domain name of the Web application, the centralization state supported by the Web application, the zone list of the Web application, the regionalization enabling state of each zone in the zone list, and the regionalization domain name of each zone.
In an exemplary embodiment, the determining a second domain name according to the URL and the regionalized configuration information of the Web application may include:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentralization and the first domain name of the URL can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining the matched regionalized domain name as a second domain name;
if the Web application supports multicentralization and the URL parameter of the URL carries region information, acquiring a domain name corresponding to the region information from regional configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentralization, the first domain name of the URL is not matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, the domain name corresponding to the region information is acquired from the regionalized configuration information of the Web application as a second domain name according to the region information recorded in the cache of the client.
Embodiments of the present application further provide a computer-readable medium, which stores a plurality of instructions, and when the plurality of instructions are executed by one or more processors, the method for implementing domain name hopping for a Web application is implemented.
In the embodiment of the application, the URL of the Web application accessed by the client is obtained and analyzed to obtain the first domain name, the second domain name is determined according to the URL and the regionalized configuration information of the Web application, and whether domain name skipping is carried out or not is determined according to the comparison result of the first domain name and the second domain name. Therefore, the method and the device support smooth transition between single-center deployment and multi-center deployment of the Web application, and are compatible with access modes of the Web application under single-center deployment forms and multi-center deployment forms. In addition, the existing service is not influenced in the process of deployment and migration of the Web application between the single center and the multiple centers, so that the user experience is ensured.
Of course, it is not necessary for any product to achieve all of the above advantages at the same time for the practice of the present application.
Other aspects will be apparent upon reading and understanding the attached drawings and detailed description.
Drawings
FIG. 1 is a schematic illustration of an implementation environment of an embodiment of the present application;
fig. 2 is a flowchart of a method for implementing domain name hopping for a Web application according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an example of an embodiment of the present application;
fig. 4 is a schematic diagram of an apparatus for implementing domain name hopping for a Web application according to an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described in detail below with reference to the accompanying drawings, and it should be understood that the embodiments described below are only for illustrating and explaining the present application and are not intended to limit the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
It should be noted that, if not conflicted, the embodiments and the features of the embodiments can be combined with each other and are within the scope of protection of the present application. Additionally, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
In some embodiments, a computing device executing a method of implementing Web application domain name hopping may include one or more processors (CPUs), input/output interfaces, network interfaces, and memory (memory).
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. The memory may include module 1, module 2, … …, and module N (N is an integer greater than 2).
Computer readable media include both permanent and non-permanent, removable and non-removable storage media. A storage medium may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
Fig. 1 is a schematic structural diagram of an implementation environment according to an embodiment of the present application. As shown in fig. 1, the implementation environment of the present embodiment includes a terminal 11 and an application server 12. Among other things, the terminal 11 may be a terminal including a client 110 (e.g., a browser), such as a mobile phone, a tablet, a desktop, and a notebook. The terminal 11 may be connected to the application server 12 through a wired network or a wireless network, so that the terminal 11 sends a request to the application server 12 and receives information returned by the application server 12. The application server 12 may be one or more high-performance computers or cloud computing centers connected with the terminal 11 through a wired network or a wireless network.
In this embodiment, after a client 110 (for example, a browser) on a terminal 11 receives a Uniform Resource Locator (URL) input or selected by a user, a corresponding network Protocol (IP) address of an application server 12 may be queried from a domain name resolution server, and an access request is sent to the application server 12 according to the IP address of the application server 12 returned by the domain name resolution server, and after the application server 12 receives the access request of the client 110, the application server 12 returns a requested application page and an application code to the client 110; the client 110 may display the application page returned by the application server 12, and implement the method for implementing the Web application domain name hopping provided by the embodiment by running the application code returned by the application server 12.
The method for realizing the domain name hopping of the Web application provided by the embodiment is used for supporting the smooth transition of the Web application between multi-center deployment and single-center deployment. In the Web application deployed in a single center, a URL parameter (for example, a hash parameter or a path parameter) is used to distinguish different areas. For example, for a Web application with a basic domain name xxx. continole. aliyun. com, the hangzhou territory access address of the Web application is xxx. continole. aliyun. com/#/regionId ═ hangzhou; the Shenzhen region access address of the Web application is as follows: xxx. If the Web application needs to access different areas, the regionId information in the URL parameter needs to be changed. In a multi-center deployed Web application, access addresses of different areas are usually represented in a manner of different domain names, for example, when the single-center deployed Web application is extended to a multi-center deployed Web application, the access address of a hangzhou region may be: xxx-hangzhou. console. aliyuun. com, the access address of shenzhen region may be: xxx-shenzhen. As can be seen from the above example, when the Web application is changed from the single-center deployment to the multi-center deployment, because one domain name is changed into a plurality of domain names, there is a problem of conflict with the way of distinguishing different areas by URL parameters when the single-center deployment is performed. According to the method and the device, smooth transition of the Web application between single-center deployment and multi-center deployment is supported by means of compatibility of access modes of the Web application under single-center deployment forms and multi-center deployment forms.
Fig. 2 is a flowchart of a method for implementing domain name hopping for a Web application according to an embodiment of the present application. The method for realizing the Web application domain name hopping of the embodiment is implemented at a client (for example, a browser). As shown in fig. 2, the method of the present embodiment includes the following steps:
step 201: the method comprises the steps of obtaining a URL (uniform resource locator) of a Web application accessed by a client, and analyzing to obtain a first domain name;
step 202: determining a second domain name according to the URL and the regionalized configuration information of the Web application;
step 203: and determining whether to carry out domain name skipping or not according to a comparison result of the first domain name and the second domain name.
The first domain name is obtained by analyzing the acquired access URL, and the second domain name is determined according to the acquired URL and the regionalized configuration information of the Web application. The regionalized configuration information of the Web application is included in the application code returned by the application server.
In some implementations, the regionalized configuration information for the Web application can include at least one of: the method comprises the steps of obtaining a basic domain name of a Web application, a centralization state supported by the Web application, a zone list of the Web application, a regionalization enabling state of each zone in the zone list, and a regionalization domain name of each zone.
When a Web application adopts single-centric deployment, the regionalized configuration information of the Web application may include: the basic domain name of the Web application, the centralization state supported by the Web application (in this case, monocentricization). When a Web application is deployed in a multi-centric manner, the regionalized configuration information of the Web application may include: a centralization state supported by the Web application (in this case, multicentricization), a list of zones of the Web application, a regionalization enabled state for each zone in the list of zones, and a regionalized domain name for each zone. The area list may be used to record area identifications (e.g., numbers or names) of all areas corresponding to the Web application. The regionalization enabled status of each zone is used to indicate whether the zone is configured as a hub (i.e., whether the regionalized domain name for the zone is enabled); the regionalized domain name for each zone is used to indicate the domain name for the zone when the Web application enables multicentric deployment.
It should be noted that, for a region, when the regionalization enabled status of the region indicates that the region is not configured as a center, the regionalized domain name of the region is in the disabled status, and only when the regionalization enabled status of the region indicates that the region is configured as a center, the regionalized domain name of the region is in the enabled status. In some implementations, for a zone, when the regionalization enabled status of the zone indicates that the zone is not configured as a hub, the regionalized domain name for the zone may not be included in the regionalization configuration information. However, the content of the regionalized configuration information of one Web application is not limited in the present application. In an actual application, the regional configuration information of the Web application can be set according to the actual deployment situation of the Web application.
In some implementations, step 202 may include:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentricization and the first domain name of the URL acquired in step 201 can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining that the matched regionalized domain name is a second domain name;
if the Web application supports multicentralization and the URL parameter in the URL acquired in step 201 carries region information, acquiring a domain name corresponding to the region information from the regionalized configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentricization, the first domain name of the URL acquired in step 201 does not match the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, and according to the region information recorded in the client cache, the domain name corresponding to the region information is acquired from the regionalized configuration information of the Web application as the second domain name.
Acquiring the domain name corresponding to the regional information from the regional configuration information of the Web application as the second domain name may include:
in the regionalized configuration information of the Web application, if the regionalized domain name corresponding to the regional information is enabled, the regionalized domain name is confirmed to be a second domain name;
and if the regionalized domain name corresponding to the region information is not enabled, confirming that the basic domain name of the Web application is the second domain name.
In this implementation, when the Web application supports single centralization, the Web application corresponds to only one domain name (i.e., the basic domain name), and it may be determined that the second domain name is the basic domain name. When the Web application supports multi-centralization, the first domain name of the URL and the enabled regionalized domain name in the regionalized configuration information of the Web application can be matched; if the URL parameter is not matched with the domain name, identifying the domain information carried by the URL parameter of the URL, and acquiring the domain name corresponding to the domain information from the regionalized configuration information of the Web application; if the URL parameter of the URL does not carry the domain information, the domain information recorded in the client cache is obtained, and the domain name corresponding to the domain information (for example, the enabled domain name corresponding to the domain information, or the basic domain name of the Web application) is obtained from the regionalization configuration information of the Web application.
Wherein the URL parameter may include at least one of: a hash parameter, a path parameter. Wherein the hash parameter refers to the content after the # identifier in the URL; for example, in the following URLs: www.aliyun.com/#/regionId cn-hangzhou, the hash parameter is: and (4) a region id (cn-hangzhou), namely the hash parameter carries a region identifier, and the region indicated by the region identifier is Hangzhou in China. The path parameter refers to the path portion of a URL, also called pathname; for example, in the following URLs: https:// ecs.console.aliyun.com/detail.html # regionId ═ cn-hangzhou, domain name is ecs.console.aliyun.com; the path parameter is/detail.html; the hash parameter is regionId-cn-hangzhou.
In some implementations, after step 202, the method of this embodiment may further include: and recording the area information in the client cache. When the client is a browser, the client cache can be Cookie. The Cookie is a small text file stored in a browser, and may contain information about the user. For example, a Cookie of the browser records a zone identifier corresponding to the second domain name. In the process of determining the second domain name, corresponding region information can be obtained according to the determined regionalized domain name, or the region information is obtained from a URL parameter, or the region information is obtained according to a previous record; after obtaining the zone information, the zone information (e.g., a zone number or a name) stored in the Cookie may be updated with the zone information for subsequent use in processing the Web application domain name hop, or for use in processing other Web application domain name hops.
In some implementations, step 203 can include:
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping;
and if the first domain name is different from the second domain name, determining to skip according to the second domain name.
If the first domain name and the second domain name are different, the URL to which the jump is to be performed may be determined according to the URL parameter in the URL obtained in step 201 and the second domain name. For example, the URL obtained in step 201 is: console. aliyun. com? query instance1, the second domain name determined in step 202 is: ecs-cn-hang zhhou. console. aliyun. com, it is determined that the URL to which the jump is required is: ecs-cn-hang zhou. console. origin. query. instance 1.
After determining the URL to which the domain name needs to be jumped, the client may query the IP address of the corresponding application server from the domain name resolution server according to the URL, send an access request to the application server according to the IP address of the application server returned by the domain name resolution server, and return an application page and an application code after the application server receives the access request of the client, where, for the same Web application, the application code returned at this time is the same as the application code previously received by the client, and the client may display the application page returned by the application server, and may determine that the domain name is no longer jumped by executing the application code.
The scheme of the present application is explained below by way of an example.
In this example, a cloud server (ecs, Elastic computer Service) application is taken as an example for explanation. The ecs applied regionalized configuration information may include: a base domain name, a supported centralization status, a list of zones, a regionalization enabled status for each zone in the list of zones, a regionalized domain name for each zone.
The region list may be stored by using an array regionList, for example, the regionList is: { regionId: "cn-hangzhou" }, { regionId: "cn-shenzhen" }, { regionId: "ap-nordheast-1" }, { regionId: "ap-souuthast-1" } ], wherein the regionId represents a region identification, and in this example, the regionId may comprise the following four values: ap-nordheast-1 (which may refer to Japan), ap-southeast-1 (which may refer to Singapore), cn-shenzhen (which refers to Shenzhen, China), and cn-hanghzou (which refers to Hangzhou, China).
Wherein the regionalized configuration information (regionSetting) applied by the ecs can be configured to:
Figure BDA0001293153030000111
Figure BDA0001293153030000121
where the "regions" section records whether each region of the ecs application enables a regionalized domain name, and the corresponding regionalized domain name. The open is an open switch bit, and is used to indicate a regionalization enabling state of a region, if "open" is true, it indicates that a regionalization domain name is enabled for the region, otherwise, it indicates that the regionalization domain name is not enabled for the region, and at this time, the domain name corresponding to the region may be a basic domain name.
It should be noted that if the ecs application adopts single-center deployment, the isregistration is false; at this time, the regionalized domain names of the respective regions recorded by the "regions" section are all in an inactive state.
As shown in fig. 3, in this example, a browser accesses esc an application, for example, a user inputs a URL for accessing esc the application in the browser, the browser sends an access request to a corresponding application server, the application server returns an application page and application code to the browser, and the application code returned by the application server is run in the browser to perform the following steps:
301, acquiring a URL accessed by a browser through a tool method provided by the browser, and analyzing to obtain a domain name A;
step 302, judging whether a matched enabled regionalized domain name is found from the regionossetting applied by esc;
it should be noted that, when regionalized domain names matched with regionalized domain names are searched for by regioonsetting, only the regionalized domain names corresponding to "opene" true in "regions" are searched (i.e., matching is performed from the enabled regionalized domain names);
step 303, if the matched enabled regionalized domain name is found, determining the regionalized id information corresponding to the regionalized domain name;
step 304, if the matched enabled regionalized domain name is not found, judging whether the URL obtained in step 301 carries a hash parameter or not, and whether the hash parameter carries a regionId or not;
step 305, if the hash parameter of the URL carries the regionId, acquiring regionId information from the hash parameter;
step 306, if the URL does not carry the hash parameter or the hash parameter does not carry the regionId, acquiring the most recently recorded regionId information from the Cookies of the browser;
the regionId information can be obtained through step 303, step 305 or step 306; then, in step 307, acquiring the domain name B corresponding to the regionId information from regionSetting; in step 308, the regionId information is recorded in Cookies, such as updating the previously recorded regionId information with the regionId information. In step 307, if the corresponding regionalized domain name cannot be obtained according to the regionalid information, the basic domain name applied by esc is obtained.
It should be noted that, the sequence of step 307 and step 308 is not limited in this application, and step 307 is executed before step 308 in fig. 3 as an example. In other implementations, step 308 may be performed prior to step 307, or, alternatively, simultaneously.
Step 309, judging whether the domain name A and the domain name B are the same;
if the domain name A is the same as the domain name B, the domain name challenge is not needed, and the browser is kept on the current page; if the domain name a is not the same as the domain name B, the URL corresponding to the domain name B is skipped (step 310). It should be noted that, if the URL obtained before carries the URL parameter, the URL corresponding to the domain name B includes the domain name B and the URL parameter.
A number of examples are illustrated below based on this example.
In example one, the URL of the esc application obtained in step 301 is: instance, identity, query, instance1, the domain name a is obtained as: cs, console, aliyun, com; according to the regionsmitting, the domain name a does not match the enabled regionalized domain name, and the URL does not carry the regionsid, so that the most recently recorded regionsid information can be obtained from the browser Cookies, for example, if the regionsid recorded by the Cookies is cn-hangzhou, the regionalized domain name enabled by the cn-hangzhou can be known according to the regionsmitting, and thus, the domain name B can be determined as: ecs-cn-hang zhhou. console. aliyun. com. In this example, domain name a and domain name B are different, and the final jump URL may be determined as: ecs-cn-hang zhou. console. origin. query. instance 1.
In example two, the URL of the ecs application obtained in step 301 is: instance, identity, query, instance1, the domain name a is obtained as: cs, console, aliyun, com; according to the regionsmitting, the domain name a is not matched with the enabled regionalized domain name, and the URL does not carry the regionsid, so that the most recently recorded regionsid information can be obtained from the browser Cookies, for example, if the regionsid recorded by the Cookies is ap-southeaast-1, the non-enabled regionalized domain name of ap-southeast-1 can be known according to the regionsmitting, and accordingly, the domain name B can be determined to be ecs.content.aliyun.com; in this example, domain name B is the same as domain name a, and does not perform domain name hopping.
In example three, the URL obtained in step 301 is: ecs-ap-norheatast-1. console. aliyun. com, the domain name a is obtained as: ecs-ap-northast-1. console. aliyun. com; according to the regionsmitting, the domain name a may be matched to the regionalized domain name enabled by "ap-normal-1", and accordingly, the domain name B may be determined to be the regionalized domain name enabled by "ap-normal-1", that is: ecs-ap-northast-1. console. In this example, domain name B is the same as domain name a, and no domain name hopping is performed.
In example four, the URL of the application obtained ecs in step 301 is: console. aliyun. com/#/regionId ═ cn-hangzhou, the domain name a is obtained as: cs, console, aliyun, com; according to the regionsmitting, the domain name a does not match the enabled regionalized domain name, but the URL carries a regionId, and the regionId is cn-hangzhou; at this time, it can be known that the cn-hangzhou has enabled the regionalized domain name according to regionSetting, and accordingly, it can be determined that the domain name B is: ecs-cn-hang zhhou. console. aliyun. com. In this example, the domain name a and the domain name B are different, and it can be determined that the final jump URL is: ecs-cn-hangzhhou. console. aliyun. com/#/regionId ═ cn-hangzhhou, or ecs-cn-hangzhhou. console. aliyun. com.
An embodiment of the present application further provides a device for implementing domain name hopping for a Web application, and as shown in fig. 4, the device provided in this embodiment includes:
the first domain name determining module 401 is configured to obtain a URL of a Web application accessed by a client, and analyze the URL to obtain a first domain name;
a second domain name determining module 402, configured to determine a second domain name according to the URL and the regionalized configuration information of the Web application;
a skipping control module 403, configured to determine whether to skip the domain name according to a comparison result between the first domain name and the second domain name.
The apparatus provided in this embodiment may be applied to a client (e.g., a browser), and the implementation environment of the apparatus of this embodiment may be described with reference to fig. 1, so that details are not described herein.
Wherein the regionalized configuration information of the Web application may include at least one of: the method comprises the steps of obtaining a basic domain name of a Web application, a centralization state supported by the Web application, a zone list of the Web application, a regionalization enabling state of each zone in the zone list, and a regionalization domain name of each zone.
The second domain name determining module 402 may be configured to determine the second domain name according to the URL and the regionalized configuration information of the Web application in the following manner:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentricization and the first domain name of the URL acquired by the first domain name determining module 401 can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining that the matched regionalized domain name is a second domain name;
if the Web application supports multicentricization and the URL parameter in the URL acquired by the first domain name determining module 401 carries region information, acquiring a domain name corresponding to the region information from the regionalized configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentricization, the first domain name of the URL acquired by the first domain name determining module 401 does not match the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, acquiring a domain name corresponding to the region information from the regionalized configuration information of the Web application as a second domain name according to the region information recorded in the client cache.
The second domain name determining module 402 may be configured to obtain, as the second domain name, the domain name corresponding to the area information from the regionalized configuration information of the Web application in the following manner:
in the regionalized configuration information of the Web application, if the regionalized domain name corresponding to the regional information is enabled, the regionalized domain name is confirmed to be a second domain name;
and if the regionalized domain name corresponding to the region information is not enabled, confirming that the basic domain name of the Web application is the second domain name.
The apparatus provided in this embodiment may further include: a recording module 404, configured to record the region information in the client cache.
The skipping control module 403 may be configured to determine whether to skip the domain name according to a comparison result between the first domain name and the second domain name in the following manner:
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping;
and if the first domain name is different from the second domain name, determining to skip according to the second domain name.
For the related description of the present embodiment, reference may be made to the description of the embodiment shown in fig. 2, and therefore, the description thereof is omitted here.
An embodiment of the present application further provides a device, including: a memory and a processor; the memory is used for storing a program for realizing Web application domain name jumping; when being read and executed by a processor, the program for realizing Web application domain name jumping executes the following operations:
the method comprises the steps of obtaining a URL (uniform resource locator) of a Web application accessed by a client, and analyzing to obtain a first domain name; determining a second domain name according to the URL and the regionalized configuration information of the Web application; and determining whether to carry out domain name skipping or not according to a comparison result of the first domain name and the second domain name.
Wherein the regionalized configuration information of the Web application may include at least one of: the method comprises the steps of obtaining a basic domain name of a Web application, a centralization state supported by the Web application, a zone list of the Web application, a regionalization enabling state of each zone in the zone list, and a regionalization domain name of each zone.
Determining the second domain name according to the URL and the regionalized configuration information of the Web application may include:
if the Web application supports single centralization, determining that the basic domain name of the Web application is a second domain name;
if the Web application supports multicentralization and the first domain name of the acquired URL can be matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, determining the matched regionalized domain name as a second domain name;
if the Web application supports multicentralization and the URL parameter in the obtained URL carries region information, acquiring a domain name corresponding to the region information from the regional configuration information of the Web application as a second domain name according to the region information carried by the URL parameter;
if the Web application supports multicentricization, the first domain name of the acquired URL is not matched with the enabled regionalized domain name in the regionalized configuration information of the Web application, and the URL parameter of the URL does not carry region information, the domain name corresponding to the region information is acquired from the regionalized configuration information of the Web application as a second domain name according to the region information recorded in the cache of the client.
In this embodiment, when the program for implementing the domain name hopping of the Web application is read and executed by the processor, the operations executed correspond to steps 201 to 203 in the embodiment shown in fig. 2; further details of the operations performed by the program may be found in the method embodiments described above.
In addition, a computer-readable medium is provided in an embodiment of the present application, and a plurality of instructions are stored, and when executed by one or more processors, the method for implementing domain name hopping for a Web application is implemented.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by a program instructing associated hardware (e.g., a processor) which may be stored in a computer readable medium such as a read only memory, a magnetic or optical disk, etc. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Accordingly, the modules/units in the above embodiments may be implemented in hardware, for example, by an integrated circuit, or may be implemented in software, for example, by a processor executing programs/instructions stored in a memory to implement the corresponding functions. The present application is not limited to any specific form of hardware or software combination.
The foregoing shows and describes the general principles and features of the present application, together with the advantages thereof. The present application is not limited to the above-described embodiments, which are described in the specification and drawings only to illustrate the principles of the application, but also to provide various changes and modifications within the spirit and scope of the application, which are within the scope of the claimed application.

Claims (12)

1. A method for realizing webpage application domain name skip is characterized by comprising the following steps:
acquiring a uniform resource locator of a webpage application accessed by a client, and analyzing to obtain a first domain name;
determining a second domain name according to the uniform resource locator and the regionalized configuration information of the webpage application;
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping; if the first domain name is different from the second domain name, determining to skip according to the second domain name;
wherein the regionalized configuration information of the web application includes at least one of: the web application comprises a basic domain name of the web application, a centralization state supported by the web application, a zone list of the web application, a regionalization enabling state of each zone in the zone list, and a regionalization domain name of each zone.
2. The method of claim 1, wherein determining the second domain name according to the uniform resource locator and the regionalized configuration information of the web application comprises:
if the webpage application supports single centralization, determining that the basic domain name of the webpage application is a second domain name;
if the web application supports multicentricization and the first domain name of the uniform resource locator can be matched with the enabled regionalized domain name in the regionalized configuration information of the web application, determining the matched regionalized domain name as a second domain name;
if the web application supports multicentralization and the uniform resource locator parameter of the uniform resource locator carries area information, acquiring a domain name corresponding to the area information from the regional configuration information of the web application as a second domain name according to the area information carried by the uniform resource locator parameter;
if the web application supports multicentricization, the first domain name of the uniform resource locator is not matched with the enabled regionalized domain name in the regionalized configuration information of the web application, and the uniform resource locator parameter of the uniform resource locator does not carry region information, the domain name corresponding to the region information is obtained from the regionalized configuration information of the web application as a second domain name according to the region information recorded in the cache of the client.
3. The method according to claim 2, wherein the obtaining, from the regionalized configuration information of the web application, a domain name corresponding to the region information as a second domain name includes:
in the regionalization configuration information of the web application, if a regionalization domain name corresponding to the regional information is enabled, determining that the regionalization domain name is a second domain name; and if the regionalized domain name corresponding to the regional information is not enabled, confirming that the basic domain name of the webpage application is the second domain name.
4. The method of claim 2, wherein the uniform resource locator parameter comprises at least one of: hash parameters, path parameters.
5. The method of claim 2, wherein after determining the second domain name, the method further comprises: and recording the area information in the client cache.
6. An apparatus for implementing domain name hopping for web applications, comprising:
the first domain name determining module is used for acquiring a uniform resource locator of a webpage application accessed by a client and analyzing to obtain a first domain name;
the second domain name determining module is used for determining a second domain name according to the uniform resource locator and the regionalized configuration information of the webpage application;
wherein the regionalized configuration information of the web application includes at least one of: a base domain name of the web application, a centralization state supported by the web application, a region list of the web application, a regionalization enabling state of each region in the region list, and a regionalization domain name of each region;
a skip control module, configured to determine whether to perform domain name skip according to a comparison result between the first domain name and the second domain name, where the skip control module is configured to: if the first domain name is the same as the second domain name, determining not to carry out domain name skipping; and if the first domain name is different from the second domain name, determining to skip according to the second domain name.
7. The apparatus of claim 6, wherein the second domain name determining module is configured to determine the second domain name according to the uniform resource locator and the regionalized configuration information of the web application by:
if the webpage application supports single centralization, determining that the basic domain name of the webpage application is a second domain name;
if the web application supports multicentricization and the first domain name of the uniform resource locator can be matched with the enabled regionalized domain name in the regionalized configuration information of the web application, determining the matched regionalized domain name as a second domain name;
if the web application supports multicentralization and the uniform resource locator parameter of the uniform resource locator carries area information, acquiring a domain name corresponding to the area information from the regional configuration information of the web application as a second domain name according to the area information carried by the uniform resource locator parameter;
if the web application supports multicentricization, the first domain name of the uniform resource locator is not matched with the enabled regionalized domain name in the regionalized configuration information of the web application, and the uniform resource locator parameter of the uniform resource locator does not carry region information, the domain name corresponding to the region information is obtained from the regionalized configuration information of the web application as a second domain name according to the region information recorded in the cache of the client.
8. The apparatus according to claim 7, wherein the second domain name determining module is configured to obtain a domain name corresponding to the region information as the second domain name from the regionalization configuration information of the web application in the following manner:
in the regionalization configuration information of the web application, if a regionalization domain name corresponding to the regional information is enabled, determining that the regionalization domain name is a second domain name; and if the regionalized domain name corresponding to the regional information is not enabled, confirming that the basic domain name of the webpage application is the second domain name.
9. The apparatus of claim 7, further comprising: and the recording module is used for recording the area information in the client cache.
10. An apparatus for implementing domain name hopping for web applications, comprising: a memory and a processor; the memory is used for storing a program for realizing webpage application domain name jumping; when the program for realizing the webpage application domain name jump is read and executed by the processor, the following operations are executed:
acquiring a uniform resource locator of a webpage application accessed by a client, and analyzing to obtain a first domain name;
determining a second domain name according to the uniform resource locator and the regionalized configuration information of the webpage application;
if the first domain name is the same as the second domain name, determining not to carry out domain name skipping; if the first domain name is different from the second domain name, determining to skip according to the second domain name;
wherein the regionalized configuration information of the web application includes at least one of: the web application comprises a basic domain name of the web application, a centralization state supported by the web application, a zone list of the web application, a regionalization enabling state of each zone in the zone list, and a regionalization domain name of each zone.
11. The apparatus of claim 10, wherein the determining a second domain name according to the uniform resource locator and the regionalized configuration information of the web application comprises:
if the webpage application supports single centralization, determining that the basic domain name of the webpage application is a second domain name;
if the web application supports multicentricization and the first domain name of the uniform resource locator can be matched with the enabled regionalized domain name in the regionalized configuration information of the web application, determining the matched regionalized domain name as a second domain name;
if the web application supports multicentralization and the uniform resource locator parameter of the uniform resource locator carries area information, acquiring a domain name corresponding to the area information from the regional configuration information of the web application as a second domain name according to the area information carried by the uniform resource locator parameter;
if the web application supports multicentricization, the first domain name of the uniform resource locator is not matched with the enabled regionalized domain name in the regionalized configuration information of the web application, and the uniform resource locator parameter of the uniform resource locator does not carry region information, the domain name corresponding to the region information is obtained from the regionalized configuration information of the web application as a second domain name according to the region information recorded in the cache of the client.
12. A computer-readable medium storing a plurality of instructions which, when executed by one or more processors, implement a method of implementing a web application domain name hopping as claimed in any one of claims 1 to 5.
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 CN108881501A (en) 2018-11-23
CN108881501B true 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 (6)

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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012061243A1 (en) * 2010-11-05 2012-05-10 Citrix Systems, Inc. Systems and methods for managing domain name system security (dnssec)
CN103023787B (en) * 2011-09-26 2016-01-20 百度在线网络技术(北京)有限公司 Data center systems and device and the method for service is provided
CN104170356B (en) * 2013-12-30 2017-11-24 华为技术有限公司 A kind of method and apparatus for handling domain name request
CN105072211B (en) * 2015-08-12 2018-11-02 网宿科技股份有限公司 Domain name deployment system based on DNS and method

Patent Citations (6)

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

Also Published As

Publication number Publication date
CN108881501A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN110149423B (en) Domain name processing method and device, readable storage medium and electronic equipment
US10033818B2 (en) Using listen ranges to deliver content to electronic devices from local caching servers
CN106202547B (en) Site management method and device and website system
CN108268609B (en) File path establishing and accessing method and device
CN107181686B (en) Method, device and system for synchronizing routing table
CN103064989B (en) Webpage preservation, deployment method and device
CN107291759B (en) Method and device for processing browser page resources
CN104580540B (en) The implementation method and device of website visiting
US8799518B2 (en) Process for selecting an authoritative name server
CN107038194B (en) Page jump method and device
CN106817388B (en) Method and device for acquiring data by virtual machine and host machine and system for accessing data
CN112954043B (en) Method for identifying user based on website access log and computer equipment
CN104268229A (en) Resource obtaining method and device based on multi-process browser
CN109634753B (en) Data processing method, device, terminal and storage medium for switching browser kernels
CN102761628A (en) Pan-domain name identification and processing device and method
JP2018515845A (en) Method and apparatus for recording and restoring click position on web page
JP6779307B2 (en) Method and device for page display
CN110933193B (en) Domain name resolution method and device, electronic equipment and computer readable storage medium
CN109710832B (en) Method and equipment for searching hosted program
CN107704464B (en) Method and device for analyzing path of static resource
US20120209804A1 (en) Method and apparatus for managing content in a processing device
CN108881501B (en) Method and device for realizing webpage application domain name skip
CN106919595B (en) Cookie mapping method and device and electronic equipment
CN110830492B (en) Method and system for mutually scheduling edge applications based on CoreDNS registration service
CN111797334A (en) Website access method and device, electronic equipment and storage medium

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