CN114844866A - Network request connection method and related equipment - Google Patents

Network request connection method and related equipment Download PDF

Info

Publication number
CN114844866A
CN114844866A CN202210320778.5A CN202210320778A CN114844866A CN 114844866 A CN114844866 A CN 114844866A CN 202210320778 A CN202210320778 A CN 202210320778A CN 114844866 A CN114844866 A CN 114844866A
Authority
CN
China
Prior art keywords
current
address information
historical
address
request
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.)
Pending
Application number
CN202210320778.5A
Other languages
Chinese (zh)
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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN202210320778.5A priority Critical patent/CN114844866A/en
Publication of CN114844866A publication Critical patent/CN114844866A/en
Pending legal-status Critical Current

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/14Session management
    • H04L67/141Setup of application sessions

Landscapes

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

Abstract

The invention discloses a network request connection method and related equipment. The method comprises the following steps: acquiring current request address information based on the current network request, wherein the current request address information comprises current IP address information; determining a historical link corresponding to the current IP address information as a target link in a connection pool based on the current request address information; and executing the current network request through the target link. According to the method provided by the embodiment of the application, the IP address corresponding to the request address of the current network request is obtained, the historical links with the same IP address are selected from the connection pool for multiplexing, and compared with a method for judging whether the links can be multiplexed or not by adopting a domain name, the multiplexing rate of the links is improved, so that the network request speed of the client side can be improved, and the user experience is improved.

Description

Network request connection method and related equipment
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a network connection request method and a related device.
Background
For a client to initiate an http network request, the process is to extract a requested domain name from a requested website, perform DNS resolution based on the domain name to obtain an IP list of a server, select an IP from the IP list for connection, perform a TCP connection process requiring 3 times handshake connection, and perform a TLS protocol encryption verification process if the http request is https. I.e. a normal request takes a long time if a link is established by the above steps.
At present, a method often adopted is that after a network request is sent by an established link, the link is not disconnected but placed in a connection pool, and multiplexing is performed subsequently, where multiplexing is to directly send the request on the established link, and the above DNS resolution and TCP handshake connection are omitted, so that it is very fast to send a request, which is about 30 ms to 200 ms. Currently, whether the 2 requests can be multiplexed or not is determined based on whether the domain names of the 2 requests are the same or not, if the domain names of the 2 requests are the same, multiplexing can be performed, otherwise, multiplexing cannot be performed. However, the method for judging whether the link multiplexing can be performed by using the domain name address has a low success rate, so that the speed of the network request connection is limited.
Disclosure of Invention
A series of concepts in a simplified form are introduced in the summary section, which is described in further detail in the detailed description section. This summary of the invention is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
In order to increase the speed of network connection request, in a first aspect, the present invention provides a method for network connection request, where the method includes:
acquiring current request address information based on the current network request, wherein the current request address information comprises current IP address information;
determining a historical link corresponding to the current IP address information as a target link in a connection pool based on the current request address information;
and executing the current network request through the target link.
Optionally, the current IP address information includes a current IP address list, where the current IP address list includes a plurality of current IP addresses;
determining a historical link corresponding to the current IP address information in a connection pool based on the current request address information as a target link, wherein the historical link is included;
acquiring a historical IP address list corresponding to a historical link in the connection pool;
selecting a historical IP address which is the same as the current IP address from the historical IP address list as a target IP address;
and determining the historical link corresponding to the target IP address as the target link.
Optionally, after the step of selecting the historical IP address that is the same as the current IP address from the historical IP address list as the target IP address, the method further includes:
counting the multiplexing times of the historical IP addresses;
and adjusting the arrangement sequence of the historical IP addresses in the historical IP address list according to the sequence of the multiplexing times from high to low.
Optionally, the historical IP address list further includes historical DNS resolution time, and the current address information further includes current domain name address information;
before the step of determining, in the connection pool, the historical link corresponding to the current IP address information as the target link based on the current request address information, the method further includes:
acquiring DNS analysis interval duration based on the historical DNS analysis time;
and under the condition that the DNS analysis interval duration is greater than the preset interval duration, determining a historical link corresponding to the current domain name address information as a target link in a connection pool based on the current domain name address information.
Optionally, when the DNS resolution interval duration is longer than a preset interval duration, after the step of determining, in the connection pool, the historical link corresponding to the current domain name address information as the target link based on the current domain name address information, the method further includes:
and executing DNS analysis operation to acquire the current IP address information under the condition that the historical link corresponding to the current domain name address information does not exist in the connection pool.
Optionally, after the step of obtaining the DNS resolution interval duration based on the historical DNS resolution time, the method further includes:
executing DNS analysis operation to acquire the current IP address information under the condition that the DNS analysis interval duration is less than or equal to the preset interval duration;
and determining the historical link corresponding to the current IP address information as a target link in a connection pool based on the current IP address information.
Optionally, the determining, in the connection pool based on the current request address information, that the historical link corresponding to the current IP address information is a target link includes:
acquiring historical request address information corresponding to the historical link in the connection pool, wherein the historical request address information is stored in a data structure body, the data structure body comprises a domain name address and/or an IP address list corresponding to the domain name address, and the data structure body further comprises at least one of an IP address, a server port, a proxy IP and a proxy port;
and determining the target link according to the current address information and the historical address information.
In a second aspect, the present invention further provides a network connection request apparatus, including:
an obtaining unit, configured to obtain current request address information based on the current network request, where the current request address information includes current IP address information;
a determining unit, configured to determine, in a connection pool, a historical link corresponding to the current IP address information as a target link based on the current request address information;
and the execution unit is used for executing the current network request through the target link.
In a third aspect, an electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the steps of the network connection request method according to any one of the first aspect when executing the computer program stored in the memory.
In a fourth aspect, the present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the network connection request method of any one of the above-mentioned first aspects.
To sum up, a network connection request method provided in the embodiment of the present application includes: acquiring current request address information based on the current network request, wherein the current request address information comprises current IP address information; determining a historical link corresponding to the current IP address information as a target link in a connection pool based on the current request address information; and executing the current network request through the target link. According to the method provided by the embodiment of the application, the IP address corresponding to the request address of the current network request is obtained, the historical links with the same IP address are selected from the connection pool for multiplexing, and compared with a method for judging whether the links can be multiplexed or not by adopting a domain name, the multiplexing rate of the links is improved, so that the network request speed of the client side can be improved, and the user experience is improved.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the specification. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart of a network connection request method according to an embodiment of the present application;
fig. 2 is a network connection request apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device requesting connection through a network according to an embodiment of the present disclosure.
Detailed Description
According to the method provided by the embodiment of the application, the IP address corresponding to the request address of the current network request is obtained, the historical links with the same IP address are selected from the connection pool for multiplexing, and compared with a method for judging whether the links can be multiplexed or not by adopting a domain name, the multiplexing rate of the links is improved, so that the network request speed of the client side can be improved, and the user experience is improved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments.
Referring to fig. 1, a schematic flow chart of a network connection request method according to an embodiment of the present application may specifically include:
s110, acquiring current request address information based on a current network request, wherein the current request address information comprises current IP address information;
illustratively, in order to solve the problem that the success rate of multiplexing the historical link only by the domain name address is low, the present application provides a method capable of improving the link multiplexing rate, and multiplexing the historical link according to the IP address and the domain name address specifically may include: the present request address information is obtained based on the present network request, where the request address information includes present IP address information obtained by performing DNS resolution on a domain name address, and it should be noted that a plurality of IP address information can be resolved by one domain name address.
In some embodiments, the historical IP address list further includes historical DNS resolution time, the current address information further includes current domain name address information, and in order to reduce the filtering duration of link multiplexing, the method further includes, after step S110, step S111 to step S112:
s111, acquiring DNS analysis interval duration based on the historical DNS analysis time;
s112, under the condition that the DNS analysis interval duration is greater than the preset interval duration, determining a historical link corresponding to the current domain name address information as a target link in a connection pool based on the current domain name address information;
illustratively, the DNS resolution time may form a data structure with the IP list, Iplist:
Struct Iplist{
vector < std:: string > ips; storing the IP list;
time t; storing DNS analysis time;
}
DNS resolution may be characterized when during a cache time (a preset interval duration), such as: 10 seconds, when the same domain name is analyzed again, the speed is very high, and the last analysis result is directly returned; if the caching time is exceeded, the system initiates a network request to request the current localdns server to resolve the IP list corresponding to the domain name, and the whole time consumption for sending through the network request is uncertain and therefore slow.
Based on the consideration, under the condition that the DNS resolution time length is longer than the preset interval time length, the DNS resolution time length is longer because the cache time is exceeded, at the moment, historical links in a connection pool are screened according to domain name address information, and if the historical links with the same domain name address information exist, the historical links are determined as target links, so that historical link multiplexing is realized.
In some embodiments, in order to increase the reuse rate of the historical link when there is no historical link corresponding to the current domain name address information in the connection pool, step S113 may be further included after step S112:
s113, in a case that there is no historical link corresponding to the current domain name address information in the connection pool, performing a DNS resolution operation to obtain the current IP address information;
illustratively, when the DNS resolution interval duration exceeds the DNS resolution cache period, and there is no historical link corresponding to the current domain name address information in the connection pool, at this time, a DNS resolution operation needs to be performed to obtain the current IP address information, and the historical links corresponding to the same IP address are selected for multiplexing in the connection pool by the current IP address information, so that the multiplexing rate of the historical links is increased, and the speed of the network request is increased.
In some embodiments, in a case that the DNS resolution interval duration is less than or equal to the preset interval duration, in order to increase the reuse rate of the historical link, there may be a scheme different from the scheme in steps S112 to S113 after step S111, and specifically, the scheme may include steps S114 to S115:
s114, when the DNS analysis interval duration is less than or equal to the preset interval duration, executing DNS analysis operation to acquire the current IP address information;
and S115, determining the historical link corresponding to the current IP address information as a target link in a connection pool based on the current IP address information.
Illustratively, under the condition that the DNS resolution time is less than or equal to the preset interval time, namely the current time is still in a DNS resolution cache period, the resolution speed of the current domain name address is high, so that the target link is not selected by the domain name address, the DNS resolution is directly performed through the current domain name address to obtain the current IP address, and the target link is selected in the connection pool through the IP address, so that the reuse rate of the link can be improved, and the speed of network requests can be improved.
Further, after the IP address is acquired in steps S113 and S115, the historical link corresponding to the current IP address information may be set as the target link in step S120:
s120, determining a historical link corresponding to the current IP address information as a target link in a connection pool based on the current request address information;
illustratively, after the network request task is completed, the link corresponding to the historical network request, that is, the historical link, is put into the connection pool, so that the subsequent network request multiplexes the link. In this embodiment, a historical link with the same IP address information is selected as a target link from a connection pool based on the IP address information in the current request address information.
For example: a domain name address 1 corresponding to one of historical interfaces in a connection pool: ip of ca1. douyuucdn. cn after DNS analysis is:
Ip11:120.36.224.221
Ip12:120.36.224.222
Ip13:120.36.224.223
at this time, the domain name address 2 of the current network request is: a2.douyucdn. cn, adopting the existing scheme to compare the domain name addresses in the connection pool, selecting the historical link which is the same as the domain name address 2 for multiplexing, but the connection pool does not have the same domain name address, the existing scheme can reestablish a new link, and the method proposed by the application is to execute DNS analysis on the domain name address 2 to obtain the IP address, wherein the specific IP address can be as follows
Ip21:120.36.224.221
Ip22:120.36.224.225
Ip23:120.36.224.226
It can be seen that the IP11 is the same as the IP21, and therefore, the current network request can use the history interface corresponding to the IP11 as the target link, thereby realizing the history link multiplexing and improving the multiplexing rate.
In some embodiments, the current IP address information includes a current IP address list, where the current IP address list includes a plurality of current IP addresses, and in order to further improve the efficiency of historical link multiplexing, the method specifically includes, in step S120, step S1201 to step S1206:
s1201, determining a historical link corresponding to the current IP address information in a connection pool based on the current request address information as a target link, wherein the historical link is included;
s1202, obtaining a historical IP address list corresponding to the historical link in the connection pool;
s1203, selecting a historical IP address which is the same as the current IP address from the historical IP address list as a target IP address;
s1204, determining the historical link corresponding to the target IP address as the target link;
for example, since each domain name address resolves a plurality of IP addresses, an IP address list may be created for convenience of management and IP address comparison;
vector < std:: string > ips; storing the IP list;
comparing the current IP address with the historical IP address one by one based on the current IP address list and the historical IP address list, and multiplexing the historical link corresponding to the same IP address under the condition that the same IP address appears, thereby realizing link multiplexing.
The current IP address and the historical IP address are respectively stored in the corresponding IP lists, so that the management and comparison of the IP addresses are facilitated, and the efficiency of IP address comparison is improved.
S1205, counting the multiplexing times of the historical IP addresses;
and S1206, adjusting the arrangement sequence of the historical IP addresses in the historical IP address list according to the sequence of the multiplexing times from high to low.
For example, based on the above IP address list established, a common method is to compare sequentially from the head to the tail of the list to obtain the same IP address, and in practical applications, the probability of repeated occurrence of some specific IP addresses is very high, so in the embodiment of the present application, the number of times that IP addresses are multiplexed is counted, and the arrangement sequence of IP addresses in the IP list is adjusted according to the number of times that IP addresses are multiplexed, so that in the process of performing one-by-one comparison from the head to the tail of the column, IP addresses that are repeated with a high probability are placed at the head of the column, and the speed of successful comparison can be increased.
The specific sorting algorithm is as follows:
a structure is defined for binding ip and overlap ratio data (number of multiplexes).
Struct ipData{
String ip in Std; for storing ip addresses
Uint32 count; for storing ip goodness-of-overlap data. }
An ipData structure is created for each IP of the IP list and the count is initialized to 0. Vector < ipData > stores all the ipDatas structure data using one std. The contact-level data for each IP is calculated for the IP list of previously resolved domain names. The specific algorithm is to traverse the analyzed IP list, traverse each IP address from the IP lists of all domain names stored in the hostpps, if the IP address has one same IP with a certain domain name in the hostpps, add 1 to the count value, finally, each IP will go to the IP list of each domain name in the hostpps to inquire once, and if the IP addresses are the same, add 1 to the IP list, finally, the value of the contact ratio calculated by each IP in the hostpps can be obtained.
A comparison function is written for comparing the coincidence values of 2 ips.
inline bool compareBySameCount(const ipData&lhs,const ipData&rhs){
return lhs.count>rhs.count;}
The sizes of the 2 objects of the ipData are compared according to the degree of coincidence, and the larger the degree of coincidence, the larger the object is and the larger the other object is.
std::sort(std::begin(ipDatas),std::end(ipDatas),compareBySameCount);
Writing a comparison function, sequencing the iDatas structures by using a sort function provided by stl, and after sequencing is completed, arranging the IP address with the highest contact ratio to the front of the queue.
By setting the IP list, calculating the multiplexing times in the IP list, arranging the IP addresses according to the multiplexing times from high to low, and placing the IP addresses with high probability of repetition at the head of the list, the successful comparison speed can be improved, and the network request speed is improved.
In some embodiments, in order to make the link multiplexing work easier and faster, step S120 may further be implemented by step S1200:
s1200, obtaining historical request address information corresponding to the historical link in the connection pool, wherein the historical request address information is stored in a data structure body, the data structure body comprises a domain name address and/or an IP address list corresponding to the domain name address, and the data structure body further comprises at least one of an IP address, a server port, a proxy IP and a proxy port; and determining the target link according to the current address information and the historical address information.
For example, the current request address information and the historical request address information may be stored in a data structure, where the data structure includes a domain name address and/or an IP address list corresponding to the domain name address, and the data structure further includes at least one of an IP address, a server port, a proxy IP, and a proxy port.
Further, the data structure may be established by:
Struct sessionData{
pool cured _ { false }; whether the session (link) is an http request or an https request is stored.
std, string host _; and the domain name address corresponding to the session.
std: string server ip _; and the IP address of the server corresponding to the session.
uint16_ t port _ {0 }; and the port number of the server corresponding to the session.
std, string proxyIp _; if not, the proxy is null; if so, it is the proxy's ip address.
U int16_ t proxyPort _ {0 }; the agent port of (1), if there is no agent, is 0; if any, the port number of the agent.
std vector < SocketAddress > ips _; and (4) IP list. }
According to the method provided by the embodiment of the application, the current request address information and the historical request address information are stored through the data structure body, a plurality of variables in the request address information can be uniformly managed, and the link multiplexing work is simpler, more convenient and faster.
After the target link is determined, a network request is also performed through step S180:
and S130, executing the current network request through the target link.
For example, the current network request is executed through the target link, for an existing server, if the server is deployed on a CDN node, the CDN node is equivalent to a gateway node, the request of the client is connected to the CDN node first, and the CDN node distributes the request to a specific service of each request behind the CDN, so that in the case of having the CDN node, it is proposed herein that in the case of IP multiplexing, even if domain names of 2 requests are different, but there is an IP of a common CDN node, link multiplexing can be implemented through the method, so that reusability of the request can be greatly improved, and meanwhile, speed of the network request is also improved.
In summary, according to the method provided by the embodiment of the application, the IP address corresponding to the request address of the current network request is obtained, and the historical links with the same IP address are selected from the connection pool for multiplexing.
Further, whether the time interval is in the DNS cache time is judged by obtaining the DNS resolution time interval, and if the time interval is not in the cache period, a target link is screened in the connection pool through the domain name address, so that the condition that the DNS resolution time is uncertain after exceeding the cache period and influences the network request speed is avoided. Under the condition that the DNS analysis time length is longer than the preset interval time length, the DNS analysis time length is longer due to the fact that the cache time is exceeded, at the moment, historical links in a connection pool are screened according to domain name address information, and if the historical links with the same domain name address information exist, the historical links are determined to be target links, and therefore historical link multiplexing is achieved. If the historical link corresponding to the current domain name address information does not exist in the connection pool, DNS analysis operation needs to be executed to obtain the current IP address information, the historical link corresponding to the same IP address is selected from the connection pool through the current IP address information for multiplexing, the multiplexing rate of the historical link is improved, and the speed of network requests is increased. Meanwhile, the IP list is set, the multiplexing times in the IP list are calculated, the IP addresses are arranged from high to low according to the multiplexing times, the IP addresses with large probability of repetition are placed at the head of the list, the successful comparison speed can be improved, and the network request speed is improved. Compared with the scheme of multiplexing the links by adopting the domain name addresses in the prior art, the scheme provided by the application has higher multiplexing rate and more flexible scheme, and can make full use of the domain name addresses and the IP addresses to multiplex the links quickly with high success rate.
Referring to fig. 2, an embodiment of a network connection request apparatus in the embodiment of the present application may include:
an obtaining unit 21, configured to obtain current request address information based on the current network request, where the current request address information includes current IP address information;
a determining unit 22, configured to determine, based on the current request address information, a historical link corresponding to the current IP address information in a connection pool as a target link;
an executing unit 23, configured to execute the current network request through the target link.
As shown in fig. 3, the embodiment of the present application further provides an electronic device 200, which includes a memory 310, a processor 320, and a computer program 511 stored in the memory 320 and executable on the processor, wherein when the computer program 311 is executed by the processor 320, the steps of any one of the above-mentioned methods for requesting a connection via a network are implemented.
Since the electronic device described in this embodiment is a device used for implementing a network connection request apparatus in this embodiment, based on the method described in this embodiment, a person skilled in the art can understand the specific implementation manner of the electronic device of this embodiment and various variations thereof, so that how to implement the method in this embodiment by the electronic device is not described in detail herein, and as long as the person skilled in the art implements the device used for implementing the method in this embodiment, the device falls within the scope of the protection of this application.
In a specific implementation, the computer program 311 may implement any of the embodiments corresponding to fig. 1 when executed by a processor.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Embodiments of the present application further provide a computer program product, where the computer program product includes computer software instructions, and when the computer software instructions are run on a processing device, the processing device is caused to execute a flow of a network request connection method in the embodiment corresponding to fig. 1.
The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). A computer-readable storage medium may be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for requesting a connection from a network, comprising:
acquiring current request address information based on a current network request, wherein the current request address information comprises current IP address information;
determining a historical link corresponding to the current IP address information as a target link in a connection pool based on the current request address information;
executing the current network request through the target link.
2. The method of claim 1, wherein the current IP address information comprises a current IP address list, the current IP address list comprising a plurality of current IP addresses;
determining a historical link corresponding to the current IP address information in a connection pool based on the current request address information as a target link, wherein the historical link is included;
acquiring a historical IP address list corresponding to a historical link in the connection pool;
selecting a historical IP address which is the same as the current IP address from the historical IP address list as a target IP address;
and determining the historical link corresponding to the target IP address as the target link.
3. The method of claim 2, wherein after the step of selecting a historical IP address in the historical IP address list that is the same as the current IP address as the target IP address, further comprising:
counting the multiplexing times of the historical IP addresses;
and adjusting the arrangement sequence of the historical IP addresses in the historical IP address list according to the sequence of the multiplexing times from high to low.
4. The method of claim 2, wherein the historical list of IP addresses further includes historical DNS resolution times, the current address information further includes current domain name address information;
before the step of determining, in the connection pool, the historical link corresponding to the current IP address information as the target link based on the current request address information, the method further includes:
acquiring DNS analysis interval duration based on the historical DNS analysis time;
and under the condition that the DNS analysis interval duration is greater than the preset interval duration, determining a historical link corresponding to the current domain name address information as a target link in a connection pool based on the current domain name address information.
5. The method according to claim 4, wherein, after the step of determining, in the connection pool, that the historical link corresponding to the current domain name address information is the target link based on the current domain name address information, if the DNS resolution interval duration is greater than a preset interval duration, the method further comprises:
and under the condition that the historical link corresponding to the current domain name address information does not exist in the connection pool, performing DNS analysis operation to acquire the current IP address information.
6. The method of claim 4, wherein after the step of obtaining a DNS resolution interval duration based on the historical DNS resolution time, further comprising:
executing DNS analysis operation to acquire the current IP address information under the condition that the DNS analysis interval duration is less than or equal to the preset interval duration;
and determining the historical link corresponding to the current IP address information as a target link in a connection pool based on the current IP address information.
7. The method of any one of claims 1-6, wherein the determining, in a connection pool based on the current request address information, that a historical link corresponding to the current IP address information is a target link comprises:
obtaining historical request address information corresponding to the historical link in the connection pool, wherein the historical request address information is stored in a data structure body, the data structure body comprises a domain name address and/or an IP address list corresponding to the domain name address, and the data structure body further comprises at least one of an IP address, a server port, a proxy IP and a proxy port;
and determining the target link according to the current address information and the historical address information.
8. A network connection request apparatus, comprising:
an obtaining unit, configured to obtain current request address information based on the current network request, where the current request address information includes current IP address information;
a determining unit, configured to determine, in a connection pool, a historical link corresponding to the current IP address information as a target link based on the current request address information;
and the execution unit is used for executing the current network request through the target link.
9. An electronic device, comprising: memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor is adapted to carry out the steps of the network connection request method according to any of claims 1-7 when executing the computer program stored in the memory.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program, when executed by a processor, implements the network request connection method of any of claims 1-7.
CN202210320778.5A 2022-03-29 2022-03-29 Network request connection method and related equipment Pending CN114844866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210320778.5A CN114844866A (en) 2022-03-29 2022-03-29 Network request connection method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210320778.5A CN114844866A (en) 2022-03-29 2022-03-29 Network request connection method and related equipment

Publications (1)

Publication Number Publication Date
CN114844866A true CN114844866A (en) 2022-08-02

Family

ID=82564115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210320778.5A Pending CN114844866A (en) 2022-03-29 2022-03-29 Network request connection method and related equipment

Country Status (1)

Country Link
CN (1) CN114844866A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104144231A (en) * 2014-08-21 2014-11-12 北京金山安全软件有限公司 Method and device for processing DNS query request
US20160043990A1 (en) * 2014-08-07 2016-02-11 Cedexis, Inc. Dns resolution replay for bare domain names that map to "a" records
CN109996250A (en) * 2017-12-29 2019-07-09 洛阳中科晶上智能装备科技有限公司 The method for detecting TCP connection state
CN110351115A (en) * 2019-05-23 2019-10-18 中国平安财产保险股份有限公司 Reduce method, apparatus, computer equipment and the storage medium of network access time delay
CN110519401A (en) * 2019-07-05 2019-11-29 中国平安财产保险股份有限公司 Improve method, apparatus, equipment and the storage medium of network Access Success Rate
CN112751931A (en) * 2020-12-29 2021-05-04 中国工商银行股份有限公司 Network connection method and device, electronic device, and medium
CN113366815A (en) * 2019-04-11 2021-09-07 深圳市欢太科技有限公司 Network resource request method, device, electronic equipment and storage medium
CN113452808A (en) * 2021-06-29 2021-09-28 百果园技术(新加坡)有限公司 Domain name resolution method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160043990A1 (en) * 2014-08-07 2016-02-11 Cedexis, Inc. Dns resolution replay for bare domain names that map to "a" records
CN104144231A (en) * 2014-08-21 2014-11-12 北京金山安全软件有限公司 Method and device for processing DNS query request
CN109996250A (en) * 2017-12-29 2019-07-09 洛阳中科晶上智能装备科技有限公司 The method for detecting TCP connection state
CN113366815A (en) * 2019-04-11 2021-09-07 深圳市欢太科技有限公司 Network resource request method, device, electronic equipment and storage medium
CN110351115A (en) * 2019-05-23 2019-10-18 中国平安财产保险股份有限公司 Reduce method, apparatus, computer equipment and the storage medium of network access time delay
CN110519401A (en) * 2019-07-05 2019-11-29 中国平安财产保险股份有限公司 Improve method, apparatus, equipment and the storage medium of network Access Success Rate
CN112751931A (en) * 2020-12-29 2021-05-04 中国工商银行股份有限公司 Network connection method and device, electronic device, and medium
CN113452808A (en) * 2021-06-29 2021-09-28 百果园技术(新加坡)有限公司 Domain name resolution method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11122067B2 (en) Methods for detecting and mitigating malicious network behavior and devices thereof
CN104219316B (en) A kind of call request processing method and processing device in distributed system
CN104767716B (en) Service request processing method and device
CN104768139B (en) A kind of method and device that short message is sent
CN109309685B (en) Information transmission method and device
US20060112422A1 (en) Data transfer using hyper-text transfer protocol (HTTP) query strings
CN104640114B (en) A kind of verification method and device of access request
CN103731472B (en) Method and system, the client of file are downloaded using P2P technologies
CN108833450B (en) Method and device for preventing server from being attacked
CN108390860B (en) Data packet encryption and decryption method and device
CN107347015B (en) Method, device and system for identifying content distribution network
CN110995656B (en) Load balancing method, device, equipment and storage medium
CN107395553B (en) Network attack detection method, device and storage medium
CN108200158A (en) Ask Transmission system, method, apparatus and storage medium
CN111177601B (en) Page rendering processing method, device, equipment and readable storage medium
CN111049781A (en) Detection method, device, equipment and storage medium for rebound network attack
CN108156160A (en) Connect method for building up and device
US8903998B2 (en) Apparatus and method for monitoring web application telecommunication data by user
US10785235B2 (en) System and method for gathering botnet cyber intelligence
CN106789858A (en) A kind of access control method and device and server
US20190068635A1 (en) Data processing method, apparatus, and system
CN111147598A (en) HTTP message processing method and device
CN108055299B (en) Portal page pushing method, network access server and Portal authentication system
CN114844866A (en) Network request connection method and related equipment
CN111225038B (en) Server access method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination