Summary of the invention
For the defective that exists in the prior art, the purpose of this invention is to provide simple, the fireballing digital resource packet structure verifying method of a kind of logic and system.
To achieve these goals, the technical solution used in the present invention is as follows:
A kind of digital resource packet structure verifying method comprises that the detailed organizational form to the digital resource pack arrangement is described, and forms the step of digital resource pack arrangement information A; Described method also comprises to be processed digital resource pack arrangement information A, the attribute information of digital resource bag File and catalogue is processed into CHAR, then all CHARs are connected, form the step of digital resource pack arrangement information B, and the step that whether belongs to structure Y by the digital resource bag that digital resource pack arrangement information B comes verification to belong to structure X.
Aforesaid a kind of digital resource packet structure verifying method wherein, is processed digital resource pack arrangement information A, and the detailed process that forms digital resource pack arrangement information B may further comprise the steps:
(1) resolution digital resource pack arrangement information A is handled as follows All Files and catalogue in this digital resource bag:
1. take out all or part of information in file or the directory attribute information;
2. with all or part of information arranged in sequence that takes out in this document or the catalogue;
3. the information processing after will arranging becomes CHAR;
(2) adopt any mark-hold that the CHAR of All Files and catalogue is connected, form digital resource pack arrangement information B;
(3) corresponding relation between record digital resource bag and the digital resource pack arrangement information B;
Aforesaid a kind of digital resource packet structure verifying method, wherein, the detailed process whether the digital resource bag that comes verification to belong to structure X by digital resource pack arrangement information B belongs to structure Y may further comprise the steps:
(a) obtain structure X information B according to the corresponding relation between digital resource bag and the digital resource pack arrangement information B, and obtain structure Y information B;
(b) comparative structure X information B and structure Y information B; Belong to structure X information B such as fruit structure Y information B, the digital resource bag that then belongs to structure X also belongs to structure Y; Otherwise the digital resource bag that belongs to structure X does not belong to structure Y.
Aforesaid a kind of digital resource packet structure verifying method wherein, is stored as the XML formatted file with digital resource pack arrangement information A.
Aforesaid a kind of digital resource packet structure verifying method, wherein, step is processed into CHAR by the mode of encrypting that the information after arranging is made a summary with it in 3..
Aforesaid a kind of digital resource packet structure verifying method, wherein, before encryption that the information after arranging is made a summary, first with its unified upper case or lower case letter that converts to.
Aforesaid a kind of digital resource packet structure verifying method in the step (2), before any mark-hold of employing is connected to the CHAR of All Files and catalogue, sorts to each CHAR first in alphabetical order.
Aforesaid a kind of digital resource packet structure verifying method, the process whether B of comparative structure Y information described in the step (b) belongs to structure X information B may further comprise the steps:
1. take mark-hold as separator structure X information B is disassembled into sectional information with structure Y information B;
2. take out among the structure Y information B after disassembling without a segment information relatively;
3. whether the segment information that takes out in 2. of determining step is identical with the content of a segment information among the digital resource pack arrangement X format information B; In this way, then 2.~3. repeating step continues relatively next segment information, until all segment informations among the structure Y form B that relatively finishes, structure Y information B belongs to structure X information B; As no, then structure Y information B does not belong to structure X information B.
Aforesaid a kind of digital resource packet structure verifying method, wherein, mark-hold is "-".
A kind of digital resource pack arrangement check system comprises with lower module:
Digital resource pack arrangement describing module is used for the detailed organizational form of digital resource pack arrangement is described, and forms digital resource pack arrangement information A;
Digital resource pack arrangement processing module is used for digital resource pack arrangement information A is processed, and digital resource bag File and catalogue are processed into CHAR, then all CHARs is connected, and forms digital resource pack arrangement information B;
Digital resource pack arrangement correction verification module, whether the digital resource bag that is used for coming one of verification to belong to structure X by digital resource pack arrangement information B belongs to structure Y.
The method of the invention and system, whether the digital resource bag that comes verification to meet structure X by comparative figures resource pack arrangement information B also meets structure Y, need not to obtain and travel through the practical structures of digital resource bag, i.e. the speed of digital resource pack arrangement information A, so verification is fast.And owing to all fixed length storages after each section partial content is made a summary, check logic is simple.
Embodiment
Below in conjunction with embodiment and accompanying drawing, describe the present invention.For the ease of the understanding of the present invention, at first term involved in the present invention and self-defining word are described below:
The digital resource bag: a digital resource can be processed to the file of multiple file types as required, such as txt, jpg, doc, zip etc.; There are all information of a digital resource of description that could be complete jointly in these files, and are indispensable; These files are got up just to have formed a digital resource bag according to the structure organization of digital resource bag.
Digital resource pack arrangement: be used for describing organizational form and the internal structure of digital resource bag All Files and catalogue.
Digital resource pack arrangement information A: the detailed organizational form to the digital resource pack arrangement is described, and comprises the attribute of All Files in the digital resource bag and the description of document directory structure.Wherein, file attribute comprises the content that all users such as file name, file type, file role, FileVersion are concerned about.The digital resource pack arrangement that adopts this mode to describe is called digital resource pack arrangement information A, is called for short structural information A, be stored in the database or directly be stored as the file of XML form or the file of extended formatting.
Core concept of the present invention is: digital resource pack arrangement information A is processed, the attribute information of digital resource bag File and catalogue is processed into CHAR, then all CHARs are connected, form digital resource pack arrangement information B.Whether the digital resource bag that comes verification to belong to structure X by digital resource pack arrangement information B belongs to structure Y.
Fig. 1 is the structured flowchart of digital resource pack arrangement check system preferred implementation of the present invention.This system comprises digital resource pack arrangement describing module 11, the digital resource pack arrangement message processing module 12 that is connected with digital resource pack arrangement describing module 11 and the digital resource pack arrangement correction verification module 13 that is connected with digital resource pack arrangement message processing module 12.
Digital resource pack arrangement describing module 11 is used for the detailed organizational form of digital resource pack arrangement is described, and forms digital resource pack arrangement information A, is stored in the database, perhaps directly is stored as the file of XML formatted file or extended formatting.
Digital resource pack arrangement message processing module 12 is used for digital resource pack arrangement information A is processed, and digital resource bag File and catalogue are processed into CHAR, then all CHARs is connected, and forms digital resource pack arrangement information B.
Whether the digital resource bag that digital resource pack arrangement correction verification module 13 is used for coming one of verification to belong to structure X by digital resource pack arrangement information B also belongs to structure Y.
Adopt system shown in Figure 1 to realize that the method for digital resource pack arrangement verification comprises two parts: a part is that digital resource pack arrangement information A is processed, and forms digital resource pack arrangement information B; Another part is whether the digital resource bag that verification belongs to structure X also belongs to structure Y.
Fig. 2 is the method flow diagram that digital resource pack arrangement information A is processed, and may further comprise the steps:
(1) resolution digital resource pack arrangement information A proceeds as follows All Files and catalogue in this digital resource bag:
1. take out all or part of information in file or the directory attribute information;
2. with all or part of information arranged in sequence that takes out in this document or the catalogue;
3. the information processing after will arranging becomes CHAR.
(2) adopt any mark-hold that the CHAR of All Files and catalogue is connected, form digital resource pack arrangement information B.Digital resource pack arrangement information B can be stored in the database, also can directly be stored as XML formatted file or extended formatting file.
(3) corresponding relation between record digital resource bag and the digital resource pack arrangement information B.
Fig. 3 is the method flow diagram whether digital resource bag that verification belongs to structure X also belongs to structure Y.The method is by judging whether structure Y information B belongs to structure X information B, and whether the digital resource bag that comes verification to belong to structure X also belongs to structure Y.Belong to structure X information B such as fruit structure Y information B, the digital resource bag that then belongs to structure X also belongs to structure Y; Otherwise the digital resource bag that belongs to structure X does not belong to structure Y.Concrete checking procedure is as follows:
(4) find digital resource pack arrangement X information B according to the corresponding relation between digital resource bag and the digital resource pack arrangement information B, and obtain digital resource pack arrangement Y information B;
(5) take mark-hold as separator the information B of structure X and Y is disassembled into sectional information;
(6) whether each segment information all is contained among the structure X information B among the structure Y information B after relatively disassembling, and namely whether each segment information is all identical with certain segment information content among the structure X information B among the structure Y information B; In this way, the digital resource bag that then belongs to structure X also belongs to structure Y; Otherwise the digital resource bag that belongs to structure X does not belong to structure Y.
Embodiment
In the present embodiment, the structure of digital resource bag M as shown in Figure 4, its structural information A has described bibliographic structure, file role, file extension, file type and the FileVersion of this digital resource bag, and it is stored as the XML file, its form is as follows:
<Package>
<Name>PackageName</Name>
<Label>PVERSION2009050804</Label>
<Version>4.0</Version>
<CreatedDate>2009-5-8</CreatedDate>
<FileList>
<Dir?Name=″cover″>
<File?Role=″CD_Cover″Ext=″jpg″Type=″JPEG″Version=″1.0″/>
</Dir>
<!--File: file;--
<!--Role: file role--〉
<!--Ext: file extension--〉
<!--Type: file type--〉
<!--Version: FileVersion--〉
<File?Role=″MD″Ext=″xml″Type=″XML″Version=″1.0″/>
<File?Role=″MD_Doc″Ext=″doc″Type=″Microsoft?Office?Word″
Version=″2003″/>
</FileList>
</Package>
Resolve above-mentioned XML file, obtain title and the attribute of each Dir (catalogue) and File (file) node, it is processed into CHAR.Wherein, the attribute of file and catalogue can be all properties among the structural information A, also can be the part attribute.The mode of encrypting by summary is processed into CHAR with it, before the encryption of making a summary, first with its unified upper case or lower case letter that converts to.Case sensitive because make a summary, and its titles such as file or catalogue are case-insensitives.In the present embodiment, whole attributes of catalogue and file in the selecting structure information A, and adopt the summary encryption that it is processed into CHAR, detailed process is as follows:
(1) the MD5 value of structure Dir node, formation rule is carried out MD5 digest in the present embodiment after its Name value is converted to capitalization.The value of the Name attribute of the Dir node in the present embodiment is " cover ", and the information that " COVER " that is converted to capitalization carried out after the MD5 digest is: " 901B03BA0232D92ACCB3426E9ACDDFEE ".
(2) the MD5 value of structure File node, formation rule is for to organize the attribute of each File node in the present embodiment according to the mode of " Role attribute _ Ext attribute _ Version attribute _ Type attribute _ Dir directory name ".Wherein, organizational form can freely be selected by the user, but should be identical to the organizational form of each digital resource bag.Then carry out again md5 encryption after respectively the content of organizing being converted into first capitalization.
The MD5 value of 3 File node is constructed as follows in the present embodiment:
A: the content that first File node organization is good is " CD_Cover_jpg_1.0_JPEG_cover ", is converted into the information that capitalization carries out obtaining after the MD5 digest to be: " E11B902E0F92B4EFA0068C02982A1537 ".
B: second good content of File node organization is " MD_xml_1.0_XML_ ", if certain attribute does not exist in the organizational form of describing in the step (2), then this property location is empty.Being converted into the information that capitalization carries out obtaining after the MD5 digest is: " 27FD3C808DE57746CE011A2260375631 ".
C: the 3rd content that the File node organization is good is " MD_Doc_doc_2003_Microsoft OfficeWord_ ", is converted into the information that capitalization carries out obtaining after the MD5 digest to be: " 25FB05BB106D3FE4ED1D7E4027189E3C ".
(3) will encrypt good character string and sort, and connect with symbol "-", form the structural information B of digital resource bag M.The purpose that to encrypt good character string sorting herein is to improve efficient relatively relatively the time for the follow-up structure of carrying out.Can arrange according to random order, in the present embodiment, the order of the letter or number that comprises according to character string sorts from small to large, as follows: " 25FB05BB106D3FE4ED1D7E4027189E3C-27FD3C808DE57746CE011A2 260375631-901B03BA0232D92ACCB3426E9ACDDFEE-E11B902E0F92B 4EFA0068C02982A1537 " is designated as structure X.Set up the corresponding relation between digital resource bag M and the structure X, be stored in the database.
Adopt the summary cipher mode, the information processings such as catalogue and file attribute can be become on the one hand the character string of fixed length; Because the information after encrypting is the combination of letter and number, contain the junction symbol between the character string after therefore having avoided encrypting in the information on the other hand, such as "-", thereby cause the possibility of ambiguity.
Digital resource pack arrangement Y information A is:
<Package>
<Name>PackageNameY</Name>
<Label>PVERSION2009050805</Label>
<Version>4.0</Version>
<CreatedDate>2009-5-18</CreatedDate>
<FileList>
<Dir?Name=″cover″>
<File?Role=″CD_Cover″Ext=″jpg″Type=″JPEG″Version=″1.0″/>
</Dir>
<File?Role=″MD_Doc″Ext=″doc″Type=″Microsoft?Office?Word″
Version=″2003″/>
</FileList>
</Package>
Adopt the mode identical with aforesaid way, generating digital resource pack arrangement Y information B, as follows: " 25FB05BB106D3FE4ED1D7E4027189E3C-901B03BA0232D92ACCB3426 E9ACDDFEE-E11B902E0F92B4EFA0068C02982A1537 ".
Judge whether the digital resource bag M that belongs to structure X also satisfies structure Y, only structure Y information B and structure X information B need to be compared, and belongs to structure X information B such as fruit structure Y information B, the digital resource bag M that then belongs to structure X also meets structure Y simultaneously.The comparison procedure of structural information B may further comprise the steps:
(1) with symbol "-" structural information B is cut apart.Structure X information B is divided into:
“25FB05BB106D3FE4ED1D7E4027189E3C”、
“27FD3C808DE57746CE011A2260375631”、
" 901B03BA0232D92ACCB3426E9ACDDFEE " and
“E11B902E0F92B4EFA0068C02982A1537”。
Structure Y information B is divided into: " 25FB05BB106D3FE4ED1D7E4027189E3C ", " 901B03BA0232D92ACCB3426E9ACDDFEE " and " E11B902E0F92B4EFA0068C02982A1537 ".
(2) cutting apart good content with every section mates one by one.
At first, all sections content after the first paragraph content " 25FB05BB106D3FE4ED1D7E4027189E3C " cut apart of selecting structure Y information B is cut apart with structure X information B compares in order.In the present embodiment, first paragraph content lucky and that structure X information B is cut apart is complementary.
Then, next section content " 901B03BA0232D92ACCB3426E9ACDDFEE " of cutting apart of selecting structure Y information B directly and " 27FD3C808DE57746CE011A2260375631 " among the structure X information B mate.Need not be from the beginning with structure X information B in " 25FB05BB106D3FE4ED1D7E4027189E3C " reason of mating be structural information B when generating through having sorted, so directly next section content coupling on the last time coupling is just passable." 901B03BA0232D92ACCB3426E9ACDDFEE " and " 27FD3C808DE57746CE011A2260375631 " obviously do not mate in the present embodiment.Continuation compares " 901B03BA0232D92ACCB3426E9ACDDFEE " of structure Y information B and next section content of structure X information B.Next section content of structure X information B is exactly " 901B03BA0232D92ACCB3426E9ACDDFEE ", and obviously the match is successful.
At last, the section content after next section content " E11B902E0F92B4EFA0068C02982A1537 " of structure Y information B cut apart with structure X information B is mated, and also can successfully find occurrence.So far, each section content among the structure Y information B can both find the section that matches in structure X information B.
Can find out that by top coupling every section content among the structure Y all is contained among the structure X, so decision structure Y belongs to structure X, also meet structure Y so meet the digital resource bag M of structure X.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technology thereof, then the present invention also is intended to comprise these changes and modification interior.