CN112019649B - Method, device and system for correcting IP address, storage medium and electronic equipment - Google Patents

Method, device and system for correcting IP address, storage medium and electronic equipment Download PDF

Info

Publication number
CN112019649B
CN112019649B CN202010845051.XA CN202010845051A CN112019649B CN 112019649 B CN112019649 B CN 112019649B CN 202010845051 A CN202010845051 A CN 202010845051A CN 112019649 B CN112019649 B CN 112019649B
Authority
CN
China
Prior art keywords
address
click
client
exposure
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010845051.XA
Other languages
Chinese (zh)
Other versions
CN112019649A (en
Inventor
张其科
刘沛
李大圣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN202010845051.XA priority Critical patent/CN112019649B/en
Publication of CN112019649A publication Critical patent/CN112019649A/en
Application granted granted Critical
Publication of CN112019649B publication Critical patent/CN112019649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method, a device and a system for correcting an IP address, a storage medium and electronic equipment, and belongs to the field of computers. Wherein, the method comprises the following steps: monitoring a click event of a client aiming at a media resource; when the click event occurs, obtaining a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the viewing event of the client is monitored in historical time; and correcting the click IP of the click event according to the historical exposure IP. The invention solves the technical problem that the exposure IP of the monitoring user is inconsistent with the click IP in the related technology, avoids the IP deviation and improves the stability and the accuracy of the IP monitoring system.

Description

Method, device and system for correcting IP address, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to a method, a device and a system for correcting an IP address, a storage medium and electronic equipment.
Background
When the related art performs regional analysis on the click behavior of the media resource on the media server, the user IP of the client often needs to be acquired, and then the region is analyzed according to the IP address, and if the IP address is wrong, the region analysis is wrong or the analysis fails.
In the related art, a user triggers an exposure monitoring code and clicks the monitoring code at the same time in a very short time, and different IPs are obtained on an acquisition server with a certain probability due to the difference in the user network environment, the resolution of the DNS, or the server location where the click code is exposed. The same user obtains different IPs at different servers, which may cause IP bias in a series of data in the future. In the related art, generally, which IP is used when the IP is received, that is, one of the IPs is randomly used as the user IP, and it is not possible to distinguish between an exposure IP and a click IP, nor between IPv4 and IPv6 network protocols, and thus when the exposure IP and the click IP are different, or the network protocols are different, the analyzed user IPs are not consistent, resulting in IP deviation.
In view of the above problems in the related art, no effective solution has been found so far.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a system, a storage medium and electronic equipment for correcting an IP address.
According to an aspect of an embodiment of the present application, there is provided a method for correcting an IP address, including: monitoring a click event of a client aiming at a media resource; when the click event occurs, obtaining a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the watching event of the client is monitored in historical time; and correcting the click IP of the click event according to the historical exposure IP.
Further, before obtaining the historical exposure IP from the cache of the client, the method further includes: monitoring a viewing event of the client for the media asset; when the watching event occurs, acquiring a user IP of the client; and determining the user IP as the exposure IP of the viewing event, and storing the exposure IP in a cache of the client.
Further, the obtaining of the historical exposure IP from the cache of the client includes: acquiring an IP address list from a cache of the client; judging whether a legal first IP address of the IPv4 version exists in the IP address list or not; if a legal first IP address of the IPv4 version exists, determining the first IP address as the historical exposure IP; and if the first IP address of the legal IPv4 version does not exist, determining the second IP address of the legal IPv6 version in the IP address list as the historical exposure IP.
Further, correcting the click IP of the click event according to the historical exposure IP includes: replacing the original IP field of the clicked IP by the target IP field of the historical exposure IP; analyzing a first IP address type in a click request message of the click event and a second IP address type of the historical exposure IP; and correcting the network protocol of the click IP according to the first IP address type and the second IP address type.
Further, correcting the network protocol of the click to IP according to the first IP address type and the second IP address type includes: if the IP address type is IPv4 and the historical exposure IP is IPv4, correcting the click IP to be IPv4; if the IP address type is IPv4 and the historical exposure IP is IPv6, correcting the click IP to be IPv6; if the IP address type is IPv6 and the historical exposure IP is IPv4, correcting the click IP to be IPv4; and if the IP address type is IPv6 and the historical exposure IP is IPv6, correcting the click IP to be IPv6.
Further, obtaining the historical exposure IP from the cache of the client includes: acquiring an IP address list from a cache of the client; judging whether a legal first IP address of the IPv6 version exists in the IP address list or not; if a legal first IP address of the IPv6 version exists, determining the first IP address as the historical exposure IP; and if the first IP address of the legal IPv6 version does not exist, determining the second IP address of the legal IPv4 version in the IP address list as the historical exposure IP.
Further, after correcting the click IP of the click event according to the historical exposure IP, the method further comprises: analyzing the region range of the client according to the click IP; and determining the region range as the region range for clicking the media resource.
According to another aspect of the embodiments of the present application, there is also provided an IP address correction apparatus, including: the first monitoring module is used for monitoring a click event of the client aiming at the media resource; a first obtaining module, configured to obtain a historical exposure IP from a cache of the client when the click event occurs, where the historical exposure IP is a user IP stored when a viewing event of the client is monitored at a historical time; and the correction module is used for correcting the click IP of the click event according to the historical exposure IP.
Further, the apparatus further comprises: the second monitoring module is used for monitoring the watching event of the client aiming at the media resource before the first monitoring module acquires the historical exposure IP from the cache of the client; the second acquisition module is used for acquiring the user IP of the client when the watching event occurs; and the processing module is used for determining the user IP as the exposure IP of the viewing event and storing the exposure IP in the cache of the client.
Further, the first obtaining module comprises: the obtaining unit is used for obtaining an IP address list from the cache of the client; the first judging unit is used for judging whether a legal first IP address of an IPv4 version exists in the IP address list or not; a first determining unit, configured to determine, if a valid first IP address of an IPv4 version exists, the first IP address as the historical exposure IP; and if the first IP address of the legal IPv4 version does not exist, determining the second IP address of the legal IPv6 version in the IP address list as the historical exposure IP.
Further, the first obtaining module comprises: the obtaining unit is used for obtaining an IP address list from the cache of the client; a second judging unit, configured to judge whether a first IP address of a legal IPv6 version exists in the IP address list; a second determining unit, configured to determine, if a valid first IP address of an IPv6 version exists, the first IP address as the historical exposure IP; and if the first IP address of the legal IPv6 version does not exist, determining the second IP address of the legal IPv4 version in the IP address list as the historical exposure IP.
Further, the correction module includes: the replacing unit is used for replacing the original IP field of the click IP with the target IP field of the historical exposure IP; the analysis unit is used for analyzing a first IP address type in a click request message of the click event and a second IP address type of the historical exposure IP; and the correcting unit is used for correcting the network protocol of the click IP according to the first IP address type and the second IP address type.
Further, the correction unit includes: a first syndrome unit, configured to correct the click IP to IPv4 if the IP address type is IPv4 and the historical exposure IP is IPv4; a second correcting subunit, configured to correct the click IP to IPv6 if the IP address type is IPv4 and the historical exposure IP is IPv6; a third syndrome unit, configured to correct the click IP to IPv4 if the IP address type is IPv6 and the historical exposure IP is IPv4; and the fourth syndrome unit is used for correcting the click IP into IPv6 if the IP address type is IPv6 and the historical exposure IP is IPv6.
Further, the apparatus further comprises: the analysis module is used for analyzing the region range of the client according to the click IP after the correction module corrects the click IP of the click event according to the historical exposure IP; and the determining module is used for determining the region range as the region range for clicking the media resource.
According to another aspect of the embodiments of the present application, there is also provided an IP address correction system, including: the system comprises a media server, a monitoring server and a client, wherein the media server is connected with the client, is deployed with an exposure monitoring script and a click monitoring script and is used for monitoring click events and exposure events on the client; the monitoring server is connected with the media server and comprises the device described in the embodiment.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
According to the invention, the click event of the media resource is monitored by the client, when the click event occurs, the historical exposure IP corresponding to the viewing event is obtained from the cache of the client, the click IP of the click event is corrected according to the historical exposure IP, and the click IP of the click event is corrected by using the historical exposure IP, so that the consistency of the user IP in the click event and the viewing event can be ensured, the technical problem that the exposure IP of the monitoring user is inconsistent with the click IP in the related technology is solved, the IP deviation is avoided, and the stability and the accuracy of an IP monitoring system are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a server according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for correcting an IP address according to an embodiment of the present invention;
FIG. 3 is a flow chart of resolving an IP address of an embodiment of the present invention;
fig. 4 is a block diagram showing a configuration of an apparatus for correcting an IP address according to an embodiment of the present invention;
fig. 5 is a block diagram of a system for correcting an IP address according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device implementing an embodiment of the invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, 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.
Example 1
The method provided by the embodiment one of the present application may be executed in a server, a computer, or a similar computing device. Taking an example of the server running on the server, fig. 1 is a hardware structure block diagram of a server according to an embodiment of the present invention. As shown in fig. 1, the server 10 may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data, and optionally may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and is not intended to limit the structure of the server. For example, the server 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a server program, for example, a software program and a module of application software, such as a server program corresponding to a method for correcting an IP address in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the server program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to server 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for correcting an IP address is provided, and fig. 2 is a flowchart of the method for correcting an IP address according to the embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, monitoring a click event of a client aiming at a media resource;
in this embodiment, by deploying a script for clicking a monitoring code on a media server, when a user clicks a media resource on the media server through a client, for example, contents such as a video and a picture, the user is actively triggered, and through interaction with the monitoring server, the monitoring server can receive a corresponding user behavior log, where the user behavior log includes information such as but not limited to a user cookie, an ip, and a user agent, and monitors activity-related data.
Step S204, when a click event occurs, acquiring a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the viewing event of the client is monitored in historical time;
since a user must open and present a media resource in a browser or APP when clicking on the media resource on a client, and then click (e.g. click on a video of interest) after viewing the media resource, the historical exposure IP obtained in the cache (e.g. cookie) of the client is the user IP of the viewing event before the click event occurs.
In step S206, the click IP of the click event is corrected according to the historical exposure IP.
In the embodiment, the historical exposure IP is used as a reference, the click IP of the click event is corrected to be consistent with the exposure IP, and the consistency of the user IP is ensured.
Through the steps, the click event of the client aiming at the media resource is monitored, when the click event occurs, the historical exposure IP corresponding to the watching event is obtained from the cache of the client, the click IP of the click event is corrected according to the historical exposure IP, and the click IP of the click event is corrected by using the historical exposure IP, so that the consistency of the user IP in the click event and the watching event can be ensured, the technical problem that the exposure IP of the monitoring user is inconsistent with the click IP in the related technology is solved, the IP deviation is avoided, and the stability and the accuracy of an IP monitoring system are improved.
In another aspect of this embodiment, the exposure IP may also be obtained through the exposure monitoring code, and before obtaining the historical exposure IP from the cache of the client, the method further includes: monitoring a viewing event of a client for a media asset; when a watching event occurs, acquiring a user IP of a client; the user IP is determined as the exposure IP of the viewing event and the exposure IP is stored in the cache of the client.
In this embodiment, by deploying the exposure monitoring code on the media server, when the user views media resources on the media, such as video, pictures, and other contents, the user is automatically triggered, and through interaction with the monitoring server, the monitoring server can receive a corresponding user behavior log, where the user behavior log includes but is not limited to a user cookie, ip, a user agent, and data related to monitoring activities.
When the exposure monitoring code is triggered, the current user IP is stored in the browser cookie of the user or the application data of the APP. When the click monitoring code is triggered, the server can find the IP exposed in the previous period from the cookie of the browser of the user, and the IP exposed is taken as the IP of the user at the time of the click, so that the consistency of the IP of the user is ensured.
In some examples of this embodiment, the media resource sets codes of a click event and a view event, and only a monitoring code of one event is triggered due to a network anomaly, a network switch, and the like, for example, only the click event is monitored, in this case, a historical exposure IP (if any) is obtained from a cache of the client, and the click IP of the click event is corrected according to the historical exposure IP, in the case that there is no historical exposure IP in the cache, a user IP of the client is obtained and determined as the click IP of the click event, in another scenario, if only the view event is monitored, in this case, an exposure IP of a current view event is taken as a final user IP, in yet another scenario, both the click event and the view event are triggered, but the view event is triggered after the click event, in this case, the historical exposure IP is obtained from the cache of the client, and the click IP of the click event is corrected by using the historical exposure IP, and if the view event is consistent, one of the click IP and the final user IP is selected.
In this embodiment, a plurality of IP addresses, different IP addresses in the IP address list, or IP addresses of different versions (network protocols) may be stored in the cache of the client, in this case, the present embodiment sets the priority of the network protocol, such as preferentially selecting the IPv4 version or preferentially selecting the IPv6 version, and in the case of consistent versions, the IP address may be selected according to the storage time, such as selecting the IP address stored most recently.
In an implementation manner of this embodiment, the obtaining the historical exposure IP from the cache of the client includes: acquiring an IP address list from a cache of a client; judging whether a legal first IP address of the IPv4 version exists in the IP address list or not; if a legal first IP address of the IPv4 version exists, determining the first IP address as a historical exposure IP; and if the first IP address of the legal IPv4 version does not exist, determining the second IP address of the legal IPv6 version in the IP address list as the historical exposure IP.
In another implementation of this embodiment, the obtaining the historical exposure IP from the cache of the client includes: acquiring an IP address list from a cache of a client; judging whether a legal first IP address of the IPv6 version exists in the IP address list or not; if a legal first IP address of the IPv6 version exists, determining the first IP address as a historical exposure IP; and if the first IP address of the legal IPv6 version does not exist, determining the second IP address of the legal IPv4 version in the IP address list as the historical exposure IP.
In this embodiment, IPv4 (Internet Protocol version 4, also called fourth edition of Internet communication Protocol) is a fourth revision in the development process of Internet Protocol, and is also the first widely deployed version of this Protocol. IPv4 is the core of the Internet, and is also the most widely used Internet Protocol Version, and its subsequent Version is IPv6 (Internet Protocol Version 6 ), which is the next generation IP Protocol designed by Internet Engineering Task Force (IETF) for replacing IPv4, and its number of addresses is more than IPv4, and reaches 2^128, and in the current network environment, IPv6 is widely popularized, but in the real network, most of the IP is IPv4, and IPv4 to IPv6 are long-term handover processes, and the IP of the two protocols will coexist for a relatively long time, and the address length of IPv6 is 128 bits, which is 4 times the address length of IPv4, so when analyzing, the analysis algorithm of the IP address of IPv6 is more complex. However, with the development of IPv6, IPv4 is gradually replaced, and therefore, the positions of IPv6 and IPv4 may also be changed.
In one embodiment of the present embodiment, correcting the click IP of the click event according to the historical exposure IP includes:
s11, replacing an original IP field of the clicked IP with a target IP field of the historical exposure IP;
s12, analyzing a first IP address type and a second IP address type of historical exposure IP in a click request message of a click event;
and S13, correcting the network protocol of the click IP according to the first IP address type and the second IP address type.
In one implementation of this embodiment, the network protocol for correcting the click to IP according to the first IP address type and the second IP address type includes: if the IP address type is IPv4 and the historical exposure IP is IPv4, correcting the click IP to be IPv4; if the IP address type is IPv4 and the historical exposure IP is IPv6, correcting the click IP to be IPv6; if the IP address type is IPv6 and the historical exposure IP is IPv4, correcting the click IP to be IPv4; if the IP address type is IPv6 and the historical exposure IP is IPv6, correcting the click IP to be IPv6.
In the embodiment, the conversion of the network protocol is decimal and hexadecimal, IPv4 is decimal, and IPv6 is hexadecimal. In one example, an example of IPv4 is: 192.168.0.118, IPv4 is decimal, so IPv6 converted to hexadecimal becomes: 192.168.0.118 → 0000:0000:0000:0000:0000:0000: c0a8:0076, wherein 0 can be omitted, and the formula is c0a8:0076 or c0a8: 0. IPv6 is hexadecimal, the conversion process is opposite to the above process, so IPv4 converted into decimal becomes: c0=192: a8=168:0=00:76=118.
Fig. 3 is a flowchart of analyzing an IP address according to an embodiment of the present invention, where after a click event of a user is monitored, an address type (IPv 4 or IPv 6) of the IP address carried in a click request message is determined, and then whether an exposure correction IP (an exposure IP stored in a Cookie) exists and the address type of the exposure correction IP are further determined, and finally, the IP address is analyzed using a corresponding IP library.
The exposure correction IP of this embodiment is an IP (corresponding to a click event) that corrects a click through an exposed IP (corresponding to a view event), and is based on an IP of a user during exposure.
When the exposure IP is obtained, by analyzing the exposure log, if the IPv4 IP in the log is legal, the IPv4 IP is used; otherwise, using IP of IPv6; when the click IP is obtained, by analyzing the click log, firstly, according to the rule of the exposure log (which IP address of the network protocol is used preferentially), determining which IP type is used, wherein the priority of the exposure correction IP is greater than that of the click IP, and the priority of the IPv4 is greater than that of the IPv6, and the method comprises the following processing rules:
the click request is IPv4, the exposure correction IP is IPv4, and the click IP is corrected to be IPv4;
the click request is IPv4, the exposure correction IP is IPv6, and the click IP is corrected to be IPv6;
the click request is IPv6, the exposure correction IP is IPv4, and the click IP is corrected to be IPv4;
and if the click request is IPv6 and the exposure correction IP is IPv6, correcting the click IP to be IPv6.
Optionally, after the click IP of the click event is corrected according to the historical exposure IP, the corrected click IP may be used to analyze the regional distribution of the media resource. The method comprises the following steps: analyzing the region range of the client according to the IP clicking; and determining the region range as the region range of the media resource clicking. If the media resource is IPv4, the IPv4 version IP library is used for analyzing the region, and if the media resource is IPv6, the IPv6 version IP library is used for analyzing the region, so that the region range of clicking the media resource, such as which province clicks how many times, is accurately obtained.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a device and a system for correcting an IP address are also provided, which are used to implement the foregoing embodiments and preferred embodiments, and are not described again after being described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a structure of an apparatus for correcting an IP address according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes: a monitoring module 40, an acquisition module 42, a correction module 44, wherein,
the monitoring module 40 is used for monitoring click events of the client aiming at the media resources;
an obtaining module 42, configured to obtain a historical exposure IP from a cache of the client when the click event occurs, where the historical exposure IP is a user IP saved when a viewing event of the client is monitored in a historical time;
and the correcting module 44 is configured to correct the click IP of the click event according to the historical exposure IP.
Optionally, the apparatus further comprises: a second monitoring module, configured to monitor a viewing event of the client for the media resource before the first monitoring module obtains a historical exposure IP from a cache of the client; the second acquisition module is used for acquiring the user IP of the client when the watching event occurs; and the processing module is used for determining the user IP as the exposure IP of the viewing event and storing the exposure IP in the cache of the client.
Optionally, the first obtaining module includes: the obtaining unit is used for obtaining an IP address list from the cache of the client; a first judging unit, configured to judge whether a first IP address of a legal IPv4 version exists in the IP address list; a first determining unit, configured to determine, if a valid first IP address of an IPv4 version exists, the first IP address as the historical exposure IP; and if the first IP address of the legal IPv4 version does not exist, determining the second IP address of the legal IPv6 version in the IP address list as the historical exposure IP.
Optionally, the first obtaining module includes: the obtaining unit is used for obtaining an IP address list from the cache of the client; a second judging unit, configured to judge whether a first IP address of a legal IPv6 version exists in the IP address list; a second determining unit, configured to determine, if a valid first IP address of an IPv6 version exists, the first IP address as the historical exposure IP; and if the first IP address of the legal IPv6 version does not exist, determining the second IP address of the legal IPv4 version in the IP address list as the historical exposure IP.
Optionally, the correction module includes: the replacing unit is used for replacing the original IP field of the click IP with the target IP field of the historical exposure IP; the analysis unit is used for analyzing a first IP address type in a click request message of the click event and a second IP address type of the historical exposure IP; and the correcting unit is used for correcting the network protocol of the click IP according to the first IP address type and the second IP address type.
Optionally, the correction unit includes: a first syndrome unit, configured to correct the click IP to IPv4 if the IP address type is IPv4 and the historical exposure IP is IPv4; a second correcting subunit, configured to correct the click IP to IPv6 if the IP address type is IPv4 and the historical exposure IP is IPv6; a third syndrome unit, configured to correct the click IP to IPv4 if the IP address type is IPv6 and the historical exposure IP is IPv4; and the fourth syndrome unit is used for correcting the click IP into IPv6 if the IP address type is IPv6 and the historical exposure IP is IPv6.
Optionally, the apparatus further comprises: the analysis module is used for analyzing the region range of the client according to the click IP after the correction module corrects the click IP of the click event according to the historical exposure IP; and the determining module is used for determining the region range as the region range for clicking the media resource.
Fig. 5 is a block diagram of a structure of a system for correcting an IP address according to an embodiment of the present invention, and as shown in fig. 5, the system includes: the system comprises a media server 50, a monitoring server 52 and a client 54, wherein the media server is connected with the client, is deployed with an exposure monitoring script and a click monitoring script, is used for monitoring click events and exposure events on the client, interacts with the monitoring server and sends user behavior logs to the monitoring server; the monitoring server is connected with the media server and comprises the device described in the above embodiment.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, monitoring a click event of a client aiming at a media resource;
s2, when the click event occurs, obtaining a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the viewing event of the client is monitored in historical time;
and S3, correcting the click IP of the click event according to the historical exposure IP.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, monitoring a click event of a client aiming at a media resource;
s2, when the click event occurs, obtaining a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the viewing event of the client is monitored in historical time;
and S3, correcting the click IP of the click event according to the historical exposure IP.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
Fig. 6 is a block diagram of an electronic device implementing an embodiment of the invention. As shown in fig. 6, the device includes a processor 41 and a memory 42 for storing data, which are connected by a communication bus 44, and a communication interface 43 connected to the communication bus 44 and adapted to connect with other components or external devices.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The 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 according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for correcting an IP address, comprising:
monitoring a click event of a client aiming at a media resource;
when the click event occurs, obtaining a historical exposure IP from a cache of the client, wherein the historical exposure IP is a user IP stored when the viewing event of the client is monitored in historical time;
and replacing the click IP of the click event according to the historical exposure IP.
2. The method of claim 1, wherein prior to retrieving historical exposure IPs from the client's cache, the method further comprises:
monitoring a viewing event of the client for the media asset;
when the watching event occurs, acquiring a user IP of the client;
and determining the user IP as the exposure IP of the viewing event, and storing the exposure IP in a cache of the client.
3. The method of claim 1, wherein obtaining historical exposure IPs from the client's cache comprises:
acquiring an IP address list from a cache of the client;
judging whether a legal first IP address of the IPv4 version exists in the IP address list or not;
if a legal first IP address of the IPv4 version exists, determining the first IP address as the historical exposure IP; and if the first IP address of the legal IPv4 version does not exist, determining the second IP address of the legal IPv6 version in the IP address list as the historical exposure IP.
4. The method of claim 1, wherein obtaining historical exposure IPs from the client's cache comprises:
acquiring an IP address list from a cache of the client;
judging whether a legal first IP address of the IPv6 version exists in the IP address list or not;
if a legal first IP address of the IPv6 version exists, determining the first IP address as the historical exposure IP; and if the first IP address of the legal IPv6 version does not exist, determining the second IP address of the legal IPv4 version in the IP address list as the historical exposure IP.
5. The method of claim 1, wherein replacing the click IP of the click event according to the historical exposure IP comprises:
replacing an original IP field of the clicked IP with a target IP field of the historical exposure IP, wherein both the clicked IP and the historical exposure IP are IP addresses;
analyzing a first IP address type in a click request message of the click event and a second IP address type of the historical exposure IP;
and correcting the network protocol of the click IP according to the first IP address type and the second IP address type.
6. The method of claim 5, wherein correcting the network protocol of the click to IP according to the first IP address type and the second IP address type comprises:
if the first IP address type is IPv4 and the second IP address type is IPv4, correcting the clicked IP to be IPv4;
if the first IP address type is IPv4 and the second IP address type is IPv6, correcting the clicked IP to be IPv6;
if the first IP address type is IPv6 and the second IP address type is IPv4, correcting the clicked IP to be IPv4;
and if the first IP address type is IPv6 and the second IP address type is IPv6, correcting the click IP to be IPv6.
7. The method of claim 1, wherein after replacing the click IP of the click event according to the historical exposure IP, the method further comprises:
analyzing the region range of the client according to the click IP;
and determining the region range as the region range for clicking the media resource.
8. An apparatus for correcting an IP address, comprising:
the first monitoring module is used for monitoring a click event of the client aiming at the media resource;
a first obtaining module, configured to obtain a historical exposure IP from a cache of the client when the click event occurs, where the historical exposure IP is a user IP stored when a viewing event of the client is monitored at a historical time;
and the correction module is used for replacing the click IP of the click event according to the historical exposure IP.
9. A system for correcting an IP address, comprising: a media server, a monitoring server, and a client, wherein,
the media server is connected with the client, is deployed with an exposure monitoring script and a click monitoring script and is used for monitoring click events and exposure events on the client;
the monitoring server, connected to the media server, comprising the apparatus of claim 8.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method steps of any of the preceding claims 1 to 7.
11. An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1 to 7 by executing a program stored on a memory.
CN202010845051.XA 2020-08-20 2020-08-20 Method, device and system for correcting IP address, storage medium and electronic equipment Active CN112019649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010845051.XA CN112019649B (en) 2020-08-20 2020-08-20 Method, device and system for correcting IP address, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010845051.XA CN112019649B (en) 2020-08-20 2020-08-20 Method, device and system for correcting IP address, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112019649A CN112019649A (en) 2020-12-01
CN112019649B true CN112019649B (en) 2023-01-31

Family

ID=73504381

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010845051.XA Active CN112019649B (en) 2020-08-20 2020-08-20 Method, device and system for correcting IP address, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112019649B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468771A (en) * 2014-12-03 2015-03-25 北京国双科技有限公司 Method and device for determining geographical position
CN105653724A (en) * 2016-01-20 2016-06-08 北京京东尚科信息技术有限公司 Page exposure monitoring method and device
CN105869021A (en) * 2016-04-05 2016-08-17 乐视控股(北京)有限公司 Internet advertisement putting method and apparatus
CN106899548A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 A kind of IP address modification method and device
US10559009B1 (en) * 2013-03-15 2020-02-11 Semcasting, Inc. System and method for linking qualified audiences with relevant media advertising through IP media zones

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075908B (en) * 2006-11-08 2011-04-20 腾讯科技(深圳)有限公司 Method and system for accounting network click numbers
KR100857148B1 (en) * 2007-04-26 2008-09-05 엔에이치엔(주) Method for processing invalid click and system for executing the method
CN103514178A (en) * 2012-06-18 2014-01-15 阿里巴巴集团控股有限公司 Searching and sorting method and device based on click rate
CN103577494B (en) * 2012-08-09 2018-02-02 腾讯科技(深圳)有限公司 A kind of light exposure determination method, device and system
US20140342772A1 (en) * 2013-09-12 2014-11-20 Bandwidth.Com, Inc. Predictive Caching of IP Data
CN105978852A (en) * 2016-04-14 2016-09-28 北京北信源软件股份有限公司 Network equipment access history information determination method, equipment and switch

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10559009B1 (en) * 2013-03-15 2020-02-11 Semcasting, Inc. System and method for linking qualified audiences with relevant media advertising through IP media zones
CN104468771A (en) * 2014-12-03 2015-03-25 北京国双科技有限公司 Method and device for determining geographical position
CN106899548A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 A kind of IP address modification method and device
CN105653724A (en) * 2016-01-20 2016-06-08 北京京东尚科信息技术有限公司 Page exposure monitoring method and device
CN105869021A (en) * 2016-04-05 2016-08-17 乐视控股(北京)有限公司 Internet advertisement putting method and apparatus

Also Published As

Publication number Publication date
CN112019649A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
US11960388B2 (en) System and method for data collection and analysis of information relating to mobile applications
CN106997314B (en) Exception handling method, device and system for distributed system
CN109564665B (en) Advertisement monitoring method, device and system
US8761757B2 (en) Identification of communication devices in telecommunication networks
CN108809890B (en) Vulnerability detection method, test server and client
CN109327357B (en) Feature extraction method and device of application software and electronic equipment
CN113010378B (en) Log processing method and device of microservice module, storage medium and electronic device
CN112434039A (en) Data storage method, device, storage medium and electronic device
CN101808018A (en) Method and device for detecting quantity of access terminals
CN110727697A (en) Data processing method and device, storage medium and electronic device
CN107124483A (en) Domain name analytic method and server
CN105553770B (en) Data acquisition control method and device
CN112231209A (en) Parameter acquisition method and device, computer equipment and storage medium
WO2022179353A1 (en) Domain name resolution method and apparatus, and computer device
CN109510729B (en) Implementation method for discovering application topological relation based on CMDB and Netstat
CN112019649B (en) Method, device and system for correcting IP address, storage medium and electronic equipment
CN116192626B (en) Device access method and device, computer readable storage medium and electronic device
CN111026995A (en) Method and device for information association between applications and storage medium
CN113179251B (en) Front-end file processing method, device, equipment and machine-readable storage medium
CN115878443A (en) Interface test script generation method and device, storage medium and electronic device
CN113973111A (en) Data forwarding method and device, gateway equipment and computer readable storage medium
CN109547276B (en) Problem positioning method, terminal and storage medium
CN112671615A (en) Method, system and storage medium for collecting operation behavior data of front-end user
CN102904743A (en) Electronic apparatus and methods for handling multiple device management (dm) server addresses
CN112783451A (en) Time-consuming abnormity analysis method and system based on interceptor and storage medium

Legal Events

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