Operate replay method and device
Technical field
The embodiment of the present invention belongs to field of computer technology more particularly to a kind of operation replay method and device.
Background technique
When user tests intelligent terminal (such as mobile phone), intelligent terminal needs to record the operation of user, and repeats
The operation of recording.
In existing operation recording and replay method, after obtaining action event, to each event, (each operation may
It is made of multiple events) primary equipment file is all opened, then data are written in open device file, due to every time in equipment
It requires to open primary equipment file when file write data, so that the overlong time of the data of one group of operation of write-in, into
And the event sent is postponed, so as to cause operation deformation, for example, short-press operation is made to be deformed into long press operation, it is double
It hits operation and is deformed into multiple click.
Summary of the invention
The embodiment of the invention provides a kind of operation replay method and devices, it is intended to solve in existing method, set every time
It requires to open primary equipment file when standby file write data, so that the overlong time of the data of one group of operation of write-in,
So that the event sent postpones, the problem of deformation so as to cause operation.
The embodiments of the present invention are implemented as follows, a kind of operation replay method, which comprises
Primary event information is obtained, the primary event information includes the time that event occurs;
Event is grouped according to the time that event occurs;
By the corresponding specified event information of the event after grouping according to time sequencing according to the time interval of each group and each event
The device file opened is written, and executes the device file to reappear the operation of recording.
The another object of the embodiment of the present invention is to provide a kind of operation reproducer, and described device includes:
Primary event information acquisition unit, for obtaining primary event information, the primary event information includes event hair
The raw time;
Event packets unit, the time for being occurred according to event are grouped event;
Reproducing unit is operated, for the corresponding event information of event after being grouped according to time sequencing according to each group and each thing
The device file that the time interval write-in of part is opened, and the device file is executed to reappear the operation of recording.
In embodiments of the present invention, since the time occurred according to event is grouped event, so that being divided into one group
Event be the corresponding event of same operation, and the event information being grouped just is written when opening primary equipment file, therefore,
Without repeatedly opening device file when a corresponding event of operation is written, so that the time is saved, so that described in executing
The operation that recording can be reappeared when device file, without making the operation reappeared deform.
Detailed description of the invention
Fig. 1 is a kind of flow chart for operation replay method that first embodiment of the invention provides;
Fig. 2 is a kind of structure chart for operation reproducer that second embodiment of the invention provides.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In the embodiment of the present invention, primary event information is obtained, the primary event information includes the time that event occurs, root
According to event occur time event is grouped, by the corresponding specified event information of the event after grouping according to time sequencing according to
The device file that the write-in of the time interval of each group and each event is opened, and the device file is executed to reappear the operation of recording.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one:
Fig. 1 shows a kind of flow chart of operation replay method of first embodiment of the invention offer, and details are as follows:
Step S11, obtains primary event information, and the primary event information includes the time that event occurs.
In the step, primary event information, the corresponding primary event information of the operation recorded, the primary event are obtained
Information includes the time that event occurs.
Wherein, the step S11 is specifically included:
A1, the corresponding primary event information of at least two operations is obtained.Wherein, at least two operation is corresponding initial
Event information includes: the value and corresponding description information of the title of event, the time of event generation, event type, event.Its
In, a variety of (at least two) are obtained by the getevent that the system of intelligent terminal provides and operate corresponding primary event information.
Here " corresponding description information " refer to " time that event occurs, event type, event value " corresponding description information.Example
Such as, the description information for the time that event occurs is " time ", and the description information of event type is " type " etc..
Alternatively,
A2, a kind of corresponding primary event information of operation is obtained.Wherein, the corresponding primary event information of a kind of operation
Include: event occur time, event type, event value.It should be pointed out that same operate corresponding primary event letter
Breath may be the primary event information of an event, it is also possible to be the primary event information of multiple events.
Optionally, after obtaining primary event information, comprising:
The primary event information of acquisition is handled.For example, deleting the corresponding initial thing of at least two operations obtained
The title of event in part information, to obtain the corresponding specified event information of event;Alternatively, the Time And Event that event is occurred
The corresponding description information of type increases to a kind of corresponding primary event information of operation of acquisition, corresponding specified to obtain event
Event information.Wherein, the corresponding specified event information of the event include: event occur time, event type, event value
And the event information of corresponding description information.
Wherein, in addition to event occur time, event type, event value and corresponding description information, the event
Corresponding specified event information may also include that corresponding code of facility information, event etc..The primary event information of acquisition is carried out
Processing is the corresponding information for deleting or increasing primary event information, so that treated, event information is eligible.
Optionally, after issuing due to an operation by key or screen, other devices in intelligent terminal are also triggered
Response, and user is usually concerned only with the corresponding event information of the action types such as key or screen, therefore, in order to obtain more accurately
Operation reappears, and the primary event information of described pair of acquisition, which is handled, to include:
It deletes non-key or non-screen operates corresponding event information.
Step S12 is grouped event according to the time that event occurs.
Optionally, due to the call format of the format of the event information of acquisition and the event information of subsequent write device file
Difference, therefore, in order to the smooth write device file of event information that will acquire, before the step S12, comprising:
The Data Format Transform in primary event information that will acquire is specified format.Wherein, specified format refers to
It is capable of the corresponding format of event information of write device file.
Optionally, the step S12 is specifically included:
B1, according to event occur time calculate adjacent events between time interval.Specifically, by two adjacent events
The time that corresponding event occurs subtracts each other, and obtained absolute value is the time interval between two adjacent events.
When B2, the time interval between current event and a upper event are less than specified time interval, work as by described in
Preceding event is divided into including big group where a upper event.Wherein, specified time interval may be set to 100ms (milli
Second).For example, it is assumed that current event is event A, a upper event of event A is event B, and event B is divided into X group, if event
The time interval of A and event B are less than specified time interval, then event A are also divided into X group.
It, will when B3, the time interval between current event and a upper event are greater than or equal to specified time interval
It does not include big group of a upper event that the current event, which is divided into,.For example, it is assumed that current event is event A, event A's
A upper event is event B, and event B is divided into X group, if the time interval of event A and event B are greater than or equal to specified
Between be spaced, then event A is divided into non-X group, such as be divided into Y group.
Further, in order to avoid the volume of event for being divided into same group is excessive, the B2 is specifically included:
When B21, the time interval between current event and a upper event are less than specified time interval, described in judgement
Whether the volume of event organized greatly is less than specified maximum volume of event.Here volume of event refers to the event number for including in a group.
B22, when big group of the volume of event is less than specified maximum volume of event, then be divided at least two for described big group
A group, so that the volume of event of each group is less than maximum volume of event.
Certainly, when needing to be divided at least two groups for big group, the volume of event of the group after dividing can be made average,
To avoid going wrong.For example, it is assumed that maximum volume of event is 30, need to divide 70 events, then in order to enable dividing
The volume of event of group afterwards is average, then the volume of event of the group after dividing can be divided into 25,25 without separating into 30,30,10,
20, to avoid maximum volume of event is too close to and the problem.
Step S13, by the corresponding specified event information of the event after grouping according to time sequencing according to each group and each event
The device file that time interval write-in is opened, and the device file is executed to reappear the operation of recording.
In the step, the device file of every group of event is read and opened by customized sendevent, and set in opening
Same group of event is continuously written into when standby file in order, is favorably accomplished to operate to link up, prevents operation from becoming
Shape.
Optionally, the step S13 is specifically included:
The device file that C1, the event for organizing difference greatly are opened according to the time interval write-in between preset group, and execute
The device file is to reappear the operation of recording.Wherein, the time interval between preset group can be fixed time interval, can also
For two adjacent groups time interval be added with delay time lag after obtained time interval.The time interval of the two adjacent groups is
Refer to the time that the event of the last one event for the time and a upper group that the event for first event currently organized occurs occurs
Absolute value of the difference, delay time lag can be arranged according to the actual situation, for example, being set as 500ms etc..Due in different big groups
Event be usually the corresponding event of different operation, therefore, by the events organized greatly of difference according to the time interval between preset group
The device file that write-in is opened can better discriminate between two groups of event, and the operation reappeared is avoided to obscure.
C2, the equipment text for opening groups different in same big group according to the time interval write-in of the adjacent event of each group
Part, and the device file is executed to reappear the operation of recording.
Certainly, it if operation has N number of, needs to repeat step S12 and step S13, executed until N group event is whole, N
More than or equal to 2.
Optionally, in order to the operation of reproduction carry out pressure test, can preset loop number, circulation execute step S12 and
Step S13 judges whether the operation for executing step S12 and step S13 reproduction every time is identical, if they are the same, then determines this operation
It retests and passes through.
In first embodiment of the invention, primary event information is obtained, event is grouped according to the time that event occurs,
The corresponding specified event information of event after grouping is written according to time sequencing according to the time interval of each group and each event and is opened
Device file, and execute the device file to reappear the operation of recording.Due to time for being occurred according to event to event into
Row grouping, as soon as so that the event being divided into group is the corresponding event of same operation, and be written when opening primary equipment file
The event information being grouped, therefore, without repeatedly opening device file when a corresponding event of operation is written, to save
Time, so that the operation of recording can be reappeared when executing the device file, without becoming the operation reappeared
Shape.
It should be understood that in embodiments of the present invention, magnitude of the sequence numbers of the above procedures are not meant to the elder generation of execution sequence
Afterwards, the execution sequence of each process should be determined by its function and internal logic, the implementation process structure without coping with the embodiment of the present invention
At any restriction.
Embodiment two:
Fig. 2 shows a kind of structure chart for operation reproducer that second embodiment of the invention provides, which reappears dress
Setting can be used in an intelligent terminal, which may include being led to through wireless access network RAN and one or more core nets
The user equipment of letter, the user equipment can be mobile phone (or being " honeycomb " phone), the computer with mobile device
Deng, for example, user equipment can also be portable, pocket, hand-held, built-in computer or vehicle-mounted mobile device,
They exchange voice and/or data with wireless access network.In another example the mobile device may include smart phone, tablet computer,
Personal digital assistant PDA, point-of-sale terminal POS or vehicle-mounted computer etc..For ease of description, it illustrates only and phase of the embodiment of the present invention
The part of pass.
The operation reproducer includes: primary event information acquisition unit 21, event packets unit 22, operation reproducing unit
23.Wherein:
Primary event information acquisition unit 21, for obtaining primary event information, the primary event information includes event
The time of generation.
Wherein, the primary event information acquisition unit 21 includes:
Multioperation data obtaining module, for obtaining the corresponding primary event information of at least two operations.Wherein, it is described extremely
Few two kinds operate the value that corresponding primary event information includes: the title of event, the time of event generation, event type, event
And corresponding description information.
Part operation data obtaining module, for obtaining a kind of corresponding primary event information of operation.Wherein, described one kind
Operate the value of time, event type, event that corresponding primary event information includes: event generation.It should be pointed out that same
Kind operates the primary event information that corresponding primary event information may be an event, it is also possible to be the initial thing of multiple events
Part information.
Optionally, which includes:
Primary event information process unit, for deleting in the corresponding primary event information of obtain at least two operations
The title of event, to obtain the corresponding specified event information of event;Alternatively, the Time And Event type pair for event to occur
The description information answered increases to a kind of corresponding primary event information of operation of acquisition, to obtain the corresponding specified event letter of event
Breath.
Wherein, the corresponding specified event information of the event include: event occur time, event type, event value
And the event information of corresponding description information.
Optionally, after issuing due to an operation by key or screen, other devices in intelligent terminal are also triggered
Response, and user is usually concerned only with the corresponding event information of the action types such as key or screen, therefore, in order to obtain more accurately
Operation reappears, and the operation reproducer can also include:
Event information filter element operates corresponding event information for deleting non-key or non-screen.
Event packets unit 22, the time, event type and the corresponding value of event for being occurred according to event are to difference
Event be grouped.
Optionally, due to the call format of the format of the event information of acquisition and the event information of subsequent write device file
Difference, therefore, in order to the smooth write device file of event information that will acquire, the operation reproducer can also be wrapped
It includes:
Uniform format unit, the Data Format Transform in primary event information for will acquire are specified format.Its
In, specified format is the corresponding format of event information for referring to write device file.
Wherein, the event packets unit 22 includes:
The time interval computing module of event, the time for being occurred according to event calculated between the time between adjacent events
Every.Specifically, the time that the corresponding event of two adjacent events occurs is subtracted each other, obtained absolute value be two different events it
Between time interval.
Same group of event division module is less than specified for the time interval between current event and a upper event
When time interval, the current event is divided into including big group where a upper event.Wherein, between the specified time
Every may be set to 100ms (millisecond).
Different groups of event division modules are greater than or equal to for the time interval between current event and a upper event
When specified time interval, it does not include big group of a upper event that the current event, which is divided into,.
Further, in order to avoid the volume of event for being divided into same group is excessive, the same group of event division module includes:
Volume of event comparison module, for judging whether big group of the volume of event is less than specified maximum volume of event.Here
Volume of event refer to the event number for including in a group.
Event division module, for when big group of the volume of event is greater than specified maximum volume of event, then will it is described greatly
Group is divided at least two groups, so that the volume of event of each group is less than maximum volume of event.
Operate reproducing unit 23, for the corresponding event information of event after be grouped according to time sequencing according to each group and respectively
The device file that the time interval write-in of event is opened, and the device file is executed to reappear the operation of recording.
The device file of every group of event is read and opened by customized sendevent, and when opening device file
It is continuously written into same group of event in order, is favorably accomplished to operate to link up, prevents operation from deforming.
The operation reproducing unit includes:
Big group event rendering module, the event for organizing difference greatly are opened according to the time interval write-in between preset group
Device file, and execute the device file to reappear the operation of recording.Wherein, the time interval between preset group can be solid
Fixed time interval, the time interval obtained after can also being added for the time interval of two adjacent groups with delay time lag.The phase
Adjacent two groups of time interval refers to the last one thing for the time and a upper group that the event for first event currently organized occurs
The absolute value of the difference for the time that the event of part occurs, delay time lag can be arranged according to the actual situation, for example, being set as
500ms etc..
Group event rendering module, for will be in same big group between time of the different groups according to the adjacent event of each group
Every the device file that write-in is opened, and the device file is executed to reappear the operation of recording.
Certainly, if operation has N number of, need to repeat event packets unit 22 and operation reproducing unit 23, until N group thing
Part has all executed, and N is more than or equal to 2.
Optionally, in order to the operation of reproduction carry out pressure test, can preset loop number, circulation execute event packets list
Member 22 and operation reproducing unit 23, whether each operation for executing event packets unit 22 and operating the reproduction of reproducing unit 23 of judgement
It is identical, if they are the same, then determines that this operation retests and pass through.
In second embodiment of the invention, since the time occurred according to event is grouped event, so that being divided into one
The event of group is the corresponding event of same operation, and the event information being grouped just is written when opening primary equipment file, because
This, without repeatedly opening device file when a corresponding event of operation is written, so that the time is saved, so that executing institute
The operation that recording can be reappeared when stating device file, without making the operation reappeared deform.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical 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
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.