Invention content
In order to improve the reuse efficiency of multimedia file, solving existing software for composing can not be to the multimedia text of mixed type
The problem of part carries out fast search and reuses, the present invention provides a kind of fast search of component and the methods of reuse, including:
Multimedia component is generated by multimedia file, and the multimedia component is saved in Component Gallery, more matchmakers
Body component includes index information;
It is scanned for, is generated according to the multimedia component that search obtains fast in the Component Gallery according to the index information
According to and cache;
The recent snapshot of caching is compared with former snapshot, removes the former snapshot if changing, and again into
Row search, wherein the original snapshot generates after generating the immediate search of recent snapshot;
Using when the obtained multimedia component of search is directly dragged to region to be edited.
Optionally, the multimedia file includes picture, audio and video.
Optionally, the index information is the index information of the multimedia file, for being looked into according to the index information
Look for the multimedia file.
Optionally, described to include by multimedia file generation multimedia component:
Obtain the multimedia file;
The multimedia file be packaged storing according to preset data format and generates the multimedia component, storage
When stored according to relative path, wherein the preset data format of the multimedia component includes unique header and more
A index information further includes and the one-to-one thumbnail of the index information and multimedia file.
Optionally, described that multimedia component packet is generated by multimedia file when the multimedia component is page assembly
It includes:
The page is selected from multimedia file, and the page is dragged in the Component Gallery;
Record the data information of each filling block and position letter in the page info and the page of the page assembly
Breath.
Optionally, it is scanned in the Component Gallery according to the index information using hierarchical search mode, described point
The search order of grade way of search is file searching, file search and file content search.
Optionally, in search process according to while search while Mechanism showed, the Component Gallery belongs to data Layer,
The data Layer is scanned for according to the index information, and the multimedia component that search obtains is showed in boundary layer.
Optionally, the recent snapshot by caching is compared with former snapshot further includes:
Do not change if the recent snapshot is compared with the former snapshot, more matchmakers that directly output search obtains
Body component.
Optionally, the described directly multimedia component that search obtains is dragged to after region to be edited further includes:
Size in the multimedia component is adjusted according to the size in the region to be edited, until more matchmakers
Body component can completely show in the region to be edited.
Optionally, the multimedia component in search result is directly dragged to region to be edited when the application further includes:
Convert the relative path for the multimedia component applied to Actual path, and more according to Actual path reuse
Media component.
Method for fast searching provided by the invention be packaged storing and be arrived using specific data format to multimedia file
Component Gallery is scanned for according to index information later, due in search process only to the index information part of multimedia component into
Row retrieval, does not access specific multimedia file content, only can just be carried out to specific multimedia file in application component
It accesses, to realize fast search, directly utilizes multimedia component into edlin, component is integrally reused so that reuse
Reuse efficiency when efficiency is only reused content of text far above the prior art.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below
Example is not limited to the scope of the present invention for illustrating the present invention.
The present invention provides a kind of fast search of component and the methods of reuse, and steps flow chart is as shown in Figure 1, specifically include
Following steps:
Step S1, multimedia component is generated by multimedia file, and multimedia component is saved in Component Gallery, wherein more
Media component includes index information.
Step S2, it is scanned for, is generated according to the multimedia component that search obtains fast in Component Gallery according to index information
According to and cache, Central Plains snapshot generate the immediate primary search of recent snapshot after generate.
Step S3, the recent snapshot of caching is compared with former snapshot, former snapshot is removed if changing, and again
It scans for.
The multimedia component that search obtains directly is dragged to region to be edited when step S4, applying, until completing entire
The editor of the page.
The above method in view of the deficiencies in the prior art, is packaged multimedia file, prevents loss of data, profit
Index of reference information scans for, entire multimedia file need not be scanned for, it can be achieved that efficiently quickly search, while
Using when can directly using multimedia component carry out the page editor, the reuse to content of text not only may be implemented, also
Various multimedia components can quickly be reused, improve reuse efficiency.
Optionally, multimedia file includes picture, audio and video.
The multimedia component obtained according to data format of the present invention includes the material breviary of header, index information, component
Diagram data (abbreviation thumbnail) and multimedia file data.The schematic diagram of above-mentioned data format is as shown in Fig. 2, wherein in header
Including version information, the difference for identifying version, while being additionally operable to distinguish whether using above-mentioned data format be packaged and deposit
Storage, while there is data format provided by the invention forward compatibility, i.e. lowest version can be useful in highest version.
Index information therein is the index information of multimedia file, for searching multimedia file according to index information.
Optionally, generating multimedia component by multimedia file includes:
Obtain multimedia file;
Multimedia file is carried out being packaged storage according to preset data format and generates multimedia component, according to phase when storage
Path is stored, the preset data format of wherein multimedia component includes unique header and multiple index informations,
Further include and the one-to-one thumbnail of index information and multimedia file.
Multimedia file is stored when being packaged storage according to relative path, and the multimedia file is indicated in relative path
The file of storage and the position of file, schematic diagram are as shown in Figure 3.Referring to Fig. 3, file packet include picture, data and
Interactive program resource file, wherein data are open document format .odf files, are a kind of binary file formats.Interaction
The program resource file of formula includes audio, video and panorama sketch, specific file content can be MP4, MP3, JPG and
HTML (HyperText Markup Language, hypertext markup language).
Optionally, when multimedia component is page assembly, generating multimedia component by multimedia file includes:
The page is selected from multimedia file, and the page is dragged in Component Gallery;
Record the data information and location information of each filling block in the page info and the page of page assembly.
It is specific when generating multimedia component using the page in multimedia file:In page view, the page is dragged
It is pulled in Component Gallery and forms page assembly, as shown in figure 4, being recorded simultaneously to the various information of page assembly, convenient for application.
Optionally, it is scanned in Component Gallery according to index information using hierarchical search mode, hierarchical search mode
Search order is file searching, file search and file content search, by realizing the search of file content to component
Search and application.
The flow chart of above-mentioned search as shown in figure 5, first determine whether to whether there is current search in buffer, if there is no
Then start to search for, due to having searched for corresponding snapshot caching each time, so if having current search in existing caching into
Row snapshot compares, and judges whether recent snapshot and former snapshot change, and the former snapshot of caching is removed if changing, then weigh
It newly scans for, directly exports the multimedia component searched in former snapshot if not changing.Caching is removed in time, it can
With alleviate it is data cached it is more caused by pressure.During scanning for, according to hierarchical search, first searching fold, again
Search file, final search file content.The also hierarchical classification exhibition when multimedia component obtained to search shows
Existing, the file, file and file content that will be matched with index information, classification are not presented in Component Gallery content exhibition by different level
Show in region.In addition, referring to Fig. 5, the recent snapshot of caching is compared with former snapshot further includes:
Do not change if recent snapshot is compared with former snapshot, the multimedia component that directly output search obtains.
Optionally, in search process according to while search while Mechanism showed, Component Gallery belongs to data Layer, in data
Layer is scanned for according to index information, and the multimedia component that search obtains is showed in boundary layer.Due to component warehouse compartment
In data Layer, and search result (multimedia component searched for) is located at boundary layer, according to the ticker data on interface
Index information is obtained, scans for according to index information in data Layer, shows search result is fed back to boundary layer, this
That is mentioned in invention shows by being realized to the access of thumbnail, and the multimedia component that need not show wouldn't visit
It asks, only accesses the multimedia component for needing to show.
It should also be noted that, not accessing specific file content in multimedia component in search process, only answering
With can just access specific file content in multimedia component when multimedia component, the time of access can be saved in this way.
Optionally, directly the multimedia component that search obtains is dragged to after region to be edited and further includes:
Size in multimedia component is adjusted according to the size in region to be edited, until multimedia component can be
Region to be edited shows completely.
The schematic diagram of above application page assembly is as shown in fig. 6, size and dimension scale due to multimedia component are
It is fixed, therefore pull the multimedia component come in and be not necessarily adapted to the current page, thus by multimedia component pull into
Also its size is carried out readjusting position and size by intelligence computation after coming.
It should also be noted that, using when the multimedia component in search result be directly dragged to region to be edited also wrap
It includes:
It converts the relative path for the multimedia component applied to Actual path, and multimedia is reused according to Actual path
Component.
The operation that path resetting is carried out when due to generating multimedia component, i.e., reset to relative path by Actual path, because
This also converts relative path to Actual path in application of multimedia component, that is, needs to carry out route matching.
Method for fast searching provided by the invention be packaged storing and be arrived using specific data format to multimedia file
Component Gallery is scanned for according to index information later, due in search process only to the index information part of multimedia component into
Row retrieval, does not access specific multimedia file content, only can just be carried out to specific multimedia file in application component
It accesses, to realize fast search, directly utilizes multimedia component into edlin, component is integrally reused so that reuse
Reuse efficiency when efficiency is only reused content of text far above the prior art.
Embodiment of above is merely to illustrate the present invention, and not limitation of the present invention, in relation to the common of technical field
Technical staff can also make a variety of changes and modification without departing from the spirit and scope of the present invention, therefore all
Equivalent technical solution also belongs to scope of the invention, and scope of patent protection of the invention should be defined by the claims.