Operating system starting method, and terminal device

By starting only the 64-bit incubator process and determining whether to start the 32-bit incubator process based on the 32-bit process mark, the problem of large memory usage when the terminal device is turned on is solved, and the boot performance and user experience are optimized.

WO2025026022A1PCT designated stage expired Publication Date: 2025-02-06HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/104831
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-03
Filing Date
2024-07-10
Publication Date
2025-02-06

AI Technical Summary

Technical Problem

The starting method of the existing operating system takes up a large memory when the terminal device is turned on, affecting the boot performance.

Method used

By detecting the user's boot operation, only the 64-bit incubator process is started, and based on the 32-bit process mark, it is determined whether the 32-bit incubator process needs to be started. If the 32-bit process is marked as the first mark, the 32-bit incubator process will not be started.

Benefits of technology

It reduces the memory usage of terminal devices when powering on, optimizes the boot performance, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024104831_06022025_PF_FP_ABST
    Figure CN2024104831_06022025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an operating system starting method, and a terminal device. When a 32-bit process mark is a first mark, a 32-bit incubator process is not started, which occupies less memory of the terminal device, and thus the startup performance of the terminal device can be optimized, thereby improving the user experience. The method comprises: when a startup operation of a user on a terminal device is detected, starting a 64-bit incubator process; on the basis of a 32-bit process mark, determining whether a 32-bit incubator process needs to be started, wherein the 32-bit process mark is a first mark or a second mark; and if the 32-bit process mark is the first mark, not starting the 32-bit incubator process.
Need to check novelty before this filing date? Find Prior Art

Description

Operating system startup method and terminal device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 3, 2023, with application number 202310974129.1 and application name “Operating system startup method and terminal device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the technical field of terminal devices, and in particular to a method for starting an operating system and a terminal device. Background Art

[0003] The incubator process includes a 64-bit incubator process and a 32-bit incubator process. The 32-bit incubator process can be used to incubate 32-bit child processes, such as 32-bit application processes; the 64-bit incubator process can be used to incubate 64-bit child processes, such as 64-bit application processes. In order to improve the efficiency of incubating child processes, after the terminal device is turned on, a 32-bit incubator process and a 64-bit incubator process are usually started, so that when the user needs to run a 32-bit application and / or a 64-bit application, the application process of the application can be efficiently incubated.

[0004] However, such an operating system startup method causes a large amount of memory to be occupied when the terminal device is started, thereby affecting the startup performance of the terminal device.

[0005] Summary of the Invention

[0006] The present application provides an operating system startup method and a terminal device, which can reduce the memory usage of the terminal device when starting up, optimize the startup performance of the terminal device, and improve the user experience.

[0007] In a first aspect, a method for starting an operating system is provided, which is applied to a terminal device, the method comprising: detecting a user's power-on operation on the terminal device, and starting a 64-bit incubator process; judging whether it is necessary to start a 32-bit incubator process based on a 32-bit process mark, the 32-bit process mark being a first mark or a second mark; if the 32-bit process mark is the first mark, then not starting the 32-bit incubator process.

[0008] The startup method of the operating system of the present application is that after the terminal device detects the startup operation, on the one hand, the 64-bit incubator process is started normally; on the other hand, when the 32-bit process is marked as the first mark, the 32-bit incubator process is not started. Compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time, only the 64-bit incubator process is started when the terminal device is started, which occupies less memory of the terminal device, can optimize the startup performance of the terminal device, reduce the memory overhead of the system, and improve the user experience.

[0009] It should be understood that the power-on operation can be understood as an operation by a user to turn on the terminal device, such as the user pressing the power button on the terminal device. The first flag and the second flag can be different indication information. For example, the first flag can be 1 and the second flag can be 0. 1 can be used to indicate that the terminal device does not need to start the 32-bit incubator process, and 0 can be used to indicate that the terminal device needs to start the 32-bit incubator process.

[0010] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: if the 32-bit process mark is the first mark, continue to read the 32-bit process mark; when the 32-bit process mark is read as the second mark, start the 32-bit incubator process.

[0011] It should be understood that in the process of the terminal device reading the 32-bit process mark, if the 32-bit process mark is reset to the second mark, the terminal device will read the 32-bit process mark as the second mark, and then start the 32-bit incubator process, and no longer read the 32-bit process mark. Through such a technical solution, compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time during the terminal device startup process, the memory usage of the terminal device is smaller, and the startup performance of the terminal device can be optimized; in addition, by continuing to read the 32-bit process mark when the 32-bit process mark is the first mark, the 32-bit incubator process can be started when the terminal device resets the 32-bit process mark to the second mark, so that the terminal device can start the 32-bit incubator process at multiple times without affecting the 32-bit incubator process and startup and use, and can support the scenario of continued use after installing the 32-bit application, while improving the flexibility of the startup method of the operating system.

[0012] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: scanning the applications installed in the terminal device to obtain the number of 32-bit applications installed in the terminal device; if the number of 32-bit applications installed in the terminal device is 0, setting the 32-bit process mark to the first mark, or if the number of 32-bit applications installed in the terminal device is greater than 0, setting the 32-bit process mark to the second mark.

[0013] It should be understood that the terminal device can read the package information of the installed applications by scanning them. Package information can be understood as information used to describe the installation package, which may include information indicating whether the application is a 32-bit application or a 64-bit application. Therefore, the terminal device can obtain the number of 32-bit applications installed in the terminal device by scanning the installed applications. By first determining the number of 32-bit applications installed in the terminal device during each startup of the terminal device, and setting the 32-bit process flag to the first flag when the number is 0; and setting the 32-bit process flag to the second flag when the number is greater than 0, the terminal device can accurately determine whether a 32-bit application is installed in the terminal device based on the 32-bit process flag when reading the 32-bit process flag again after startup, and determine whether to start the 32-bit incubator process based on whether a 32-bit application is installed in the terminal device.

[0014] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: monitoring the installation process of the application of the terminal device; if the terminal device is monitored to install a 32-bit application, setting the 32-bit process mark to the second mark.

[0015] It should be understood that in order to facilitate the subsequent efficient incubation of the application process of the 32-bit application, the terminal device can set the 32-bit process tag to the second tag after monitoring the installation of the 32-bit application on the terminal device. In this way, the 32-bit process tag is more consistent with the actual situation of the current terminal device, thereby making the execution operation of the terminal device more in line with the actual situation.

[0016] In combination with the first aspect, in some possible implementations of the first aspect, the monitoring of the installation process of the application of the terminal device includes: obtaining package information of the first application; determining whether the package information of the first application includes information for indicating that the first application is a 32-bit application; and if so, determining that the terminal device is monitored to install a 32-bit application.

[0017] It should be understood that package information can be understood as information used to describe the installation package. The package information may include the application name of the application, the name of the installation package, and information indicating whether the application is a 32-bit application or a 64-bit application. The first application is the application to be installed, for example, a music application or a shopping application. The package information of the first application includes information indicating whether the first application is a 32-bit application or a 64-bit application.

[0018] Optionally, the terminal device uses the package management service module to obtain the installation package information of the first application based on the Android application package (APK) path of the first application. The package management service module can obtain the APK path of the first application from an application market application.

[0019] In combination with the first aspect, in some possible implementations of the first aspect, after determining that the terminal device has been monitored to install a 32-bit application, the method further includes: updating the number of 32-bit applications installed in the terminal device.

[0020] It should be understood that by updating the number of 32-bit applications installed in the terminal device after the terminal device monitors the installation of a 32-bit application, the terminal device can accurately determine whether the 32-bit application has been installed in the terminal device based on the number, thereby accurately setting the 32-bit process flag.

[0021] In combination with the first aspect, in some possible implementations of the first aspect, the first mark is used to indicate that no 32-bit application is installed in the terminal device, and the method further includes: monitoring the uninstallation process of the application of the terminal device; if the terminal device is monitored to uninstall the 32-bit application, determining whether the terminal device still has an installed 32-bit application; if not, setting the 32-bit process mark to the first mark.

[0022] It should be understood that after uninstalling a 32-bit application, if no 32-bit application is installed in the terminal device, the 32-bit process flag is set to the first flag. In this way, the terminal device can determine that the 32-bit application is not installed in the terminal device based on the first flag the next time the 32-bit process flag is read. For example, after the 32-bit process flag is set to the first flag, the terminal device is shut down. The next time the terminal device detects a user power-on operation, the 32-bit process flag can be read as the first flag, thereby determining that the 32-bit application is not installed in the terminal device and not starting the 32-bit incubator process. This reduces the memory usage of the terminal device during the terminal device startup process, thereby optimizing the terminal device's startup performance.

[0023] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: if the terminal device is monitored to uninstall a 32-bit application, determining whether the terminal device still has any installed 32-bit applications, including: if the terminal device is monitored to uninstall a 32-bit application, updating the number of installed 32-bit applications in the terminal device; if the number of installed 32-bit applications in the terminal device after the update is 0, determining that no 32-bit applications are installed in the terminal device.

[0024] It should be understood that during the process of powering on the terminal device, the number of 32-bit applications installed in the terminal device has been determined. Since the terminal device may install and / or uninstall 32-bit applications during subsequent operation of the terminal device, causing the number of 32-bit applications installed in the terminal device to change, the terminal device can simultaneously monitor the installation and uninstallation processes of applications, and update the number of 32-bit applications installed in the terminal device when monitoring the terminal device uninstalling or installing a 32-bit application. Since the number of 32-bit applications installed in the terminal device is updated in real time based on actual conditions, the terminal device can set a 32-bit process flag based on the number of 32-bit applications installed in the terminal device, and determine whether a 32-bit application is installed in the terminal device based on the read 32-bit process flag, thereby making the execution operation of the terminal device more consistent with actual conditions.

[0025] In combination with the first aspect, in some possible implementations of the first aspect, the process of monitoring the uninstallation of the application of the terminal device includes: obtaining the package information of the second application; determining whether the package information of the second application includes information for indicating that the second application is a 32-bit application; and if so, determining that the terminal device is monitored to uninstall the 32-bit application.

[0026] It should be understood that the second application is an application to be installed, for example, a music application, a shopping application, etc. The terminal device can uninstall the application in various ways, for example, through an application market application, or based on the user's uninstall operation on the application icon on the desktop, uninstall the application corresponding to the icon, etc.

[0027] Optionally, obtaining package information of the second application includes: the terminal device using a package management service module to obtain installation package information of the second application.

[0028] Optionally, before the terminal device uses the package management service module to obtain the package information of the second application, the method also includes: using an application market application or a desktop manager to transmit the installation package name of the second application to the package management service module; using the package management service module to obtain the package information of the second application, including: using the package management service module to obtain the installation package name of the second application corresponding to the installation package name of the second application.

[0029] It should be understood that the terminal device can uninstall applications in a variety of ways, such as uninstalling through an application market application, or uninstalling the application corresponding to the icon based on the user's uninstall operation on the application icon in the desktop, etc. When the second application is uninstalled through the application market application, the application market application transmits the installation package name of the second application to the package management service module; when the second application is uninstalled based on the user's uninstall operation on the second application icon in the desktop, the desktop manager transmits the installation package name of the second application to the package management service module.

[0030] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: reading the 32-bit process tag and monitoring the startup process of the application of the terminal device; if it is monitored that the terminal device starts the 32-bit application for the first time, setting the 32-bit process tag to the second tag and starting the 32-bit incubator process.

[0031] It should be understood that when a terminal device first launches a 32-bit application, it can first launch a 32-bit incubator process. This not only reduces the terminal device's memory usage by not launching the 32-bit incubator during the terminal device's startup process, but also optimizes the terminal device's startup performance. Furthermore, it allows the terminal device to launch 32-bit applications normally, improving the user experience. Furthermore, compared to launching the 32-bit incubator process after installing a 32-bit application on the terminal device, since the 32-bit application may not be launched immediately after installation, launching the 32-bit incubator process when the 32-bit application is first launched can further reduce the terminal device's memory usage.

[0032] In combination with the first aspect, in some possible implementations of the first aspect, the process of monitoring the startup of the application of the terminal device includes: obtaining package information of a third application; determining whether the package information of the third application includes information indicating that the third application is a 32-bit application; and if so, determining that the terminal device is monitored to start a 32-bit application.

[0033] It should be understood that a terminal device can launch an application in a variety of ways. In one example, a third application is launched based on a user input operation, such as clicking an application icon on the desktop. In this case, obtaining the package information of the third application can be implemented as follows: the desktop launcher indicates the installation package name of the third application to the activity management service module, and the activity management service module transmits the installation package name of the third application to the package management module; the package management module transmits the package information of the third application corresponding to the installation package name of the third application to the activity management service module. In another example, when an application capable of triggering the launch of the third application launches the third application, for example, the third application is a payment application, and the application capable of triggering the launch of the third application is a music application, while the user is using the music application, inputs a payment operation to the terminal device, and the music application launches the payment application, obtaining the package information of the third application can be implemented as follows: the application capable of triggering the launch of the third application indicates the installation package name of the third application to the activity management service module, and the activity management service module transmits the installation package name of the third application to the package management module; the package management module transmits the package information of the third application corresponding to the installation package name of the third application to the activity management service module.

[0034] In combination with the first aspect, in some possible implementations of the first aspect, after starting the 32-bit incubator process, the method further includes: setting the 32-bit process flag to the first flag.

[0035] It should be understood that the terminal device starting the 32-bit incubator process indicates that the 32-bit process is marked as the second mark. By resetting the 32-bit process mark to the first mark after starting the 32-bit incubator process, the terminal device will read the 32-bit process mark as the first mark after detecting the user's power-on operation next time, so that the 32-bit incubator process will not be started during the terminal device power-on process. In this way, the memory usage during the next power-on process of the terminal device is smaller, the power-on performance of the terminal device can be optimized, and the user experience can be improved.

[0036] In combination with the first aspect, in some possible implementations of the first aspect, before determining whether a 32-bit incubator process needs to be started based on the 32-bit process tag, the method further includes: setting the 32-bit process tag to the first tag.

[0037] It should be understood that by setting the 32-bit process mark to the first mark before the terminal device determines whether it needs to start the 32-bit incubator process, the 32-bit process mark read during the terminal device startup process is set to the first mark. In this way, the 32-bit incubator process will not be started during the terminal device startup process, and the memory usage during the terminal device startup process is smaller, which can optimize the terminal device startup performance and improve the user experience.

[0038] In combination with the first aspect, in some possible implementations of the first aspect, determining whether it is necessary to start a 32-bit incubator process based on a 32-bit process mark includes: starting an initial process after detecting that the user has powered on the terminal device; and using the initial process to determine whether the 32-bit process mark is the first mark or the second mark.

[0039] It should be understood that during the startup of the operating system, the startup processes of the 64-bit incubator process and the 32-bit incubator process do not affect each other. That is, regardless of whether the terminal device starts the 32-bit incubator process, the 64-bit incubator process will be started normally. In this way, the operating system and 64-bit applications can both start normally. The 32-bit incubator process is started by the initial process. Therefore, the terminal device can use the initial process to determine whether the 32-bit process mark exists. In this way, if the 32-bit process mark is the first mark, during the terminal device startup process, the initial process can completely not start the 32-bit incubator process, which takes up less memory of the terminal device, can optimize the startup performance of the terminal device, and improve the user experience.

[0040] In combination with the first aspect, in some possible implementations of the first aspect, judging whether it is necessary to start a 32-bit incubator process based on a 32-bit process mark includes: starting the 32-bit incubator process after starting the initial process; after starting the 32-bit incubator process, the 32-bit incubator process is in a semi-started state; and using the 32-bit incubator process in the semi-started state, judging whether the 32-bit process mark is the first mark or the second mark.

[0041] It should be understood that the startup of the incubator process includes multiple processes such as registering the server socket and loading the virtual machine. The 32-bit incubator process in a semi-started state can be understood as a 32-bit incubator process that has not been fully started. For example, first, the terminal device starts the initial process, and then starts the 32-bit incubator process; then the terminal device can pause the startup of the 32-bit incubator process before starting the virtual machine. At this time, the 32-bit incubator process is in a semi-started state; then, the terminal device reads the 32-bit process mark. If the 32-bit process mark is the second mark, the 32-bit incubator process will continue to start; if the 32-bit process mark is the first mark, the 32-bit incubator process will not continue to start, and the 32-bit process mark will be read. At this time, the 32-bit incubator process is still in a semi-started state.

[0042] In this way, compared with fully starting the 32-bit incubator process after the terminal device detects the user's power-on operation, the terminal device occupies less memory and can optimize the power-on performance of the terminal device; compared with not starting the 32-bit incubator process at all when the 32-bit process is marked as the first mark, when the 32-bit process is read as the second mark and the 32-bit incubator process needs to be started, the startup efficiency of the 32-bit incubator process can be improved.

[0043] In combination with the first aspect, in some possible implementations of the first aspect, the 32-bit process tag is read by calling an attribute access function; or, the 32-bit process tag is read by accessing a database.

[0044] It should be understood that the 32-bit process tag can be stored on the terminal device through various methods, such as attribute items, databases, and other methods. The attribute item can be understood as a property. Furthermore, the 32-bit process tag remains stored on disk after the operating system crashes and restarts. The property access function can be understood as a property_get function, which can be used to obtain the 32-bit process tag stored on the terminal device.

[0045] In a second aspect, the present application provides a terminal device that can implement the operating system startup method described in the first aspect and any possible implementation of the first aspect. The terminal device includes corresponding units or modules for executing the above method. The units or modules included in the terminal device can be implemented through software and / or hardware. The terminal device can be, for example, a chip, a chip system, or a processor that supports the terminal device to implement the above method, or a logic module or software that can implement all or part of the functions of the terminal device.

[0046] In a third aspect, the present application provides a terminal device comprising a processor, wherein the processor is configured to execute the method for starting an operating system as described in the first aspect and any possible implementation of the first aspect.

[0047] Optionally, the terminal device may further include a memory for storing instructions and data. The memory is coupled to the processor, and when the processor executes the instructions stored in the memory, the methods described in the above aspects may be implemented.

[0048] Optionally, the terminal device may further include a communication interface, which is used for the terminal device to communicate with other hardware or software modules in the terminal device. Exemplarily, the communication interface may be a circuit, bus, module or other type of communication interface.

[0049] In a fourth aspect, the present application provides a chip system comprising at least one processor for supporting the implementation of the functions involved in the above-mentioned first aspect and any possible implementation method of the first aspect, for example, processing the data and / or information involved in the above-mentioned method.

[0050] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0051] The chip system can be composed of chips, or can include chips and other discrete devices.

[0052] In a fifth aspect, the present application provides a computer-readable storage medium comprising a computer program, which, when executed on a computer, enables the computer to implement the method in the first aspect and any possible implementation of the first aspect.

[0053] In a sixth aspect, the present application provides a computer program product, comprising: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute the method in the first aspect and any possible implementation of the first aspect.

[0054] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] FIG1 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0056] FIG2 is a block diagram of the software structure of a terminal device according to an embodiment of the present application;

[0057] FIG3 is a schematic diagram of the startup process of the operating system of the terminal device provided in an embodiment of the present application;

[0058] FIG4 is a flow chart of a method for starting an operating system provided in an embodiment of the present application;

[0059] FIG5 is a flow chart of another method for starting an operating system provided in an embodiment of the present application;

[0060] FIG6 is a flow chart of a method for setting a 32-bit process flag according to an embodiment of the present application;

[0061] FIG7 is a flow chart of another method for starting an operating system provided in an embodiment of the present application;

[0062] FIG8 is a flow chart of another method for starting an operating system provided in an embodiment of the present application;

[0063] FIG9 is a schematic block diagram of a terminal device provided in an embodiment of the present application;

[0064] FIG10 is a schematic block diagram of another terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The technical solution in this application will be described below with reference to the accompanying drawings.

[0066] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first and second numerical values ​​are merely used to distinguish different numerical values ​​and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity or execution order, and words such as "first" and "second" do not necessarily mean different.

[0067] It should be noted that in the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0068] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.

[0069] The terminal device provided in the embodiments of the present application may be a mobile phone, a laptop computer, a tablet computer, a large-screen display device, a wearable device (such as a smart watch, a smart bracelet, etc.), a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a laptop computer, a personal digital assistant (PDA), a VR device, an AR device, a speaker, an artificial intelligence (AI) device, and the like. The operating system installed on the terminal device includes but is not limited to the Android operating system, the Hongmeng operating system, the IOS operating system, and the like. In some embodiments, the terminal device may be a fixed device or a portable device. This application does not limit the specific type of the terminal device or the installed operating system.

[0070] In order to better understand the terminal device in the embodiment of the present application, the hardware structure of the terminal device in the embodiment of the present application is described in detail below with reference to FIG1 .

[0071] FIG1 is a schematic diagram of the structure of a terminal device 100 provided in an embodiment of the present application. As shown in FIG1 , the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, and the like.

[0072] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0073] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0074] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0075] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0076] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0077] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the terminal device 100.

[0078] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0079] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0080] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0081] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the terminal device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0082] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0083] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal device 100 and to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other terminal devices, such as AR devices.

[0084] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.

[0085] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal device via the power management module 141.

[0086] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0087] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0088] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0089] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0090] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0091] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0092] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0093] The terminal device 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0094] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, terminal device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0095] The terminal device 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0096] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0097] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0098] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0099] Video codecs are used to compress or decompress digital video. Terminal device 100 may support one or more video codecs. This allows terminal device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0100] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in the terminal device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0101] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0102] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0103] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0104] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0105] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0106] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the user can hear the voice by placing the receiver 170B close to the ear.

[0107] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and can also identify the source of sound, realize directional recording function, etc.

[0108] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0109] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.

[0110] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0111] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0112] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the terminal device 100 by inserting or removing it from the SIM card interface 195. The terminal device 100 can support one or N SIM card interfaces, where N is a positive integer greater than one. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0113] The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the terminal device 100.

[0114] FIG2 is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0115] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: application layer, Java framework layer, system runtime and system libraries, hardware abstraction layer, and kernel layer.

[0116] 1. Application layer

[0117] The application layer may include a series of application packages. As shown in FIG2 , the application package may include applications such as calling, browser, email, and desktop launcher.

[0118] Among them, the desktop launcher is the first application process incubated by the incubator process, and can be used to manage the desktop display application of the terminal device.

[0119] 2. Java framework layer

[0120] The Java framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The Java framework layer includes some predefined functions. As shown in Figure 2, the Java framework layer can include starting a system service and a view system.

[0121] The system server may include services such as an activity manager service module, a window manager, a power manager, an input manager, and a package manager service module.

[0122] The activity management service module is used to manage and maintain all running activity information in the operating system, such as tasks, memories, services, and applications, and provides an interface for obtaining activity information; it is also responsible for starting applications.

[0123] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0124] The package management service module is used to manage the installation packages of various applications installed in the terminal device, such as the installation packages of music, video, navigation and other applications.

[0125] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0126] 3. System runtime and system libraries

[0127] The system runtime includes the core library and the virtual machine. The system runtime is responsible for scheduling and management of the Android system.

[0128] Among them, the core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the Android core library.

[0129] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0130] The system library can include multiple functional modules, such as the surface manager, service manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0131] Among them, the surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0132] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. It supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The media library includes an audio manager and a media player service.

[0133] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing.

[0134] A 2D graphics engine is a drawing engine for 2D drawings.

[0135] 4. Hardware Abstraction Layer

[0136] The Hardware Abstraction Layer (HAL) includes multiple library modules, such as Bluetooth, camera, audio, and sensor modules. Each library module provides an interface for the corresponding hardware component. For example, when the framework API accesses the camera, the terminal device can load the camera module for the camera.

[0137] 5. Kernel layer

[0138] The kernel layer is the layer between hardware and software. It drives the hardware, making it work. The kernel layer includes display drivers, screen drivers, graphics processing unit (GPU) drivers, camera drivers, and sensor drivers, though this is not a limitation in the present embodiment. For example, the screen driver can turn the screen on or off.

[0139] It is understood that the software structure shown in FIG2 of the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer software modules than shown in the figure, for example, the system server may also include a resource manager, etc.

[0140] It should be understood that the names of the software modules or layer structures included in the software structure illustrated in FIG2 of the embodiment of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the software modules in the software structure illustrated in FIG2 may also have other names. For example, the system library may also be referred to as the C++ framework layer, the Java framework layer may also be referred to as the application framework layer (FWK), and the system server may also be referred to as the system ability manager (SAMGR).

[0141] 3 , the process of starting the Android system of the terminal device 100 by a user will be described below by taking the Android system of the layered architecture as an example.

[0142] FIG3 is a schematic diagram of the startup process of the operating system of the terminal device 100 provided in an embodiment of the present application.

[0143] To facilitate understanding, the terms and processes involved in the Android system startup process are first explained.

[0144] 1. Bootloader

[0145] The boot loader can be used to boot the operating system of the terminal device. The boot loader layer includes the boot chip (boot ROM) and the system boot program (boot loader).

[0146] The boot chip is a mask ROM or write-protected flash memory embedded in the processor chip, which includes the first code executed after the processor is powered on or reset.

[0147] The system boot program is a boot program that runs before the operating system kernel runs. It is used to initialize the system hardware parameters and start the kernel, for example, mapping the storage area, setting the stack pointer, etc.

[0148] 2. Kernel layer

[0149] After the kernel layer is started, it includes the swapper process, the kernel thread (kthreadd) process, and the kernel daemon process (kernel daemons).

[0150] The swap process, also known as the scheduling process or idle process, is a process with a process identification number (PID) equal to 0. The swap process is the first process created from scratch in the kernel layer during Android system initialization, automatically created by the operating system. The swap process is used for initialization process management, memory management, and loading various drivers, including display drivers.

[0151] The kernel thread process is a process with PID 2, which is used to schedule and manage all kernel threads in the Android system and create kernel daemon processes such as soft interrupt threads.

[0152] 3. System Library

[0153] The system library includes the initial process, service manager process, and media server process.

[0154] The init process is the first user process in the operating system. It is primarily responsible for creating mount folders, parsing the init.rc file, and starting the incubator, service manager, and media manager processes. After parsing the init.rc file, the init process forks and starts the zygote process. The init.rc file is a configuration file that includes the startup script for the zygote process.

[0155] The media server process is responsible for starting and managing various services in the system library, such as the audio manager and media player services.

[0156] 4. System runtime

[0157] The system runtime includes an incubator process. The incubator process can be used to incubate system server processes and application processes by replicating them. There are 32-bit and 64-bit incubator processes. The 32-bit incubator process can incubate 32-bit application processes, while the 64-bit incubator process can incubate 64-bit application processes.

[0158] 5. Java framework layer

[0159] The Java framework layer includes the system server process, which can be used to start the processes of various services such as the activity management service module and the window manager.

[0160] 6. Application Layer

[0161] The application layer includes processes for various applications, such as the desktop launcher, call, and email. Each application in the application layer runs on at least one process. The desktop launcher is the first application process created by the incubator process.

[0162] It is understood that the layered architecture of the Android system illustrated in FIG3 of the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, various processes in the terminal device 100 may create more or fewer processes, and the terminal device 100 may include more or fewer processes than shown in the figure. For example, if the initial process in the system library can also start processes such as the boot animation (bootanim), the system library may also include processes such as the boot animation.

[0163] The following describes the startup process of the Android system in detail with reference to FIG3 .

[0164] S1. After the user turns on the terminal device 100, the boot chip in the boot device runs and loads the system boot program to complete the initialization of hardware parameters.

[0165] S2. Start the exchange process.

[0166] Optionally, the swap process may also start a kernel thread process and load multiple drivers, such as a display driver and an input driver; the kernel thread process may further create a kernel daemon process.

[0167] S3. The exchange process starts the initial process.

[0168] S4. The initial process starts the incubator process.

[0169] Optionally, the initial process may also start a user space daemon process, a boot animation process, a service manager process, and a media server process.

[0170] It should be understood that the incubator process started by the initial process includes a 64-bit incubator process and a 32-bit incubator process.

[0171] S5. The incubator process incubates the system server process.

[0172] S6. The incubator process incubates the application process, wherein the 32-bit incubator process incubates the 32-bit application process, and the 64-bit incubator process incubates the 64-bit application process.

[0173] It should be understood that in the embodiments of the present application, the incubator process refers to a process that can be started by the initial process and can be used to incubate application processes. The incubator process can also be called zygote, etc. This application does not specifically limit the name of the incubator process.

[0174] It should be understood that in the embodiments of the present application, the incubator process incubating the application process and the system manager process can be understood as the incubator process creating the application process and the system manager process, which means that the application process and the system manager process are derived from the incubator process. Among them, the application process and the system manager process can be understood as child processes of the incubator process, and the incubator process can be understood as the parent process or root process of the application process and the system manager process.

[0175] It can be understood that the incubator process includes a 32-bit incubator process and a 64-bit incubator process, wherein the 32-bit incubator process can be represented by zygote and the 64-bit incubator process can be represented by zygote 64. For ease of understanding, in the embodiments of the present application, the 32-bit incubator process and the 64-bit incubator process are used as examples for description, and the names of the 32-bit incubator process and the 64-bit incubator process do not constitute a limitation on the present application.

[0176] As shown in Figure 3, the operating system startup process shows that after the terminal device is powered on, the initial process simultaneously launches a 32-bit incubator process and a 64-bit incubator process. This allows for efficient subsequent incubation of application processes, making it easier for users to launch both 32-bit and 64-bit applications. However, the incubator process consumes a lot of memory. After the terminal device launches both the 32-bit and 64-bit incubator processes, the terminal device is overloaded, potentially affecting its startup performance, such as extending the startup time and thus impacting the user experience.

[0177] In order to solve the above technical problems, the present application provides an operating system startup method and a terminal device. During the startup process of the terminal device, when the 32-bit process is marked as the first mark, the terminal device does not start the 32-bit incubator process. Compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time, such a startup method occupies less memory of the terminal device, can optimize the startup performance of the terminal device, and improve the user experience.

[0178] The following describes in detail the operating system startup method of the present application in conjunction with Figures 4 to 8. The operating system startup method of the embodiment of the present application can be executed by the various terminal devices described above, or by a chip, chip system, or processor that supports the terminal device to implement the operating system startup method, or by a logic module or software that can implement all or part of the terminal device, and the embodiment of the present application does not impose specific restrictions on this.

[0179] The following describes in detail the method for starting the operating system of the embodiment of the present application by taking the terminal device as the execution subject as an example.

[0180] FIG4 is a flow chart of a method 400 for starting an operating system according to an embodiment of the present application. The method 400 is applied to a terminal device, and the hardware structure of the terminal device may be as shown in FIG1 , and the software structure may be as shown in FIG2 . The method 400 includes the following steps:

[0181] S401: Detecting a user's power-on operation on a terminal device, and starting a 64-bit incubator process.

[0182] It should be understood that the power-on operation can be understood as an operation by a user to turn on the terminal device, such as the user pressing the power button of the terminal device. When the user powers on the terminal device, the operating system of the terminal device starts to start.

[0183] S402: Determine whether a 32-bit incubator process needs to be started according to a 32-bit process mark, where the 32-bit process mark is a first mark or a second mark.

[0184] It should be understood that the 32-bit process flag can be understood as information that can be used to indicate whether the terminal device needs to start the 32-bit incubator process. The 32-bit process flag can also be called isDelayZygoteEn and other names. The embodiment of this application does not specifically limit the name of the 32-bit process flag.

[0185] The first mark and the second mark can be different indication information, for example, the first mark can be 1, and the second mark can be 0, where 1 can be used to indicate that the terminal device does not need to start a 32-bit incubator process, and 0 can be used to indicate that the terminal device needs to start a 32-bit incubator process; or, the first mark can be true, and the second mark can be false, where false can be used to indicate that the terminal device needs to start a 32-bit incubator process, and true can be used to indicate that the terminal device does not need to start a 32-bit incubator process.

[0186] If the 32-bit process mark is the first mark, the terminal device executes S403 and does not start the 32-bit incubator process.

[0187] It should be understood that not starting the 32-bit incubator process can be understood as delaying the start of the 32-bit incubator process after detecting the user's power-on operation on the terminal device, or not starting the 32-bit incubator process until the terminal device is shut down.

[0188] The startup method of the operating system of the present application is that after the terminal device detects the power-on operation, on the one hand, the 64-bit incubator process is started normally; on the other hand, when the 32-bit process is marked as the first mark, the 32-bit incubator process is not started. Compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time, only the 64-bit incubator process is started when the terminal device is started, which occupies less memory of the terminal device, can optimize the startup performance of the terminal device, reduce the memory overhead of the system, and improve the user experience. In actual applications, through the method of the embodiment of the present application, the startup time of the terminal device can be shortened by 500ms to 1000ms, and the resident memory usage of the terminal device can be reduced by 30+MB, that is, the startup performance of the terminal device is optimized and the memory usage of the terminal device during startup is reduced.

[0189] As an optional embodiment, if the 32-bit process mark is the second mark, the terminal device executes S404 to start the 32-bit incubator process.

[0190] It should be understood that if the 32-bit process mark is read as the second mark during the startup of the terminal device, the 32-bit incubator process is started.

[0191] As an optional embodiment, after the above S403, the method 400 further includes S405, reading the 32-bit process tag; when the read 32-bit process tag is the second tag, the terminal device executes S404 to start the 32-bit incubator process.

[0192] It should be understood that reading the 32-bit process flag can be understood as continuously and periodically reading the 32-bit process flag. That is, when the 32-bit process flag is the first flag, the terminal device will read the 32-bit process flag again, and this process is performed periodically. During the process of the terminal device reading the 32-bit process flag, if the 32-bit process flag is reset to the second flag, the terminal device will read the 32-bit process flag as the second flag, and then start the 32-bit incubator process without reading the 32-bit process flag again. This technical solution reduces the memory usage of the terminal device compared to simultaneously starting the 32-bit incubator process and the 64-bit incubator process during the terminal device startup process, and can optimize the terminal device's startup performance. In addition, by reading the 32-bit process flag when the 32-bit process flag is the first flag, the 32-bit incubator process can be started when the terminal device resets the 32-bit process flag to the second flag. This allows the terminal device to start the 32-bit incubator process at various times without affecting the startup and use of the 32-bit incubator process, while also improving the flexibility of the operating system startup method.

[0193] The terminal device can determine whether the 32-bit process mark is the first mark or the second mark in the following two ways, as follows.

[0194] In a possible implementation, S402 is specifically implemented in the following manner: after detecting a user power-on operation on the terminal device, starting an initial process; using the initial process, determining whether the 32-bit process mark is the first mark or the second mark.

[0195] It should be understood that the 32-bit incubator process is started by the initial process. Therefore, the terminal device can use the initial process to determine whether the 32-bit process mark exists. In this way, if the 32-bit process mark is the first mark, during the startup of the terminal device, the initial process can completely not start the 32-bit incubator process, which takes up less memory of the terminal device, can optimize the startup performance of the terminal device, and improve the user experience.

[0196] In another possible implementation, S402 is specifically implemented in the following manner: after starting the initial process, starting the 32-bit incubator process; after starting the 32-bit incubator process, the 32-bit incubator process is in a semi-started state; using the 32-bit incubator process in the semi-started state, determining whether the 32-bit process mark is the first mark or the second mark.

[0197] It should be understood that the startup of the incubator process includes multiple processes such as registering the server socket and loading the virtual machine. The 32-bit incubator process in a semi-started state can be understood as a 32-bit incubator process that has not been fully started. For example, first, the terminal device starts the initial process, and then starts the 32-bit incubator process; then the terminal device can pause the startup of the 32-bit incubator process before starting the virtual machine. At this time, the 32-bit incubator process is in a semi-started state; then, the terminal device reads the 32-bit process mark. If the 32-bit process mark is the second mark, the 32-bit incubator process will continue to start; if the 32-bit process mark is the first mark, the 32-bit incubator process will not continue to start, and the 32-bit process mark will be read. At this time, the 32-bit incubator process is still in a semi-started state.

[0198] In this way, compared with fully starting the 32-bit incubator process after the terminal device detects the user's power-on operation, the terminal device occupies less memory and can optimize the power-on performance of the terminal device; compared with not starting the 32-bit incubator process at all when the 32-bit process is marked as the first mark, when the 32-bit process is read as the second mark and the 32-bit incubator process needs to be started, the startup efficiency of the 32-bit incubator process can be improved.

[0199] It can be understood that no matter whether the initial state of the 32-bit process mark is the first mark or the second mark, the terminal device can reset the 32-bit process mark after the operating system is started. In this way, when the initial state of the 32-bit process mark is the first mark, if the terminal device resets the 32-bit process mark to the second mark, the terminal device can start the 32-bit incubator process based on the read second mark, thereby reducing the memory usage during the terminal device startup process. At the same time, after the terminal device is started, it can also determine whether to start the 32-bit incubator process based on the 32-bit process mark, thereby making the terminal device more flexible in starting the 32-bit incubator process; in addition, after the terminal device is started for the next time, if it is necessary to read the 32-bit process mark that was finally set during the operation of this terminal device, it can be determined whether to start the 32-bit incubator process during the next terminal device startup by setting the 32-bit process mark during the terminal device's current operation, thereby making the terminal device more flexible in starting the 32-bit incubator process.

[0200] Optionally, the terminal device can implement the setting of the 32-bit process flag in two ways: the first way is to monitor the installation process and / or uninstallation process of the application; the second way is to monitor the startup process of the application. The startup method of the operating system of the embodiment of the present application corresponding to these two ways is described in detail below.

[0201] Below, the method for starting the operating system of the embodiment of the present application described in the above-mentioned method 1 is described in detail with reference to Figures 5 and 6.

[0202] FIG5 is a flow chart of a method 500 for starting an operating system according to an embodiment of the present application. The method 500 is applied to a terminal device, and the hardware structure of the terminal device may be as shown in FIG1 , and the software structure may be as shown in FIG2 . The method 500 includes the following steps:

[0203] S501: Load the system boot program.

[0204] It should be understood that after the terminal device detects the user's power-on operation, it runs the boot chip, then loads the system boot program code into the memory, and executes the system boot program.

[0205] S502: Load the system kernel.

[0206] It should be understood that loading the system kernel includes processes such as the operating system creating a swap process, the swap process starting a kernel thread process, and loading a driver.

[0207] S503: Start the initial process.

[0208] It should be understood that after the kernel is started, the swap process may start the initial process, and the initial process may start a 64-bit incubator process and / or a 32-bit incubator process.

[0209] It should be understood that the specific implementation of S501 to S503 is similar to that of S1 to S3 shown in FIG3 , and will not be described in detail here. Please refer to the above description.

[0210] It can be understood that after the initial process is started, the operations performed by the terminal device are divided into two aspects. On the one hand, the 64-bit incubator process is started normally, and then the 64-bit incubator process incubates the system server process and the desktop launcher process, that is, executes S504 to S506; on the other hand, it determines whether to start the 32-bit incubator process, that is, executes S507 and S508.

[0211] S504: Start the 64-bit incubator process.

[0212] S505: Incubate system server process.

[0213] It should be understood that the system server process can be used to start and manage the package management service module.

[0214] S506: Incubate the desktop launcher process.

[0215] It should be understood that S504 to S506 are similar to S4 to S6 shown in FIG. 3 , and are not described in detail here. Please refer to the above description.

[0216] S507: Determine whether the 32-bit process flag is the second flag.

[0217] Optionally, during the terminal device startup process, the 32-bit process flag read by the terminal device for the first time may be the flag finally set by the terminal device during the terminal device's last operation. For example, assuming that during the terminal device's last operation, the 32-bit process flag was finally set to the first flag; after the terminal device is currently started, the 32-bit process flag read by the terminal device is the first flag.

[0218] If the 32-bit process mark is the second mark, then continue to execute S508 to start the 32-bit incubator process, and this process ends.

[0219] If the 32-bit process mark is the first mark, S507 is executed in a loop, that is, the 32-bit process mark is continuously read until the 32-bit process mark is read as the second mark, and then S508 is executed, and this process ends.

[0220] It should be understood that in one case, during the last operation of the terminal device, the 32-bit process mark was eventually set to the second mark, that is, during the current startup of the terminal device, the 32-bit process mark read for the first time was the second mark, and then the terminal device will continue to execute S508, and this process ends; in another case, during the last operation of the terminal device, the 32-bit process mark was eventually set to the first mark, that is, during the current startup of the terminal device, the 32-bit process mark read for the first time was the first mark, and the terminal device will continue to read the 32-bit process mark in a loop until the 32-bit process mark is switched to the second mark, and then the terminal device reads the 32-bit process mark, executes S508, and this process ends.

[0221] Regardless of the above situations, the stored 32-bit process tag may change during the operation of the terminal device, and before the terminal device executes S508, if the 32-bit process tag changes, it will be read during the process of the terminal device executing S507. For example, the current 32-bit process tag is the first tag, and the terminal device will continue to read the 32-bit process tag in a loop. If the 32-bit process tag switches from the first tag to the second tag at this time, the terminal device will determine that the 32-bit process tag is the second tag and continue to execute S508; after the terminal device executes S508, if the 32-bit process tag changes, the 32-bit process tag will no longer be read before the terminal device is shut down.

[0222] The following describes in detail the method for setting the 32-bit process flag in conjunction with Figure 6. As shown in Figure 6, the above method 500 further includes the following steps:

[0223] S509: Scan the applications installed in the terminal device and determine the number of 32-bit applications installed in the terminal device.

[0224] Optionally, during the boot process, after determining the number of 32-bit applications installed in the terminal device, the terminal device may set a 32-bit process flag based on the number, as described in S510 to S512.

[0225] S510: Determine whether the number of 32-bit applications installed in the terminal device is 0.

[0226] If the number of 32-bit application programs installed in the terminal device is not 0, S511 is executed to set the 32-bit process flag to the second flag.

[0227] If the number of 32-bit application programs installed in the terminal device is 0, S512 is executed to set the 32-bit process flag to the first flag.

[0228] It should be understood that during the terminal device startup process, after the 64-bit incubator process incubates the system server process, the terminal device may execute S509 to S512. In some embodiments, the terminal device scans installed applications to determine whether the package information of the installed applications includes information indicating that the installed applications are 32-bit applications. In this way, the terminal device can determine the number of 32-bit applications installed in the terminal device during the startup process.

[0229] This technical solution improves the accuracy of 32-bit process marking compared to solutions that do not scan the number of installed 32-bit applications during terminal device startup, or do not set the 32-bit process mark based on the number scanned during startup. For example, assume that before a terminal device system upgrade, one 32-bit application, namely the first 32-bit application, was installed on the terminal device, and the 32-bit process mark was the second mark. After the terminal device system upgrade, the first 32-bit application installed on the terminal device was upgraded to a 64-bit application. Because the terminal device did not update the number of installed 32-bit applications during the upgrade of the first 32-bit application, the number of installed 32-bit applications on the terminal device remains at 1, and the 32-bit process mark remains at the second mark. Therefore, during the next startup of the terminal device, by re-determining the number of installed 32-bit applications and setting the 32-bit process mark based on this number, the number of installed 32-bit applications on the terminal device can be updated, and the 32-bit process mark can be set based on the updated number. It can be seen that the above technical solution can increase the number of 32-bit applications installed in the terminal device and the accuracy of 32-bit process labels, thereby making the execution operation of the terminal device more in line with the actual situation.

[0230] It should be understood that no matter whether the terminal device executes S511 or S512, it will continue to execute S513 to S521.

[0231] S513: Monitor the installation process of the application.

[0232] S514: Determine whether installation of a 32-bit application is detected.

[0233] If no 32-bit application is detected to be installed, S513 is executed again.

[0234] It should be understood that failure to monitor the installation of a 32-bit application may be understood as the terminal device monitoring the installation of an application, but the application is not a 32-bit application.

[0235] If it is detected that a 32-bit application is being installed, S515 and S516 are executed.

[0236] S515: Set the 32-bit process flag as the second flag.

[0237] S516: Update the number of 32-bit applications installed in the terminal device, and continue to execute S513 to S516 in a loop.

[0238] It should be understood that in order to facilitate the subsequent efficient incubation of the application process of the 32-bit application, the terminal device can set the 32-bit process tag to the second tag after monitoring the installation of the 32-bit application on the terminal device. In this way, the 32-bit process tag is more consistent with the actual situation of the current terminal device, thereby making the execution operation of the terminal device more in line with the actual situation.

[0239] Optionally, the above S513 and S514 are specifically implemented in the following manner: obtaining package information of the first application; determining whether the package information of the first application includes information indicating that the first application is a 32-bit application; if so, determining that the terminal device is monitored to install a 32-bit application.

[0240] It should be understood that package information can be understood as information used to describe the installation package, and the package information may include the application name of the application, the installation package name, and information used to indicate that the application is a 32-bit application or a 64-bit application. The first application is an application to be installed, for example, it can be a music application, a shopping application, etc. The package information of the first application includes information used to indicate that the first application is a 32-bit application or a 64-bit application. Exemplarily, the package information of the first application may include CPU information, such as CPU application binary interface (ABI) information, and the terminal device can determine whether the first application is a 32-bit application through the CPU information. For example, the CPU information includes armeabi-v7a information, and the terminal device can determine that the first application is a 32-bit application based on the armeabi-v7a information. Armeabi-v7a can be understood as a type of information used to indicate that the first application is a 32-bit application.

[0241] It is understandable that the terminal device can install the first application in a variety of ways, such as through an application market application, etc. This application does not specifically limit the installation method of the first application.

[0242] S517: Monitor the uninstallation process of the application.

[0243] S518: Determine whether uninstallation of a 32-bit application is detected.

[0244] If uninstallation of a 32-bit application is detected, S519 and S520 are executed.

[0245] If no uninstallation of the 32-bit application is detected, S517 and S518 are executed again.

[0246] S519: Update the number of 32-bit applications installed in the terminal device.

[0247] S520: Determine whether the number of 32-bit applications installed in the terminal device is 0.

[0248] If the number of 32-bit applications installed in the terminal device is greater than 0, S517 is executed again.

[0249] It should be understood that since the 32-bit process mark is set to the second mark before the 32-bit application is uninstalled, and the 32-bit application still exists in the terminal device after the 32-bit application is uninstalled, when the number of 32-bit applications is greater than 0, the terminal device does not need to reset the 32-bit process mark and needs to continue to monitor the application uninstallation process.

[0250] If the number of 32-bit application programs installed in the terminal device is 0, S521 is executed to set the 32-bit process flag to the first flag.

[0251] It should be understood that after uninstalling a 32-bit application, if no 32-bit application is installed in the terminal device, the 32-bit process flag is set to the first flag. In this way, the terminal device can determine that the 32-bit application is not installed in the terminal device based on the first flag the next time it reads the 32-bit process flag, and thus does not start the 32-bit incubator process. For example, after setting the 32-bit process flag to the first flag, the terminal device is shut down. The next time the terminal device detects a user power-on operation, it can read the 32-bit process flag as the first flag, thereby determining that the 32-bit application is not installed in the terminal device and not starting the 32-bit incubator process, thereby reducing the memory usage of the terminal device, optimizing the terminal device's power-on performance, and thus improving the user experience.

[0252] Optionally, S517 and S518 are specifically implemented in the following manner: obtaining package information of the second application; determining whether the package information of the second application includes information indicating that the second application is a 32-bit application; if so, determining that the terminal device is monitored to uninstall the 32-bit application.

[0253] It should be understood that the second application is an application to be installed, for example, a music application, a shopping application, etc. The implementation method of determining that the terminal device has been monitored to uninstall a 32-bit application is similar to the implementation method of determining that the terminal device has been monitored to install a 32-bit application, and can refer to the above description, which will not be repeated here.

[0254] It should be understood that the second application can be uninstalled in a variety of ways, such as uninstalling through an application market application, or uninstalling based on the user's uninstall operation on the icon of the second application on the desktop, etc. This application does not specifically limit the uninstall method of the second application.

[0255] Through the method shown in Figure 6, when the terminal device monitors the uninstallation and installation of 32-bit applications, it can update the number of 32-bit applications installed in the terminal device. Since the number of 32-bit applications installed in the terminal device is updated in real time according to actual conditions, the terminal device can set a 32-bit process flag according to the number of 32-bit applications installed in the terminal device, and determine whether the 32-bit application is installed in the terminal device based on the read 32-bit process flag, thereby making the execution operation of the terminal device more in line with actual conditions.

[0256] It is understood that when the operating system is in operation, S513 to S516 and S517 to S521 are executed in a loop, that is, the terminal device will continuously monitor the installation and uninstallation processes of the application, so that the terminal device can set the 32-bit process flag according to whether a 32-bit application is installed. In addition, when the terminal device executes S507 in method 500 in a loop, if the terminal device resets the 32-bit process flag through the process of S509 to S521, the terminal device can read the reset 32-bit process flag; if the terminal device has already executed S508 in method 500, if the terminal device resets the 32-bit process flag through the process of S509 to S521, the terminal device will not read the reset 32-bit process flag before shutting down.

[0257] It should be understood that S504 to S506, S507 to S508, and S509 to S521 can be executed in parallel or sequentially, and the embodiments of the present application do not specifically limit this.

[0258] Below, the method for starting the operating system of the embodiment of the present application described in the above-mentioned second method is described in detail with reference to FIG. 7 and FIG. 8 .

[0259] The method for starting the operating system of the embodiment of the present application described in the above-mentioned method 2 can be specifically implemented through two implementation methods. Below, the method for starting the operating system of the embodiment of the present application described in the above-mentioned method 2 is described in detail in combination with Figures 7 and 8 respectively.

[0260] FIG7 is a flow chart of a method 700 for starting an operating system provided in an embodiment of the present application. The method 700 is applied to a terminal device, and the hardware structure of the terminal device may be as shown in FIG1 , and the software structure may be as shown in FIG2 . The method 700 includes the following steps:

[0261] S701: Load the system boot program.

[0262] S702: Load the system kernel.

[0263] S703: Start the initial process.

[0264] S704. Start the 64-bit incubator process.

[0265] S705: Incubate the system server process.

[0266] S706: Incubate the desktop launcher process.

[0267] It should be understood that the specific implementation of S701 to S706 is similar to that of S501 to S506 in method 500, and will not be repeated here. Please refer to the above description.

[0268] S707: Determine whether the 32-bit process flag is the second flag.

[0269] It is understood that after the terminal device is powered on, the first 32-bit process flag read may be the flag last set by the terminal device during the last operation of the terminal device. For example, assuming that during the last operation of the terminal device, the terminal device finally set the 32-bit process flag to the first flag; then after the current power-on, the terminal device determines that the 32-bit process flag is the first flag.

[0270] If the 32-bit process mark is the second mark, S708 is executed to start the 32-bit incubator process.

[0271] After S708 , the terminal device executes S709 to set the 32-bit process flag to the first flag.

[0272] It should be understood that the terminal device starting the 32-bit incubator process indicates that the 32-bit process is marked as the second mark. Therefore, when the terminal device executes S708, the 32-bit process is marked as the second mark. By setting the 32-bit process mark to the first mark after the 32-bit incubator process is started, on the one hand, it will not affect the startup of the 32-bit application; on the other hand, it can make the 32-bit process read during the next startup of the terminal device be marked as the first mark, so that the 32-bit incubator process will not be directly started during the startup of the terminal device. In this way, compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time, only starting the 64-bit incubator process when the terminal device is started, the memory usage of the terminal device is smaller, and the startup performance of the terminal device can be optimized, thereby improving the user experience.

[0273] If the 32-bit process mark is the first mark, S707 is executed again.

[0274] It should be understood that when the 32-bit process mark is the first mark, the terminal device can determine that the 32-bit application is not started in the terminal device, and the 32-bit incubator process will not be installed, and S707 will be executed in a loop until the 32-bit process mark is read as the second mark, and then S708 and S709 are executed, and this process ends.

[0275] S710: Monitor the startup process of the application.

[0276] S711. Determine whether it is the first time to start a 32-bit application.

[0277] It should be understood that after monitoring the application startup process, the terminal device determines whether the application is a 32-bit application. If the application is a 32-bit application, it determines that it is the first time to start the 32-bit application and no longer monitors the application startup process.

[0278] If the 32-bit application is started for the first time, S712 is executed to set the 32-bit process flag to the second flag.

[0279] If the started application is not a 32-bit application, S710 and S711 are executed again.

[0280] It should be understood that, in the case that the terminal device continues to fail to detect the first startup of a 32-bit application, the terminal device will loop S710 and S711 until the terminal device switches from the power-on state to the power-off state.

[0281] It should be understood that after the terminal device detects the user's power-on operation, the 32-bit process mark is always the first mark until the first startup of the 32-bit application is monitored. Therefore, the terminal device is in a state of continuously executing S707; after monitoring the first startup of the 32-bit application and setting the 32-bit process mark to the second mark, when the terminal device executes S707 again, it can read the 32 bits and mark them as the second mark, and thus will continue to execute S708 and S709.

[0282] With this technical solution, when a terminal device first launches a 32-bit application, it can first launch a 32-bit incubator process. This not only reduces the terminal device's memory usage by not launching the 32-bit incubator during the terminal device's startup process, but also optimizes the terminal device's startup performance. Furthermore, it allows the terminal device to launch 32-bit applications normally, improving the user experience. Furthermore, compared to launching the 32-bit incubator process after installing a 32-bit application on the terminal device, since the 32-bit application may not be launched immediately after installation, launching the 32-bit incubator process when the 32-bit application is first launched can further reduce the terminal device's memory usage.

[0283] Optionally, the above S710 and S711 can be specifically implemented in the following manner: obtaining package information of the third application; determining whether the package information of the third application includes information indicating that the third application is a 32-bit application; if so, determining that the terminal device is monitored to start a 32-bit application.

[0284] It should be understood that a terminal device can launch a third application in a variety of ways. One way to launch a third application is based on a user input operation, such as clicking a third application icon on the desktop. In this case, the desktop launcher can indicate the installation package name of the third application to the activity management service module. Another way to launch a third application is for another application to trigger the launch of the third application. For example, when a user is using a music application, the music application triggers the launch of a payment application. The other application can indicate the installation package name of the third application to the activity management service module.

[0285] It should also be understood that the specific implementation method of the terminal device determining whether the package information of the third application includes information indicating that the third application is a 32-bit application is similar to the process of the terminal device monitoring the installation process of the terminal device to determine whether the application is a 32-bit application. It will not be repeated here, and you can refer to the description above.

[0286] In the embodiment of the present application, S704 to S706, S707 to S709, and S710 to S712 can be executed in parallel or sequentially, and the embodiment of the present application does not specifically limit this.

[0287] FIG8 is a flow chart of a method 800 for starting an operating system according to an embodiment of the present application. The method 800 is applied to a terminal device, and the hardware structure of the terminal device may be as shown in FIG1 , and the software structure may be as shown in FIG2 . The method 800 includes the following steps:

[0288] S801. Load the system boot program.

[0289] S802: Load the system kernel.

[0290] S803: Start the initial process.

[0291] S804. Start the 64-bit incubator process.

[0292] S805, incubate system server process.

[0293] S806: Incubate the desktop launcher process.

[0294] It should be understood that S801 to S806 are the same as S701 to S706 in method 700 and will not be repeated here.

[0295] S807: Set the 32-bit process flag as the first flag.

[0296] It should be understood that by setting the 32-bit process mark as the first mark before the incubator process is started, the 32-bit process mark initially read after the terminal device is turned on is set to the first mark. In this way, the 32-bit incubator process will not be started when the terminal device is turned on. Compared with starting the 32-bit incubator process and the 64-bit incubator process at the same time, only starting the 64-bit incubator process when the terminal device is turned on takes up less memory of the terminal device, can optimize the startup performance of the terminal device, and improve the user experience.

[0297] S808: Determine whether the 32-bit process flag is the second flag.

[0298] S809. Start the 32-bit incubator process.

[0299] S810: Monitor the startup process of the application.

[0300] S811. Determine whether it is the first time to start a 32-bit application.

[0301] S812: Set the 32-bit process flag as the second flag.

[0302] It should be understood that S810 to S812 are the same as S710 to S712 in method 700, and will not be repeated here. Please refer to the above description.

[0303] It should also be understood that S804 to S806, S807 to S809, and S810 to S812 can be executed in parallel or sequentially, and the embodiments of the present application do not specifically limit this.

[0304] It can be understood that the difference between method 800 and method 700 is that the timing of setting the 32-bit process mark to the first mark is different. In method 700, the 32-bit process mark is set to the first mark after the terminal device starts the 32-bit incubator process, so that the next time the terminal device detects the user's power-on operation, the initial 32-bit process mark read is the first mark; in method 800, after the terminal device detects the user's power-on operation, before reading the 32-bit process mark, the 32-bit process mark is first set to the first mark, so that the 32-bit process mark initially read by the terminal device is the first mark. Both methods can prevent the terminal device from starting the 32-bit incubator process during the power-on process, thereby reducing the memory usage of the terminal device and optimizing the power-on performance of the terminal device.

[0305] In methods 500, 700, and 800 of the embodiments of the present application, the implementation of determining whether a 32-bit process is marked as the first mark or the second mark can refer to the description of the above method 400 and will not be repeated here.

[0306] The following describes in detail how to read the 32-bit process tag.

[0307] As an optional embodiment, the 32-bit process tag is read by calling an attribute access function; or, the 32-bit process tag is read by accessing a database.

[0308] It should be understood that the 32-bit process tag can be stored on the terminal device through various methods, such as attribute items, databases, and other methods. The attribute item can be understood as a property. Furthermore, the 32-bit process tag remains stored on disk after the operating system crashes and restarts. The property access function can be understood as a property_get function, which can be used to obtain the 32-bit process tag stored on the terminal device.

[0309] As an optional embodiment, setting the 32-bit process mark as the first mark, or setting the 32-bit process mark as the second mark, can be implemented in the following way: calling the property setting function to set the 32-bit process mark as the first mark, or calling the property setting function to set the 32-bit process mark as the second mark.

[0310] It should be understood that the property access function can be understood as a property_set function. Through the property setting function, the 32-bit process flag stored in the terminal device can be set.

[0311] The above text, in combination with Figures 4 to 8, describes in detail the method for starting the operating system of an embodiment of the present application. The following text, in combination with Figures 9 and 10, describes in detail the terminal device of an embodiment of the present application.

[0312] FIG9 is a schematic block diagram of a terminal device 900 provided in an embodiment of the present application. As shown in FIG9 , the terminal device 900 includes: a processing module 901 .

[0313] The processing module 901 is used to detect the user's power-on operation on the terminal device 900 and start the 64-bit incubator process; based on the 32-bit process mark, it is determined whether the 32-bit incubator process needs to be started, and the 32-bit process mark is the first mark or the second mark; if the 32-bit process mark is the first mark, the 32-bit incubator process is not started.

[0314] Optionally, the processing module 901 is further configured to: if the 32-bit process mark is a first mark, continue to read the 32-bit process mark; and when the 32-bit process mark is read as a second mark, start the 32-bit incubator process.

[0315] Optionally, the terminal device 900 also includes: a package management service module 902, which is used to scan the installed applications in the terminal device 900 to obtain the number of 32-bit applications installed in the terminal device 900; if the number of 32-bit applications installed in the terminal device 900 is 0, the 32-bit process mark is set to the first mark, or if the number of 32-bit applications installed in the terminal device 900 is greater than 0, the 32-bit process mark is set to the second mark; monitor the installation process of the application of the terminal device 900; if the terminal device 900 is monitored to install a 32-bit application, the 32-bit process mark is set to the second mark, and the number of 32-bit applications installed in the terminal device 900 is updated; monitor the uninstallation process of the application of the terminal device 900; if the terminal device 900 is monitored to uninstall the 32-bit application, determine whether the terminal device 900 still has installed 32-bit applications; if not, set the 32-bit process mark to the first mark.

[0316] Optionally, the package management service module 902 is specifically used to: obtain package information of the first application; determine whether the package information of the first application includes information indicating that the first application is a 32-bit application; if so, determine that the terminal device 900 is monitored to install a 32-bit application.

[0317] Optionally, the package management service module 902 is specifically used to: if it is monitored that the terminal device 900 uninstalls a 32-bit application, update the number of 32-bit applications installed in the terminal device 900; if the number of 32-bit applications installed in the terminal device 900 after the update is 0, determine that there is no installed 32-bit application in the terminal device 900.

[0318] Optionally, the package management service module 902 is specifically used to: obtain package information of the second application; determine whether the package information of the second application includes information indicating that the second application is a 32-bit application; if so, determine to monitor that the terminal device 900 uninstalls the 32-bit application.

[0319] Optionally, the processing module 901 is also used to: read the 32-bit process tag and monitor the startup process of the application of the terminal device 900; the terminal device 900 also includes: an activity management service module 903, which is used to set the 32-bit process tag to the second tag if it monitors that the terminal device 900 starts a 32-bit application for the first time; the processing module 901 is also used to: start a 32-bit incubator process.

[0320] Optionally, the activity management service module 903 is specifically used to: obtain package information of the third application; determine whether the package information of the third application includes information indicating that the third application is a 32-bit application; if so, determine to monitor that the terminal device 900 starts a 32-bit application.

[0321] Optionally, the processing module 901 is further configured to: start the package management service module 902 ; or start the activity management service module 903 .

[0322] It should be understood that the processing module 901 may include a system server process, and the system server process may start the package management service module 902 and the activity management service module 903 .

[0323] Optionally, the processing module 901 is further configured to: set the 32-bit process flag as a first flag.

[0324] Optionally, the processing module 901 is specifically configured to: start an initial process after detecting a user power-on operation on the terminal device 900 ; and use the initial process to determine whether the 32-bit process mark is the first mark or the second mark.

[0325] Optionally, the processing module 901 is specifically used to: after starting the initial process, start the 32-bit incubator process; after starting the 32-bit incubator process, the 32-bit incubator process is in a semi-started state; using the 32-bit incubator process in the semi-started state, determine whether the 32-bit process mark is the first mark or the second mark.

[0326] It should be understood that the terminal device 900 here is embodied in the form of a functional module. The term "module" here can refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art will understand that the terminal device 900 can be used to execute the various processes and / or steps corresponding to the terminal device in the above-mentioned method embodiment. To avoid repetition, they are not described here.

[0327] The terminal device 900 has the function of implementing the corresponding steps performed by the terminal device in the above method; the above functions can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0328] In the embodiment of the present application, the terminal device 900 in FIG9 may also be a chip, such as a SOC. Correspondingly, the processing module 901 may be a processing circuit of the chip, which is not limited here.

[0329] Figure 10 is a schematic block diagram of a terminal device 1000 provided in an embodiment of the present application. The terminal device 1000 includes a processor 1001, a communication interface 1002 and a memory 1003. Among them, the processor 1001, the communication interface 1002 and the memory 1003 communicate with each other through an internal connection path, the memory 1003 is used to store instructions, and the processor 1001 is used to execute the instructions stored in the memory 1003. The communication interface 1002 can be used to send signals to other devices (such as the processor 1001 or the touch screen of the terminal device), and can also be used to receive signals from other devices (such as the memory 1003). Exemplarily, the communication interface 1002 reads the instructions stored in the memory 1003 and sends the instructions to the processor 1001.

[0330] It should be understood that the terminal device 1000 can be specifically the terminal device in the above-mentioned embodiment, and can be used to execute the various steps and / or processes corresponding to the terminal device in the above-mentioned method embodiment. Optionally, the memory 1003 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store device type information. The processor 1001 can be used to execute instructions stored in the memory, and when the processor 1001 executes the instructions stored in the memory, the processor 1001 is used to execute the various steps and / or processes of the above-mentioned method embodiment.

[0331] It should be noted that the above-described method embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above-described method embodiments can be completed by hardware integrated logic circuits within the processor or by software instructions. The above-described processor may be a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software modules can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium is located in a memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above-described method.

[0332] The memory in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Wherein, the non-volatile memory can be a ROM, PROM, EPROM, EEPROM or flash memory. The volatile memory can be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (doubledata rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM). It should be noted that the memory of the system and method described herein is intended to include but is not limited to these and any other suitable types of memory.

[0333] The present application provides a chip system, which includes at least one processor for supporting the functions of the terminal device involved in any one of the above method embodiments, for example, processing the data and / or information involved in the above method.

[0334] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0335] The chip system can be composed of chips, or can include chips and other discrete devices.

[0336] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the terminal device in the above method embodiment.

[0337] The present application also provides a computer-readable storage medium storing a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the terminal device in the above method embodiment.

[0338] The method provided in the above embodiment can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product may include one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic disk), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).

[0339] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0340] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0341] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0342] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0343] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0344] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[0345] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for starting an operating system, characterized in that: Applied to a terminal device, the method comprises: Detecting a user's power-on operation on the terminal device, and starting a 64-bit incubator process; According to the 32-bit process mark, determining whether it is necessary to start the 32-bit incubator process, wherein the 32-bit process mark is the first mark or the second mark; If the 32-bit process mark is the first mark, the 32-bit incubator process is not started.

2. The method according to claim 1, characterized in that The method further comprises: If the 32-bit process mark is the first mark, continue to read the 32-bit process mark; When the 32-bit process mark is read as the second mark, the 32-bit incubator process is started.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Scanning the applications installed in the terminal device to obtain the number of 32-bit applications installed in the terminal device; If the number of 32-bit applications installed in the terminal device is 0, the 32-bit process mark is set to the first mark; or if the number of 32-bit applications installed in the terminal device is greater than 0, the 32-bit process mark is set to the second mark.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Monitoring the installation process of the application of the terminal device; If it is monitored that the terminal device installs a 32-bit application, the 32-bit process mark is set to the second mark.

5. The method according to claim 4, characterized in that The installation process of the application program for monitoring the terminal device includes: Obtaining package information of a first application; determining whether the package information of the first application includes information indicating that the first application is a 32-bit application; If so, it is determined that the terminal device is monitored to install a 32-bit application.

6. The method according to claim 5, characterized in that After determining that the terminal device is monitored to install a 32-bit application, the method further includes: The number of 32-bit applications installed in the terminal device is updated.

7. The method according to any one of claims 1 to 6, characterized in that The first mark is used to indicate that a 32-bit application is not installed in the terminal device, and the method further includes: Monitoring the uninstallation process of the application program of the terminal device; If it is monitored that the terminal device uninstalls the 32-bit application, determine whether the terminal device still has installed 32-bit applications; If not, the 32-bit process flag is set to the first flag.

8. The method according to claim 7, characterized in that If it is monitored that the terminal device uninstalls the 32-bit application, determining whether the terminal device still has an installed 32-bit application includes: If it is monitored that the terminal device uninstalls the 32-bit application, updating the number of 32-bit applications installed in the terminal device; If the number of 32-bit applications installed in the terminal device after the update is 0, it is determined that there is no 32-bit application installed in the terminal device.

9. The method according to claim 7 or 8, characterized in that: The uninstallation process of the application program monitoring the terminal device includes: Obtaining package information of a second application; determining whether the package information of the second application includes information indicating that the second application is a 32-bit application; If so, it is determined that the terminal device is monitored to uninstall the 32-bit application.

10. The method according to claim 1, characterized in that The method further comprises: Read the 32-bit process tag and monitor the startup process of the application of the terminal device; If it is monitored that the terminal device starts a 32-bit application for the first time, the 32-bit process mark is set to the second mark, and the 32-bit incubator process is started.

11. The method according to claim 10, characterized in that The startup process of the application program of the monitoring terminal device includes: Obtaining package information of a third application; Determining whether the package information of the third application includes information indicating that the third application is a 32-bit application; If so, it is determined that the terminal device is monitored to start a 32-bit application.

12. The method according to claim 10 or 11, characterized in that: After starting the 32-bit incubator process, the method further includes: The 32-bit process flag is set to the first flag.

13. The method according to claim 10 or 11, characterized in that: Before judging whether it is necessary to start the 32-bit incubator process according to the 32-bit process mark, the method further includes: The 32-bit process flag is set to the first flag.

14. The method according to any one of claims 1 to 13, characterized in that The step of judging whether to start a 32-bit incubator process according to the 32-bit process mark includes: After detecting that the user turns on the terminal device, starting an initial process; Using the initial process, it is determined whether the 32-bit process mark is the first mark or the second mark.

15. The method according to any one of claims 1 to 13, characterized in that The determining whether to start the 32-bit incubator process according to the 32-bit process mark includes: After starting the initial process, the 32-bit incubator process is started; After starting the 32-bit incubator process, the 32-bit incubator process is in a semi-started state; Using the 32-bit incubator process in a semi-started state, it is determined whether the 32-bit process mark is the first mark or the second mark.

16. The method according to any one of claims 1 to 15, characterized in that The 32-bit process tag is read by calling an attribute access function; or, the 32-bit process tag is read by accessing a database.

17. A terminal device, characterized in that: The terminal device comprises a processing module; The processing module is used for: Detecting a user's power-on operation on the terminal device, and starting a 64-bit incubator process; According to the 32-bit process mark, determining whether it is necessary to start the 32-bit incubator process, wherein the 32-bit process mark is the first mark or the second mark; If the 32-bit process mark is the first mark, the 32-bit incubator process is not started.

18. The terminal device according to claim 17, characterized in that: The processing module is also used for: If the 32-bit process mark is the first mark, continue to read the 32-bit process mark; When the 32-bit process mark is read as the second mark, the 32-bit incubator process is started.

19. The terminal device according to claim 17 or 18, characterized in that: The terminal device also includes: a package management service module; The package management service module is used to: Scanning the applications installed in the terminal device to obtain the number of 32-bit applications installed in the terminal device; If the number of 32-bit applications installed in the terminal device is 0, the 32-bit process flag is set to the first flag, or if the number of 32-bit applications installed in the terminal device is greater than 0, the 32-bit process flag is set to the second flag; Monitoring the installation process of the application of the terminal device; If it is monitored that the terminal device installs a 32-bit application, the 32-bit process flag is set to the second flag, and the number of 32-bit applications installed in the terminal device is updated; Monitoring the uninstallation process of the application program of the terminal device; If it is monitored that the terminal device uninstalls the 32-bit application, determine whether the terminal device still has installed 32-bit applications; If not, the 32-bit process flag is set to the first flag.

20. The terminal device according to claim 19, characterized in that: The package management service module is specifically used for: Obtaining package information of a first application; determining whether the package information of the first application includes information indicating that the first application is a 32-bit application; If so, it is determined that the terminal device is monitored to install a 32-bit application.

21. The terminal device according to claim 19 or 20, characterized in that: The package management service module is specifically used for: If it is monitored that the terminal device uninstalls the 32-bit application, updating the number of 32-bit applications installed in the terminal device; If the number of 32-bit applications installed in the terminal device after the update is 0, it is determined that there is no 32-bit application installed in the terminal device.

22. The terminal device according to any one of claims 19 to 21, characterized in that: The package management service module is specifically used for: Obtaining package information of a second application; determining whether the package information of the second application includes information indicating that the second application is a 32-bit application; If so, it is determined that the terminal device is monitored to uninstall the 32-bit application.

23. The terminal device according to claim 17, characterized in that: The processing module is also used for: Read the 32-bit process tag and monitor the startup process of the application of the terminal device; The terminal device further includes: an activity management service module, configured to set the 32-bit process mark to the second mark when monitoring that the terminal device starts a 32-bit application for the first time; The processing module is also used for: Start the 32-bit incubator process.

24. The terminal device according to claim 23, characterized in that: The activity management service module is specifically used for: Obtaining package information of a third application; Determining whether the package information of the third application includes information indicating that the third application is a 32-bit application; If so, it is determined that the terminal device is monitored to start a 32-bit application.

25. The terminal device according to claim 23 or 24, characterized in that: The processing module is also used for: The 32-bit process flag is set to the first flag.

26. The terminal device according to any one of claims 17 to 25, characterized in that: The processing module is specifically used for: After detecting that the user turns on the terminal device, starting an initial process; The initial process is used to determine whether the 32-bit process mark is the first mark or the second mark.

27. The terminal device according to any one of claims 17 to 25, characterized in that: The processing module is specifically used for: After starting the initial process, the 32-bit incubator process is started; After starting the 32-bit incubator process, the 32-bit incubator process is in a semi-started state; Using the 32-bit incubator process in a semi-started state, it is determined whether the 32-bit process mark is the first mark or the second mark.

28. A terminal device, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program, the terminal device executes the method according to any one of claims 1 to 16.

29. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 16.

30. A computer program product, characterized in that The computer program product includes a computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • System start-up method and device

    CN106126377A

  • Dynamic link library file loading method, device and equipment and readable storage medium

    CN115167948A

  • Android system starting method, terminal equipment and storage medium

    CN115344328A

  • System service switching method and control device, electronic equipment and storage medium

    CN116048629A

  • Application Start Method and Electronic Device

    US20220308899A1