CN110798491B - Network access method and device and proxy server - Google Patents

Network access method and device and proxy server Download PDF

Info

Publication number
CN110798491B
CN110798491B CN201810859903.3A CN201810859903A CN110798491B CN 110798491 B CN110798491 B CN 110798491B CN 201810859903 A CN201810859903 A CN 201810859903A CN 110798491 B CN110798491 B CN 110798491B
Authority
CN
China
Prior art keywords
network
ips
resource
binding
card
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
CN201810859903.3A
Other languages
Chinese (zh)
Other versions
CN110798491A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201810859903.3A priority Critical patent/CN110798491B/en
Publication of CN110798491A publication Critical patent/CN110798491A/en
Application granted granted Critical
Publication of CN110798491B publication Critical patent/CN110798491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a network access method and a device and a proxy server, wherein the network access method is applied to the proxy server, wherein a plurality of network cards are arranged in the proxy server, and each network card is respectively bound with at least one external network IP and at least one internal network IP; the proxy server stores the mapping relation between the external network IP and the internal network IP bound by each network card, and the method comprises the following steps: when any network card receives a network access request, determining a first network IP of the network card for receiving the network access request, wherein the first network IP is an intranet IP or an extranet IP; determining a second network IP according to the first network IP and the mapping relation; and carrying out network access according to the second network IP. Therefore, the scheme provided by the invention can improve the resource utilization rate of the proxy server.

Description

Network access method and device and proxy server
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a network access method and device and a proxy server.
Background
With the development of internet technology, people increasingly acquire information from the internet. However, since there are some security concerns in the common network resources, a proxy server is typically used for network access.
Currently, only a single network IP (Internet Protocol) is usually bound in a proxy server, and then network access is performed using the bound network IP. However, the proxy server only binds a single network IP, only a small amount of resources are occupied in the proxy process to complete network access, and a large amount of resources are in an idle state.
It can be seen that when the proxy server executes the proxy, only few resources are required to complete the proxy. Most resources in the proxy server are not utilized, so that the resource utilization rate of the proxy server is low in the conventional mode.
Disclosure of Invention
In view of this, the present invention provides a network access method and apparatus, and a proxy server, and mainly aims to improve the resource utilization rate of the proxy server.
In a first aspect, the present invention provides a network access method applied to a proxy server, wherein the proxy server is provided with a plurality of network cards, and each network card is respectively bound with at least one external network IP and at least one internal network IP; the proxy server stores the mapping relation between the outer network IP and the inner network IP bound to each network card, and the network access method comprises the following steps:
when any network card receives a network access request, determining a first network IP of the network card for receiving the network access request, wherein the first network IP is an intranet IP or an extranet IP;
determining a second network IP according to the first network IP and the mapping relation;
and performing network access according to the second network IP.
Alternatively to this, the first and second parts may,
prior to receiving the network access request, the method further comprises:
and binding each network card with at least one external network IP and at least one internal network IP respectively.
Alternatively to this, the first and second parts may,
the binding of each network card with at least one outer network IP and at least one inner network IP respectively comprises:
binding at least one intranet IP for each network card by adopting a first preset binding method;
binding at least one external network IP for each network card by adopting a second preset binding method;
the first preset binding method and the second preset binding method are the same or different;
the first preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method;
the second preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method.
In the alternative,
the first preset binding method is a dynamic IP binding method, and the binding of at least one intranet IP for each network card by using the first preset binding method includes:
selecting at least one intranet resource IP from a preset IP resource pool, and binding the selected at least one intranet resource IP with the network card; the IP resource pool is used for storing a plurality of intranet resource IPs, the number of the intranet resource IPs in the IP resource pool is larger than or equal to the number of the network cards, and each intranet resource IP is bound with at most one network card.
In the alternative,
the second preset binding method is a dynamic IP binding method, and adopts the second preset binding method to bind at least one external network IP for each network card respectively, and includes:
selecting at least one external network resource IP in a preset IP resource pool, and binding the selected at least one external network resource IP with the network card; the IP resource pool is used for storing a plurality of external network resource IPs, the number of the external network resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each external network resource IP is bound with at most one network card.
Alternatively to this, the first and second parts may,
the method further comprises the following steps:
when an IP updating instruction is received or a preset updating period is reached, reselecting at least one resource IP in the IP resource pool, and binding the reselected at least one resource IP with the network card; the reselected at least one resource IP is different from the at least one resource IP bound to the network card at the last time, and the resource IP is an intranet resource IP or an extranet resource IP;
and updating the mapping relation between the external network IP and the internal network IP bound by the network card according to the at least one resource IP re-bound on the network card.
In the alternative,
the determining a second network IP according to the first network IP and the mapping relationship includes:
according to the mapping relation, at least one network IP having the mapping relation with the first network IP is found out;
when the number of the found network IPs is one, determining the network IP as the second network IP;
when the number of the found network IPs is multiple, screening the second network IP from the multiple network IPs according to a preset screening condition; the screening condition comprises at least one of stability of the IP, IP sequencing and IP use frequency;
when the first network IP is an intranet IP, the second network IP is an extranet IP; and when the first network IP is an external network IP, the second network IP is an internal network IP.
In a second aspect, the present invention provides a network access device applied to a proxy server, wherein the proxy server is provided with a plurality of network cards, and each network card is respectively bound with at least one external network IP and at least one internal network IP; the proxy server stores the mapping relationship between the extranet IP and the intranet IP bound to each network card, and the network access device comprises:
the first determining module is used for determining a first network IP of the network card for receiving the network access request when any network card receives the network access request, wherein the first network IP is an intranet IP or an extranet IP;
a second determining module, configured to determine a second network IP according to the first network IP determined by the first determining module and the mapping relationship stored in the proxy server;
and the access module is used for carrying out network access according to the second network IP determined by the second determination module.
In a third aspect, the present invention provides a proxy server, comprising: a plurality of network cards and memories;
each network card is respectively bound with at least one outer network IP and at least one inner network IP;
the memory is used for storing the mapping relation between the outer network IP and the inner network IP bound to each network card;
the proxy server is configured to perform the network access method of any of the above.
In a fourth aspect, the present invention provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device in which the storage medium is located is controlled to execute the network access method described in any one of the foregoing methods.
In a fifth aspect, the present invention provides an electronic device, including a processor, a memory, and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the network access method of any of the above.
The embodiment of the invention provides a network access method and device and a proxy server, wherein when any network card in the proxy server receives a network access request, a first network IP (the first network IP can be an internal network IP or an external network IP bound by the network card) of the network access request received by the network card is determined. And then determining a second network IP according to the first network IP and the mapping relation between the outer network IP and the inner network IP bound by each network card stored in the proxy server (the second network IP is the outer network IP when the first network IP is the inner network IP; and the second network IP is the inner network IP when the first network IP is the outer network IP). And finally, performing network access according to the determined second network IP. As can be seen from the above, the proxy server stores the mapping relationship between the extranet IP and the intranet IP respectively bound by the multiple network cards, and when any one of the multiple network cards receives a network access request, network access can be performed according to the network IP receiving the network access request and the mapping relationship stored in the proxy server. Therefore, in the scheme provided by the embodiment of the invention, the proxy server is provided with the plurality of network cards, and network access is carried out according to the mapping relation between the intranet IP and the extranet IP bound by the plurality of network cards, so that the resource utilization rate of the proxy server can be improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a network access method applied to a proxy server according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a network access method applied to a proxy server according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a network access device applied to a proxy server according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a network access device applied to a proxy server according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a network access device applied to a proxy server according to yet another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a network access device applied to a proxy server according to yet another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a network access device applied to a proxy server according to yet another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a proxy server according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention provides a network access method applied to a proxy server, where the proxy server is provided with a plurality of network cards, and each network card is respectively bound to at least one external network IP and at least one internal network IP; the proxy server stores the mapping relation between the external network IP and the internal network IP bound by each network card, and the network access method comprises the following steps:
step 101: when any network card receives a network access request, determining a first network IP of the network card for receiving the network access request, wherein the first network IP is an intranet IP or an extranet IP;
step 102: determining a second network IP according to the first network IP and the mapping relation;
step 103: and performing network access according to the second network IP.
According to the embodiment shown in fig. 1, when any network card in the proxy server receives a network access request, it is determined that the network card receives a first network IP of the network access request (the first network IP may be an intranet IP or an extranet IP to which the network card is bound). And then determining a second network IP according to the first network IP and the mapping relation between the outer network IP and the inner network IP bound by each network card stored in the proxy server (the second network IP is the outer network IP when the first network IP is the inner network IP; and the second network IP is the inner network IP when the first network IP is the outer network IP). And finally, performing network access according to the determined second network IP. As can be seen from the above, the proxy server stores the mapping relationship between the extranet IP and the intranet IP respectively bound by the multiple network cards, and when any one of the multiple network cards receives a network access request, network access can be performed according to the network IP receiving the network access request and the mapping relationship stored in the proxy server. Therefore, in the scheme provided by the embodiment of the invention, the proxy server is provided with the plurality of network cards, and network access is carried out according to the mapping relation between the intranet IP and the extranet IP bound by the plurality of network cards, so that the resource utilization rate of the proxy server can be improved.
In an embodiment of the present invention, the number of network cards in the proxy server may be determined according to configuration parameters of the proxy server. For example, the configuration parameters of the proxy server may include, but are not limited to, at least one or more of the number of CPU cores, the master frequency, the memory size, and the hard disk size. The higher the configuration parameters are, the more the setting number of the network cards can be.
In this embodiment, the type of the network card may be determined according to the service requirement. For example, the network card may be a wired network card or a wireless network card.
In an embodiment of the present invention, before receiving the network access request, the method may further include step a:
a: and binding each network card with at least one external network IP and at least one internal network IP respectively.
In this embodiment, one or more intranet IPs may be bound to each network card according to specific service requirements. It should be noted that, when a plurality of intranet IPs are bound to a network card, the network card receives a network access request through one of the intranet IPs when receiving the network access request. When an intranet IP is bound on a network card, the network card receives a network access request through the intranet IP when receiving the network access request.
In this embodiment, one or more external network IPs may be bound to each network card according to specific service requirements. It should be noted that, when a plurality of external network IPs are bound to one network card, the network card receives a network access request through one of the external network IPs when receiving the network access request. When an external network IP is bound on a network card, the network card receives a network access request through the external network IP when receiving the network access request.
In this embodiment, at least one intranet IP and at least one extranet IP bound to the same network card have a mapping relationship. The mapping relation can be written into a file with a specified format and stored in the proxy server so as to record and use the mapping relation.
In this embodiment, the specific types of the intranet IP and the extranet IP can be determined according to the service requirement. Optionally, the intranet IP may be any one of, but not limited to, "10.0.0-10.255.255.255", "172.16.0.0-172.31.255.255", and "192.168.0.0-192.168.255.555". Alternatively, the pattern of the outer network IP may include any IP other than "10.0.0.0 to 10.255.255.255", "172.16.0.0 to 172.31.255.255", "192.168.0 to 192.168.255.555".
In an embodiment of the present invention, the step a related in the above embodiment of binding each network card with at least one external network IP and at least one internal network IP respectively may include the following steps:
a1: binding at least one intranet IP for each network card by adopting a first preset binding method; the first preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method;
a2: binding at least one external network IP for each network card by adopting a second preset binding method; the second preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method.
The first preset binding method and the second preset binding method may be the same or different. For example, the first preset binding method and the second preset binding method may both be static IP binding methods, or both may be dynamic IP binding methods; or, one of the first preset binding method and the second preset binding method is a dynamic IP binding method, and the other is a static IP binding method.
In this embodiment, according to different binding methods, at least four processes of performing step a to bind each network card with at least one extranet IP and at least one intranet IP exist as follows:
the first method comprises the following steps:
binding at least one intranet IP for each network card by adopting a static IP binding method;
and respectively binding at least one external network IP for each network card by adopting a static IP binding method.
And the second method comprises the following steps:
binding at least one intranet IP for each network card by adopting a static IP binding method;
and binding at least one external network IP for each network card by adopting a dynamic IP binding method.
And the third is that:
binding at least one intranet IP for each network card by adopting a dynamic IP binding method;
and binding at least one external network IP for each network card by adopting a static IP binding method.
And a fourth step of:
binding at least one intranet IP for each network card by adopting a dynamic IP binding method;
and binding at least one external network IP for each network card by adopting a dynamic IP binding method.
According to the embodiment, the same or different binding methods can be adopted to bind the intranet IP and the extranet IP for each network card respectively, so that the service applicability is strong.
In an embodiment of the present invention, when the first preset binding method is a dynamic IP binding method, the binding, in step A1, at least one intranet IP for each network card by using the first preset binding method may include:
selecting at least one intranet resource IP from a preset IP resource pool, and binding the selected at least one intranet resource IP with the network card; the IP resource pool is provided with a plurality of intranet resource IPs, the number of the intranet resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each intranet resource IP is bound with at most one network card.
In this embodiment, the IP resource pool may be determined according to specific service requirements. When the IP resource pool is a special intranet IP resource pool, the internal resource IPs are all intranet resource IPs, and the number of the intranet resource IPs is greater than or equal to the number of the network cards. When the IP resource pool is a shared IP resource pool of the internal network and the external network, the resource IP in the IP resource pool can be used as the internal network resource IP or the external network resource IP, and the number of the resource IPs is more than or equal to 2 times of the number of the network cards.
In this embodiment, the plurality of IP resources in the IP resource pool may be determined according to the service requirement. Alternatively, the plurality of resource IPs included in the IP resource pool may be a continuous plurality of IPs. The plurality of resource IPs included in the IP resource pool may be a discontinuous plurality of IPs. For example, the following steps are carried out: the IP resource pool includes 4 consecutive resource IPs, and the 4 resource IPs are "192.168.0.00, 192.168.0.01, 192.168.0.02, and 192.168.0.03", respectively. By way of example: the IP resource pool includes discontinuous 4 resource IPs, and the 4 resource IPs are respectively "115.183.008.004, 115.183.008.085, 115.183.008.150, and 115.183.008.200".
In this embodiment, the method for selecting at least one intranet resource IP in the IP resource pool may be: firstly, at least one intranet resource IP is randomly selected; secondly, when the plurality of resources P in the IP resource pool are a plurality of consecutive IPs, at least one intranet resource IP is sequentially selected according to the consecutive order of the IPs. By way of example: the proxy server is provided with a network card 1, a network card 2, a network card 3 and a network card 4, the IP resource pool comprises 5 continuous resources IP '192.168.0.00-192.168.0.04', and intranet resource IPs selected from the network card 1 to the network card 4 according to the continuous sequence of the IPs in the IP resource pool are 192.168.0.00, 192.168.0.01, 192.168.0.02 and 192.168.0.03 in sequence.
In an embodiment of the present invention, when the second preset binding method is a dynamic IP binding method, the step A2 uses the second preset binding method to bind at least one external network IP for each network card, which may include:
selecting at least one external network resource IP in a preset IP resource pool, and binding the selected at least one external network resource IP with the network card; the IP resource pool is used for storing a plurality of external network resource IPs, the number of the external network resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each external network resource IP is bound with at most one network card.
In this embodiment, the IP resource pool may be determined according to specific service requirements. And when the IP resource pool is a special external network IP resource pool, the internal resource IPs are all external network resource IPs, and the number of the external network resource IPs is more than or equal to that of the network cards. When the IP resource pool is an IP resource pool shared by the internal network and the external network, the resource IP in the IP resource pool can be used as the internal network resource IP or used as the external network resource IP, and the number of the resource IP is more than or equal to 2 times of the number of the network cards.
In this embodiment, the plurality of IP resources in the IP resource pool may be determined according to the service requirement. Alternatively, the plurality of resource IPs included in the IP resource pool may be a continuous plurality of IPs. The plurality of resource IPs included in the IP resource pool may be a discontinuous plurality of IPs.
In this embodiment, the method for selecting at least one extranet resource IP in the IP resource pool may be: firstly, at least one external network resource IP is randomly selected; secondly, when the multiple resource IPs in the IP resource pool are multiple continuous IPs, at least one external network resource IP is sequentially selected according to the continuous sequence of the IPs.
According to the above embodiment, since the IP to which the network card is bound is selected from the preset IP resource pool, the IP is not pre-specified. Therefore, the dynamic IP binding method can ensure anonymity, thereby improving the security of network access.
In an embodiment of the present invention, when the first preset binding method is a static IP binding method, the step A1 of binding at least one intranet IP for each network card by using the first preset binding method may include:
and binding at least one pre-specified intranet IP for each network card, wherein the intranet IPs bound by different network cards are different.
In this embodiment, each network card may be bound with a continuous intranet IP or a discontinuous intranet IP.
In the present embodiment, the following are exemplified: the proxy server is provided with a network card 1, a network card 2, a network card 3 and a network card 4, and an intranet IP is bound for each network card by adopting a static IP binding method. The network card 1 is bound with intranet IP "192.168.0.11", the network card 2 is bound with intranet IP "192.168.0.22", the network card 3 is bound with intranet IP "192.168.0.33" and the network card 4 is bound with intranet IP "192.168.0.54". It can be seen that in this embodiment, discontinuous IPs are bound to each network card.
In an embodiment of the present invention, when the second preset binding method is a static IP binding method, the step A2 uses the second preset binding method, and binds at least one external network IP for each network card respectively, which may include:
and binding at least one pre-specified external network IP for each network card respectively, wherein the external network IPs bound by different network cards are different.
According to the embodiment, because the IP bound on each network card is pre-specified, the static IP binding method can conveniently manage the IP bound on each network card.
In an embodiment of the present invention, the network access method may further include:
when an IP updating instruction is received or a preset updating period is reached, reselecting at least one resource IP in the IP resource pool, and binding the reselected at least one resource IP with the network card; the reselected at least one resource IP is different from the at least one resource IP bound to the network card at the last time, and the resource IP is an intranet resource IP or an extranet resource IP;
and updating the mapping relation between the external network IP and the internal network IP bound by the network card according to the at least one resource IP re-bound on the network card.
In this embodiment, when a user needs to update the network card bound IP, an IP update instruction may be directly input, so as to update the intranet IP and the extranet IP bound to each network card according to the IP update instruction input by the user. Because the IP updating instruction can be input at any time when the user has the updating requirement, the updating is more flexible.
In this embodiment, the update period may be determined according to the service requirement. For example, the update period may be half an hour, one day, etc. When the update period is reached, the intranet IP and the extranet IP bound on the network card can be automatically updated without manual intervention of a user, so that the automation degree is high.
According to the embodiment, the intranet IP and the extranet IP bound to each network card can be updated, so that the security is high when the IP is used for network access.
In an embodiment of the present invention, the step 103 in the flowchart shown in fig. 1 determines the second network IP according to the first network IP and the mapping relationship, which may include:
according to the mapping relation, at least one network IP with the mapping relation with the first network IP is found out;
when the number of the found network IPs is one, determining the network IP as the second network IP;
when the number of the found network IPs is multiple, screening the second network IP from the multiple network IPs according to a preset screening condition; the screening condition comprises at least one of stability of IP, IP sequencing and IP use frequency;
when the first network IP is an intranet IP, the second network IP is an extranet IP; and when the first network IP is an external network IP, the second network IP is an internal network IP.
In this embodiment, when two or more network IPs exist, the second network IP may be determined according to the screening condition. When the screening condition only includes any one of the stability of the IP, the IP ranking and the IP usage frequency, the second network IP may be determined according to the following several conditions: firstly, determining the network IP with the highest IP stability as a second network IP; secondly, determining the network IP which is ranked most front or back as a second network IP; third, the network IP with the highest or lowest frequency of use is determined as the second network IP.
In this embodiment, when the screening condition includes any two or more of the stability of the IP, the IP ranking, and the IP usage frequency, the screening condition value corresponding to each network IP may be calculated by using the preset weights respectively corresponding to the stability of the IP, the IP ranking, and the IP usage frequency, and then the network IP whose screening condition value reaches the preset threshold value is determined as the second network IP.
According to the embodiment, when the number of the searched network IPs is multiple, the second network IP is determined according to at least one or more of the stability, the IP sequence, and the IP usage frequency of each of the searched network IPs, so that the determined second network IP can better meet the service requirement.
Below, 20 network cards are arranged in the proxy server, and each network card is respectively bound with a set number of external network IPs and a set number of IPs; the proxy server stores the mapping relationship between the external network IP and the internal network IP bound to each network card as an example, and explains the network access method. As shown in fig. 2, the network access method may include:
step 201: respectively executing the following steps for each network card: selecting at least one intranet resource IP from a preset IP resource pool, and binding the selected at least one intranet resource IP with a network card; the IP resource pool stores a plurality of intranet resource IPs, the number of the intranet resource IPs in the IP resource pool is larger than that of the network cards, and each intranet resource IP is bound with at most one network card.
In this step, a pre-specified intranet resource IP is bound to each of the 20 network cards. The intranet resources IP bound by the network cards 1 to 20 by the static IP binding method are intranet resources IP1 to intranet IP20 (192.168.0.00 to 192.168.0.19), respectively.
Step 202: respectively executing the following steps for each network card: selecting at least one external network resource IP in a preset IP resource pool, and binding the selected at least one external network resource IP with a network card; the IP resource pool stores a plurality of external network resource IPs, the number of the external network resource IPs in the IP resource pool is larger than that of the network cards, and each external network resource IP is bound with at most one network card.
In this step, there is a preset IP resource pool, where the IP resource pool is an external network IP dedicated resource pool, and the resource pool includes continuous 30 external network resources IP, "external network resources IP1 to external network resources IP30", and the 30 external network resources IP are external network resources IP1 to external network resources IP30 (115.183.008.000 to 115.183.008.029), respectively. And respectively selecting an external network resource IP for each network card in the IP resource pool, and binding the selected external network resource IP on the network card. The network cards 1 to 20 are respectively bound with an external network resource IP, and are respectively an external network resource IP1 to an external network resource IP20.
Step 203: judging whether a network access request is received, if so, executing step 204; otherwise, step 210 is performed.
In this step, it is determined that the network card 1 receives the network access request, and step 204 is executed.
Step 204: when any network card receives a network access request, determining a first network IP of the network card for receiving the network access request.
In this step, the network card 1 receives the network access request, and determines that the first network IP of the network card 1 receiving the network access request is intranet IP1"192.168.0.00".
Step 205: and finding out at least one network IP having a mapping relation with the first network IP according to the mapping relation stored in the proxy server.
In this step, the network IP having the mapping relationship with the first network IP "intranet IP1" is found to be "extranet IP1 (115.183.008.000)" from the mapping relationship.
Step 206: judging whether the number of the found network IPs is multiple, if so, executing step 207; otherwise, step 208 is performed.
In this step, it is determined that the number of the network IPs found in step 205 is 1, and step 208 is performed.
Step 207: when the number of the found network IPs is multiple, screening the second network IP from the multiple network IPs according to preset screening conditions; the screening condition includes at least one of stability of the IP, ranking of the IP, and frequency of use of the IP, and step 209 is performed.
Step 208: when the number of the found network IPs is one, the network IP is determined as the second network IP, and step 209 is performed.
In this step, the external network IP1 (115.183.008.000) is determined as the second network IP.
Step 209: and performing network access according to the second network IP.
In this step, network access is performed according to the external network IP1 (115.183.008.000) to acquire data corresponding to the network access request.
Step 210: judging whether the current time reaches a preset updating period, if so, executing step 211; otherwise, step 203 is executed.
In this step, it is determined that the preset update period is reached, and step 211 is performed.
Step 211: respectively executing the following steps aiming at each network card: reselecting at least one resource IP in the IP resource pool, and binding the reselected at least one resource IP with the network card; and the reselected at least one resource IP is different from the at least one resource IP bound on the network card at the last time, and the resource IP is an external network resource IP.
In this step, one extranet resource IP is selected for each network card again among the extranet IPs extranet IP "extranet IP1 to extranet IP30" included in the extranet IP resource pool, and the selected extranet resource IP is bound to the network card. The network cards 1 to 20 are respectively bound with an external network IP, and are respectively an external network IP30 to an external network IP11.
Step 212: and updating the mapping relation between the outer network IP and the inner network IP bound by the network card according to the at least one resource IP re-bound on the network card.
As shown in fig. 3, an embodiment of the present invention provides a network access device applied to a proxy server, where the proxy server is provided with a plurality of network cards, and each network card is respectively bound with at least one external network IP and at least one internal network IP; the proxy server stores the mapping relation between the external network IP and the internal network IP bound by each network card, and the network access device comprises:
a first determining module 301, configured to determine, when any one of the network cards receives a network access request, a first network IP of the network card that receives the network access request, where the first network IP is an intranet IP or an extranet IP;
a second determining module 302, configured to determine a second network IP according to the first network IP determined by the first determining module 301 and the mapping relationship stored in the proxy server;
an accessing module 303, configured to perform network access according to the second network IP determined by the second determining module 302.
According to the embodiment shown in fig. 3, through interaction of the first determining module, the second determining module and the access module, when any network card of the plurality of network cards receives a network access request, network access can be performed according to a network IP receiving the network access request and a mapping relationship stored in the proxy server. Therefore, in the scheme provided by the embodiment of the invention, the proxy server is provided with the plurality of network cards, and network access is carried out according to the mapping relation between the intranet IP and the extranet IP bound by the plurality of network cards, so that the resource utilization rate of the proxy server can be improved.
In an embodiment of the present invention, as shown in fig. 4, the network access apparatus further includes: a binding module 304;
the binding module 304 is configured to bind each network card with at least one extranet IP and at least one intranet IP before receiving the network access request.
In an embodiment of the present invention, as shown in fig. 5, the binding module 304 may include an intranet IP binding submodule 3041 and an extranet IP binding submodule 3042;
the intranet IP binding submodule 3041 is configured to bind, by using a first preset binding method, at least one intranet IP for each network card; the first preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method;
the extranet IP binding submodule 3042 is configured to bind, to each network card, at least one extranet IP by using a second preset binding method; the first preset binding method and the second preset binding method are the same or different; the second preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method.
In an embodiment of the present invention, the intranet IP binding submodule 3041 is configured to select at least one intranet resource IP from a preset IP resource pool, and bind the selected at least one intranet resource IP with the network card; the IP resource pool is provided with a plurality of intranet resource IPs, the number of the intranet resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each intranet resource IP is bound with at most one network card.
In an embodiment of the present invention, the external network IP binding submodule 3042 is configured to select at least one external network resource IP from a preset IP resource pool, and bind the selected at least one external network resource IP with the network card; the IP resource pool is used for storing a plurality of external network resource IPs, the number of the external network resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each external network resource IP is bound with at most one network card.
In an embodiment of the present invention, as shown in fig. 6, the network access apparatus further includes: an update module 305;
the updating module 305 is configured to reselect at least one resource IP from the IP resource pool and bind the reselected at least one resource IP with the network card when an IP update instruction is received or a preset update period is reached; the reselected at least one resource IP is different from the at least one resource IP bound to the network card at the last time, and the resource IP is an intranet resource IP or an extranet resource IP; and updating the mapping relation between the external network IP and the internal network IP bound by the network card according to the at least one resource IP re-bound on the network card.
In an embodiment of the present invention, as shown in fig. 7, the first determining module 301 may include: a searching submodule 3031 and a determining submodule 3032;
the searching submodule 3031 is configured to search, according to the mapping relationship, at least one network IP having a mapping relationship with the first network IP;
the determining submodule 3032 is configured to determine the network IP as the second network IP when the number of the network IPs found by the finding submodule 3031 is one; when the number of the network IPs searched by the searching submodule is multiple, screening the second network IP from the multiple network IPs according to preset screening conditions; the screening condition comprises at least one of stability of IP, IP sequencing and IP use frequency; when the first network IP is an intranet IP, the second network IP is an extranet IP; and when the first network IP is an external network IP, the second network IP is an internal network IP.
As shown in fig. 8, an embodiment of the present invention provides a proxy server, where the proxy server includes: a plurality of network cards 401 and memories 402;
each network card 401 is respectively bound with at least one external network IP and at least one internal network IP;
the memory 402 is configured to store a mapping relationship between an external network IP and an internal network IP bound to each network card 401;
the proxy server is used for executing the network access method.
According to the embodiment shown in fig. 8, in the scheme provided by the embodiment of the present invention, the proxy server is provided with a plurality of network cards, and performs network access according to the mapping relationship between the intranet IP and the extranet IP bound by the plurality of network cards, so that the resource utilization rate of the proxy server can be improved.
An embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, where when the program runs, a device in which the storage medium is located is controlled to execute the network access method described in any one of the foregoing descriptions.
In an embodiment of the present invention, an electronic device is provided, as shown in fig. 9, which includes a processor 501, a memory 502, and a bus 503; the processor 501 and the memory 502 complete communication with each other through the bus 503; the processor 501 is configured to call program instructions in the memory 502 to perform any one of the network access methods described above.
The information interaction and execution process between the units in the device are based on the same concept as the method embodiment of the present invention, and specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
Various embodiments of the invention have at least the beneficial effects of any one or more of the following:
1. in the embodiment of the present invention, when any network card in the proxy server receives a network access request, it is determined that the network card receives a first network IP of the network access request (the first network IP may be an intranet IP or an extranet IP bound to the network card). And then determining a second network IP according to the first network IP and the mapping relation between the outer network IP and the inner network IP bound by each network card stored in the proxy server (the second network IP is the outer network IP when the first network IP is the inner network IP; and the second network IP is the inner network IP when the first network IP is the outer network IP). And finally, performing network access according to the determined second network IP. As can be seen from the above, the proxy server stores the mapping relationship between the extranet IP and the intranet IP respectively bound by the multiple network cards, and when any one of the multiple network cards receives a network access request, network access can be performed according to the network IP receiving the network access request and the mapping relationship stored in the proxy server. Therefore, in the scheme provided by the embodiment of the invention, the proxy server is provided with the plurality of network cards, and network access is carried out according to the mapping relation between the intranet IP and the extranet IP bound by the plurality of network cards, so that the resource utilization rate of the proxy server can be improved.
2. In the embodiment of the invention, the same or different binding methods can be adopted to bind the intranet IP and the extranet IP for each network card respectively, so that the service applicability is stronger.
3. In the embodiment of the invention, the IP bound by the network card is selected from the preset IP resource pool, and the IP is not specified in advance. Therefore, the dynamic IP binding method can ensure anonymity, thereby improving the security of network access.
4. In the embodiment of the invention, because the IP bound on each network card is specified in advance, the static IP binding method can conveniently manage the IP bound on each network card.
5. In the embodiment of the invention, because the intranet IP and the extranet IP bound on each network card can be updated, the safety is higher when the IP is used for network access.
6. When the number of the found network IPs is multiple, the second network IP is determined according to at least one or more of the stability, the IP sequencing and the IP use frequency of each found network IP, so that the determined second network IP can better meet the service requirement.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A network access method is characterized in that the method is applied to a proxy server, wherein a plurality of network cards are arranged in the proxy server, each network card is respectively bound with a plurality of external network IPs and a plurality of internal network IPs, and the method specifically comprises the following steps: binding a plurality of intranet IPs for each network card respectively by adopting a first preset binding method; binding a plurality of external network IPs for each network card respectively by adopting a second preset binding method; the first preset binding method and the second preset binding method are the same or different; the first preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method; the second preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method; the proxy server stores the mapping relation between the external network IP and the internal network IP bound by each network card, and the method comprises the following steps:
when any network card receives a network access request, determining a first network IP of the network card for receiving the network access request, wherein the first network IP is an intranet IP or an extranet IP;
determining a second network IP according to the first network IP and the mapping relation;
and performing network access according to the second network IP.
2. The method of claim 1, wherein prior to receiving the network access request, the method further comprises:
and binding each network card with a plurality of external network IPs and a plurality of internal network IPs respectively.
3. The network access method of claim 1,
the first preset binding method is a dynamic IP binding method, and the binding of a plurality of intranet IPs for each network card by using the first preset binding method includes:
selecting a plurality of intranet resource IPs from a preset IP resource pool, and binding the selected intranet resource IPs with the network card; a plurality of intranet resource IPs are stored in the IP resource pool, the number of the intranet resource IPs in the IP resource pool is greater than or equal to the number of the network cards, and each intranet resource IP is bound with at most one network card;
and/or the presence of a gas in the atmosphere,
the second preset binding method is a dynamic IP binding method, and the method for binding a plurality of external network IPs to each network card by using the second preset binding method includes:
selecting a plurality of external network resource IPs in a preset IP resource pool, and binding the selected plurality of external network resource IPs with the network card; the IP resource pool is used for storing a plurality of external network resource IPs, the number of the external network resource IPs in the IP resource pool is larger than or equal to that of the network cards, and each external network resource IP is bound with at most one network card.
4. The method of claim 3, further comprising:
when an IP updating instruction is received or a preset updating period is reached, reselecting a plurality of resource IPs in the IP resource pool, and binding the reselected resource IPs with the network card; the reselected resource IPs are different from the resource IPs bound to the network card at the last time, and the resource IPs are intranet resource IPs or extranet resource IPs;
and updating the mapping relation between the external network IP and the internal network IP bound by the network card according to the plurality of resource IPs bound on the network card again.
5. The method according to any one of claims 1 to 4, wherein the determining a second network IP according to the first network IP and the mapping relationship comprises:
according to the mapping relation, at least one network IP having the mapping relation with the first network IP is found out;
when the number of the found network IPs is one, determining the network IP as the second network IP;
when the number of the found network IPs is multiple, screening the second network IP from the multiple network IPs according to a preset screening condition; the screening condition comprises at least one of stability of the IP, IP sequencing and IP use frequency;
when the first network IP is an intranet IP, the second network IP is an extranet IP; and when the first network IP is an external network IP, the second network IP is an internal network IP.
6. The utility model provides a network access device, its characterized in that is applied to proxy server, wherein, be provided with many network cards in the proxy server, each network card binds with a plurality of outer net IPs and a plurality of intranet IPs respectively, specifically includes: the binding module can comprise an internal network IP binding submodule and an external network IP binding submodule; the intranet IP binding submodule is used for binding a plurality of intranet IPs for each network card by adopting a first preset binding method; the first preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method; the external network IP binding submodule is used for binding a plurality of external network IPs for each network card by adopting a second preset binding method; wherein the first preset binding method and the second preset binding method are the same or different; the second preset binding method comprises the following steps: any one of a static IP binding method and a dynamic IP binding method; the proxy server stores the mapping relationship between the external network IP and the internal network IP bound by each network card, and the network access device comprises:
the first determining module is used for determining a first network IP of the network card for receiving the network access request when any network card receives the network access request, wherein the first network IP is an intranet IP or an extranet IP;
a second determining module, configured to determine a second network IP according to the first network IP determined by the first determining module and the mapping relationship stored in the proxy server;
and the access module is used for carrying out network access according to the second network IP determined by the second determination module.
7. A proxy server, comprising: a plurality of network cards and memories;
each network card is respectively bound with a plurality of external network IPs and a plurality of internal network IPs;
the memory is used for storing the mapping relation between the external network IP and the internal network IP bound by each network card;
the proxy server is configured to perform the network access method of any one of claims 1 to 5.
8. A storage medium comprising a stored program, wherein the program, when executed, controls an apparatus in which the storage medium is located to perform the network access method according to any one of claims 1 to 5.
9. An electronic device, wherein the electronic device comprises a processor, a memory and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the network access method of any one of claims 1 to 5.
CN201810859903.3A 2018-08-01 2018-08-01 Network access method and device and proxy server Active CN110798491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810859903.3A CN110798491B (en) 2018-08-01 2018-08-01 Network access method and device and proxy server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810859903.3A CN110798491B (en) 2018-08-01 2018-08-01 Network access method and device and proxy server

Publications (2)

Publication Number Publication Date
CN110798491A CN110798491A (en) 2020-02-14
CN110798491B true CN110798491B (en) 2022-10-28

Family

ID=69425102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810859903.3A Active CN110798491B (en) 2018-08-01 2018-08-01 Network access method and device and proxy server

Country Status (1)

Country Link
CN (1) CN110798491B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202488486U (en) * 2011-09-29 2012-10-10 新奥特(北京)视频技术有限公司 Manuscript and making information interaction system applied in inside and outside network environment
CN105610638A (en) * 2015-10-19 2016-05-25 上海斐讯数据通信技术有限公司 Method of simulating wireless Internet access behavior of user
CN105872129A (en) * 2016-06-07 2016-08-17 国云科技股份有限公司 Method for realizing multi-NC (Network Card) extranet communication of Linux virtual machine
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202488486U (en) * 2011-09-29 2012-10-10 新奥特(北京)视频技术有限公司 Manuscript and making information interaction system applied in inside and outside network environment
CN105610638A (en) * 2015-10-19 2016-05-25 上海斐讯数据通信技术有限公司 Method of simulating wireless Internet access behavior of user
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards
CN105872129A (en) * 2016-06-07 2016-08-17 国云科技股份有限公司 Method for realizing multi-NC (Network Card) extranet communication of Linux virtual machine

Also Published As

Publication number Publication date
CN110798491A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
EP2656210B1 (en) Providing a persona-based application experience
US8285677B2 (en) Method and apparatus for propagating tables while preserving cyclic foreign key relationships
CN103368986A (en) Information recommendation method and information recommendation device
CN104268229B (en) Resource obtaining method and device based on multi-process browser
CN110445828B (en) Data distributed processing method based on Redis and related equipment thereof
CN109240607B (en) File reading method and device
CN102073741A (en) Method for realizing file reading and/or writing and data server
US20170053019A1 (en) System to organize search and display unstructured data
US20240061712A1 (en) Method, apparatus, and system for creating training task on ai training platform, and medium
CN106021512A (en) Page refresh method and apparatus
CN109784065A (en) Access control method, device, server and storage medium
CN105426231A (en) Multi-processing apparatus and multi-processing method
US20180011923A1 (en) Value range synopsis in column-organized analytical databases
CN112631648A (en) Service configuration method and device, electronic equipment and storage medium
CN110798491B (en) Network access method and device and proxy server
CN105868023B (en) Data processing method and calculate node in a kind of distributed system
CN112363980A (en) Data processing method and device for distributed system
CN101833585A (en) Database server operation control system, method and device
US9378230B1 (en) Ensuring availability of data in a set being uncorrelated over time
CN103856535A (en) Method and device for obtaining user data
CN115294979A (en) Method, apparatus, storage medium, and voice device for reducing voice response time
CN114385657A (en) Data storage method, device and storage medium
EP3091447B1 (en) Method for modifying root nodes and modifying apparatus
CN110209431B (en) Data partition splitting method and device
JP2010128675A (en) Retrieval 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