CN113347284A - Resource access method, resource access device, electronic device and storage medium - Google Patents
Resource access method, resource access device, electronic device and storage medium Download PDFInfo
- Publication number
- CN113347284A CN113347284A CN202110642578.7A CN202110642578A CN113347284A CN 113347284 A CN113347284 A CN 113347284A CN 202110642578 A CN202110642578 A CN 202110642578A CN 113347284 A CN113347284 A CN 113347284A
- Authority
- CN
- China
- Prior art keywords
- domain name
- connection
- data
- binding relationship
- binding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/14—Routing performance; Theoretical aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention relates to the technical field of Internet and discloses a resource access method, a resource access device, electronic equipment and a storage medium. The resource access method comprises the following steps: determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection; and acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name. According to the technical scheme provided by the embodiment of the application, the network resource corresponding to the domain name can be accessed through the designated data dial-up connection.
Description
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a resource access method, a resource access device, electronic equipment and a storage medium.
Background
The process of establishing wireless Data services is known as Data dialing (Data Call). After the data dialing connection is successfully established, information such as an Internet Protocol (IP) address, a gateway address, a DNS (domain name system) and the like is acquired. In an actual application scenario, a plurality of data dialing connections can be created simultaneously, and different services can be performed through different data dialing connections. In the scenario of service access using a domain name, the domain name needs to be accessed using a specified data dial-up connection.
However, there may be multiple data dial-up connections for one device. How to use a designated data dial-up connection when accessing a certain network service is a problem to be solved.
Disclosure of Invention
An object of embodiments of the present invention is to provide a resource access method, a resource access apparatus, an electronic device, and a storage medium, which can access a network resource corresponding to a domain name through a specified data dial-up connection.
To solve the foregoing technical problem, in a first aspect, an embodiment of the present invention provides a resource access method, including: determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection; and acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name.
In a second aspect, an embodiment of the present invention provides a resource access apparatus, including: the proxy module and the domain name binding module; the agent module is used for determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relation between the domain name and the data dialing connection; the domain name binding module is used for acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name.
In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of resource access as mentioned in the above embodiments.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the resource access method mentioned in the foregoing embodiment.
According to the resource access method, the resource access device, the electronic device and the storage medium provided by the embodiment of the invention, a Long Term Evolution (LTE) module can determine the data dial-up connection corresponding to the domain name carried by the domain name resolution request according to the binding relationship between the pre-stored domain name and the data dial-up connection, further acquire the IP address corresponding to the domain name through the data dial-up connection corresponding to the domain name, and generate the routing rule, so that when a user accesses the network resource through the domain name, the network resource corresponding to the domain name can be accessed through the data dial-up connection corresponding to the domain name.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of a resource access method in an embodiment of the present application;
FIG. 2 is a flow chart of a resource access method in another embodiment of the present application;
FIG. 3 is a flow chart of a resource access method in a further embodiment of the present application;
FIG. 4 is a flow chart of a resource access method in yet another embodiment of the present application;
FIG. 5 is a flow chart of a resource access method in a further embodiment of the present application;
FIG. 6 is a flow chart of a resource access method in yet another embodiment of the present application;
FIG. 7 is a flow chart of a resource access method in a further embodiment of the present application;
FIG. 8 is a diagram illustrating interaction among a local application, a DNS proxy server, and a domain name binding server in an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a resource access device in an embodiment of the present application
Fig. 10 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
In a network, network access to a certain server is performed by an IP address. A user often uses a Domain Name method to access a network (for example, access www.xxx.com), and will first resolve a Domain Name into an IP address, that is, a Domain Name System (DNS) server using data dial-up connection resolves the Domain Name into the IP address, and then uses the resolved IP address to access the network through a socket () function. However, there may be multiple data dial-up connections for the LTE module. The manner in which routing rules are used in an operating system (e.g., Linux) defines which data dial-up connection to use to access a certain network resource. The format of the routing rule is: the destination IP address via is the gateway dev (pointing) data dial-up connection interface name of the data dial-up connection. From this principle, it can be known that, when a domain name is accessed by using a certain data dial-up connection, a DNS server that needs to use the data dial-up connection first resolves an IP address of the domain name, and then sets a routing rule to direct the IP address to the data dial-up connection. However, for some third party software and Local Area Network (LAN) hosts connected to the devices, the purpose of accessing Network resources by specific data dialing cannot be achieved in this way. The reason is that the third party software and the logic of the LAN host cannot be modified. Currently, the steps for third party software and LAN hosts to access network resources using domain names are as follows: calling a network information query function (gethostbyname) type function in a Linux standard library, resolving a domain name into an IP address, and then establishing socket connection by using the IP address to access network resources. However, the gethostbyname function in the Linux standard library cannot use the designated DNS to perform domain name resolution, and the user needs to implement a domain name resolution interface by himself. The scheme uses the domain name to access the network resource for the third-party software and the LAN host of the access device, and cannot realize the specific data dialing connection when the domain name is accessed.
In the embodiment of the application, the resource access method can be applied to an LTE module. The resource access method shown in fig. 1 includes the following steps.
Step 101: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 102: and acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name.
In the embodiment of the application, the LTE module can determine the data dial-up connection corresponding to the domain name carried by the domain name resolution request according to the binding relationship between the pre-stored domain name and the data dial-up connection, and then acquire the IP address corresponding to the domain name through the data dial-up connection corresponding to the domain name to generate the routing rule, so that when a user accesses the network resource through the domain name, the network resource corresponding to the domain name can be accessed through the data dial-up connection corresponding to the domain name.
In one embodiment, as shown in FIG. 2, step 102: the method comprises the following substeps of obtaining an Internet Protocol (IP) address corresponding to a domain name through data dialing connection corresponding to the domain name and generating a routing rule corresponding to the domain name:
step 1021: and sending a domain name resolution request to a domain name resolution server corresponding to the data dialing connection corresponding to the domain name. Specifically, the domain name resolution server resolves the domain name according to the received domain name resolution request to obtain an IP address corresponding to the domain name, and returns a resolution result to the LTE module.
Step 1022: and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the corresponding domain name resolution server.
Step 1023: and generating a routing rule corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name and the data dial-up connection corresponding to the domain name.
Take the data dial-up connection as an example. The LTE module carries out domain name resolution by using a domain name resolution server connected with the data dial corresponding to the domain name. And after the resolution is successful, obtaining the IP address corresponding to the domain name. And the LTE module sets a routing rule according to the IP address corresponding to the domain name. The data dialing connection is a mode that the LTE module is connected to data dialing, for example, home gateway equipment, and an interface connected to the data dialing is an Ethernet port, a WIFI wireless interface and the like. As for the vehicle-mounted module, the interface connected to the data dialing includes data dialing, WIFI and the like.
It should be noted that, those skilled in the art can understand that the data dialing connection may also be other connections, and this embodiment is only an example.
In this embodiment, after setting the binding relationship between the domain name and the data dial-up connection, when the LTE module accesses the domain name, the domain name can be automatically resolved by using the domain name resolution server of the data dial-up connection corresponding to the domain name, and after the resolution is completed, the corresponding routing rule is automatically set. Compared with the method that when domain name resolution is carried out, a domain name resolution server connected through data dialing is manually set, after an IP address is obtained, the IP address after resolution is manually set to be routed to the designated data dialing connection, and finally the domain name is accessed by using the designated data dialing connection, the operation is simpler.
In one embodiment, before obtaining an internet protocol IP address corresponding to a domain name through a data dial-up connection corresponding to the domain name and generating a routing rule corresponding to the domain name, the method further includes: and determining that the binding relation matched with the domain name exists in the binding relation between the domain name and the data dial-up connection.
In this embodiment, it is first determined whether a binding relationship of a domain name carried by the domain name resolution request exists, so that resource waste caused by performing subsequent operations under the condition of an unmatched binding relationship is avoided.
Optionally, the determining that a binding relationship matching the domain name exists in the binding relationship between the domain name and the data dial-up connection includes: matching and inquiring in the binding relationship between the domain name and the data dial-up connection by using the domain name, and judging whether the binding relationship matched with the domain name exists or not; if the domain name exists, determining that a binding relation matched with the domain name exists in the binding relation of the domain name and the data dialing connection; and if the domain name does not exist, using the previous-level domain name of the domain name, matching and inquiring in the binding relationship between the domain name and the data dial-up connection, judging whether the binding relationship matched with the previous-level domain name of the domain name exists, if the binding relationship matched with the domain name exists, taking the binding relationship corresponding to the previous-level domain name of the domain name as the binding relationship matched with the domain name, and determining that the binding relationship matched with the domain name exists. For example, for the aa.bb.cc, the matching is performed by using the aa.bb.cc, and if the binding relationship corresponding to the aa.bb.cc is not matched, the matching is performed by using the bb.cc. Since the matching is performed using bb.cc, the domain name bb.cc and the domain name aa.bb.cc can be matched. In this embodiment, by setting multi-level domain name matching, the batch matching of domain names can be realized.
Optionally, if it is determined that the binding relationship between the domain name and the data dial-up connection does not exist in the binding relationship between the domain name and the data dial-up connection, the resource access method further includes: sending a domain name resolution request to a default domain name resolution server; and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
Specifically, as shown in fig. 3, the resource access method includes the following steps:
step 301: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 302: and judging whether a binding relation matched with the domain name carried by the domain name resolution request exists in the binding relation of the domain name and the data dial-up connection. If yes, go to step 303, and if no, go to step 304.
Step 303: and acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name. The flow is then ended.
Step 304: sending a domain name resolution request to a default domain name resolution server; and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
In this embodiment, a compatible mechanism is set for a domain name for which a binding relationship is not set, and a domain name resolution request is resolved by a default domain name resolution server to obtain an IP address corresponding to the domain name, so that compatibility of the resource access method is improved.
It should be noted that, as can be understood by those skilled in the art, other measures may also be adopted when the binding relationship corresponding to the domain name carried by the domain name resolution request is not matched, and this embodiment is merely an example.
In one embodiment, after obtaining the internet protocol IP address corresponding to the domain name, the resource access method further includes: and establishing communication connection of the network resources corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name. Specifically, after the IP address is acquired, a socket connection is created using the IP address, and network access is performed.
In this embodiment, the communication connection is established based on the routing rule, so that the LTE module can access the network resource corresponding to the domain name through the specified data dial-up connection.
In one embodiment, before determining the data dial-up connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dial-up connection, the resource access method includes: and loading and storing the binding relationship between the domain name and the data dial-up connection. Specifically, the user may create a binding relationship between the domain name and the data dial-up connection on the LTE module or other device. And the LTE module loads the binding relation between the domain name and the data dialing connection and stores the binding relation in a database.
It should be noted that, as can be understood by those skilled in the art, the binding relationship between the domain name and the data dial-up connection may be stored in the LTE module in the form of a data table, or may be stored in the device in other forms, which is not limited in this embodiment.
In one embodiment, before determining the data dial-up connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dial-up connection, the resource access method further includes: and acquiring a domain name resolution request through a network information query function (gethostbyname) type domain name resolution interface.
In this embodiment, the gethostbyname domain name resolution interface is a domain name resolution interface of the C library, so that the resource access method of this embodiment can be compatible with the domain name resolution interface in the C library, and further can be compatible with all application programs using the domain name resolution interface in the C library.
It should be noted that, as will be understood by those skilled in the art, the domain name resolution request may also be initiated through other interfaces, and this embodiment is merely an example.
The above embodiments can be mutually combined and cited, for example, the following embodiments are examples after being combined, but not limited thereto; the embodiments can be arbitrarily combined into a new embodiment without contradiction.
In one embodiment, the resource access method as shown in FIG. 4 includes the following steps.
Step 401: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 402: and judging whether a binding relation matched with the domain name carried by the domain name resolution request exists in the binding relation of the domain name and the data dial-up connection. If yes, go to step 403, and if no, go to step 406.
Step 403: and sending a domain name resolution request to a domain name resolution server corresponding to the data dialing connection corresponding to the domain name.
Step 404: and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the corresponding domain name resolution server.
Step 405: and generating a routing rule corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name and the data dial-up connection corresponding to the domain name. The flow is then ended.
Step 406: sending a domain name resolution request to a default domain name resolution server; and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, loading and storing the binding relationship between the domain name and the data dialing connection.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, the domain name resolution request is obtained through a network information query function domain name resolution interface.
In one embodiment, the resource access method as shown in FIG. 5 includes the following steps.
Step 501: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 502: and sending a domain name resolution request to a domain name resolution server corresponding to the data dialing connection corresponding to the domain name.
Step 503: and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the corresponding domain name resolution server.
Step 504: and generating a routing rule corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name and the data dial-up connection corresponding to the domain name.
Step 505: and establishing communication connection of the network resources corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, loading and storing the binding relationship between the domain name and the data dialing connection.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, the domain name resolution request is obtained through a network information query function domain name resolution interface.
In one embodiment, the resource access method as shown in FIG. 6 includes the following steps.
Step 601: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 602: and judging whether a binding relation matched with the domain name carried by the domain name resolution request exists in the binding relation of the domain name and the data dial-up connection. If yes, go to step 603, and if no, go to step 604.
Step 603: and acquiring an Internet Protocol (IP) address corresponding to the domain name through data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dialing connection corresponding to the domain name. Step 605 is then performed.
Step 604: sending a domain name resolution request to a default domain name resolution server; and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
Step 605: and establishing communication connection of the network resources corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, loading and storing the binding relationship between the domain name and the data dialing connection.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, the domain name resolution request is obtained through a network information query function domain name resolution interface.
In one embodiment, the resource access method as shown in FIG. 7 includes the following steps.
Step 701: and determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection.
Step 702: and judging whether a binding relation matched with the domain name carried by the domain name resolution request exists in the binding relation of the domain name and the data dial-up connection. If yes, go to step 703, and if no, go to step 706.
Step 703: and sending a domain name resolution request to a domain name resolution server corresponding to the data dialing connection corresponding to the domain name.
Step 704: and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the corresponding domain name resolution server.
Step 705: and generating a routing rule corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name and the data dial-up connection corresponding to the domain name. Step 707 is then executed.
Step 706: sending a domain name resolution request to a default domain name resolution server; and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
Step 707: and establishing communication connection of the network resources corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, loading and storing the binding relationship between the domain name and the data dialing connection.
Optionally, before determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dialing connection, the domain name resolution request is obtained through a network information query function domain name resolution interface.
In one embodiment, the LTE module is provided with a local application, a DNS proxy service program, and a domain name binding service program. The local application program, the DNS proxy service program and the domain name binding service program are matched to access the network resource. The local application may be a client application, a third party application, or an application on the LAN host. The DNS proxy service may be an open source DNS proxy service, such as a service tool (dnsmasq). And the domain name binding service program receives a response result of the domain name resolution request of the DNS proxy service program and sets a routing rule according to the response result. Specifically, the interaction of the local application, the DNS proxy service and the domain name binding service is schematically shown in fig. 8. Wherein the local application executes the steps of:
step 801: the local application is initialized.
Step 802: the local application program calls a gethostbyname standard library function to resolve the domain name and initiates a domain name resolution request to the DNS proxy service program.
Step 803: and the local application program acquires the domain name resolution response and acquires the IP address of the domain name.
Step 804: the native application establishes a socket connection using the IP address of the domain name.
Step 805: and the local application program accesses the network resource corresponding to the domain name through the data dial-up connection. The flow is then ended.
The DNS proxy server program executes the following steps:
step 806: the DNS proxy server initializes.
Step 807: the DNS proxy waits for a domain name resolution request.
Step 808: the DNS proxy receives a domain name resolution request.
Step 809: the DNS proxy service program inquires the binding relation between the domain name and the data dial-up connection and judges whether the binding relation corresponding to the domain name exists or not. If it is determined that the reference signal does not exist, step 810 is executed, and if it is determined that the reference signal exists, step 811 is executed.
Step 810: the DNS proxy service program uses a domain name resolution server with default configuration to perform domain name resolution. Step 813 is then performed.
Step 811: and the DNS proxy service program is connected with a corresponding domain name resolution server for domain name resolution through data dialing corresponding to the domain name.
Step 812: and acquiring the IP address, notifying a domain name binding service program, and waiting for confirmation information. After receiving the confirmation information, step 813 is performed.
Step 813: after the resolution is completed, a domain name resolution response is sent to the local application, and the process returns to step 807. The flow is then ended.
The domain name binding service program performs the following steps:
step 814: the domain name binding service program is initialized.
Step 815: the domain name binding service program creates a database that stores binding relationships between domain names and data dial-up connections.
Step 816: the domain name binding service program loads entries in a database that store binding relationships between domain names and data dial-up connections.
Step 817: the domain name binding service program waits for the notification of successful domain name resolution.
Step 818: and the domain name binding service program receives a notification of successful domain name resolution.
Step 819: the domain name binding service program sets routing rules. Specifically, a routing rule is set according to the IP address and the binding relationship between the domain name and the data dial-up connection.
Step 820: returning an acknowledgement to the DNS proxy server and returning to step 817.
As can be seen from the above, in this embodiment, the LTE module (e.g., LAN host) uses a unified mechanism when accessing data dial-up connection, and all goes through the DNS proxy service procedure. And setting a local loopback address in a DNS configuration file of the LTE module so as to receive a domain name resolution response. The domain name binding service program loads the binding relationship (i.e. binding rule) between the domain name and the data dial-up connection and stores the binding relationship in the database. When the local application program accesses the domain name, the domain name resolution request is sent to the DNS proxy service program. After receiving the domain name resolution request, the DNS proxy service program performs matching query on the database, and if the binding relation corresponding to the domain name carried by the domain name resolution request is not queried, the domain name resolution is performed by using a default domain name resolution server. And if the binding relation corresponding to the domain name carried by the domain name resolution request is inquired, performing domain name resolution by using a domain name resolution server in binding data dial connection. And after the resolution is successful, sending a domain name resolution success notice to the domain name binding service program. The successful domain name resolution notification includes the IP address corresponding to the domain name. And the domain name binding service program sets a routing rule according to the IP address corresponding to the domain name and the binding relation between the domain name and the data dialing connection, and returns confirmation information to the DNS proxy service program. And after receiving the confirmation information or the response of the default domain name resolution server, the DNS proxy service program confirms that the domain name resolution is finished. And after the domain name resolution is finished, sending a domain name resolution response to the local client program. And after the local client program obtains the IP address, establishing a socket by using the IP address to access the network. The resource access method of the embodiment enables a user to specify the binding rule to solve the problem of specifying the domain name to access the specific data dial-up connection in the scene of the multi-data dial-up connection, and is simple to operate. After a user sets a binding relationship, when a local application program on the LTE module accesses a domain name, a special domain name resolution mode is not needed, the binding of the domain name and the designated data dialing connection can be realized only by using a standard Linux domain name resolution function, a domain name resolution process is processed in a DNS proxy service program and a domain name binding service program, and the local application program of the LTE module is not needed to be modified. The LTE module enables compatibility of all applications using the domain name resolution interface in the C library through the gethostbyname class function (i.e., the domain name resolution interface in the C library). In the resource access method of this embodiment, the domain name assigned with the binding relationship is subjected to a special domain name resolution process, and the other domain names are subjected to a default domain name resolution process, so that the resource access method can be compatible with access to network resources corresponding to domain names not in the binding relationship.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
An embodiment of the present application further provides a resource access apparatus, as shown in fig. 9, including: a proxy module 901 and a domain name binding module 902. The agent module 901 is configured to determine a data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and a binding relationship between the domain name and the data dialing connection. The domain name binding module 902 is configured to obtain an internet protocol IP address corresponding to a domain name through data dial-up connection corresponding to the domain name, and generate a routing rule corresponding to the domain name, so as to access a network resource corresponding to the domain name through the data dial-up connection corresponding to the domain name.
It should be understood that this embodiment is a system implementation corresponding to the above method embodiment, and the embodiment can be implemented in cooperation with the above method embodiment. The related technical details mentioned in the above method embodiments are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related art details mentioned in the present embodiment can also be applied to the above-described method embodiments.
It should be noted that, all the modules involved in this embodiment are logic modules, and in practical application, one logic unit may be one physical unit, may also be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, a unit which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that there is no other unit in the present embodiment.
An embodiment of the present application further provides an electronic device, as shown in fig. 10, including: at least one processor 110; and a memory 120 communicatively coupled to the at least one processor 110; wherein the memory stores instructions executable by the at least one processor 110, the instructions being executable by the at least one processor 110 to enable the at least one processor 110 to perform the above-described method embodiments.
Where memory 120 and processor 110 are coupled in a bus, the bus may include any number of interconnected buses and bridges that couple one or more of the various circuits of processor 110 and memory 120 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 110 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor 110.
The processor 110 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 120 may be used to store data used by processor 110 in performing operations.
An embodiment of the present application further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.
Claims (10)
1. A resource access method is applied to a Long Term Evolution (LTE) module, and comprises the following steps:
determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection;
and acquiring an Internet Protocol (IP) address corresponding to the domain name through the data dialing connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access the network resource corresponding to the domain name through the data dialing connection corresponding to the domain name.
2. The method according to claim 1, wherein the obtaining an internet protocol IP address corresponding to the domain name and generating a routing rule corresponding to the domain name through the data dial-up connection corresponding to the domain name includes:
sending the domain name resolution request to a domain name resolution server corresponding to the data dialing connection corresponding to the domain name;
acquiring an Internet Protocol (IP) address corresponding to the domain name according to the response of the corresponding domain name resolution server;
and generating a routing rule corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name and the data dial-up connection corresponding to the domain name.
3. The method according to claim 1, wherein before the obtaining an internet protocol IP address corresponding to the domain name through the data dial-up connection corresponding to the domain name and generating the routing rule corresponding to the domain name, the method further comprises:
and determining that the binding relation matched with the domain name exists in the binding relation between the domain name and the data dialing connection.
4. The method according to claim 3, wherein the determining that a binding relationship matching the domain name exists in the binding relationship between the domain name and the data dial-up connection comprises:
matching and inquiring in the binding relationship between the domain name and the data dial-up connection by using the domain name, and judging whether the binding relationship matched with the domain name exists or not;
if the domain name exists, determining that a binding relation matched with the domain name exists in the binding relation of the domain name and the data dialing connection;
and if the domain name does not exist, using the previous-level domain name of the domain name, matching and inquiring in the binding relationship between the domain name and the data dial-up connection, judging whether the binding relationship matched with the previous-level domain name of the domain name exists, if the binding relationship matched with the domain name exists, taking the binding relationship corresponding to the previous-level domain name of the domain name as the binding relationship matched with the domain name, and determining that the binding relationship matched with the domain name exists.
5. The method according to claim 3, wherein if it is determined that there is no binding relationship matching the carried domain name in the binding relationship between the domain name and the data dial-up connection, the method further comprises:
sending a domain name resolution request to a default domain name resolution server;
and acquiring the Internet protocol IP address corresponding to the domain name according to the response of the default domain name resolution server.
6. The method according to claim 1 or 4, wherein after obtaining the internet protocol IP address corresponding to the domain name, the method further comprises:
and establishing communication connection of the network resource corresponding to the domain name according to the Internet protocol IP address corresponding to the domain name.
7. The resource access method according to any one of claims 1 to 4, wherein before determining the data dial-up connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and each data dial-up connection, the resource access method comprises:
and loading and storing the binding relationship between the domain name and the data dial-up connection.
8. A resource access apparatus, comprising: the proxy module and the domain name binding module;
the agent module is used for determining the data dialing connection corresponding to the domain name according to the domain name carried by the domain name resolution request and the binding relationship between the domain name and the data dialing connection;
the domain name binding module is used for acquiring an Internet Protocol (IP) address corresponding to the domain name through data dial-up connection corresponding to the domain name, and generating a routing rule corresponding to the domain name so as to access network resources corresponding to the domain name through the data dial-up connection corresponding to the domain name.
9. An electronic device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the resource access method of any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the resource access method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110642578.7A CN113347284B (en) | 2021-06-09 | 2021-06-09 | Resource access method, resource access device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110642578.7A CN113347284B (en) | 2021-06-09 | 2021-06-09 | Resource access method, resource access device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113347284A true CN113347284A (en) | 2021-09-03 |
CN113347284B CN113347284B (en) | 2023-08-15 |
Family
ID=77475622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110642578.7A Active CN113347284B (en) | 2021-06-09 | 2021-06-09 | Resource access method, resource access device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113347284B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102752411A (en) * | 2012-06-29 | 2012-10-24 | 华为终端有限公司 | Redirection method and device |
CN106603748A (en) * | 2016-12-30 | 2017-04-26 | 深圳市万普拉斯科技有限公司 | Terminal internet surfing method and terminal |
CN110224996A (en) * | 2019-05-20 | 2019-09-10 | 深圳壹账通智能科技有限公司 | Network Access Method, device, computer equipment and the storage medium of application program |
CN110247999A (en) * | 2019-07-11 | 2019-09-17 | 广东美的制冷设备有限公司 | Domain name analytic method, domain name mapping device, household appliance and storage medium |
CN111314499A (en) * | 2020-02-17 | 2020-06-19 | 深信服科技股份有限公司 | Domain name proxy method, device, equipment and readable storage medium |
CN112153168A (en) * | 2020-08-14 | 2020-12-29 | 深圳市广和通无线股份有限公司 | Network access method, device, computer equipment and storage medium |
CN112698113A (en) * | 2020-12-10 | 2021-04-23 | 上海移远通信技术股份有限公司 | Amplitude calibration method and device of receiving channel and network equipment |
-
2021
- 2021-06-09 CN CN202110642578.7A patent/CN113347284B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102752411A (en) * | 2012-06-29 | 2012-10-24 | 华为终端有限公司 | Redirection method and device |
CN106603748A (en) * | 2016-12-30 | 2017-04-26 | 深圳市万普拉斯科技有限公司 | Terminal internet surfing method and terminal |
CN110224996A (en) * | 2019-05-20 | 2019-09-10 | 深圳壹账通智能科技有限公司 | Network Access Method, device, computer equipment and the storage medium of application program |
CN110247999A (en) * | 2019-07-11 | 2019-09-17 | 广东美的制冷设备有限公司 | Domain name analytic method, domain name mapping device, household appliance and storage medium |
WO2021004144A1 (en) * | 2019-07-11 | 2021-01-14 | 广东美的制冷设备有限公司 | Domain name resolution method, domain name resolution device, household appliance, and storage medium |
CN111314499A (en) * | 2020-02-17 | 2020-06-19 | 深信服科技股份有限公司 | Domain name proxy method, device, equipment and readable storage medium |
CN112153168A (en) * | 2020-08-14 | 2020-12-29 | 深圳市广和通无线股份有限公司 | Network access method, device, computer equipment and storage medium |
CN112698113A (en) * | 2020-12-10 | 2021-04-23 | 上海移远通信技术股份有限公司 | Amplitude calibration method and device of receiving channel and network equipment |
Non-Patent Citations (2)
Title |
---|
冯忠义,杜祥,朱敏晓: ""家庭宽带用户IPv6地址分配实施方案的研究与部署"", 《江苏通信》 * |
冯忠义,杜祥,朱敏晓: ""家庭宽带用户IPv6地址分配实施方案的研究与部署"", 《江苏通信》, 5 January 2021 (2021-01-05) * |
Also Published As
Publication number | Publication date |
---|---|
CN113347284B (en) | 2023-08-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10924558B2 (en) | Network function information interaction method and device, and computer storage medium | |
CN111278031B (en) | PDU type setting method, UE strategy setting method, entity and storage medium | |
CN116057924B (en) | Methods, systems, and computer readable media for providing network function discovery service enhancements | |
JP2020522201A (en) | Service discovery methods, registration centers, and devices | |
CN110602724A (en) | Network configuration method and communication device | |
EP3648525A1 (en) | Network management method and system | |
CN110572820B (en) | Registration method and device of IMS terminal, position information server and storage medium | |
CN112104640B (en) | Data processing method, device and equipment of gateway and readable storage medium | |
CN104969515A (en) | Methods and gateways for processing DNS request | |
JP2024081633A (en) | Processing of service request | |
CN115567521A (en) | Communication method and device between local area network and public cloud, and computing equipment | |
EP3952403B1 (en) | Optimization of network function profile administration and registration | |
EP3439238A1 (en) | Architecture, method and apparatus for realizing network function communication | |
US11924294B2 (en) | Service request handling | |
US7593349B2 (en) | Method and arrangement for configuration of a device in a data network | |
CN104426816A (en) | Virtual machine communication method and device | |
CN115174310B (en) | PDN dialing and configuration method, system, device, equipment and storage medium | |
CN110278558B (en) | Message interaction method and WLAN system | |
CN113347284B (en) | Resource access method, resource access device, electronic equipment and storage medium | |
WO2017166038A1 (en) | Communication method and terminal | |
CN111314477A (en) | P2P communication method, system, home gateway, electronic device and storage medium | |
CN101465783B (en) | Connection method, device and connection network bridge for isomery household network appliances | |
CN110661895A (en) | Network address mapping method and network address mapping equipment of server | |
EP3579502A1 (en) | Outer multicast ip address allocation method and device | |
EP4106291A1 (en) | A method for operating a distributed application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |