Summary of the invention
In order to improve the reuse efficiency of multimedia file, solve the problem that existing software for composing cannot carry out fast search to the multimedia file of mixed type and reuse, the fast search that the invention provides a kind of assembly and the method for reusing, comprising:
Generate multimedia groupware by multimedia file, and be saved in Component Gallery by described multimedia groupware, described multimedia groupware comprises index information;
Search in described Component Gallery according to described index information, according to searching for the multimedia groupware generating snapshot buffer memory that obtain;
The recent snapshot of buffer memory and former snapshot are compared, if changed, remove described former snapshot, and re-start search, wherein said former snapshot is generate the immediate search of described recent snapshot to generate afterwards;
Directly region to be edited is dragged to by searching for the multimedia groupware obtained during application.
Alternatively, described multimedia file comprises picture, Voice & Video.
Alternatively, described index information is the index information of described multimedia file, for searching described multimedia file according to described index information.
Alternatively, described by multimedia file generate multimedia groupware comprise:
Obtain described multimedia file;
According to the data layout preset, packing is carried out to described multimedia file and stores the described multimedia groupware of generation, store according to relative path during storage, the data layout preset of wherein said multimedia groupware comprises unique header and multiple index information, also comprises and described index information thumbnail and multimedia file one to one.
Alternatively, when described multimedia groupware is page assembly, described by multimedia file generate multimedia groupware comprise:
From multimedia file, select the page, and the described page is dragged in described Component Gallery;
Record data message and the positional information of each filling block in the page info of described page assembly and the described page.
Alternatively, adopt hierarchical search mode to search in described Component Gallery according to described index information, the search order of described hierarchical search mode is file searching, file search and file content search.
Alternatively, represent according to search limit, limit Mechanism in search procedure, described Component Gallery belongs to data Layer, searches for according to described index information at described data Layer, and represents searching for the multimedia groupware obtained at contact bed.
Alternatively, the described recent snapshot of buffer memory and former snapshot being compared also comprises:
Do not change if described recent snapshot and described former snapshot are compared, then directly export the multimedia groupware searched for and obtain.
Alternatively, describedly directly also to comprise searching for after the multimedia groupware obtained is dragged to region to be edited:
Size according to described region to be edited adjusts the size in described multimedia groupware, until described multimedia groupware can represent completely in described region to be edited.
Alternatively, directly the multimedia groupware in Search Results is dragged to region to be edited during described application also to comprise:
The relative path of applied multimedia groupware is converted into Actual path, and reuses multimedia groupware according to described Actual path.
Method for fast searching provided by the invention, utilize specific data layout to carry out packing to multimedia file and be stored into Component Gallery, search for according to index information afterwards, owing to only retrieving the index information part of multimedia groupware in search procedure, do not access concrete multimedia file content, only just can concrete multimedia file be conducted interviews when application component, thus realize fast search, multimedia groupware is directly utilized to edit, component integration is reused, reuse efficiency when reuse efficiency is only reused content of text far above prior art.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples for illustration of the present invention, but are not used for limiting the scope of the invention.
The fast search that the invention provides a kind of assembly and the method for reusing, steps flow chart as shown in Figure 1, specifically comprises the following steps:
Step S1, generate multimedia groupware by multimedia file, and be saved in Component Gallery by multimedia groupware, wherein multimedia groupware comprises index information.
Step S2, search in Component Gallery according to index information, according to searching for the multimedia groupware generating snapshot buffer memory that obtain, its Central Plains snapshot is generate after generating the immediate once search of recent snapshot.
Step S3, the recent snapshot of buffer memory and former snapshot to be compared, if changed, remove former snapshot, and re-start search.
Directly region to be edited is dragged to, until complete the editor of full page by searching for the multimedia groupware obtained when step S4, application.
Said method is for the defect existed in prior art, multimedia file is packed, prevent loss of data, utilize index information search, do not need to search for whole multimedia file, can realize efficiently searching for fast, can directly utilize multimedia groupware to carry out the editor of the page when applying simultaneously, not only can realize reusing content of text, can also reuse fast various multimedia groupware, improve reuse efficiency.
Alternatively, multimedia file comprises picture, Voice & Video.
The multimedia groupware obtained according to data layout of the present invention comprises header, index information, the material thumbnail data (abbreviation thumbnail) of assembly and multimedia file data.The schematic diagram of above-mentioned data layout as shown in Figure 2, wherein header comprises version information, for identifying the difference of version, also whether apply above-mentioned data layout for differentiation simultaneously and carry out packing storage, data layout provided by the invention has forward compatibility simultaneously, and namely lowest version can be useful in highest version.
Index information is wherein the index information of multimedia file, for searching multimedia file according to index information.
Alternatively, generate multimedia groupware by multimedia file to comprise:
Obtain multimedia file;
According to the data layout preset, packing is carried out to multimedia file and stores generation multimedia groupware, store according to relative path during storage, wherein the data layout preset of multimedia groupware comprises unique header and multiple index information, also comprises and index information thumbnail and multimedia file one to one.
Multimedia file packing stores according to relative path when storing, and indicate the file of this multimedia file storage and the position of file in relative path, schematic diagram as shown in Figure 3.See Fig. 3, file bag comprises picture, data and interactively program resource file, and wherein data are ODF .odf file, is a kind of binary file format.Interactively program resource file comprises audio frequency, video and panorama sketch, and concrete file content can be MP4, MP3, JPG and HTML (HyperTextMarkupLanguage, HTML (Hypertext Markup Language)).
Alternatively, when multimedia groupware is page assembly, generates multimedia groupware by multimedia file and comprise:
From multimedia file, select the page, and the page is dragged in Component Gallery;
The data message of each filling block and positional information in the record page info of page assembly and the page.
Concrete when utilizing the page in multimedia file to generate multimedia groupware: in page view, the page to be dragged in Component Gallery and to form page assembly, as shown in Figure 4, record is carried out to the various information of page assembly simultaneously, be convenient to application.
Alternatively, adopt hierarchical search mode to search in Component Gallery according to index information, the search order of hierarchical search mode is file searching, file search and file content search, by realizing search to assembly and application to the search of file content.
The process flow diagram of above-mentioned search as shown in Figure 5, first judge whether there is current search in impact damper, if there is no search is then started, owing to having searched for corresponding snapshot buffer memory each time, if so have current search in existing buffer memory, carry out snapshot comparison, judge whether recent snapshot and former snapshot change, if changed, remove the former snapshot of buffer memory, re-start search again, if there is no change, the direct multimedia groupware output will searched in former snapshot.Timely removing buffer memory, can alleviate the data cached more pressure caused.Carry out in search procedure, according to hierarchical search, first searching fold, again search file, final search file content.Representing searching in the multimedia groupware that obtains represents also hierarchical classification, by the file, file and the file content that match with index information, point rank is presented in Component Gallery content displaying region by different level.In addition, see Fig. 5, the recent snapshot of buffer memory and former snapshot are compared and also comprise:
Do not change if recent snapshot and former snapshot are compared, then directly export the multimedia groupware searched for and obtain.
Alternatively, represent according to search limit, limit Mechanism in search procedure, Component Gallery belongs to data Layer, searches for according to index information at data Layer, and represents searching for the multimedia groupware obtained at contact bed.Because Component Gallery is positioned at data Layer, and Search Results (namely searching for the multimedia groupware obtained) is positioned at contact bed, index information is obtained according to the ticker data on interface, search for according to index information at data Layer, represent Search Results is fed back to contact bed, that mentions in the present invention represents by realizing the access of thumbnail, does not need the multimedia groupware represented to access, and only accesses the multimedia groupware needing to represent.
Also it should be noted that, in search procedure, do not access file content concrete in multimedia groupware, only just can access file content concrete in multimedia groupware when application of multimedia assembly, the time of access can be saved like this.
Alternatively, directly also comprise searching for after the multimedia groupware obtained is dragged to region to be edited:
Size according to region to be edited adjusts the size in multimedia groupware, until multimedia groupware can represent completely in region to be edited.
The schematic diagram of above-mentioned application page assembly as shown in Figure 6, because the size of multimedia groupware and dimension scale are fixing, therefore the multimedia groupware pulled into is not necessarily adapted to the current page, also will carry out readjusting position and size by intelligent computation to its size after therefore being pulled into by multimedia groupware.
Also it should be noted that, directly the multimedia groupware in Search Results be dragged to region to be edited during application and also comprise:
The relative path of applied multimedia groupware is converted into Actual path, and reuses multimedia groupware according to Actual path.
Owing to carrying out the operation of path replacement when generating multimedia groupware, reset to relative path by Actual path, therefore also relative path will be converted into Actual path when application of multimedia assembly, namely need to carry out route matching.
Method for fast searching provided by the invention, utilize specific data layout to carry out packing to multimedia file and be stored into Component Gallery, search for according to index information afterwards, owing to only retrieving the index information part of multimedia groupware in search procedure, do not access concrete multimedia file content, only just can concrete multimedia file be conducted interviews when application component, thus realize fast search, multimedia groupware is directly utilized to edit, component integration is reused, reuse efficiency when reuse efficiency is only reused content of text far above prior art.
Above embodiment is only for illustration of the present invention; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.