CN103440338A - Method and system for estimating read-write performance of packed files - Google Patents

Method and system for estimating read-write performance of packed files Download PDF

Info

Publication number
CN103440338A
CN103440338A CN2013104052621A CN201310405262A CN103440338A CN 103440338 A CN103440338 A CN 103440338A CN 2013104052621 A CN2013104052621 A CN 2013104052621A CN 201310405262 A CN201310405262 A CN 201310405262A CN 103440338 A CN103440338 A CN 103440338A
Authority
CN
China
Prior art keywords
file
identification
packaging
file identification
sequential
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.)
Granted
Application number
CN2013104052621A
Other languages
Chinese (zh)
Other versions
CN103440338B (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.)
Chengdu Xishanju Interactive Entertainment Technology Co Ltd
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Online Game Technology Co Ltd
Chengdu Xishanju Interactive Entertainment Technology 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 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
Priority claimed from CN201310405262.1A external-priority 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 method and a system for estimating the read-write performance of a packed files. The read-write performance of the packed files is judged according to file identifications in sequential files, so that the calculation is objective and cannot be affected by the performance of a computer. F; furthermore, the whole method is simple and feasible, and; the time can be shortened; as the file identifications are generated in advance, a calculation result is high in accuracy.

Description

A kind of method and system of assessing the packaging file readwrite performance
Technical field
The present invention relates to the assessment of file read-write performance, particularly a kind of method and system of assessing the packaging file readwrite performance.
Background technology
background technology
Existing software client resource adopts the packing manner storage usually, thereby obtains that transmission is convenient, resource is maintained secrecy and the advantage such as fast access speed more.In packaging file, can store a plurality of package-in files, yet these package-in files lack effective method at the operating readwrite performance of practical programs, it be assessed, thereby can't know the reading efficiency of packaging file.If packaging file is after repeatedly upgrading, its reading efficiency just can't be known more.For this reason, traditional approach reads All Files in packaging file time by calculating is as the mode of assessment reading efficiency, but while using the computing machine of different performance to be assessed, the time result of calculating is inevitable different, obviously the fairness of impact judgement.And, thisly read the mode of All Files in packaging file and quite lose time, because need to press out the whole solutions of the file in all packaging files.For this reason, need a kind of new assessment mode.
Summary of the invention
For addressing the above problem, the object of the present invention is to provide a kind of method and system of assessing the packaging file readwrite performance, assess the readwrite performance of packaging file by file identification, it is objective and accurate to make to assess.
The present invention solves the technical scheme that its problem adopts:
The present invention adopts a kind of method and system of assessing the packaging file readwrite performance, at first generate a sequential file, this sequential file includes the file identification described packaging file is described according to certain logical order, because some sign in file identification possibly can't find in packaging file, some signs or repetition, therefore, the file identification that need to comprise sequential file is arranged, when arranging, delete the file identification that those can't find in packaging file, delete the file identification of those repetitions simultaneously, when deleting the file identification repeated, in deleted file sign sequence after sign.
After the file identification comprised in sequential file is arranged, need to assess the readwrite performance of packaging file, include many files in packaging file, file reading identifies successively, find out corresponding file simultaneously in packaging file, if the off-set value of current found out file in packaging file equals off-set value and the big or small sum thereof of the previous file found out in packaging file, illustrate that the corresponding file identification of current file is for desirable sign; For first file identification read, judge by the mode that initial value is set whether it is desirable sign, if the off-set value of the corresponding file of this file identification in packaging file equals initial value, illustrate that it is desirable sign.File identification wherein can be unduplicated filename, file relative path, file absolute path or file path cryptographic hash etc.
Finally, calculate the ratio that desirable sign accounts for sequential file All Files sign, weigh the readwrite performance of packaging file with this ratio.
The invention has the beneficial effects as follows:
The present invention adopts a kind of method and system of assessing the packaging file readwrite performance, by the readwrite performance of the judgement of the file identification in sequential file packaging file, more objective during calculating, can not be subject to the impact of computing power; Simultaneously, whole method is simple, relatively saves time, and because file identification is to generate in advance, therefore, the accuracy of result of calculation is also higher.
The accompanying drawing explanation
Below in conjunction with accompanying drawing and example, the invention will be further described.
Fig. 1 is the process flow diagram of the method for the invention.
Embodiment
Embodiment 1:
Process flow diagram with reference to the method for the invention shown in Fig. 1, the invention provides a kind of method of assessing the packaging file readwrite performance, at first spanned file sequence, this file sequence has comprised the file identification described packaging file is described according to certain logical order, these file identifications may generate by program, also can initiatively be inputted by the programmer, or read the logic generation by the HOOK program.
Because the file identification generated may include repetition or unnecessary, the so-called repetition, refer to that same file identification is more than one, so-called unnecessary, refers to that file identification can't find in packaging file.Therefore, need to the file identification generated be arranged the file identification of Delete superfluous and repetition.For unnecessary file identification, in the scanning packaging file, the file identification of All Files, be identified at the All Files comprised in the file sequence in the file identification scanned and searched, if do not find, illustrate that it does not lie in packaging file, by its deletion; When deleting the file identification repeated, because file identification is to arrange according to certain reading order, therefore, need to delete the file identification of sequence in back, and be retained in the file identification of front, and only retain one.When the file identification of Delete superfluous and repetition, optimum order is first to delete the file identification of repetition, and the workload of minimizing postorder that like this can be preferential, save time.
After file identification in the file sequence is arranged, need by the performance of these file identification assessment packaging files.Read successively the file identification in sequential file, search read file identification corresponding file in packaging file simultaneously, if the off-set value of the current file found equates with off-set value and the big or small sum thereof of the previous file found, record the corresponding file identification of this current file for desirable sign.Owing to reading first file identification, there is no so-called previous file sign, therefore, need to judge whether first file identification is desirable sign by initial value is set, if the off-set value of the corresponding file of first file identification equals initial value, illustrate that it is desirable sign.When specific implementation, two counters can be set, counter one is used to desirable sign counting, the off-set value sum big or small with it of the current file that counter two finds for record, for counter two arranges initial value, read successively the file identification in sequential file, when reading first file identification, search the file of this file identification correspondence in packaging file, if the off-set value of the file found in packaging file equals initial value, illustrate that it is desirable sign, counter one adds 1, simultaneously, the value of counter two is set to off-set value and the big or small sum thereof of first file identification institute respective file in packaging file, afterwards, read second file identification, search the file of this file identification in packaging file, if the off-set value of the file found equates with the value of counter two, illustrate that second file identification is for desirable sign, counter one adds 1 again, off-set value and big or small sum that the value that counter two is set simultaneously is second file identification institute respective file, the like, until that all file identifications read is complete.
Finally, the number of calculating desirable sign accounts for the ratio of All Files sign in the file sequence, and ratio value is between 0 to 1, and this numerical value reacted the readwrite performance of packaging file, and data are higher, show that readwrite performance is better.
For file identification, can select unduplicated filename, file relative path, file absolute path or file path cryptographic hash etc., as long as the sign of different files is unique.
The invention provides a kind of system of assessing the packaging file readwrite performance, comprising:
For the device of formation sequence file, described sequential file includes the file identification described packaging file is described according to certain logical order;
For deleting the file identification that described sequential file can't find in packaging file, delete the device of the file identification repeated in sequential file simultaneously, wherein, during the file identification that repeats in deleting sequential file, delete sequence after file identification, retain the file identification the preceding that sorts;
For reading successively the file identification of sequential file, search read file identification corresponding file in packaging file simultaneously, if the off-set value of the current file found in packaging file is with the previous file found, the off-set value in packaging file and big or small sum thereof equate, record the device of the corresponding file identification of this current file for desirable sign, wherein, for first read file identification, judge by the mode that initial value is set whether first read file identification is desirable sign, if the off-set value of the corresponding file of first file identification read is identical with initial value, record it for desirable sign,
Account for the device of the ratio of sequential file All Files sign for calculating desirable sign.
Wherein, All Files in described packaging file is scanned, obtain the file identification of All Files, contrasted by the file identification by sequential file and the file identification obtained, to delete the file identification that can't find in described sequential file in packaging file.
Described system adopts the method identical with the above to be assessed packaging file, concrete with reference to content described in above method.
Embodiment 2:
The present embodiment describes the method in embodiment 1 by object lesson, and wherein the file sequence is as follows:
a.txt
b.txt
c.txt
Include successively and include three file identifications in this file sequence, be followed successively by a.txt, b.txt, c.txt.The file comprised in packaging file is as follows:
File identification Off-set value File size
a.txt 0 100
b.txt 100 200
d.txt 300 10
c.txt 310 90
e.txt 400 100
Wherein, off-set value has recorded the offset address of respective file in packaging file, and file size has shown the size of this file.
After file identification in the file sequence is arranged, file identification is followed successively by a.txt, b.txt, c.txt, because wherein there is no repetition and unnecessary file identification.
The initial value of counter two is set to 0, and generally, when packaging file is stored, the off-set value of its first file is 0, therefore, when the initial value of counter two is set, should carry out initialization according to the off-set value of first file in packaging file.
File identification in the file reading sequence successively, first reading is a.txt, finds that its off-set value is identical with initial value, illustrate that it is desirable sign, counter one adds 1, and the value of counter two is set to the off-set value sum big or small with it of respective file, i.e. " 0 "+" 100 "; Afterwards, read second file identification b.txt, its off-set value is 100, identical with the value in counter two, illustrates that it is desirable sign, and counter one adds 1 again, and the value of counter two is set to " 100 "+" 200 " simultaneously; Read the 3rd file identification c.txt, its off-set value is 310, unequal with 300 numerical value in counter two, illustrates that it is not desirable sign, and the value of counter two is set to " 310 "+" 90 " simultaneously; So far, all file identifications read complete, and the number of calculating desirable sign accounts for the ratio of All Files sign, and 2/3, therefore " assessment result "=2/3=0.66.
The above, be preferred embodiment of the present invention, and the present invention is not limited to above-mentioned embodiment, as long as it reaches technique effect of the present invention with identical means, all should belong to protection scope of the present invention.

Claims (10)

1. a method of assessing the packaging file readwrite performance, is characterized in that, comprising:
The formation sequence file, described sequential file includes the file identification described packaging file is described according to certain logical order;
Delete the file identification that can't find in described sequential file in packaging file, delete the file identification repeated in sequential file simultaneously;
Read successively the file identification in sequential file, search read file identification corresponding file in packaging file simultaneously, if the off-set value of the current file found in packaging file is with the previous file found, the off-set value in packaging file and big or small sum thereof equate, record the corresponding file identification of this current file for desirable sign; And
Calculate the ratio that desirable sign accounts for All Files sign in sequential file.
2. method according to claim 1, it is characterized in that, All Files in described packaging file is scanned, obtain the file identification of All Files, by the file identification by sequential file and the file identification obtained, contrasted, to delete the file identification that can't find in described sequential file in packaging file.
3. method according to claim 1, is characterized in that, during the file identification that repeats in described deletion sequential file, delete sequence after file identification, retain the file identification the preceding that sorts.
4. method according to claim 1, it is characterized in that, during the described file identification read successively in sequential file, for first read file identification, judge by the mode that initial value is set whether first read file identification is desirable sign, if the off-set value of the corresponding file of first file identification read is identical with initial value, record it for desirable sign.
5. according to the arbitrary described method of claim 1 to 4, it is characterized in that, described file identification is unduplicated filename, file relative path, file absolute path or file path cryptographic hash.
6. a system of assessing the packaging file readwrite performance, is characterized in that, comprising:
For the device of formation sequence file, described sequential file includes the file identification described packaging file is described according to certain logical order;
For deleting the file identification that described sequential file can't find in packaging file, delete the device of the file identification repeated in sequential file simultaneously;
For reading successively the file identification of sequential file, search read file identification corresponding file in packaging file simultaneously, if the off-set value of the current file found in packaging file is with the previous file found, the off-set value in packaging file and big or small sum thereof equate, record the device of the corresponding file identification of this current file for desirable sign; And
Account for the device of the ratio of sequential file All Files sign for calculating desirable sign.
7. system according to claim 6, it is characterized in that, All Files in described packaging file is scanned, obtain the file identification of All Files, by the file identification by sequential file and the file identification obtained, contrasted, to delete the file identification that can't find in described sequential file in packaging file.
8. system according to claim 6, is characterized in that, during the file identification that repeats in described deletion sequential file, delete sequence after file identification, retain the file identification the preceding that sorts.
9. system according to claim 6, it is characterized in that, during the described file identification read successively in sequential file, for first read file identification, judge by the mode that initial value is set whether first read file identification is desirable sign, if the off-set value of the corresponding file of first file identification read is identical with initial value, record it for desirable sign.
10. according to the arbitrary described system of claim 6 to 9, it is characterized in that, described file identification is unduplicated filename, 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 true CN103440338A (en) 2013-12-11
CN103440338B 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
赵铁柱: "分布式文件系统性能建模及应用研究", 《中国博士学位论文全文数据库 信息科技辑》 *

Similar Documents

Publication Publication Date Title
CN108932257B (en) Multi-dimensional data query method and device
CN104298680B (en) Data statistical approach and data statistics device
CN102682108B (en) Row and line mixed database storage method
CN103699585A (en) Methods, devices and systems for file metadata storage and file recovery
CN103345496A (en) Multimedia information searching method and system
CN102486748B (en) Method and device for performance test
CN104424256A (en) Method and device for generating Bloom filter
CN105447035A (en) Data scanning method and apparatus
CN102169491A (en) Dynamic detection method for multi-data concentrated and repeated records
CN109460406A (en) A kind of data processing method and device
CN103440197B (en) A kind of method automatically generating difference test report based on contrast test
CN104133836B (en) A kind of method and device realizing change Data Detection
CN105426314A (en) Process mapping method for FPGA memory
CN104714983B (en) The generation method and device of distributed index
CN105487953A (en) Bus performance analysis method and apparatus
US20160055211A1 (en) Apparatus and method for memory storage and analytic execution of time series data
CN110019357B (en) Database query script generation method and device
CN103440338A (en) Method and system for estimating read-write performance of packed files
CN108647243B (en) Industrial big data storage method based on time series
CN104750846A (en) Method and device for finding substring
CN110889017B (en) Retrieval method and terminal for information encrypted through base64
CN103440338B (en) A kind of method and system assessing packaging file readwrite performance
CN105279103A (en) Data management method and apparatus
CN104598618A (en) Cloud platform incomplete large data filling method based on complete compatible classes
CN104424238B (en) A kind of method, apparatus that mass file generates

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
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.

CP03 Change of name, title or address