Summary of the invention
The object of the invention is to overcome shortcoming of the prior art with not enough, a kind of reminding method of mobile phone advertisement flow is provided.
The present invention adopts following technical scheme to realize: a kind of mobile phone advertisement flow reminding method, comprises the steps:
Step 1: the network function of adapter system;
Step 2: analyze IP address, port and link information in the contiguous function from network function;
Step 3: meanwhile, parse Http agreement, network address and link information in the read/write function from network function;
Step 4: according to the link information of associated steps two and three, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain mobile phone advertisement chained address;
Step 5: show this mobile phone advertisement chained address.
And the present invention also provides the suggestion device of a kind of mobile phone advertisement chained address, it comprises
Take over module, the network function of its adapter system;
IP address, port and link information acquisition module, analyze IP address, port and link information in its contiguous function from network function;
Http agreement, network address and link information acquisition module, parse Http agreement, network address and link information in the read/write function from network function;
Relating module, it is according to the link information of IP address, port and link information acquisition module and Http agreement, network address and link information acquisition module, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain mobile phone advertisement chained address; And
Display module, it shows this mobile phone advertisement chained address.
With respect to prior art, mobile phone advertisement provided by the invention chained address reminding method and device thereof are by taking over and analyze network function, obtain mobile phone advertisement chained address, can point out this advertisement link address of user to have risk, to avoid unnecessary loss.
Further, the present invention also provides the acquisition methods of a kind of mobile phone advertisement chained address, comprises the steps:
Step 1: the network function of adapter system;
Step 2: analyze IP address, port and link information in the contiguous function from network function;
Step 3: meanwhile, parse Http agreement, network address and link information in the read/write function from network function;
Step 4: according to the link information of associated steps two and three, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain mobile phone advertisement chained address.
And the acquisition device of a kind of mobile phone advertisement chained address is provided, it comprises
Take over module, the network function of its adapter system;
IP address, port and link information acquisition module, analyze IP address, port and link information in its contiguous function from network function;
Http agreement, network address and link information acquisition module, parse Http agreement, network address and link information in the read/write function from network function; And
Relating module, it is according to the link information of IP address, port and link information acquisition module and Http agreement, network address and link information acquisition module, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain mobile phone advertisement chained address.
With respect to prior art, mobile phone advertisement provided by the invention chained address acquisition methods and device thereof are by network function is taken over and analyzed, to obtain mobile phone advertisement chained address.
In order to understand more clearly the present invention, set forth the specific embodiment of the present invention below with reference to brief description of the drawings.
Embodiment
Embodiment 1
Refer to Fig. 1, it is the flow chart of the preparation method of mobile phone advertisement flow of the present invention.The acquisition methods of this mobile phone advertisement chained address comprises step:
Step S1: the network function of adapter system.
Wherein, obtain the network function of system by Hook Mechanism (Hook).The network function of this system is a set of family of functions.Hook, is a platform of operating system message processing facility, and application program can arrange sub-journey in the above to monitor certain message of specified window, and the window monitoring can be that other processes create.After message arrives, before processing function, target window processes it.Hook Mechanism allows application program to intercept and capture and processes operating system message or particular event.Hook is actually the program segment of a processing messages, by system call, it is hung into system.Whenever specific message is sent, not arriving before object window, hook program is just first caught this message, that is first controlled power of Hook Function.At this moment Hook Function can process this message of processing (change), also can not deal with and continues to transmit this message, can also force the transmission of end.
Taking the Android operating system of mobile phone terminal as example, the realization of the network function method of adapter system of the present invention is described below.
Refer to Fig. 2, it is the system architecture diagram of Android operating system.This Android operating system comprises APPLICATION(application program), APPLICATION FRAMEWORK(application framework), LIBRARIES(storehouse), ANDROID RUNTIME(Android when operation), LINUX KERNEL(Linux kernel program) five layers.
Wherein, at LINUX KERNEL layer, Android provides core system service based on Linux2.6, for example: safety, memory management, management of process, network stack, driving model.Linux Kernel is also as the level of abstraction between hardware and software, and its is hidden particular hardware details and provides unified service for upper strata.At ANDROID RUNTIME layer, the set that Android comprises a core library, provides major part available function in Java programming language core class libraries.Each Android application program is the example in Dalvik virtual machine, operates in themselves process.At LIBRARIES layer, the set that Android comprises a C/C++ storehouse, for each assembly of Android system.These functions are exposed to developer by the application framework (application framework) of Android.At APPLICATION FRAMEWORK layer, by open development platform is provided, Android makes developer can work out extremely abundant and novel application program.And at APPLICATION layer, Android assembles a core application set, comprises email client, SMS program, calendar, map, browser, contact person and other settings.All application programs are all write with Java programming language.
In the network function method of adapter system of the present invention, by replacing the Libc interface of LIBRARIES layer, its network function is taken over, further to obtain the network link information of application program.
Step S2: detect the flow whether advertisement produces.
Particularly, network function comprises contiguous function (connect) and read/write function (read/write).Wherein, read/write function (read/write) includes the data message of the packet that sends and return, and the numerical value of its packet returning is flow.Contiguous function (connect) and read/write function (read/write) include network address or the IP address of request networking, can extract network linking address.Further, be whether detect by following steps be the flow that advertisement produces:
Step S21: analyze IP address, port and link information (socket) in the contiguous function (connect) from network function.
Step S22: meanwhile, parse Http agreement, network address (URL) and link information (socket) in the read/write function (read/write) from network function.
Step S23: according to the link information of associated steps S22 and S23, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain the chained address of all networkings.
Step S24: chained address and an advertisement link address base of all networkings that obtain are compared, if there is the chained address of mating with advertisement link address base, judge that advertisement has produced flow.
Step S3: add up and record the flow being produced by advertisement.In return data bag due to the read/write function (read/write) in network function, record flow value, can directly add up and record the flow value of the packet generation of advertisement link address.
Refer to Fig. 3, it is the module diagram of the statistic device of mobile phone advertisement flow of the present invention.The statistic device of this mobile phone advertisement flow comprises takes over module 1, detection module 2 and statistical module 3.Wherein, this detection module 2 comprises IP address, port and link information acquisition module 21, Http agreement, network address and link information acquisition module 22, relating module 23 and comparing module 24, and an advertisement link address base 25.
The network function of this adapter module 1 adapter system.Particularly, taking the Android operating system of mobile phone terminal as example, this adapter module 1, by replacing the Libc interface of LIBRARIES layer, is taken over its network function, further to obtain the network link information of application program.
This detection module 2 detects the flow whether advertisement produces.
Particularly, in this IP address, port and link information acquisition module 21 contiguous function (connect) from network function, analyze IP address, port and link information (socket).
This Http agreement, network address and link information acquisition module 22 parse Http agreement, network address (URL) and link information (socket) in the read/write function (read/write) from network function simultaneously.
This relating module 23 obtain according to this IP address, port and link information acquisition module 21 and this Http agreement, network address and link information acquisition module 22 link information, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain the chained address of all networkings.
This comparing module 24 is compared chained address and the advertisement link address base 25 of all networkings that obtain, if having the chained address of mating with advertisement link address base 25, judges that advertisement has produced flow.
The flow being produced by advertisement is added up and recorded to this statistical module 3.In return data bag due to the read/write function (read/write) in network function, record flow value, can directly add up and record the flow value of the packet generation of advertisement link address according to the comparison result of comparing module 24.
With respect to prior art, the statistical method of mobile phone advertisement flow provided by the invention and device thereof are by taking over and analyze network function, obtain mobile phone advertisement chained address and add up the flow of its consumption, can point out this advertisement link address of user to have risk, to avoid unnecessary loss.
Embodiment 2
Further, the present invention also provides a kind of reminding method of mobile phone advertisement flow, its be on the basis of the statistical method of above-mentioned mobile phone advertisement flow by obtain information indicating to user.Refer to Fig. 4, it is the flow chart of the reminding method of mobile phone advertisement of the present invention chained address.Specifically comprise the following steps:
Step S1: the network function of adapter system.Particularly, taking the Android operating system of mobile phone terminal as example, this adapter module 11, by replacing the Libc interface of LIBRARIES layer, is taken over its network function, further to obtain the network link information of application program.
Step S2: detect the flow whether advertisement produces.
Particularly, network function comprises contiguous function (connect) and read/write function (read/write).Wherein, read/write function (read/write) includes the data message of the packet that sends and return, and the numerical value of its packet returning is flow.Contiguous function (connect) and read/write function (read/write) include network address or the IP address of request networking, can extract network linking address.Further, be whether detect by following steps be the flow that advertisement produces:
Step S21: analyze IP address, port and link information (socket) in the contiguous function (connect) from network function.
Step S22: meanwhile, parse Http agreement, network address (URL) and link information (socket) in the read/write function (read/write) from network function.
Step S23: according to the link information of associated steps S22 and S23, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain the chained address of all networkings.Step S24: chained address and an advertisement link address base of all networkings that obtain are compared, if there is the chained address of mating with advertisement link address base, judge that advertisement has produced flow.
Step S3: add up and record the flow being produced by advertisement.In return data bag due to the read/write function (read/write) in network function, record flow value, can directly add up and record the flow value of the packet generation of advertisement link address.
Step S4: show this mobile phone advertisement flow, to point out user.
Accordingly, the invention provides a kind of suggestion device of mobile phone advertisement flow.Refer to Fig. 5, it is the module diagram of the suggestion device of mobile phone advertisement flow of the present invention.The statistic device of this mobile phone advertisement flow comprises takes over module 1, detection module 2, statistical module 3 and display module 4.Wherein, this detection module 2 comprises IP address, port and link information acquisition module 21, Http agreement, network address and link information acquisition module 22, relating module 23 and comparing module 24, and an advertisement link address base 25.
The network function of this adapter module 1 adapter system.Particularly, taking the Android operating system of mobile phone terminal as example, this adapter module 1, by replacing the Libc interface of LIBRARIES layer, is taken over its network function, further to obtain the network link information of application program.
This detection module 2 detects the flow whether advertisement produces.
Particularly, in this IP address, port and link information acquisition module 21 contiguous function (connect) from network function, analyze IP address, port and link information (socket).
This Http agreement, network address and link information acquisition module 22 parse Http agreement, network address (URL) and link information (socket) in the read/write function (read/write) from network function simultaneously.
This relating module 23 obtain according to this IP address, port and link information acquisition module 21 and this Http agreement, network address and link information acquisition module 22 link information, by associated with network address to IP address, port and Http agreement go out IP port network address, thereby obtain the chained address of all networkings.
This comparing module 24 is compared chained address and the advertisement link address base 25 of all networkings that obtain, if having the chained address of mating with advertisement link address base 25, judges that advertisement has produced flow.
The flow being produced by advertisement is added up and recorded to this statistical module 3.In return data bag due to the read/write function (read/write) in network function, record flow value, can directly add up and record the flow value of the packet generation of advertisement link address according to the comparison result of comparing module 24.
This display module 4 shows this mobile phone advertisement flow, to point out user.
With respect to prior art, mobile phone advertisement flow reminding method provided by the invention and device thereof are by taking over and analyze network function, obtain mobile phone advertisement chained address and add up the flow of its consumption, can point out this advertisement link address of user to have risk, to avoid unnecessary loss.
The present invention is not limited to above-mentioned execution mode, if various changes of the present invention or distortion are not departed to the spirit and scope of the present invention, if within these changes and distortion belong to claim of the present invention and equivalent technologies scope, the present invention is also intended to comprise these changes and distortion.