CN103440338B - A kind of method and system assessing packaging file readwrite performance - Google Patents

A kind of method and system assessing packaging file readwrite performance Download PDF

Info

Publication number
CN103440338B
CN103440338B CN201310405262.1A CN201310405262A CN103440338B CN 103440338 B CN103440338 B CN 103440338B CN 201310405262 A CN201310405262 A CN 201310405262A CN 103440338 B CN103440338 B CN 103440338B
Authority
CN
China
Prior art keywords
file
identification
packaging
sequential
file identification
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.)
Active
Application number
CN201310405262.1A
Other languages
Chinese (zh)
Other versions
CN103440338A (en
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.)
Zhuhai Kingsoft Online Game Technology Co Ltd
Chengdu Xishanju Interactive Entertainment Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Online Game Technology Co Ltd
Chengdu Xishanju Interactive Entertainment Technology Co Ltd
Filing date
Publication date
Application filed by Zhuhai Kingsoft Online Game Technology Co Ltd, Chengdu Xishanju Interactive Entertainment Technology Co Ltd filed Critical Zhuhai Kingsoft Online Game Technology Co Ltd
Priority to CN201310405262.1A priority Critical patent/CN103440338B/en
Publication of CN103440338A publication Critical patent/CN103440338A/en
Application granted granted Critical
Publication of CN103440338B publication Critical patent/CN103440338B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and system assessing packaging file readwrite performance, judged the readwrite performance of packaging file by the file identification in sequential file, more objective during calculating, will not be affected by computing power;Meanwhile, whole method is simple, relatively time-consuming, and owing to file identification is generated in advance, therefore, the accuracy of result of calculation is the highest.

Description

A kind of method and system assessing packaging file readwrite performance
Technical field
The present invention relates to the assessment of file read-write performance, a kind of method assessing packaging file readwrite performance and be System.
Background technology
Existing software client resource generally uses packing manner to store, thus obtain that transmission is convenient, resource secrecy and The more quickly advantage such as access speed.In packaging file, multiple package-in file can be stored, but these package-in files are in reality The operating readwrite performance of program then lacks effective method and is estimated it, thus cannot know the reading effect of packaging file Rate.If packaging file is after repeatedly updating, its reading efficiency the most more cannot be known.To this end, traditional approach is by calculating In reading packaging file, the time of All Files is as the mode of assessment reading efficiency, but uses the computer of different performance to carry out During assessment, the time result of calculating is inevitable different, hence it is evident that the fairness that impact judges.And, institute in this reading packaging file Documentary mode is quite lost time, since it is desired that the file all solutions in all packaging files is pressed out.For this reason, it may be necessary to A kind of new assessment mode.
Summary of the invention
For solving the problems referred to above, it is an object of the invention to provide a kind of method assessing packaging file readwrite performance and be System, by the readwrite performance of file identification assessment packaging file, makes assessment objective and accurate.
The present invention solves its problem and be the technical scheme is that
The present invention uses a kind of method and system assessing packaging file readwrite performance, firstly generates a sequential file, This sequential file includes the file identification being described described packaging file according to certain logical order, due to files-designated Some mark in knowledge possibly cannot find in packaging file, some marks or repeat, accordingly, it would be desirable to sequence The file identification that file is comprised arranges, and when arranging, deletes those files-designated that cannot find in packaging file Know, delete those file identifications repeated simultaneously, when deleting the file identification repeated, deletion file identification sorts posterior Mark.
After arranging the file identification included in sequential file, then the readwrite performance of needs assessment packaging file, beats APMB package includes many files, is successively read file identification, in packaging file, find out the file of correspondence simultaneously, if The file currently found out deviant in packaging file is equal to inclined in packaging file of the previous file found out Shifting value and size sum thereof, then explanation file identification corresponding to current file is preferable mark;For first literary composition read Part identifies, and judges whether it is preferable mark by the way of arranging initial value, if the file corresponding to this file identification exists Deviant in packaging file is equal to initial value, illustrates that it is preferable mark.File identification therein can be unduplicated literary composition Part name, file relative path, file absolute path or file path cryptographic Hash etc..
Finally, calculate ideal mark and account for the ratio of sequential file All Files mark, weigh packaging file with this ratio Readwrite performance.
The invention has the beneficial effects as follows:
The present invention uses a kind of method and system assessing packaging file readwrite performance, by the files-designated in sequential file Know the readwrite performance judging packaging file, more objective during calculating, will not be affected by computing power;Meanwhile, whole side Method is simple, relatively time-consuming, and owing to file identification is generated in advance, therefore, the accuracy of result of calculation also compares High.
Accompanying drawing explanation
The invention will be further described with example below in conjunction with the accompanying drawings.
Fig. 1 is the flow chart of the method for the invention.
Detailed description of the invention
Embodiment 1:
With reference to the flow chart of the method for the invention shown in Fig. 1, the invention provides a kind of assessment packaging file read-write property The method of energy, firstly generates sequential file, and this sequential file contains and enters described packaging file according to certain logical order The file identification of line description, these file identifications may pass through Program Generating, it is also possible to is actively entered by programmer, or passes through HOOK program reads logic and generates.
File identification owing to generating may include repetition or unnecessary, so-called repetition, refers to same files-designated Know more than one, so-called unnecessary, refer to that file identification cannot find in packaging file.Accordingly, it would be desirable to the files-designated generated Know and arrange, delete file identification that is unnecessary and that repeat.For unnecessary file identification, All Files in scanning packaging file File identification, by included in sequential file All Files identify make a look up in the file identification scanned, if Do not find, then illustrate that it does not lies in packaging file, be deleted;When deleting the file identification repeated, due to file Mark is according to certain reading order arrangement, sorts at file identification below accordingly, it would be desirable to delete, and before being retained in File identification, and only retain one.When deleting the file identification of unnecessary and repetition, optimum order is first to delete to repeat File identification, the workload of minimizing postorder that so can be preferential, time-consuming.
After file identification in sequential file is arranged, then need the property by these file identifications assessment packaging file Energy.The file identification being successively read in sequential file, searches the file identification that read corresponding in packaging file simultaneously File, if the deviant of the deviant of the current file found and the previous file found and size sum phase thereof Deng, then recording the file identification corresponding to this current file is ideal mark.During owing to reading first file identification, there is no institute The previous file mark of meaning, accordingly, it would be desirable to judge whether first file identification is preferable mark by arranging initial value, if The deviant of the file corresponding to first file identification is equal to initial value, then illustrate that it is preferable mark.When implementing, Two enumerators can be set, enumerator one for for ideal mark counting, enumerator two for record found current The deviant of file and its size sum, arrange initial value for enumerator two, the file identification being successively read in sequential file, when When reading first file identification, search the file that this file identification is corresponding in packaging file, if the file found exists Deviant in packaging file is equal to initial value, then illustrate that it is preferable mark, then enumerator one adds 1, meanwhile, by enumerator two Value be set to the deviant in packaging file of the file corresponding to first file identification and size sum thereof, afterwards, read Second file identification, searches this file identification file in packaging file, if the deviant of the file found and meter The value of number device two is equal, then second file identification of explanation is preferable mark, and enumerator one adds 1 again, arranges enumerator simultaneously The value of two is deviant and the size sum of file corresponding to second file identification, the like, until all of files-designated Recognition takes complete.
Finally, the number calculating ideal mark accounts for the ratio of the mark of All Files in sequential file, ratio value 0 to 1 it Between, this numerical value has i.e. reacted the readwrite performance of packaging file, and data are the highest, then show that readwrite performance is the best.
For file identification, unduplicated filename, file relative path, file absolute path or file road can be selected Footpath cryptographic Hash etc., as long as the mark of different file is unique.
The invention provides a kind of system assessing packaging file readwrite performance, including:
For the device of formation sequence file, described sequential file includes according to certain logical order described packing The file identification that file is described;
For deleting the file identification that cannot find in packaging file in described sequential file, delete sequence literary composition simultaneously The device of the file identification repeated in part, wherein, during the file identification repeated in deleting sequential file, deletes sequence posterior File identification, retains the preceding file identification that sorts;
For the file identification being successively read in sequential file, search the file identification read in packaging file simultaneously Corresponding file, if the deviant that the current file found is in packaging file is being beaten with the previous file found Deviant and size sum thereof in APMB package are equal, then recording the file identification corresponding to this current file is preferable mark Device, wherein, for first file identification read, judges read first literary composition by the way of arranging initial value Part identifies whether to identify into ideal, if the deviant of read first file corresponding to file identification and initial value phase With, then record it for ideal mark;
The device of the ratio of All Files mark in sequential file is accounted for for calculating preferable mark.
Wherein, the All Files in described packaging file is scanned, obtains the file identification of All Files, by inciting somebody to action File identification in sequential file contrasts with acquired file identification, cannot pack to delete in described sequential file The file identification found in file.
Described system uses the method identical with the above to be estimated packaging file, referring in particular in above method Described content.
Embodiment 2:
Method in embodiment 1 is illustrated by the present embodiment by object lesson, and wherein sequential file is as follows:
This sequential file includes three file identifications successively, is followed successively by a.txt, b.txt, c.txt.In packaging file The file comprised is as follows:
Wherein, deviant have recorded respective file offset address in packaging file, and file size indicates this file Size.
After arranging the file identification in sequential file, file identification is followed successively by a.txt, b.txt, c.txt, because of it In there is no repetition and unnecessary file identification.
The initial value of enumerator two is set to 0, and typically when packaging file stores, the deviant of its first file is 0, therefore, when arranging the initial value of enumerator two, it should at the beginning of carrying out according to the deviant of first file in packaging file Beginningization.
The file identification being successively read in sequential file, first of reading is a.txt, finds its deviant and initial value Identical, illustrate that it is preferable mark, enumerator one adds 1, by big with it for the deviant that the value of enumerator two is set to respective file Little sum, i.e. " 0 "+" 100 ";Afterwards, reading second file identification b.txt, its deviant is in 100, with enumerator two Be worth identical, illustrate that it is preferable mark, then enumerator one adds 1 again, the value of enumerator two is set to simultaneously " 100 "+ “200”;Reading the 3rd file identification c.txt, its deviant is that in 310, with enumerator two, the numerical value of 300 is unequal, explanation It is not preferable mark, and the value of enumerator two is set to " 310 "+" 90 " simultaneously;So far, all of file identification has read Finish, then the number calculating ideal mark accounts for the ratio of All Files mark, i.e. 2/3, therefore " assessment result "=2/3=0.66.
The above, simply presently preferred embodiments of the present invention, the invention is not limited in above-mentioned embodiment, as long as It reaches the technique effect of the present invention with identical means, all should belong to protection scope of the present invention.

Claims (10)

1. the method assessing packaging file readwrite performance, it is characterised in that including:
Formation sequence file, described sequential file includes and is described described packaging file according to certain logical order File identification;
Delete the file identification that cannot find in packaging file in described sequential file, delete in sequential file simultaneously and repeat File identification;
The file identification being successively read in sequential file, searches the file identification that read corresponding in packaging file simultaneously File, if the deviant that the current file found is in packaging file and the previous file found are in packaging file Deviant and size sum equal, then record file identification corresponding to this current file for ideal mark;And
Calculate ideal mark and account for the ratio of All Files mark in sequential file.
Method the most according to claim 1, it is characterised in that the All Files in described packaging file is scanned, Obtain the file identification of All Files, by the file identification in sequential file is contrasted with acquired file identification, To delete the file identification that cannot find in packaging file in described sequential file.
Method the most according to claim 1, it is characterised in that during the file identification repeated in described deletion sequential file, Delete the posterior file identification that sorts, retain the preceding file identification that sorts.
Method the most according to claim 1, it is characterised in that described in be successively read in sequential file file identification time, For first file identification read, by the way of initial value is set, whether judge read first file identification Identify for ideal, if the deviant of read first file corresponding to file identification is identical with initial value, then record it Identify for ideal.
5. according to the arbitrary described method of Claims 1-4, it is characterised in that described file identification be unduplicated filename, File relative path, file absolute path or file path cryptographic Hash.
6. the system assessing packaging file readwrite performance, it is characterised in that including:
For the device of formation sequence file, described sequential file includes according to certain logical order described packaging file The file identification being described;
For deleting the file identification that cannot find in packaging file in described sequential file, delete in sequential file simultaneously The device of the file identification repeated;
For the file identification being successively read in sequential file, search the file identification read institute in packaging file right simultaneously The file answered, if the deviant that the current file found is in packaging file and the previous file found are at packing literary composition Deviant and size sum thereof in part are equal, then record the dress that the file identification corresponding to this current file is preferable mark Put;And
The device of the ratio of All Files mark in sequential file is accounted for for calculating preferable mark.
System the most according to claim 6, it is characterised in that the All Files in described packaging file is scanned, Obtain the file identification of All Files, by the file identification in sequential file is contrasted with acquired file identification, To delete the file identification that cannot find in packaging file in described sequential file.
System the most according to claim 6, it is characterised in that during the file identification repeated in described deletion sequential file, Delete the posterior file identification that sorts, retain the preceding file identification that sorts.
System the most according to claim 6, it is characterised in that described in be successively read in sequential file file identification time, For first file identification read, by the way of initial value is set, whether judge read first file identification Identify for ideal, if the deviant of read first file corresponding to file identification is identical with initial value, then record it Identify for ideal.
10. according to the arbitrary described system of claim 6 to 9, it is characterised in that described file identification is unduplicated file Name, file relative path, file absolute path or file path cryptographic Hash.
CN201310405262.1A 2013-09-06 A kind of method and system assessing packaging file readwrite performance Active CN103440338B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310405262.1A CN103440338B (en) 2013-09-06 A kind of method and system assessing packaging file readwrite performance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310405262.1A CN103440338B (en) 2013-09-06 A kind of method and system assessing packaging file readwrite performance

Publications (2)

Publication Number Publication Date
CN103440338A CN103440338A (en) 2013-12-11
CN103440338B true CN103440338B (en) 2016-11-30

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7424482B2 (en) * 2004-04-26 2008-09-09 Storwize Inc. Method and system for compression of data for block mode access storage
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7424482B2 (en) * 2004-04-26 2008-09-09 Storwize Inc. Method and system for compression of data for block mode access storage
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
分布式文件系统性能建模及应用研究;赵铁柱;《中国博士学位论文全文数据库 信息科技辑》;20111215(第12期);论文正文第9-119页 *

Similar Documents

Publication Publication Date Title
KR102098548B1 (en) Method and device for verifying block data in blockchain
CN103699585B (en) Methods, devices and systems for file metadata storage and file recovery
CN104700033A (en) Virus detection method and virus detection device
CN102243699A (en) Malicious code detection method and system
CN104317823B (en) A kind of method utilizing data fingerprint to carry out Data Detection
CN104462873A (en) Picture processing method and picture processing device
CN104298687B (en) A kind of hash partition management method and device
Bartoletti et al. A journey into bitcoin metadata
CN107665306A (en) A kind of method, apparatus, client and server for detecting illegal file injection
CN104978521A (en) Method and system for realizing malicious code marking
CN104346384A (en) Method and device for processing small files
CN106250319A (en) Static code scanning result treating method and apparatus
CN101763394A (en) Method for searching secret-related files in computer system
CN102169491A (en) Dynamic detection method for multi-data concentrated and repeated records
CN105225192A (en) A kind of based on detailed reconciliation auditing method and system
CN105447035A (en) Data scanning method and apparatus
CN109460406A (en) A kind of data processing method and device
CN107644033B (en) Method and equipment for querying data in non-relational database
CN110119947B (en) Method and apparatus for shared workload proof computing power generation of symbiotic blockchains
CN103440338B (en) A kind of method and system assessing packaging file readwrite performance
Jones et al. A method and implementation for the empirical study of deleted file persistence in digital devices and media
CN106649566B (en) A kind of sequence number generation method and device
CN107169057A (en) The detection method and device of a kind of repetitive picture
CN106155866A (en) A kind of method and device of monitoring CPU core frequency
CN110889017B (en) Retrieval method and terminal for information encrypted through base64

Legal Events

Date Code Title Description
CP03 Change of name, title or address

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Patentee after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Patentee after: CHENGDU XISHANJU INTERACTIVE ENTERTAINMENT TECHNOLOGY Co.,Ltd.

Address before: 519000 Jinshan software building, 8 Lanshan lane, Jida Jingshan Hill Road, Zhuhai, Guangdong

Patentee before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Patentee before: CHENGDU XISHANJU INTERACTIVE ENTERTAINMENT TECHNOLOGY Co.,Ltd.