CN112631609A - Compiling method, device, terminal and storage medium - Google Patents

Compiling method, device, terminal and storage medium Download PDF

Info

Publication number
CN112631609A
CN112631609A CN202110008345.1A CN202110008345A CN112631609A CN 112631609 A CN112631609 A CN 112631609A CN 202110008345 A CN202110008345 A CN 202110008345A CN 112631609 A CN112631609 A CN 112631609A
Authority
CN
China
Prior art keywords
operating system
terminal
partition
description file
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110008345.1A
Other languages
Chinese (zh)
Other versions
CN112631609B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110008345.1A priority Critical patent/CN112631609B/en
Publication of CN112631609A publication Critical patent/CN112631609A/en
Application granted granted Critical
Publication of CN112631609B publication Critical patent/CN112631609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

The disclosure relates to a compiling method, a compiling device, a terminal and a storage medium. The compiling method provided by the disclosure is applied to a terminal, and the terminal is provided with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs a first operating system; the compiling method comprises the following steps: updating the second operating system and mounting the second system partition after the second operating system is updated; acquiring a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program; before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.

Description

Compiling method, device, terminal and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a compiling method, apparatus, terminal, and storage medium.
Background
The android system can record a frequently used code, namely a hot spot code, in the execution process of the application program, and compile the hot spot code to generate a native code when the terminal is in a charging and idle (idle) state, so that the performance of the application program can be improved in the next use.
On the one hand, however, when the mobile phone downloads the update package on the remote server through an Over-the-Air (OTA) technology to update the version of the system, the file for recording the hot spot code and the native code generated based on the hot spot code are deleted, and the hot spot code needs to be compiled again when the updated mobile phone is in a charged and idle state again; on the other hand, with the development of battery technology, the battery capacity is larger and the charging speed is faster, and fewer users charge the mobile phone all night, so that the situation that the mobile phone enters a charging and idle state is reduced, hot spot codes cannot be compiled in time easily, and the performance of an application program is affected.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
According to one or more embodiments of the present disclosure, there is provided a compiling method applied to a terminal, where the terminal is installed with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system; the method comprises the following steps:
updating the second operating system and mounting the second system partition after the second operating system is updated;
acquiring a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program;
before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.
According to one or more embodiments of the present disclosure, there is provided a compiling apparatus applied to a terminal, where the terminal is installed with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system; the device comprises:
the second system mounting unit is used for updating the second operating system and mounting the second system partition after the second operating system is updated;
the system comprises a description file acquisition unit, a hot spot description file acquisition unit and a hot spot code acquisition unit, wherein the description file acquisition unit is used for acquiring a hot spot description file of at least one application program, and the hot spot description file is used for recording a hot spot code of the application program;
and the compiling unit is used for compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system before the terminal is restarted so as to generate native codes executed under the second operating system.
According to one or more embodiments of the present disclosure, there is provided a mobile terminal, characterized in that the mobile terminal includes:
at least one memory and at least one processor;
wherein the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the compiling method provided according to one or more embodiments of the disclosure.
According to one or more embodiments of the present disclosure, there is provided a non-transitory computer storage medium storing program code which, when run on a computer device, causes the computer device to perform a compiling method provided according to one or more embodiments of the present disclosure.
According to the compiling method provided by one or more embodiments of the disclosure, before the terminal is restarted after the second operating system is updated, the hotspot codes of the application program are compiled by using the hotspot description file of the second operating system based on the application program to generate the native codes executed under the second system, so that the problem that the hotspot description file cannot be compiled in time due to the fact that the system is updated and deleted can be avoided, the hotspot codes used by a new system can be compiled during the system updating period, and the hotspot codes are compiled without waiting until the terminal is in a charging and idle state, so that the native codes can be compiled at the first time, and the application performance can be improved in time.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a flowchart of a compiling method according to an embodiment of the disclosure;
fig. 2 is a flowchart of a compiling method according to another embodiment of the disclosure;
fig. 3 is an exemplary schematic structural diagram of a compiling apparatus according to an embodiment of the disclosure
Fig. 4 is a schematic structural diagram of a terminal device for implementing an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The term "responsive to" and related terms mean that one signal or event is affected to some extent, but not necessarily completely or directly, by another signal or event. If an event x occurs "in response" to an event y, x may respond directly or indirectly to y. For example, the occurrence of y may ultimately result in the occurrence of x, but other intermediate events and/or conditions may exist. In other cases, y may not necessarily result in the occurrence of x, and x may occur even though y has not already occurred. Furthermore, the term "responsive to" may also mean "at least partially responsive to". The term "determining" broadly encompasses a wide variety of actions that can include calculating, computing, processing, deriving, investigating, looking up (e.g., looking up in a table, a database or another data structure), ascertaining and the like, and can also include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and the like, as well as resolving, selecting, choosing, establishing and the like. Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the following, several technical terms related to the present disclosure will be explained first.
1. Hotspot Code (Hot Spot Code)
Hotspot code may refer to code that is executed more than a preset threshold number of times during application startup or use, including but not limited to functions, methods, code blocks, classes, and the like. For example, in a Client mode, the android system takes codes with execution times exceeding 1500 as hot spot codes; in a Server (Server) mode, the android system takes code with execution times exceeding 10000 as hot spot code.
2. Native Code (Native Code)
The native code is computer programming code that is compiled to run a particular processor (e.g., an intel x86 class processor) and its particular instruction set. Native code is code that has been compiled into processor-specific machine code and can be executed directly by a virtual machine.
3. Precompilation or AOT compilation (Ahead-of-time compilation)
Precompilation refers to the act of converting a higher level programming language (such as C or C + +) or intermediate code (such as Java bytecode or. NET Framework Common Intermediate Language (CIL) code) into native code to generate a binary file that can be natively executed. Compiling intermediate code during program execution (e.g., Just-in-time compilation) may degrade the performance of the application, while pre-compiling eliminates the need for this step by occurring before execution rather than during execution.
The compiling method provided by one or more embodiments of the present disclosure is applied to terminals, including but not limited to, devices such as televisions, smart screens, mobile phones, computers, electronic readers, PDAs (personal digital assistants), PADs (tablet computers), and the like; the terminal is provided with a first operating system and a second operating system, the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition. The first operating system and the second operating system may be the same version or different versions of the same operating system.
In some embodiments, the first system partition and the second system partition may be two separate sets of system partitions. Illustratively, each set of system partitions includes a respective boot partition, system partition, vendor partition, and the like.
In some embodiments, the terminal currently runs the first operating system, and referring to fig. 1, a compiling method 100 provided based on one or more embodiments of the present disclosure is shown, where the compiling method 100 includes:
step S101: updating the second operating system and mounting the second system partition after the second operating system is updated;
in this step, after the second operating system is updated, the second system partition is mounted so that the file of the second system partition can be accessed, which is equivalent to that the terminal runs the first operating system and the second operating system at the same time.
In some embodiments, the system update data may be obtained and written to the second system partition based on the first operating system currently running on the terminal. It should be noted that, when the system update data is written into the second system partition, the second system partition is not yet mounted, that is, only the first operating system is mounted on the current terminal, and only the first operating system is in an active state.
Illustratively, the terminal may download the system update package on the remote server via Over-the-Air (OTA) technology and write the system update package to the second system partition.
Step S102: the method comprises the steps of obtaining a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program.
Illustratively, the hotspot description file is a profile file, which is used to record hotspot codes of an application program and can be used for profile-guide compilation.
In some embodiments, the hotspot description files are stored in respective directories of the corresponding application programs, and the directories of the application programs are located in a user data (userdata) partition. The user data partition is used for storing user data, including application programs installed by users and data generated in use; the user data partition may be shared by the first operating system and the second operating system.
Further, in some embodiments, a hotspot description file for at least one application may be obtained from the user data partition.
It should be noted that, in this step, the hotspot description files of all the application programs installed in the terminal may be obtained, and also the hotspot description file of one or more specific application programs may be obtained, which is not limited in this disclosure.
Step S103: before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.
Illustratively, AOT compilation may be employed to compile dalvik bytecodes (dalvik bytecodes) as hot spot codes in the dex file into assembly instructions that the processor can recognize for execution, i.e., Native codes.
It should be noted that, in this step, hot spot codes of all application programs installed in the terminal may be compiled, and also hot spot codes of one or more specific application programs may be compiled, which is not limited herein.
In some embodiments, the generated native code may be saved in a specific folder, preventing the native code from being deleted as a result of the terminal restarting to run the updated operating system. Illustratively, the particular folder may be located in the second system partition.
According to the compiling method provided by one or more embodiments of the disclosure, before the terminal is restarted after the second operating system is updated, the hotspot codes of the application program are compiled by using the hotspot description file of the second operating system based on the application program to generate the native codes executed under the second system, so that the problem that the hotspot description file cannot be compiled in time due to the fact that the system is updated and deleted can be avoided, the hotspot codes used by a new system can be compiled during the system updating period, and the hotspot codes are compiled without waiting until the terminal is in a charging and idle state, so that the native codes can be compiled at the first time, and the application performance can be improved in time.
In some embodiments, the method 100 further comprises:
step S104: restarting the terminal;
illustratively, the first operating system may pop up a dialog box whether to restart, and restart the terminal in response to a user confirming an instruction to restart.
Step S105: after the terminal is restarted, loading the updated second operating system;
step S106: and storing the native code into a directory of a corresponding application program.
In this embodiment, after the terminal is restarted, the second operating system is started from the second system partition, and the first system partition is not mounted, so that switching from the first operating system to the updated second operating system is completed, and the compiled native code is stored in the directory of the corresponding application program, so that the native code can be directly executed when the updated second operating system is started and uses the corresponding application program, thereby improving the performance of the application program in time.
In some embodiments, the terminal is configured to alternately update the first system partition and the second system partition, so that the updated system can be provided with the native code of each application program by performing the steps at each system update, thereby improving the performance of the application program.
In some embodiments, the first operating system and the second operating system are a/B systems of an android platform.
The A/B system update (also called seamless update) of the android platform ensures that a system which can be normally started and used is reserved on a disk during the update of a wireless download (OTA) by setting two sets of system partitions (a slot A and a slot B) so as to reduce the possibility that a device cannot be started after the update. Under an A/B system, the system runs from the "current" slot, but during normal operation, the running system does not access partitions in unused slots. The method prevents the update problem by reserving the unused slot position as the backup slot position: if an error occurs during or just after the update, the system may roll back to the original slot and continue normal operation. Thus, in the A/B system of the android platform, only one system partition is mounted at the same time.
In contrast, according to one or more embodiments of the present disclosure, by modifying the system partition mount logic of the a/B system of the android platform, when the first system partition is mounted, the second system partition is mounted simultaneously after the second operating system is updated, so that the hot point code of the application can be compiled by the second operating system according to the hot point description to generate a native code executed under the second operating system, thereby achieving the completion of the compilation of the native code during the "seamless update" of the system, and it is not necessary to compile the hot point code again until the updated terminal is again in the charging and idle state, so that the compilation of the native code can be completed at the first time, and the application performance can be improved in time.
Referring to fig. 2, fig. 2 illustrates a compiling method 200 provided based on another embodiment of the present disclosure, applied to a terminal installed with a first operating system and a second operating system, where the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal has a user data partition shared by the first operating system and the second operating system; the compiling method 200 comprises the following steps:
step S201: under the condition that the terminal is mounted with the first system partition, acquiring a system update package based on the first operating system, and writing the system update package into the second system partition;
step S202: after the system updating package is written, mounting the second system partition;
step S203: acquiring a hotspot description file of at least one application program from a user data partition;
step S204: compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system;
step S205: restarting the terminal;
step S206: after the terminal is restarted, starting the updated second operating system from the second system partition, and not mounting the first system partition;
step S207: and storing the native code into a directory of a corresponding application program.
According to the compiling method provided by one or more embodiments of the disclosure, in the case that the first system partition is mounted, after the second operating system is updated, the second system partition is mounted at the same time, so that the second operating system can be used for compiling the application program based on the hotspot description file of the application program in the shared user data partition to generate native codes, the second operating system loaded after the terminal is restarted can execute the native codes, therefore, the problem that the hotspot description file cannot be compiled in time due to the fact that the system is updated and deleted can be avoided, the hotspot codes used by a new system can be compiled during the seamless updating period of the system, and the hotspot codes are not required to be compiled until the terminal is in a charging and idle state, so that the compiling of the native codes can be completed at the first time, and the application performance can be improved in time.
Correspondingly, fig. 3 illustrates a compiling apparatus 300 provided based on one or more embodiments of the present disclosure, which is applied to a terminal, and the terminal is installed with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system; the apparatus 300 comprises:
a second system mount unit 301, configured to update the second operating system and mount the second system partition after the second operating system is updated;
a description file obtaining unit 302, configured to obtain a hotspot description file of at least one application, where the hotspot description file is used to record a hotspot code of the application;
and a compiling unit 303, configured to compile, based on the updated second operating system, a hot spot code of at least one application program according to the hot spot description file before the terminal is restarted, so as to generate a native code executed under the second operating system.
According to the compiling device provided by one or more embodiments of the disclosure, before the terminal is restarted after the second operating system is updated, the hotspot codes of the application program are compiled by using the hotspot description file of the second operating system based on the application program to generate the native codes executed under the second system, so that the problem that the hotspot description file cannot be compiled in time due to the fact that the system is updated and deleted can be avoided, the hotspot codes used by a new system can be compiled during the system updating period, and the hotspot codes are compiled without waiting until the terminal is in a charging and idle state, so that the native codes can be compiled at the first time, and the application performance can be improved in time.
In some embodiments, the terminal has a user data partition shared by the first operating system and the second operating system; the hotspot description file is stored in the user data partition; the description file obtaining unit 302 is further configured to obtain a hotspot description file of at least one application from the user data partition.
In some embodiments, the apparatus 300 further comprises:
the restarting unit is used for restarting the terminal;
the second system loading unit is used for loading the updated second operating system after the terminal is restarted;
and the saving unit is used for saving the native code into a directory of the corresponding application program.
In this embodiment, after the terminal is restarted, the second operating system is started from the second system partition, and the first system partition is not mounted, so that switching from the first operating system to the updated second operating system is completed, and the compiled native code is stored in the directory of the corresponding application program, so that the native code can be directly executed when the updated second operating system is started and uses the corresponding application program, thereby improving the performance of the application program in time.
In some embodiments, the first operating system and the second operating system may be the same version or different versions of the same class of operating system.
In some embodiments, the second system mount unit 302 includes:
an update data acquisition unit configured to acquire system update data based on the first operating system;
and the data writing unit is used for writing the system updating data into the second system partition.
In some embodiments, the terminal is configured to alternately update the first system partition and the second system partition, so that the compiling apparatus provided according to the embodiments of the present disclosure can enable the updated system to have native codes of respective application programs, thereby improving the performance of the application programs.
In some embodiments, the first operating system and the second operating system are a/B systems of an android platform.
The A/B system update (also called seamless update) of the android platform ensures that a system which can be normally started and used is reserved on a disk during the update of a wireless download (OTA) by setting two sets of system partitions (a slot A and a slot B) so as to reduce the possibility that a device cannot be started after the update. Under an A/B system, the system runs from the "current" slot, but during normal operation, the running system does not access partitions in unused slots. The method prevents the update problem by reserving the unused slot position as the backup slot position: if an error occurs during or just after the update, the system may roll back to the original slot and continue normal operation. Thus, in the A/B system of the android platform, only one system partition is mounted at the same time.
In contrast, according to the compiling device provided in one or more embodiments of the present disclosure, by modifying the system partition mount logic of the a/B system of the android platform, when the first system partition is mounted, the second system partition is mounted simultaneously after the second operating system is updated, so that the hot point code of the application can be compiled by the second operating system according to the hot point description, so as to generate the native code executed under the second operating system, thereby achieving the purpose of completing the compiling of the native code during the "seamless update" of the system, and without waiting until the updated terminal is in the charging and idle state again, the hot point code can be compiled again, so that the compiling of the native code can be completed at the first time, and the application performance can be improved in time.
For the embodiments of the apparatus, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described apparatus embodiments are merely illustrative, in that modules illustrated as separate modules may or may not be separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Accordingly, according to one or more embodiments of the present disclosure, there is provided a terminal device including:
at least one memory and at least one processor;
wherein the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the compiling method provided by one or more embodiments of the disclosure.
Referring now to fig. 4, a block diagram of a mobile terminal 400 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the disclosed embodiment may include, but is not limited to, devices such as a television, smart screen, cell phone, computer, e-reader, PDA (personal digital assistant), PAD (tablet), and the like. The terminal shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the terminal device 400 may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 401 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (hypertext transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled into the terminal device.
The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: updating the second operating system and mounting the second system partition after the second operating system is updated; acquiring a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program; before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer device, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The name of a unit does not in some cases form a limitation on the unit itself, for example, the second system mount unit may also be described as "a unit for updating the second operating system and mounting the second system partition when the second operating system is updated.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a compiling method applied to a terminal, where the terminal is installed with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system; the method comprises the following steps: updating the second operating system and mounting the second system partition after the second operating system is updated; acquiring a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program; before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.
According to one or more embodiments of the present disclosure, the terminal has a user data partition shared by the first operating system and the second operating system; the hotspot description file is stored in the user data partition; the acquiring the hotspot description file of at least one application program comprises: and acquiring a hotspot description file of at least one application program from the user data partition.
The compiling method provided according to one or more embodiments of the present disclosure further includes: restarting the terminal; after the terminal is restarted, loading the updated second operating system; and storing the native code into a directory of a corresponding application program.
According to one or more embodiments of the present disclosure, the first operating system and the second operating system are the same type of operating system.
According to one or more embodiments of the present disclosure, the terminal currently running a first operating system includes: and the terminal only mounts the first system partition at present.
According to one or more embodiments of the present disclosure, the updating the second operating system includes: acquiring system updating data based on the first operating system; writing the system update data to the second system partition.
In accordance with one or more embodiments of the present disclosure, the terminal is configured to update the first system partition and the second system partition alternately.
According to one or more embodiments of the present disclosure, the first operating system and the second operating system are a/B systems of an android platform.
According to one or more embodiments of the present disclosure, there is provided a compiling apparatus applied to a terminal, where the terminal is installed with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system; the device comprises: the second system mounting unit is used for updating the second operating system and mounting the second system partition after the second operating system is updated; the system comprises a description file acquisition unit, a hot spot description file acquisition unit and a hot spot code acquisition unit, wherein the description file acquisition unit is used for acquiring a hot spot description file of at least one application program, and the hot spot description file is used for recording a hot spot code of the application program; and the compiling unit is used for compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system before the terminal is restarted so as to generate native codes executed under the second operating system.
According to one or more embodiments of the present disclosure, there is provided a terminal, characterized in that the mobile terminal includes: at least one memory and at least one processor; wherein the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the compiling method provided according to one or more embodiments of the disclosure.
According to one or more embodiments of the present disclosure, there is provided a non-transitory computer storage medium characterized in that the non-transitory computer storage medium stores program code which, when run on a computer device, causes the computer device to execute a compiling method provided according to one or more embodiments of the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (11)

1. A compiling method is applied to a terminal and is characterized in that the terminal is provided with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system;
the method comprises the following steps:
updating the second operating system and mounting the second system partition after the second operating system is updated;
acquiring a hotspot description file of at least one application program, wherein the hotspot description file is used for recording hotspot codes of the application program;
before the terminal is restarted, compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system so as to generate native codes executed under the second operating system.
2. The compiling method of claim 1 wherein,
the terminal has a user data partition shared by the first operating system and the second operating system;
the hotspot description file is stored in the user data partition;
the acquiring the hotspot description file of at least one application program comprises: and acquiring a hotspot description file of at least one application program from the user data partition.
3. The compiling method of claim 1 further comprising:
restarting the terminal;
after the terminal is restarted, loading the updated second operating system;
and storing the native code into a directory of a corresponding application program.
4. The compiling method of claim 1 wherein,
the first operating system and the second operating system are the same type of operating system.
5. The compiling method of claim 1 wherein the terminal currently running a first operating system comprises:
and the terminal only mounts the first system partition at present.
6. The compilation method of claim 1, the updating the second operating system comprising:
acquiring system updating data based on the first operating system;
writing the system update data to the second system partition.
7. The compiling method of claim 1 wherein,
the terminal is configured to update the first system partition and the second system partition alternately.
8. The compiling method of claim 1 wherein,
the first operating system and the second operating system are A/B systems of an android platform.
9. A compiling device is applied to a terminal and is characterized in that the terminal is provided with a first operating system and a second operating system; the first operating system corresponds to a first system partition, and the second operating system corresponds to a second system partition; the terminal currently runs the first operating system;
the device comprises:
the second system mounting unit is used for updating the second operating system and mounting the second system partition after the second operating system is updated;
the system comprises a description file acquisition unit, a hot spot description file acquisition unit and a hot spot code acquisition unit, wherein the description file acquisition unit is used for acquiring a hot spot description file of at least one application program, and the hot spot description file is used for recording a hot spot code of the application program;
and the compiling unit is used for compiling the hot spot codes of at least one application program according to the hot spot description file based on the updated second operating system before the terminal is restarted so as to generate native codes executed under the second operating system.
10. A terminal, characterized in that the mobile terminal comprises:
at least one memory and at least one processor;
wherein the memory is configured to store program code and the processor is configured to call the program code stored in the memory to execute the compiling method of any of claims 1 to 8.
11. A non-transitory computer storage medium, characterized in that,
the non-transitory computer storage medium stores program code that, when run on a computer device, causes the computer device to perform the compiling method of any of claims 1 to 8.
CN202110008345.1A 2021-01-05 2021-01-05 Compiling method, compiling device, compiling terminal and storage medium Active CN112631609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110008345.1A CN112631609B (en) 2021-01-05 2021-01-05 Compiling method, compiling device, compiling terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110008345.1A CN112631609B (en) 2021-01-05 2021-01-05 Compiling method, compiling device, compiling terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112631609A true CN112631609A (en) 2021-04-09
CN112631609B CN112631609B (en) 2024-06-18

Family

ID=75290642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110008345.1A Active CN112631609B (en) 2021-01-05 2021-01-05 Compiling method, compiling device, compiling terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112631609B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900673A (en) * 2021-06-15 2022-01-07 荣耀终端有限公司 System installation package management method, device, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777981A (en) * 2014-01-13 2014-05-07 中南大学 Multi-operation-system remote loading implementation method suitable for X86 framework
CN107967141A (en) * 2017-11-27 2018-04-27 北京小米移动软件有限公司 Operating system update method, apparatus and terminal
CN108614705A (en) * 2017-02-07 2018-10-02 腾讯科技(深圳)有限公司 A kind of data compilation processing method and terminal
CN109960507A (en) * 2017-12-14 2019-07-02 广东欧珀移动通信有限公司 Compile optimization method, device, storage medium, intelligent terminal and server
CN111158714A (en) * 2019-11-28 2020-05-15 上海能塔智能科技有限公司 Method and device for upgrading software of on-board domain controller OTA, storage medium and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777981A (en) * 2014-01-13 2014-05-07 中南大学 Multi-operation-system remote loading implementation method suitable for X86 framework
CN108614705A (en) * 2017-02-07 2018-10-02 腾讯科技(深圳)有限公司 A kind of data compilation processing method and terminal
CN107967141A (en) * 2017-11-27 2018-04-27 北京小米移动软件有限公司 Operating system update method, apparatus and terminal
CN109960507A (en) * 2017-12-14 2019-07-02 广东欧珀移动通信有限公司 Compile optimization method, device, storage medium, intelligent terminal and server
CN111158714A (en) * 2019-11-28 2020-05-15 上海能塔智能科技有限公司 Method and device for upgrading software of on-board domain controller OTA, storage medium and terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900673A (en) * 2021-06-15 2022-01-07 荣耀终端有限公司 System installation package management method, device, storage medium and program product
CN113900673B (en) * 2021-06-15 2022-10-28 荣耀终端有限公司 System installation package management method, device, storage medium and program product

Also Published As

Publication number Publication date
CN112631609B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
CN110096302B (en) Software data storage and upgrading method, device, equipment and storage medium
CN110851204B (en) Application starting method and device and application packaging method and device
CN111611145B (en) Breakdown information collection method and device, storage medium and electronic equipment
CN111240766B (en) Application starting method and device, electronic equipment and computer readable storage medium
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN111666516A (en) Page loading method and device, electronic equipment and storage medium
CN110908734A (en) Application combination method and device based on plug-in, terminal equipment and storage medium
CN110968331A (en) Method and device for running application program
CN110960855A (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN112631609B (en) Compiling method, compiling device, compiling terminal and storage medium
CN104636154A (en) Method and device for installing application programs
CN109032693B (en) Method and device for loading display information, electronic equipment and readable storage medium
CN111400091B (en) Factory setting restoration method, factory setting restoration device and mobile terminal
CN112905220B (en) Thermal restoration method, device, equipment and storage medium
CN112631608A (en) Compiling method, device, terminal and storage medium
CN111367720A (en) Data protection method and device, electronic equipment and computer readable storage medium
CN113391882B (en) Virtual machine memory management method and device, storage medium and electronic equipment
CN108959553A (en) A kind of URL update method, device and electronic equipment
CN110502251B (en) Application installation method and device
CN114090069A (en) Application program installation package file processing method and electronic equipment
CN111382076A (en) Application program testing method and device, electronic equipment and computer storage medium
CN111367577A (en) Method, device and terminal for loading plug-in of application
CN116991449B (en) Method, device and storage medium for upgrading kernel subsystem thermally
CN113554498B (en) Processing method and device for user account request
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium

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
GR01 Patent grant