CN109542531B - File layout adjustment method and device - Google Patents

File layout adjustment method and device Download PDF

Info

Publication number
CN109542531B
CN109542531B CN201811261888.9A CN201811261888A CN109542531B CN 109542531 B CN109542531 B CN 109542531B CN 201811261888 A CN201811261888 A CN 201811261888A CN 109542531 B CN109542531 B CN 109542531B
Authority
CN
China
Prior art keywords
file
application
optimized
list
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811261888.9A
Other languages
Chinese (zh)
Other versions
CN109542531A (en
Inventor
魏剑锋
杨琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201811261888.9A priority Critical patent/CN109542531B/en
Publication of CN109542531A publication Critical patent/CN109542531A/en
Application granted granted Critical
Publication of CN109542531B publication Critical patent/CN109542531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for 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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

A method and an apparatus for adjusting a file layout are disclosed. A method of adjusting a layout of a file, the method comprising: determining an application to be optimized; for the application to be optimized, determining a file identifier corresponding to a file required by the application to be optimized during cold start; determining a first file identifier list and a second file identifier list, wherein the first file identifier list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed; integrating the first file identification list and the second file identification list; and adjusting the current file layout of all files included in the application to be optimized according to the integration result.

Description

File layout adjustment method and device
Technical Field
The embodiment of the specification relates to the technical field of application optimization, in particular to a file layout adjusting method and device.
Background
With the continuous development of mobile terminal technology, the variety of applications on the mobile terminal is increasing. For example, a game application, a social application, a video playing application, an instant messaging application, a shopping application, and the like are installed on the mobile terminal at the same time. In order to improve the usage experience of the application, developers of the application gradually start to pay attention to the time required for the cold start of the application, for example, the time required for the cold start of the pay-per-view application is about 1708 ms. Optimizing the application to improve the starting performance of the cold start of the application, and reducing the time required by the cold start of the application is a problem to be solved at present. Applying cold start: when an application is started, the background of the operating system does not have a process of the application, and the operating system can recreate a new process to be allocated to the application.
The traditional application optimization scheme is as follows: the time required for the cold start of the application is reduced by optimizing the application in such a way that the source code of the application is optimized, i.e. modified.
Since the conventional application optimization scheme involves optimization of source code, it is necessary to consume a lot of time and effort of a developer.
Disclosure of Invention
In view of the above technical problems, an embodiment of the present specification provides a method and an apparatus for adjusting a file layout, and a technical scheme is as follows:
a method of adjusting a layout of a file, the method comprising:
determining an application to be optimized;
for the application to be optimized, determining a file identifier corresponding to a file required by the application to be optimized during cold start;
determining a first file identifier list and a second file identifier list, wherein the first file identifier list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
integrating the first file identification list and the second file identification list;
and adjusting the current file layout of all files included in the application to be optimized according to the integration result.
A document layout adjustment apparatus, the apparatus comprising:
the application determining module is used for determining the application to be optimized;
the file identification determining module is used for determining the file identification corresponding to the file required by the application to be optimized during cold start of the application to be optimized;
an identifier list determining module, configured to determine a first file identifier list and a second file identifier list, where the first file identifier list is: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
the integration module is used for integrating the first file identification list and the second file identification list;
and the file layout adjusting module is used for adjusting the current file layout of all files included in the application to be optimized according to the integration result.
According to the technical scheme provided by the embodiment of the specification, for the application to be optimized, the file identifier corresponding to the file required by the application in cold start is determined, the first file identifier list and the second file identifier list are integrated, the current file layout corresponding to all files included in the application to be optimized is adjusted according to the integration result, and then the number of times of real disk I/O can be effectively reduced, the cold start performance of the application is improved, and the time required by the cold start of the application is shortened by utilizing a cache mechanism based on the adjusted file layout in the next cold start of the application. For the developer, the time and the energy consumed by the developer for optimizing the application source code can be saved because the optimization of the application source code is not involved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of embodiments of the invention.
In addition, any one of the embodiments in the present specification is not required to achieve all of the effects described above.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a file layout adjustment method according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a document layout adjustment apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an apparatus for configuring a device according to an embodiment of the present disclosure.
Detailed Description
At present, various applications are applied to a mobile terminal, and due to the fact that a large number of services are rapidly on-line, starting performance of an application in a cold starting stage is not ideal, and use experience of a user is further influenced. In order to improve the use experience of the user on the application, the traditional optimization scheme can optimize the UI layout or optimize the code structure, so that the starting performance of the cold start of the application is improved, and the time required by the cold start of the application is reduced. However, this conventional optimization scheme is of little consequence, for example, it may only reduce the time required to apply a cold start by 10ms, and it may also consume a significant amount of time and effort from the developer.
In order to solve the above problems, the present specification considers from another point of view, and finds that applying a cold boot stage consumes a lot of time in a disk I/O (disk I/O, reading data of a certain sector from a disk or writing data into a certain sector of a disk by a command, the command generally notifies a beginning sector position of the disk, then gives a number of consecutive sectors that need to go back from the beginning sector, and simultaneously gives a corresponding operation of reading or writing, and the disk receives the command, and reads or writes data according to the command requirement, and one read or write data is a disk I/O), because applying the cold boot stage, there will be a lot of file read/write operations, and more real disk I/os will occur, if the number of times of these disk I/os can be reduced, the whole starting performance can be obviously improved, and the use experience of the whole application is further improved.
On a mobile terminal, for example, a bottom layer system of an Android system is a Linux system, a Linux file system has a Cache mechanism (Page Cache, Page Cache memory, Page Cache for short, and the size is usually 4K, and when a file is read and written, it is used for caching the logical content of the file, thereby accelerating access to an image and data on a disk), and when data is read from the disk each time, the Linux file system reads the data according to the size of 16 × 4K by default and puts the read data into a Cache, and if the data corresponding to the next read file is already in the Cache, real disk I/O does not occur, but the data is directly read from the Cache, which is compared with reading the data from the Cache, and it takes much time to read the data from the disk. If the file to be read next time is located behind the file to be read this time in the file arrangement layout, the file is placed into the cache with a high probability that the corresponding data is read from the disk at the same time when the file is read this time, so that one real disk I/O is reduced. For example, for A, B two files 1K each, if B is arranged behind a, when reading the a file, the read space of 16 × 4K reads the data corresponding to the B file and places the data corresponding to the B file in the buffer while reading the data corresponding to the a file from the disk, so that when reading the B file, real disk I/O does not occur, and the data corresponding to the B file is directly read from the buffer.
According to the thought, if the application cold start stage can be measured, the files required by the application cold start are arranged together by adjusting the file layout, and the actual disk I/O times can be effectively reduced by utilizing a cache mechanism. Because the files included in the general application are basically sorted according to the default a-z and 0-9 sequences, the files required in the cold start stage of the application may irregularly exist in the files included in the application, for example, the required files are file a, file B and file C, the sizes of which are 1K respectively, based on the initial file layout, the actual disk I/O occurs 3 times when the required files are loaded in the cold start of the application, if the file layout is adjusted, the file a, the file B and the file C are arranged together, and the actual disk I/O occurs 1 time when the required files are loaded in the cold start of the application, the number of times of the actual disk I/O is effectively reduced, the start performance of the application can be improved, and the time required by the cold start of the application is reduced.
Based on the above analysis, the embodiments of the present specification provide a technical solution for adjusting a file layout, where for an application to be optimized, a file identifier corresponding to a file required by the application during cold start is determined, a first file identifier list and a second file identifier list are determined, wherein the first file identification list and the second file identification list can be obtained according to the file identification corresponding to the file required by the application in cold start, the first file identification list and the second file identification list are integrated, according to the integration result, adjusting the current file layout corresponding to all files included in the application to be optimized, and subsequently, when the application is cold started next time, utilizing a cache mechanism based on the adjusted file layout, the method can effectively reduce the number of times of real disk I/O, improve the cold start performance of the application and reduce the time required by the cold start of the application. For the developer, the time and the energy consumed by the developer for optimizing the application source code can be saved because the optimization of the application source code is not involved.
Specifically, the technical solutions provided in the embodiments of the present specification are as follows:
determining an application to be optimized; for the application to be optimized, determining a file identifier corresponding to a file required by the application to be optimized during cold start; determining a first file identifier list and a second file identifier list, wherein the first file identifier list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed; integrating the first file identification list and the second file identification list; and adjusting the current file layout of all files included in the application to be optimized according to the integration result.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of protection.
As shown in fig. 1, a schematic flow chart of a file layout adjustment method provided in an embodiment of the present specification may specifically include the following steps:
s101, determining an application to be optimized;
in this specification, a game application, a social application, a video playing application, an instant messaging application, a shopping application, and the like are installed on a mobile terminal at the same time, and when a cold start stage of a certain application needs to be optimized, the certain application may be manually specified, or the application to be optimized may be determined in an instruction form, that is, an instruction is manually input, where the instruction carries an identifier of the application, and when the instruction is received, the application to be optimized may be determined by the identifier carried in the instruction, for example, the application to be optimized is determined to be a pay treasure. There are many specific implementation manners for determining the application to be optimized, and the embodiments of this specification are not described herein any more.
S102, determining a file identifier corresponding to a file required by the application to be optimized during cold start for the application to be optimized;
and for the application to be optimized determined in the step S101, determining a file identifier corresponding to a file required by the application to be optimized during cold start. Specifically, there are various implementation manners for determining the file identifier corresponding to the file required by the application to be optimized during cold start, and this description exemplifies two implementation manners:
one implementation manner for determining the file identifier corresponding to the file required by the application to be optimized during cold start is as follows: and acquiring a file loading log generated when the application to be optimized is cold started based on the current file layout of all files included in the application to be optimized, and analyzing a loading record of a required file recorded in the file loading log to determine a file identifier corresponding to the required file when the application to be optimized is cold started. In order to conveniently determine the file identifier corresponding to the required file during the cold start of the application to be optimized, the file loading log is recorded while the required file is loaded at the loading stage of the cold start file of the application. When the application is in cold start based on the current file layout of all files, a file loading log is correspondingly generated, the file loading log generated when the application is in cold start is obtained, a loading record of a required file recorded in the file loading log is analyzed, the loading record at least comprises the loading time of the required file, the file name and size of the required file, a file directory, an application name and the like, the file name and size of the required file, namely the file identification of the required file can be obtained, and therefore the file identification corresponding to the required file when the application to be optimized is in cold start can be determined.
For example, for an application a including 10 files, the current 10 files are ordered in an order of a-z by default, based on the current file layout of the files, the file loading required by the application a in the cold start file loading stage is 4 files, the file loading log is generated by loading the file during the application a cold start, the loading record of the required file is analyzed from the file loading log, and the file names and sizes of the 4 files, such as a (1K), C (2K), D (1K), and F (2K), can be obtained from the loading record.
Another implementation manner for determining the file identifier corresponding to the file required by the application to be optimized during cold start is as follows: the method comprises the steps of obtaining a pre-compiled script, wherein the script is used for counting file behaviors when an application is in cold start, the file behaviors are whether a file has real disk I/O or not and whether the file hits a cache or not, the file with the disk I/O and the file with the cache hit is a file required when the application is in cold start, a file list and a file offset corresponding to the file required in the cold start stage of the application and whether the file has real disk I/O or the cache hit can be counted by using the script, a file identifier corresponding to each file can be obtained according to the file list, and the file identifier corresponding to the file required when the application to be optimized is in cold start can be determined.
For example, as shown in Table 1 below, the hit cache is 0 and a true disk I/O of 1 occurs.
Figure BDA0001844048570000071
TABLE 1
And obtaining the file identifier corresponding to the file required by the application to be optimized in cold start according to the file list. After determining the file identifiers corresponding to the files required by the application to be optimized in cold start, the current file layout can be adjusted according to the file identifiers.
S103, determining a first file identification list and a second file identification list, wherein the first file identification list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
for the file identifier corresponding to the file required by the application to be optimized in the cold start determined in S102, the first file identifier list and the second file identifier list may be determined according to the file identifiers.
And the first file identification list is composed of file identifications corresponding to the required files when the application to be optimized is in cold start, and the file identifications corresponding to the required files are sequenced. Preferably, the file identifiers corresponding to the required files may be sorted according to the loading time sequence of the required files when the application to be optimized is cold-started, so as to obtain a file identifier list.
For example, according to the loading time sequence of the required files when the application to be optimized is cold started, the file identifiers corresponding to the required files are sorted, so as to obtain a file identifier list, where the file identifier list may be: A. c, D, F, J, K, meaning that in the file load chronological order, the load chronological order of file A is ranked first, the load chronological order of file C is ranked second, and so on.
And a second file identifier list, which is composed of file identifiers corresponding to the remaining files, except the required file, included in the application to be optimized, and is obtained by sorting the file identifiers corresponding to the remaining files, except the required file, included in the application to be optimized according to an original default sorting rule, that is, by using an initial sorting rule, for example, by using an a-z and 0-9 default sorting rule, the file identifiers corresponding to the remaining files are still sorted according to an a-z and 0-9 default sorting rule to obtain the second file identifier list.
For example, the remaining files except the required file are ask B, file E, file G, file H, and file I, and the corresponding file identifiers are: B. e, G, H, I, the file identifiers corresponding to the remaining files are still sorted according to a-z and 0-9 default sorting rule to obtain a second file identifier list: B. e, G, H, I are provided.
S104, integrating the first file identification list and the second file identification list;
the first file identification list and the second file identification list are integrated to generate a third file identification list, the first file identification list can be specifically inserted into any position in the second file identification list to generate the third file identification list, namely, the first file identification list is regarded as a whole and inserted into any position such as the head, the tail and the middle of the second file identification list, and therefore a new file identification list can be generated.
For example, the first list of file identifications is: A. c, D, F, J, K, the second file identification list is: B. e, G, H, I, inserting the first file identification list into the second file identification list after B, the generated third file identification list is: B. a, C, D, F, J, K, E, G, H, I are provided.
S105, according to the integration result, adjusting the current file layout of all files included in the application to be optimized.
For the integration result obtained in S104, the current file layouts of all files included in the application to be optimized may be adjusted according to the integration result, that is, the arrangement order of all files included in the application to be optimized may be adjusted according to the integration result.
For example, according to the integration result, i.e., the third file identification list: B. a, C, D, F, J, K, E, G, H, I, adjusting the arrangement sequence of the file A, the file B, the file C, the file D, the file E, the file F, the file G, the file H, the file I, the file J and the file K included by the application, wherein the adjusted file layout is as follows: file B, file a, file C, file D, file F, file J, file K, file E, file G, file H, file I.
For applications on a mobile terminal, for example, files included in an application (for example, an Android system) on a mobile phone generally exist in a compressed form, for example, an APK (Android Package) file is actually in a Zip format, and in order to realize adjustment of file layout, a compression tool needs to be called by means of a compression tool, for example, a 7-Zip compression tool, so as to import a third file identifier list into the compression tool, execute a file compression function of the compression tool, and subsequently change the arrangement order of all files according to the third file identifier list, thereby achieving the purpose of adjusting the file layout.
Therefore, the files required by the application in cold start are arranged together, so that less real disk I/O can be generated, and the cold start performance is improved due to less real disk I/O generation based on the adjusted file layout when the subsequent application is subjected to the next cold start, thereby effectively reducing the time consumed by the cold start, wherein the effect pair is as shown in the following table 2:
Figure BDA0001844048570000091
TABLE 2
Through the above description of the technical solution provided in the embodiment of the present specification, for an application to be optimized, a file identifier corresponding to a file required by the application during cold start is determined, a first file identifier list and a second file identifier list are determined, the first file identifier list and the second file identifier list are integrated, a current file layout corresponding to all files included in the application to be optimized is adjusted according to an integration result, and then, when the application is cold started next time, based on the adjusted file layout, a cache mechanism is utilized, so that the number of times of real disk I/O can be effectively reduced, the cold start performance of the application is improved, and the time required by the cold start of the application is reduced. For the developer, the time and the energy consumed by the developer for optimizing the application source code can be saved because the optimization of the application source code is not involved.
With respect to the above method embodiment, an embodiment of the present specification further provides a file layout adjusting apparatus, and referring to fig. 2, the apparatus may include: an application determination module 210, a file identification determination module 220, an identification list determination module 230, an integration module 240, and a file layout adjustment module 250.
An application determination module 210 for determining an application to be optimized;
the file identifier determining module 220 is configured to determine, for the application to be optimized, a file identifier corresponding to a file required by the application to be optimized when the application to be optimized is cold started;
an identifier list determining module 230, configured to determine a first file identifier list and a second file identifier list, where the first file identifier list is: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
an integration module 240, configured to integrate the first file identifier list and the second file identifier list;
and a file layout adjusting module 250, configured to adjust current file layouts of all files included in the application to be optimized according to the integration result.
According to a specific embodiment provided in this specification, the file identifier determining module 220 is specifically configured to:
acquiring a file loading log generated when the application to be optimized is cold started based on the current file layout of all files included in the application to be optimized;
and analyzing the loading record of the required file recorded in the file loading log to determine the file identifier corresponding to the required file when the application to be optimized is in cold start.
According to an embodiment provided by the present specification, the integration module 240 is specifically configured to:
and inserting the first file identification list into any position in the second file identification list.
According to one embodiment provided in the present specification,
the first file identification list is: and sequencing the file identifications corresponding to the required files according to the loading time sequence of the required files when the application to be optimized is in cold start.
According to one embodiment provided in the present specification,
the second file identification list is: and sequencing the file identifications corresponding to the rest files except the required file included in the application to be optimized according to the original default sequencing rule.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
Through the above description of the technical solution provided in the embodiment of the present specification, for an application to be optimized, a file identifier corresponding to a file required by the application during cold start is determined, a first file identifier list and a second file identifier list are determined, the first file identifier list and the second file identifier list are integrated, a current file layout corresponding to all files included in the application to be optimized is adjusted according to an integration result, and then, when the application is cold started next time, based on the adjusted file layout, a cache mechanism is utilized, so that the number of times of real disk I/O can be effectively reduced, the cold start performance of the application is improved, and the time required by the cold start of the application is reduced. For the developer, the time and the energy consumed by the developer for optimizing the application source code can be saved because the optimization of the application source code is not involved.
Embodiments of the present specification further provide a computer device, as shown in fig. 3, the computer device may include: a processor 310, a memory 320, an input/output interface 330, a communication interface 340, and a bus 350. Wherein the processor 310, memory 320, input/output interface 330, and communication interface 340 are communicatively coupled to each other within the device via bus 350.
The processor 310 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present specification.
The Memory 320 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 320 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 320 and called to be executed by the processor 310.
The input/output interface 330 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 340 is used for connecting a communication module (not shown in the figure) to implement communication interaction between the present device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 350 includes a path that transfers information between the various components of the device, such as processor 310, memory 320, input/output interface 330, and communication interface 340.
It should be noted that although the above-mentioned device only shows the processor 310, the memory 320, the input/output interface 330, the communication interface 340 and the bus 350, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Embodiments of the present specification also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the foregoing file layout adjustment method. The method at least comprises the following steps:
a method of adjusting a layout of a file, the method comprising:
determining an application to be optimized;
for the application to be optimized, determining a file identifier corresponding to a file required by the application to be optimized during cold start;
determining a first file identifier list and a second file identifier list, wherein the first file identifier list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
integrating the first file identification list and the second file identification list;
and adjusting the current file layout of all files included in the application to be optimized according to the integration result.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
From the above description of the embodiments, it is clear to those skilled in the art that the embodiments of the present disclosure can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the embodiments of the present disclosure. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is only a specific embodiment of the embodiments of the present disclosure, and it should be noted that, for those skilled in the art, a plurality of modifications and decorations can be made without departing from the principle of the embodiments of the present disclosure, and these modifications and decorations should also be regarded as the protection scope of the embodiments of the present disclosure.

Claims (11)

1. A file layout adjusting method is suitable for adjusting the file layout of an application based on an Android system, and comprises the following steps:
determining an application to be optimized;
for the application to be optimized, determining a file identifier corresponding to a file required by the application to be optimized during cold start;
determining a first file identifier list and a second file identifier list, wherein the first file identifier list is as follows: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
integrating the first file identification list and the second file identification list;
and adjusting the current file layout of all files included in the application to be optimized according to the integration result.
2. The method of claim 1, wherein the determining a file identifier corresponding to a file required by the application to be optimized in cold start comprises:
acquiring a file loading log generated when the application to be optimized is cold started based on the current file layout of all files included in the application to be optimized;
and analyzing the loading record of the required file recorded in the file loading log to determine the file identifier corresponding to the required file when the application to be optimized is in cold start.
3. The method of claim 1, said integrating the first list of file identifications with the second list of file identifications, comprising:
and inserting the first file identification list into any position in the second file identification list.
4. The method according to any one of claims 1 to 3,
the first file identification list is: and sequencing the file identifications corresponding to the required files according to the loading time sequence of the required files when the application to be optimized is in cold start.
5. The method according to any one of claims 1 to 3,
the second file identification list is: and sequencing the file identifications corresponding to the rest files except the required file included in the application to be optimized according to the original default sequencing rule.
6. A file layout adjustment apparatus, the apparatus being adapted to adjust a file layout of an Android system based application, the apparatus comprising:
the application determining module is used for determining the application to be optimized;
the file identification determining module is used for determining the file identification corresponding to the file required by the application to be optimized during cold start of the application to be optimized;
an identifier list determining module, configured to determine a first file identifier list and a second file identifier list, where the first file identifier list is: the second file identifier list is composed of file identifiers corresponding to files required by the application to be optimized during cold start, and the file identifiers are as follows: the file identification corresponding to the rest files except the required file included in the application to be optimized is formed;
the integration module is used for integrating the first file identification list and the second file identification list;
and the file layout adjusting module is used for adjusting the current file layout of all files included in the application to be optimized according to the integration result.
7. The apparatus of claim 6, wherein the file identifier determining module is specifically configured to:
acquiring a file loading log generated when the application to be optimized is cold started based on the current file layout of all files included in the application to be optimized;
and analyzing the loading record of the required file recorded in the file loading log to determine the file identifier corresponding to the required file when the application to be optimized is in cold start.
8. The apparatus of claim 6, the integration module specifically to:
and inserting the first file identification list into any position in the second file identification list.
9. The device according to any one of claims 6 to 8,
the first file identification list is: and sequencing the file identifications corresponding to the required files according to the loading time sequence of the required files when the application to be optimized is in cold start.
10. The device according to any one of claims 6 to 8,
the second file identification list is: and sequencing the file identifications corresponding to the rest files except the required file included in the application to be optimized according to the original default sequencing rule.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when executing the program.
CN201811261888.9A 2018-10-26 2018-10-26 File layout adjustment method and device Active CN109542531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811261888.9A CN109542531B (en) 2018-10-26 2018-10-26 File layout adjustment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811261888.9A CN109542531B (en) 2018-10-26 2018-10-26 File layout adjustment method and device

Publications (2)

Publication Number Publication Date
CN109542531A CN109542531A (en) 2019-03-29
CN109542531B true CN109542531B (en) 2021-11-23

Family

ID=65845363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811261888.9A Active CN109542531B (en) 2018-10-26 2018-10-26 File layout adjustment method and device

Country Status (1)

Country Link
CN (1) CN109542531B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377051A (en) * 2013-07-16 2013-10-30 广东欧珀移动通信有限公司 Application interface customizing method based on Android system
CN106201574A (en) * 2016-06-22 2016-12-07 广东欧珀移动通信有限公司 A kind of startup method and device of application interface

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729671A (en) * 2009-12-31 2010-06-09 宇龙计算机通信科技(深圳)有限公司 Method for managing backup file, terminal thereof and system thereof
CN101814038B (en) * 2010-03-23 2012-10-03 杭州顺网科技股份有限公司 Method for increasing booting speed of computer
CN103914318A (en) * 2013-01-04 2014-07-09 腾讯科技(深圳)有限公司 Program starting method and device
CN104572139B (en) * 2013-10-10 2019-01-08 腾讯科技(深圳)有限公司 A kind of method and apparatus of accelerating application starting
US10296323B2 (en) * 2016-02-02 2019-05-21 ZeroTurnaround AS System and method for fast initial and incremental deployment of apps
CN106155750B (en) * 2016-07-29 2018-09-07 腾讯科技(深圳)有限公司 A kind of loading method and device of resource file

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377051A (en) * 2013-07-16 2013-10-30 广东欧珀移动通信有限公司 Application interface customizing method based on Android system
CN106201574A (en) * 2016-06-22 2016-12-07 广东欧珀移动通信有限公司 A kind of startup method and device of application interface

Also Published As

Publication number Publication date
CN109542531A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
US9740761B2 (en) Management of application state data
US20170097974A1 (en) Resolving conflicts within saved state data
US9558016B2 (en) Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
CN109614372B (en) Object storage and reading method and device and service server
CN109359118B (en) Data writing method and device
US10191838B2 (en) Method and device for checking influence of deleting cache file, and mobile terminal
CN106951521B (en) Method, device and system for reading and writing log file
CN107729246B (en) Auxiliary test method, device and equipment for target application and storage medium
US10664443B2 (en) Method and apparatus for presenting to-be-cleaned data, and electronic device
CN111611145B (en) Breakdown information collection method and device, storage medium and electronic equipment
CN111241040B (en) Information acquisition method and device, electronic equipment and computer storage medium
CN110221781B (en) Manufacturing method and device of disk fragments, storage medium and intelligent terminal
JP2018528634A (en) Method and device for previewing moving image and method and device for displaying expression package
CN112463634A (en) Software testing method and device under micro-service architecture
CN109933381A (en) A kind of loading method and device of kernel
CN111104178A (en) Dynamic library loading method, terminal device and storage medium
CN106484779B (en) File operation method and device
CN109542531B (en) File layout adjustment method and device
CN116628773A (en) Data processing method, device, electronic equipment and storage medium
CN111143258A (en) Method, system, device and medium for accessing FPGA (field programmable Gate array) by system based on Opencl
US10372333B2 (en) Electronic device and method for storing a file in a plurality of memories
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium
CN109656805B (en) Method and device for generating code link for business analysis and business server
CN113268221A (en) File matching method and device, storage medium and computer equipment
US9146720B1 (en) Binary file application processing

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant