A kind of user behavior trace playback methodTechnical field
The present invention relates to a kind of user behavior trace playback method.
Background technology
Telecommunications industry generally adopts the WEB system of B/S structure at present, the application of service (server) end administration, and by browser (browser) access system, the webpage of front end man-machine interaction is mainly used the JavaScript script technology.JavaScript has brought powerful dynamic effect to webpage, and communication modes flexibly.Can utilize JavaScript to process the primary monitoring of mouse and KeyEvent, realize record, playback and analysis to user of service's sequence of operations behavior.
At present in the operation system of telecommunications industry, operating personnel are day by day strong to the controllability requirement of system to ease for use requirement and the supvr of system, the form of the passive reception suggestion of formula is obtained the method poor effect of the easy-to-use performance of system by inquiry, the solution that can not reproduce the formula Problem-Error to some is also relatively lost time, and has had a strong impact on maintainability and the ease for use upgrading of system.
Javascript is a kind of case sensitive client script language of OO regime type of the prototype succession developed by the LiveScript of Netscape, fundamental purpose is for the settlement server end instruction, such as Perl, the speed issue of leaving over, for the client provides more smooth result of browse.Service end need to be verified data at that time, because network speed is quite slow, only had 28.8kbps, and the time of verification step waste is too many.So the browser Navigator of Netscape has added Javascript, and the basic function of data verification is provided.
Summary of the invention
Technical matters to be solved by this invention is, for the deficiencies in the prior art, provide a kind of can Realization analysis and the playback operation personnel in the operation trace of special time, be convenient to the user behavior trace playback method of analyzing and observing.
The technical scheme that the present invention solves the problems of the technologies described above is as follows: a kind of user behavior trace playback method specifically comprises the following steps:
Step 1: at function pages, load the Javascript script;
Step 2: function pages receives user's operation, judges that whether active user's operation needs record, if so, carry out step 3; Otherwise, finish;
Step 3: be written into function pages, whether judgement needs record at the user behavior trace information of function pages, if so, carry out step 4; Otherwise, finish;
Step 4:Javascript script is monitored the operation of mouse and keyboard, records the positional information that mouse and keyboard are clicked, and according to predefined data memory format, the positional information of click is recorded on function pages;
Step 5: when function pages is closed, be stored in cache database being recorded in the positional information of clicking on function pages;
Step 6: resolve the data in cache database, obtain the set of positional information of all clicks of function pages operation, realize playback, and the user behavior statistics is analyzed.
The invention has the beneficial effects as follows: user behavior trace playback method of the present invention can record operation that operating personnel make at operation interface and detailed operation steps, and be stored in cache database, when needs playback and analysis, the data of special time are recalled, can the playback operation personnel in the operation trace of this time period, be convenient to analyze and observe; By replaying user behavior track, be convenient to the friendly of analytic system interface, instruct and optimize interface, further promote the user and experience; By washability user behavior trace playback, be convenient to fault recurrence and analysis.
On the basis of technique scheme, the present invention can also do following improvement.
Further, described click location information comprises the data such as coordinate figure, triggered time, operator's code, page code.
Further, described step 4 specifically comprises following two steps:
Step 4.1:Javascript script is monitored the operation of mouse and keyboard, recording user corresponding operation while triggering mouse and KeyEvent;
Step 4.2: record X coordinate and the Y coordinate of mouse and keyboard click location, and according to predefined data memory format by the click location information recording on the page.
Further, in described step 4.2 according to predefined data memory format by the page cache technology by the click location information recording on function pages.
Further, described 6 specifically comprise the following steps:
Step 6.1: resolve the data in cache database, obtain the set that function pages operates all coordinate figures, and show usually display operation track of unit according to sequence of positions and the triggered time dynamic creation page in set, realize playback function;
Step 6.2: resolve data in cache database, obtain the data such as page events triggered time, operator's code, page code, coordinate figure is carried out to statistical study according to information such as triggered time, operator's code, page code, realize the user behavior statistical study.
Further, the statistical study in described step 6.2, can realize the various combination statistical study information according to time period, operator's code or page code.
The accompanying drawing explanation
Fig. 1 is the described a kind of user behavior trace playback method flow diagram of the specific embodiment of the invention 1.
Embodiment
Below in conjunction with accompanying drawing, principle of the present invention and feature are described, example, only for explaining the present invention, is not intended to limit scope of the present invention.
As shown in Figure 1, a kind of described user behavior trace playback method of the specific embodiment of the invention 1 specifically comprises the following steps:
Step 1: at function pages, load the Javascript script;
Step 2: function pages receives user's operation, judges that whether active user's operation needs record, if so, carry out step 3; Otherwise, finish;
Step 3: be written into function pages, whether judgement needs record at the user behavior trace information of function pages, if so, carry out step 4; Otherwise, finish;
Step 4:Javascript script is monitored the operation of mouse and keyboard, recording user corresponding operation while triggering mouse and KeyEvent;
Step 5: record X coordinate and the Y coordinate of mouse and keyboard click location, and according to predefined data memory format by the click location information recording on the page;
Step 6: when function pages is closed, be stored in cache database being recorded in the positional information of clicking on function pages;
Step 7: resolve the data in cache database, obtain the set that function pages operates all coordinate figures, and show usually display operation track of unit according to sequence of positions and the triggered time dynamic creation page in set, realize playback function;
Step 8: resolve data in cache database, obtain the data such as page events triggered time, operator's code, page code, coordinate figure is carried out to statistical study according to information such as triggered time, operator's code, page code, realize the user behavior statistical study.
Described click location information comprises the data such as coordinate figure, triggered time, operator's code, page code.
In described step 5 according to predefined data memory format by the page cache technology by the click location information recording on function pages.
Statistical study in described step 8, can realize the various combination statistical study information according to time period, operator's code or page code.
In the exploitation of Shanxi Mobile NG-BOSS system, use the user behavior that the method occurs in the business operation page for operating personnel to propose technical scheme.Foreground is by the clicking operation based on the primary action listener function of browser end JavaScript record, playback analysis operation personnel.Details is as follows:
1. use JavaScript to carry out page mouse, keyboard monitoring, when triggering mouse and KeyEvent, corresponding operation is carried out to record;
2. use JavaScript to record mouse or the keyboard click location is X coordinate and Y coordinate, and data memory format according to the rules by the page cache technical notes on the page;
3. when the page close event is triggered, the data such as coordinate figure, triggered time, operator's code, page code that are cached to all click location in the page are stored in cache database;
4. use JavaScript to resolve the data of form storage according to the rules, obtain all set of coordinate values of page events, and show usually display operation track of unit according to the sequence of positions dynamic creation page in set, realize playback function;
5. use JavaScript to resolve the data of prescribed form storage, obtain the data such as page events triggered time, operator's code, page code, carry out the user behavior statistical study.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.