CN101697154A - Method and device for creating index - Google Patents

Method and device for creating index Download PDF

Info

Publication number
CN101697154A
CN101697154A CN200910110350A CN200910110350A CN101697154A CN 101697154 A CN101697154 A CN 101697154A CN 200910110350 A CN200910110350 A CN 200910110350A CN 200910110350 A CN200910110350 A CN 200910110350A CN 101697154 A CN101697154 A CN 101697154A
Authority
CN
China
Prior art keywords
service
file
index
scripts
source
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
CN200910110350A
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.)
Aspire Digital Technologies Shenzhen Co Ltd
Original Assignee
Aspire Digital Technologies Shenzhen 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 Aspire Digital Technologies Shenzhen Co Ltd filed Critical Aspire Digital Technologies Shenzhen Co Ltd
Priority to CN200910110350A priority Critical patent/CN101697154A/en
Publication of CN101697154A publication Critical patent/CN101697154A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to index technology, in particular to a method and a device for creating an index to overcome the disadvantage that the prior index creating scheme occupies excessive system resources. The method comprises the following steps: receiving an index update command, extracting service identification contained in the command and reading a source service file under a source directory corresponding to the service identification; when judging that the read source service file is different from an object service file under an object directory corresponding to the service identification, updating the object service file according to the source service file; and generating an index file for the updated object service file, and according to the index file, updating an index file under an index file directory corresponding to the service identification. The invention also provides a device for creating the index. The method determines whether to create the index according to the fact that a service file changes or not, thereby greatly reducing the execution density of index creation, and overcoming the disadvantage that the prior index creating scheme occupies excessive system resources.

Description

A kind of device of creating the method for index and creating index
Technical field
The present invention relates to index technology, more particularly, relate to a kind of device of creating the method for index and creating index.
Background technology
Along with the maturation day by day of digital information memory technology, the full-text search of information has obtained using widely.From internet search engine, to the library book search, the application of information global search technology is seen everywhere.
In the face of huge information bank,, often need the information architecture index for improving the efficient of full-text search.With the internet search engine is example, and search engine companies must be to a large amount of web data index buildings that excavate every day, could ensure that every day, number was responded fast in necessarily Webpage search request.
Yet existing index structuring method often needs to take a large amount of system resource, for large database, often needs to dispose special indexing apparatus and comes execution index to make up task.
Therefore, need a kind of index construct scheme, can effectively overcome the above-mentioned defective that existing index structuring method exists.
Summary of the invention
The technical problem to be solved in the present invention is, at the defective of existing index construct scheme excessive occupied system resources, provides a kind of device of creating the method for index and creating index.
The technical solution adopted for the present invention to solve the technical problems is:
Construct a kind of method of creating index, comprising:
S1, reception hint update command are extracted the service identification that wherein comprises, and read the source service scripts under the source directory of this service identification correspondence;
S2, the target service file under source service scripts that judgement the is read target directory corresponding with this service identification upgrade described target service file according to described source service scripts not simultaneously;
S3, for the target service file after upgrading generates index file, according to this index file the index file under the index file catalogue of described service identification correspondence is upgraded.
In the method for establishment index provided by the invention, described index upgrade order is triggered during the time in the index upgrade that arrives described service identification correspondence.
In the method for establishment index provided by the invention, in described step S2, at the MD5 proof test value of the MD5 proof test value of judging described source service scripts and described target service file not simultaneously, judge that described source service scripts is different with described target service file.
In the method for establishment index provided by the invention, in described step S2, when the modification time of judging described source service scripts and described target service file modifying asynchronism(-nization), judge that described source service scripts is different with described target service file.
In the method for establishment index provided by the invention, in described step S2, in the file size of the file size of judging described source service scripts and described target service file not simultaneously, judge that described source service scripts is different with described target service file.
The present invention also provides a kind of device of creating index, comprising:
Receiver module is used for the reception hint update command, extracts the service identification that wherein comprises;
Read module is used for reading the source service scripts under the source directory of this service identification correspondence;
The service scripts update module, be used under source service scripts that judgement the is read target directory corresponding with this service identification the target service file not simultaneously, according to described source service scripts described target service file is upgraded;
The index file creation module is used to the target service file after the renewal to generate index file, according to this index file the index file under the index file catalogue of described service identification correspondence is upgraded.
In the device of establishment index provided by the invention, described index upgrade order is triggered during the time in the index upgrade that arrives described service identification correspondence.
In the device of establishment index provided by the invention, described service scripts update module is used for judging that described source service scripts is different with described target service file at the MD5 proof test value of the MD5 proof test value of judging described source service scripts and described target service file not simultaneously.
In the device of establishment index provided by the invention, described service scripts update module is used for judging that described source service scripts is different with described target service file when the modification time of judging described source service scripts and described target service file modifying asynchronism(-nization).
In the device of establishment index provided by the invention, described service scripts update module is used for judging that described source service scripts is different with described target service file in the file size of the file size of judging described source service scripts and described target service file not simultaneously.
Implement technical scheme of the present invention, have following beneficial effect: in the method for establishment index provided by the invention with create in the device of index, judge at first whether the service scripts of index to be created variation has taken place.Based on judged result, only when service scripts changes, just to this service scripts index building.Thus, just can promptly only create index, so just can reduce the execution density of index construct work greatly, overcome the defective of existing index construct scheme excessive occupied system resources the selectable index building of service scripts to the service scripts that changes.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Fig. 1 is the process flow diagram according to the index creation method of a preferred embodiment of the present invention;
Fig. 2 is the process flow diagram according to the index creation method of another preferred embodiment of the present invention;
Fig. 3 is the logical organization synoptic diagram according to the index creation device of a preferred embodiment of the present invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The invention provides a kind of device of creating the method for index and creating index, can judge at first whether the service scripts of index to be created variation has taken place, again based on judged result, when service scripts changes, just to this service scripts index building.Thus, just can promptly only create index, so just can reduce the execution density of index construct work greatly, overcome the defective of existing index construct scheme excessive occupied system resources the selectable index building of service scripts to the service scripts that changes.Below just with specific embodiment technical scheme provided by the invention is described in detail in conjunction with the accompanying drawings.
The service creation index that provides for the service provider is provided technical scheme provided by the invention.The business that the service provider provides can be summarized and is divided into polytype, such as but not limited to picture business, novel business, music services, video traffic, game service, theme business, software operation and animation business or the like.For ease of the user search corresponding service, the service provider need be to its professional index building that provides.And in the specific implementation process, the service provider comes belonging to all professional index buildings of the type according to the type of business.Every business is corresponding one description document of describing this business tine all.In this description document with a plurality of attributes such as the title of this business, type, brief introduction, provider, business release, price, thumbnail, download address, author, special editions.In the index building process, for each type of service, the service provider at first generates the service scripts that comprises all professional property files that belong to this type of service, and one service identification is set for this service scripts.Be this service scripts index building at attribute mentioned above (i.e. Ye Wu title, type, brief introduction, provider, business release, price, thumbnail, download address, author, special edition etc.) then.In concrete application process, (for example some professional upgrade perhaps additions and deletions business) Shi Caihui renewal that changes of general only some business among such business of the professional corresponding service file of every class.
Fig. 1 is the process flow diagram according to the index creation method 100 of a preferred embodiment of the present invention.As shown in Figure 1, method 100 starts from step 102.
Subsequently, at next step 104, reception hint is created order, extracts the service identification that wherein comprises.When receiving new service scripts (for example increased a new class business and caused newly-increased new service scripts), an index creation order (for example operating personnel send the index creation order) is sent in triggering, comprise this new business file corresponding service sign among this index creation order.The service scripts that newly receives will be stored under the source directory of this service identification correspondence as the source service scripts, and wherein source directory is specifically designed to storage source service scripts.
Subsequently, at next step 106, for this service identification generates corresponding target directory and index file catalogue.In the specific implementation process,, this service identification all can name according to this service identification for generating corresponding target directory and index file catalogue.
Subsequently, at next step 108, under the source directory of the service identification correspondence of extracting, read the source service scripts.
Subsequently, at next step 110, the source service scripts that reads is arrived under the target directory that generates for this service identification as the target service file storage.
Subsequently, at next step 112, for this target service file generates index file and stores under the index file catalogue that generates into this service identification, wherein the index file catalogue is specifically designed to the storage index file.The particular content of relevant generation index file has been done among prior art clearly and has been described, and therefore repeats no more herein.
At last, method 100 ends at step 114.
For every class was professional, its scope of business and business item may change, and cause its service scripts also to change thus.When service scripts changes, new service scripts will cover original source service scripts, and promptly the source service scripts upgrades, and cause the source service scripts different with the target service file thus.In this case, need regenerate index file to this business.Below just this process is described in detail in conjunction with Fig. 2.
Fig. 2 is the process flow diagram according to the index creation method 200 of another preferred embodiment of the present invention.As shown in Figure 2, method 200 starts from step 202.
Subsequently, at next step 204, the reception hint update command is extracted the service identification that wherein comprises.In the specific implementation process, the index upgrade order can be triggered during the time in the index upgrade that arrives a certain class professional or a certain service scripts (being the service identification correspondence), is perhaps triggered by administrator hand.
At this moment, the pairing service identification of service scripts that comprises a certain class business that to upgrade its index in this index upgrade order.
Subsequently, at next step 206, under the source directory of this service identification correspondence, read the source service scripts.
Subsequently, at next step 208, judge the source service scripts read and the index of extraction identify the target service file under the corresponding target directory whether identical, if then forward step 216 to, otherwise forward step 210 to.As indicated above, when service scripts changes, the source service scripts will be updated, and cause the source service scripts different with the target service file thus.
In the specific implementation process, can adopt wherein at least a of following method to judge whether the source service scripts is identical with the target service file:
Be respectively source service scripts and target service file and generate the MD5 check code, judge then whether the MD5 check code of source service scripts and target service file is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file;
Judge whether source service scripts and target service file modifying time is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file;
Whether the file size of judging source service scripts and target service file is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file.
In the specific implementation process, because there are relation one to one in MD5 check code and service scripts, i.e. service scripts difference, then also difference of its MD5 check code.Therefore, the accuracy when judging that based on the MD5 check code source service scripts and target service file be whether identical is higher.
As indicated above, if judge that in step 208 the source service scripts is different with the target service file, then forward step 210 to, according to the source service scripts target service file is upgraded, forward step 212 then to.
Subsequently, at next step 212,, forward step 214 then to for the target service file after upgrading generates index file.About the concrete generation method and the correlation technique of index file have been done clearly description among prior art, so this paper repeats no more.
Subsequently, at next step 214, the index file under the index file catalogue of service identification correspondence is upgraded according to the index file that generates.
At last, method 200 ends at step 216.
The present invention also provides a kind of device of creating index, below just be described in greater detail in conjunction with Fig. 3.
Fig. 3 is the logical organization synoptic diagram according to the index creation device 300 of a preferred embodiment of the present invention.As shown in Figure 3, index creation device 300 comprises receiver module 302, generation module 304, read module 306, index file creation module 308 and service scripts update module 310.
Receiver module 302 is used for reception hint and creates order, extracts the service identification that wherein comprises.When receiving new service scripts (for example increased a new class business and caused newly-increased new service scripts), an index creation order (for example operating personnel send the index creation order) is sent in triggering, comprise this new business file corresponding service sign among this index creation order.The service scripts that newly receives will be stored under the source directory of this service identification correspondence as the source service scripts, and wherein source directory is specifically designed to storage source service scripts.
Generation module 304 is used to this service identification to generate corresponding target directory and index file catalogue.In the specific implementation process,, this service identification all can name according to this service identification for generating corresponding target directory and index file catalogue.
Read module 306 is used for reading the source service scripts according to this service identification under the source directory of correspondence.In addition, read module 306 is used for described service identification and the source service scripts that reads are mail to index file creation module 308.
Index file creation module 308 is used for the source service scripts is arrived under the target directory that generates for this service identification as the target service file storage.After this, index file creation module 308 generates index file for this target service file and stores under the index file catalogue that generates into this service identification, and wherein the index file catalogue is specifically designed to the storage index file.About the concrete generation method and the correlation technique of index file have been done clearly description among prior art, so this paper repeats no more.
For every business, its scope of business and business item may change, and cause its service scripts also to change thus.When service scripts changes, new service scripts will cover original source service scripts, and promptly the source service scripts upgrades, and cause the source service scripts different with the target service file thus.In this case, need regenerate index file to this business.Just the function of each module of index creation device 300 among Fig. 3 in such cases is described in detail below.
Receiver module 302 is used for the reception hint update command, extracts the service identification that wherein comprises.In the specific implementation process, the index upgrade order can be triggered during the time in the index upgrade that arrives a certain class professional or a certain service scripts (being the service identification correspondence), is perhaps triggered by administrator hand.Wherein, comprise the service identification that is associated in the index upgrade order.
Read module 306 is used for reading the source service scripts under the source directory of this service identification correspondence.
Service scripts update module 310 be used under source service scripts that judgement the is read target directory corresponding with this service identification the target service file not simultaneously, according to described source service scripts described target service file is upgraded.As indicated above, when service scripts changes, the source service scripts will be updated, and cause the source service scripts different with the target service file thus.
In the specific implementation process, can adopt wherein at least a of following method to judge whether the source service scripts is identical with the target service file:
Be respectively source service scripts and target service file and generate the MD5 check code, judge then whether the MD5 check code of source service scripts and target service file is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file;
Judge whether source service scripts and target service file modifying time is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file;
Whether the file size of judging source service scripts and target service file is identical.If the two is identical, then the source service scripts is identical with the target service file, otherwise the source service scripts is different with the target service file.
In the specific implementation process, because there are relation one to one in MD5 check code and service scripts, i.e. service scripts difference, then also difference of its MD5 check code.Therefore, the accuracy when judging that based on the MD5 check code source service scripts and target service file be whether identical is higher.
Index file creation module 308 is used to the target service file after the renewal to generate index file, according to this index file the index file under the index file catalogue of described service identification correspondence is upgraded.About the concrete generation method and the correlation technique of index file have been done clearly description among prior art, so this paper repeats no more.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a method of creating index is characterized in that, comprising:
S1, reception hint update command are extracted the service identification that wherein comprises, and read the source service scripts under the source directory of this service identification correspondence;
S2, the target service file under source service scripts that judgement the is read target directory corresponding with this service identification upgrade described target service file according to described source service scripts not simultaneously;
S3, for the target service file after upgrading generates index file, according to this index file the index file under the index file catalogue of described service identification correspondence is upgraded.
2. the method for establishment index according to claim 1 is characterized in that, described index upgrade order is triggered during the time in the index upgrade that arrives described service identification correspondence.
3. the method for establishment index according to claim 1, it is characterized in that, in described step S2, at the MD5 proof test value of the MD5 proof test value of judging described source service scripts and described target service file not simultaneously, judge that described source service scripts is different with described target service file.
4. the method for establishment index according to claim 1, it is characterized in that, in described step S2, when the modification time of judging described source service scripts and described target service file modifying asynchronism(-nization), judge that described source service scripts is different with described target service file.
5. the method for establishment index according to claim 1, it is characterized in that, in described step S2, in the file size of the file size of judging described source service scripts and described target service file not simultaneously, judge that described source service scripts is different with described target service file.
6. a device of creating index is characterized in that, comprising:
Receiver module is used for the reception hint update command, extracts the service identification that wherein comprises;
Read module is used for reading the source service scripts under the source directory of this service identification correspondence;
The service scripts update module, be used under source service scripts that judgement the is read target directory corresponding with this service identification the target service file not simultaneously, according to described source service scripts described target service file is upgraded;
The index file creation module is used to the target service file after the renewal to generate index file, according to this index file the index file under the index file catalogue of described service identification correspondence is upgraded.
7. the device of establishment index according to claim 6 is characterized in that, described index upgrade order is triggered during the time in the index upgrade that arrives described service identification correspondence.
8. the device of establishment index according to claim 6, it is characterized in that, described service scripts update module is used for judging that described source service scripts is different with described target service file at the MD5 proof test value of the MD5 proof test value of judging described source service scripts and described target service file not simultaneously.
9. the device of establishment index according to claim 6, it is characterized in that, described service scripts update module is used for judging that described source service scripts is different with described target service file when the modification time of judging described source service scripts and described target service file modifying asynchronism(-nization).
10. the device of establishment index according to claim 6, it is characterized in that, described service scripts update module is used for judging that described source service scripts is different with described target service file in the file size of the file size of judging described source service scripts and described target service file not simultaneously.
CN200910110350A 2009-10-28 2009-10-28 Method and device for creating index Pending CN101697154A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910110350A CN101697154A (en) 2009-10-28 2009-10-28 Method and device for creating index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910110350A CN101697154A (en) 2009-10-28 2009-10-28 Method and device for creating index

Publications (1)

Publication Number Publication Date
CN101697154A true CN101697154A (en) 2010-04-21

Family

ID=42142259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910110350A Pending CN101697154A (en) 2009-10-28 2009-10-28 Method and device for creating index

Country Status (1)

Country Link
CN (1) CN101697154A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177112A (en) * 2013-04-02 2013-06-26 浪潮电子信息产业股份有限公司 Backup file browsing system
CN105653648A (en) * 2015-12-28 2016-06-08 北京金山安全软件有限公司 File acquisition method and device and electronic equipment
CN109165259A (en) * 2018-08-27 2019-01-08 深圳市大迈科技有限公司 Index table updating method, processor and storage device based on network attached storage
CN117391415A (en) * 2023-09-28 2024-01-12 连连宝(杭州)信息技术有限公司 Service processing method, device and computer storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177112A (en) * 2013-04-02 2013-06-26 浪潮电子信息产业股份有限公司 Backup file browsing system
CN105653648A (en) * 2015-12-28 2016-06-08 北京金山安全软件有限公司 File acquisition method and device and electronic equipment
CN109165259A (en) * 2018-08-27 2019-01-08 深圳市大迈科技有限公司 Index table updating method, processor and storage device based on network attached storage
CN117391415A (en) * 2023-09-28 2024-01-12 连连宝(杭州)信息技术有限公司 Service processing method, device and computer storage medium

Similar Documents

Publication Publication Date Title
CN101702158A (en) Index file creation synchronized method and search system
CN104572043A (en) Method and device for embedding points for controls of client application in real time
CN103049515A (en) Method, device and equipment for classifying application programs
CN101794222A (en) Software version collecting method, management system and software upgrading detection method and system
WO2011117465A1 (en) Method and apparatus for portable index on a removable storage medium
CN103309884A (en) User behavior data collecting method and system
CN103078945B (en) To the method and system that browser crash data processes
CN105786538A (en) Software upgrading method and device based on Android system
CN100440782C (en) Data push method
CN103678487A (en) Method and device for generating web page snapshot
CN111651296A (en) Interception backup method, device, equipment and storage medium for data deletion operation
CN106648569A (en) Target serialization achieving method and device
CN101833464A (en) Method and device for sectionally loading application programs by mobile terminal
CN102810115B (en) Method for implementing multi-layer distributed document management system
CN112099880B (en) Method and system for reducing application program driven by scene
CN101697154A (en) Method and device for creating index
CN101046746B (en) Code management in a distributed software development environment
CN105447349A (en) Method and device for protecting derived symbol in so file
CN108279905B (en) Method and device for introducing library file into assembly
CN115080114B (en) Application program transplanting processing method, device and medium
CN102750391A (en) File previewing method and system based on Hadoop distribution type
CN102446252B (en) Method and device for showing off-limit files
CN110502574B (en) Cross-system information synchronization method, user equipment, storage medium and device
CN115454827B (en) Compatibility detection method, system, equipment and medium
JP5186880B2 (en) File management system, file management method, and file management program

Legal Events

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

Application publication date: 20100421