CN103914318A - Program starting method and device - Google Patents

Program starting method and device Download PDF

Info

Publication number
CN103914318A
CN103914318A CN201310001291.1A CN201310001291A CN103914318A CN 103914318 A CN103914318 A CN 103914318A CN 201310001291 A CN201310001291 A CN 201310001291A CN 103914318 A CN103914318 A CN 103914318A
Authority
CN
China
Prior art keywords
blocks
files
program
information
looking ahead
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310001291.1A
Other languages
Chinese (zh)
Inventor
朱文焕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310001291.1A priority Critical patent/CN103914318A/en
Publication of CN103914318A publication Critical patent/CN103914318A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention discloses a program starting method and device and belongs to the field of computers. The method comprises the steps of obtaining information of at least one pre-fetching file block corresponding to a program when a program starting instruction is received, wherein the information of at least one pre-fetching file block is obtaining by merging information of file blocks corresponding to page errors occurred in the historical starting and running process of the program; loading a file block corresponding to the information of at least one pre-fetching file block; loading a code of the program so as to start an application program. By adopting the technical scheme, file blocks corresponding to the often-occurred page errors can be loaded by loading the file block corresponding to the information of the pre-fetching file block in advance, hard page error frequencies in the program starting process are greatly decreased, namely the disk I/O times are decreased, and the program starting speed is improved.

Description

The method and apparatus that program starts
Technical field
The present invention relates to computer realm, the method and apparatus that particularly a kind of program starts.
Background technology
Along with the development of computing machine, application categories is more and more, and depend on some image file (EXE file and dll file) in program startup or use procedure, loading and use in the process of these image files, in the time that the virtual page number of access is not mapped to effective physical page, there is page fault (Page Fault); If virtual page number is mapped to the physical page of other states in internal memory, need this page to join loose-leaf, there is soft page fault (Soft Fault); If virtual page number is mapped in the file on disk, just need to from disk file, read, there is hard page fault (Hard Fault), and because Hard Fault reads as required, corresponding single I/O size smaller (Data Page16KB and Code Page32KB), and more random due to the I/O that Hard Fault causes at every turn, may cause the jump of magnetic head on disk, these magnetic disc i/os are by the operation of the program that greatly slows down.
Summary of the invention
In order to solve the problem of prior art, the method and apparatus that the embodiment of the present invention provides a kind of program to start.Described technical scheme is as follows:
The method that program starts, described method comprises:
In the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
Load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Load the code of described program, to start described application program.
In the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, comprise before:
Analyze the historical start-up and operation process of described program, obtain corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
Analyze the historical start-up and operation process of described program, obtain corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead, comprising:
Obtain the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation;
Calculate document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
According to document misregistration amount corresponding to described each described virtual address, obtain blocks of files information corresponding to page fault occurring;
Blocks of files information corresponding to page fault occurring is merged, obtain corresponding at least one of described program blocks of files information of looking ahead.
The virtual address of obtaining the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation, comprising:
Application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
Blocks of files information corresponding to page fault occurring is merged, obtains corresponding at least one of described program blocks of files information of looking ahead, specifically comprise:
Blocks of files information corresponding to page fault that same image file is occurred, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
In the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, comprising:
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain at least one corresponding with described program information blocks of files information of looking ahead;
Or,
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain the program version information of described program, described program version information carries described at least one blocks of files information of looking ahead.
Load described at least one blocks of files corresponding to blocks of files information of looking ahead, comprising:
Use asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or, use the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
The device that program starts, described device comprises:
The blocks of files of looking ahead acquisition of information module, for in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
The first load-on module, for loading described at least one blocks of files corresponding to blocks of files information of looking ahead;
The second load-on module, for loading the code of described program, to start described application program.
Described device also comprises:
Analysis module, for analyzing the historical start-up and operation process of described program, obtains corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
Described analysis module comprises:
Acquiring unit, for obtaining the virtual address of page fault Page Fault of image file list that the historical start-up and operation process of described program loads and generation;
Computing unit, for calculating document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
Blocks of files information acquisition unit, for according to document misregistration amount corresponding to described each described virtual address, obtains blocks of files information corresponding to page fault occurring;
The blocks of files of looking ahead information acquisition unit, for blocks of files information corresponding to page fault occurring is merged, obtains corresponding at least one of described program blocks of files information of looking ahead.
Described acquiring unit is specifically for application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
Described blocks of files information corresponding to page fault of blocks of files information acquisition unit specifically for same image file is occurred of looking ahead, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
The described blocks of files acquisition of information module of looking ahead is in the time receiving the instruction of start-up routine, according to the program information of described program, obtains at least one corresponding with described program information blocks of files information of looking ahead;
Or,
The described blocks of files acquisition of information module of looking ahead, in the time receiving the instruction of start-up routine, according to the program information of described program, is obtained the program version information of described program, and described program version information carries described at least one blocks of files information of looking ahead.
Described the first load-on module is for using asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or described the first load-on module is for using the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
In the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains; Load described at least one blocks of files corresponding to blocks of files information of looking ahead; Load the code of described program, to start described application program.Adopt technical scheme provided by the invention, make in program start-up course, by loading blocks of files corresponding to blocks of files information of looking ahead, can will often occur that the blocks of files that page fault is corresponding loads in advance, greatly reduce hard page fault frequency in program start-up course, that is to say and reduced magnetic disc i/o number of times, accelerated program toggle speed.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the method flow diagram that a kind of program that the embodiment of the present invention provides starts;
Fig. 2 is the method flow diagram that a kind of program that the embodiment of the present invention provides starts;
Fig. 3 is that the one that the embodiment of the present invention provides merges schematic diagram;
Fig. 4 is prior art program start-up time and the contrast schematic diagram that adopts the start-up time of the program starting method of the embodiment of the present invention;
Fig. 5 is the apparatus structure schematic diagram that a kind of program that the embodiment of the present invention provides starts.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Before introducing program starting method provided by the invention and device, the crucial term the present invention relates to is carried out to following explanation:
Page fault: when the virtual page number of current process access is not mapped to effective physical page, application program will be used the virtual memory page being kept on hard disk, operating system can find this page on hard disk, and is called in physical memory, and then program could be moved.If virtual page number is mapped to the physical page of other states in internal memory, generation be soft page fault (Soft Fault), if virtual page number is mapped in the file on disk, generation be hard page fault (Hard Fault).
Image file: the File Mapping on disk, to virtual address space, is equally accessed to these files by access memory, and these mapped files are called image file, use image file to be written into EXE and dll file in process initiation process.
Magnetic disc i/o: the read-write of disk.
It should be noted that, the program described in the embodiment of the present invention is Application Software Program, driver or operating system program.
Fig. 1 is the method flow diagram that a kind of program that the embodiment of the present invention provides starts, and the executive agent of the method is terminal device, and referring to Fig. 1, method flow comprises:
101: in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
102: load described at least one blocks of files corresponding to blocks of files information of looking ahead;
103: load the code of described program, to start described program.
Alternatively, in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, comprise before:
Analyze the historical start-up and operation process of described program, obtain corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
Alternatively, analyze the historical start-up and operation process of described program, obtain corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead, comprising:
Obtain the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation;
Calculate document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
According to document misregistration amount corresponding to described each described virtual address, obtain blocks of files information corresponding to page fault occurring;
Blocks of files information corresponding to page fault occurring is merged, obtain corresponding at least one of described program blocks of files information of looking ahead.
Alternatively, obtain the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation, comprising:
Application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
Alternatively, blocks of files information corresponding to page fault occurring is merged, obtains corresponding at least one of described program blocks of files information of looking ahead, specifically comprise:
Blocks of files information corresponding to page fault that same image file is occurred, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
Alternatively, in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, comprising:
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain at least one corresponding with described program information blocks of files information of looking ahead;
Or,
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain the program version information of described program, described program version information carries described at least one blocks of files information of looking ahead.
Alternatively, load described at least one blocks of files corresponding to blocks of files information of looking ahead, comprising:
Use asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or, use the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
Adopt technical scheme provided by the invention, make in program start-up course, by loading blocks of files corresponding to blocks of files information of looking ahead, can will often occur that the blocks of files that page fault is corresponding loads in advance, greatly reduce hard page fault frequency in program start-up course, that is to say and reduced magnetic disc i/o number of times, accelerated program toggle speed.
Fig. 2 is the method flow diagram that a kind of program that the embodiment of the present invention provides starts, and the executive agent of the method is terminal device, and referring to Fig. 2, method flow comprises:
201: the journal file that obtains program;
Wherein, journal file is the file comprising about system message, different journal files is recorded different information, for example, have for recording the syslog file of acquiescence, have only for recording security message, for this step 201, the journal file of this program of obtaining is for recording the start-up and operation relevant information of this program, and this journal file at least comprises the log-on message of this program, and this log-on message comprises the Page Fault information occurring in the historical start-up course of program.
Alternatively, before this step 201, comprise step 200: application tracking recording mechanism, the virtual address of the image file list loading in the historical start-up and operation process of logging program and the page fault Page Fault of generation;
Applied ETW(Event Tracing for Windows in this step 200, track record mechanism) be the unified tracking that provides of Windows and the mechanism of recording events, user model program and kernel-mode driver can carry out recording events with ETW.Because ETW is for all programs in whole system and system, therefore need to start ETW kernel log recording conversation, opening necessary event flag (is page fault mark in the present embodiment, as Hard Fault mark), filter applying the event that this ETW mechanism gets, obtain the event of designated program or designated module, as the virtual address of the page fault Page Fault of the image file list loading in the historical start-up and operation process of program and generation.
202: the program of the obtaining image file list that process loads in start-up and operation process;
Wherein, image file list at least comprises start address and the path of institute's load document, for this program, this image file list is because the Page Fault occurring in program start-up course loads, therefore, obtain this image file list, can be informed in the path that has loaded which file and these files while there is Page Fault in program start-up course.
This obtains can be to obtain all image file lists that process loads in the process of start-up and operation of this program, it can also be the image file list that only comprises that in start-up course, process loads, or the image file list that only process loads in load operating process, the embodiment of the present invention is not construed as limiting this.
Wherein, the beginning that start-up course can refer to user interface process is until the time between display foreground window.This start-up course can also shorten in less scope, specifically can be arranged by technician, and the embodiment of the present invention is not specifically limited.
203: the virtual address of the program of the obtaining page fault that process occurs in start-up and operation process;
This virtual address is the address of the virtual page number that in program start-up and operation process, process is accessed, for this step 203, the virtual address of the page fault that the process of obtaining occurs can be informed in which virtual address in program start-up and operation process not to be mapped in effective physical address.
It should be noted that, because the page fault occurring in every secondary program start-up and operation process is not identical, therefore, need to analyze to the start-up and operation process of program repeatedly the virtual address while generation to obtain image file list that process loads and Page Fault.The step 201-203 of the present embodiment is only to analyze the journal file of single start-up and operation, and the process of virtual address when obtaining image file list and Page Fault and occurring is that example describes, in actual applications, can analyze multiple journal files simultaneously, and virtual address when obtaining image file list and Page Fault and occurring, or, multiple journal file orders are analyzed, and virtual address when obtaining image file list and Page Fault and occurring, can have multiple to the analysis sequence of multiple journal files, specifically can be arranged by technician, the present embodiment is not specifically limited.
It should be noted that, this step 201-203 can also be replaced by following steps: obtain the image file list of process loading in program cold start-up first and operational process and the virtual address of the page fault that process occurs.Cold start-up is also named and is powered up startup, generally refers under off-mode and starts the operating system.And after passing through the analysis and merging of subsequent step 204-206, the blocks of files information configuration of looking ahead merging together can be issued in the program version information of program, terminal device is being got after the program version information of this program, can start according to the entrained blocks of files information of looking ahead of program version information.
204: calculate document misregistration amount corresponding to each this virtual address according to this image file list and this virtual address;
Those skilled in the art can be known, for the single image file in image file list, the virtual address when start address of image file deducts Page Fault generation, obtain relative virtual address, and obtain document misregistration amount by relative virtual address, wherein, this relative virtual address and document misregistration amount are piecewise linear relationships, this piecewise linear relationship is arranged by image file (PE file layout), and the present embodiment does not repeat.
This embodiment difference with the prior art is, directly do not load the whole image file in image file list, but by load granularity refinement more, only load the blocks of files that page fault will occur in program start-up course in image file, exchange the significantly lifting of I/O efficiency with the redundant data of minute quantity for.
205: blocks of files information corresponding to page fault that same image file is occurred, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and obtains at least one the blocks of files information of looking ahead;
Wherein, this at least one form storage that blocks of files information can list of looking ahead, the embodiment of the present invention is not construed as limiting this.
Wherein, default bit number can be set by technician, in the time that the distance between two adjacent blocks of files of determining according to document misregistration amount is less than default bit number, described two adjacent blocks of files information are merged, obtain the first blocks of files information of looking ahead, according to this first look ahead blocks of files information and with this first adjacent blocks of files information of the definite blocks of files of blocks of files information of looking ahead, continue to merge, until after adjacent blocks of files information has been merged, using the second blocks of files information of looking ahead that blocks of files information obtains as step 205 of looking ahead finally obtaining.
In embodiments of the present invention, be combined the file size of looking ahead in blocks of files information obtaining and do not limit, the number being combined does not also limit.
As, when the blocks of files information of the first blocks of files is 00000001 ~ 00000110, the blocks of files information of the second blocks of files is 00000111 ~ 00001111, merges into by 00000001 ~ 00000110 and 00000111 ~ 00001111 the blocks of files information 00000001 ~ 00001111 of looking ahead.
And for example, Fig. 3 is that the one that the embodiment of the present invention provides merges schematic diagram.Referring to Fig. 3, blocks of files 1, blocks of files 4, blocks of files 8 and blocks of files 11 distance between any two are all less than default bit number, therefore, the blocks of files information of blocks of files 1, blocks of files 4, blocks of files 8 and blocks of files 11 is merged, the offset address of its blocks of files information 1 of looking ahead after merging taking the offset address of blocks of files 1 as the blocks of files of looking ahead, with the distance between size and the blocks of files of blocks of files 1, blocks of files 4, blocks of files 8 and blocks of files 11 and, as the file size of the blocks of files of looking ahead.As, the file size of blocks of files 1, blocks of files 4, blocks of files 8 is 16kb, and there is no between any two spacing, blocks of files 8 and blocks of files 11 are also 16kb, spacing is therebetween 16kb, the offset address that the blocks of files information 1 of looking ahead after merging comprises is the offset address of blocks of files 1, and the file size that the blocks of files information 1 of looking ahead after merging comprises is 96kb.
For blocks of files 11 and blocks of files 5, spacing is therebetween 100kb, default bit number is 64kb, therefore, this spacing is greater than default bit number, and the blocks of files information of blocks of files 11 and blocks of files 5 can not merge, therefore, the blocks of files information that adjacent and spacing is less than to blocks of files 11, blocks of files 6 and the blocks of files 10 of default bit number merges, and fileinfo 2 obtains looking ahead; And the blocks of files information that adjacent and spacing is less than to blocks of files 3, blocks of files 9, blocks of files 2, blocks of files 7 and the blocks of files 12 of default bit number merges, fileinfo 3 obtains looking ahead.
In this step 205, only the merging process of blocks of files information corresponding to the page fault of program image file generation is described, and in real process, the blocks of files information corresponding to page fault that can occur multiple image files of program merges, this merging can be parallel or serial, the embodiment of the present invention does not limit, and further, can also be that blocks of files information corresponding to page fault occurring for the image file of designated module in program merges.
Those skilled in the art can be known, the size of a magnetic disc i/o can reach 2M on WIN7, on XP, can reach 1M, and the I/O size of a Hard Fault introducing only has 16KB or 32KB, therefore, in the present embodiment, by by the union operation of the blocks of files information of adjacent blocks of files, avoid the process to blocks of files restructuring, and be only by the merging of blocks of files information, make first to load the blocks of files corresponding to blocks of files information of this merging in the process of the startup of program, can significantly improve the efficiency of magnetic disc i/o.
206: in the time receiving the instruction of start-up routine, according to the program information of described program, obtain at least one corresponding with described program information blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
It should be noted that, for a terminal device, can store the blocks of files information of looking ahead corresponding to multiple programs, therefore, can be according to program information, blocks of files information that what inquiry need to be obtained look ahead, then according to corresponding at least one of this program information inquiring fast information of file of looking ahead, carry out follow-up loading procedure.
In addition, in another inventive embodiments, after the analysis of step 201-206 and merging, the blocks of files information configuration of looking ahead merging together can be issued in the program version information of program, terminal device is being got after the program version information of this program, can start according to the entrained blocks of files information of looking ahead of program version information.Particularly, in the time receiving the instruction of start-up routine, according to the program information of described program, obtain the program version information of described program, described program version information carries described at least one blocks of files information of looking ahead.
207: load described at least one blocks of files corresponding to blocks of files information of looking ahead;
What in fact comprise due to the blocks of files information of looking ahead is document misregistration address and the file size of blocks of files, therefore, in the time loading, can sequentially read blocks of files corresponding to each blocks of files information of looking ahead and load.
This loading procedure can be to use asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead; Or, use the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.Particularly, in the time that system is Windows7 and later version, terminal is used asynchronous I/O read mode that at least one blocks of files corresponding to blocks of files information of looking ahead is read in internal memory, in the time that system is the version before Windows7, as, XP system, although system is supported asynchronous read mode, but while using asynchronous read mode that at least one blocks of files corresponding to blocks of files information of looking ahead is read in internal memory, speed is slow, now terminal device uses the mode of dynamic load that described at least one blocks of files corresponding to blocks of files information of looking ahead is loaded in internal memory, and pin corresponding virtual page number, be that terminal is used the mode of LoadLirary that at least one blocks of files corresponding to blocks of files information of looking ahead is read in internal memory, in the time that blocks of files is loaded in internal memory, use VirtuallLock to pin corresponding virtual page number.
208: load the code of described program, to start described program.
The loading of this step 208 is mainly code except blocks of files corresponding to the blocks of files information of looking ahead etc. in loading procedure, and the embodiment of the present invention is not described further.
It should be noted that, the program starting method that the present embodiment provides, is applicable to any program, and needs hardly existing code to make an amendment.And the process of the step 201-208 that the present embodiment provides is also not limited to the start-up course of program, can also be used for the scene of any raising program feature.
Further, described method can not only faster procedure start-up course, can also faster procedure operational process, as long as the blocks of files that the hard page fault of real-time collecting program operation process is introduced, the information of described blocks of files is merged, the blocks of files information that obtains looking ahead, and in program operation process, load the blocks of files on disk according to the blocks of files information of looking ahead, the operation of program will be accelerated greatly.
And, in the start-up and operation process of every secondary program, all perform step obtaining and analytic process of 201-205, can realize and in program use procedure, carry out adaptive optimization.Particularly, for program, in the time that this program starts for the first time, the blocks of files information of can not looking ahead, and by step 201-205 to this for the first time start-up course analyze, to obtain the blocks of files information of looking ahead, and in follow-up start-up course, load this blocks of files corresponding to blocks of files information of looking ahead, to accelerate start-up course, and in follow-up each start-up course, all perform step the analysis of 201-205, on the basis of the existing blocks of files information of looking ahead, continue to merge, along with the number of starts increase and the fileinfo of looking ahead more and more complete, make toggle speed more and more faster.
Adopt technical scheme provided by the invention, make in program start-up course, by loading blocks of files corresponding to blocks of files information of looking ahead, can will often occur that the blocks of files that page fault is corresponding loads in advance, greatly reduce hard page fault frequency in program start-up course, that is to say and reduced magnetic disc i/o number of times, accelerated program toggle speed.
In order to further illustrate beneficial effect of the present invention, below from prior art program start-up course with to adopt the contrast between the start-up course of program starting method of the embodiment of the present invention be that example describes:
Fig. 4 is prior art program start-up time and the contrast schematic diagram that adopts the start-up time of the program starting method of the embodiment of the present invention.As seen from Figure 3, prior art program T2 start-up time comprises hard page fault time and loading procedure code time, adopt T1 start-up time of the program starting method of the embodiment of the present invention to comprise prefetch data time and the loading procedure code time of loading, T1 is far smaller than T2, in the start-up time of the program starting method of the employing embodiment of the present invention, do not comprise the hard page fault time, greatly improved the speed starting.
Table 1 is prior art program start-up course and adopt the contrast of the magnetic disc i/o parameter of a main modular in the start-up course of program starting method of the embodiment of the present invention.
Table 1
Program starts Start-up time The I/O time Magnetic disc i/o number of times
Without looking ahead 7.9s 4.55s 825
Intelligence is looked ahead 3.8s 2.42s 273
Data by upper table can be found out, in program start-up course, I/O proportion consuming time is larger, the startup of the direct faster procedure of optimization to I/O, by the program starting method that adopts the present embodiment to provide, program toggle speed is than having improved 50% ~ 60% without prefetch program toggle speed.
Fig. 5 is the apparatus structure schematic diagram that a kind of program that the embodiment of the present invention provides starts.Referring to Fig. 5, this device comprises:
The blocks of files of looking ahead acquisition of information module 501, for in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
The first load-on module 502, for loading described at least one blocks of files corresponding to blocks of files information of looking ahead;
The second load-on module 503, for loading the code of described program, to start described application program.
Alternatively, described device also comprises:
Analysis module, for analyzing the historical start-up and operation process of described program, obtains corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
Alternatively, described analysis module comprises:
Acquiring unit, for obtaining the virtual address of page fault Page Fault of image file list that the historical start-up and operation process of described program loads and generation;
Computing unit, for calculating document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
Blocks of files information acquisition unit, for according to document misregistration amount corresponding to described each described virtual address, obtains blocks of files information corresponding to page fault occurring;
The blocks of files of looking ahead information acquisition unit, for blocks of files information corresponding to page fault occurring is merged, obtains corresponding at least one of described program blocks of files information of looking ahead.
Alternatively, described acquiring unit is specifically for application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
Alternatively, described blocks of files information corresponding to page fault of blocks of files information acquisition unit specifically for same image file is occurred of looking ahead, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
Alternatively, described in look ahead blocks of files acquisition of information module 501 in the time receiving the instruction of start-up routine, according to the program information of described program, obtain at least one corresponding with described program information blocks of files information of looking ahead;
Or,
The described blocks of files acquisition of information module 501 of looking ahead, in the time receiving the instruction of start-up routine, according to the program information of described program, is obtained the program version information of described program, and described program version information carries described at least one blocks of files information of looking ahead.
Alternatively, described the first load-on module 502 is for using asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or described the first load-on module 502 is for using the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
It should be noted that: the device that the accelerated procedure that above-described embodiment provides starts is in the time that program starts, only be illustrated with the division of above-mentioned each functional module, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, be divided into different functional modules by the inner structure of equipment, to complete all or part of function described above.In addition, the embodiment of the method that the device that the program that above-described embodiment provides starts and program start belongs to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (14)

1. the method that program starts, is characterized in that, described method comprises:
In the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
Load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Load the code of described program, to start described application program.
2. method according to claim 1, is characterized in that, in the time receiving the instruction of start-up routine, obtains corresponding at least one of described program blocks of files information of looking ahead, and comprises before:
Analyze the historical start-up and operation process of described program, obtain corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
3. method according to claim 1, is characterized in that, analyzes the historical start-up and operation process of described program, obtains corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead, and comprising:
Obtain the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation;
Calculate document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
According to document misregistration amount corresponding to described each described virtual address, obtain blocks of files information corresponding to page fault occurring;
Blocks of files information corresponding to page fault occurring is merged, obtain corresponding at least one of described program blocks of files information of looking ahead.
4. method according to claim 3, is characterized in that, obtains the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation, comprising:
Application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
5. method according to claim 3, is characterized in that, blocks of files information corresponding to page fault occurring is merged, and obtains corresponding at least one of described program blocks of files information of looking ahead, and specifically comprises:
Blocks of files information corresponding to page fault that same image file is occurred, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
6. method according to claim 1, is characterized in that, in the time receiving the instruction of start-up routine, obtains corresponding at least one of described program blocks of files information of looking ahead, and comprising:
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain at least one corresponding with described program information blocks of files information of looking ahead;
Or,
In the time receiving the instruction of start-up routine, according to the program information of described program, obtain the program version information of described program, described program version information carries described at least one blocks of files information of looking ahead.
7. method according to claim 1, is characterized in that, loads described at least one blocks of files corresponding to blocks of files information of looking ahead, and comprising:
Use asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or, use the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
8. the device that program starts, is characterized in that, described device comprises:
The blocks of files of looking ahead acquisition of information module, for in the time receiving the instruction of start-up routine, obtain corresponding at least one of described program blocks of files information of looking ahead, blocks of files information corresponding to page fault that described at least one blocks of files information of looking ahead is occurred in historical start-up and operation process by described program merges and obtains;
The first load-on module, for loading described at least one blocks of files corresponding to blocks of files information of looking ahead;
The second load-on module, for loading the code of described program, to start described application program.
9. device according to claim 8, is characterized in that, described device also comprises:
Analysis module, for analyzing the historical start-up and operation process of described program, obtains corresponding at least one of described historical start-up and operation process Program blocks of files information of looking ahead.
10. device according to claim 8, is characterized in that, described analysis module comprises:
Acquiring unit, for obtaining the virtual address of page fault Page Fault of image file list that the historical start-up and operation process of described program loads and generation;
Computing unit, for calculating document misregistration amount corresponding to each described virtual address according to described image file list and described virtual address;
Blocks of files information acquisition unit, for according to document misregistration amount corresponding to described each described virtual address, obtains blocks of files information corresponding to page fault occurring;
The blocks of files of looking ahead information acquisition unit, for blocks of files information corresponding to page fault occurring is merged, obtains corresponding at least one of described program blocks of files information of looking ahead.
11. devices according to claim 10, it is characterized in that, described acquiring unit is specifically for application tracking recording mechanism, records the virtual address of the page fault Page Fault of the image file list that loads in the historical start-up and operation process of described program and generation.
12. devices according to claim 10, it is characterized in that, described blocks of files information corresponding to page fault of blocks of files information acquisition unit specifically for same image file is occurred of looking ahead, according to the document misregistration amount in image file, the blocks of files information that distance is less than to the blocks of files of default bit number merges, and blocks of files information obtains looking ahead.
13. devices according to claim 8, it is characterized in that, the described blocks of files acquisition of information module of looking ahead is in the time receiving the instruction of start-up routine, according to the program information of described program, obtains at least one corresponding with described program information blocks of files information of looking ahead;
Or,
The described blocks of files acquisition of information module of looking ahead, in the time receiving the instruction of start-up routine, according to the program information of described program, is obtained the program version information of described program, and described program version information carries described at least one blocks of files information of looking ahead.
14. devices according to claim 8, is characterized in that, described the first load-on module is for using asynchronous I/O read mode to load described at least one blocks of files corresponding to blocks of files information of looking ahead;
Or described the first load-on module is for using the mode of dynamic load to load described at least one blocks of files corresponding to blocks of files information of looking ahead.
CN201310001291.1A 2013-01-04 2013-01-04 Program starting method and device Pending CN103914318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310001291.1A CN103914318A (en) 2013-01-04 2013-01-04 Program starting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310001291.1A CN103914318A (en) 2013-01-04 2013-01-04 Program starting method and device

Publications (1)

Publication Number Publication Date
CN103914318A true CN103914318A (en) 2014-07-09

Family

ID=51040023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310001291.1A Pending CN103914318A (en) 2013-01-04 2013-01-04 Program starting method and device

Country Status (1)

Country Link
CN (1) CN103914318A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991058A (en) * 2016-01-21 2017-07-28 腾讯科技(深圳)有限公司 Prefetch document handling method and device
CN109471671A (en) * 2017-09-06 2019-03-15 武汉斗鱼网络科技有限公司 A kind of program cold start-up method and system
CN109542531A (en) * 2018-10-26 2019-03-29 阿里巴巴集团控股有限公司 A kind of file layout method of adjustment and device
CN117493127A (en) * 2023-12-29 2024-02-02 太平金融科技服务(上海)有限公司 Application program detection method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101126995A (en) * 2006-08-14 2008-02-20 国际商业机器公司 Method and apparatus for processing serious hardware error
EP2439639A1 (en) * 2009-06-02 2012-04-11 Ubiquitous Corporation Program, control method, and control device
CN102662690A (en) * 2012-03-14 2012-09-12 腾讯科技(深圳)有限公司 Method and apparatus for starting application program
CN102662713A (en) * 2012-04-12 2012-09-12 腾讯科技(深圳)有限公司 Method, device and terminal for increasing running speed of application programs
CN102707966A (en) * 2012-04-12 2012-10-03 腾讯科技(深圳)有限公司 Method and device for acceleratively starting operating system, and method, device and terminal for generating prefetched information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101126995A (en) * 2006-08-14 2008-02-20 国际商业机器公司 Method and apparatus for processing serious hardware error
EP2439639A1 (en) * 2009-06-02 2012-04-11 Ubiquitous Corporation Program, control method, and control device
CN102662690A (en) * 2012-03-14 2012-09-12 腾讯科技(深圳)有限公司 Method and apparatus for starting application program
CN102662713A (en) * 2012-04-12 2012-09-12 腾讯科技(深圳)有限公司 Method, device and terminal for increasing running speed of application programs
CN102707966A (en) * 2012-04-12 2012-10-03 腾讯科技(深圳)有限公司 Method and device for acceleratively starting operating system, and method, device and terminal for generating prefetched information

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991058A (en) * 2016-01-21 2017-07-28 腾讯科技(深圳)有限公司 Prefetch document handling method and device
CN109471671A (en) * 2017-09-06 2019-03-15 武汉斗鱼网络科技有限公司 A kind of program cold start-up method and system
CN109471671B (en) * 2017-09-06 2023-03-24 武汉斗鱼网络科技有限公司 Program cold starting method and system
CN109542531A (en) * 2018-10-26 2019-03-29 阿里巴巴集团控股有限公司 A kind of file layout method of adjustment and device
CN117493127A (en) * 2023-12-29 2024-02-02 太平金融科技服务(上海)有限公司 Application program detection method, device, equipment and medium
CN117493127B (en) * 2023-12-29 2024-04-05 太平金融科技服务(上海)有限公司 Application program detection method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN102662690B (en) Method and apparatus for starting application program
CN103914318A (en) Program starting method and device
CN105701190A (en) Data synchronizing method and device
CN102207897A (en) Incremental backup method
US20240086332A1 (en) Data processing method and system, device, and medium
CN106681659A (en) Data compression method and device
CN102708317B (en) Recording auditing method under windows platform on basis of filter driver
CN102609484A (en) General method for managing log of system
CN105389268A (en) Data storage system and operating method thereof
CN105095418A (en) Method and apparatus for processing write request
CN108198582B (en) NAND Flash control method and device and SSD
CN114138424B (en) Virtual machine memory snapshot generation method and device and electronic equipment
Zeng et al. CosaFS: A cooperative shingle-aware file system
CN103246611B (en) A kind of document handling method and system
CN110347406A (en) A kind of method and device of the operation data of acquisition applications
CN105589912A (en) Method and storage structure for processing frequently written document with MRAM (Magnetic Random Access Memory)
CN105389232A (en) Valid data analysis method for EXT file system
CN108304186B (en) Method and equipment for executing multiple operations based on synthetic configuration file
CN107766385B (en) Method and equipment for converting file format of virtual disk
CN111176568B (en) Data analysis method and device
US20120159006A1 (en) Monitoring input/output operations to specific storage locations
CN102722446B (en) Dynamic recorder for local memory access model for stream processor
CN103077261A (en) Computerized dynamic simulation method for intelligently repairing virtual environment
CN104252415A (en) Method and system for redistributing data
CN105159607A (en) Discrete storage based high-speed writing method

Legal Events

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

Application publication date: 20140709