CN109284142A - File preloads method, apparatus, electronic equipment and computer readable storage medium - Google Patents

File preloads method, apparatus, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN109284142A
CN109284142A CN201810928017.1A CN201810928017A CN109284142A CN 109284142 A CN109284142 A CN 109284142A CN 201810928017 A CN201810928017 A CN 201810928017A CN 109284142 A CN109284142 A CN 109284142A
Authority
CN
China
Prior art keywords
file
application program
memory
program
application
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
CN201810928017.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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810928017.1A priority Critical patent/CN109284142A/en
Publication of CN109284142A publication Critical patent/CN109284142A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application embodiment is related to field of terminal technology, discloses a kind of file and preloads method, apparatus, electronic equipment and computer readable storage medium.Wherein, file pre-add support method includes: the corresponding relationship of file according to the pre-stored data and application program in the open command for detecting application program, searches file corresponding with the application program;Wherein, the file is the file used in the application program operational process;The corresponding file found out is loaded onto memory, and directly reads the file of load in the memory in the operational process of the application program.The application embodiment can promote the fluency of application program operation.

Description

File preloads method, apparatus, electronic equipment and computer readable storage medium
Technical field
The application embodiment is related to field of terminal technology, in particular to file preload method, apparatus, electronic equipment and Computer readable storage medium.
Background technique
With universal, the type of APP (application, application program) in terminal of the terminals such as mobile phone, tablet computer It is more and more.Application program at runtime, needs to load a certain amount of data file or configuration file from external memory to system In memory, the file for then reading above-mentioned load from memory again is run.
Summary of the invention
A kind of file of being designed to provide of the application embodiment preloads method, apparatus, electronic equipment and computer Readable storage medium storing program for executing can promote the fluency of application program operation.
Presently filed embodiment provides a kind of file pre-add support method, comprising: in the unlatching for detecting application program When instruction, the corresponding relationship of file according to the pre-stored data and application program searches file corresponding with the application program;Its In, the file is the file used in the application program operational process;The corresponding file load that will be found out Into memory, and the file of load in the memory is directly read in the operational process of application program.
Presently filed embodiment additionally provides a kind of file pre-load means, comprising: searching module, for detecting When the open command of application program, the corresponding relationship of file according to the pre-stored data and application program is searched and applies journey with described The corresponding file of sequence;Wherein, the file is the file used in the application program operational process;Preloaded components are used It is loaded onto memory in the corresponding file for finding out the searching module;Module is run, for applying journey in operation The file of load in the memory is directly read during sequence.
Presently filed embodiment additionally provides a kind of electronic equipment, comprising: at least one processor;And at least The memory of one processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instruction It is executed by least one processor, so that at least one processor is able to carry out above-mentioned file pre-add support method.
Presently filed embodiment additionally provides a kind of computer readable storage medium, is stored with computer program, the meter Calculation machine program realizes above-mentioned file pre-add support method when being executed by processor.
The application embodiment is by when having detected that application program is opened, according to the application program and in advance of being opened The file of storage and the corresponding relationship of application program find out file corresponding with the application program being opened, by what is found out File is loaded onto memory.That is, in application program launching, which is needed in the process of running using arriving File is loaded onto memory, and the text of load in the memory is directly read in the operational process for the application program being opened Part can promote the fluency of application program operation.
Detailed description of the invention
One or more embodiments are illustrated by the picture in corresponding attached drawing, these are exemplary Illustrate not constitute the restriction to embodiment.
Fig. 1 is the flow chart that file preloads method in the application first embodiment;
Fig. 2 is Android system framework map in the application first embodiment;
Fig. 3 is the flow chart that file preloads method in the application second embodiment;
Fig. 4 is the structural framing figure of Android system framework map, memory and external memory in the application second embodiment;
Fig. 5 is the flow chart that file preloads method in the application third embodiment;
Fig. 6 is the structural block diagram of file pre-load means in the 4th embodiment of the application;
Fig. 7 is the structural block diagram of file pre-load means in the 5th embodiment of the application;
Fig. 8 is the structural block diagram of file pre-load means in the application sixth embodiment;
Fig. 9 is the structural schematic diagram of the electronic equipment provided in the 7th embodiment of the application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application embodiment clearer, below in conjunction with attached drawing to this Shen Each embodiment please is explained in detail.However, it will be understood by those skilled in the art that respectively implementing in the application In mode, in order to make the reader understand this application better, many technical details are proposed.But it is even if thin without these technologies Section and various changes and modifications based on the following respective embodiments, also may be implemented the application technical solution claimed.
The first embodiment of the application is related to a kind of file pre-add support method.The application embodiment can be, but not limited to Implemented based on electronic equipment, electronic equipment can be the terminals such as mobile phone, computer, tablet computer, smart television.Application program At runtime, it needs to read data file and/or configuration file is run.The file of present embodiment includes data file And/or configuration file.Wherein, it can be, but not limited to include using data in data file.
The realization details of the file pre-add support method of present embodiment is specifically described below, the following contents is only The realization details for understanding and providing is provided, is not limited to implement the necessary of this programme.
As shown in Figure 1, file pre-add support method includes:
Step 101, the corresponding relationship of storage file and application program in the database in advance.Wherein, with application program pair The file answered, to need in the application program operational process using the file arrived.For example, can make in an application program operational process Use data file or configuration file.Data file can be the various files such as image, text, audio, video;Configuration file It is various to can be size and location of procedural item, screen color, network connection, printer connection, mouse setting and window etc. File.Terminal device can get the corresponding relationship of file and application program from the server of network side, and store to local Database in.Moreover, in practical applications, can also be synchronized with the server of network side, to update the file saved With the corresponding relationship of application program.
In the present embodiment, it the instruction information of storage file and the corresponding of application package name can close in the database System, the corresponding relationship as storage file and application program.Wherein, the instruction information of file may include path and the text of file The title of part.Since the information in database can store in external memory, the information in database can't be because of terminal Power down/restart and lose so that the corresponding relationship of file and application program, can be stable be stored in terminal.
It should be noted that present embodiment to how " the instruction information and application program of storage file in the database The corresponding relationship of packet name " is with no restrictions.In the present embodiment, can in such a way that table stores storage file in the database Instruction information and application package name corresponding relationship.
It should be noted that multiple files may be used when each application program is run.I.e. an application program can be right Answer multiple files.In addition, different application programs is it is also possible that with identical file.I.e. a file can correspond to multiple and different Application program.
In some embodiments, it can store in database when multiple application programs and application program are run using arriving The corresponding relationship of file.As shown in table 1, the corresponding file name of application program for wrapping entitled A is file 1, the file road of file 1 Diameter is path 1;The corresponding file name of application program of the entitled A of the packet is path 2 there are also file 2, the file path of file 2 Deng.Wherein, table 1 only as an example, type and number to the application program stored in database with no restrictions, to each application Corresponding file number is with no restrictions when program is run.In addition, by table 1 it is found that application program different in present embodiment At runtime, identical file may be used;I.e. same file may correspond to multiple and different application programs.
Table 1
The database of present embodiment is not limited to the instruction information and application program of the storage file in such a way that table stores The corresponding relationship of packet name the instruction information of storage file and can also apply journey in other manners according to the demand of actual design The corresponding relationship of sequence packet name.Present embodiment is without limitation.
Step 102, judge whether to detect the open command of application program.If it is, entering step 103;Otherwise, it returns Return step 102.
As shown in Fig. 2, being illustrated by taking Android system as an example, wherein Android system includes: application layer 21 (applications layers), ccf layer 22 (framework layers), system class libraries layer 23 (libc layers), system kernel layer 24 (linuxkernel layers).
Application layer 21 (applications layers), including the application program run on Android virtual machine, such as browser, connection It is people, calendar and other applications.User can operate the application program in application layer 21.
Ccf layer 22 (framework layers), refers to the core of Android application and development, provides various necessary to exploitation Basic API framework.Such as ccf layer 22 has packet name record, application management, the various service functions of back-stage management.
System class libraries layer 23 (libraries layers), in order to support upper layer application, Android system passes through some C/ in this layer Modules or component used in us are supported in the library C++.System class libraries layer 23 includes function library and Android performing environment.Letter Number library includes other functions such as web, open, sql, the environment such as Android performing environment such as dv virtual machine, java function library.
System kernel layer 24 (kernel layers of linux), mainly realizes file system, memory management, process scheduling, process Between communicate, the functions such as power management and driving.Such as realize display driving, camera driving, WiFi driving other function.In system Stratum nucleare 24 is communicated with the hardware other than Android framework.
When user needs to open some application program in application layer 21, user can carry out a use to the application program In the specific operation for opening program.For specific operation to open program is clicking operation, when ccf layer 22 detects user When to the clicking operation of the icon of some application program in desktop, that is, it is considered as the open command for detecting the application program, To trigger the unlatching of application program, and enter step 103.
Step 103, the corresponding relationship stored in the application program and database opened according to open command, lookup are answered with this With the corresponding file of program, and the file found is loaded onto memory.
In the present embodiment, (some application is opened when there is application program to be opened and show to terminal interface Program), the application management service function of ccf layer 22 can record which application program is opened, and can will apply The information such as the packet name of program are sent to the service unit that this layer has back-stage management service by the local finger daemon of this layer, And the packet name in relation to the application program can be recorded by packet name writing function.There ought be application program to be opened and show to end When holding interface, the packet name of the application program can be recorded in the ccf layer 22 of Android system.
Since the corresponding relationship of documentary instruction information and application package name being stored in advance in database, it can To search corresponding with application program file instruction information in the Bao Mingcong database according to application program, and according to finding File indicates information, file is got from the external memory of storage file, and the file that will acquire is loaded onto memory.
Wherein, file instruction information includes the title of file and the path of file.I.e. according to the title of the file found With the path of file, the file that may use when getting application program operation, and the file that will acquire be loaded onto it is interior In depositing.
Step 104, the file of load in memory is directly read during the application program operation being opened.Due to In application program launching, the file that may be used in operational process is loaded onto memory, therefore, in application program If you need to use some file during operation, the file loaded in memory can be directly read, application program is improved The fluency of operation.Moreover, even if occurring failing to read required file in memory during application program is run Special circumstances (such as application program has a upgrading, and it is still that application program before upgrading is corresponding with file that terminal device, which saves, Relationship), required file can also be got from external memory again, and be loaded into memory, to guarantee the smooth fortune of application program Row.Moreover, it is also possible to when there are the special circumstances, by the instruction information supplement of this document to the file and application program saved Corresponding relationship in, to realize automatically updating for the corresponding relationship of file and application program.
In practical applications, file loaded into memory can also be discharged in closing application program;Alternatively, unloading When carrying or deleting application program, file loaded into memory is deleted, for example, when application program unloads or deletes, it can be with According to the title for obtaining file corresponding with application program in the Bao Mingcong database of application program, will be added according to the title of file The file being downloaded in memory is deleted.Moreover, after the unloading or deletion for completing application program, it can also be in the corresponding relationship of preservation In, the application program of unloading and the corresponding relationship of file are deleted, so that the application program in the corresponding relationship saved, is terminal Equipment is possible to the application program opened.
In present embodiment, in application program launching, which is needed in the process of running using the file arrived It is loaded onto memory, rather than is needed in the operational process of application program using which file, then goes to obtain this document, and will acquire File be loaded onto memory.When relative to needing which file in the operational process of application program, then institute is obtained from external memory The file needed and the scheme loaded, since application program can directly read required file in operational process from memory, Without carrying out file load in the process of running, so as to promote the fluency of application program operation, help to match User demand.
Moreover, because the scheme that application program is loaded in operation, also results in required phase when application program operation It closes distribution of the file on external memory to disperse very much, causes file load further slack-off, application program operation is not more smooth;Cause This, present embodiment also can avoid when application program operation required associated documents the distribution dispersion on external memory the case where, To help further to promote the fluency of application program operation.
Although terminal device locally preserves the corresponding relationship of file and application program in present embodiment, actually answering It, can also be in the open command for detecting application program, from the clothes for the corresponding relationship for being stored with file and application program in It is engaged in device obtaining or directly inquiring in real time, i.e. the corresponding relationship of file and application program is stored in advance in network side, according to network The corresponding relationship of side storage, searches file corresponding with the application program being opened, and preloaded, details are not described herein.
The second embodiment of the application is related to a kind of file pre-add support method.In the application second embodiment, lead to It crosses when application program is run for the first time, the instruction information conduct of the file of records application program packet name and the application call The corresponding relationship of application program and file, and storing into database provides and a kind of effective and feasible file is indicated information It is related to need to load when the operation of subsequent applications program with a kind of specific implementation of the corresponding relationship write-in database of packet name File instruction information provides effective and feasible implementation.
As shown in figure 3, the file pre-add support method of present embodiment includes:
Step 301, judge whether to detect the open command for the first time of application program.If it is, entering step 302;It is no Then return step 301.Due to detecting that user is used for the icon of some application program in desktop when ccf layer 22 The specific operation (such as clicking operation) for opening the application program, will trigger the unlatching of the application program.Therefore, in this step In, if detecting that user has carried out the spy for being used to open the application program to the icon of some application program in desktop for the first time Fixed operation then determines the open command for the first time for detecting application program, opens the application program and show the application program To terminal interface, 302 are entered step.
Step 302, the packet name of application program is recorded into buffering.Increase in ccf layer 22 specifically, can use Packet name record functional module (as shown in Figure 2), come record terminal prospect apply packet name, in an application program by for the first time When opening and display to terminal interface (when starting application program for the first time), the functional module of the packet name record of ccf layer 22 will The packet name of application program is recorded into buffer (buffering).The functional module of prospect application packet name record passes through system kernel layer 24 I/O interface the packet name of application program is recorded into buffer (buffering), as shown in Figure 4.(251 are marked in figure indicates buffering Region) be the block address space opened up in memory 25, i.e., buffering (Buffer) is exactly to reserve to specify size in memory Memory space be used as the scratchpad area (SPA)s of data, using buffering, there are two benefits: 1, reducing actual physics and read and write number; 2, the position buffered has been assigned in creation, this block region of memory is reused always, it is possible to reduce is dynamically distributed and is returned Receive the number of memory space.
Step 303, detected file be opened operate when, obtain buffering in application program packet name.
Wherein, ccf layer 22 can reserve the function interface communicated with the open function in system class libraries layer 23, use To call the data of open function operation.Open function be generally used to open or create a file, can according to parameter come Customize the various parameters such as attribute and the user right of the file needed.First parameter is directed to want opening in open function File path name or filename.It, can be from the operation data of open function by heavy duty open function in present embodiment The middle title for obtaining the file being opened and path.In addition, the system class libraries layer 23 in present embodiment is relative to application layer For 21, actually this system class libraries layer 23 refers to the library (library) in Android frame, and libc is one in library Function library, in libc function library, libc function library is normally stored in external memory open function.Ccf layer 22 passes through system kernel I/O interface in layer 24 obtains the packet name of application program from buffering.
Step 304, by record the process by the instruction information of the file for the operation that is opened, as the application program in buffering Packet name corresponding to file instruction information, be written database in, to store application package name and file in the database Instruction information corresponding relationship.
Specifically, the file being opened is indicated pair of the packet name of information and acquisition by the record the process in ccf layer 22 It should be related to and database is written by the I/O interface in system kernel layer 24.The file being opened is indicated to believe by record the process Database is written in breath and the corresponding relationship of packet name, is easy to implement.Further, remembered by the record thread in record the process Record can to realize corresponding relationship with less system resource since the occupied system resource of record thread is less Write-in.
Wherein, the instruction information of file includes at least the path of file and the title of file.Database (marks in such as figure Region represented by 261) it is the one piece of region for storage file instruction information and packet name corresponding relationship established in external memory 26. File is indicated that database is written in the corresponding relationship of information and packet name through the above way, to provide a kind of effective and feasible A kind of specific implementation that file is indicated to the corresponding relationship write-in database of information and packet name, runs for subsequent applications program When need to load associated documents instruction information provide effective and feasible implementation.
Present embodiment can be, but not limited in table form the instruction information and application of storage file in the database The corresponding relationship of program-package name the instruction information of storage file and can also answer in other manners according to the demand of actual design With the corresponding relationship of program-package name.In the operational process of each application program, may use to a file, it is also possible to use Multiple files.
Step 305, judge whether the application program being currently turned on is preset objective optimization program.If it is, into Enter step 306;Otherwise, return step 305.
In the present embodiment, when currently having application program to be opened, the packet name for the application program being opened, and root are obtained It whether is preset objective optimization program according to the application program that the packet name judgement of acquisition is currently turned on.And this step Detection process specifically: ccf layer 22 is communicated by the I/O interface in system kernel layer 24 with buffering, and the buffering is obtained In application program packet name, and whether be that preset target is excellent according to the application program that is currently turned on of the packet name of acquisition judgement Change program.It should be noted that being not limited by aforesaid way in actual design process and judging the application program being currently turned on It whether is objective optimization program, present embodiment is without limitation, above as just citing.
Objective optimization program can be an application program, be also possible to multiple application programs.Objective optimization program can be with By user's self-setting, can also be arranged by the system default of terminal.For example, a white list can be set in terminal, it is white Application program in list is objective optimization program.Alternatively, can also be by the classification of one application program of setting, to be arranged Objective optimization program, such as classification of setting are game class, as long as then the classification of application program is game class, which is Objective optimization program.
In addition, it is noted that in practical applications, the application program in the corresponding relationship of storage can be mesh Mark optimization program can increase a judgment step that is, before step 304, judge that the packet name of the application program in buffering is The no packet name for objective optimization program then executes step 304 again, passes through record the process if it is the packet name of objective optimization program By the instruction information of the file for the operation that is opened, the instruction of file corresponding to the packet name as the application program in buffering is believed Breath is written in database;If the packet name of the application program in buffering, is not the packet name of objective optimization program, then without note Record.By this design, family or the customized objective optimization program for needing to optimize of system, the mesh only optimized to needs can be used Mark optimization program carries out file preloading, furthermore, it is possible to reduce the corresponding relationship of store files and application program institute in database The space needed also further improves the efficiency for searching optimization application respective file.
Step 306, it according to the corresponding relationship stored in the application program and database being opened, finds out and is opened The corresponding file of application program, and the file found out is loaded onto memory.
Specifically, according to the " correspondence of file instruction information and packet name stored in the Bao Mingcong database of application program The title and the application program pair of file corresponding to the file that may be used when application program operation are searched in relationship " The path for the file answered, the file that gets file according to the title of file and path, and will acquire are loaded onto memory, specifically Above-mentioned file can be loaded onto region represented by mark 252 in figure.
In actual application, the priority of file can also be preset, specifically, can be according to the use time of file The frequency of use of number, the size of file or file presets the priority of file.When above-mentioned file is loaded onto memory, The higher file of priority ratio is first loaded according to the priority of the occupancy of memory, the size of file and file.Specifically, When the file found out to be loaded onto memory, the size of the occupancy of memory and each file is checked first, if The occupancy of memory is larger (existing memory can be smaller using space), can choose the higher file of priority and is loaded onto memory In.Alternatively, space, i.e., existing memory can be utilized when the memory headroom that the file found out needs to occupy is greater than existing memory When using insufficient space to store the above-mentioned All Files found, the higher file of priority can be first loaded.
For example, below only as an example, further limitation is not done to present embodiment, according to the file of above-mentioned lookup Indicate that the file that information determines is P, L, M, N, and the sum of size of these files is W1, existing memory can be using space W2.If W1 is greater than W2, existing memory can be using insufficient space to store the above-mentioned All Files found.At this point, needing The higher file of priority (such as file P, L, M) first to be loaded into memory.Certainly, it alternatively realizes, it can also be pre- If a memory usage thresholding, if the occupancy of current memory is greater than the memory usage thresholding of setting, selection is preferential The higher file of grade is loaded onto memory.
For example, File Privilege is set for being described in detail so that application program is QQ as an example, but not will The setting means of File Privilege is further limited, is illustrative only:
For example, the file used during the operation of first time QQ is F1, F2, F3, F4, F5 etc., the fortune of second of QQ The file that uses is F1, F2, F3, F6, F7 etc. during row, the file use in the operational process of third time QQ be F1, F2, F3, F8, F9 etc., preset times 3.The access times of file F1, F2, F3 reach preset times 3, it is possible to determine that file F1, F2, F3 are the file being commonly used when application program is run, therefore determine that file F1, F2, F3 are the higher file of priority.File The access times of F4, F5, F6, F7, F8, F9 are less than preset times 3, it is possible to determine that file F4, F5, F6, F7, F8, F9 are not answered The file being commonly used when being run with program, therefore determine that file F4, F5, F6, F7, F8, F9 are the lower file of priority.Existing Some memories can complete whole loads of required file in QQ operational process using insufficient space, alternatively, current memory When occupancy is greater than the memory usage thresholding of setting, it may be selected only to load F1, F2, F3.
Step 307, the file of load in memory is directly read during the application program operation being opened.Specifically , application program can directly read the file recorded in memory by the I/O interface in system kernel layer 24 and bring into operation.
In present embodiment, application program on startup, can directly obtain corresponding file instruction from database Information, the file needed when indicating that information runs application program according to file are loaded onto memory, and in the application being opened The file of load in the memory is directly read in the operational process of program, rather than is needed in the operational process of application program Which using file, then go this document being loaded onto memory.Relative to application program in operation load document to the side of memory The time of case, this programme consumption is shorter, can promote the fluency of application program operation, helps to match user demand.And Load document is to the scheme of memory in operation for application program, and required associated documents exist when also resulting in application program operation Distribution on external memory disperses very much, causes file load further slack-off, application program operation is not more smooth;But this programme exists When application program launching, just by need using to file be loaded onto memory, allow application program in operational process directly from interior File needed for depositing reading avoids required when application program operation without carrying out file load in the process of running The associated documents wanted are the case where the distribution on external memory disperses, to facilitate the smoothness for further promoting application program operation Degree.
The third embodiment of the application is related to a kind of file pre-add support method.Third embodiment is in first embodiment On the basis of improved, mainly the improvement is that: in the present embodiment, search with unlatching application program it is corresponding Before file, the occupancy of current memory is first judged.If the occupancy of current memory is greater than or equal to preset occupancy Thresholding, then without the preloading of file, if it is decided that the occupancy of current memory is less than preset occupancy thresholding, then again File corresponding with the application program being opened is found out, and the file found out is loaded onto memory.
Detailed process is as shown in figure 5, in step 501, and storage file and the corresponding of application program are closed in the database in advance System.This step is similar with step 101, and details are not described herein.
In step 502, judge whether the open command for detecting application program.If it is, entering step 503;Otherwise, Return step 502.This step is similar with step 102, and details are not described herein.
In step 503, judge whether the occupancy of current memory is less than preset occupancy thresholding.Wherein, occupancy door Limit can be set based on experience value.If it is determined that being less than preset occupancy thresholding, then 504 are entered step, if it is determined that being greater than or waiting In preset occupancy thresholding, then 506 are entered step, in the operational process of application program, required text is obtained from external memory Part is simultaneously loaded onto memory.
In step 504, the corresponding relationship that stores in the application program and database opened according to open command, search with The corresponding file of the application program, and the file found is loaded onto memory, and enter step 505, it is answered what is be opened The file of load in memory is directly read during being run with program.Step 504 and step 505 respectively with step 103 and Step 104 is similar, and details are not described herein.
Step 506, in the operational process of application program, required file is obtained from external memory and is loaded onto memory.
In the present embodiment, it is distinguished according to loading method of the current memory usage to file, for working as Preceding memory usage not yet exceeds this case that preset occupancy thresholding, in application program launching, by the application program Need in the process of running using to file be loaded onto memory, and directly read in the operational process for the application program being opened The file of load in the memory, can promote the fluency of application program operation;Surpass for current memory usage Out this case that preset occupancy thresholding, using in the operational process of application program, needing using which file, then from outer It deposits middle acquisition this document and is loaded onto the mode of memory, can effectively mitigate the use burden of current memory source.
The 4th embodiment of the application relates to a kind of file pre-load means.As shown in fig. 6, file pre-load means packet It includes: searching module 42, in the open command for detecting application program, file according to the pre-stored data and application program Corresponding relationship searches file corresponding with the application program.Wherein, the file is to make in the application program operational process The file used.In specific implementation, the pre- of the corresponding relationship of file and application program can be realized by presetting module 41 First store.The mode that is stored in advance of file and the corresponding relationship of application program includes: when application program is run for the first time, and record is answered It uses program-package name and the instruction information of the file of the application call as the corresponding relationship of application program and file, and deposits Storage is into database;Alternatively, obtaining the corresponding relationship of file and application program from network side, and store into database.
Preloaded components 43, the corresponding file for finding out the searching module are loaded onto memory.
Module 44 is run, for directly reading the file of load in the memory during running application program.
In present embodiment, application program on startup, can directly obtain corresponding file instruction from database The instruction information of information, file includes at least the path of file and the title of the file.Indicate that information will be applied according to file The file that program needs when running is loaded onto memory, and load is directly read in the operational process for the application program being opened File in the memory, rather than need in the operational process of application program using which file, then go to add this document It is loaded onto memory.Relative to application program, in operation, for load document to the scheme of memory, the time of this programme consumption is shorter, can be with The fluency for promoting application program operation helps to match user demand.And application program in operation load document to interior The scheme deposited, distribution of the required associated documents on external memory disperses very much when also resulting in application program operation, leads to file Load is further slack-off, and application program operation is not more smooth;But this programme is in application program launching, will just need using arriving File be loaded onto memory, so that application program is directly read required file from memory in operational process, without File load is carried out in the process of running, avoids distribution point of the required associated documents on external memory when application program operation Scattered situation, to facilitate the fluency for further promoting application program operation.
Fifth embodiment of the invention is related to a kind of file pre-load means.As shown in fig. 7, comprises: searching module 42 is used In in the open command for detecting application program, the corresponding relationship of file according to the pre-stored data and application program, search with The corresponding file of the application program.Wherein, the file is the file used in the application program operational process.Having When body is realized, being stored in advance for the corresponding relationship of file and application program can be realized by presetting module 41.Preload mould Block 43, the corresponding file for finding out the searching module are loaded onto memory.Module 44 is run, for transporting The file of load in the memory is directly read during row application program.
Wherein, presetting module 41 includes: record sub module 411, is used for when starting application program for the first time, by the application The packet name of program is recorded into buffering.Acquisition submodule 412, for detected file be opened operate when, described in acquisition The packet name of application program in buffering.Submodule 413 is written, for making the instruction information of the file of the operation that is opened The instruction information of file corresponding to packet name for the application program in the buffering is written in database.Wherein, submodule is written Block 413, specifically for passing through record the process by the instruction information of the file of the operation that is opened, as answering in the buffering The instruction information of file corresponding to packet name with program is written in database.
In specific implementation, the application program that presetting module 41 is written in the corresponding relationship of database can be that target is excellent Change program.Searching module 42 can first judge that currently detected unlatching refers to before searching file corresponding with application program Enable whether the application program opened is preset objective optimization program, if the application program that open command is opened is objective optimization journey Sequence searches file corresponding with the application program being opened then further according to application program and the corresponding relationship.For example, can be with By obtaining the packet name for the application program that currently detected open command is opened, answering for open command unlatching is judged according to packet name With program whether be preset objective optimization program mode, the application program for judging that currently detected open command is opened is No is preset objective optimization program.
The application sixth embodiment is related to a kind of file pre-load means.As shown in Figure 8, comprising: searching module 42 is used In in the open command for detecting application program, the corresponding relationship of file according to the pre-stored data and application program, search with The corresponding file of the application program.Wherein, the file is the file used in the application program operational process.Having When body is realized, being stored in advance for the corresponding relationship of file and application program can be realized by presetting module 41.Preload mould Block 43, the corresponding file for finding out the searching module are loaded onto memory.Module 44 is run, for transporting The file of load in the memory is directly read during row application program.
The file pre-load means of present embodiment further include: judgment module 46, for searching and the application program Before corresponding file, the occupancy of current memory is judged.Searching module 42, it is current specifically for determining in judgment module 46 When the occupancy of memory is less than preset occupancy thresholding, then search file corresponding with the application program being opened.
The 7th embodiment of the application is related to a kind of electronic equipment.Electronic equipment includes at least one processor;And with The memory of at least one processor communication connection;Wherein, the memory be stored with can by it is described at least one processing The instruction that device executes, described instruction execute the file in first or second embodiment by least one described processor and preload Method.Wherein, memory and processor connects using bus mode, bus may include any number of interconnection bus with Bridge, bus is by one or more processors together with the various circuit connections of memory.Bus can also such as will be set periphery Standby, voltage-stablizer is together with various other circuit connections of management circuit or the like, and these are all it is known in the art, Therefore, it will not be further described herein.
Bus interface provides interface between bus and transceiver.Transceiver can be an element, be also possible to multiple Element, such as multiple receivers and transmitter, provide the unit for communicating over a transmission medium with various other devices.Through locating The data of reason device processing are transmitted on the radio medium by antenna, and further, antenna also receives data and by data transmission To processor etc..Processor is responsible for managing bus and common processing, can also provide various functions, including timing, periphery connects Mouthful, voltage adjusting, power management and other control functions.And memory can be used for storage processor when executing operation Used data.
As shown in figure 9, the electronic equipment may include: memory 601,602 (Central of central processor CPU Processing Unit, abbreviation processor), the memory 601, for storing executable program code;The processor 602 is corresponding with the executable program code to run by reading the executable program code stored in the memory 601 Program, with for executing:
In the open command for detecting application program, the corresponding relationship of file according to the pre-stored data and application program, Search file corresponding with the application program;Wherein, the file is the text used in the application program operational process Part;The corresponding file found out is loaded onto memory, and is directly read in the operational process of the application program The file of load in the memory.
The electronic equipment further include: Peripheral Interface 603, RF circuitry 605, voicefrequency circuit 606, loudspeaker 611, electricity Source control chip 608, input/output (I/O) subsystem 609, touch screen 612, other input/control devicess 610 and outside Port 604, these components are communicated by one or more communication bus or signal wire 607.
It should be understood that illustrating the example that electronic equipment 600 is only electronic equipment, and electronic equipment 600 It can have than shown in the drawings more or less component, can combine two or more components, or can be with It is configured with different components.Various parts shown in the drawings can include one or more signal processings and/or dedicated It is realized in the combination of hardware, software or hardware and software including integrated circuit.Below with regard to electronic equipment provided in this embodiment It is described in detail, which takes the mobile phone as an example.
Memory 601, the memory 601 can be accessed by CPU 602, Peripheral Interface 603 etc., the memory 601 It may include high-speed random access memory, can also include nonvolatile memory, such as one or more magnetic disk storages Part, flush memory device or other volatile solid-state parts.In the present embodiment, memory 601 includes memory 6011 and outer Deposit 6012;Wherein, for storage file and file and the corresponding relationship of application program, (i.e. database is located at external memory to external memory 6012 In 6012);A block address space is opened up in memory 6011 as buffer (buffering), which is used to record opening The packet name of application program.When searching file corresponding with open application program, according to the packet name recorded in buffer area, with And the corresponding relationship stored in database, file corresponding with the application program is found out from external memory 6012, and will find out Corresponding file be loaded onto memory 6011.
The peripheral hardware that outputs and inputs of equipment can be connected to 502 He of CPU by Peripheral Interface 603, the Peripheral Interface 603 Memory 601.
I/O subsystem 609, the I/O subsystem 609 can be by the input/output peripherals in equipment, such as touch screen 612 With other input/control devicess 610, it is connected to Peripheral Interface 603.I/O subsystem 609 may include 6091 He of display controller For controlling one or more input controllers 6092 of other input/control devicess 610.Wherein, one or more input controls Device 6092 processed receives electric signal from other input/control devicess 610 or sends electric signal to other input/control devicess 610, Other input/control devicess 610 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole clicks idler wheel.It is worth noting that input controller 6092 can with it is following any one connect: keyboard, infrared port, The indicating equipment of USB interface and such as mouse.
Touch screen 612, the touch screen 612 are the input interface and output interface between user terminal and user, can It is shown to user depending on output, visual output may include figure, text, icon, video etc..
Display controller 6091 in I/O subsystem 609 receives electric signal from touch screen 612 or sends out to touch screen 612 Electric signals.Touch screen 612 detects the contact on touch screen, and the contact that display controller 6091 will test is converted to and is shown The interaction of user interface object on touch screen 612, i.e. realization human-computer interaction, the user interface being shown on touch screen 612 Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 605 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 605 receives and sends RF letter Number, RF signal is also referred to as electromagnetic signal, and RF circuit 605 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 605 may include for executing The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 606 is mainly used for receiving audio data from Peripheral Interface 603, which is converted to telecommunications Number, and the electric signal is sent to loudspeaker 611.
Loudspeaker 611 is reduced to sound for mobile phone to be passed through RF circuit 605 from the received voice signal of wireless network And the sound is played to user.
Power management chip 608, the hardware for being connected by CPU602, I/O subsystem and Peripheral Interface 603 are supplied Electricity and power management.
Present embodiment is and the mutual corresponding equipment embodiment of first or second embodiment, therefore present embodiment Can work in coordination implementation with first or second embodiment.The relevant technical details mentioned in first or second embodiment are at this In embodiment still effectively, the attainable technical effect of institute is also same in the present embodiment in first or second embodiment Sample may be implemented, and in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment It can be applicable in first or second embodiment.
In present embodiment, application program on startup, can directly obtain corresponding file instruction from database Information, the file needed when indicating that information runs application program according to file are loaded onto memory, and in the application being opened The file of load in the memory is directly read in the operational process of program, rather than is needed in the operational process of application program Which using file, then go this document being loaded onto memory.Relative to application program in operation load document to the side of memory The time of case, this programme consumption is shorter, can promote the fluency of application program operation, helps to match user demand.And Load document is to the scheme of memory in operation for application program, and required associated documents exist when also resulting in application program operation Distribution on external memory disperses very much, causes file load further slack-off, application program operation is not more smooth;But this programme exists When application program launching, just by need using to file be loaded onto memory, allow application program in operational process directly from interior File needed for depositing reading avoids required when application program operation without carrying out file load in the process of running The associated documents wanted are the case where the distribution on external memory disperses, to facilitate the smoothness for further promoting application program operation Degree.
The 8th embodiment of the application is related to a kind of computer readable storage medium, is stored with computer program.Computer The file pre-add support method in the first, second or third embodiment is realized when program is executed by processor.
That is, it will be understood by those skilled in the art that all or part of the steps in realization above embodiment method is can Completed with instructing relevant hardware by program, which is stored in a storage medium, including some instructions to So that an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) execute each embodiment institute of the application State all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read- Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can be with Store the medium of program code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize the specific embodiment party of the application Formula, and in practical applications, can to it, various changes can be made in the form and details, without departing from spirit herein and model It encloses.

Claims (10)

1. a kind of file pre-add support method characterized by comprising
In the open command for detecting application program, the corresponding relationship of file according to the pre-stored data and application program is searched File corresponding with the application program;Wherein, the file is the file used in the application program operational process;
The corresponding file found out is loaded onto memory, and is directly read in the operational process of the application program The file of load in the memory.
2. file pre-add support method according to claim 1, which is characterized in that the file and the corresponding of application program are closed System the mode that is stored in advance include:
When application program is run for the first time, the instruction information of the file of records application program packet name and the application call is made For the corresponding relationship of application program and file, and store into database;Alternatively,
The corresponding relationship of file and application program is obtained from network side, and is stored into database.
3. file pre-add support method according to claim 2, which is characterized in that it is described when application program is run for the first time, Records application program packet name and the instruction information of the file of the application call are closed as application program and the corresponding of file System, comprising:
When starting application program for the first time, the packet name of the application program is recorded into buffering;
Detected file be opened operate when, obtain the packet name of the application program in the buffering;
By the instruction information of the file of the operation that is opened, text corresponding to the packet name as the application program in the buffering The instruction information of part is written in database.
4. file pre-add support method according to claim 3, which is characterized in that the instruction information of the file includes at least The title in the path of the file and the file.
5. file pre-add support method according to claim 1, which is characterized in that the application program in the corresponding relationship is equal For objective optimization program;According to the application program and the corresponding relationship, file corresponding with the application program is searched Before, the file pre-add support method further include:
Whether the application program for judging that currently detected open command is opened is preset objective optimization program;
When the application program that the open command is opened is the objective optimization program, according to the application program and described right It should be related to, search file corresponding with the application program being opened.
6. file pre-add support method according to claim 5, which is characterized in that the currently detected unlatching of the judgement refers to Enable whether the application program opened is preset objective optimization program, comprising:
Obtain the packet name for the application program that currently detected open command is opened;
It whether is preset objective optimization program according to the application program that the packet name of acquisition judges that the open command is opened.
7. file pre-add support method according to claim 1, which is characterized in that further include:
Before lookup file corresponding with the application program, the occupancy of current memory is judged;
If the occupancy of current memory is less than preset occupancy thresholding, then executes the lookup and the application program pair The file answered.
8. a kind of file pre-load means characterized by comprising
Searching module, in the open command for detecting application program, file according to the pre-stored data and application program Corresponding relationship searches file corresponding with the application program;Wherein, the file is to make in the application program operational process The file used;
Preloaded components, the corresponding file for finding out the searching module are loaded onto memory;
Module is run, for directly reading the file of load in the memory during running application program.
9. a kind of electronic equipment characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out the preloading of the file as described in any one of claims 1 to 7 Method.
10. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located Reason device realizes file pre-add support method described in any one of claims 1 to 7 when executing.
CN201810928017.1A 2018-08-15 2018-08-15 File preloads method, apparatus, electronic equipment and computer readable storage medium Pending CN109284142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810928017.1A CN109284142A (en) 2018-08-15 2018-08-15 File preloads method, apparatus, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810928017.1A CN109284142A (en) 2018-08-15 2018-08-15 File preloads method, apparatus, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109284142A true CN109284142A (en) 2019-01-29

Family

ID=65183545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810928017.1A Pending CN109284142A (en) 2018-08-15 2018-08-15 File preloads method, apparatus, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109284142A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321179A (en) * 2019-07-08 2019-10-11 深圳市迅雷网络技术有限公司 A kind of application program launching method, system, device and computer storage medium
CN110659081A (en) * 2019-09-10 2020-01-07 北京达佳互联信息技术有限公司 File processing method and device for program object and electronic equipment
CN112817648A (en) * 2019-10-31 2021-05-18 深圳市万普拉斯科技有限公司 Application program file preloading method and device and mobile terminal
CN113849245A (en) * 2021-09-23 2021-12-28 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN114461588A (en) * 2021-08-20 2022-05-10 荣耀终端有限公司 Method for adjusting pre-reading window and electronic equipment
CN116661882A (en) * 2022-11-22 2023-08-29 荣耀终端有限公司 Method for preloading applet, electronic device and storage medium
CN117112046A (en) * 2023-04-04 2023-11-24 荣耀终端有限公司 Application program starting method and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070028224A1 (en) * 2005-07-28 2007-02-01 Lite-On Technology Corporation Program initiation methods and embedded systems utilizing the same
CN103677920A (en) * 2013-12-11 2014-03-26 清华大学 Critical application program identifying and starting accelerating method and system
CN108228876A (en) * 2018-01-19 2018-06-29 维沃移动通信有限公司 A kind of method and mobile terminal for reading file data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070028224A1 (en) * 2005-07-28 2007-02-01 Lite-On Technology Corporation Program initiation methods and embedded systems utilizing the same
CN103677920A (en) * 2013-12-11 2014-03-26 清华大学 Critical application program identifying and starting accelerating method and system
CN108228876A (en) * 2018-01-19 2018-06-29 维沃移动通信有限公司 A kind of method and mobile terminal for reading file data

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321179A (en) * 2019-07-08 2019-10-11 深圳市迅雷网络技术有限公司 A kind of application program launching method, system, device and computer storage medium
CN110321179B (en) * 2019-07-08 2023-02-14 深圳市迅雷网络技术有限公司 Application program starting method, system, device and computer storage medium
CN110659081A (en) * 2019-09-10 2020-01-07 北京达佳互联信息技术有限公司 File processing method and device for program object and electronic equipment
CN110659081B (en) * 2019-09-10 2022-12-27 北京达佳互联信息技术有限公司 File processing method and device for program object and electronic equipment
CN112817648A (en) * 2019-10-31 2021-05-18 深圳市万普拉斯科技有限公司 Application program file preloading method and device and mobile terminal
CN114461588A (en) * 2021-08-20 2022-05-10 荣耀终端有限公司 Method for adjusting pre-reading window and electronic equipment
CN113849245A (en) * 2021-09-23 2021-12-28 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN113849245B (en) * 2021-09-23 2023-09-12 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN116661882A (en) * 2022-11-22 2023-08-29 荣耀终端有限公司 Method for preloading applet, electronic device and storage medium
CN116661882B (en) * 2022-11-22 2024-04-16 荣耀终端有限公司 Method for preloading applet, electronic device and storage medium
CN117112046A (en) * 2023-04-04 2023-11-24 荣耀终端有限公司 Application program starting method and electronic equipment
CN117112046B (en) * 2023-04-04 2024-05-10 荣耀终端有限公司 Application program starting method and electronic equipment

Similar Documents

Publication Publication Date Title
CN109284142A (en) File preloads method, apparatus, electronic equipment and computer readable storage medium
US20200342338A1 (en) Method for preloading application, storage medium, and terminal
WO2019228156A1 (en) Method and device for preloading application, storage medium and intelligent terminal
US10631361B2 (en) Method and apparatus for providing user with information received by electronic device
CN108228305A (en) Display methods, device, storage medium and the electronic equipment of five application page
US11099861B2 (en) Method for preloading application, storage medium, and terminal
CN108363528B (en) Application page starting method and device, storage medium and electronic equipment
JP7098757B2 (en) How to implement application functions and electronic devices
WO2018120813A1 (en) Smart recommendation method and terminal
WO2020155014A1 (en) Smart home device sharing system and method, and electronic device
CN108287918B (en) Music playing method and device based on application page, storage medium and electronic equipment
US20170185248A1 (en) Electronic device and method of managing application programs thereof
CN105955766A (en) Method and device for application preloading
CN106445647B (en) Open the data manipulation method, device and mobile terminal of application more
US20220358089A1 (en) Learning-Based Keyword Search Method and Electronic Device
US20150220247A1 (en) Electronic device and method for providing information thereof
CN107678823A (en) Control method, device and the storage medium and mobile terminal of mobile terminal application
CN109408136A (en) Information processing method, device, storage medium and electronic equipment
CN106484547A (en) A kind of management method, device and terminal for opening application more
CN111512286A (en) Method for arranging program and electronic equipment
CN107402625B (en) Touch screen scanning method and device, terminal and computer readable storage medium
CN105871695A (en) Emoji sending method and device
CN111970401A (en) Call content processing method and electronic equipment
US20150281394A1 (en) Data sharing method and electronic device thereof
CN106445671A (en) Application program management method and device and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination