The content of the invention
For the defect that prior art is present, the present invention provides a kind of interpolation storage method of screen picture, system and returns
Method is put, is used to solve the above problems.
The technical solution adopted by the present invention is as follows:
The present invention provides a kind of interpolation storage method of screen picture, comprises the following steps:
S1, sets initial parameter value, and the initial parameter value is including frame number m in a group totalframes L, group sequence number n, group and entirely
Office frame number z;Wherein, L, n, m and z are natural number;
Associated data table is created, the associated data table is used for frame number, the overall situation in associated storage picture frame group sequence number, group
The corresponding relation of frame number, picture frame attribute information and interior storage location of the picture frame in file stream of group;
S2, initialization, makes n=1, m=1, z=1;
S3, when the trigger condition of screen acquisition is met, obtains current full-screen image frame, and by the full-screen image frame
N-th group m frame positions in file stream are stored in, frame number is that m, global frame number are z in the group of the full-screen image frame;
S4, judges whether m is equal to L, if equal to, then make n=n+1, z=z+1, m be initialized as 1, it is then back to perform
S3;
If it is not, m=m+1 is then made, z=z+1;Then S5 is performed;
S5, when the trigger condition of screen acquisition is met, the current full-screen image frame of acquisition is compared with previous picture frame
Modified-image frame, and the modified-image frame is stored in the n-th group m frame positions in file stream;The modified-image frame it is complete
Office's frame number is z;Positional information of the modified-image frame on screen is obtained simultaneously, the positional information is used as the variation diagram
As the attribute information of frame, the attribute information is arrived with the corresponding relation storage of frame number m and group sequence number n in global frame number z, group
The associated data table;Judge whether to reach the end condition that screen picture is obtained, if reached, terminate flow;If not
Reach, then return to S4.
Preferably, group totalframes L values are 10~100.
Preferably, L values are 50.
Preferably, the modified-image frame is h sides shape, and h is natural number, also, h >=3.
Preferably, in S5, positional information of the modified-image frame on screen is:H sides Xing Ge summits are on screen
Coordinate information.
Preferably, in S3, operation behavior occurs as the trigger condition of screen picture acquisition;Or, predefined time interval,
The trigger condition of screen picture acquisition is met whenever interval time is reached.
The present invention also provides a kind of interpolation storage system of screen picture, including:
Initial parameter value setup module, for setting initial parameter value, the initial parameter value includes group totalframes L, group
Frame number m and global frame number z in sequence number n, group;Wherein, L, n, m and z are natural number;
Associated data table memory module, for frame number, global frame number and figure in associated storage picture frame group sequence number, group
As the corresponding relation of Frame Properties information;
Trigger condition detection module, for detecting whether there is the trigger condition of screen acquisition;
Numeration module, for frame number m in record group sequence number n, group and global frame number z;During initialization, n=1, m=1,
Z=1;Also, when m increases to group totalframes L, then m is to be counted again since 1;
Full-screen image frame acquisition module, for when the testing result of the trigger condition detection module is received, being based on
Frame number m and global frame number z in group sequence number n that the numeration module is recorded, group, as m=1, then obtains current complete
Screen image frame, and the full-screen image frame is stored in n-th group m frame positions in file stream;
Modified-image frame acquisition module, for when the testing result of the trigger condition detection module is received, being based on
Group sequence number n, group interior frame number m and global frame number z that the numeration module is recorded, as 1 < m < L, obtain current full frame
Modified-image frame of the picture frame compared with previous picture frame, and the modified-image frame is stored in the n-th group m in file stream
Frame position;Positional information of the modified-image frame on screen is obtained simultaneously, by the attribute information and global frame number z, group
The associated data table is arrived in the corresponding relation storage of interior frame number m and group sequence number n;
Associated data table, for frame number, global frame number, image Frame Properties in associated storage picture frame group sequence number, group
The corresponding relation of storage location of the picture frame in file stream in information and group.
The present invention also provides a kind of back method of screen picture, comprises the following steps:
Step 1, when needing since view screen image in order specified picture frame of the global frame number for x, is removed with x
With a group totalframes L, if the integer-bit numeral of acquired results is a, decimal place numeral is b;A is specifying where specified picture frame
Group sequence number;
Step 2, associated data table is searched based on the designated groups sequence number a that step 1 is calculated, and obtains designated groups in file stream
In storage location;
Step 3, based on the storage location that step 2 is obtained, directly navigates to designated groups in file stream;If b=1,
The full-screen image frame of designated groups is directly read and played, then, the figure after the full-screen image frame is constantly read in order
As frame;If picture frame is modified-image frame, according to position of the modified-image frame stored in associated data table on screen
Information, modified-image frame is updated the correspondence position of screen in order;If picture frame is full-screen image frame, directly export
Onto screen, so as to realize the view screen image in order since specified picture frame of the global frame number for x;
If b ≠ 1, by the full-screen image frame output of designated groups to screen buffer, and constantly read full frame positioned at this
Modified-image frame after picture frame, and the position according to the modified-image frame stored in associated data table on full-screen image frame
Information, modified-image frame is updated the correspondence position of full-screen image frame in order, is arrived until b modified-image frame is updated
During screen buffer, i.e. reduction obtains target image;Then the full-screen image frame after renewal is shown on screen, then, no
The disconnected picture frame read in order after the full-screen image frame after the renewal;If picture frame is modified-image frame, root
According to positional information of the modified-image frame stored in associated data table on screen, modified-image frame is updated into screen in order
Correspondence position;If picture frame is full-screen image frame, it is directly output on screen, so as to realize that from global frame number be x
Specified picture frame start view screen image in order.
The interpolation storage method of screen picture, system and back method that the present invention is provided, with advantages below:
(1) because screen picture frame is stored in groups, a full-screen image frame is only stored in each group, other are change
Picture frame, because modified-image frame occupies memory space much smaller than full-screen image frame, therefore, it is equal with all images in the prior art
Compared using full-screen image storage mode, on the whole the effectively smaller occupancy situation of memory space;
(2) in addition, the present invention use interpolation storage mode, due in each group exist a full-screen image frame, because
This, can quick indexing is to arbitrary image frame and plays, have the advantages that picture frame locating speed is fast, improve user's playback experience;
(3) also to have the advantages that CPU and memory source are used less for the present invention.
Specific embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail:
As shown in figure 1, the present invention provides a kind of interpolation storage method of screen picture, comprise the following steps:
S1, sets initial parameter value, and the initial parameter value is including frame number m in a group totalframes L, group sequence number n, group and entirely
Office frame number z;Wherein, L, n, m and z are natural number;Group totalframes L be constant according to the size of the physical memory space and
The size of CPU situation determination group totalframes L, can be selected between 10~100, preferably 50.Organize sequence number n, organize interior frame number m and complete
Office frame number z is variable;
Associated data table is created, the associated data table is used for frame number, the overall situation in associated storage picture frame group sequence number, group
The corresponding relation of frame number, picture frame attribute information and interior storage location of the picture frame in file stream of group;
S2, initialization, makes n=1, m=1, z=1;
S3, when the trigger condition of screen acquisition is met, obtains current full-screen image frame, and by the full-screen image frame
N-th group m frame positions in file stream are stored in, frame number is that m, global frame number are z in the group of the full-screen image frame;
In the present invention, the trigger condition that screen is obtained flexibly is set according to the actual requirements, for example, working as provide the present invention
When interpolation storage method is applied to operation behavior audit field, operation behavior occurs to be the trigger condition that screen picture is obtained,
That is, often there is once-through operation behavior and note that one screen picture of acquisition;When the interpolation storage method application for providing the present invention
In screen picture record field when, can predefined time interval, meet whenever interval time is reached screen picture acquisition
Trigger condition.
S4, judges whether m is equal to L, if equal to, then make n=n+1, z=z+1, m be initialized as 1, it is then back to perform
S3;
If it is not, m=m+1 is then made, z=z+1;Then S5 is performed;
S5, when the trigger condition of screen acquisition is met, the current full-screen image frame of acquisition is compared with previous picture frame
Modified-image frame, and the modified-image frame is stored in the n-th group m frame positions in file stream;The modified-image frame it is complete
Office's frame number is z;Positional information of the modified-image frame on screen is obtained simultaneously, the positional information is used as the variation diagram
As the attribute information of frame, the attribute information is arrived with the corresponding relation storage of frame number m and group sequence number n in global frame number z, group
The associated data table;Judge whether to reach the end condition that screen picture is obtained, if reached, terminate flow;If not
Reach, then return to S4.
It is simple computation, modified-image frame may be set to triangle or polygon, position of the modified-image frame on screen
Information is the coordinate information of polygon or each summit of triangle on screen.
It is interpolation image storage organization with reference to Fig. 2 as a example by L=50 with 500 picture frames of common acquisition according to above-mentioned flow
Schematic diagram, introduces a kind of specific example:
The full-screen image frame of z=1 is obtained first, is deposited into the 1st group of the 1st frame position;
Then the modified-image frame of z=2 is obtained, the 1st group of the 2nd frame position is deposited into;
The modified-image frame of z=3 is obtained, the 1st group of the 3rd frame position is deposited into;
…
The modified-image frame of z=50 is obtained, the 1st group of the 50th frame position is deposited into;
That is, for the 1st group of image, only the 1st image is full-screen image frame, and other 49 images are phase
For the previous modified-image frame of image;
Same:
The full-screen image frame of z=51 is obtained again, is deposited into the 2nd group of the 1st frame position;
The modified-image frame of z=52 is obtained, the 2nd group of the 2nd frame position is deposited into;
The modified-image frame of z=53 is obtained, the 2nd group of the 3rd frame position is deposited into;
…
The modified-image frame of z=100 is obtained, the 2nd group of the 50th frame position is deposited into;
The rest may be inferred:
When the full-screen image frame for obtaining z=451, the 10th group of the 1st frame position is deposited into;
The modified-image frame of z=452 is obtained, the 10th group of the 2nd frame position is deposited into;
The modified-image frame of z=452 is obtained, the 10th group of the 3rd frame position is deposited into;
…
The modified-image frame of z=500 is obtained, the 10th group of the 50th frame position is deposited into.
As can be seen here, the interpolation storage method of the screen picture that the present invention is provided, substantially one kind is stored in groups picture number
According to method, the number of image frames of each group can adjust.Also, every group of image sequence by positioned at the first full-screen image frame and after
The modified-image frame composition of continuous position;Full-screen image frame is the image information of whole screen, and modified-image frame is screen change
Image-region;In addition, for convenience of retrieving, also setting up associated record table, each picture frame attribute information is recorded.Thus modified-image
Frame data are much larger than full-screen image number of frames, therefore, in the picture frame sequence that each group image is formed, full-screen image frame is appreciated that
Be interpolated frame, be interspersed between each modified-image frame, can quick indexing is to arbitrary image frame and plays, with image frame alignment
Fireballing advantage, improves user's playback experience.
The present invention also provides a kind of interpolation storage system of screen picture, including:
Initial parameter value setup module, for setting initial parameter value, the initial parameter value includes group totalframes L, group
Frame number m and global frame number z in sequence number n, group;Wherein, L, n, m and z are natural number;
Associated data table memory module, for frame number, global frame number and figure in associated storage picture frame group sequence number, group
As the corresponding relation of Frame Properties information;
Trigger condition detection module, for detecting whether there is the trigger condition of screen acquisition;
Numeration module, for frame number m in record group sequence number n, group and global frame number z;During initialization, n=1, m=1,
Z=1;Also, when m increases to group totalframes L, then m is to be counted again since 1;
Full-screen image frame acquisition module, for when the testing result of the trigger condition detection module is received, being based on
Frame number m and global frame number z in group sequence number n that the numeration module is recorded, group, as m=1, then obtains current complete
Screen image frame, and the full-screen image frame is stored in n-th group m frame positions in file stream;
Modified-image frame acquisition module, for when the testing result of the trigger condition detection module is received, being based on
Group sequence number n, group interior frame number m and global frame number z that the numeration module is recorded, as 1 < m < L, obtain current full frame
Modified-image frame of the picture frame compared with previous picture frame, and the modified-image frame is stored in the n-th group m in file stream
Frame position;Positional information of the modified-image frame on screen is obtained simultaneously, by the attribute information and global frame number z, group
The associated data table is arrived in the corresponding relation storage of interior frame number m and group sequence number n;
Associated data table, for frame number, global frame number, image Frame Properties in associated storage picture frame group sequence number, group
The corresponding relation of storage location of the picture frame in file stream in information and group.
The interpolation storage system of the screen picture that the present invention is provided, can be applied in operation behavior auditing system, be installed on
Server end, for storing audit view data.
For example:When client accesses the audit operation system of remote server, remote server installs interpolation storage system
System, when effective operation behavior that client has keyboard or mouse occurs, server calls interpolation storage system carries out screen note
Record, the totalframes of group may be set to 50 frames.
Further, the storage that an image stores sequence can be carried out in units of windows sessions.Image obtain and
Image storage is segmented in two programs and performs, and a server can concurrently support multiple session storage sequences.Such as, a service
Device start 10 sessions, each session using the present invention offer be stored in groups and obtain screen frame by the way of, equivalent to one
Individual server carries out 10 recordings of screen using hardware simultaneously, can further reduce server CPU and EMS memory occupation situation.
The present invention also provides a kind of back method of screen picture, comprises the following steps:
Step 1, when needing since view screen image in order specified picture frame of the global frame number for x, is removed with x
With a group totalframes L, if the integer-bit numeral of acquired results is a, decimal place numeral is b;A is specifying where specified picture frame
Group sequence number;
Step 2, associated data table is searched based on the designated groups sequence number a that step 1 is calculated, and obtains designated groups in file stream
In storage location;
Step 3, based on the storage location that step 2 is obtained, directly navigates to designated groups in file stream;If b=1,
The full-screen image frame of designated groups is directly read and played, then, the figure after the full-screen image frame is constantly read in order
As frame;If picture frame is modified-image frame, according to position of the modified-image frame stored in associated data table on screen
Information, modified-image frame is updated the correspondence position of screen in order;If picture frame is full-screen image frame, directly export
Onto screen, so as to realize the view screen image in order since specified picture frame of the global frame number for x;
If b ≠ 1, by the full-screen image frame output of designated groups to screen buffer, and constantly read full frame positioned at this
Modified-image frame after picture frame, and the position according to the modified-image frame stored in associated data table on full-screen image frame
Information, modified-image frame is updated the correspondence position of full-screen image frame in order, is arrived until b modified-image frame is updated
During screen buffer, i.e. reduction obtains target image;Then the full-screen image frame after renewal is shown on screen, then, no
The disconnected picture frame read in order after the full-screen image frame after the renewal;If picture frame is modified-image frame, root
According to positional information of the modified-image frame stored in associated data table on screen, modified-image frame is updated into screen in order
Correspondence position;If picture frame is full-screen image frame, it is directly output on screen, so as to realize that from global frame number be x
Specified picture frame start view screen image in order.
So that 10 groups of images of storage coexist, every group is 50 picture frames, i.e., as a example by one has 500 picture frames, if group sequence number point
Wei 1,2 ... 10;Introduce the back method of the screen picture that the present invention is provided:
Played back since the 251st picture frame if desired, then 251/50=5, remainder is 1, i.e.,:A=5, b=1;Show
251st picture frame is at the 5th group;By searching associated data table, the 5th group of storage location in file stream is obtained;Then, directly
It is connected in file stream and navigates to the 5th group;Due to b=1 in this example, therefore, the 251st picture frame is full-screen image frame, can be direct
Read and play;Then the picture frame after the full-screen image frame is constantly read in order again;
Played back since the 253rd picture frame if desired, then 253/50=5, remainder is 3, i.e.,:A=5, b=3;Show
253rd picture frame is at the 5th group;By searching associated data table, the 5th group of storage location in file stream is obtained;Then, directly
It is connected in file stream and navigates to the 5th group;Due to b=3 ≠ 1 in this example, therefore, the 253rd picture frame be modified-image frame, it is necessary to
Then the 5th group of full-screen image frame output is read into the modified-image frame of serial number 2 in the 5th group of group to screen buffer first
And export to screen buffer, it is further continued for reading in the 5th group of group the modified-image frame of serial number 3 and exports and arrives screen buffer,
Thus i.e. obtain the 253rd picture frame, then by data output in screen buffer to screen, last handling process and b=1 phases
Together, will not be repeated here.
It can be seen that, the present invention can quickly be positioned and play back target image, improve user's playback experience.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
Depending on protection scope of the present invention.