CN106484703B - The sending method and device of web data - Google Patents
The sending method and device of web data Download PDFInfo
- Publication number
- CN106484703B CN106484703B CN201510528512.XA CN201510528512A CN106484703B CN 106484703 B CN106484703 B CN 106484703B CN 201510528512 A CN201510528512 A CN 201510528512A CN 106484703 B CN106484703 B CN 106484703B
- Authority
- CN
- China
- Prior art keywords
- target webpage
- data
- cursor pointer
- target
- predeterminable area
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
This application discloses a kind of sending method of web data and devices.Wherein, this method comprises: whether monitoring cursor pointer is located within the predeterminable area of target webpage;When cursor pointer moves out predeterminable area, target data is sent to destination server every preset time, wherein target data is total data of the target webpage from starting to current time.Present application addresses the more technical problems for causing server process data slower of the data for being sent to server in the prior art.
Description
Technical field
This application involves internet areas, in particular to the sending method and device of a kind of web data.
Background technique
For the Webpage and video player of the browser at the end pc (personal computer), it is directed to adopts at present
The data of the user collected are sent in the form of snapshot, are sent to background server, i.e., are sent one at regular intervals
Data, this data can comprising user start click Webpage to close Webpage when all data or from the beginning of
Watch the video data all to the current moment.When backstage carries out data processing, first and the last item are only needed in fact
Data, intermediate many a large amount of redundant datas are sent to background processor, this had both increased the burden of processing server,
A large amount of broadband resource are occupied again, increase great amount of cost.
It improves to obtain a kind of improvement project on the basis of above scheme transmission data volume is big, is only clicking opening
A data is sent when webpage or when video playing starts, and is retransmited at the end of video playing or when user closes Webpage
One data.This improvement project captures the close event of browser, sends the last item data when closing browser.Improvement side
Case saves the time of processing data relative to original scheme, saves memory space, and improvement project is possible in theory, but by
It is many kinds of in browser, to the close event of browser can not 100% capture, close event is captured as power and is only according to statistics
80%, so if will there is nearly 20% closing browser data to send less than server using improvement project, data caused to be adopted
Collection inaccuracy.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the present application provides the sending method and device of a kind of web data, at least to solve to send out in the prior art
It send to the more technical problem for causing server process data slower of data of server.
According to the one aspect of the embodiment of the present application, a kind of sending method of web data is provided, comprising: monitoring cursor
Whether pointer is located within the predeterminable area of target webpage;When cursor pointer moves out the predeterminable area, when default
Between send target data to destination server, wherein the target data is the target webpage from starting to current time
Total data.
Further, the method also includes: when cursor pointer is located in the predeterminable area, control stops to described
Destination server sends target data.
Further, the predeterminable area of the target webpage is determined by the width of target webpage and the height of target webpage,
Wherein, the width of the target webpage is the inner width of the target webpage window, and the height of the target webpage is described
The internal height of target webpage window.
Further, it includes: described in monitoring that whether the monitoring cursor pointer, which is located within the predeterminable area of target webpage,
The mobile trigger event of cursor pointer, wherein the movement is triggered when the cursor pointer moves in the target webpage
Trigger event;In the case where listening to the mobile trigger event, the abscissa of the cursor pointer and the target
The width of webpage, and the height of the ordinate of the cursor pointer and the target webpage, wherein the abscissa and institute
Stating ordinate is the coordinate using the lower left corner of the predeterminable area as origin cursor pointer in the predeterminable area;In the light
Mark pointer abscissa be greater than zero and be less than the target webpage width, and the ordinate of the cursor pointer be greater than zero and
In the case where height less than the target webpage, determine that the cursor pointer is located within the predeterminable area;And institute
The ordinate of the abscissa and the cursor pointer of stating cursor pointer meets at least one of goal condition, determines the cursor
Pointer is located at except the predeterminable area, wherein the goal condition includes that the abscissa is equal to equal to the zero, abscissa
The width of the target webpage, the ordinate are equal to zero and the ordinate is equal to the height of the target webpage.
Further, before described monitor within the predeterminable area whether cursor pointer is located at target webpage, the hair
Delivery method further include: when receiving the first instruction, send the first data to the destination server, wherein described first refers to
It enables and opens the instruction of the target webpage for control or play the instruction of video in the target webpage, first data are institute
State total data of the target webpage when receiving the first instruction.
Further, described after preset time sends target data to destination server, described sender method
Further include: when receiving the second instruction, the second data are sent to the destination server, wherein second instruction is to work as
The instruction of the target webpage is closed using predetermined manner or stops playing the instruction of video in the target webpage, it is described default
Mode indicates that second data are the target network by the close button closing target webpage on the target webpage
Total data of the page when receiving the second instruction.
According to the another aspect of the embodiment of the present application, a kind of sending device of web data is additionally provided, which is characterized in that
It include: monitoring unit, for monitoring whether cursor pointer is located within the predeterminable area of target webpage;First transmission unit is used
In when cursor pointer moves out the predeterminable area, target data is sent to destination server, the mesh every preset time
Marking data is total data of the target webpage from starting to current time.
Further, described device further include: control unit is used for when cursor pointer is located in the predeterminable area,
Control stops sending target data to the destination server.
Further, the monitoring unit includes: monitoring module, for monitoring the mobile triggering thing of the cursor pointer
Part, wherein the mobile trigger event is triggered when the cursor pointer moves in the target webpage;Comparison module is used
In in the case where listening to the mobile trigger event, the width of the abscissa of the cursor pointer and the target webpage
Degree, and the height of the ordinate of the cursor pointer and the target webpage, wherein the abscissa and the ordinate
For the coordinate using the lower left corner of the predeterminable area as origin cursor pointer in the predeterminable area;First determining module is used
It is greater than zero in the abscissa in the cursor pointer and the abscissa is less than the width of the target webpage, and the cursor
In the case that the ordinate of pointer is greater than zero and the height of the target webpage, determine that the belonging positions of the cursor pointer are located at
Within the predeterminable area;And second determining module, for the abscissa and the cursor pointer in the cursor pointer
Ordinate meets at least one of goal condition, determine the belonging positions of the cursor pointer be located at the predeterminable area it
Outside, wherein the goal condition includes that the abscissa is equal to width of the zero, abscissa equal to the target webpage, institute
Ordinate is stated equal to zero and the ordinate is equal to the height of the target webpage.
Further, described device further include: the second transmission unit, for being in monitoring unit monitoring cursor pointer
It is no within the predeterminable area of target webpage before, when receiving the first instruction, send the first data to the target take
Business device, wherein first instruction opens the instruction of the target webpage for the control that the cursor pointer is sent or plays institute
The instruction of video in target webpage is stated, first data are whole numbers of the target webpage when receiving the first instruction
According to.
In the embodiment of the present application, whether it is located within the predeterminable area of target webpage using monitoring cursor pointer;Work as light
When mark pointer moves out predeterminable area, target data is sent to destination server every preset time, wherein target data is mesh
Mark the mode of total data of the webpage from starting to current time.Pass through the position in target webpage of real-time monitoring cursor pointer
It sets, only at the time of the position for monitoring cursor pointer is moved to except predeterminable area, sends target webpage to server
Target data, achieved the purpose that reduce sending target data to server, shortened server process data to realize
The technical effect of time, so solve be sent in the prior art server data it is more cause server process data compared with
Slow technical problem.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen
Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is the flow chart according to the sending method of the web data of the embodiment of the present application;
Fig. 2 is the distribution schematic diagram of predeterminable area in the sending method according to the web data of the embodiment of the present application;And
Fig. 3 is the schematic diagram according to a kind of sending device of web data of the embodiment of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people
Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection
It encloses.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
According to the embodiment of the present application, a kind of embodiment of the method for the sending method of web data is provided, needs to illustrate
It is that step shown in the flowchart of the accompanying drawings can execute in a computer system such as a set of computer executable instructions,
Also, although logical order is shown in flow charts, and it in some cases, can be to be different from sequence execution herein
Shown or described step.
Fig. 1 is according to the flow chart of the sending method of the web data of the embodiment of the present application, as shown in Figure 1, this method packet
Following steps S102 is included to step S104:
Whether step S102, monitoring cursor pointer are located within the predeterminable area of target webpage.It should be noted that default
Region is primarily referred to as the visible area in target webpage namely the region of main presentation web page contents, as shown in symbol 4 in Fig. 2
Region be predeterminable area, user can be by information in predeterminable area access target webpage, and use is shown in predeterminable area
The information of family access.Wherein, target webpage can be the webpage including multimedia player or only include text and picture
Webpage.
Step S104 sends target data to target every preset time and takes when cursor pointer moves out predeterminable area
Business device, target data are total data of the target webpage from starting to current time.
It is moved in target webpage it should be noted that controlling cursor pointer by the hardware device for being connected to terminal device
Dynamic, particular hardware equipment can be connected to terminal device by wired and wireless mode, and hardware device includes mouse, touches
The equipment such as plate, control-rod+key, keyboard.Target data is that target webpage exists from the video opened in moment or target webpage
Until all data at current time, the target data are for characterizing user on target webpage at the time of starting to play
Behavioral data.
The sending method of web data provided by the embodiment of the present application, by real-time monitoring cursor pointer in target network
Position in page is sent only at the time of the position for monitoring cursor pointer is moved to except predeterminable area to server
The target data of target webpage has achieved the purpose that reduce sending target data to server, to realize shortening server
The technical effect of data time is handled, and then is solved and is sent to the data of server in the prior art and more causes at server
Manage the slower technical problem of data.
Before step S102 is monitored within the predeterminable area whether cursor pointer is located at target webpage, the embodiment of the present application
The sending method of web data further include step S1, it is specific as follows shown in:
Step S1 sends the first data to destination server when receiving the first instruction, wherein the first instruction is light
It marks the control that pointer is sent to open the instruction of target webpage or play the instruction of video in target webpage, the first data are target network
Total data of the page when receiving the first instruction.
Specifically, at the time of hardware device control cursor pointer opens target webpage, instruction control target webpage is sent
It opens, which is the first instruction.At the time of target webpage is opened, destination server is sent data to, at this time
Data are the first data, and the first data indicate the primary data of data namely target data of the target webpage at the time of opening,
The transmission of data is completed by the data collector being embedded in browser.
In step S104 after preset time sends target data to destination server, the webpage of the embodiment of the present application
The sending method of data further includes step S2, specific as follows shown:
Step S2 sends the second data to destination server when receiving the second instruction, wherein the second instruction is to work as
Cursor pointer is sent when closing target webpage using predetermined manner instruction or pause play the instruction of video in target webpage, in advance
If mode indicates to close target webpage by the close button on target webpage, wherein the second data are that target webpage is receiving
To total data when the second instruction.
When hardware device control cursor pointer is closed in target webpage, instruction control browser can be sent and carry out related behaviour
Make, which is the second instruction.Multimedia player stopping is broadcast at the time of target webpage is closed or in target webpage
At the time of putting, the last item data are sent to destination server, which is the second data, and the second data indicate
Multimedia player of the target webpage in closing or target webpage is in the data for stopping playing time, that is, target data
End data, wherein stopping playing includes the multimedia for stopping playing, in target webpage in the playing process of video
Device, which plays, to be terminated and closing target webpage causes multimedia player broadcasting to terminate.For browser or for target network
For page, the method for closing browser and target webpage specifically includes that " closing " for clicking the upper right corner, i.e. close button, use
Shortcut key ctr l+E, it shuts down and clicks the browser window on taskbar by right key and click closing window, but for most
For several users, the mode for clicking the upper right corner " closing " can all be selected to close browser or target webpage, the application institute
The mode that the sending method default of the web data of offer closes browser is to click " closing " in the upper right corner, as default side
Formula.
It should be noted that browser acquires user behavior in real time and is formed at the time of receiving the first instruction
Target data, wherein target data is from target webpage, wherein target data is that target clothes are sent in the form of snapshot
It is engaged in device, target data includes total data of the target webpage at current time.
Further, when cursor pointer is located in predeterminable area, control stops sending target data to destination server.
When cursor pointer is located in predeterminable area, indicate that cursor pointer moves in predeterminable area always or cursor pointer is by presetting
It is moved within predeterminable area except region.
If cursor pointer moves in predeterminable area always, it is believed that user does not turn off the target webpage, stops at this time
Target data is sent to destination server.
If cursor pointer except predeterminable area by being moved within predeterminable area, it is believed that user may be to target at this time
Webpage carries out other operations, then user does not turn off target webpage at this time, before being moved to predeterminable area inside, always with
Preset time sends a target data, then correspondingly stopping sending after cursor pointer is moved within predeterminable area
Target data.
Further, whether monitoring cursor pointer is located within the predeterminable area of target webpage, including step S1021 is extremely walked
Rapid S1027, specific as follows shown:
Step S1021 monitors the mobile trigger event of cursor pointer, wherein when cursor pointer moves in target webpage
When trigger mobile trigger event.
It is moved within predeterminable area and is moved to except predeterminable area by Javascript script monitor cursor pointer
The two events determine the position of cursor pointer.It can be triggered when the cursor pointer window movement of target webpage in a browser
Cursor pointer moving event document.onmousemove obtains cursor pointer by the method for binding when triggering the event
Position, can real-time detection to cursor pointer whether leave predeterminable area, and the position in predeterminable area.
Step S1023 compares the abscissa and target webpage of cursor pointer in the case where listening to mobile trigger event
Width, and compare the ordinate of cursor pointer and the height of target webpage, wherein abscissa and ordinate are with predeterminable area
The lower left corner be that origin indicates coordinate of the cursor pointer in predeterminable area.
The coordinate in the target webpage lower left corner is (0,0), coordinate (width of target webpage, the height of target webpage in the upper right corner
Degree), it is that the former heart constructs rectangular coordinate system with the coordinate in the lower left corner, wherein predeterminable area is rectangle, rectangle in rectangular coordinate system
Width is represented by width, is highly represented by height.Such as: width=1000 pixel, height=500 pixel, in advance
If region is exactly the rectangle of 1000 × 500 pixels.By the abscissa of cursor pointer present position and target webpage
Width (may be expressed as: width) is compared, (can by the height of cursor pointer present position ordinate and target webpage
Indicate are as follows: height) be compared, judged by the comparison of coordinate the position of cursor pointer whether be located at predeterminable area it
It is interior.Since user can carry out dragging adjustment, the height and width of target webpage and preset areas to browser window size
Domain also will do it corresponding adjustment variation.
Step S1025 is greater than zero in the abscissa of cursor pointer and abscissa is less than the width of target webpage, and cursor
In the case that the ordinate of pointer is greater than zero and height of the ordinate less than target webpage, the belonging positions position of cursor pointer is determined
Within predeterminable area.
Wherein, the coordinate of cursor pointer can be expressed as (x, y), as abscissa x>0 and x<width, and y>0 and y<
In the case where height, determine that mouse is located within predeterminable area.
Step S1027, the abscissa of cursor pointer and the ordinate of cursor pointer meet in goal condition at least it
One, determine that cursor pointer is located at except predeterminable area, wherein goal condition includes that abscissa is equal to zero, abscissa equal to target
The width of webpage, ordinate is equal to zero and ordinate is equal to the height of target webpage.
When the abscissa of cursor pointer and ordinate meet following any case, it is believed that mouse leaves predeterminable area,
Target data destination server: the abscissa x=0 of cursor pointer present position, cursor is sent every preset time at this time
The abscissa x=width of pointer present position, the ordinate y=0 of cursor pointer present position, cursor pointer are worked as
The ordinate y=height of preceding position.
Further, the predeterminable area of target webpage is determined by the width of target webpage and the height of target webpage, wherein
The width of target webpage is the inner width of target webpage window, and the height of target webpage is that the inside of target webpage window is high
Degree.It should be noted that in the embodiment of the present application, the default of target webpage in browser is obtained by Javascript script
Region mainly obtains the inner width and internal height of target webpage window, wherein target network by Javascript script
Page window is the window of main displayed web page content, to be determined as target according to the region of the width and height composition that get
The predeterminable area of webpage, predeterminable area are also the window of target webpage.
It is obtained for Internet Explorer, Chrome, Firefox, Opera and Safari these types browser
The inner width of browser target webpage is taken mainly to utilize following procedure: window.innerWidth.
The inner width that browser is obtained for browser these types of for Internet Explorer8,7,6,5 is main
Utilize following procedure: document.documentElement.clientWidth.
Or the inner width of browser target webpage: document.body.clientWidth is obtained according to following procedure.
In order to cover all browsers, Javascript script obtains the interior of browser target webpage using following procedure
Portion's width:
Var width=window.innerWidth;
||document.documentElement.clientWidth;
||document.body.clientWidth;
The internal height of target webpage is obtained by following procedure, wherein following procedure indicates to obtain inside target webpage
Three kinds of methods of width:
It is obtained for Internet Explorer, Chrome, Firefox, Opera and Safari these types browser
The inner width of browser target webpage is taken mainly to utilize following procedure: window.innerHeight.
The inner width that browser is obtained for browser these types of for Internet Explorer8,7,6,5 is main
Utilize following procedure: document.documentElement.cl ientHeight.
Or the inner width of browser: document.body.cl ientHeight is obtained using following procedure.
In order to cover all browsers, Javascript script obtains the interior of browser target webpage using following procedure
Portion's height.
Var height=window.innerHeight;
||document.documentElement.clientHeight;
||document.body.clientHeight;
Fig. 2 is the distribution schematic diagram of predeterminable area in the sending method according to the web data of the embodiment of the present application, such as Fig. 2
Shown, location tags region shown in symbol 1, position shown in symbol 2 is menu bar, and position shown in symbol 3 is toolbar,
Position shown in symbol 4 is that position shown in visible area and symbol is status bar.Predeterminable area is primarily referred to as in target webpage
The region of main presentation web page contents, information of the user in predeterminable area access target webpage, predeterminable area are properly termed as again
Visible area, region shown in symbol 4 in predeterminable area Fig. 2, show in Fig. 2 be certain search engine web site homepage.In Fig. 2
" label area ", " menu bar ", " toolbar " and " status bar " is other than predeterminable area shown in symbol 1,2,3 and 5
Region.
The embodiment of the present application also provides a kind of sending device of web data, which is mainly used for executing this Shen
Please web data provided by embodiment above content sending method, the web data of offer is provided to the embodiment of the present application below
Sending device do specific introduction.
Fig. 3 is according to a kind of schematic diagram of the sending device of web data of the embodiment of the present application, as shown in figure 3, the net
The sending device of page data mainly includes monitoring unit 10 and the first transmission unit 20, in which:
Monitoring unit 10, for monitoring whether cursor pointer is located within the predeterminable area of target webpage.It needs to illustrate
It is that predeterminable area is primarily referred to as the visible area in target webpage namely the region of main presentation web page contents, such as above-mentioned Fig. 2
Region shown in middle symbol 4 is predeterminable area, and user can be by information in predeterminable area access target webpage, and in preset areas
The information of user's access is shown in domain.Wherein, target webpage can be the webpage including multimedia player or only include text
The webpage of word and picture.
First transmission unit 20, for sending number of targets every preset time when cursor pointer moves out predeterminable area
According to destination server, target data is total data of the target webpage from starting to current time.
If cursor pointer is moved to except predeterminable area by the region within predeterminable area, it is considered that user may
Target webpage is closed, a target data is just sent to destination server every preset time by the first transmission unit of setting,
Wherein, preset time can be chosen for 1min or 2min, and the specific time chooses preset time as needed.
It is moved in target webpage it should be noted that controlling cursor pointer by the hardware device for being connected to terminal device
Dynamic, particular hardware equipment can be connected to terminal device by wired and wireless mode, and hardware device includes mouse, touches
The equipment such as plate, control-rod+key, keyboard.Target data is that target webpage exists from the video opened in moment or target webpage
Until all data at current time, the target data are for characterizing user on target webpage at the time of starting to play
Behavioral data
The sending device of the embodiment of the present application web data passes through the position in target webpage of real-time monitoring cursor pointer
It sets, only at the time of the position for monitoring cursor pointer is moved to except predeterminable area, sends target webpage to server
Target data, achieved the purpose that reduce sending target data to server, shortened server process data to realize
The technical effect of time, so solve be sent in the prior art server data it is more cause server process data compared with
Slow technical problem.
The application following embodiment is by taking cursor pointer is mouse as an example, according to above-described embodiment provided by the present application, net
The sending device of page data further include: the second transmission unit, in which:
Second transmission unit, for monitoring unit 10 monitor cursor pointer whether be located at target webpage predeterminable area it
Before, when receiving the first instruction, the first data are sent to destination server, wherein the first instruction is what cursor pointer was sent
Control opens the instruction of target webpage or plays the instruction of video in target webpage, and the first data are that target webpage is receiving the
Total data when one instruction.
Specifically, at the time of hardware device control cursor pointer opens target webpage, instruction control target webpage is sent
It opens, which is the first instruction.At the time of target webpage is opened, mesh is sent data to by the second transmission unit
Server is marked, data at this time are the first data, and the first data indicate data namely target of the target webpage at the time of opening
The primary data of data completes the transmission of data by the data collector being embedded in browser.
According to above-described embodiment provided by the present application, the sending device of web data further include: third transmission unit,
In:
Third transmission unit, for determining whether to send target data to destination service according to judging result in determination unit
After device, when receiving the second instruction, the second data are sent to destination server, wherein the second instruction is when using default
Cursor pointer is sent when mode closes target webpage instruction or stopping play the instruction of video in target webpage, predetermined manner table
Show and target webpage is closed by the close button on target webpage, wherein the second data are that target webpage is receiving the second finger
Total data when enabling.
When cursor pointer closes target webpage, instruction control target webpage can be sent and carry out relevant operation, which is
Second instruction, at the time of multimedia player stops playing at the time of target webpage is closed or in target webpage, third
Transmission unit sends the last item data to destination server at this time, and data at this time are the second data, and the second data indicate mesh
Multimedia player of the webpage in closing or target webpage is marked in the data for stopping playing time.
One ground of progress, the sending device of web data include that control unit is used to be located in predeterminable area when cursor pointer
When, control stops sending target data to destination server.When cursor pointer is located in predeterminable area, cursor pointer one is indicated
It is directly moved in predeterminable area or cursor pointer except predeterminable area by being moved within predeterminable area.
Specifically, if in the case where movement in predeterminable area always of cursor pointer, it is believed that user does not turn off clear
It lookes at device, browser is controlled by setting control unit and stops transmission target data at this time to destination server.
If cursor pointer is moved to the region within predeterminable area by the region except predeterminable area, it is believed that user at this time
Other operations may be carried out to target webpage, then user does not turn off target webpage at this time, be moved to predeterminable area it
Before interior, a target data is sent with preset time always, then after cursor pointer is moved within predeterminable area, phase
Ying Di stops sending target data.
Further, monitoring unit 10 includes monitoring module, comparison module, the first determining module and the second determining module,
Wherein:
Monitor the mobile trigger event that module is used to monitor cursor pointer, wherein when cursor pointer moves in target webpage
Mobile trigger event is triggered when dynamic.
It is moved within predeterminable area and is moved to by Javascript script monitor cursor pointer in monitoring module
The two events determine the position of cursor pointer except predeterminable area.The embodiment of the present application is carried out using cursor pointer as mouse
It introduces, mouse moving event can be triggered when the mouse window movement of target webpage in a browser
Document.onmousemove obtains mouse position by the method for binding when triggering the event, can real-time detection arrive
Whether mouse leaves predeterminable area, and the position in predeterminable area.
Comparison module is used in the case where listening to mobile trigger event, compares the abscissa and target network of cursor pointer
The size of the width of page, and compare the size of the ordinate of cursor pointer and the height of target webpage, wherein abscissa and vertical seat
It is designated as indicating coordinate of the cursor pointer in predeterminable area by origin of the lower left corner of predeterminable area.
Target webpage in corresponding browser, the coordinate in the lower left corner are (0,0), the coordinate (width of target webpage in the upper right corner
Degree, the height of target webpage), it is that the former heart constructs rectangular coordinate system with the coordinate in the lower left corner, wherein predeterminable area is in rectangular co-ordinate
It is rectangle in system, rectangle width is represented by width, is highly represented by height.Such as: width=1000 pixel,
Height=500 pixel, predeterminable area are exactly the rectangle of 1000 Χ, 500 pixel.Cursor pointer is worked as in comparison module
The abscissa of preceding position and the width (may be expressed as: width) of target webpage are compared, and cursor pointer is currently located
The height (may be expressed as: height) of position ordinate and target webpage is compared, and judges cursor by the comparison of coordinate
Whether the position of pointer is located within predeterminable area.Since user can carry out dragging adjustment, mesh to browser window size
The height and width and predeterminable area of mark webpage also will do it corresponding adjustment variation.
First determining module is used to be greater than zero in the abscissa of cursor pointer and abscissa is less than the width of target webpage, and
And in the case that the ordinate of cursor pointer is greater than zero and height of the ordinate less than target webpage, the affiliated of cursor pointer is determined
Position is located within region.
Wherein, the coordinate of cursor pointer can be expressed as (x, y), as abscissa x>0 and x<width, and y>0 and y<
In the case where height, determine that mouse is located within predeterminable area by the first determining module.
Second determining module is used to meet in the abscissa of cursor pointer and the ordinate of cursor pointer following any
In the case of, determine that the belonging positions of cursor pointer are located at except predeterminable area: abscissa is equal to zero, abscissa and is equal to target webpage
Width, ordinate be equal to zero and ordinate be equal to target webpage height.
When the abscissa of cursor pointer and ordinate meet following any case, it is believed that mouse leaves predeterminable area,
Target data destination server: the abscissa x=0 of cursor pointer present position, cursor is sent every preset time at this time
The abscissa x=width of pointer present position, the ordinate y=0 of cursor pointer present position, cursor pointer are worked as
The ordinate y=height of preceding position, in the case that the second determining module determines that mouse leaves predeterminable area, at this time
Target data destination server is sent every preset time.
Further, the predeterminable area of target webpage is determined by the width of target webpage and the height of target webpage, wherein
The width of target webpage is the inner width of target webpage window, and the height of target webpage is that the inside of target webpage window is high
Degree.The sending device of web data provided by the embodiment of the present application obtains predeterminable area by Javascript script, passes through
Setting first obtains module, and the size of the width of browser target webpage is obtained using following procedure.
Var width=window.innerWidth;
||document.documentElement.clientWidth;
||document.body.clientWidth;
Module is obtained by setting first, the size of the height of browser target webpage is obtained using following procedure.
Var height=window.innerHeight;
||document.documentElement.clientHeight;
||document.body.clientHeight;
By the analysis to above-mentioned steps, the sending method and device of web data provided by the present application not only reduce hair
The data volume sent, while also assuring the transmission success rate of data.
The sending method of web data provided by the present application at the time of target webpage is opened or in target webpage open by video
It is not to send data to destination server always, but pass through the affiliated position for judging cursor pointer at the time of beginning to play
It sets to determine whether to send data to destination server, therefore, reduces the traffic volume of data, while also saving many bandwidth
Resource accelerates the processing speed of mesh server.
Destination server is when carrying out the processing of data, the first data (i.e. the first data) and the last item data are (i.e.
Second data) have critical effect, so accurately obtain and send the last item data be the key that guarantee the quality of data because
Element.The sending method of web data provided by the present application, in the case where accurately the second data cannot be obtained, can get with
The immediate data of second data are sent to destination server, this ensure that the quality of data.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
In above-described embodiment of the application, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module
It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the application whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above is only the preferred embodiment of the application, it is noted that for the ordinary skill people of the art
For member, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications are also answered
It is considered as the protection scope of the application.
Claims (8)
1. a kind of sending method of web data characterized by comprising
Whether monitoring cursor pointer is located within the predeterminable area of target webpage;
When cursor pointer moves out the predeterminable area, target data is sent to destination server every preset time, wherein
The target data is total data of the target webpage from starting to current time,
Before described monitor within the predeterminable area whether cursor pointer is located at target webpage, described sender method further include:
When receiving the first instruction, the first data are sent to the destination server, wherein first instruction opens institute for control
It states the instruction of target webpage or plays the instruction of video in the target webpage, first data are that the target webpage is connecing
Receive total data when the first instruction.
2. sending method according to claim 1, which is characterized in that the method also includes: when cursor pointer is located at institute
When stating in predeterminable area, control stops sending target data to the destination server.
3. sending method according to claim 1, which is characterized in that the predeterminable area of the target webpage is by target webpage
Width and target webpage height determine, wherein the width of the target webpage be the target webpage window inside it is wide
Degree, the height of the target webpage are the internal height of the target webpage window.
4. sending method according to claim 3, which is characterized in that whether the monitoring cursor pointer is located at target webpage
Predeterminable area within include:
Monitor the mobile trigger event of the cursor pointer, wherein when the cursor pointer moves in the target webpage
Trigger the mobile trigger event;
In the case where listening to the mobile trigger event, the abscissa of the cursor pointer and the target webpage
Width, and the height of the ordinate of the cursor pointer and the target webpage, wherein the abscissa and the vertical seat
It is designated as the coordinate using the lower left corner of the predeterminable area as origin cursor pointer in the predeterminable area;
It is greater than zero in the abscissa of the cursor pointer and is less than the width of the target webpage, and the cursor pointer is vertical
Coordinate be greater than zero and be less than the target webpage height in the case where, determine the cursor pointer be located at the predeterminable area it
It is interior;And
Meet at least one of goal condition in the abscissa of the cursor pointer and the ordinate of the cursor pointer, determines
The cursor pointer is located at except the predeterminable area, wherein the goal condition includes that the abscissa is equal to zero, the cross
Coordinate is equal to the width of the target webpage, the ordinate equal to zero and the ordinate is equal to the height of the target webpage
Degree.
5. sending method according to claim 1, which is characterized in that send target data extremely every preset time described
After destination server, described sender method further include:
When receiving the second instruction, the second data are sent to the destination server, wherein second instruction uses to work as
Predetermined manner closes the instruction of the target webpage or stops playing the instruction of video in the target webpage, the predetermined manner
It indicates to close the target webpage by the close button on the target webpage, second data are that the target webpage exists
Receive total data when the second instruction.
6. a kind of sending device of web data characterized by comprising
Monitoring unit, for monitoring whether cursor pointer is located within the predeterminable area of target webpage;
First transmission unit, for sending target data every preset time when cursor pointer moves out the predeterminable area
To destination server, the target data is total data of the target webpage from starting to current time,
Described device further include: the second transmission unit, for whether being located at target network in monitoring unit monitoring cursor pointer
Before within the predeterminable area of page, when receiving the first instruction, the first data are sent to the destination server, wherein institute
Stating the first instruction is that the control that the cursor pointer is sent is opened the instruction of the target webpage or played in the target webpage
The instruction of video, first data are total data of the target webpage when receiving the first instruction.
7. sending device according to claim 6, which is characterized in that described device further include: control unit, for working as light
When mark pointer is located in the predeterminable area, control stops sending target data to the destination server.
8. sending device according to claim 6, which is characterized in that the monitoring unit includes:
Module is monitored, for monitoring the mobile trigger event of the cursor pointer, wherein when the cursor pointer is in the target
The mobile trigger event is triggered when moving in webpage;
Comparison module, in the case where listening to the mobile trigger event, the abscissa of the cursor pointer with
The width of the target webpage, and the height of the ordinate of the cursor pointer and the target webpage, wherein the cross
Coordinate and the ordinate are the coordinate using the lower left corner of the predeterminable area as origin cursor pointer in the predeterminable area;
First determining module is greater than zero for the abscissa in the cursor pointer and the abscissa is less than the target webpage
Width, and the ordinate of the cursor pointer be greater than zero and the height of the target webpage in the case where, determine the light
The belonging positions of mark pointer are located within the predeterminable area;And
Second determining module, for meeting goal condition in the abscissa of the cursor pointer and the ordinate of the cursor pointer
At least one of, determine that the belonging positions of the cursor pointer are located at except the predeterminable area, wherein the goal condition
It is equal to zero and described equal to the width of the target webpage, the ordinate to be equal to the zero, abscissa including the abscissa
Ordinate is equal to the height of the target webpage.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510528512.XA CN106484703B (en) | 2015-08-25 | 2015-08-25 | The sending method and device of web data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510528512.XA CN106484703B (en) | 2015-08-25 | 2015-08-25 | The sending method and device of web data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106484703A CN106484703A (en) | 2017-03-08 |
CN106484703B true CN106484703B (en) | 2019-09-20 |
Family
ID=58233394
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510528512.XA Active CN106484703B (en) | 2015-08-25 | 2015-08-25 | The sending method and device of web data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106484703B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108900563B (en) * | 2018-03-30 | 2021-05-18 | 世纪龙信息网络有限责任公司 | Data transmission method and device, computer equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101159739A (en) * | 2007-09-19 | 2008-04-09 | 腾讯科技(深圳)有限公司 | Subtitling display process and communication system and related equipment |
CN102316298A (en) * | 2010-09-17 | 2012-01-11 | 苏州阔地网络科技有限公司 | Method for realizing audio and video recording |
CN102325273A (en) * | 2011-09-14 | 2012-01-18 | 深圳Tcl新技术有限公司 | Video terminal and display method of screen menu type page data of same |
CN103455549A (en) * | 2013-07-26 | 2013-12-18 | 苏州亿倍信息技术有限公司 | Method and system for data processing |
CN103530314A (en) * | 2013-07-26 | 2014-01-22 | 苏州亿倍信息技术有限公司 | Data processing method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201128420A (en) * | 2010-02-12 | 2011-08-16 | Kuo-Ching Chiang | Visual image searching method |
-
2015
- 2015-08-25 CN CN201510528512.XA patent/CN106484703B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101159739A (en) * | 2007-09-19 | 2008-04-09 | 腾讯科技(深圳)有限公司 | Subtitling display process and communication system and related equipment |
CN102316298A (en) * | 2010-09-17 | 2012-01-11 | 苏州阔地网络科技有限公司 | Method for realizing audio and video recording |
CN102325273A (en) * | 2011-09-14 | 2012-01-18 | 深圳Tcl新技术有限公司 | Video terminal and display method of screen menu type page data of same |
CN103455549A (en) * | 2013-07-26 | 2013-12-18 | 苏州亿倍信息技术有限公司 | Method and system for data processing |
CN103530314A (en) * | 2013-07-26 | 2014-01-22 | 苏州亿倍信息技术有限公司 | Data processing method and system |
Also Published As
Publication number | Publication date |
---|---|
CN106484703A (en) | 2017-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2847688B1 (en) | A method and system for monitoring and tracking browsing activity on handheld devices | |
CN102819416B (en) | A kind of realize the method and apparatus that component content shows | |
CN104391636B (en) | A kind of screenshotss method and device | |
CN109358795A (en) | Browsing method and device, the electronic equipment of interface information | |
CN103955495B (en) | The method for down loading and device of page child resource | |
CN106844635A (en) | The edit methods and device of the element in webpage | |
CN104899306B (en) | Information processing method, information display method and device | |
CN108197125A (en) | Webpage capture method and device | |
CN104281677A (en) | Page displaying method and device | |
CN105302461B (en) | A kind of method and apparatus for the offer target pages in mobile application | |
WO2014032589A1 (en) | Window switching method and apparatus | |
CN103376977A (en) | Display method and display device for browser | |
CN112764871B (en) | Data processing method, data processing device, computer equipment and readable storage medium | |
CN101937461A (en) | Page turning operation-based method and equipment for optimizing web browsing | |
US20150121301A1 (en) | Information processing method and electronic device | |
CN110489312A (en) | Data correlation method and device for control trigger data acquisition | |
CN103543996A (en) | Browser window management method and device | |
CN112394861A (en) | Page jump method and device, storage medium and electronic device | |
CN104881273A (en) | Webpage rendering analysis method and terminal device | |
CN103365542A (en) | User click behavior showing method and system | |
CN111400575A (en) | User identification generation method, user identification method and device | |
CN106484703B (en) | The sending method and device of web data | |
US20140372936A1 (en) | Method and apparatus for displaying tag data | |
CN104615356A (en) | Page operating method and device | |
WO2016058460A1 (en) | Browse switching processing method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |