CN108052651A - Collocation method, device, pre-reading method of files and electronic equipment - Google Patents

Collocation method, device, pre-reading method of files and electronic equipment Download PDF

Info

Publication number
CN108052651A
CN108052651A CN201711436130.XA CN201711436130A CN108052651A CN 108052651 A CN108052651 A CN 108052651A CN 201711436130 A CN201711436130 A CN 201711436130A CN 108052651 A CN108052651 A CN 108052651A
Authority
CN
China
Prior art keywords
read
file
configuration
strategy
attribute information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711436130.XA
Other languages
Chinese (zh)
Inventor
杨瑞峰
刘浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201711436130.XA priority Critical patent/CN108052651A/en
Publication of CN108052651A publication Critical patent/CN108052651A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present disclosure provides a kind of collocation method, device, pre-reading method of files and electronic equipment, belongs to data reading techniques field.Wherein, collocation method includes obtaining file to be pre-read, and obtains corresponding configuration rule according to the attribute information of the file to be pre-read, according to configuration rule configuration with the file to be pre-read is matched pre-reads strategy.With the matched strategy that pre-reads of this document, to realize the pre-read of file, the applicability for pre-reading strategy has been effectively ensured, disclosure satisfy that different files pre-reads demand in attribute information configuration of the embodiment of the present disclosure based on file.

Description

Collocation method, device, pre-reading method of files and electronic equipment
Technical field
This disclosure relates to data reading techniques field, in particular to a kind of collocation method, device, the file side of pre-reading Method and electronic equipment.
Background technology
File, which is pre-read, to be referred to when order reads file in advance by digital independent to buffer area, with can be in reading next time Data are directly read in buffer area, to improve file reading performance.Through inventor the study found that in the prior art, for different File big city carries out pre-reading processing using the identical strategy that pre-reads, and applicability has much room for improvement.
The content of the invention
In view of this, the embodiment of the present disclosure is designed to provide a kind of collocation method, device, pre-reading method of files and electricity Sub- equipment can be effectively improved the above problem.
Disclosure preferred embodiment provides a kind of collocation method, the described method includes:
Obtain file to be pre-read;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to configuration rule configuration with The file to be pre-read is matched to pre-read strategy.
Optionally, perform according to described in file to be pre-read attribute information obtain corresponding configuration rule the step of it Before, the method further includes:
Configuration singleton configuration rule corresponding with the attribute information of file;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to configuration rule configuration with The matched step for pre-reading strategy of the file to be pre-read includes:
Singleton configuration rule corresponding with the attribute information of the file to be pre-read is judged whether, if in the presence of adjusting With the singleton configuration rule;
According to the singleton configuration rule of calling, configuration with the file to be pre-read is matched pre-reads strategy.
Optionally, perform according to described in file to be pre-read attribute information obtain corresponding configuration rule the step of it Before, the method further includes:
Configuration global configuration rule corresponding from the attribute information of different files;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to the category of the file to be pre-read Property information configuration it is matched pre-read strategy step further include:
If there is no singleton configuration rules corresponding with the attribute information of the file to be pre-read, the overall situation is called to match somebody with somebody Put rule;
According to the global configuration of calling rule, configuration with the file to be pre-read is matched pre-reads strategy.
Optionally, the step of obtaining file to be pre-read includes:
Obtain file to be read;
Judge whether the file to be read meets the condition of pre-reading, if satisfied, then using the file to be read as treating Pre-read file.
Optionally, judge that the step of whether file to be read meets the condition of pre-reading includes:
Judge whether the attribute information of the file to be read meets default needs in the singleton configuration rule and open The condition of pre- reading mode, if satisfied, then using the file to be read as file to be pre-read;Or
Judge whether the attribute information of the file to be read meets default needs in the global configuration rule and open The condition of pre- reading mode, if satisfied, then using the file to be read as file to be pre-read.
Optionally, the method further includes:
Configuration and the matched strategy that pre-reads of file to be pre-read are preserved;
This, which is deleted, when the preservation duration for pre-reading strategy is more than the first preset duration pre-reads strategy or described pre- This, which is deleted, when reading the idle duration of strategy more than the second preset duration pre-reads strategy.
Optionally, the method further includes:
It is described when file is pre-read when needing to read again, judge whether to preserve that file to be pre-read is corresponding pre-reads with this Strategy;
If the category for pre-reading strategy, performing the file to be pre-read according to corresponding with the file to be pre-read is not preserved Property information configuration it is matched pre-read strategy step.
Optionally, the attribute information includes file type and file size.
Disclosure preferred embodiment also provides a kind of pre-reading method of files, and the pre-reading method of files is used for by above-mentioned The strategy that pre-reads of collocation method configuration is treated and pre-reads file and pre-read.
Optionally, the method further includes:
File destination is obtained, judges whether to match with the attribute information of the file destination and has completed to pre-read The fileinfo of strategy configuration, if in the presence of calling this document is corresponding to pre-read strategy, and strategy is pre-read to the mesh according to this Mark file is pre-read.
Disclosure preferred embodiment also provides a kind of configuration device, and the configuration device includes:
File acquisition module is pre-read, for obtaining file to be pre-read;
Tactful configuration module obtains corresponding configuration rule for the attribute information of the file to be pre-read according to, according to The configuration rule, which configures, and the file to be pre-read is matched pre-reads strategy.
Optionally, the tactful configuration module includes:
Regular dispensing unit, for configuring singleton configuration rule corresponding with the attribute information of file;
Tactful call unit, for judging whether singleton configuration corresponding with the attribute information of the file to be pre-read Rule, if in the presence of calling the singleton configuration rule;
Tactful dispensing unit, for passing through the singleton configuration rule of calling, according to the attribute of the file to be pre-read File to be pre-read is matched pre-reads strategy with this for information configuration.
Optionally, the regular dispensing unit is additionally operable to configuration global configuration rule corresponding from the attribute information of different files Then;
The strategy call unit is additionally operable to match somebody with somebody there is no singletons corresponding with the attribute information of the file to be pre-read When putting rule, the global configuration rule is called;
The strategy dispensing unit is additionally operable to the global configuration rule by calling, according to the file to be pre-read Attribute information configures that file to be pre-read is matched pre-reads strategy with this.
Disclosure preferred embodiment also provides a kind of electronic equipment, including processor, memory and above-mentioned configuration device, The configuration device includes one or more and is stored in the memory and the software function module performed by the processor.
Disclosure preferred embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, institute It states computer program and is performed collocation method or pre-reading method of files, it can be achieved that above-mentioned.
Compared with prior art, collocation method, device, pre-reading method of files and the electronics that the embodiment of the present disclosure provides are set It is standby, can adaptively be configured according to the attribute information of different files it is matched pre-read strategy, ensure that the spirit for pre-reading strategy Activity and applicability, and then meet different files pre-reads demand.
In addition, the present embodiment can be preserved to pre-reading strategy, so as to reduce when pre-read strategy configuration Data processing amount.
For the above-mentioned purpose of the disclosure, feature and advantage is enable to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
It, below will be to needed in the embodiment attached in order to illustrate more clearly of the technical solution of the embodiment of the present disclosure Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the disclosure, therefore is not construed as pair The restriction of scope, for those of ordinary skill in the art, without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the frame structure schematic diagram for the electronic equipment that the embodiment of the present disclosure provides.
Fig. 2 is the flow diagram for the collocation method that the embodiment of the present disclosure provides.
Fig. 3 is the sub-process schematic diagram of step S11 shown in Fig. 2.
Fig. 4 is the sub-process schematic diagram of step S12 shown in Fig. 2.
Fig. 5 is the frame structure schematic diagram for the configuration device that the embodiment of the present disclosure provides.
Icon:10- electronic equipments;100- configuration devices;110- pre-reads file acquisition module;120- strategy configuration modules; 121- rule dispensing units;122- strategy call units;123- strategy dispensing units;200- memories;300- storage controls; 400- processors.
Specific embodiment
Through inventor the study found that the existing strategy that pre-reads is obtained based on global configuration rule mostly, and once pre-read Strategy configuration is completed then come into force always, can't distinguish the attribute informations such as file type, the file size of file to be read, more Can not judge whether some file is pre-read so that pre-read strategy applicability, flexibility it is poor.
For example, the strategy that pre-reads obtained in the prior art based on global configuration rule is usually to be read in continuous multiple orders After trigger, and pre-read is carried out using the identical strategy that pre-reads for different files.But it is regarded for what video broadcasting field was related to For frequency file, the video file is mostly larger, it is necessary to promote reading performance by once pre-reading more data, makes picture smooth Without interim card, and the above-mentioned strategy that pre-reads can't pre-read the triggered time according to adjustment such as file type, file sizes or pre-read size Deng can not meet video file pre-reads demand.
It is general and pre-read is not required in another example for the data file based on random read take preserved in database, But it is existing to pre-read strategy and do not differentiate between file type, pre-read can also be carried out to the data file based on random read take, So as to invalid the problem of pre-reading occur, while can also side effect be generated to storage performance etc., influence the read-write of regular traffic.
In summary, according to actual conditions configuration and file it is matched pre-read it is tactful very necessary.Based on this, the disclosure is real It applies example and provides a kind of collocation method and device that can adaptively carry out pre-reading strategy configuration according to file attribute information, with And the strategy that pre-reads that can be configured by the collocation method carries out the pre-reading method of files that file is pre-read.
Below in conjunction with the attached drawing in the embodiment of the present disclosure, the technical solution in the embodiment of the present disclosure is carried out clear, complete Site preparation describes, it is clear that described embodiment is only disclosure part of the embodiment, instead of all the embodiments.Usually The component for the embodiment of the present disclosure being described and illustrated herein in the accompanying drawings can configure to arrange and design with a variety of.Cause This, the detailed description of the embodiment of the disclosure to providing in the accompanying drawings is not intended to limit the claimed disclosure below Scope, but it is merely representative of the selected embodiment of the disclosure.Based on embodiment of the disclosure, those skilled in the art are not doing Go out all other embodiments obtained on the premise of creative work, belong to the scope of disclosure protection.
It should be noted that:Similar label and letter represents similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.
As shown in Figure 1, be disclosure preferred embodiment provide using the collocation method and the electronic equipment 10 of device Frame structure schematic diagram, the electronic equipment 10 include configuration device 100, memory 200, storage control 300 and processing Device 400.Wherein, the memory 200, storage control 300 and 400 each element of processor are directly or indirectly electric between each other Property connection, to realize the transmission of data or interaction.For example, pass through one or more communication bus or signal wire between these elements It realizes and is electrically connected.The configuration device 100 can be stored in the memory including at least one in the form of software or firmware In 200 or the software function module that is solidificated in the operating system of the electronic equipment 10.The processor 400 is in the storage The memory 200 is accessed under the control of controller 300, for performing the executable module stored in the memory 200, Such as software function module included by the configuration device 100 and computer program etc., and then realize in the embodiment of the present disclosure Collocation method.Optionally, the electronic equipment 10 may be, but not limited to, smart mobile phone, I PAD, computer, server etc..
It should be appreciated that structure shown in FIG. 1 is only to illustrate.The electronic equipment 10 can have it is more more than shown in Fig. 1 or The less component of person has the configuration different from shown in Fig. 1.Wherein, each component shown in FIG. 1 can be by software, hardware Or a combination thereof realization.
Further, it is described as shown in Fig. 2, being the flow diagram for the collocation method that disclosure preferred embodiment provides Collocation method is applied to the electronic equipment 10 shown in Fig. 1.With reference to Fig. 2 to the idiographic flow and step of the collocation method It is described in detail.
Step S11:Obtain file to be pre-read.
Wherein, the file to be pre-read can be a file set for including multiple files with same alike result, also may be used To be an individual file, the present embodiment is not limited herein.
The file to be pre-read can obtain in several ways, for example, can be believed according to the attribute for being set in advance in file In breath for identifying whether file needs the pre- read flag of pre-read to obtain;It can also be needed according to pre-set into style of writing The type of service of part pre-read obtains, if pre-setting video playing business and audio broadcasting business to need to carry out file The type of service of pre-read, then, when type of service is video playing business and audio plays business, the file of calling is It needs to carry out file to be pre-read of pre-read etc., the embodiment of the present disclosure is not restricted this.
Fig. 3 is please referred to, the embodiment of the present disclosure additionally provides one of which and obtained by step S110 and step S111 The implementation method of file to be pre-read.
Step S110:Obtain file to be read.
Wherein, the file to be read can be a file set for including multiple files with same alike result, also may be used To be an individual file, the present embodiment is not limited herein.
Step S111:Judge whether the file to be read meets the condition of pre-reading, if satisfied, then by the text to be read Part is used as file to be pre-read.
Wherein, there are many realization methods for pre-reading condition, for example, the condition that pre-reads can be file Attribute information meet certain condition, it is described pre- herein by taking the attribute information of file includes file type and file size as an example If the condition of pre-reading can be the file type or/and file size for needing to carry out the file of pre-read, in the category of file to be read Property information meet it is default pre-read file type or/and file size when, the file to be read is pre- as treating Read file.It should be appreciated that in the present embodiment, the attribute information of file includes but not limited to file type and file size.
In another example described pre-read in the attribute information that condition can be file exists to identify whether file needs The pre- read flag of pre-read, it is when the attribute information of file to be read includes pre- read flag, the file to be read is pre- as treating Read file.
In another example the industry for pre-reading the type of service that condition can be file and meeting needs progress file pre-read Service type, when the type of service of file to be read is to need to carry out the type of service of file pre-read, by the file to be read As file to be pre-read.
In another example the condition that pre-reads can be that reading frequency of the file in a preset period of time meets certain item When file to be read, reading frequency meets the reading frequency of needs progress pre-read in a preset period of time, this is continued for part File is taken as file to be pre-read etc..
Step S12:Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, is advised according to the configuration Then configuration with the file to be pre-read is matched pre-reads strategy.
Wherein, the strategy that pre-reads can include but is not limited to pre-read size, tactful triggered time, pre-read interval, pre-read One or more of information such as stop condition.In addition, the present embodiment is matched somebody with somebody according to the attribute information of file to be pre-read is corresponding Rule configuration is put with described when pre-reading that file is matched to pre-read strategy, the configuration rule can be there are many form, for example, institute It states configuration rule and can include but is not limited to singleton configuration rule or global configuration rule, the singleton configuration rule is for basis The attribute information of file pre-read the configuration of strategy, the global configuration rule be used for according to the attribute informations of different files into Row difference pre-reads the configuration of strategy.During actual implementation, obtained in the attribute information for performing the file to be pre-read according to corresponding Before the step of configuration rule, also need to be pre-configured with and preserve singleton configuration rule corresponding with the attribute information of file and Global configuration rule corresponding from the attribute information of different files.Wherein, the file can be single file or including having The file of multiple files of same alike result information, the present embodiment are not limited herein.
Based on the description of above-mentioned configuration rule, in actual implementation, the condition that pre-reads can be stored in the institute It states in singleton configuration rule and global configuration rule, the singleton configuration rule can also be different from and global configuration is regular and only Vertical to exist, the embodiment of the present disclosure is not limited herein.
Further, for different files to be pre-read, it is understood that there may be partly file to be pre-read and there is no corresponding list Example configuration rule, for example, corresponding singleton configuration rule may be not present in the document files of less demanding to reading performance.So, At some, wait pre-reading file, there is no during corresponding singleton configuration rule, then need to call global configuration rule to the text to be pre-read Part pre-read the configuration of strategy.
In detail, as shown in figure 4, in the present embodiment, setting based on above-mentioned singleton configuration rule and global configuration rule It puts, the step S12 can be realized by five sub-steps of following step S121- steps S125.
Step S121:Judge whether singleton configuration rule corresponding with the attribute information of the file to be pre-read, if In the presence of then performing step S122 and step S123, if being not present, perform step S124 and step S125.
Step S122:Call singleton configuration rule corresponding with the attribute information of the file to be pre-read.
Step S123:According to the singleton configuration rule of calling, configuration with the file to be pre-read is matched pre-reads plan Slightly.
Step S124:Call global configuration rule.
Step S125:According to the global configuration of calling rule, configuration with the file to be pre-read is matched pre-reads plan Slightly.
Optionally, in the embodiments of the present disclosure, the singleton configuration rule and global configuration rule be there are many set-up mode, For example, it is assumed that the attribute information of file includes file type, the condition of pre-reading is stored in the singleton configuration rule, described Singleton configuration rule can be as shown in Table 1 and Table 2.
Table 1
File type AVI wma rmvb rm flash mp4 mid 3GP
Whether pre-read It is It is It is It is It is It is It is It is
Pre-read size 1M 64k 1M 1M 64k 64k 64k 1M
Table 2
File type mdf mdb mdf DB DBF wdb
Whether pre-read It is no It is no It is no It is no It is no It is no
As above, listed in table 1 part need to open the file type of pre- reading mode and it is corresponding pre-read size, Part is listed in table 2 need not open the file type of pre- reading mode, can be according to the text of file to be read based on Tables 1 and 2 Part type judges whether the file to be read needs to carry out pre-read, and when needing pre-read according to the selection pair of this document type The configuration for pre-reading size and pre-read strategy answered.For example, it is assumed that the file type of file to be read is rmvb, then from table 1 In can show that the file satisfaction of rmvb types pre-reads condition, and the corresponding size that pre-reads of file of the rmvb types is 1M, so as to it is configurable with the file to be read is matched pre-reads strategy, wherein, this, which pre-reads strategy, includes file to be pre-read Size information is pre-read, if the size that pre-reads of the file of rmvb types is 1M.
As another embodiment, it is assumed that the attribute information of file includes file size, and the condition of pre-reading is present in In singleton configuration rule, then the singleton configuration rule can be included using file size as whether opening sentencing for pre- reading mode Fixed condition and the pre-set interval [m, n] that is located at according to file size, which are chosen, corresponding pre-reads size.For example, the singleton Configuration rule can be as follows.
(1) if the file size of file to be pre-read is less than m, without pre-reading;
(2) if the file size of file to be pre-read is to be less than n more than m, pre-read, pre-read size as m;
(3) if the file size of file to be pre-read is more than n, pre-read, pre-read size as n.
Wherein, m and n can flexibly be set according to actual demand, for example, m can be 64k, n can be 1M, then default Section is [64k, 1M];In another example m can be 128k, n can be 1.5M, then pre-set interval is [128k, 1.5M] etc..
It is understood that the file to be pre-read is being carried out pre-reading tactful configuration according to corresponding singleton configuration rule When, if the file to be pre-read is a file set for including multiple files with same alike result, then, this document is concentrated each File carries out pre-read using the same strategy that pre-reads.
In the present embodiment, the global configuration rule is basically identical with the design concept of singleton configuration rule, for example, institute Singleton configuration rule is stated to can be used for carrying out the configuration for pre-reading strategy for the attribute information of file to be pre-read, and global configuration is regular Available for the configuration for for different files to be pre-read pre-read strategy, such as global configuration rule can be directed to different business The file to be pre-read of type carries out pre-reading tactful configuration respectively.Wherein, type of service include but not limited to video playing business, Audio plays business, preview picture business, document preview business etc..
By taking the singleton configuration rule shown in table 1 as an example, singleton configuration rule can be directed to inhomogeneity in video playing business Type, such as the video file of avi, rmvb, mp4 carry out pre-reading respectively the configuration of strategy, and all types of files it is corresponding pre-read it is big It is small to differ.And for global configuration rule, can business, preview picture business be played according to video playing business, audio Etc. the differences of types of service carry out pre-reading the configurations of size respectively, for example, for different types of video in video playing business File, such as avi, rmvb, mp4 using identical configuration rule pre-read the configuration of strategy, and it is identical to pre-read size;Again Such as, carried out for the different types of audio file in audio broadcasting business such as mp3, mi d i etc. using identical configuration rule The configuration of strategy is pre-read, and pre-reads that size is identical, and the present embodiment is not limited herein.
It is to be understood that in the present embodiment, the priority of the singleton configuration rule is excellent higher than global configuration rule First grade, global configuration rule are used for wait pre-reading file, there is no carry out pre-reading strategy during corresponding singleton configuration rule Configuration.
Optionally, the save location of the singleton configuration rule and global configuration rule can be carried out according to actual demand Flexibly selection.If the singleton configuration rule can be stored with the attribute information of file in metadata, which is used for File attribute information is described, and supports such as to indicate storage location, historical data, resource lookup, file record function;It is described complete Office configuration rule can be stored in configuration file, the configuration file include all users it is dedicated configuration set, as procedural item, Screen color, network connection, printer connection, mouse is set and the size and location etc. of window.
Step S13:Configuration and the matched strategy that pre-reads of file to be pre-read are preserved.
On the premise of ensureing to pre-read policy flexibility and flexibility, in order to avoid strategy configures the wasting of resources, this implementation It can be preserved in example to what configuration obtained with the matched strategy that pre-reads of file to be pre-read.It is preserved extremely for example, strategy can will be pre-read It pre-reads in policy database, so that in the reading for the file to be read with same alike result information or identical file When reading again, can directly search it is matched pre-read strategy as this document and pre-read strategy, without carrying out pre-reading plan Configuration slightly, so as to which further improve file pre-reads efficiency.
Optionally, except to pre-reading in addition to strategy preserves, can also complete to treat to pre-read file according to pre-reading strategy Pre-read after, to this pre-read strategy execution it is invalid or delete etc. operations, the present embodiment be not limited herein.
Step S14:It is deleted when the preservation duration for pre-reading strategy is more than the first preset duration and pre-reads strategy, Huo Zhe The idle duration for pre-reading strategy is deleted when being more than the second preset duration and pre-reads strategy.
It in the present embodiment, can be pre- to what is preserved according to the preservation duration for pre-reading strategy, idle duration, frequency of use etc. It reads strategy to be monitored, to delete the invalid waste for pre-reading strategy, and then avoiding storage resource for meeting certain condition, keep away simultaneously Exempt from since pre-reading for preservation is tactful excessive, and target is caused to pre-read inquiry complexity increasing of strategy etc..Wherein, certain item is met It is more than setting duration that part, which includes but not limited to preserve duration or idle duration, and frequency of use is less than preset value etc..
Wherein, first preset duration and second preset duration can flexibly be set according to actual conditions.Example Such as, first preset duration may be the same or different with second preset duration, e.g., first preset duration Second preset duration or second preset duration, which can be more than, can be more than described first preset duration etc..
In addition, tactful preservation is pre-read to configured based on above-mentioned, it is described when file is pre-read when needing to read again, It can determine whether to preserve that file to be pre-read is corresponding pre-reads strategy with this, if not preserving corresponding with the file to be pre-read Strategy is pre-read, then the attribute information for performing the file to be pre-read according to configures the matched step for pre-reading strategy;If not It finds corresponding when pre-reading strategy, carries out pre-reading the real-time of strategy further according to the singleton configuration rule or global configuration rule Configuration.
Further, based on the description to above-mentioned collocation method, disclosure preferred embodiment also provides a kind of file and pre-reads Method, the strategy that pre-reads that this document pre-head method is configured by above-mentioned collocation method are treated and pre-read file and pre-read.
Wherein, the pre-reading method of files can be applied to same electronic equipment 10 with the collocation method, can also distinguish Realize that the present embodiment is not limited herein by different electronic equipments 10.In addition, in actual implementation, treated for each pre- Read file, can according to pre-read strategy carry out pre- read operation when more read some contents and preserve in the buffer so that When reading again, it can directly be read out to effectively improve reading performance from caching.For example, when pre-read configured in strategy it is pre- Reading size is 1M, then, during actually pre-reading, the big I of pre-reads data is more than 1M.Strategy and institute are pre-read by described Stating pre-reading of being mentioned in collocation method, strategy is similar, thus details are not described herein for the present embodiment.
On the premise of realization is pre-read, efficiency is pre-read in order to further improve file, data processing amount is reduced, improves user Experience, in the present embodiment, the pre-reading method of files further includes acquisition file destination, judges whether and target text The attribute information of part matches and has completed to pre-read the fileinfo of strategy configuration, if in the presence of calling corresponding to this document Pre-read strategy, and strategy is pre-read according to this, file destination is pre-read.
When getting file destination, judged whether and the file destination according to the attribute information of the file destination Attribute information match and completed to pre-read the fileinfo of strategy configuration, if in the presence of directly invoking and pre-read accordingly Strategy carries out file destination pre-read, this kind of set-up mode, without carrying out pre-reading tactful configuration for file destination, to subtract Data processing amount is lacked.
Wherein, match somebody with somebody judging whether to match with the attribute information of the file destination and completed to pre-read strategy During the fileinfo put, matching can be carried out according to type of service belonging to the file attribute or file destination of file destination etc. and is sentenced It is disconnected.
For example, the mode of matching judgment is carried out according to the file attribute of file destination to be included:Judge whether with it is described The file type of file destination is identical and has completed to pre-read the fileinfo of strategy configuration, if in the presence of calling is corresponding pre- It reads strategy and pre-read is carried out to file destination;Alternatively, it judges whether small with the difference of the file size of the file destination The fileinfo of strategy configuration is pre-read in predetermined threshold value and having completed, if in the presence of can directly invoke and pre-read plan accordingly Pre-read slightly is carried out to file destination.
In another example when carrying out matching judgment according to the type of service belonging to file destination, it can determine whether exist and this Type of service belonging to file destination is identical and has completed to pre-read the fileinfo of strategy configuration, if in the presence of calling is corresponding The strategy that pre-reads pre-read etc. is carried out to file destination, the embodiment of the present disclosure is not limited herein.
It is understood that the file destination can be above-mentioned file to be read or above-mentioned wait to pre-read File etc., the embodiment of the present disclosure be only used for herein distinguish and without substantive meaning.
Based on the above-mentioned description to collocation method and pre-reading method of files, below using the file type of file to be read as Rmvb, singleton configuration rule are stored in metadata, and global configuration rule is stored in configuration file, singleton configuration rule such as 1 He of table Exemplified by shown in table 2, the pre- read procedure of file to be read is introduced.
(1) when opening file to be read, the corresponding metadata of the file to be read is called first, and from the metadata The attribute information of the file to be read is obtained, the file type for obtaining the file to be read is rmvb.
(2) judge in the metadata with the presence or absence of singleton configuration rule, if in the presence of calling the singleton configuration rule, root The file that can obtain rmvb types according to the singleton configuration rule needs to open pre- reading mode, and pre-reads size as 1M, then Configuration pre-reads strategy comprising size is pre-read for 1M.
(3) if singleton configuration rule corresponding with the file to be read is not present in the metadata, configuration is called The global configuration file stored in file can obtain business corresponding with the rmvb types according to the global configuration rule Type, and according to the corresponding configuration for pre-reading size and pre-read strategy of the type of service.For example, it is advised according to the global configuration The corresponding type of service of rmvb types can then be obtained as video playing business, and the video playing business needs to open and pre-reads mould Formula, and size is pre-read as 1.5M, then the configurable size that pre-reads pre-reads strategy for 1.5M.
(4) pre-read is carried out to the file to be read according to the strategy that pre-reads configured, and this is pre-read into tactful progress It preserves.
(5) if read again above-mentioned file to be read or the file to match with the attribute information of the file to be read, The corresponding strategy that pre-reads can be obtained to carry out the pre-read of file by searching for, the mode called.
Further, as shown in figure 5, being a kind of configuration device 100 applied to electronic equipment 10 provided in this embodiment Frame structure schematic diagram, which includes pre-reading file acquisition module 110 and tactful configuration module 120.
It is described to pre-read file acquisition module 110, for obtaining file to be pre-read.In the present embodiment, text is pre-read on described The description of part acquisition module 110 specifically refers to the detailed description of above-mentioned steps S11, that is, the step S11 can be by pre-reading File acquisition module 110 performs, thus does not illustrate more herein.
The strategy configuration module 120 obtains corresponding configuration rule for the attribute information of the file to be pre-read according to Then, according to configuration rule configuration with the file to be pre-read is matched pre-reads strategy.In the present embodiment, on the strategy The description of configuration module 120 specifically refers to the detailed description of above-mentioned steps S12, that is, the step S12 can be matched somebody with somebody by strategy It puts module 120 to perform, thus does not illustrate more herein.
Optionally, referring to Fig. 5, in the present embodiment, the strategy configuration module 120 includes regular dispensing unit 121st, tactful call unit 122 and tactful dispensing unit 123, thus do not illustrate more herein.
The rule dispensing unit 121, for configuring singleton configuration rule corresponding with the attribute information of file, Yi Jipei Put global configuration rule corresponding from the attribute information of different files.In the present embodiment, on the regular dispensing unit 121 Description specifically refers to the detailed description of above-mentioned steps S12, that is, the step S12 can be by the regular dispensing unit 121 It performs, thus does not illustrate more herein.
The strategy call unit 122, it is corresponding with the attribute information of the file to be pre-read for judging whether Singleton configuration rule, if in the presence of, call the singleton configuration rule and there is no with the attribute of the file to be pre-read letter When ceasing the corresponding singleton configuration rule, the global configuration rule is called.In the present embodiment, called on the strategy single The description of member 122 specifically refers to the detailed description of above-mentioned steps S121, step S122 and step S124, that is, the step S121, step S122 and step S124 can be performed by the tactful call unit 122, thus not illustrated more herein.
The strategy dispensing unit 123, for passing through the singleton configuration rule of calling, configuration and the text to be pre-read Part is matched to pre-read strategy or the global configuration rule by calling, and configuration is matched pre- with the file to be pre-read Read strategy.In the present embodiment, the description as described in the tactful dispensing unit 123 specifically refers to above-mentioned steps S123 and step The detailed description of S125, that is, the step S123 and step S125 can be performed by the tactful dispensing unit 123, thus Do not illustrate more herein.
Further, the present embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, institute It states computer program and is performed collocation method or pre-reading method of files, it can be achieved that above-mentioned.
In conclusion the embodiment of the present disclosure provides a kind of collocation method, device, pre-reading method of files and electronic equipment 10, According to the attribute information of different files adaptively configure it is matched pre-read strategy, ensure that the flexibility that pre-reads strategy and Applicability, so as to which meet different files pre-reads demand.Meanwhile the disclosure is realized simply, it is easy to spread, and can be to pre-reading strategy It is preserved, so as to reduce data processing amount.
In the several embodiments provided in the embodiment of the present disclosure, it should be understood that disclosed apparatus and method also may be used To realize by another way.Apparatus and method embodiment described above is only schematical, for example, in attached drawing Flow chart and block diagram show the device of multiple embodiments according to the disclosure, the possibility of method and computer program product is realized Architectural framework, function and operation.In this regard, each box in flow chart or block diagram can represent module, a program A part for section or code, a part for the module, program segment or code are used to implement defined patrol comprising one or more Collect the executable instruction of function.It should also be noted that at some as the function of in the realization method replaced, being marked in box It can be occurred with being different from the order marked in attached drawing.For example, two continuous boxes can essentially be held substantially in parallel Row, they can also be performed in the opposite order sometimes, this is depending on involved function.It is also noted that block diagram and/or The combination of each box in flow chart and the box in block diagram and/or flow chart can use function or dynamic as defined in performing The dedicated hardware based system made is realized or can realized with the combination of specialized hardware and computer instruction.
In addition, each function module in each embodiment of the disclosure can integrate to form an independent portion Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized in the form of software function module and is independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, the technical solution of the disclosure is substantially in other words The part contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can be People's computer, electronic equipment or network equipment etc.) perform all or part of step of each embodiment the method for the disclosure Suddenly.And foregoing storage medium includes:USB flash disk, mobile hard disk, are deposited at read-only memory (ROM, Read-Only Memory) at random The various media that can store program code such as access to memory (RAM, Random Access Memory), magnetic disc or CD. It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to the bag of nonexcludability Contain so that process, method, article or equipment including a series of elements not only include those elements, but also including It other elements that are not explicitly listed or further includes as elements inherent to such a process, method, article, or device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, also there are other identical elements in article or equipment.
The foregoing is merely the alternative embodiments of the disclosure, are not limited to the disclosure, for the skill of this field For art personnel, the disclosure can have various modifications and variations.It is all within the spirit and principle of the disclosure, that is made any repaiies Change, equivalent substitution, improvement etc., should be included within the protection domain of the disclosure.

Claims (13)

1. a kind of collocation method, which is characterized in that the described method includes:
Obtain file to be pre-read;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to configuration rule configuration with it is described File to be pre-read is matched to pre-read strategy.
2. collocation method according to claim 1, which is characterized in that performing the attribute letter of the file to be pre-read according to Before breath obtains the step of corresponding configuration rule, the method further includes:
Configuration singleton configuration rule corresponding with the attribute information of file;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to configuration rule configuration with it is described The matched step for pre-reading strategy of file to be pre-read, including:
Singleton configuration rule corresponding with the attribute information of the file to be pre-read is judged whether, if in the presence of calling should Singleton configuration rule;
According to the singleton configuration rule of calling, configuration with the file to be pre-read is matched pre-reads strategy.
3. collocation method according to claim 2, which is characterized in that performing the attribute letter of the file to be pre-read according to Before breath obtains the step of corresponding configuration rule, the method further includes:
Configuration global configuration rule corresponding from the attribute information of different files;
Corresponding configuration rule is obtained according to the attribute information of the file to be pre-read, according to configuration rule configuration with it is described The matched step for pre-reading strategy of file to be pre-read further includes:
If there is no singleton configuration rules corresponding with the attribute information of the file to be pre-read, the global configuration is called to advise Then;
According to the global configuration of calling rule, configuration with the file to be pre-read is matched pre-reads strategy.
4. collocation method according to claim 1, which is characterized in that the step of obtaining file to be pre-read includes:
Obtain file to be read;
Judge whether the file to be read meets the condition of pre-reading, if satisfied, then using the file to be read as waiting to pre-read File.
5. collocation method according to claim 4, which is characterized in that it is default pre- to judge whether the file to be read meets The step of reading condition, includes:
Judge whether the attribute information of the file to be read meets default needs unlatching in the singleton configuration rule and pre-read The condition of pattern, if satisfied, then using the file to be read as file to be pre-read;Or
Judge whether the attribute information of the file to be read meets default needs unlatching in the global configuration rule and pre-read The condition of pattern, if satisfied, then using the file to be read as file to be pre-read.
6. according to the collocation method any one of claim 1-5, which is characterized in that the method further includes:
Configuration and the matched strategy that pre-reads of file to be pre-read are preserved;
This is deleted when the preservation duration for pre-reading strategy is more than the first preset duration to pre-read strategy or pre-read plan described Idle duration slightly deletes this when being more than the second preset duration and pre-reads strategy.
7. a kind of pre-reading method of files, which is characterized in that the pre-reading method of files is used for through any one of claim 1-6 The strategy that pre-reads of described collocation method configuration is treated and pre-reads file and pre-read.
8. pre-reading method of files according to claim 7, which is characterized in that the method further includes:
File destination is obtained, judges whether to match with the attribute information of the file destination and has completed to pre-read strategy The fileinfo of configuration, if in the presence of calling this document is corresponding to pre-read strategy, and strategy is pre-read to target text according to this Part is pre-read.
9. a kind of configuration device, which is characterized in that the configuration device includes:
File acquisition module is pre-read, for obtaining file to be pre-read;
Tactful configuration module obtains corresponding configuration rule, according to described for the attribute information of the file to be pre-read according to Configuration rule, which configures, and the file to be pre-read is matched pre-reads strategy.
10. configuration device according to claim 9, which is characterized in that the strategy configuration module includes:
Regular dispensing unit, for configuring singleton configuration rule corresponding with the attribute information of file;
Tactful call unit, for judging whether singleton configuration rule corresponding with the attribute information of the file to be pre-read Then, if in the presence of calling the singleton configuration rule;
Tactful dispensing unit, for the singleton configuration rule according to calling, configuration is matched pre- with the file to be pre-read Read strategy.
11. configuration device according to claim 10, which is characterized in that it is described rule dispensing unit be additionally operable to configuration with not The corresponding global configuration rule with the attribute information of file;
It is described strategy call unit be additionally operable to there is no singleton corresponding with the attribute information of the file to be pre-read configuration advise When then, the global configuration rule is called;
The strategy dispensing unit is additionally operable to be matched with the file to be pre-read according to the global configuration rule of calling, configuration Pre-read strategy.
12. a kind of electronic equipment, which is characterized in that including any one of processor, memory and the claims 9-11 institute The configuration device stated, the configuration device include one or more and are stored in the memory and the software performed by the processor Function module.
13. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program It is performed collocation method or pre-reading method of files, it can be achieved that any one of claim 1-8.
CN201711436130.XA 2017-12-26 2017-12-26 Collocation method, device, pre-reading method of files and electronic equipment Pending CN108052651A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711436130.XA CN108052651A (en) 2017-12-26 2017-12-26 Collocation method, device, pre-reading method of files and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711436130.XA CN108052651A (en) 2017-12-26 2017-12-26 Collocation method, device, pre-reading method of files and electronic equipment

Publications (1)

Publication Number Publication Date
CN108052651A true CN108052651A (en) 2018-05-18

Family

ID=62128098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711436130.XA Pending CN108052651A (en) 2017-12-26 2017-12-26 Collocation method, device, pre-reading method of files and electronic equipment

Country Status (1)

Country Link
CN (1) CN108052651A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634874A (en) * 2018-12-07 2019-04-16 联想(北京)有限公司 A kind of data processing method, device, electronic equipment and storage system
CN109947720A (en) * 2019-04-12 2019-06-28 苏州浪潮智能科技有限公司 A kind of pre-reading method of files, device, equipment and readable storage medium storing program for executing
CN110377367A (en) * 2019-07-24 2019-10-25 广州虎牙科技有限公司 Arrrangement method, device, electric terminal and computer readable storage medium
CN111930307A (en) * 2020-07-30 2020-11-13 北京浪潮数据技术有限公司 Data reading method, device and equipment and computer readable storage medium
CN114461589A (en) * 2021-08-24 2022-05-10 荣耀终端有限公司 Method for reading compressed file, file system and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04148361A (en) * 1990-10-11 1992-05-21 Nec Corp Network type education system
CN1924834A (en) * 2006-09-08 2007-03-07 华为技术有限公司 High-speed memory pre-read method and device
CN101315595A (en) * 2008-06-30 2008-12-03 华为技术有限公司 Data reading method and device
CN101373445A (en) * 2008-09-09 2009-02-25 创新科存储技术(深圳)有限公司 Method and apparatus for scheduling memory
CN102521349A (en) * 2011-12-12 2012-06-27 深圳市创新科信息技术有限公司 Pre-reading method of files
CN106293513A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Movable storage device file reading and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04148361A (en) * 1990-10-11 1992-05-21 Nec Corp Network type education system
CN1924834A (en) * 2006-09-08 2007-03-07 华为技术有限公司 High-speed memory pre-read method and device
CN101315595A (en) * 2008-06-30 2008-12-03 华为技术有限公司 Data reading method and device
CN101373445A (en) * 2008-09-09 2009-02-25 创新科存储技术(深圳)有限公司 Method and apparatus for scheduling memory
CN102521349A (en) * 2011-12-12 2012-06-27 深圳市创新科信息技术有限公司 Pre-reading method of files
CN106293513A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Movable storage device file reading and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634874A (en) * 2018-12-07 2019-04-16 联想(北京)有限公司 A kind of data processing method, device, electronic equipment and storage system
CN109947720A (en) * 2019-04-12 2019-06-28 苏州浪潮智能科技有限公司 A kind of pre-reading method of files, device, equipment and readable storage medium storing program for executing
CN110377367A (en) * 2019-07-24 2019-10-25 广州虎牙科技有限公司 Arrrangement method, device, electric terminal and computer readable storage medium
CN110377367B (en) * 2019-07-24 2022-05-03 广州虎牙科技有限公司 Component configuration method and device, electronic terminal and computer readable storage medium
CN111930307A (en) * 2020-07-30 2020-11-13 北京浪潮数据技术有限公司 Data reading method, device and equipment and computer readable storage medium
CN111930307B (en) * 2020-07-30 2022-06-17 北京浪潮数据技术有限公司 Data reading method, device and equipment and computer readable storage medium
CN114461589A (en) * 2021-08-24 2022-05-10 荣耀终端有限公司 Method for reading compressed file, file system and electronic equipment
CN114461589B (en) * 2021-08-24 2023-04-11 荣耀终端有限公司 Method for reading compressed file, file system and electronic equipment

Similar Documents

Publication Publication Date Title
CN108052651A (en) Collocation method, device, pre-reading method of files and electronic equipment
US11451856B2 (en) Providing visual content editing functions
CN110019087B (en) Data processing method and system
US10055106B2 (en) Information display processing system, information display processing method, and program recording medium
CN105224560B (en) Cache data searching method and device
CN104536965B (en) A kind of data query display systems under the conditions of big data and method
CN106295382B (en) A kind of Information Risk preventing control method and device
CN107301204A (en) A kind of method and terminal for sharing file
CN106888381A (en) A kind of data resource storage method and device
CN105408894B (en) A kind of user identity classification determines method and device
CN107977678A (en) Method and apparatus for output information
CN111476596A (en) Family population data processing method, system and storage medium based on homologous equipment
KR20130118580A (en) Method and apparatus for providing contents based on voice call
CN108600780A (en) Method for pushed information
CN108668161A (en) Method of video image processing, computer installation and computer readable storage medium
CN110333802A (en) A kind of method, terminal device, device and storage medium handling Information on Collection
CN106412296A (en) Terminal device control method and apparatus
CN105407005A (en) Content distribution method and device
WO2021087684A1 (en) Method and apparatus for processing user behavior data, server, and storage medium
CN108140128A (en) Link association
CA2983580A1 (en) Method and system for providing content by using digital signage, and nontransitory computer-readable recording medium
CN108763433A (en) Information pushing method and device
JP2013546072A (en) Autonomous intelligent content items
CN108073638A (en) Data diagnosis method and device
CN104426900B (en) multimedia data acquisition method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180518