CN110149423B - Domain name processing method and device, readable storage medium and electronic equipment - Google Patents

Domain name processing method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN110149423B
CN110149423B CN201910601459.XA CN201910601459A CN110149423B CN 110149423 B CN110149423 B CN 110149423B CN 201910601459 A CN201910601459 A CN 201910601459A CN 110149423 B CN110149423 B CN 110149423B
Authority
CN
China
Prior art keywords
domain name
accessed
file
address
configuration file
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
CN201910601459.XA
Other languages
Chinese (zh)
Other versions
CN110149423A (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.)
Shenzhen Zhenai Jieyun Information Technology Co ltd
Original Assignee
Shenzhen Zhenai Jieyun Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhenai Jieyun Information Technology Co ltd filed Critical Shenzhen Zhenai Jieyun Information Technology Co ltd
Priority to CN201910601459.XA priority Critical patent/CN110149423B/en
Publication of CN110149423A publication Critical patent/CN110149423A/en
Application granted granted Critical
Publication of CN110149423B publication Critical patent/CN110149423B/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/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/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a domain name processing method, a domain name processing device, a readable storage medium and electronic equipment, and belongs to the technical field of networks, and the application comprises the following steps: acquiring a webpage access request for switching a page, wherein the webpage access request carries a domain name to be accessed and target environment information; determining an IP address to be accessed corresponding to the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the IP address corresponding to the domain name to be accessed under at least one environment information; and switching the page to the page corresponding to the IP address to be accessed according to the webpage access request. Through the method and the device, the access webpage is switched under multiple environments, and the related operation of manually changing the Host file is not required to be executed, so that the operation amount can be effectively reduced, the operation flow is simpler and more convenient, and the access efficiency of the webpage under multiple environments is promoted.

Description

Domain name processing method and device, readable storage medium and electronic equipment
Technical Field
The application belongs to the technical field of networks, and particularly relates to a domain name processing method, a domain name processing device, a readable storage medium and electronic equipment.
Background
Before a web page is formally online, the web page needs to be deployed in various environments, such as a development environment, a test environment, and a pre-release environment. In different environments, the IP addresses corresponding to the domain names of the web pages are different, for example, the IP address corresponding to the domain name a of the web page in the development environment is B1, the IP address corresponding to the domain name a in the test environment is B2, and the IP address corresponding to the domain name a in the pre-release environment is B3. In actual service development, a tester needs to frequently switch various environments to perform webpage test operation, for example, to switch back and forth among a development environment, a test environment and a pre-release environment to perform webpage test, and the problem exists that the tester needs to modify a local Host file to modify domain name direction every time the local Host file is switched to realize directional access to a webpage under the environment to be switched.
Disclosure of Invention
In order to overcome the problems in the related art at least to a certain extent, the application provides a domain name processing method, a domain name processing device, a readable storage medium and electronic equipment, which are beneficial to improving the access efficiency of web pages in various environments.
In order to achieve the purpose, the following technical scheme is adopted in the application:
in a first aspect,
the application provides a domain name processing method, which is applied to a webpage client and comprises the following steps:
acquiring a webpage access request for switching a page, wherein the webpage access request carries a domain name to be accessed and target environment information;
determining an IP address to be accessed corresponding to the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the IP address corresponding to the domain name to be accessed under at least one type of environment information;
and switching the page to the page corresponding to the IP address to be accessed according to the webpage access request.
In a second aspect of the present invention,
the application provides a domain name processing device, including:
the first acquisition module is used for acquiring a webpage access request for switching a page, wherein the webpage access request carries a domain name to be accessed and target environment information;
the determining module is used for determining the IP address to be accessed corresponding to the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the IP address corresponding to the domain name to be accessed under at least one environment information;
and the switching module is used for switching the page to the page corresponding to the IP address to be accessed according to the webpage access request.
In a third aspect of the present invention,
the present application provides a readable storage medium having stored thereon an executable program which when executed by a processor implements the steps of the method described above.
In a fourth aspect of the present invention,
the application provides an electronic device, including:
a memory having an executable program stored thereon;
a processor for executing the executable program in the memory to implement the steps of the method described above.
This application adopts above technical scheme, possesses following beneficial effect at least:
according to the method, the webpage under the target environment information is automatically accessed by acquiring the webpage access request for switching the webpage, directionally pointing the domain name to be accessed to the IP address corresponding to the target environment information according to the domain name configuration file by utilizing the target environment information and the domain name to be accessed carried by the webpage access request, and switching the webpage to the page corresponding to the IP address to be accessed according to the webpage access request; meanwhile, through the domain name configuration file, in practical application, a domain name resolution server does not need to be configured, and the operation and maintenance cost is further reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a domain name processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a domain name processing method according to another embodiment of the present application;
fig. 3 is a schematic flowchart of a domain name processing method according to another embodiment of the present application;
fig. 4 is a schematic flowchart of a domain name processing method according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a domain name processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic flowchart of a domain name processing method according to an embodiment of the present application, and this embodiment is described by taking an execution example at a web client side, as shown in fig. 1, the domain name processing method includes the following steps:
step S101, acquiring a webpage access request for switching a page, wherein the webpage access request carries a domain name to be accessed and target environment information;
step S102, determining a corresponding IP address to be accessed of the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the corresponding IP address of the domain name to be accessed under at least one environment information;
and step S103, switching the page to a page corresponding to the IP address to be accessed according to the webpage access request.
In the above embodiment, for example, before the web page is formally online, the web page needs to be deployed in multiple environments for testing, and the environment information may include a development environment, a testing environment, and a pre-release environment. Under different environments, the IP addresses corresponding to the domain names of the web pages are different, for example, the IP address corresponding to the domain name a of the web page under the development environment is B1, the IP address corresponding to the domain name a under the test environment is B2, and the IP address corresponding to the domain name a under the pre-release environment is B3. In actual service development, a tester needs to switch various environments frequently to perform webpage test operation under the three environments, for example, if the tester needs to access a webpage of a webpage domain name a in a development environment, the tester needs to select the development environment as target environment information.
For the web page access, in the related technology, when a user inputs a website to be logged in a browser, a system automatically searches a corresponding IP address from a Host file at first, once the website is found, the system immediately opens the corresponding webpage, and if the website is not found, the system submits the website to a DNS domain name resolution server for IP address resolution. The Host file is a database which establishes a correlation between the website domain name and the corresponding IP address, only domain name configuration data under one type of environment information is stored in the Host file for a certain domain name, and the Host file does not have the function of automatic directional access according to the application environment for the application of webpage access under multiple environments. Therefore, when the environment is switched, a tester is required to manually modify the local Host file to modify the domain name direction, so as to realize the targeted access of the webpage in the target environment. For example, the IP address corresponding to the domain name a of the web page recorded in the current local Host file is B1, which indicates that the IP address of the domain name a in the development environment is stored in the local Host file record, so if the tester does not modify the local Host file, and inputs the website of the domain name a, the browser accesses the web page in the development environment according to the local Host file. If a tester wants to access a webpage under a pre-release environment, the tester needs to modify a local Host file, modify an IP address corresponding to a domain name A of the webpage into B3, then save the local Host file, and then manually refresh a DNS cache of a browser to enable the local Host file to be effective, so that the tester can access the webpage under the pre-release environment. Although the workload of Host file modification is not large, the Host file modification has a large number of times of survivability, and often, before a webpage is formally online, a tester needs to switch environments for a large number of times (for example, thousands of times) to test the webpage in various environments, so that the access efficiency of the webpage in various environments is low, the operation process of the tester is complicated, and the tester feels very inconvenient.
In the embodiment of the application, the domain name configuration file includes domain name configuration data under various environment information, such as domain name configuration data under respective environments of a development environment, a test environment and a pre-release environment, and after acquiring target environment information and a domain name selected by a user, a web client can directionally point the domain name to an IP address corresponding to the target environment information by using the domain name configuration file. The domain name configuration data under various environment information included in the domain name configuration file can reflect the corresponding relationship between the environment information and the domain name-IP address, for example, taking the domain name configuration data of the domain name a under three environments of a development environment, a test environment and a pre-release environment as an example, the domain name configuration data can be embodied in the following form:
development environment-domain name a-IP address: b1;
test environment-domain name a-IP address: b2; and
pre-publishing context-domain name a-IP address: B3.
the environment information is not limited to be represented in the text format of the development environment, the test environment and the pre-release environment in the specific application, and the text format is also used for facilitating the understanding of the scheme of the application. In practical applications, the environment information may also be embodied in other forms, such as a character form of numbers, letters, and the like, and various environments may be distinguished.
Similarly, in practical application, the data form of the domain name configuration data under various environment information in the domain name configuration file can also be embodied in a form of supporting regular matching, so that the IP address corresponding to the domain name to be accessed under the target environment information can be determined in a regular expression mode.
In combination with the above specific embodiments of the domain name configuration file, the present application specifically explains the scheme of the domain name processing method according to the present application through specific application scenarios.
In practical applications, the web page client can be implemented by an Electron framework. The loading of the network resources is realized through the Electron frame, the functions of a web browser can be realized, and the functions of the web browser can be expanded more than those of the browser by means of the Nodejs capability of the main process and the system bottom layer authority higher than that of the browser. The electronic framework has the advantage of cross-platform development, the webpage client side is achieved through the electronic framework, cross-MacOS, windows and other platform applications can be generated through configuration, and a user interface with consistent experience and function can be built. The webpage client developed through the Electron frame can set function items such as address bar, favorite and environment selection commonly used by a browser on an application interface, and realizes the webpage browsing function of a specified URL through a < webview/> component of the Electron. In a specific application, if a tester wants to access a webpage of a domain name a in a pre-release environment, the following related operations may be performed: selecting a pre-publishing environment as a target environment, inputting a website including a domain name A, clicking to confirm, and generating a webpage access request by a webpage client according to the pre-publishing environment and the website of the domain name A, wherein the webpage access request carries the pre-publishing environment and the domain name A. According to the webpage access request, the IP address corresponding to the domain name A in the target environment of the pre-release environment is determined to be B3 through the domain name configuration file, the domain name is directionally pointed to the IP address corresponding to the target environment information through the domain name configuration file, and finally the page is switched to the page corresponding to the IP address B3 for access according to the webpage access request, so that the webpage under the target environment information is automatically accessed.
Through the description of the multi-environment webpage access, by means of the embodiment of the application, the webpage is switched and accessed under the multi-environment, only the domain name website is input and the target environment information is selected, the webpage corresponding to the IP address under the target environment information can be switched and accessed, and a series of related operations for manually changing the Host file are not needed, so that the operation amount can be effectively reduced, the operation process is simpler and more convenient, and the webpage access efficiency under various environments is improved.
Meanwhile, the domain name configuration file in the page client side is utilized, the domain name can be directionally pointed to the IP address corresponding to the target environment information, and the automatic access to the webpage under the target environment information is achieved. According to the scheme of the embodiment, when the webpage client for multi-environment switching is developed, the domain name configuration file can replace a Host file, a domain name resolution server does not need to be configured, and caching in the domain name processing step process is achieved through the domain name configuration file. In practical application, the operation and maintenance cost can be effectively reduced, and meanwhile, the safety problems of domain name resolution cache, performance, domain name hijack and the like in the domain name resolution server are avoided.
Fig. 2 is a schematic flowchart of a domain name processing method according to another embodiment of the present application, and similarly, this embodiment is described by taking an execution example at a web client side as an example, as shown in fig. 2, the domain name processing method includes the following steps:
step S201, intercepting a webpage access request for switching a webpage through a preset proxy service; acquiring a webpage access request forwarded by proxy service;
step S202, acquiring a domain name to be accessed and target environment information from a webpage access request forwarded by a proxy service; when the domain name to be accessed is detected to exist in the domain name configuration file, determining the IP address to be accessed corresponding to the domain name to be accessed under the target environment information through the domain name configuration file;
step S203, when the IP address to be accessed is determined, forwarding the IP address to be accessed through proxy service; acquiring an IP address to be accessed forwarded by the proxy service; and switching the page to the page corresponding to the IP address to be accessed forwarded by the proxy service according to the webpage access request.
In the above embodiment, for the web page access request, in practical applications, for example, when the web page client is a client applied to a computer, an application interface of the web page client is provided with an environment information selection item and a web page address bar, a user selects target environment information on the application interface, inputs a website of a domain name to be accessed in the web page address bar on the application interface, and clicks an enter key, so that a corresponding web page access request is formed, where the web page access request carries the domain name to be accessed and the target environment information.
In practical application, the application can be developed by using the existing browser, and the scheme of the application is applied. For the existing browser, under a free webpage access mechanism, a corresponding IP address is firstly searched from a Host file when a webpage is accessed, and once the corresponding IP address is found, the system immediately opens the corresponding webpage. Therefore, when the application is applied to the existing browser and multi-environment switching is performed to access the web page, the corresponding IP address needs to be searched from the Host file in the existing browser first, and therefore, the solution provided by the application embodiment intercepts the web page access request through the preset proxy service and avoids searching the corresponding IP address from the Host file when the multi-environment switching is performed to access the web page. In the practical application of the webpage client, when a webpage access request is generated, the webpage access request is intercepted through a preset proxy service, the webpage access request does not pass through a Host file, meanwhile, the webpage access request is forwarded by the proxy service, the webpage access request forwarded by the proxy service is obtained, a domain name to be accessed and target environment information are obtained, and then according to a domain name configuration file, an IP address to be accessed corresponding to the domain name to be accessed under the target environment information is determined from the corresponding relation between the domain name and the IP address under various environment information configured by the domain name configuration file.
Taking the example that the web page needs to be deployed in various environments for testing before being formally online, the environment information may include a development environment, a test environment, and a pre-release environment. The testing under each environmental information may be performed under an intranet or an extranet, for example, for some enterprises, in the application in the enterprise lan, a separate intranet DNS server needs to be built, and the intercepting DNS resolution is configured to direct the intercepting DNS resolution to a specified internal service IP. The problem exists that separately building a DNS server increases the enterprise operation cost, and at the same time, the DNS configuration needs to be changed again each time the service IP is migrated and updated, and the DNS configuration does not become effective immediately due to the multi-level caching. However, if the DNS server of the external network is used, security problems such as domain name hijacking by the network operator of the external network are easily encountered. By utilizing the scheme of the embodiment of the application, the IP address corresponding to the domain name to be accessed under the target environment information is determined by utilizing the domain name configuration file through intercepting the domain name access request, so that the establishment of a domain name resolution scheme under multiple environments can be avoided, and further the safety problems of the domain name resolution such as cache, performance, domain name hijacking and the like in the DNS are avoided. In a scenario where a user needs to frequently switch domain name resolution, the DNS cache hit rate is not high, and a full link query is performed again for each new resolution, which causes a performance problem in a network request to a certain extent.
The method comprises the steps of intercepting and forwarding a webpage access request based on the use of proxy service, obtaining a domain name to be accessed and target environment information from the webpage access request forwarded by the proxy service, and when the domain name to be accessed is detected to be in a domain name configuration file, indicating that the corresponding IP address of the domain name to be accessed under at least one type of environment information is configured in the domain name configuration file, namely determining the corresponding IP address to be accessed of the domain name to be accessed under the target environment information from the corresponding relation between the domain name and the IP address under various types of environment information configured by the domain name configuration file.
When the IP address to be accessed is determined, the IP address to be accessed is forwarded by using the proxy service agent, for example, a built-in browser of the webpage client can be realized by Webview, the proxy service agent forwards the IP address to be accessed to the Webview, and after the Webview acquires the IP address to be accessed forwarded by the proxy service, the Webview switches the page to the page corresponding to the IP address to be accessed forwarded by the proxy service according to the webpage access request.
Fig. 3 is a schematic flowchart of a domain name processing method according to another embodiment of the present application, and as shown in fig. 3, the domain name processing method further includes a step of configuring a file, including:
step S301, obtaining a domain name file configured by a user in a customized manner to obtain a customized domain name configuration file group; acquiring a public domain name configuration file pre-stored in an appointed remote end to obtain a public domain name configuration file group; acquiring a Host file under each platform to obtain a Host configuration file group;
step S302, generating a corresponding domain name configuration file according to the obtained file groups.
The above embodiment provides a scheme for generating a domain name profile, in which domain name configuration data under various environment information of the domain name profile can be derived from three aspects: the user-defined public domain name configuration file pre-stored in the appointed remote end and the Host file under each platform. The method and the device have the advantages that various sources of domain name configuration data under various environmental information are beneficial to enabling the method and the device to be suitable for different grouped complex scenes, and the unified and rapid switching of domain names in different grouped complex scenes is supported. In practical application, the customized domain name configuration file group is obtained by user customization; the public domain name profile groupings may be formed by a team or enterprise's public DNS resolution profiles; the Host configuration file groups can be formed by Host files under different application platforms.
The file source of each aspect may form a corresponding file group, and the following describes the three file groups in detail.
Specifically, for the customized domain name configuration file grouping, a user can perform customized configuration on domain name configuration data under various environmental information by using a preset template format according to actual webpage access requirements. In a specific application, the customized domain name profile packet may include at least one packet data, for example, each packet data may include: group id (id), group name (name), whether active (active) is enabled, weight (weight), and group domain name list (domains). The packet name may be represented as context information, and one packet data is represented as domain name configuration data in one context information. For each group domain name list, a plurality of "IP-domain names, or domain name regular expression" key value pairs may be included, wherein, by using the domain name regular expression, the domain name resolution of the customized domain name profile group may support regular matching. In specific application, each packet data in the customized domain name configuration file packet can be serialized into JSON data, and then further merged with other file packets and stored in a memory.
Specifically, the common domain name profile group may be formed by various common domain name profiles, where a common domain name resolution profile may refer to a domain name profile in which all web pages point to the same IP address in multiple environments, for example, a domain name of a certain web page points to the same IP address in a test environment and a pre-release environment. In specific application, public domain name resolution configuration files in an enterprise or a team can be stored in a designated remote end for sharing, for example, the public domain name resolution configuration files can be stored in a CDN server in a JSON form, a webpage client acquires the public domain name resolution configuration files by accessing the designated remote end to form a public domain name configuration file group, and then the public domain name resolution configuration file group is combined with other file groups to form a domain name configuration file, so that the method is not only beneficial to enabling the application to be suitable for complex scenes of different groups, but also beneficial to realizing the purpose of utilizing the existing public domain name configuration files to quickly access webpages; meanwhile, the public domain name configuration file is combined into the domain name configuration file, so that the application of an internal network request does not depend on DNS service, the DNS server is not required to be built, the operation and maintenance cost is fully reduced, and the problem of hijacking of the domain name of an external network is avoided.
Specifically, for the grouping of the Host configuration files, in a specific application, taking a web client developed by an Electron frame as an example, the application across platforms such as MacOS and windows can be realized, the web client developed by the Electron frame can detect the positions of the Host files under different platforms by means of nodjs capabilities, after the application is initialized, the Host files under each platform are read, all current Host files are identified, each Host file can show the corresponding relationship between a domain name and an IP address under the environment information, the grouping of the Host configuration files is formed by the Host files under different platforms, and then the grouping is combined with other file groups to form the domain name configuration files.
In one embodiment, for step S302, generating a corresponding domain name configuration file according to the generated file group includes: when the obtained file groups have at least two types, combining the file groups to generate a corresponding domain name configuration file, wherein the combining comprises: when the configuration data of the same domain name exists in different file groups, the priority attribute corresponding to each file group is obtained, the obtained priority attribute indicates the file group with the highest level, and the configuration data of the same domain name in the file group with the highest level is merged.
In a specific application, the scheme solves the merging problem of configuration data of the same domain name in different file groups through the priority attribute of each file group, wherein the priority attribute of each file group represents the priority of the use of the domain name configuration data of the file group, for example, the self-defined domain name configuration file group and the Host configuration file group both have the configuration data of the domain name a, and if the priority attribute of the self-defined domain name configuration file group is higher than the priority attribute of the Host configuration file group, the use priority level of the configuration data of the domain name a in the self-defined domain name configuration file group is higher than the use priority level of the configuration data of the domain name a in the Host configuration file group. Furthermore, when various file grouping data are combined to form a domain name configuration file, the domain name configuration data of the same domain name of the file grouping with the highest priority are selected to be combined, so that the optimization of the domain name configuration file data can be realized, the elimination of interference data is realized in a certain sense, and the accuracy of webpage access is ensured.
Fig. 4 is a schematic flowchart of a domain name processing method according to another embodiment of the present application, and as shown in fig. 4, the domain name processing method further includes the following steps:
step S401, when detecting that the domain name configuration file changes, acquiring updated grouping configuration information of the domain name configuration file;
and step S402, updating the domain name configuration file according to the updated grouping configuration information.
By the scheme of the embodiment, the real-time updating of the domain name configuration file can be realized. The change of the domain name configuration file in the above embodiment scheme may include the following situations:
adding, deleting or modifying data of one or more file groups; and/or the presence of a gas in the gas,
updating one or more file groups according to a preset time interval;
wherein, for modifying the data of one or more file groups, the following situations can be included:
modifying the state of one or more groups of data in the customized domain name profile grouping, wherein the state comprises the following steps: enabled or disabled; and/or the presence of a gas in the gas,
when the file grouping is various, the priority attributes of various file groupings are modified.
The above mentioned various changes of the domain name configuration file form corresponding grouping configuration information after storage, which is further explained by specific application.
Taking the customized domain name profile packet as an example, the customized domain name profile packet may include at least one group of data, and each group of data may represent various domain name profile data in an environment, for example, each group of data may include: packet id (id), packet name (name), whether active is enabled (active), weight (weight), and packet domain name list (domains), etc. The user can add one or more sets of data according to the requirement. The user can delete one or more groups of data according to the requirement. The user may also modify data in one or more groups of data according to the requirement, for example, switch the state of a certain group of data, so that the group of data becomes: enabled or disabled; as another example, the IP address data in the packet domain name list is modified. The above operations can make the domain name configuration file change correspondingly, and after the corresponding operations are saved, corresponding grouping configuration information is formed. In practical applications, when the user makes the processing request, the web client application may re-group the customized domain name configuration file into new JSON format data, and then further combine the new JSON format data with other file groups.
Taking grouping of public domain name configuration files as an example, in practical application, the number of times of changing the public domain name resolution configuration files is less, and when the public domain name resolution configuration files can be stored in a designated remote end in a JSON format data form, file coverage can be directly carried out during updating, and meanwhile, the resource E-TAG cache identification is opened. When the application is initialized and loaded, the appointed far end can be accessed to obtain the public domain name configuration file, the configuration is pulled from the appointed far end and then standard serialization is carried out, and a public domain name configuration file group is formed. In the using process of the application, the latest public configuration can be obtained from the designated remote end at intervals of preset duration (for example, every hour) and is used as the updated grouping configuration information, and the E-TAG is used for negotiating and caching, so that the relative real-time updating is ensured, and the network resources are not frequently occupied. In practical application, public DNS analysis configuration of a team or an enterprise is stored in a designated remote sharing and dynamically updated in real time in application, so that the problem of multi-level cache after configuration updating can be avoided, and the configuration can take effect.
Taking the Host profile grouping as an example, the web client may listen to the modification of the Host profile. And on the premise of obtaining the operation permission of the user, allowing the user to directly edit and store the current Host file configuration on an editing page in the application. And after the user modifies the Host file, automatically reading and changing the Host file, acquiring the updated grouping configuration information, and updating the grouping configuration information of the Host file.
In addition, for data of modifying one or more file packets, the priority attribute of a file packet may also be modified, for example, in a default state, the order of the priority attributes of a customized domain name profile packet, a common domain name profile packet, and a Host profile packet from large to small is: the public domain name configuration file grouping > the customized domain name configuration file grouping > the Host configuration file grouping, and a user can modify the priority attributes of the public domain name configuration file grouping > the customized domain name configuration file grouping > the Host configuration file grouping according to the actual requirements of the user, for example, the sequence of the modified priority attributes from large to small is as follows: customized domain name configuration file grouping > public domain name configuration file grouping > Host configuration file grouping.
In addition, for the webpage client applying the scheme of the related embodiment of the application, taking the webpage client developed by an Electron frame as an example, the application main interface can be realized by HTML/CSS/JS; when the remote page and the function are updated, whether the remote page and the function need to be updated or not can be inquired through a network when the application is started, if yes, the latest resource is directly loaded and cached to the local part of the user computer by means of a Service Worker; if the local cached resources do not need to be updated, the local cached resources are directly loaded, and offline access is realized; by adopting the resource caching and updating strategy, the application initialization loading performance is improved.
Fig. 5 is a schematic structural diagram of a domain name processing device according to an embodiment of the present application, and as shown in fig. 5, the domain name processing device 5 includes:
a first obtaining module 501, configured to obtain a web access request for switching a page, where the web access request carries a domain name to be accessed and target environment information;
a determining module 502, configured to determine, according to a domain name configuration file, an IP address to be accessed corresponding to the domain name to be accessed under the target environment information, where the domain name configuration file includes an IP address corresponding to the domain name to be accessed under at least one piece of environment information;
a switching module 503, configured to switch a page to a page corresponding to the to-be-accessed IP address according to the web page access request.
Further, the first obtaining module 501 is specifically configured to: intercepting a webpage access request for switching a page through a preset proxy service; and acquiring the webpage access request forwarded by the proxy service.
Further, the determining module 502 is specifically configured to: acquiring a domain name to be accessed and target environment information from a webpage access request forwarded by a proxy service; and when the domain name to be accessed is detected to be in the domain name configuration file, determining the IP address to be accessed corresponding to the domain name to be accessed under the target environment information through the domain name configuration file.
Further, the switching module 503 is specifically configured to: when the IP address to be accessed is determined, forwarding the IP address to be accessed through the proxy service; acquiring the IP address to be accessed forwarded by the proxy service; and switching a page to a page corresponding to the IP address to be accessed forwarded by the proxy service according to the webpage access request.
Further, the domain name processing apparatus 5 further includes:
an obtaining module 504, configured to obtain a user-defined domain name file, and obtain a user-defined domain name configuration file group; acquiring public domain name configuration files pre-stored in an appointed remote end to obtain a public domain name configuration file group; acquiring a Host file under each platform to obtain a Host configuration file group;
a generating module 505, configured to generate a corresponding domain name configuration file according to the generated file group.
Further, the generating module 505 is specifically configured to: when the obtained file groups have at least two types, combining the file groups to generate a corresponding domain name configuration file, wherein the combining comprises: when the different file groups have the configuration data of the same domain name, the priority attributes corresponding to the file groups are obtained, the obtained priority attributes indicate the file group with the highest level, and the configuration data of the same domain name in the file group with the highest level are combined.
Further, the domain name processing apparatus 5 further includes:
a second obtaining module 506, configured to obtain, when it is detected that the domain name configuration file changes, updated grouping configuration information of the domain name configuration file;
an updating module 507, configured to update the domain name configuration file according to the updated grouping configuration information.
With regard to the domain name processing apparatus 5 in the above-described related embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In one embodiment, the present application provides a readable storage medium, on which an executable program is stored, and the executable program realizes the steps of the above method when executed by a processor.
With respect to the readable storage medium in the above embodiments, the specific manner of executing the operation by the stored execution program has been described in detail in the embodiments related to the method, and will not be elaborated herein.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 6, the electronic device 6 includes:
a memory 601 on which an executable program is stored;
a processor 602 for executing the executable program in the memory 601 to implement the steps of the above method.
In practical applications, the electronic device 6 may be a computer, a PAD, a smart phone, or the like.
With respect to the electronic device 6 in the above embodiment, the specific manner of executing the program in the memory 601 by the processor 602 thereof has been described in detail in the embodiment related to the method, and will not be described in detail here.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar contents in other embodiments may be referred to for the contents which are not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present application, the meaning of "plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as: represents modules, segments or portions of code which include one or more executable instructions for implementing specific logical functions or steps of a process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description of the present specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (7)

1. A domain name processing method is applied to a webpage client, and comprises the following steps:
the method for acquiring the webpage access request for switching the page comprises the following steps of: intercepting the webpage access request for switching the page through a preset proxy service, and acquiring the webpage access request forwarded by the proxy service;
determining an IP address to be accessed corresponding to the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the IP address corresponding to the domain name to be accessed under at least one type of environment information;
switching a page to a page corresponding to the IP address to be accessed according to the webpage access request;
the method also comprises a file configuration step, which comprises the following steps:
acquiring a domain name file configured by a user in a user-defined way, and acquiring a group of the domain name configuration file configured in the user-defined way;
acquiring public domain name configuration files pre-stored in an appointed remote end to obtain a public domain name configuration file group;
acquiring a Host file under each platform to obtain a Host configuration file group;
generating the corresponding domain name configuration file according to the obtained file groups, wherein the method comprises the following steps: when the obtained file groups have at least two types, combining the file groups to generate a corresponding domain name configuration file, wherein the combining comprises: when the different file groups have the configuration data of the same domain name, acquiring the priority attribute corresponding to each file group, acquiring the file group with the priority attribute indicating the highest level, and combining the configuration data of the same domain name in the file group with the highest level.
2. The method according to claim 1, wherein the determining, according to a domain name profile, the IP address to be accessed corresponding to the domain name to be accessed under the target environment information includes:
acquiring the domain name to be accessed and the target environment information from the webpage access request forwarded by the proxy service;
and when the domain name to be accessed is detected to exist in the domain name configuration file, determining the IP address to be accessed corresponding to the domain name to be accessed under the target environment information through the domain name configuration file.
3. The method according to claim 2, wherein the switching the page to the page corresponding to the IP address to be accessed according to the web page access request comprises:
when the IP address to be accessed is determined, forwarding the IP address to be accessed through the proxy service;
acquiring the IP address to be accessed forwarded by the proxy service;
and switching a page to a page corresponding to the IP address to be accessed forwarded by the proxy service according to the webpage access request.
4. The method of claim 1, further comprising:
when detecting that the domain name configuration file changes, acquiring the updated grouping configuration information of the domain name configuration file;
and updating the domain name configuration file according to the updated grouping configuration information.
5. A domain name processing apparatus, comprising:
the first obtaining module is configured to obtain a web access request for switching a page, where the web access request carries a domain name to be accessed and target environment information, and the obtaining of the web access request for switching a page includes: intercepting the webpage access request for switching the page through a preset proxy service; acquiring the webpage access request forwarded by the proxy service;
the determining module is used for determining an IP address to be accessed corresponding to the domain name to be accessed under the target environment information according to a domain name configuration file, wherein the domain name configuration file comprises the IP address corresponding to the domain name to be accessed under at least one type of environment information;
the switching module is used for switching a page to a page corresponding to the IP address to be accessed according to the webpage access request;
the domain name processing apparatus further includes:
the acquisition module is used for acquiring the domain name files configured by the user in a user-defined manner to obtain the user-defined domain name configuration file group; acquiring public domain name configuration files pre-stored in an appointed remote end to obtain a public domain name configuration file group; acquiring a Host file under each platform to obtain a Host configuration file group;
a generating module, configured to generate the corresponding domain name configuration file according to the obtained file group, where the generating module includes: when at least two obtained file groups exist, combining the file groups to generate a corresponding domain name configuration file, wherein the combining comprises: when the different file groups have the configuration data of the same domain name, acquiring the priority attribute corresponding to each file group, wherein the acquired priority attribute indicates the file group with the highest level, and merging the configuration data of the same domain name in the file group with the highest level.
6. A computer-readable storage medium having stored thereon an executable program, wherein the executable program, when executed by a processor, performs the steps of the method of any one of claims 1-4.
7. An electronic device, comprising:
a memory having an executable program stored thereon;
a processor for executing the executable program in the memory to implement the steps of the method of any of claims 1-4.
CN201910601459.XA 2019-07-04 2019-07-04 Domain name processing method and device, readable storage medium and electronic equipment Active CN110149423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910601459.XA CN110149423B (en) 2019-07-04 2019-07-04 Domain name processing method and device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910601459.XA CN110149423B (en) 2019-07-04 2019-07-04 Domain name processing method and device, readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110149423A CN110149423A (en) 2019-08-20
CN110149423B true CN110149423B (en) 2022-07-22

Family

ID=67597033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910601459.XA Active CN110149423B (en) 2019-07-04 2019-07-04 Domain name processing method and device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110149423B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221572B (en) * 2020-01-13 2023-09-01 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to running environment
CN111343294A (en) * 2020-02-14 2020-06-26 京东数字科技控股有限公司 Network environment switching method, device, equipment and computer readable storage medium
CN111447299A (en) * 2020-03-25 2020-07-24 中国工商银行股份有限公司 DNS analysis method and system based on test environment standing book
CN111459415B (en) * 2020-04-15 2023-05-23 腾讯云计算(长沙)有限责任公司 Cross-cloud data migration method, device, equipment and storage medium
CN113965543B (en) * 2020-07-03 2024-01-16 深圳市腾讯网域计算机网络有限公司 Access method, device and storage medium of application server
CN111935329B (en) * 2020-07-16 2023-03-31 郑州悉知信息科技股份有限公司 Domain name resolution method and device
CN112241371A (en) * 2020-10-21 2021-01-19 四川长虹电器股份有限公司 Method for improving testing efficiency of Web application interface
CN112527429B (en) * 2020-11-30 2024-01-19 文思海辉智科科技有限公司 Page configuration method and device and readable storage medium
CN113076497A (en) * 2021-04-19 2021-07-06 北京沃东天骏信息技术有限公司 Front-end and back-end asynchronous request calling method, device, equipment and medium
CN113347020B (en) * 2021-04-29 2022-11-15 上海淇玥信息技术有限公司 Domain name service disaster recovery method, system, device and medium
CN113194099B (en) * 2021-04-30 2023-04-18 网宿科技股份有限公司 Data proxy method and proxy server
CN113434196A (en) * 2021-06-29 2021-09-24 北京房江湖科技有限公司 Method and device for managing application program
CN113783972A (en) * 2021-07-26 2021-12-10 福建野小兽健康科技有限公司 Server domain name switching method and device
CN114430409B (en) * 2022-01-26 2023-08-15 网易(杭州)网络有限公司 Webpage access method, webpage access device, storage medium and electronic equipment
CN115412529A (en) * 2022-07-21 2022-11-29 银盛支付服务股份有限公司 iOS development domain name switching method and system
CN115529292A (en) * 2022-10-11 2022-12-27 中国农业银行股份有限公司 Access request processing method, device, equipment, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391811A (en) * 2014-08-29 2016-03-09 腾讯科技(深圳)有限公司 DNS (domain name resolution) method, access method for application server, and terminal
CN107402880A (en) * 2016-05-20 2017-11-28 腾讯科技(北京)有限公司 A kind of method of testing and electronic equipment
CN107959601A (en) * 2018-01-04 2018-04-24 深圳市富途网络科技有限公司 A kind of method and system for being switched fast network test environment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944942B (en) * 2013-01-22 2018-04-27 腾讯科技(深圳)有限公司 A kind of data access method and device of more WEB environments
US9258270B2 (en) * 2013-05-23 2016-02-09 International Business Machines Corporation Selecting between domain name system servers of a plurality of networks
CN104580540B (en) * 2013-10-09 2018-11-23 腾讯科技(深圳)有限公司 The implementation method and device of website visiting

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391811A (en) * 2014-08-29 2016-03-09 腾讯科技(深圳)有限公司 DNS (domain name resolution) method, access method for application server, and terminal
CN107402880A (en) * 2016-05-20 2017-11-28 腾讯科技(北京)有限公司 A kind of method of testing and electronic equipment
CN107959601A (en) * 2018-01-04 2018-04-24 深圳市富途网络科技有限公司 A kind of method and system for being switched fast network test environment

Also Published As

Publication number Publication date
CN110149423A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
CN110149423B (en) Domain name processing method and device, readable storage medium and electronic equipment
US10412176B2 (en) Website access method, apparatus, and website system
US20210314354A1 (en) Techniques for determining threat intelligence for network infrastructure analysis
CN102647482B (en) Method and system for accessing website
US20140280943A1 (en) Lightweight directory access protocol (ldap) join search mechanism
US11023538B2 (en) System and methods for dynamic generation of object storage datasets from existing file datasets
EP2997465A1 (en) Automatic discovery of system behavior
US20230328138A1 (en) Cloud Platform and Bucket Management Method for Object Storage Service Provided by Cloud Platform
CN106897336A (en) Web page files sending method, webpage rendering intent and device, webpage rendering system
US20240073222A1 (en) Techniques for managing projects and monitoring network-based assets
CN108280237A (en) A kind of gray scale dissemination method and device, system, computer storage media
US20230221952A1 (en) Disabling a script based on indications of unsuccessful execution of the script
US10778565B2 (en) Forwarding current request based on, at least in part, previous request(s)
CN107408055B (en) Code cache system
US10289617B2 (en) Accessing on-premise and off-premise datastores that are organized using different application schemas
US20150067029A1 (en) Data uniqued by canonical url for rest application
US20080065679A1 (en) Method for rules-based drag and drop processing in a network environment
US11652908B2 (en) Split testing with custom cache keys for content delivery networks
US20220229858A1 (en) Multi-cloud object store access
CN112583891B (en) Interface document acquisition method and device and server
US11288336B2 (en) Systems and methods for providing content items in situations involving suboptimal network conditions
US11693906B2 (en) Method and system for using access patterns to suggest or sort objects
KR20100079052A (en) Method, system and computer-readable recording medium for providing web page using cache
CN111771191A (en) Cross-domain inline event handler
US20240111410A1 (en) Drag and drop interactions for a browser software application

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