CN103294784B - A kind of file packing method based on Hook technology and system - Google Patents

A kind of file packing method based on Hook technology and system Download PDF

Info

Publication number
CN103294784B
CN103294784B CN201310183949.5A CN201310183949A CN103294784B CN 103294784 B CN103294784 B CN 103294784B CN 201310183949 A CN201310183949 A CN 201310183949A CN 103294784 B CN103294784 B CN 103294784B
Authority
CN
China
Prior art keywords
file
package
filename
sequence list
access sequence
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
CN201310183949.5A
Other languages
Chinese (zh)
Other versions
CN103294784A (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 CN201310183949.5A priority Critical patent/CN103294784B/en
Publication of CN103294784A publication Critical patent/CN103294784A/en
Application granted granted Critical
Publication of CN103294784B publication Critical patent/CN103294784B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a kind of file packing method based on Hook technology and system, method includes: the access order of package-in file is acquired, thus obtains file access sequence list by A, employing Hook technology;The file access sequence list that B, basis obtain is treated the file of packing and is packed, thus is written in APMB package by file to be packed.The method of the present invention is packed according to the file access sequence list gathered, and order that the file access sequence list gathered accesses package-in file with actual software when running is same or like, two files accessing orbution position in APMB package can be made nearer, so that hard disc magnetic head accesses whole APMB package with approximation order reading manner, improve the access speed of APMB package.A kind of file packing method based on Hook technology of the present invention and system can be widely applied to computer application field.

Description

A kind of based on Hook The file packing method of technology and system
Technical field
The present invention relates to computer application field, a kind of file packing method based on Hook technology and system.
Background technology
Hook, is again hook, is a platform of windows messaging treatment mechanism.Application program can be arranged above with subprogram certain message with supervision specified window at Hook, and its window monitored can be created by other processes.After message arrives, application program can process the pre-treatment Hook of function at target window.Therefore, Hook mechanism allows application program intercepting and capturing to process windows messaging or particular event.
It practice, Hook is a program segment processing message, can be called by system and be linked in system.Hook program, before the message that system sends does not arrives purpose window, the most first captures this message, so that Hook function preferentially obtains control.At this moment, Hook function both can be with processed or change this message, it is also possible to does not make any process and continues to transmit this message, it is also possible to force to terminate the transmission of this message.
The resource of existing software client generally uses packing manner to store, thus obtains more convenient, the resource of transmission and more maintain secrecy and the access speed advantage such as faster.But during file is packed, traditional packing manner can't be concerned about the relation between the position of package-in file and reading order.It is the most distant that this may result in the position originally having two files accessing orbution in APMB package, makes hard disc magnetic head jump when reading APMB package relatively big, thus adds the tracking time of hard disk and reduce the access speed of APMB package.
Summary of the invention
In order to solve above-mentioned technical problem, it is an object of the invention to: a kind of file packing method fast based on Hook technology and access speed is provided.
It is another object of the present invention to: a kind of file packaging system fast based on Hook technology and access speed is provided.
The technical solution adopted for the present invention to solve the technical problems is: a kind of file packing method based on Hook technology, including:
The access order of package-in file is acquired, thus obtains file access sequence list by A, employing Hook technology;
The file access sequence list that B, basis obtain is treated the file of packing and is packed, thus is written in APMB package by file to be packed.
Further, described step A, comprising:
A1, empty file access sequence list;
A2, by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
A3, operation programmatic client, trigger the reading logic of package-in file, thus stored in file access sequence list by the filename of package-in file;
A4, described file sequence acquisition function call package-in file are opened function and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, then step A3 is re-executed.
Further, described step B, comprising:
B1, file to be packed and corresponding file access sequence list are passed to strapping tool;
B2, described strapping tool read the filename in file access sequence list;
B3, described strapping tool are inquired about in file to be packed, and check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then perform step B4, otherwise, the most directly perform step B4;
B4, the All Files name judged whether in file access sequence list are read the most, the most then perform step B5, otherwise, then re-execute step B2;
B5, by the end of remaining file write packet file to be packed, and generate the index area for accessing package-in file, then the index area of generation stored the end to APMB package.
Further, after described step B, be additionally provided with step C, described step C, itself particularly as follows:
APMB package after packing is updated, thus newly-increased wrapping outer file and need the package-in file updated to store in APMB package will be needed, and regenerate the index area of APMB package.
Further, being additionally provided with step D after described step B, described step D, it is specifically, treat the APMB package of arrangement according to the file access sequence list obtained and arrange, thus deletes the package-in file that cannot have access to and resequence package-in file.
Further, described step D, comprising:
D1, finishing tool load APMB package to be arranged and corresponding file access sequence list;
D2, described finishing tool read the filename in file access sequence list;
D3, described finishing tool are inquired about in APMB package index area to be arranged, check whether the package-in file that filename is identical with the filename of described reading, if having, then read the content of this document, and the file content of reading is stored the end to new APMB package, then step D4 is performed, otherwise, the most directly perform step D4;
D4, the All Files name judged whether in file access sequence list are read the most, the most then perform step D5, otherwise, then re-execute step D2;
D5, package-in file remaining in APMB package to be arranged is stored the end to new APMB package, and generate the index area for accessing package-in file, then the index area of generation is stored the end to new APMB package;
D6, delete wait the APMB package arranged the new APMB package after retaining arrangement.
Further, the entitled file of described file filename or for representing the asterisk wildcard of file class.
What the present invention solved that its technical problem used another solution is that a kind of file packaging system based on Hook technology, including:
Acquisition module, for using Hook technology to be acquired the access order of package-in file, thus obtains file access sequence list;
Packetization module, packs for treating the file of packing according to the file access sequence list obtained, thus is written in APMB package by file to be packed;
The outfan of described acquisition module is connected with the input of packetization module.
Further, described acquisition module includes:
Empty unit, be used for emptying file access sequence list;
Redirect unit, for by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
Filename record unit, is used for running programmatic client, triggers the reading logic of package-in file, thus is stored in file access sequence list by the filename of package-in file;
Call and judging unit, open function for described file sequence acquisition function call package-in file and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, the most again go to filename record unit;
The described outfan emptying unit passes sequentially through redirection unit and filename record unit and then is connected with the input called with judging unit.
Further, described packetization module includes:
Uploading unit, for passing to strapping tool by file to be packed and corresponding file access sequence list;
Filename reads unit, reads the filename in file access sequence list for described strapping tool;
Query unit, inquire about in file to be packed for described strapping tool, check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then go to judging unit, otherwise, then judging unit is jumped directly to;
Judging unit, for judging whether that the All Files name in file access sequence list is read the most, the most then goes to writing unit, otherwise, the most again go to filename and read unit;
Writing unit, is used for the end of remaining file write packet file to be packed, and generates the index area for accessing package-in file, then the index area of generation is stored the end to APMB package;
The input of described uploading unit is connected with the outfan of acquisition module, and the outfan of described uploading unit passes sequentially through filename and reads unit, query unit and judging unit and then be connected with the input of writing unit.
The beneficial effects of the method for the present invention is: the method for the present invention is packed according to the file access sequence list gathered, and order that the file access sequence list gathered accesses package-in file with actual software when running is same or like, two files accessing orbution position in APMB package can be made nearer, so that hard disc magnetic head accesses whole APMB package with approximation order reading manner, improve the access speed of APMB package.Further, the method for the present invention also includes step C being updated the APMB package after packing, can be updated the content of package-in file according to actual needs or the outer file of newly-increased bag, more reasonable and science.Further, the method of the present invention also includes step D arranging the APMB package treating arrangement, can delete the most invalid package-in file and make to access two files distance in APMB package of orbution closer to, thus improve the access speed of APMB package further.
The system of the present invention provides the benefit that: in the system of the present invention, packetization module is packed according to the file access sequence list of acquisition module collection, and order that the file access sequence list gathered accesses package-in file with actual software when running is same or like, two files accessing orbution position in APMB package can be made nearer, so that hard disc magnetic head accesses whole APMB package with approximation order reading manner, improve the access speed of APMB package.
Accompanying drawing explanation
The invention will be further described with specific embodiment below in conjunction with the accompanying drawings.
Fig. 1 is the flow chart of a kind of file packing method based on Hook technology of the present invention;
Fig. 2 is the flow chart of the method step A of the present invention;
Fig. 3 is the flow chart of the method step B of the present invention;
Fig. 4 is the APMB package structural representation after the present invention has packed;
Fig. 5 is that the method for the present invention is plus the flow chart after step C;
Fig. 6 is the APMB package structural representation after the present invention has updated;
Fig. 7 is that the method for the present invention is plus the flow chart after step D;
Fig. 8 is the flow chart of the method step D of the present invention;
Fig. 9 is the APMB package structural representation after the present invention has arranged;
Figure 10 is the theory diagram of a kind of file packaging system based on Hook technology of the present invention;
Figure 11 is the structured flowchart of the systematic collection module of the present invention;
Figure 12 is the structured flowchart of the system packetization module of the present invention.
Detailed description of the invention
Reference Fig. 1, a kind of file packing method based on Hook technology of the present invention, including:
The access order of package-in file is acquired, thus obtains file access sequence list by A, employing Hook technology;
The file access sequence list that B, basis obtain is treated the file of packing and is packed, thus is written in APMB package by file to be packed.
Wherein, APMB package is to have packed, be updated over or the most collated file bag, is made up of one or more package-in files.Such as, filename is respectively these four package-in files of a, b, c and d to have an APMB package G, G to include, then the file of the entitled e of file is the outer file of bag of G.File access sequence list is made up of tactic filename or relative path, close to the actual software access order to package-in file.Read for convenience, it will usually in access file list, increase access sequence number this (it practice, access sequence number is not present in file access sequence list).Such as, will read the file of the entitled b.tga file of file and the entitled c.ani of file again after the file of the software reading entitled a.mesh of file, then the access sequence obtained is listed as follows shown in table 1:
Table 1
Access sequence number Filename
1 a.mesh
2 b.tga
3 c.ani
In table 1, the file of access sequence number 1 correspondence is to be read at first when software actual access.
The access file list obtained is in addition to for packing, it is also possible to be used for carrying out the arrangement of APMB package.
With reference to Fig. 2, it is further used as preferred embodiment, described step A, comprising:
A1, empty file access sequence list;
A2, by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
A3, operation programmatic client, trigger the reading logic of package-in file, thus stored in file access sequence list by the filename of package-in file;
A4, described file sequence acquisition function call package-in file are opened function and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, then step A3 is re-executed.
Wherein, it is that bag function read by conventional software that package-in file opens function, and file sequence acquisition function then only opens many this functions of log file name of function than package-in file.The entry address that file sequence acquisition function generally opens function by Hook interception package-in file realizes.Package-in file is opened in step A2 function be redirected to the purpose of file sequence acquisition function is to substitute former package-in file with file sequence acquisition function to open function.Step A3 and A4 are for successfully being recorded in access file list by the filename of package-in file.
Step A3 is, according to top-down order, the filename of package-in file is stored file access sequence list, on the package-in file of the file that the package-in file of the file the most first accessed accesses after being stored in.File sequence acquisition function, after file part name being stored in access file list, still can call package-in file and open function, in order to continue to be acquired the filename of subsequent file.
Below as a example by the gatherer process of table 1 access file list, the gatherer process of access file list is illustrated:
First, emptying file access sequence list, and the former package-in file of HOOK opens function, HOOK program will be opened function former package-in file and be redirected to file sequence acquisition function.
Then, running programmatic client, client can Access Filename be three files of a.mesh, b.tga and c.ani successively.Owing to former APMB package opens function by Hook and be redirected to collection function, therefore file sequence acquisition function can obtain the filename of currently accessed file.And behind the bottom that the filename of acquisition is appended to access sequence list, capture program can again call APMB package and open function, make normal program operation and continue to gather follow-up filename, filename a.mesh, b.tga and c.ani adds in access file list in order the most at last, thus obtains the access file list of table 1.
With reference to Fig. 3, it is further used as preferred embodiment, described step B, comprising:
B1, file to be packed and corresponding file access sequence list are passed to strapping tool;
B2, described strapping tool read the filename in file access sequence list;
B3, described strapping tool are inquired about in file to be packed, and check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then perform step B4, otherwise, the most directly perform step B4;
B4, the All Files name judged whether in file access sequence list are read the most, the most then perform step B5, otherwise, then re-execute step B2;
B5, by the end of remaining file write packet file to be packed, and generate the index area for accessing package-in file, then the index area of generation stored the end to APMB package.
Wherein, corresponding file access sequence list is the one of the file access sequence list obtained by step A, and it is specifically designed to packs to the outer file of bag (file to be packed).And owing to file access sequence list is according to top-down acquisition order, therefore the APMB package order after packing is also top-down, above the file packed after being positioned in the file the most first packed position in bag.Therefore the end of APMB package refers to, the bottom position of APMB package.
Packing process is completed by strapping tool.First, the filename of outer file and the corresponding incoming strapping tool of file access sequence list will be wrapped.Then, strapping tool can be successively read the content wrapping outer file according to the filename in file access sequence list, and is written in APMB package (i.e. step B1~B4).If after the corresponding file of all and in file sequence list filenames is all written in APMB package, the outer file of unnecessary bag is also had to be not written in APMB package, then strapping tool can by the end of these unnecessary file appendings to APMB package, and without be concerned about these files bag in position (i.e. step B6).
Such as, if there being five files of filename respectively a.mesh, a.bone, b.tga, c.tga and c.ani to need to pack, and during packing, corresponding access file list is table 1, then the process packed is as follows:
First, strapping tool receives file (i.e. these five files of file entitled a.mesh, a.bone, b.tga, c.tga and c.ani) to be packed and corresponding file access sequence list (i.e. table 1).
Then, first filename a.mesh during strapping tool reads table 1.
Followed by, the content of this document, after existing wait the file inquiring the entitled a.mesh of file in the file packed, is appended to the end of APMB package by strapping tool.
Then, strapping tool reads second filename b.tga again from table 1, and find that the file of the entitled b.tga of file there is also when inquiry in the file packed, now strapping tool still can read the content of file of the entitled b.tga of file, and is appended to the end (being i.e. appended to below the file of the entitled a.mesh of file) of APMB package.
Then, strapping tool reads the 3rd filename c.mesh again from table 1.But find that the file of the entitled c.mesh of file does not exists when inquiry in the file packed, now strapping tool does nothing, so far the file that in table 1, All Files name is corresponding reads complete, and the most also three files to be packed of file entitled a.bone, c.tga and c.ani are not written in APMB package.Therefore, these three file can be appended to the end of APMB package by strapping tool with any order.
Finally, strapping tool can generate index area, and the end of the write packet file by generation, thus obtains the APMB package (in figure, a three-dimensional square represents a package-in file) of structure as shown in Figure 4.Index area includes the essential informations such as filename, document misregistration value and file size.
With reference to Fig. 5, be further used as preferred embodiment, after described step B, be additionally provided with step C, described step C, itself particularly as follows:
APMB package after packing is updated, thus newly-increased wrapping outer file and need the package-in file updated to store in APMB package will be needed, and regenerate the index area of APMB package.
Wherein, the APMB package after packing refers to the APMB package obtained by step B.
Newly-increased for needs can be wrapped outer file and need the file appending end to APMB package of renewal by the renewal process of step C, and regenerates index area.Renewal process is by updating program load, and the original copy of package-in file (the most former package-in file) after updating still can be retained in APMB package, only because the index area of APMB package is changed and forever cannot have access to.Additionally, the renewal process of step C is different with packing process or the process of arrangement, it will not adjust package-in file position in APMB package or order according to the file access sequence list gathered.
The renewal process of step C is as follows:
1) the incoming APMB package needing to update in more new procedures;
2) the incoming package-in file needing to update in more new procedures;
3) one is needed the end that the package-in file updated is appended to APMB package;
4) in the index area of APMB package, search whether the package-in file needing to update exists successively,
If finding, this file is present in index area, then revise the index of this file so that it is point to file position in bag after updating;If finding, the information such as this file name, document location and file size not in index area, are then added in index area by this file.
Such as, comprising five files of file entitled a.mesh, a.bone, b.tga, c.tga and c.ani in the APMB package existed, its structure is as shown in Figure 4.If needing the newly-increased entitled d.tga of file wrapping outer file, need the entitled b.tga of file of the package-in file updated.Then its process being updated is as follows:
First, more new procedures loads the APMB package existed.
Then, more new procedures reads the file of the entitled d.tga of file, and after its content is attached to the APMB package existed.
Afterwards, more new procedures is in the package-in file the most Already in APMB package of the index area inquiry entitled d.tga of file.Owing to not finding that in index area deviant current for the file of entitled for file d.tga, filename and document size information can be write in index area by the file of the entitled d.tga of file, the most more new procedures.
Then, more new procedures reads the file of the entitled b.tga of file, and after its content is attached to the APMB package existed.
Followed by, more new procedures is in the file the most Already in APMB package of the index area inquiry entitled b.tga of file.Owing to can find the file of the entitled b.tga of file in index area, the most more new procedures can revise the index of the file of the entitled b.tga of file so that it is points to the position (position after i.e. additional) of new b.tga file.APMB package structure after final updated is as shown in Figure 6.
With reference to Fig. 7, it is further used as preferred embodiment, it is additionally provided with step D after described step B, described step D, it is specially, the APMB package treating arrangement according to the file access sequence list obtained arranges, thus deletes the package-in file that cannot have access to and resequence package-in file.
Wherein, the file access sequence list obtained both can be the file access sequence list of Resurvey, it is also possible to the access file list that time for packing before, (i.e. step B) uses.
During this arrangement of step D, collate program and first load APMB package to be arranged, and successively respective file is written in new APMB package according to the filename in access sequence list.And index area in former APMB package is existed but do not appear in the file in file access sequence list, collate program to be appended to the end bottom position of APMB package (i.e. new) of new APMB package simply by its content, and without being concerned about its order.After All Files has arranged, collate program and former APMB package is deleted, and only retain new APMB package.This new APMB package is compared with former APMB package, and access speed faster, accesses more efficient.
With reference to Fig. 8, it is further used as preferred embodiment, described step D, comprising:
D1, finishing tool load APMB package to be arranged and corresponding file access sequence list;
D2, described finishing tool read a filename in file access sequence list;
D3, described finishing tool are inquired about in APMB package index area to be arranged, check whether the package-in file that filename is identical with the filename of described reading, if having, then read the content of this document, and behind the end that the file content of reading is appended to new APMB package, perform step D4, otherwise, the most directly perform step D4;
D4, the All Files name judged whether in file access sequence list are read the most, the most then perform step D5, otherwise, then re-execute step D2;
D5, remaining package-in file in APMB package to be arranged is write the end of new APMB package, and generating the end that after accessing the index area of package-in file, the index area of generation is appended to new APMB package;
D6, delete wait the APMB package arranged the new APMB package after retaining arrangement.
Wherein, corresponding file access sequence list both can be the new file access sequence list gathered, it is also possible to the file access sequence list used when packing for step B.And owing to file access sequence list is according to top-down acquisition order, the APMB package order after therefore arranging also is top-down, above the file that the file i.e. first stored when arranging position in bag stores after being positioned at.Therefore newly the end of APMB package refers to, the bottom position of new APMB package.
Arrangement process similar with packing process, is a difference in that packing process can retain former file to be packed, arranges process and then can delete former file to be arranged.
Arrangement process not only again can adjust the position of package-in file and generate new index area, but also can remove those files that cannot have access to, and can save resource further and improve access speed.
Such as, the structure of APMB package to be arranged as shown in Figure 6, i.e. wait the APMB package arranged be update after APMB package.Having two filenames to be b.tga in figure, being positioned at the file under a.mesh cannot access, and is positioned at the file under c.tga and then can have access to.If the new file access sequence list now obtained through step A is as shown in table 2 below:
Table 2
The APMB package structure then obtained after step D1~D6 is as shown in Figure 9, it can be seen that arrangement process have adjusted the order of package-in file (i.e. have adjusted the position of package-in file) not only according to table 2, and the file that will be unable to the entitled b.tga of that file of access deletes.
It is further used as preferred embodiment, the filename of the entitled file of described file or for representing the asterisk wildcard of file class.
File access sequence list includes one or more filename.Filename both can be the filename (as shown in table 1) of a file, it is also possible to be intended to indicate that the asterisk wildcard of file class.Such as, if two files of entitled a.tga and a.ani of file can be visited again after the file that Access Filename is a.mesh, and two files of entitled b.tga and b.ani of file after the file that Access Filename is b.mesh, can be visited again, then can represent above-mentioned two group access sequences with asterisk wildcard, thus obtain file access sequence list as shown in table 3:
Table 3
Access sequence number Filename
1 *.mesh
2 {1}.tga
3 {1}.ani
In table 3, * .mesh, { 1}.tga and { 1}.ani is the asterisk wildcard representing file type.
Reference Figure 10, a kind of file packaging system based on Hook technology of the present invention, including:
Acquisition module, for using Hook technology to be acquired the access order of package-in file, thus obtains file access sequence list;
Packetization module, packs for treating the file of packing according to the file access sequence list obtained, thus is written in APMB package by file to be packed;
The outfan of described acquisition module is connected with the input of packetization module.
With reference to Figure 11, being further used as preferred embodiment, described acquisition module includes:
Empty unit, be used for emptying file access sequence list;
Redirect unit, for by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
Filename record unit, is used for running programmatic client, triggers the reading logic of package-in file, thus is stored in file access sequence list by the filename of package-in file;
Call and judging unit, open function for described file sequence acquisition function call package-in file and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, the most again go to filename record unit;
The described outfan emptying unit passes sequentially through redirection unit and filename record unit and then is connected with the input called with judging unit.
With reference to Figure 12, being further used as preferred embodiment, described packetization module includes:
Uploading unit, for passing to strapping tool by file to be packed and corresponding file access sequence list;
Filename reads unit, reads the filename in file access sequence list for described strapping tool;
Query unit, inquire about in file to be packed for described strapping tool, check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then go to judging unit, otherwise, then judging unit is jumped directly to;
Judging unit, for judging whether that the All Files name in file access sequence list is read the most, the most then goes to writing unit, otherwise, the most again go to filename and read unit;
Writing unit, is used for the end of remaining file write packet file to be packed, and generates the index area for accessing package-in file, then the index area of generation is stored the end to APMB package;
The input of described uploading unit is connected with the outfan of acquisition module, and the outfan of described uploading unit passes sequentially through filename and reads unit, query unit and judging unit and then be connected with the input of writing unit.
It is above the preferably enforcement of the present invention is illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement on the premise of spirit of the present invention, and deformation or the replacement of these equivalents are all contained in the application claim limited range.

Claims (8)

1. a file packing method based on Hook technology, it is characterised in that including:
The access order of package-in file is acquired, thus obtains file access sequence list by A, employing Hook technology;
The file access sequence list that B, basis obtain is treated the file of packing and is packed, thus is written in APMB package by file to be packed;
Described step A, comprising:
A1, empty file access sequence list;
A2, by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
A3, operation programmatic client, trigger the reading logic of package-in file, thus stored in file access sequence list by the filename of package-in file;
A4, described file sequence acquisition function call package-in file are opened function and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, then step A3 is re-executed.
A kind of file packing method based on Hook technology the most according to claim 1, it is characterised in that: described step B, comprising:
B1, file to be packed and corresponding file access sequence list are passed to strapping tool;
B2, described strapping tool read the filename in file access sequence list;
B3, described strapping tool are inquired about in file to be packed, and check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then perform step B4, otherwise, the most directly perform step B4;
B4, the All Files name judged whether in file access sequence list are read the most, the most then perform step B5, otherwise, then re-execute step B2;
B5, by the end of remaining file write packet file to be packed, and generate the index area for accessing package-in file, then the index area of generation stored the end to APMB package.
A kind of file packing method based on Hook technology the most according to claim 1, it is characterised in that: after described step B, be additionally provided with step C, described step C, itself particularly as follows:
APMB package after packing is updated, thus newly-increased wrapping outer file and need the package-in file updated to store in APMB package will be needed, and regenerate the index area of APMB package.
A kind of file packing method based on Hook technology the most according to claim 1, it is characterized in that: after described step B, be additionally provided with step D, described step D, it is specially, the APMB package treating arrangement according to the file access sequence list obtained arranges, thus deletes the package-in file that cannot have access to and resequence package-in file.
A kind of file packing method based on Hook technology the most according to claim 4, it is characterised in that: described step D, comprising:
D1, finishing tool load APMB package to be arranged and corresponding file access sequence list;
D2, described finishing tool read the filename in file access sequence list;
D3, described finishing tool are inquired about in APMB package index area to be arranged, check whether the package-in file that filename is identical with the filename of described reading, if having, then read the content of this document, and the file content of reading is stored the end to new APMB package, then step D4 is performed, otherwise, the most directly perform step D4;
D4, the All Files name judged whether in file access sequence list are read the most, the most then perform step D5, otherwise, then re-execute step D2;
D5, package-in file remaining in APMB package to be arranged is stored the end to new APMB package, and generate the index area for accessing package-in file, then the index area of generation is stored the end to new APMB package;
D6, delete wait the APMB package arranged the new APMB package after retaining arrangement.
6. according to a kind of based on Hook technology the file packing method described in claim 1 or 2 or 5, it is characterised in that: the filename of the entitled file of described file or for representing the asterisk wildcard of file class.
7. a file packaging system based on Hook technology, it is characterised in that including:
Acquisition module, for using Hook technology to be acquired the access order of package-in file, thus obtains file access sequence list;
Packetization module, packs for treating the file of packing according to the file access sequence list obtained, thus is written in APMB package by file to be packed;
The outfan of described acquisition module is connected with the input of packetization module;
Described acquisition module includes:
Empty unit, be used for emptying file access sequence list;
Redirect unit, for by Hook technology, package-in file is opened function and is redirected to file sequence acquisition function;
Filename record unit, is used for running programmatic client, triggers the reading logic of package-in file, thus is stored in file access sequence list by the filename of package-in file;
Call and judging unit, open function for described file sequence acquisition function call package-in file and judge whether that all of package-in file is read the most, the most then terminate to gather, thus obtain storing the file access sequence list of filename;Otherwise, the most again go to filename record unit;
The described outfan emptying unit passes sequentially through redirection unit and filename record unit and then is connected with the input called with judging unit.
A kind of file packaging system based on Hook technology the most according to claim 7, it is characterised in that: described packetization module includes:
Uploading unit, for passing to strapping tool by file to be packed and corresponding file access sequence list;
Filename reads unit, reads the filename in file access sequence list for described strapping tool;
Query unit, inquire about in file to be packed for described strapping tool, check whether the file that filename is identical with the filename of described reading, if having, then read the content of this document, and the content of reading is stored the end to APMB package, then go to judging unit, otherwise, then judging unit is jumped directly to;
Judging unit, for judging whether that the All Files name in file access sequence list is read the most, the most then goes to writing unit, otherwise, the most again go to filename and read unit;
Writing unit, is used for the end of remaining file write packet file to be packed, and generates the index area for accessing package-in file, then the index area of generation is stored the end to APMB package;
The input of described uploading unit is connected with the outfan of acquisition module, and the outfan of described uploading unit passes sequentially through filename and reads unit, query unit and judging unit and then be connected with the input of writing unit.
CN201310183949.5A 2013-05-17 2013-05-17 A kind of file packing method based on Hook technology and system Active CN103294784B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310183949.5A CN103294784B (en) 2013-05-17 2013-05-17 A kind of file packing method based on Hook technology and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310183949.5A CN103294784B (en) 2013-05-17 2013-05-17 A kind of file packing method based on Hook technology and system

Publications (2)

Publication Number Publication Date
CN103294784A CN103294784A (en) 2013-09-11
CN103294784B true CN103294784B (en) 2016-08-24

Family

ID=49095646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310183949.5A Active CN103294784B (en) 2013-05-17 2013-05-17 A kind of file packing method based on Hook technology and system

Country Status (1)

Country Link
CN (1) CN103294784B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382948A (en) * 2008-10-14 2009-03-11 成都市华为赛门铁克科技有限公司 File memory method, apparatus and system
CN101626391A (en) * 2008-07-08 2010-01-13 盛大计算机(上海)有限公司 Method for processing resource of network game client
CN101763436A (en) * 2010-02-08 2010-06-30 深圳市茁壮网络股份有限公司 File packing method and tool

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626391A (en) * 2008-07-08 2010-01-13 盛大计算机(上海)有限公司 Method for processing resource of network game client
CN101382948A (en) * 2008-10-14 2009-03-11 成都市华为赛门铁克科技有限公司 File memory method, apparatus and system
CN101763436A (en) * 2010-02-08 2010-06-30 深圳市茁壮网络股份有限公司 File packing method and tool

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WindowsHooks中录制与回放钩子的运行机制剖析;贺细平等;《电脑与信息技术》;20061231;第14卷(第6期);第6-11页,第80页 *

Also Published As

Publication number Publication date
CN103294784A (en) 2013-09-11

Similar Documents

Publication Publication Date Title
US11599545B2 (en) Stream retention in a data storage system
CN104598809B (en) Program monitoring method and defending method thereof, as well as relevant device
US9529808B1 (en) Efficient and flexible organization and management of file metadata
US8290994B2 (en) Obtaining file system view in block-level data storage systems
US20160306799A1 (en) Atomic incremental load for map-reduce systems on append-only file systems
CN103970788A (en) Webpage-crawling-based crawler technology
US7206795B2 (en) Prefetching and multithreading for improved file read performance
CN102426594A (en) Method and system for operating database
US10114765B2 (en) Automatic recovery of application cache warmth
CN105677904B (en) Small documents storage method and device based on distributed file system
CN104246727A (en) Data processing system and method for operating a data processing system
US10642530B2 (en) Global occupancy aggregator for global garbage collection scheduling
US10877848B2 (en) Processing I/O operations in parallel while maintaining read/write consistency using range and priority queues in a data protection system
US11836047B2 (en) Small file restore performance in a deduplication file system
WO2019047442A1 (en) Method and system for bypassing function call chain detection in ios application
CN104461929B (en) Distributed data cache method based on blocker
CN103150225B (en) Disk full abnormity fault tolerance method of object parallel storage system based on application level agent
CN101441551B (en) Computer, external memory and method for processing data information in external memory
CN103294784B (en) A kind of file packing method based on Hook technology and system
US20140040191A1 (en) Inventorying and copying file system folders and files
CN105677579A (en) Data access method and system in cache system
CN110737635B (en) Data blocking method
US9384253B1 (en) System and method for multiple-layer data replication in a Linux architecture
US9646014B1 (en) Systems and methods for selective defragmentation
US10628391B1 (en) Method and system for reducing metadata overhead in a two-tier storage architecture

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
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.