CN114040025B - Method and device for controlling switching network environment and electronic equipment - Google Patents

Method and device for controlling switching network environment and electronic equipment Download PDF

Info

Publication number
CN114040025B
CN114040025B CN202010707240.0A CN202010707240A CN114040025B CN 114040025 B CN114040025 B CN 114040025B CN 202010707240 A CN202010707240 A CN 202010707240A CN 114040025 B CN114040025 B CN 114040025B
Authority
CN
China
Prior art keywords
network
address information
domain name
network environment
target application
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
CN202010707240.0A
Other languages
Chinese (zh)
Other versions
CN114040025A (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 Tencent Domain Computer Network Co Ltd
Original Assignee
Shenzhen Tencent Domain Computer Network 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 Tencent Domain Computer Network Co Ltd filed Critical Shenzhen Tencent Domain Computer Network Co Ltd
Priority to CN202010707240.0A priority Critical patent/CN114040025B/en
Publication of CN114040025A publication Critical patent/CN114040025A/en
Application granted granted Critical
Publication of CN114040025B publication Critical patent/CN114040025B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/255Maintenance or indexing of mapping tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method, a device and electronic equipment for controlling switching network environment, which relate to the technical field of computers and are used for improving the switching efficiency of the network environment. The method comprises the following steps: an access request initiated by a target application client in terminal equipment and used for requesting access to a first network environment is acquired, wherein the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment; determining second IP address information corresponding to a second network environment to be accessed by the target application client according to a network switching corresponding relation and first domain name information corresponding to the target application client, wherein the network switching corresponding relation comprises the first network address information and the corresponding second network address information; and configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.

Description

Method and device for controlling switching network environment and electronic equipment
Technical Field
The application relates to the technical field of computers, and provides a method and device for controlling and switching network environments and electronic equipment.
Background
Along with the development of science and technology, application software becomes an indispensable part in the life of users, and each application software can be tested from development to formal online process so as to perform Bug repair and ensure the normal operation of the application software.
At present, the test of application software is mainly performed in a test environment, a pre-release environment and a gray release environment. Therefore, when a tester enters different network environments such as a testing environment, a pre-release environment, a gray level release environment and the like, only three or even more installation packages of the client side of the application software can be installed respectively. And along with the display image quality of the application software becoming higher and larger, the inclusion becomes larger, so that the test progress of the function of the application software can be affected when the installation package of the client is repeatedly installed for testing when the package is compiled.
Therefore, the related art provides a technical scheme of entering different network environments through installation packages of clients of the same application software:
in the first mode, for example, a certain application software judges which environment is entered by reading the content in a fixed file, but this mode requires file modification. When the file is modified, a certain file needs to be copied into a certain fixed directory of the system, the file is troublesome to copy or modify, the network environment is time-consuming to switch, and the test progress is affected if the test is performed.
In the second mode, for example, a certain application software defaults to a formal environment, but can enter various network environments in the test process through special interface operation. Although the special interface operation is not easy to be touched by mistake, the operation is easy to be found by the outside, so that information is leaked, and the network environment cannot be replaced when the special interface operation fails, so that the test progress is affected.
In summary, the switching efficiency is low by changing the client file or performing a special interface operation on the interface of the client to switch the network environment accessed by the application software in the related art.
Disclosure of Invention
The embodiment of the application provides a method, a device and electronic equipment for controlling a switching network environment, which are used for improving the switching efficiency of switching network environments accessed by an application.
In one aspect, a method of controlling a handover network environment is provided, the method comprising:
an access request initiated by a target application client in terminal equipment and used for requesting access to a first network environment is acquired, wherein the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment;
Determining second IP address information corresponding to a second network environment to be accessed by the target application client according to a network switching corresponding relation corresponding to the target application client and the first domain name information, wherein the network switching corresponding relation comprises first network address information and corresponding second network address information, the first network address information is the network address information corresponding to the first network environment, and the second network address information is the network address information corresponding to the second network environment;
and configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.
In one aspect, an apparatus for controlling a handover network environment is provided, the apparatus comprising:
the system comprises an acquisition module, a first network environment and a second network environment, wherein the acquisition module is used for acquiring an access request which is initiated by a target application client in terminal equipment and used for requesting to access a first network environment, the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment;
The determining module is configured to determine second IP address information corresponding to a second network environment to be accessed by the target application client according to a network switching correspondence corresponding to the target application client and the first domain name information, where the network switching correspondence includes first network address information and corresponding second network address information, the first network address information is network address information corresponding to the first network environment, and the second network address information is network address information corresponding to the second network environment;
and the configuration module is used for configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.
Optionally, the determining module is configured to:
determining second network address information corresponding to the first domain name information from the network switching corresponding relation;
determining second domain name information matched with the second network address information, and sending the second domain name information to a domain name system server to request the domain name system server to conduct domain name resolution on the second domain name information;
And receiving second IP address information corresponding to the second domain name information returned by the domain name system server.
Optionally, the determining module is configured to:
sending the first domain name information to a domain name system server to request the domain name system server to conduct domain name resolution on the first domain name information;
receiving first IP address information corresponding to the first domain name information returned by the domain name system server;
and searching an IP address forwarding relation table to determine the IP address information to be forwarded corresponding to the first IP address information as the second IP address information, wherein the IP address forwarding relation table is determined according to the network switching corresponding relation.
Optionally, the determining module is configured to:
determining a first IP address and a first port corresponding to the first network address information, and determining a second IP address and a second port corresponding to the second network address information;
configuring the first IP address and the first port as inputs of an iptables forwarding table, and configuring the second IP address and the second port as outputs of the iptables forwarding table;
and determining the configured iptables forwarding table as the IP address conversion relation table.
Optionally, the determining module is configured to:
when the network where the terminal equipment is located is detected to be switched, the updated IP address information corresponding to the IP address information to be forwarded in the IP address forwarding relation table after the network is switched is obtained;
and replacing the corresponding IP address information to be forwarded with the updated IP address information to update the IP address forwarding relation table.
Optionally, the network switching correspondence is obtained according to an operation performed on a network client in the terminal device.
Optionally, the determining module is configured to:
responding to configuration triggering operation aiming at the target application client, and displaying a target conversion configuration interface corresponding to the target application client through the network client, wherein the target conversion configuration interface comprises a source input area and a target input area;
obtaining the first network address information in response to a first input operation for the source input area, and obtaining the second network address information in response to a second input operation for the destination input area;
and determining the network switching corresponding relation according to the first network address information and the second network address information.
In one aspect, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps included in the method of controlling a switching network environment described in the various possible implementations described above when the computer program is executed.
In one aspect, a storage medium is provided, where the storage medium stores computer executable instructions for causing a computer to perform steps included in a method for controlling a switching network environment described in the above various possible implementations.
In one aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps described in the various possible implementations above as a method of controlling a switching network environment comprising.
In the embodiment of the application, when the access request initiated by the target application client and used for requesting to access the first network environment is acquired, the IP address information (namely the second IP address information) corresponding to the second network environment to be switched is acquired according to the pre-configured network switching corresponding relation and the first domain name information corresponding to the first network environment, and the acquired second IP address information is configured to the target application client, so that the target application client can access the second network environment according to the second IP address information, and the network environment accessed by the target application client is switched. Therefore, the file stored in the terminal does not need to be modified, and the switching efficiency of the network environment accessed by the application is improved without special interface operation, for example, the first network environment is a formal environment of the application installed in the terminal, the second network environment is a test environment or a gray scale environment, and the testing efficiency of the application in the test process can be improved by improving the switching effect of the network environment. In addition, in the switching process of the network environment, the target application client is not perceived, so that the normal use of the target application client is not influenced.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a DNS recursive query in the related art;
fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 3 is a schematic diagram of another application scenario provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a configuration interface according to an embodiment of the present application;
fig. 5 is a flowchart of a method for controlling a switching network environment according to an embodiment of the present application;
FIG. 6 is another flowchart of a method for controlling a handover network environment according to an embodiment of the present application;
FIG. 7 is another flowchart of a method for controlling a handover network environment according to an embodiment of the present application;
fig. 8 is a schematic diagram of a comparison between the front and back of a switching network environment according to an embodiment of the present application;
fig. 9 is a block diagram of an apparatus for controlling a switching network environment according to an embodiment of the present application;
fig. 10 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 advantageous effects of the present application more apparent, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following description of the embodiments of the application is provided to illustrate and explain the principles of the application.
1. In a network environment, an application software needs to be subjected to the processes of application software development, application software test, application software formal online use and the like before being formally online, and when the application software is developed, a developer is in the development environment, and the initially developed application software possibly has many loopholes to cause that the application software cannot be formally operated, or has the problems of stuck state, poor image quality and the like in the operation process. Testing against developed application software is therefore required to be further perfected.
The test of the application software is carried out in a network environment in the test process, and the test process of the application software is carried out after the development of the application software and before the formal online, so that the test of the application software is mainly carried out in a test environment, a pre-release environment and a gray level release environment. The test environment is after the development environment, and mainly tests the developed application software to perform Bug repair; after the test environment, entering a pre-release environment, wherein the pre-release environment is a network environment configured as the formal environment after the test environment and before the formal environment, and is used for verifying the Bug repair condition of the new version; after the pre-release environment and before the formal environment, a gray release environment is further included, wherein the gray release environment refers to an independent environment in small-range release of a first version in an independent environment before the formal environment is online, so that the problem of verifying a new version in advance is solved, and the problem that serious Bug directly affects the whole network users is avoided.
After testing and modifying the application software, and determining that the application software can be formally used, the application software is formally online, and the application software accesses the formal environment.
Thus, the network environment of the application includes a development environment, a test environment, a pre-release environment, a gray release environment, and a formal environment.
2. DNS (Domain Name Server ) recursive queries, terminal device queries to domain name system servers are typically DNS recursive queries. So-called recursive queries are: if the domain name system server queried by the terminal equipment does not know the IP address corresponding to the queried domain name, the domain name system server continuously sends query requests to other root domain name system servers (namely, continuously queries for the terminal equipment) according to the identity of the DNS client, and does not let the terminal equipment perform the next query. Thus, the query result returned by the recursive query is the IP address to be queried, or is a misstatement, which indicates that the desired IP address cannot be queried. Among them, a domain name system server (or DNS server) is a server that performs domain name (domain name) and IP address conversion corresponding thereto, wherein converting a domain name into an IP address is also called a domain name resolution service.
As shown in fig. 1, which is a schematic diagram of DNS recursive query in the related art, a terminal device initiates a domain name resolution request carrying domain name information (e.g., first domain name information) to a domain name system server, if the domain name system server finds an IP address corresponding to the first domain name information locally, the domain name system server returns the found IP address to the terminal device, if the domain name system server fails to find the IP address corresponding to the first domain name information locally, a domain name resolution request carrying the first domain name information is initiated to a root domain name system server to request the root domain name system server to perform domain name resolution on the first domain name information, and after the root domain name system server finds the IP address corresponding to the first domain name information locally, the root domain name system server returns the IP address to the domain name system server, and then the domain name system server returns the IP address to the terminal device, thereby implementing the recursive query of domain name resolution.
3. Domain name hijacking is a way of internet attack, and the target website domain name is resolved to the wrong IP address by attacking a domain name system server (DNS server) or forging the domain name system server, so that the purpose that a user cannot access the target website or the purpose that the user is deliberately or maliciously required to access a designated IP address (website) is achieved.
4. The iptables, an application software running in the user space, manages the processing and forwarding of network packets by controlling the Linux kernel netfilter module.
The application scenario to which the technical scheme of the present application is applicable is illustrated below.
Fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present application. The application scenario includes a plurality of terminals 20 and a plurality of servers 21.
The terminal 20, which is a hardware device that supports installation of the target application client and is capable of running the target application client, may be a terminal device such as a personal computer (Personal Computer, PC), a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), a notebook, a mobile phone, or the like, or may be a computer having a mobile terminal device, including various portable, pocket-sized, hand-held, built-in or vehicle-mounted mobile devices, which are devices capable of providing voice, data, or voice and data connectivity to a user, and exchanging voice, data, or voice and data with a radio access network.
The server 21 includes application servers in different network environments, specifically includes an application server in a formal environment, an application server in a test environment, an application server in a pre-release environment, an application server in a gray-scale release environment, etc., and the server 21 may also include a domain name system server, a root domain name system server, etc.
Each of the servers 21 may be independent, may be any single background running device or a cluster or a distributed system formed by a plurality of background running devices capable of providing internet services, and may also be devices providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
In practical applications, the terminal 20 and the server 21 are in communication connection, and the communication network may be, but is not limited to, a local area network, a metropolitan area network, or a wide area network.
In one possible application scenario, in order to facilitate reducing the communication latency, the servers 21 may be deployed in respective regions, or for load balancing, different servers 21 may serve respective regions corresponding to the respective terminals 20. The plurality of servers 21 can share data through a blockchain, and the data sharing system is equivalent to a data sharing system formed by the plurality of servers 21.
Referring to fig. 3 again, fig. 3 includes a terminal, a domain name system server, and two application server clusters, where the two application server clusters respectively construct two network environments, one is a formal environment, and the other is a test environment, where the formal environment and the test environment are both network environments accessible to a target application corresponding to a target application client installed in a terminal device, and when the target application is formally running, an application service can be implemented by accessing the application server cluster in the formal environment, and when the target application needs to access the test environment, a corresponding application service can be implemented by accessing the application server cluster in the test environment.
In the terminal device in fig. 3, a plurality of application clients may be installed and run, taking the target application client as an example, the target application client may communicate with a network control module in the terminal device, for example, packets sent and received by the target application client through a network may all be forwarded by the network control module, where the network control module may be understood, for example, as a hardware network device such as a network card in the terminal device, or may also be understood as a network client installed in the terminal device, for example, as an installed virtual private network (Virtual Private Network, VPN) client, where embodiments of the present application are not limited.
It is assumed that, for a target application installed in a terminal device, an installation version in the terminal device is a version in a formal environment at present, that is, an installation package corresponding to the formal version of the target application is installed in the terminal device, so that a target application client corresponding to the target application can access an application server in the formal environment to provide an application service. In the process of accessing the formal environment, if the tester wants to access other network environments, taking game a as an example as a target application, the tester can start the VPN client to display a configuration interface corresponding to VPN forwarding configuration of game a as shown in fig. 4, in the configuration interface, the tester can input a domain name corresponding to the currently accessed formal environment in an input area of a source domain name, and input a domain name corresponding to the network environment to be switched in an input area of a destination domain name, it is seen that the source domain name input in fig. 4 is format.
Specifically, the network control module in the terminal device in fig. 3 may obtain the forwarding configuration information obtained by configuring in fig. 4, that is, it indicates that a switch is required from the formal environment to the test environment, and when the target application client (for example, the game a) initiates an access request to the application server in the formal environment, the access request includes domain name information (i.e., format.name.qq.com) corresponding to the formal environment, and it is assumed that the IP address corresponding to the format.name.qq.com is 1.1.1, and the network control module may obtain the IP address (i.e., test.name.qq.com) in the test environment by using a domain name hijacking method or performing IP address forwarding through an IP address forwarding table (assuming that 9.9.9.9) and configure the IP address in the test environment to the target application client, so that the target application client may access the application server with the IP address 9.9.9.9, that is directly accessing the IP address corresponding to the application server in the test environment, thereby implementing a switch of the network environment. In the conversion process, the target application client is not perceived, namely the target application client is not influenced, and installation packages under various network environments are not required to be installed as in the related technology, so that the installation and storage load of the terminal is reduced, and meanwhile, the switching efficiency of the network environments is improved.
In order to further explain the technical solution provided by the embodiments of the present application, the following details are described with reference to the accompanying drawings and the detailed description. Although embodiments of the present application provide the method operational steps shown in the following embodiments or figures, more or fewer operational steps may be included in the method, either on a routine or non-inventive basis. In steps where there is logically no necessary causal relationship, the execution order of the steps is not limited to the execution order provided by the embodiments of the present application. The methods may be performed sequentially or in parallel as shown in the embodiments or the drawings when the actual processing or the apparatus is performed.
The embodiment of the present application provides a method for controlling a switching network environment, which may be applied to a terminal 20 in fig. 2 or a terminal device in fig. 3, and in particular, may be executed by a network control module in the terminal device in fig. 3, as shown in fig. 5, and is a flowchart of a method for controlling a switching network environment provided by the embodiment of the present application, where a flowchart shown in fig. 5 is described as follows.
Step 501: an access request initiated by a target application client in terminal equipment and used for requesting access to a first network environment is acquired, wherein the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment.
The network environment corresponding to the installation version of the target application client currently installed in the terminal device is called a first network environment, so the target application client may directly run in the first network environment, that is, the target application client may directly initiate an access request to the first network environment, specifically, for example, request to access an application server in the first network environment. The target application client typically accesses the application server through a domain name, and therefore the access request includes domain name information corresponding to the first network environment for which access is requested, for example, the domain name information is referred to as first domain name information.
Step 502: and determining second IP address information corresponding to a second network environment to be accessed by the target application client according to the network switching corresponding relation and the first domain name information corresponding to the target application client, wherein the network switching corresponding relation comprises first network address information and corresponding second network address information, the first network address information is the network address information corresponding to the first network environment, and the second network address information is the network address information corresponding to the second network environment.
The network switching correspondence is configured in the terminal device in advance, for example, is configured in the network client in the terminal device in advance, that is, the network switching correspondence is obtained according to an operation performed on the network client in the terminal device. The network switch correspondence is a correspondence of network addresses for performing network environment switching, the first network address information included in the network switch correspondence is network address information corresponding to a network environment that can be accessed before the network environment switching, the second network address information is network address information corresponding to a network environment that can be accessed after the network environment switching, and the network address information may be a domain name, or may be an IP address, or may be a domain name+a network port number, or may be an IP address+a network port number, which is not limited by the embodiment of the present application.
When each application in the terminal equipment accesses the network, the initiated network access request generally passes through the network control module, and after the access request for requesting to access the first network environment initiated by the target application client is obtained, the network control module can firstly judge whether the target application client needs to switch the network environment, and the specific judging mode can be as follows: judging whether the network switching corresponding relation comprising the first network address information and the corresponding second network address information is stored in the storage of the terminal equipment, if so, indicating that network environment switching is required to be carried out on all access requests for accessing the first network environment, namely, the access to the second network environment is required to be switched, namely, the existence of the network switching corresponding relation comprising the first network address information and the second network address information can be used as a triggering condition for triggering the network environment switching.
In the embodiment of the present application, the network switching correspondence relationship is configured in advance, for example, as described in the foregoing fig. 4, specifically, in response to the configuration triggering operation for the target application client, the target switching configuration interface corresponding to the target application client is displayed through the network client, where the target switching configuration interface includes a source input area and a destination input area, that is, the user may first start the network client, for example, the VPN client in fig. 4, and the VPN client may support performing network switching configuration on a plurality of applications, and further support deleting or newly adding performing network switching configuration on an application, for example, as shown in fig. 4, clicking "+" on the right side of the game a may delete network switching configuration on the application a, and clicking "+" on the right side of the game B may newly add network switching configuration on other applications, taking the target application corresponding to the target application client as an example, and the user may perform the configuration triggering operation for example for clicking the word "game a" so as to trigger to display the switching configuration interface for the game a in the VPN client, as shown in fig. 4. The destination translation configuration interface may include a source input area and a destination input area, where the input area corresponding to the source domain name and the source port in fig. 4 is referred to as a source input area, the input area corresponding to the destination domain name and the destination port is referred to as a destination input area, the source input area is used to input network address information before the network environment is switched, and the destination input area is used to input network address information of the network environment that is desired to be switched.
Further, in response to the first input operation for the source input area, first network address information, such as "format.name.qq.com" and "12345" in fig. 4, and in response to the second input operation for the destination input area, second network address information, such as "test.name.qq.com" and "54321" in fig. 4, are obtained, and after the first network address information and the second network address information are obtained, the network switch correspondence corresponding to the target application client (i.e. game a) is obtained.
In a specific implementation process, the first network address information may be only a domain name or only an IP address, or may be a combination of a domain name and a network port number, or may also be a combination of an IP address and a network port number, which is not limited in the embodiment of the present application. The first network address information and the second network address information as shown in fig. 4 are each a combination of a domain name + a network port number. The network switching corresponding relation of the target application is configured in an interface configuration mode shown in fig. 4, so that the configuration method is visual and easy to operate, and a user can rapidly configure the network environment switching only by performing simple input operation, thereby being convenient for improving the switching efficiency of the network environment. It should be noted that, the network switching correspondence may be preconfigured before the network environment is switched, and the operation of saving the network switching correspondence may be understood as triggering the operation of triggering the network environment to be switched, that is, when the network switching correspondence is detected to be saved, the VPN process may be started, so as to trigger the application-agnostic switching of the network environment accessed by the target application from the background.
In addition, in the embodiment of the present application, the network switching correspondence corresponding to the target application client is configured by an independent network client, it may be understood that the network switching correspondence may also be configured for other application clients (for example, application clients corresponding to the game B) by using the network client, where the network client and the application clients of each application are mutually independent clients, and may be understood as the clients corresponding to the network control module in the terminal device, because the operation of each application in the terminal device is located at the bottom layer, and the network control module is a network control of a higher layer, so that the network switching correspondence may be configured for each application by using the network client, thereby configuring the network switching correspondence for multiple applications in batches and improving the configuration efficiency.
When the network control module determines that the target application client needs to switch the network environment, the network control module determines the IP address information corresponding to the network environment needing to be switched according to the network switching corresponding relation corresponding to the target application client and the first domain name information included in the access request.
Step 503: and configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.
After the second IP address information corresponding to the second network environment is obtained, the network control module may configure the second IP address information to the target application client, so that the target client may directly access the application server corresponding to the second IP address information, that is, the application server in the second network environment, thereby switching the accessed network environment. However, for the target application client, since the access request initiated by the target application client is still an access request for the first network environment, but the final access is an application server under the second network environment, namely an application server corresponding to the second IP address information, the switching of the network environment is not perceived for the target application client, the switching of the network environment is controlled by the upper network control module, the operation of the target application client is not affected, and meanwhile, no modification is required for the target application client.
In the embodiment of the application, the second IP address information corresponding to the second network environment can be determined by two modes of domain name hijacking and IP address forwarding table, and the scheme of network environment switching in the embodiment of the application is explained below corresponding to the two modes.
Referring to fig. 6, fig. 6 is a scheme for controlling a switching network environment provided by a domain name hijacking technology according to an embodiment of the present application, and a flow chart shown in fig. 6 is described below.
Step 601: the target application client in the terminal equipment initiates an access request carrying the first domain name information, and the access request is obtained by the network control module in the terminal equipment, namely the network control module can obtain the access request carrying the first domain name information sent by the target application client.
The first domain name information is domain name information corresponding to a first network environment, taking the first network environment as an example, and the first domain name information is, for example, a domain name in the formal environment, namely: formal.
Step 602: the network control module judges whether the triggering condition of network environment switching is met.
As described above, one possible triggering condition is that the terminal device stores therein the network switch correspondence relationship corresponding to the target application client, and another possible triggering condition is that the storage operation is performed after the first network address information and the second network address information are respectively input in the source input area and the destination input area of the target application client as in fig. 4.
Step 603: when the triggering condition of network environment switching is not met, the network control module directly sends the first domain name information to the domain name system server so as to request the domain name system server to conduct domain name resolution on the first domain name information.
When any possible triggering condition is not satisfied, that is, it indicates that the network environment accessed by the target application client does not need to be switched, that is, the target application client wants to access the first network environment, the first domain name information can be sent to the domain name system server, and then the access is performed according to the existing access flow.
Step 604: the network control module receives a first IP address returned by the domain name system server.
Assuming that after the domain name system server resolves the first domain name information, the obtained IP address corresponding to the first domain name information is a first IP address, for example, the first IP address is 1.1.1.1, that is, the IP address corresponding to the formal environment, the first IP address is returned to the network control module.
Step 605: the network control module configures the first IP address to the target application client.
Step 606: and the target application client accesses an application server in the first network environment according to the first IP address.
Step 607: when the triggering condition of the network environment switching is met, the network control module intercepts an access request initiated by a target client, determines second network address information corresponding to the first domain name information according to the network switching corresponding relation corresponding to the target application client, and determines second domain name information corresponding to the second network address information.
When any possible triggering condition is met, that is, the network environment accessed by the target application client needs to be switched, at this time, the network control module can intercept the first domain name information contained in the access request based on a domain name hijacking technology, and determine second domain name information belonging to the second network address information according to the corresponding relation between the first network address information and the second network address information in the network corresponding relation, if the second network address information shown in fig. 4 is a domain name, the second domain name information can be directly obtained, and if the second domain name information is test.
Step 608: the network control module sends the second domain name information to the domain name system server to request the domain name system server to conduct domain name resolution on the second domain name information.
Step 609: the network control module receives a second IP address obtained by resolving the second domain name information by the domain name system server, and presumes that the second IP address is 9.9.9.9, that is, an IP address in the second network environment.
Step 610: the network control module configures the second IP address to the target application client.
Step 611: and the target application client accesses an application server in the second network environment according to the second IP address, thereby realizing switching access to the network environment.
According to normal access, after the target application client initiates an access request containing format.name.qq.com, the network control module in the terminal can send the format.name.qq.com to the domain name system server for domain name resolution, the domain name system server determines that the IP address corresponding to the format.name.qq.com is 1.1.1.1 through domain name resolution, 1.1.1.1 is returned to the network control module, and the network control module configures 1.1.1.1 to the target application client, so that the target application client can access the application server corresponding to the target application client, namely the application server in a formal environment through the IP address 1.1.1.1.1, thereby realizing access to the formal environment, namely the flow shown in steps 603-606.
In the present application, because the network switching correspondence between format.game.qq.com and test.game.qq.com is preconfigured, the storage of the network switching correspondence can be used as a switching condition for triggering the target application client to switch the network environment accessed, under the triggering, when the target application client initiates an access request containing format.game.qq.com, the network switching correspondence of the network control module performs domain name hijacking on the target application client, namely, the format.game.qq.com is intercepted, and the test.game.qq.com is sent to the domain name system server for domain name resolution, the domain name system server determines that the IP address corresponding to the test.game.qq.com is 9.9.9.9 through domain name resolution, then 9.9.9.9 is returned to the network control module, and the network control module configures 9.9.9.9 to the target application client, thus, the target application client accesses the application server corresponding to the target application client through the IP address 9.9.9.9, namely, the application server 607 under the testing environment is tested, and the testing environment is tested, thereby realizing the step of switching the access environment from the testing environment to the testing environment 611.
In the above switching manner, the network environment can be quickly switched from the formal environment to the test environment by the domain name hijacking manner, and only the installation package in the formal environment is needed to be installed, instead of the installation package corresponding to each network environment, so that the storage and installation requirements on the terminal are reduced, and when the test is performed, the test personnel do not need to manually modify certain file contents on the terminal, and the test personnel do not need to operate through specific gestures, so that the client side in the formal environment can enter the test environment, further the test steps of the test personnel are optimized, and especially the test for the game application of big packages can be greatly improved.
Referring to fig. 7 again, fig. 7 is a scheme for controlling a switching network environment according to the manner of forwarding tables based on IP addresses provided in the embodiment of the present application, and the flowchart shown in fig. 7 is described below.
Step 701: the target application client in the terminal equipment initiates an access request carrying the first domain name information, and the access request is obtained by the network control module in the terminal equipment, namely the network control module can obtain the access request carrying the first domain name information sent by the target application client.
The first domain name information is domain name information corresponding to a first network environment, taking the first network environment as an example, and the first domain name information is, for example, a domain name in the formal environment, namely: formal.
Step 702: the network control module judges whether the triggering condition of network environment switching is met.
As described above, one possible triggering condition is that the terminal device stores therein the network switch correspondence relationship corresponding to the target application client, and another possible triggering condition is that the storage operation is performed after the first network address information and the second network address information are respectively input in the source input area and the destination input area of the target application client as in fig. 4.
Step 703: when the triggering condition of network environment switching is not met, the network control module directly sends the first domain name information to the domain name system server so as to request the domain name system server to conduct domain name resolution on the first domain name information.
When any possible triggering condition is not satisfied, that is, it indicates that the network environment accessed by the target application client does not need to be switched, that is, the target application client wants to access the first network environment, the first domain name information can be sent to the domain name system server, and then the access is performed according to the existing access flow.
Step 704: the network control module receives a first IP address returned by the domain name system server.
Assuming that after the domain name system server resolves the first domain name information, the obtained IP address corresponding to the first domain name information is a first IP address, for example, the first IP address is 1.1.1.1, that is, the IP address corresponding to the formal environment, the first IP address is returned to the network control module.
Step 705: the network control module configures the first IP address to the target application client.
Step 706: and the target application client accesses an application server in the first network environment according to the first IP address.
According to normal access, after the target application client initiates an access request containing format.name.qq.com, the network control module in the terminal may send the format.name.qq.com to the domain name system server for domain name resolution, where the domain name system server determines that the IP address corresponding to the format.name.qq.com is 1.1.1 through domain name resolution, then returns 1.1.1.1 to the network control module, and the network control module configures 1.1.1.1 to the target application client, so that the target application client may access the application server corresponding to the target application client, that is, the application server in the formal environment through the IP address 1.1.1.1, thereby implementing access to the formal environment, that is, the flow shown in steps 703-706.
Step 707: and when the triggering condition of the network environment switching is met, the network control module still transmits the first domain name information to the domain name system server.
Step 708: the network control module receives a first IP address returned by the domain name system server.
Step 709: the network control module searches an IP address forwarding relation table to determine an IP address to be forwarded corresponding to the first IP address information as second IP address information, and further obtains the second IP address.
In this manner, the IP address corresponding to the network environment to be switched is obtained through the IP address forwarding relationship table locally stored in the terminal device, and is configured through the manner that the IP address (i.e., the first IP address information) of the first network environment to be accessed currently is set as the relationship pair, where the IP address forwarding relationship table may be generated according to the foregoing network switching correspondence, for example, after the network switching correspondence for the target application is configured in the manner shown in fig. 4, the corresponding VPN process corresponding to the start-up may generate the corresponding IP address forwarding relationship table, as in the foregoing example, the first network address information in the network switching correspondence is a format.name.qq.com, and the second network address information is a test.gam.qq.com, then the IP address corresponding to the format.q.com may be set as the IP address before the switching in the IP address forwarding relationship table, and the IP address corresponding to the test.q.com is set as the IP address corresponding to the IP address before the switching in the IP address forwarding relationship table, and the IP address corresponding to the second network address table is the IP address 1, and the IP address 1 is the IP address 1, and the target address is found out by the client address 1, and the address is the IP address is obtained by determining the address corresponding relationship of the IP address corresponding table.
In a specific implementation, the IP address forwarding relationship table may be an iptables forwarding table, as shown in table 1, where the iptables forwarding table includes an INPUT (INPUT) and an OUTPUT (OUTPUT), and the IP address information in the iptables forwarding table is represented by a combination of an IP address+a network port number.
TABLE 1
For the configuration mode of the iptables forwarding table, first acquiring first network address information and second network address information corresponding to pairing in a network switching corresponding relation, then acquiring a source IP address and a source port corresponding to the first network address information, and acquiring a destination IP address and a destination port corresponding to the second network address information; the circumference of the mouth configures the acquired source IP address and source port as input of the iptables forwarding table, configures the acquired destination IP address and destination port as output of the iptables forwarding table, and further uses the configured iptables forwarding table (for example, shown in table 1) as the aforementioned IP address conversion relationship table.
Considering that different operators have different IPs, in the embodiment of the present application, network changes of the terminal device may be detected in real time, once it is determined that the network changes (for example, from 4G to wifi or from wifi to wifi) or the like where the terminal device is located may cause the operator to change, the VPN process re-parses the test.game.qq.com to take the updated IP to perform related operations, for the iptables forwarding table, all output IPs corresponding to the test.game.qq.com need to be modified to be the updated IP, that is, when it is detected that the network at the terminal device is switched, updated IP address information corresponding to the IP address information to be forwarded in the IP address forwarding relation table after the network is switched may be obtained, and then the corresponding IP address information to be forwarded is replaced with the updated IP address information to update the IP address forwarding relation table. Through timely updating, timely and effective switching of network environments is facilitated, and effectiveness of switching of network environments is guaranteed.
The background entry modification of the IP address is realized by an iptables forwarding table mode, so that data which is sent to a format, a name, a qq.com and 12345 are sent to a test, a name, a qq.com and 54321, the unaware switching of the network environment is realized, in the iptables forwarding mode, forwarding from an INPUT to an OUTPUT can be realized based on the level of an IP+ port number, the number of forwarding configurations can be increased, the access switching to a specific application server in the network environment can be further refined on the basis of realizing the network environment switching, the granularity of the switching is smaller, and the pertinence of the switching is stronger.
In particular, considering that even the same operator has multiple IPs for background load balancing, before configuration, it is required to take all public network IPs of the domain name under the network environment of the operator where the terminal is currently located, for example, 1.1.1.1 and 2.2.2.2, through httpdns request, and the destination domain name test.name.qq.com may take only one if there are multiple IPs, for example, only the first one. In this way, a plurality of rules, namely corresponding combinations between different source ip+source ports and destination ip+destination ports, can be configured in the iptables forwarding table.
After hijacking the configuration, taking the game application as an example, the domain name format.name.qq.com of the formal environment accessed by the game client is resolved to the IP (9.9.9.9) of the test environment, and the background of the game test environment returns the data of the current login account in the test environment, so that a user can perform various tests of the test environment. The same logic, if the background configures the IP of the formal environment specifically as the IP of the pre-release environment (for example, 8.8.8.8) for this terminal, the game client of the formal environment can enter the pre-release environment.
Step 710: the network control module configures the second IP address to the target application client.
Step 711: and the target application client accesses an application server in the second network environment according to the second IP address, thereby realizing switching access to the network environment.
In connection with the above example, as shown in fig. 8, the first network environment accessed by the target application client (game client) is a formal environment, and the second network environment desired to be switched is a test environment, the second IP address is the IP address of the local list server under the test environment, after the network environment is switched, the game client (whether a split-service game or a full-service game) is started, at this time, connects one local list server to perform logic such as local list pulling and client version verification, so that the connected local list server returns the local list of the current environment (or the current available) to the game client for the game player to select, the game player can select his own local or local favorite local area, and after the game player selects his own favorite local or local area, the game player will be connected to the local list server corresponding to the selected local or local area, at this time, the game player can acquire the main logic of the local game to perform the game test.
In the embodiment of the application, when the access request initiated by the target application client and used for requesting to access the first network environment is acquired, the IP address information (namely the second IP address information) corresponding to the second network environment to be switched is acquired according to the pre-configured network switching corresponding relation and the first domain name information corresponding to the first network environment, and the acquired second IP address information is configured to the target application client, so that the target application client can access the second network environment according to the second IP address information, and the network environment accessed by the target application client is switched. Therefore, the file stored in the terminal does not need to be modified, and the switching efficiency of the network environment accessed by the application is improved without special interface operation, for example, the first network environment is a formal environment of the application installed in the terminal, the second network environment is a test environment or a gray scale environment, and the testing efficiency of the application in the test process can be improved by improving the switching effect of the network environment. In addition, in the switching process of the network environment, the target application client is not perceived, so that the normal use of the target application client is not influenced.
Taking game application as an example, compared with the existing game test scheme, the embodiment of the application provides two modes of domain name hijacking and IP address forwarding table-based mode for modifying IP at a background entry, on one hand, the method does not need to test and manually modify certain file contents on a terminal, on the other hand, a tester does not need to operate through a specific gesture, so that a client package in a formal environment can enter a test environment, further, the test steps of the tester are optimized, and especially for the game test of big packages, the test efficiency can be greatly improved.
Based on the same inventive concept, the embodiments of the present application provide a device for controlling a switching network environment, where the device for controlling a switching network environment may be a hardware structure, a software module, or a hardware structure plus a software module. Referring to fig. 9, an apparatus for controlling a switching network environment in an embodiment of the present application includes an acquisition module 901, a determination module 902, and a configuration module 903, where:
the obtaining module 901 is configured to obtain an access request initiated by a target application client in a terminal device and used for requesting access to a first network environment, where the access request includes first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal device;
A determining module 902, configured to determine, according to a network switching correspondence and first domain name information corresponding to a target application client, second IP address information corresponding to a second network environment to be accessed by the target application client, where the network switching correspondence includes first network address information and corresponding second network address information, the first network address information is network address information corresponding to the first network environment, and the second network address information is network address information corresponding to the second network environment;
the configuration module 903 is configured to configure the second IP address information to the target application client, so that the target application client accesses the second network environment according to the second IP address information.
In one possible implementation, the determining module 902 is configured to:
determining second network address information corresponding to the first domain name information from the network switching corresponding relation;
determining second domain name information matched with the second network address information, and sending the second domain name information to a domain name system server to request the domain name system server to conduct domain name resolution on the second domain name information;
and receiving second IP address information corresponding to the second domain name information returned by the domain name system server.
In one possible implementation, the determining module 902 is configured to:
the first domain name information is sent to a domain name system server to request the domain name system server to conduct domain name resolution on the first domain name information;
receiving first IP address information corresponding to the first domain name information returned by the domain name system server;
and searching an IP address forwarding relation table to determine the IP address information to be forwarded corresponding to the first IP address information as second IP address information, wherein the IP address forwarding relation table is determined according to the network switching corresponding relation.
In one possible implementation, the determining module 902 is configured to:
determining a first IP address and a first port corresponding to the first network address information, and determining a second IP address and a second port corresponding to the second network address information;
configuring a first IP address and a first port as input of an iptables forwarding table, and configuring a second IP address and a second port as output of the iptables forwarding table;
and determining the configured iptables forwarding table as an IP address conversion relation table.
In one possible implementation, the determining module 902 is configured to:
when the network where the terminal equipment is located is detected to be switched, the updated IP address information corresponding to the IP address information to be forwarded in the IP address forwarding relation table after the network is switched is obtained;
And replacing the corresponding IP address information to be forwarded with the updated IP address information so as to update the IP address forwarding relation table.
In one possible embodiment, the network handover correspondence is obtained from an operation performed on a network client in the terminal device.
In one possible implementation, the determining module 902 is configured to:
responding to configuration triggering operation aiming at a target application client, and displaying a target conversion configuration interface corresponding to the target application client through a network client, wherein the target conversion configuration interface comprises a source input area and a target input area;
obtaining first network address information in response to a first input operation for a source input area, and obtaining second network address information in response to a second input operation for a destination input area;
and determining a network switching corresponding relation according to the first network address information and the second network address information.
All relevant contents of each step involved in the foregoing embodiment of the method for controlling a switching network environment may be cited in the functional description of the functional module corresponding to the device for controlling a switching network environment in the embodiment of the present application, which is not described herein.
The division of the modules in the embodiments of the present application is schematically only one logic function division, and there may be another division manner in actual implementation, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, or may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules.
Based on the same inventive concept, the embodiment of the present application also provides an electronic device, for example, a terminal device in the foregoing method embodiment. Referring to fig. 10, the electronic device in the embodiment of the present application includes at least one processor 1001 and a memory 1002 connected to the at least one processor, and the embodiment of the present application is not limited to a specific connection medium between the processor 1001 and the memory 1002, for example, the processor 1001 and the memory 1002 may be connected by a bus, and the bus may be divided into an address bus, a data bus, a control bus, and the like.
In an embodiment of the present application, the memory 1002 stores instructions executable by the at least one processor 1001, and the at least one processor 1001 may perform the steps included in the aforementioned method for controlling a switching network environment by executing the instructions stored in the memory 1002.
The processor 1001 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 1002 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1002 in embodiments of the present application may also be circuitry or any other device capable of performing memory functions for storing program instructions and/or data.
The processor 1001 is a control center of the electronic device, and may connect various parts of the entire electronic device using various interfaces and lines, and by executing or executing instructions stored in the memory 1002 and invoking data stored in the memory 1002, various functions of the electronic device and process the data, thereby performing overall monitoring of the electronic device. Alternatively, the processor 1001 may include one or more processing units, and the processor 1001 may integrate an application processor and a modem processor, wherein the application processor primarily processes an operating system, a user interface, an application program, and the like, and the modem processor primarily processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip, and in some embodiments they may be implemented separately on separate chips.
Further, the electronic device in the embodiment of the present application may further include an input unit 1003, a display unit 1004, a radio frequency unit 1005, an audio circuit 1006, a speaker 1007, a microphone 1008, a wireless fidelity (Wireless Fidelity, wiFi) module 1009, a bluetooth module 1010, a power supply 1011, an external interface 1012, a headphone jack 1013, and the like. It will be appreciated by those skilled in the art that fig. 10 is merely an example of an electronic device and is not meant to be limiting, and that an electronic device may include more or fewer components than shown, or may combine certain components, or may be different.
The input unit 1003 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. For example, the input unit 1003 may include a touch screen 1014 and other input devices 1015. The touch screen 1014 may collect touch operations on or near the user (such as operations of the user on the touch screen 1014 or near the touch screen 1014 using any suitable object such as a finger, a joint, a stylus, etc.), i.e., the touch screen 1014 may be used to detect touch pressure as well as touch input position and touch input area and to drive the corresponding connection means according to a predetermined program. The touch screen 1014 may detect a touch operation of the touch screen 1014 by a user, convert the touch operation into a touch signal to be transmitted to the processor 1001, or understand that touch information of the touch operation may be transmitted to the processor 1001, and may receive a command transmitted from the processor 1001 and execute the command. The touch information may include at least one of pressure magnitude information and pressure duration information. The touch screen 1014 may provide an input interface and an output interface between the electronic device and a user. In addition, the touch screen 1014 can be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch screen 1014, the input unit 1003 may include other input devices 1015. For example, other input devices 1015 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1004 may be used to display information input by a user or information provided to the user as well as various menus of the electronic device. Further, the touch screen 1014 may cover the display unit 1004, and when the touch screen 1014 detects a touch operation thereon or thereabout, the touch screen 1014 transmits pressure information of the touch operation to the processor 1001 for determination. In an embodiment of the present application, the touch screen 1014 and the display unit 1004 may be integrated into one component to implement the input, output, and display functions of the electronic device. For ease of description, the embodiments of the present application are schematically illustrated with the touch screen 1014 representing a functional set of the touch screen 1014 and the display unit 1004, although in some embodiments, the touch screen 1014 and the display unit 1004 may be separate components.
When the display unit 1004 and the touch panel are stacked on each other in the form of layers to form the touch screen 1014, the display unit 1004 may serve as an input device and an output device, and may be used to display images when serving as an output device, for example, to enable playback of various videos. The display unit 1004 may include at least one of a liquid crystal display (Liquid Crystal Display, LCD), a thin film transistor liquid crystal display (Thin Film Transistor Liquid Crystal Display, TFT-LCD), an organic light emitting diode (Organic Light Emitting Diode, OLED) display, an active matrix organic light emitting diode (Active Matrix Organic Light Emitting Diode, AMOLED) display, an In-Plane Switching (IPS) display, a flexible display, a 3D display, and the like. Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as a transparent display, the electronic device may include two or more display units (or other display means) depending on the particular desired implementation, e.g., the electronic device may include an external display unit (not shown in fig. 10) and an internal display unit (not shown in fig. 10).
The rf unit 1005 may be used for receiving and transmitting information or signals during a call. Typically, the radio frequency circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, and the like. In addition, the radio frequency unit 1005 may also communicate with network devices and other devices via wireless communication.
The audio circuit 1006, speaker 1007, microphone 1008 can provide an audio interface between a user and the electronic device. The audio circuit 1006 may transmit the received electrical signal after audio data conversion to the speaker 1007, and the speaker 1007 converts the electrical signal into a sound signal for output. On the other hand, the microphone 1008 converts the collected sound signals into electrical signals, which are received by the audio circuit 1006 and converted into audio data, which are processed by the audio data output processor 1001 and sent to, for example, another electronic device via the radio frequency unit 1005, or the audio data are output to the memory 1002 for further processing, and the audio circuit may also include a headphone jack 1013 for providing a connection interface between the audio circuit and headphones.
WiFi belongs to a short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 1009, so that wireless broadband Internet access is provided for the user. Although fig. 10 shows a WiFi module 1009, it is understood that it does not belong to the necessary constitution of the electronic device, and can be omitted entirely as required within the scope of not changing the essence of the invention.
Bluetooth is a short-range wireless communication technology. By utilizing the Bluetooth technology, communication between mobile communication electronic equipment such as palm computers, notebook computers and mobile phones can be effectively simplified, communication between the mobile communication electronic equipment and the Internet (Internet) can be successfully simplified, and the electronic equipment enables data transmission between the electronic equipment and the Internet to be quicker and more efficient through the Bluetooth module 1010, so that a road is widened for wireless communication. Bluetooth technology is an open scheme that enables wireless transmission of voice and data. Although fig. 10 shows a bluetooth module 1010, it is understood that it does not belong to the essential constitution of the electronic device, and can be omitted entirely as required within the scope not changing the essence of the invention.
The electronic device may also include a power source 1011 (such as a battery) for receiving external power or powering the various components within the electronic device. Preferably, the power source 1011 may be logically connected to the processor 901 through a power management system, so that functions of managing charge, discharge, and power consumption management are implemented through the power management system.
The electronic device may also include an external interface 1012, where the external interface 1012 may include a standard Micro USB interface, may include a multi-pin connector, may be used to connect the electronic device to communicate with other devices, and may be used to connect a charger to charge the electronic device.
Although not shown, the electronic device in the embodiment of the present application may further include other possible functional modules such as a camera, a flash, and so on, which are not described herein.
Based on the same inventive concept, the embodiments of the present application also provide a storage medium, which may be a computer-readable storage medium, having stored therein computer instructions which, when run on a computer, cause the computer to perform the steps of the method of controlling switching network environments as described above.
Based on the same inventive concept, the embodiments of the present application further provide a chip system, where the chip system includes a processor and may further include a memory, to implement the steps of the method for controlling the switching network environment as described above, or to implement the steps of the method for controlling the switching network environment as described above. The chip system may be formed of a chip or may include a chip and other discrete devices.
In some possible implementations, aspects of the method for controlling a switching network environment provided by the embodiments of the present application may also be implemented in the form of a program product including program code for causing a computer to perform the steps in the method for controlling a switching network environment according to various exemplary embodiments of the present application as described above when the program product is run on a computer.
Wherein the program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable signal medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (not exhaustive) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A method of controlling a handover network environment, the method comprising:
An access request initiated by a target application client in terminal equipment and used for requesting access to a first network environment is acquired, wherein the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment;
determining second IP address information corresponding to a second network environment to be accessed by the target application client according to a network switching corresponding relation corresponding to the target application client and the first domain name information, wherein the network switching corresponding relation comprises first network address information and corresponding second network address information, the first network address information is the network address information corresponding to the first network environment, and the second network address information is the network address information corresponding to the second network environment;
and configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.
2. The method of claim 1, wherein obtaining second IP address information corresponding to a second network environment to be accessed by the target application client according to the network handover correspondence corresponding to the target application client and the first domain name information, comprises:
Determining second network address information corresponding to the first domain name information from the network switching corresponding relation;
determining second domain name information matched with the second network address information, and sending the second domain name information to a domain name system server to request the domain name system server to conduct domain name resolution on the second domain name information;
and receiving second IP address information corresponding to the second domain name information returned by the domain name system server.
3. The method of claim 1, wherein obtaining second IP address information corresponding to a second network environment to be accessed by the target application client according to the network handover correspondence corresponding to the target application client and the first domain name information, comprises:
sending the first domain name information to a domain name system server to request the domain name system server to conduct domain name resolution on the first domain name information;
receiving first IP address information corresponding to the first domain name information returned by the domain name system server;
and searching an IP address forwarding relation table to determine the IP address information to be forwarded corresponding to the first IP address information as the second IP address information, wherein the IP address forwarding relation table is determined according to the network switching corresponding relation.
4. A method as claimed in claim 3, wherein the method further comprises:
acquiring first network address information and corresponding second network address information in the network switching corresponding relation;
determining a first IP address and a first port corresponding to the first network address information, and determining a second IP address and a second port corresponding to the second network address information;
configuring the first IP address and the first port as inputs of an iptables forwarding table, and configuring the second IP address and the second port as outputs of the iptables forwarding table;
and determining the configured iptables forwarding table as the IP address conversion relation table.
5. A method as claimed in claim 3, wherein the method further comprises:
when the network where the terminal equipment is located is detected to be switched, the updated IP address information corresponding to the IP address information to be forwarded in the IP address forwarding relation table after the network is switched is obtained;
and replacing the corresponding IP address information to be forwarded with the updated IP address information to update the IP address forwarding relation table.
6. A method according to any of claims 1-5, wherein the network handover correspondence is derived from an operation performed on a network client in the terminal device.
7. The method of claim 6, wherein the network handover correspondence is obtained as follows:
responding to configuration triggering operation aiming at the target application client, and displaying a target conversion configuration interface corresponding to the target application client through the network client, wherein the target conversion configuration interface comprises a source input area and a target input area;
obtaining the first network address information in response to a first input operation for the source input area, and obtaining the second network address information in response to a second input operation for the destination input area;
and determining the network switching corresponding relation according to the first network address information and the second network address information.
8. An apparatus for controlling a switching network environment, the apparatus comprising:
the system comprises an acquisition module, a first network environment and a second network environment, wherein the acquisition module is used for acquiring an access request which is initiated by a target application client in terminal equipment and used for requesting to access a first network environment, the access request comprises first domain name information corresponding to the first network environment, and the first network environment is a network environment corresponding to an installation version of the target application client in the terminal equipment;
The determining module is configured to determine second IP address information corresponding to a second network environment to be accessed by the target application client according to a network switching correspondence corresponding to the target application client and the first domain name information, where the network switching correspondence includes first network address information and corresponding second network address information, the first network address information is network address information corresponding to the first network environment, and the second network address information is network address information corresponding to the second network environment;
and the configuration module is used for configuring the second IP address information to the target application client so that the target application client accesses the second network environment according to the second IP address information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1-7 when the computer program is executed.
10. A storage medium storing computer-executable instructions for causing a computer to perform the steps comprised by the method of any one of claims 1-7.
CN202010707240.0A 2020-07-21 2020-07-21 Method and device for controlling switching network environment and electronic equipment Active CN114040025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010707240.0A CN114040025B (en) 2020-07-21 2020-07-21 Method and device for controlling switching network environment and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010707240.0A CN114040025B (en) 2020-07-21 2020-07-21 Method and device for controlling switching network environment and electronic equipment

Publications (2)

Publication Number Publication Date
CN114040025A CN114040025A (en) 2022-02-11
CN114040025B true CN114040025B (en) 2023-10-10

Family

ID=80134062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010707240.0A Active CN114040025B (en) 2020-07-21 2020-07-21 Method and device for controlling switching network environment and electronic equipment

Country Status (1)

Country Link
CN (1) CN114040025B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760298B (en) * 2022-03-18 2024-05-28 中国人寿保险股份有限公司 Service request response method, device, electronic equipment and storage medium
CN114785781B (en) * 2022-03-22 2024-03-26 阿里巴巴(中国)有限公司 Data access method and device
CN116662016B (en) * 2023-07-25 2023-10-20 太平金融科技服务(上海)有限公司 Port switching method, device, computer equipment, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2806713A1 (en) * 2012-02-23 2013-08-23 Time Warner Cable, Inc. Apparatus and methods for content distribution to packet-enabled devices via a network bridge
CN105391811A (en) * 2014-08-29 2016-03-09 腾讯科技(深圳)有限公司 DNS (domain name resolution) method, access method for application server, and terminal
CN107634851A (en) * 2017-08-11 2018-01-26 珠海金山网络游戏科技有限公司 A kind of method of mobile terminal dynamic configuration server
CN109451084A (en) * 2018-09-14 2019-03-08 华为技术有限公司 A kind of service access method and device
CN109525679A (en) * 2019-01-08 2019-03-26 郑州云海信息技术有限公司 A kind of web file server test method based on http protocol

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2806713A1 (en) * 2012-02-23 2013-08-23 Time Warner Cable, Inc. Apparatus and methods for content distribution to packet-enabled devices via a network bridge
CN105391811A (en) * 2014-08-29 2016-03-09 腾讯科技(深圳)有限公司 DNS (domain name resolution) method, access method for application server, and terminal
CN107634851A (en) * 2017-08-11 2018-01-26 珠海金山网络游戏科技有限公司 A kind of method of mobile terminal dynamic configuration server
CN109451084A (en) * 2018-09-14 2019-03-08 华为技术有限公司 A kind of service access method and device
CN109525679A (en) * 2019-01-08 2019-03-26 郑州云海信息技术有限公司 A kind of web file server test method based on http protocol

Also Published As

Publication number Publication date
CN114040025A (en) 2022-02-11

Similar Documents

Publication Publication Date Title
CN114040025B (en) Method and device for controlling switching network environment and electronic equipment
CN105471931B (en) Method, device and system for inquiring service data
US20110093567A1 (en) Mobile terminal for providing mobile cloud service and operation method thereof
WO2015043361A1 (en) Methods, devices, and systems for completing communication between terminals
CN108595218B (en) Method and device for loading dynamic library of system
CN106502703B (en) Function calling method and device
WO2017185382A1 (en) Method and related device for virtual sim card distribution and accessing network
CN109428839B (en) CDN scheduling method, device and system
US20190317783A1 (en) Methods, apparatus, and systems for providing access to serial ports of virtual machines in self-deployed virtual applications
CN110020293B (en) Multimedia data display method, device and storage medium
WO2019057155A1 (en) Method and device for dynamically managing kernel node
WO2014169616A1 (en) Systems and methods for accessing network data
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
WO2019001348A1 (en) Object interception method, terminal, server and storage medium
US20170289243A1 (en) Domain name resolution method and electronic device
CN106534281A (en) Data request responding method, apparatus and system
US20200334317A1 (en) Methods and systems for caching and searching for search results
CN113965543B (en) Access method, device and storage medium of application server
WO2017219293A1 (en) Method and device for acquiring web content
CN115658348A (en) Micro-service calling method, related device and storage medium
US20140282057A1 (en) System for applying applications of different operating systems in one electronic device and method thereof
CN111400072B (en) Interface calling method, storage medium and related equipment
CN105025064B (en) Download the method, apparatus and system of file
CN111475843B (en) Data processing method and related device
CN108132844B (en) Plug-in downloading method and device

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