Disclosure of Invention
In view of the above problems, the present invention has been made to provide an IP address correction method and a corresponding IP address correction apparatus that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided an IP address correction method, including:
when a client accesses a server, acquiring a first IP address corresponding to an access request sent by the client; the first IP address is obtained by an access request through a normal routing path;
acquiring a dotting IP address through a content distribution network server closest to a client initiating the access request; the dotting IP address is obtained by the client sending a dotting request to a content distribution network server according to the access request;
and performing matching calculation on the dotting IP address and the first IP address, and correcting the real IP address of the access request.
Preferably, when a client accesses a server, the step of obtaining a first IP address corresponding to an access request sent by the client includes:
acquiring a first IP address and a global identification from a received access request and recording; the global identification is written into the access request by the client when the access request is sent.
Preferably, the step of obtaining a dotting IP address through a content distribution network server closest to a client initiating the access request includes:
and acquiring and recording a dotting IP address and a global identification of the access request through a content distribution network server closest to a client initiating the access request.
Preferably, the step of performing matching calculation on the dotting IP address and the first IP address to correct the real IP address of the access request includes:
searching each dotting IP address and each first IP address under the same global identification;
matching calculation is carried out on the dotting IP address and the first IP address, and whether the access request corresponding to the first IP address is transferred or not is judged;
and if the access request corresponding to the first IP address is transferred, correcting the real IP address of the access request according to the dotting IP address.
Preferably, the step of performing matching calculation on the dotting IP address and the first IP address and determining whether the access request corresponding to the first IP address is forwarded includes:
judging whether each first IP address under the global identification is the same as each dotting IP address;
and if the first IP addresses under the global identification are different from the dotting IP addresses, determining that the access request corresponding to the first IP address is transferred.
Preferably, the step of correcting the real IP address of the access request according to the dotting IP address includes:
judging whether the number of the same dotting IP addresses in all the dotting IP addresses exceeds a threshold value or not;
and if the number of the same dotting IP addresses in all the dotting IP addresses exceeds a threshold value, taking the dotting IP addresses exceeding the threshold value as the real IP addresses of the access request.
Preferably, the step of performing matching calculation on the dotting IP address and the first IP address and determining whether the access request corresponding to the first IP address is forwarded includes:
judging whether each first IP address under the global identification is partially different from each dotting IP address or not;
and if the first IP addresses under the global identification are different from the dotting IP addresses, determining that the access requests corresponding to the parts of the first IP addresses different from the dotting IP addresses are transferred.
Preferably, the step of correcting the real IP address of the access request according to the dotting IP address includes:
and correcting the real IP address of the access request to be the IP address of the same part of the first IP address as each dotting IP address aiming at the access request corresponding to the part of the first IP address different from each dotting IP address.
Preferably, after the step of performing matching calculation on the dotting IP and the first IP address and correcting the real IP address of the access request, the method further includes:
and aiming at the access request with the corrected real IP address, retrieving and/or delivering network advertisement data based on the real IP address according to the real IP address.
Preferably, after the step of performing matching calculation on the dotting IP and the first IP address and correcting the real IP address of the access request, the method further includes:
and recommending personalized information corresponding to the real IP address according to the real IP address aiming at the access request with the real IP address corrected.
According to another aspect of the present invention, there is provided an IP address correction apparatus including:
the first IP address acquisition module is suitable for acquiring a first IP address corresponding to an access request sent by a client when the client accesses a server; the first IP address is obtained by an access request through a normal routing path;
a dotting IP address obtaining module, adapted to obtain a dotting IP address through a content distribution network server closest to a client initiating the access request; the dotting IP address is obtained by the client sending a dotting request to a content distribution network server according to the access request;
and the real IP address correction module is suitable for performing matching calculation on the dotting IP address and the first IP address and correcting the real IP address of the access request.
Preferably, the first IP address obtaining module includes:
the first IP address acquisition submodule is suitable for acquiring and recording a first IP address and a global identifier from the received access request; the global identification is written into the access request by the client when the access request is sent.
Preferably, the dotting IP address obtaining module includes:
and the dotting IP address acquisition submodule is suitable for acquiring and recording the dotting IP address and the global identification of the access request through a content distribution network server closest to the client initiating the access request.
Preferably, the dotting IP address obtaining module includes:
and the dotting IP address acquisition submodule is suitable for acquiring and recording the dotting IP address and the global identification of the access request through a content distribution network server closest to the client initiating the access request.
Preferably, the access request judgment sub-module includes:
the first IP address and dotting IP address judgment submodule is suitable for judging whether each first IP address under the global identification is the same as each dotting IP address;
and the access request transfer sub-module is suitable for determining that the access request corresponding to the first IP address is transferred when each first IP address under the global identification is different from each dotting IP address.
Preferably, the real IP address modification sub-module includes:
the dotting IP address number judgment submodule is suitable for judging whether the number of the same dotting IP addresses in all the dotting IP addresses exceeds a threshold value or not;
and the real IP address replacing submodule is suitable for taking the dotting IP address exceeding the threshold value as the real IP address of the access request when the number of the same dotting IP addresses exceeds the threshold value in all the dotting IP addresses.
Preferably, the access request transfer judgment sub-module includes:
a partial first IP address and dotting IP address judgment submodule which is suitable for judging whether each first IP address under the global identification is partially different from each dotting IP address or not;
and the partial access request transfer sub-module is suitable for determining that the access request corresponding to the part of the first IP address different from each dotting IP address is transferred when each first IP address under the global identification is different from each dotting IP address.
Preferably, the real IP address modification sub-module includes:
and the partial real IP address correction submodule is suitable for correcting the real IP address of the access request into the IP address of the same part of the first IP address as each dotting IP address aiming at the access request corresponding to the part of the first IP address different from each dotting IP address.
Preferably, after the real IP address modification module, the method further includes:
and the retrieval and delivery module is suitable for retrieving and/or delivering the network advertisement data based on the real IP address according to the real IP address aiming at the access request with the corrected real IP address.
Preferably, after the real IP address modification module, the method further includes:
and the personalized information recommendation module is suitable for recommending personalized information corresponding to the real IP address according to the real IP address aiming at the access request with the real IP address corrected.
According to another aspect of the present invention, there is also disclosed an IP address correction apparatus including:
a memory loaded with a plurality of executable instructions;
a processor executing the plurality of executable instructions; the plurality of instructions includes a method of performing the steps of:
when a client accesses a server, acquiring a first IP address corresponding to an access request sent by the client; the first IP address is obtained by an access request through a normal routing path;
acquiring a dotting IP address through a content distribution network server closest to a client initiating the access request; the dotting IP address is obtained by the client sending a dotting request to a content distribution network server according to the access request;
and performing matching calculation on the dotting IP address and the first IP address, and correcting the real IP address of the access request.
The IP address correction method and the device disclosed by the embodiment of the invention carry out matching calculation on the dotting IP address corresponding to the client access request and the first IP address by acquiring the first IP address corresponding to the client access request and the dotting IP address corresponding to the client access request of the content distribution network server closest to the client, thereby correcting the real IP address corresponding to the access request, solving the problems that in the prior art, the acquired first IP address is inaccurate after the access request of the client is transferred by a plurality of ISP, therefore, the problem that the cost of the advertisement releaser is lost due to the fact that the fee is deducted by mistake is solved, the obtained first IP address can be corrected, the corrected IP address can be matched with the region where the client initiating the access request is located, the probability of fee deduction by mistake is reduced, and the cost loss of the advertisement releaser is reduced.
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.
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.
Example one
Referring to fig. 1, a flowchart illustrating steps of an embodiment of an IP address correction method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step S110: when a client accesses a server, acquiring a first IP address corresponding to an access request sent by the client; the first IP address is obtained by the access request over a normal routing path.
The embodiment of the invention can be applied to the correction of the IP address which is acquired by the web server and aims at the client access request.
The first IP address is an IP address corresponding to the access request of the client, which is obtained by the web server when the web server receives the access request sent by the client. The client sends the access request to the web server. The IP address of the web server may be obtained according to a local DNS (Domain Name System) server, and the access request may be sent to the web server according to the IP address of the web server.
The network advertisement delivered by the advertisement server in the web server may be relayed by other ISPs (internet Service providers), and in the process of sending an access request to the web server by the client, the routing of the client initiating the access may be changed, which may cause the access request of the client to be changed accordingly. For example, referring to fig. 1A, which is a schematic architecture diagram of an IP address correction method provided by an embodiment of the present invention, a real IP address of a client access request is IP-1, and after the client access request is relayed, a change may occur, for example, N times of relays occur in fig. 1A, and then a first IP address acquired by a web server and corresponding to the client access request is an IP address IP-N of an ISPN. In the process of sending the access request to the web server by the client, one or more times of transfer may occur, so that the first IP address corresponding to the access request of the client, which is acquired by the web server, is inaccurate. And the Web server takes the acquired final IP address corresponding to the client access request as the first IP address of the client access request.
The web server can return data corresponding to the client access request to the client according to the first IP address of the client and the client access request, and forward the first IP address corresponding to the client access request to the advertisement server for recording and counting, so that the click rate of each network advertisement issued in the web server is obtained, and corresponding fees are deducted for the issuer of each network information.
Step S120: acquiring a dotting IP address through a content distribution network server closest to a client initiating the access request; and the dotting IP address is obtained by sending a dotting request to a content distribution network server by the client according to the access request.
when the Web server receives an access request of a client, the Web server can issue a dotting notification to the client according to a first IP address of the access request of the client, and after receiving the dotting notification, the client obtains an IP address of a CDN server (Content Delivery Network) with a geographical position closest to the client through a DNS server, and sends a dotting request corresponding to the access request of the client to the CDN server according to the IP address of the CDN server.
After receiving a dotting request corresponding to the client access request, the CDN server may obtain an IP address corresponding to the client access request, where the IP address is a dotting IP address corresponding to the client access request, and the dotting IP address is obtained when the client sends a dotting request to the CDN server according to the access request.
Correspondingly, after the CDN server closest to the client obtains the dotting IP address corresponding to the client access request, the dotting IP address corresponding to the client access request may be sent to the advertisement server, so that the advertisement server records and stores the dotting IP address of each client access request.
In practical application, a dotting collection server can be arranged between the CDN server and the advertisement server, and the dotting collection server receives a dotting IP address sent by the CDN server and then sends the dotting IP address to the advertisement server. Referring to fig. 1A, the dotting collection server collects a dotting IP address corresponding to a client access request acquired in the CDN server, and transmits the collected IP address to the advertisement server.
In the embodiment of the invention, a client sends a dotting request of an HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) to a CDN server, and a local CDN server can analyze the HTTPS request after deploying HTTPS service so as to obtain a dotting IP address. And for the CDN server of the third party, before the HTTPS request is analyzed, the encrypted part in the dotting request of the HTTPS is sent to an identity authentication server for identity authentication, and after the identity authentication server passes the authentication, the CDN server is allowed to analyze the dotting request so as to obtain the dotting IP address.
Preferably, step S120 includes:
sub-step a11, the content distribution network server receives the dotting request initiated by the client and corresponding to the access request, and authenticates the dotting request through the authentication server.
when the Web server receives an access request of a client, the Web server can issue a dotting notification to the client according to a first IP address of the access request of the client, and after receiving the dotting notification, the client obtains an IP address of a CDN (Content Delivery Network) server closest to the client through a DNS (domain name system) server, and sends a dotting request corresponding to the access request of the client to the CDN server according to the IP address of the CDN server.
After receiving a dotting request corresponding to the client access request, the CDN server may obtain an IP address corresponding to the client access request, where the IP address is the dotting IP address corresponding to the client access request.
In practical application, since the dotting request is sent according to an HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) request format required by a web server, the HTTPS request can be analyzed after an HTTPS service is deployed on a local CDN server, and a dotting IP address is obtained.
In addition, before parsing an HTTPS request, a CDN server of a third party needs to send an encrypted part in a dotting request of the HTTPS to an authentication server on the same side as a web server to authenticate a dotting request of a guest, verify authenticity of an access request of a client, and ensure security of data in the dotting request in a transmission process, so that the CDN server can normally read information in the dotting request, and at present, a commonly used authentication method may include: in practical applications, a person skilled in the art can select a reasonable authentication method according to actual needs, and the present invention is not limited thereto.
And after the authentication of the client dotting request by the authentication server passes, sending a result of passing the authentication of the client dotting request to the CDN server closest to the client.
Preferably, the sub-step a11 may include:
substep A111: and after receiving an HTTPS (hypertext transfer protocol secure) dotting request which is initiated by the client and corresponds to the access request, the content distribution network server forwards the authentication information in the HTTPS dotting request to an authentication server.
In this embodiment of the present invention, the dotting request corresponding to the access request may include: HTTPS (hypertext Transfer Protocol over Secure Socket layer) dotting request, which can be used for compressing and decompressing data, provides an information security channel, ensures data transmission security, and can also confirm authenticity of a client corresponding to an access request.
The HTTPS dotting request requires a client to perform a handshake with the CDN server to establish cryptographic information for both sides to encrypt and transmit data before transmission from the client to the CDN server.
After the CDN server closest to the client receives the HTTPS dotting request corresponding to the client access request, the authentication information in the HTTPS dotting request may be forwarded to the authentication server to perform authentication of the identity information for the HTTPS dotting request.
Preferably, the sub-step a111 may include:
sub-step A1111: and after receiving the HTTPS dotting request initiated by the client, the content distribution network server forwards the client certificate in the HTTPS dotting request and the data encrypted by the public key to an identity authentication server.
In the embodiment of the present invention, the HTTPS dotting request may include: the client certificate and the data encrypted by the public key can be used for verifying the authenticity of the client, and the data encrypted by the public key aims to ensure the safety of the HTTPS dotting request in the transmission process.
In practical application, after the client sends the HTTPS request to the CDN server, the CDN server forwards a new HTTPS request generated by an encryption portion thereof to the authentication server, and the authentication server performs encryption on the encryption portion of the new HTTPS request.
Correspondingly, the specific process of the handshake between the client and the third-party CDN server may include the following steps:
step S1: the client sends a connection request to the CDN server; the connection request includes information such as a client certificate;
step S2: the CDN server forwards information such as certificates in the connection request to the identity authentication server;
step S3: the identity authentication server authenticates information such as a client certificate; and if the authentication is passed, returning the identity information of the authentication server to the CDN server in the form of a certificate, wherein the certificate can comprise: website addresses, encrypted public keys, and issuing authorities for certificates, etc.; if the verification fails, returning the information of the verification failure;
step S4: if the CDN server receives the information of the verification failure, the connection of the client side is refused; if the CDN server receives information such as the certificate and the like, returning the certificate to the client; then the CDN server establishes a Secure channel, i.e., an SSL (Secure Sockets Layer) protocol channel, with the client;
step S5: after receiving a certificate sent by a CDN server, a client verifies the legality of the certificate, when the certificate is legal, the client generates a string of random number passwords and encrypts information in an HTTPS (hypertext transfer protocol secure protocol) dotting request and the client certificate by using an encryption public key in the certificate;
step S6: the client sends the encrypted HTTPS dotting request to the CDN server;
step S7: the CDN server generates a new HTTPS request by the client certificate in the received encrypted HTTPS dotting request and data encrypted by the public key and forwards the new HTTPS request to the identity authentication server;
step S8; and the identity authentication server extracts a client certificate and data encrypted by a public key from a new HTTPS request sent by the CDN for authentication, and then returns an authentication result to the CDN server.
For example, referring to fig. 1A, an authentication server in the figure is an authentication server in the embodiment of the present invention, the authentication server receives a client certificate and data encrypted by a public key in an encrypted HTTPS dotting request sent by a CDN server, and verifies the validity of the client certificate, and when the client certificate is legal, decrypts the data encrypted by the public key.
Sub-step A112: the identity authentication server authenticates identity authentication information in the HTTPS dotting request; and if the verification is passed, informing the HTTPS of the verification passing of the point-making request to the content distribution server.
And when the authentication information in the HTTPS dotting request passes the authentication, the authentication server informs the CDN server that the authentication of the HTTPS dotting request passes, otherwise, informs the CDN server that the authentication of the HTTPS dotting request does not pass.
Preferably, the sub-step a112 may include:
sub-step a 1121: and the identity authentication server judges whether the client certificate is legal or not and whether the data encrypted by the public key can be decrypted or not according to the locally stored server certificate and the private key in the certificate.
In the embodiment of the invention, after the authentication server receives the authentication information of the HTTPS dotting request sent by the CDN server, the legitimacy of the client certificate in the authentication information can be verified according to the server certificate stored in the authentication server, and whether the data encrypted by the public key in the authentication information can be decrypted according to the private key in the server certificate for verification.
And after the authentication information in the HTTPS dotting request is authenticated by the authentication server, returning an authentication result to the CDN server.
Substep A113: and if the content distribution server receives a result of passing the verification returned by the identity verification server, extracting a dotting IP address corresponding to the access request from the dotting request and sending the dotting IP address to the advertisement server.
After the CDN server receives the result of passing the authentication corresponding to the dotting request returned by the authentication server, the CDN server may perform domain name resolution on the client corresponding to the dotting request according to the local DNS server to obtain a dotting IP address of the client, where the dotting IP address of the client is the dotting IP address corresponding to the client access request, and send the dotting IP address of the client access request to the advertisement server for statistics.
Step S130: and performing matching calculation on the dotting IP address and the first IP address, and correcting the real IP address of the access request.
In the embodiment of the present invention, after receiving the dotting IP address and the first IP address corresponding to the client access request, the advertisement server may use a certain calculation method to determine whether the client access request is relayed or not, and if so, perform corresponding correction, as shown in fig. 1A, the advertisement server may be provided with corresponding correction service to determine whether the first IP address corresponding to the client access request is the real IP address of the client access request or not. For example, each first IP address corresponding to the client access request is compared with each dotting IP address to determine whether each dotting IP address is the same as each first IP address, if so, the client access request is not relayed, and if not, the access request is relayed, and the first IP address corresponding to the client access request stored in the web server is correspondingly corrected.
The specific matching calculation method will be described in detail in embodiment two, and will not be described in detail here.
In the embodiment of the invention, the real IP address corresponding to the client access request can be obtained after the obtained IP address corresponding to the client access request is correspondingly corrected, so that the problem of the IP address stored in the server after the client access request is changed is solved, and the server can obtain the IP address which is more matched with the area where the client is located.
Preferably, after the step S130, the method may further include:
step S140: and aiming at the access request with the corrected real IP address, retrieving and/or delivering network advertisement data based on the real IP address according to the real IP address.
In the embodiment of the invention, after the real IP address corresponding to the client access request is corrected in the advertisement server, the web server can retrieve the network advertisement data issued in the advertisement system based on the real IP address and deliver the network advertisement data based on the real IP address to the client corresponding to the real IP address.
Correspondingly, after the real IP address corresponding to the client access request is corrected in the advertisement server, corresponding fees can be deducted according to the account of the publisher issuing the network advertisement corresponding to the client access request in the advertisement system, and the charging standards of the network advertisements corresponding to different regions are different. For example, when a user in a certain region a accesses a network advertisement delivered by an advertisement deliverer a in the region a, a corresponding fee is incurred for the advertisement deliverer a of the network advertisement, the fee for the access is deducted from an advertisement account of the advertisement deliverer a, and a user in another region does not incur a fee after accessing the network advertisement delivered by the advertisement deliverer a in the region a. For example, when the advertisement publisher a launches the network advertisement a for the user in beijing, and the user in shanghai visits the network advertisement a launched in beijing, the fee deduction cannot be made for the advertisement publisher a of the network advertisement, that is, the fee for the visit cannot be deducted from the advertisement account of the advertisement publisher a.
The embodiment of the invention corrects the first IP address corresponding to the access request into the real IP address, and then can deduct the fee from the advertisement account of the advertisement releaser by using the real IP address for the corresponding access request according to the real IP address. For example, if the real IP address of an access request is shanghai and the access request accesses the network advertisement delivered by advertiser a in beijing, the advertisement server does not deduct the cost of advertisement delivery from the advertisement account of advertiser a for the access. Therefore, the method can avoid the error fee deduction to the advertisement placer of the network advertisement and reduce the cost loss of the network advertisement placer.
Preferably, after the step S130, the method may further include:
step S150: and recommending personalized information corresponding to the real IP address according to the real IP address aiming at the access request with the real IP address corrected.
In the embodiment of the present invention, after the real IP address corresponding to the access request is corrected, the network information published in the region where the client is located may be recommended to the client corresponding to the real IP address, for example, the region where the client corresponding to the real IP address of the access request is located is shanghai, the network advertisement published in shanghai may be recommended to the client, and the like. And then can maximize utilization network information resource, improve the popularization of network information. Of course, the personalized information may also include information related to the region to which the real IP address belongs, such as news information, rental house information, and the like of the region.
The embodiment of the invention obtains the first IP address of the client-side access request sent by the client-side to the server and the dotting IP address of the content distribution network server closest to the client-side access request, and performs matching calculation on the dotting IP address of the client-side access request and the first IP address, so that the obtained first IP address can be corrected, the corrected IP address can be more in line with the region where the client-side initiating the access request is located, the probability of false fee deduction is reduced, and the cost loss of an advertisement publisher is reduced.
Example two
Referring to fig. 2, a flowchart illustrating steps of an embodiment of an IP address correction method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step S210: acquiring a first IP address and a global identification from a received access request and recording; the global identification is written into the access request by the client when the access request is sent.
In the embodiment of the invention, the global identifier can be a unique identifier for identifying the client access request in the whole process of sending the client access request, different clients have different global identifiers, the global identifier is associated and bound with the client access request in the whole process of sending the access request by the client to obtain data corresponding to the access request, the global identifier and an IP address corresponding to the client access request can be correspondingly stored when the access request of the client is obtained, and the first IP address corresponding to the client access request of the access request can be directly found according to the global identifier when the IP address corresponding to the client access request is judged in the future.
The global identification is written into the access request before the access request is sent to the client, and then the access request is sent to the web server together with the access request.
In practical applications, the global identifier is the global identifier assigned to the user when the user accesses the web server for the first time. For example, when a user accesses a web server with his user ID, the web server assigns a unique global identity to the user. Of course, if the user accesses the web server in the form of a guest, the device information of the client of the user, such as hardware information such as a physical address, etc., may be obtained, and the hardware information is unique, and then the web server assigns a unique global identifier to the device information.
Step S220: and acquiring and recording a dotting IP address and a global identification of the access request through a content distribution network server closest to a client initiating the access request.
In the embodiment of the invention, when the web server receives the client access request, the web server can issue the dotting notification to the client according to the first IP address corresponding to the client access request so as to notify the client to dotte on the CDN server closest to the client. A DNS server local to a client may locate an access request of the client to a CDN server closest to the client, where the client dotting request may include: and the global identifier is written into the dotting request before the client sends the dotting request to the CDN server, and is sent to the CDN server together with the dotting request.
The CDN server performs dotting on the CDN server according to a dotting request of the client, and acquires an IP address of a client access request corresponding to the dotting request, wherein the IP address is the dotting IP address corresponding to the client access request. Correspondingly, the CDN server may bind the global identifier corresponding to the client and the dotting IP address corresponding to the client access request, and send the binding to the dotting collection server, and the dotting collection server may send the collected dotting IP address corresponding to the client access request to the advertisement server for statistics and recording.
Therefore, when the global identifier corresponding to a certain client is obtained, the dotting IP addresses corresponding to all the access requests of the client can be obtained.
Step S230: and searching each dotting IP address and each first IP address under the same global identification.
In the embodiment of the invention, the advertisement server can search and acquire each dotting IP address and each first IP address corresponding to the client access request under the same global identifier when acquiring the global identifier corresponding to the client access request according to the binding relationship between the global identifier and the client access request.
Step S240: and performing matching calculation on the dotting IP address and the first IP address, and judging whether the access request corresponding to the first IP address is transferred.
After acquiring each dotting IP address and each first IP address corresponding to the client access request under the same global identifier, the advertisement server calculates the dotting IP address and the first IP address corresponding to the client access request according to a preset calculation mode to judge whether the access request corresponding to the first IP address is transferred, and when the access request corresponding to the first IP address is transferred, step S250 is executed.
Preferably, the step S240 may include:
substep S2402: judging whether each first IP address under the global identification is the same as each dotting IP address or not, and if the first IP addresses under all the identifications are not the same as the dotting IP addresses, executing a substep S2404;
substep S2404: and determining that the access request corresponding to the first IP address is transferred.
The embodiment of the invention can be applied to the situation of judging whether all the access requests corresponding to the clients are transferred.
The first IP addresses and the dotting IP addresses corresponding to the access requests of the clients are obtained according to the global identifier corresponding to the access requests of the clients, and then the first IP addresses and the dotting IP addresses corresponding to the access requests of a certain client are correspondingly matched according to the global identifier. Further judging whether the matched first IP addresses are the same as the dotting IP addresses or not, and determining that the access requests of the client corresponding to the first IP addresses are transferred when the matched first IP addresses are not the same as the dotting IP addresses; and when the matched first IP addresses are the same as the dotting IP addresses, determining that the access request of the client corresponding to the first IP addresses is not transferred. For example, for an access request of a certain client a, the first IP addresses corresponding to the access requests of the client a obtained are IP2 and IP3, and the dotting IP address corresponding to the access request of the client a has 2 IP1, which indicates that the access request of the client a is relayed, otherwise indicates that the access request of the client a is not relayed. For another example, if the first IP address of 10 access requests corresponding to the client a has 10 respective IPs 2 and the dotting IP address has 10 IPs 1, the dotting IP address is different from the first IP address, and the relay of the 10 access requests is confirmed.
Certainly, in practical application, whether the dotting IP address and the first IP address belong to the same region or not can be judged, and if the dotting IP address and the first IP address belong to the same region, it can be considered that the access request of the first IP address is not relayed; if the access requests do not belong to the same region, the access requests of the first IP address can be considered to be relayed.
According to the embodiment of the invention, the one-to-one matching judgment is carried out according to whether the first IP addresses corresponding to the client access requests are the same as the dotting IP addresses, so that whether the client access requests are transferred is judged, and the first IP addresses of inaccurate corresponding client access requests in the web server can be avoided as much as possible.
Preferably, the step S240 may further include:
substep S2406: judging whether each first IP address under the global identification is partially different from each dotting IP address or not; if the first IP addresses under the global identification are different from the dotting IP addresses, executing a substep S2406;
substep S2408: and determining that the access request corresponding to the part of the first IP address different from each dotting IP address is relayed.
The embodiment of the invention can be applied to correspondingly judging whether part of the access requests of the corresponding clients are transferred.
After acquiring each first IP address and each dotting IP address corresponding to each client access request, the embodiment of the invention respectively matches each first IP address and each dotting IP address corresponding to different client access requests one by one according to the global identification corresponding to each client access request, compares the dotting IP address successfully matched with the first IP address to judge whether the first IP address and the dotting IP address corresponding to each client access request are the same, if so, indicates that part or all of the client access requests are not transferred, and if not, indicates that the client access requests are transferred. And according to the matching judgment mode, respectively matching and judging the dotting IP addresses and the first IP addresses corresponding to the access requests of the clients one by one so as to judge whether partial transfer of the access requests occurs. For example, the global identifiers corresponding to the access request of the client a are respectively: m and N, the first IP addresses which can obtain the access request of the corresponding client A according to M are IP1, IP2 and IP1, and dotting IP addresses IP1, IP1 and IP 1; comparing the first IP address corresponding to the access request of the client a with the dotting IP address, it can be known that the first IP address is a relay of the access request of the client a corresponding to the IP 2.
Correspondingly, for the condition that whether the access requests of the clients are transferred or not, the first IP address corresponding to the access request of each client and each dotting IP address can be matched and compared one by one according to the global identifier corresponding to the access request of each client in the above manner, so as to determine how many access requests of each client are transferred.
It can be understood that, when the number of the first IP addresses corresponding to the client access requests stored in the advertisement server is large, the method may be adopted to match the first IP addresses corresponding to the access requests with the dotting IP addresses one by one, so as to determine the number of the access requests that have a transfer in a certain client access request, and further correct the inaccurate IP addresses stored in the advertisement server, so as to reduce the number of the inaccurate IP addresses stored in the advertisement server.
According to the embodiment of the invention, according to the global identification of each client access request, the first IP addresses corresponding to each client access request are matched and judged with the dotting IP addresses, so that whether the transfer of part of the access requests occurs is determined, and the first IP address corresponding to a certain client access request can be verified in a matched manner, so that a large amount of verification time can be saved.
Step S250: and correcting the real IP address of the access request according to the dotting IP address.
When it is determined that the IP address corresponding to the access request is relayed, the first IP address corresponding to the access request stored in the web server may be replaced with the dotting IP address corresponding to the access request, that is, the correction of the IP address where the access request occurs is completed.
Preferably, in case of substep S2402-substep S2404, the step S250 may include:
substep S2502: judging whether the number of the same dotting IP addresses in all the dotting IP addresses exceeds a threshold value or not; if the number of the same dotting IP addresses in all the dotting IP addresses exceeds a threshold value, executing a substep S2504;
substep S2504: and taking the dotted IP address exceeding the threshold value as the real IP address of the access request.
The embodiment of the invention can be used for judging the same dotting IP address corresponding to a plurality of access requests of a certain client.
In the process that a client access request is sent to a CDN server closest to the client, a phenomenon of client access request transfer may occur, which may cause a change in a dotting IP address of the access request, and further, the dotting IP addresses obtained by the CDN server closest to the client corresponding to the access request of the same client may be different. For example, when an access request is sent to a client a, the real IP address corresponding to the access request of the client is IP-1, and IP-1 and IP-2 may occur when a hit IP address corresponding to the access request of the client is obtained at a CDN server closest to the client.
In the embodiment of the invention, the dotting IP addresses corresponding to the access requests of the same client are the same dotting IP addresses, under the condition that the dotting IP addresses of the access requests corresponding to the client are different, the embodiment of the invention judges whether the number of the same IP addresses corresponding to the access requests of the client exceeds the preset threshold value by presetting the threshold value, and when one IP address exceeds the threshold value, the IP address is taken as the real IP address corresponding to the access request. In the embodiment of the invention, the dotting IP addresses are correspondingly counted according to the number of the first IP addresses. For example, the preset threshold is 80% of the total number of dotted IP addresses. As in the previous example, the web server obtains 200 IP-N IP addresses, and dotting the IP addresses as: there are 180 IP-1, 15 IP-2 and 5 IP-3. The advertisement server determines that 200 corresponding access requests are all relayed according to substeps S2402-S2404, and calculates that IP-1 occupies 90% of the same dotting IP address according to the dotting IP address, and then the IP-1 can be used as a real IP address corresponding to the client access request.
Accordingly, in practical applications, a person skilled in the art can set the threshold value according to actual needs, and the present invention is not limited to this.
And when the same dotting IP addresses corresponding to the client access requests are calculated to be different, using the dotting IP addresses exceeding the threshold value in the same dotting IP addresses as the real IP addresses of the client access requests.
According to the method and the device for obtaining the dotting IP address, the same dotting IP address for obtaining the corresponding client access request is judged, so that the dotting IP address for obtaining the corresponding client access request is accurate, and the number of inaccurate dotting IP addresses stored by a system is reduced.
Preferably, in the case of sub-step S2406 to sub-step S2408, the step S250 may further include:
substep S2506: and correcting the real IP address of the access request to be the IP address of the same part of the first IP address as each dotting IP address aiming at the access request corresponding to the part of the first IP address different from each dotting IP address.
The embodiment of the invention can be used for the condition of sending the access request aiming at a certain client. After acquiring each first IP address corresponding to the client access request, comparing and judging each first IP address with each dotting IP address corresponding to the client access request, wherein each dotting IP address is the same, the first IP address which is the same as each dotting IP address in each first IP address is the real IP address corresponding to the client access request, and the part of the first IP address which is different from each dotting IP address is corrected into the IP address which is the same as each dotting IP address in the first IP address, namely the inaccurate IP address of the access request is corrected.
For example, the web server receives 200 access requests, corresponding to 100 IP-1 and 100 IP-N in the first IP address. And the dotting IP addresses obtained from the dotting collection server have 200 IP-1, then the advertisement server determines that 100 access requests of IP-N are relayed according to substep S2406-substep S2408, and then corrects the first IP address of the 100 access requests to IP-1.
The embodiment of the invention obtains the first IP address corresponding to the client access request and the dotting IP address corresponding to the client access request of the content distribution network server nearest to the client, performs matching calculation on the dotting IP address corresponding to the client access request and the first IP address, and designs a series of matching calculation methods, so that the inaccurate IP address can be corrected to a large extent, the real IP address corresponding to the access request is corrected, the obtained first IP address can be corrected, the corrected IP address can be more in line with the region where the client initiating the access request is located, the probability of mistaken fee deduction is reduced, and the cost loss of an advertiser is reduced.
For simplicity of explanation, the method embodiments are described as a series of acts or combinations, but those skilled in the art will appreciate that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the embodiments of the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
EXAMPLE III
Referring to fig. 3, a block diagram of an embodiment of an IP address correction apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
a first IP address obtaining module 310, adapted to obtain a first IP address corresponding to an access request sent by a client when the client accesses a server; the first IP address is obtained by the access request over a normal routing path.
A dotting IP address obtaining module 320 adapted to obtain a dotting IP address through a content distribution network server closest to a client initiating the access request; and the dotting IP address is obtained by sending a dotting request to a content distribution network server by the client according to the access request.
And the real IP address correction module 330 is adapted to perform matching calculation on the dotting IP address and the first IP address to correct the real IP address of the access request.
Preferably, after the real IP address modification module 330, the method further includes:
and the retrieval and delivery module 340 is suitable for retrieving and/or delivering the network advertisement data based on the real IP address according to the real IP address aiming at the access request with the corrected real IP address.
Preferably, after the real IP address modification module 330, the method further includes:
and the personalized information recommending module 350 is adapted to recommend personalized information corresponding to the real IP address according to the real IP address for the access request with the real IP address corrected.
Example four
Referring to fig. 4, a block diagram of an embodiment of an IP address correction apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
a first IP address obtaining module 410, adapted to obtain a first IP address corresponding to an access request sent by a client when the client accesses a server; the first IP address is obtained by the access request over a normal routing path.
Preferably, the first IP address obtaining module 410 includes:
a first IP address obtaining sub-module 4102, adapted to obtain and record a first IP address and a global identifier from the received access request; the global identification is written into the access request by the client when the access request is sent.
A dotting IP address obtaining module 420 adapted to obtain a dotting IP address through a content distribution network server closest to a client initiating the access request; and the dotting IP address is obtained by sending a dotting request to a content distribution network server by the client according to the access request.
Preferably, the dotting IP address obtaining module 420 includes:
a dotting IP address obtaining sub-module 4202, adapted to obtain and record the dotting IP address and the global identifier of the access request through the content distribution network server closest to the client initiating the access request.
And a real IP address correction module 430, adapted to perform matching calculation on the dotting IP address and the first IP address, and correct the real IP address of the access request.
Preferably, the real IP address modification module 430 includes:
the IP address searching submodule 4302 is suitable for searching each dotting IP address and each first IP address under the same global identification;
the access request transfer judgment sub-module 4304 is adapted to perform matching calculation on the dotting IP address and the first IP address, and judge whether the access request corresponding to the first IP address is transferred;
and the real IP address correction submodule 4306 is adapted to correct the real IP address of the access request according to the dotting IP address when the access request corresponding to the first IP address is forwarded.
Preferably, the access request judgment sub-module 4304 includes:
a first IP address and dotting IP address determining submodule 43042 adapted to determine whether each first IP address under the global identifier is the same as each dotting IP address;
and the access request transfer sub-module 43044 is adapted to determine that the access request corresponding to the first IP address is transferred when each first IP address under the global identifier is different from each dotting IP address.
The real IP address correction submodule 4306 includes:
a dotting IP address number judgment sub-module 43062 adapted to judge whether the number of the same dotting IP address exceeds a threshold value in each dotting IP address;
and the real IP address replacing submodule 43064 is adapted to, when the number of the same dotting IP addresses in each dotting IP address exceeds the threshold, use the dotting IP addresses exceeding the threshold as the real IP addresses of the access request.
Preferably, the access request transfer judgment sub-module 4304 includes:
a partial first IP address and dotting IP address judgment sub-module 43046 adapted to judge whether each first IP address under the global identifier is partially different from each dotting IP address;
the partial access request relay module 43048 is adapted to determine that an access request corresponding to a portion of the first IP address different from each dotting IP address is relayed when each first IP address under the global identifier is different from each dotting IP address.
Preferably, the real IP address modification sub-module 4306 includes:
and the partial real IP address correction submodule 43066 is adapted to correct, for the access request corresponding to the portion of the first IP address different from each dotting IP address, the real IP address of the access request to be the IP address of the same portion of the first IP address as each dotting IP address.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
EXAMPLE five
Referring to fig. 5, a block diagram of an embodiment of an IP address modification apparatus 500 according to an embodiment of the present invention is shown, which may specifically include:
a memory 510 loaded with a plurality of executable instructions;
a processor 520 that executes the plurality of executable instructions; the plurality of instructions includes a method of performing the steps of:
when a client accesses a server, acquiring a first IP address corresponding to an access request sent by the client; the first IP address is obtained by an access request through a normal routing path;
acquiring a dotting IP address through a content distribution network server closest to a client initiating the access request; the dotting IP address is obtained by the client sending a dotting request to a content distribution network server according to the access request;
and performing matching calculation on the dotting IP address and the first IP address, and correcting the real IP address of the access request.
Preferably, the executable instructions of the embodiments of the present invention may further include methods of the foregoing steps, which are not limited by the embodiments of the present invention.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in an IP address correction apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.