Android system starting method and device and electronic equipment
By presetting the file system configuration file in the Android system and dynamically adapting to different file system formats, the compatibility and adaptability issues of the Android system are solved, and the normal operation of the application on multiple file systems is achieved.
Patent Information
- Application Number
- CN202510823040.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-10-03
AI Technical Summary
The existing Android system file system partitions are fixed, resulting in the same software version supporting only one file system format type, which limits the compatibility of devices and the adaptability of applications.
By presetting a file system configuration file in the Android system, which includes configuration information of at least two file system format types, parsing and loading the corresponding format files, dynamic adaptation of the file system is achieved.
Improves the file system adaptability and compatibility of the Android system, allowing the same application to run normally on devices with different file system format types.
Smart Images

Figure CN120743371A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of Android system optimization, and in particular to an Android system startup method, device and electronic device. Background Art
[0002] Android is an open-source mobile operating system developed by Google, primarily for smartphones and tablets. Based on the Linux kernel, Android supports multitasking and a rich notification system. It is deeply integrated with Google services, offers a vast application library through the Google Play Store, and receives regular updates to enhance security. Android's openness, versatility, and broad device support have made it one of the world's most popular mobile operating systems.
[0003] In the Android system, the file system and the operating system are two core components that jointly manage device resources and data storage. The file system is used to manage data in the device storage. On different Android devices, the file format of the user area is usually fixed, and different file systems have different characteristics and properties. For example, the Android userdata user partition often uses the Ext4 (Fourth extended file system) and F2fS (Flash Friendly File System) format types. The F2fS format type of file system has faster read and write performance, and the Ext4 format type of file system has better overall stability. However, users may have different file system format type (or file system type) requirements. However, the existing Android file system partition is fixed, and the same software version only supports one file system format type, which limits the compatibility of the software and cannot adapt to different devices or operating systems using multiple file systems, resulting in the application (software) not being able to run on some Android devices. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an Android system startup method, device and electronic device, so that the Android system can load different file system format types and improve the adaptability and compatibility of application programs.
[0005] To solve the above technical problems, in a first aspect, the present invention provides an Android system startup method, comprising: determining whether there is a file system configuration file in the Android system, the file system configuration file including configuration information of at least two file system format types; in response to the existence of the file system configuration file in the Android system, parsing the file system configuration file and obtaining various format files, wherein one format file corresponds to configuration information of one file system format type; obtaining the format type of the file system in the Android system; selecting the format file corresponding to the format type of the file system in the Android system for loading, and mounting the file system partition.
[0006] Optionally, the file system format type includes at least Ext4 format and F2FS format.
[0007] Optionally, the configuration information of the file system format type includes at least a partition source location point, a mount point, a file system format type, a mount flag, and a file system management flag.
[0008] Optionally, the method further includes: in response to the absence of the file system configuration file in the Android system, loading a default format file of the Android system.
[0009] Optionally, obtaining the format type of the file system in the Android system includes: reading super block information of data in the file system, and determining the format type of the file system according to the super block information.
[0010] Optionally, the method further includes: before determining whether there is a file system configuration file in the Android system, initializing the Android system to form the file system configuration and the environment required for mounting.
[0011] Optionally, initializing the Android system includes: loading a bootloader process, an init process, a vold process, and an fs_mgr process in sequence.
[0012] In a second aspect, the present invention provides an Android system startup device, comprising: a judgment module, configured to judge whether there is a file system configuration file in the Android system, the file system configuration file including configuration information of at least two file system format types; a parsing module, configured to parse the file system configuration file in response to the existence of the file system configuration file in the Android system and obtain configuration information of each format file, and one format file corresponds to one file system format type; an acquisition module, configured to obtain the format type of the file system in the Android system; a loading module, configured to select a format file corresponding to the format type of the file system in the Android system for loading, and mount the file system partition.
[0013] In a third aspect, the present invention provides an electronic device comprising: a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the Android system startup method as described in the first aspect are implemented.
[0014] In a fourth aspect, the present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the Android system startup method as described in the first aspect are implemented.
[0015] Compared with the prior art, the present invention has the following advantages: before mounting a file system, it first determines whether the Android system has a file system configuration file, which includes configuration information for at least two file system format types. Then, in response to the existence of the file system configuration file in the Android system, it parses the file system configuration file and obtains configuration information for each format file, with each format file corresponding to a file system format type. The file system format type in the Android system is then obtained, and finally, the format file corresponding to the file system format type in the Android system is selected for loading, and the file system partition is mounted. Because the file system configuration file can be used to parse the format file for the file system, the Android system can load different file system format types, thereby improving the adaptability and compatibility of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are included to provide a further understanding of the present application. They are incorporated into and constitute a part of this application. The accompanying drawings illustrate embodiments of the present application and, together with this specification, serve to explain the principles of the present application. In the accompanying drawings:
[0017] Figure 1 This is a flowchart of an Android system startup method according to an embodiment of the present invention;
[0018] Figure 2 1 is a flow chart of an Android system startup method according to another embodiment of the present invention;
[0019] Figure 3 This is a schematic structural diagram of an Android system startup device according to an embodiment of the present invention;
[0020] Figure 4 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the following is a brief introduction to the drawings required for describing the embodiments. Obviously, the drawings described below are merely examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without inventive effort. Unless otherwise apparent from the context or otherwise noted, the same reference numerals in the figures represent the same structure or operation.
[0022] As used in this application and the claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not intended to refer to the singular but may include the plural. Generally speaking, the terms "comprises" and "include" only indicate the inclusion of the steps and elements specifically identified, and these steps and elements do not constitute an exclusive list. A method or apparatus may also include other steps or elements.
[0023] Flowcharts are used throughout this application to illustrate operations performed according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the various steps may be performed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0024] Figure 1 This is a flow chart of an Android system startup method according to an embodiment of the present invention. Figure 1 As shown, the Android system startup method 100 of this embodiment includes: S110, judging whether there is a file system configuration file in the Android system, the file system configuration file including configuration information of at least two file system format types; S120, in response to the existence of the file system configuration file in the Android system, parsing the file system configuration file and obtaining various format files, and one format file corresponds to the configuration information of one file system format type; S130, obtaining the format type of the file system in the Android system; S140, selecting the format file corresponding to the format type of the file system in the Android system for loading, and mounting the file system partition.
[0025] During the startup process, the Android system initializes core software or processes and loads drivers and file systems. The file system is one of the core components of the Android system, responsible for data storage, organization, access, and protection, providing efficient and reliable data management services for users and applications. For a specific Android device, it will only have one file system format type, such as Ext4, F2FS, FAT32, exFAT, etc., where Ext4 and F2FS are internal storage file system formats. Generally, the file system format type loaded by the Android system is consistent with the actual file system format type, which enables the Android system to start and run smoothly. However, in other application scenarios, if the file system format type is not clear, it is impossible to know which file system format type to match when the Android system starts, and the corresponding application will be restricted. Based on this, this embodiment pre-sets a file system configuration file (fstab file) in the Android system, and this file system configuration file includes configuration information for at least two file system format types. For example, the file system format types include at least Ext4 and F2FS. Then, when loading a format file, the format file corresponding to the file system format type is selected for loading.
[0026] For example, if the current file system format type is Ext4, during the Android system startup process, the Android system will parse the pre-set file system configuration file. The parsing result includes configuration information for at least two file system format types. For example, if a file system configuration file including Ext4 format files is pre-set, the parsed format files will include Ext4 format files. In this way, when loading the file system format type, an Ext4 format file that matches the Ext4 format can be selected, so that the Android system startup and the mounting of the file system partition meet the format requirements, thereby improving the adaptability and compatibility of the application. Regardless of whether the file system is in Ext4 format, F2FS format, or other format, as long as the pre-set file system configuration file can parse the format file corresponding to the actual file system, the application can be loaded and run on this Android device. Therefore, the method of this embodiment enables the same application to support one file format (such as Ext4), another file format (such as F2FS), or other formats. The file format to be loaded can be determined by a fixed flag bit, and software versions with different file formats can also be managed using the same OTA version upgrade.
[0027] In one example, the configuration information of the file system format type includes at least the partition source location point <src>, mount point<mnt_point> , file system type <type>, Mount flag<mnt_flags> And the file system management flag<fs_mgr_flags> .
[0028] For example, the pre-set file system configuration file includes configuration details of two file system format types, taking Ext4 and F2FS as examples. The file system configuration file can be in XML format, and the configuration information can be as follows:
[0029]
[0030]
[0031] In one example, method 100 further includes: in response to the absence of a file system configuration file in the Android system, loading a file in a default format of the Android system. When the Android system does not have a file system configuration file, there is no way to parse a file in a different format, and the Android system boots according to a normal boot process and directly mounts the file system partition. Of course, if an application exists with a mismatched file system format, the application may not run on the Android device.
[0032] In one example, obtaining the format type of the file system in the Android system may include reading super block information of data in the file system and determining the format type of the file system according to the super block information.
[0033] The data in the file system includes a superblock, which stores key information of the file system. This key information is used to describe and manage the status and layout of the entire file system, such as the file system format type and version, file system mount status, timestamp, etc. Therefore, the format type and structure of the file system can be identified through the superblock information. For example, the file system uses two different types of data, userdata (user data) and metadata (metadata), to manage and store data. The service will read the superblock information of userdata and metadata. The superblock information contains information such as the file system version and block size. The Android system selects the mount method based on this information. By reading the superblock information, the Android system can determine the specific format of the file system and decide which format to load.
[0034] In one example, method 100 further includes: before determining whether the Android system has a file system configuration file, initializing the Android system to establish a file system configuration and an environment required for mounting. In one implementation, initializing the Android system includes sequentially loading a bootloader process, an init process, a vold process, and an fs_mgr process.
[0035] refer to Figure 2 As shown, this embodiment shows an Android system startup process, which includes step 201: init process initialization, step 202: vold process initialization, step 203: fs_mgr initialization, step 204: judging whether there is a file system configuration file (fstab file), step 205: parse_fstab service startup, step 206: reading super block, step 207: selecting file format, step 208: loading file format, step 209: do_mount_all startup, step 210: Android startup.
[0036] Specifically, when the Android system boots, the bootloader is loaded first, followed by the initialization of the init process. The init process is native to the Android system and, as the first boot process, is responsible for initializing all other processes and services. After starting, the init process reads the init.rc configuration file and starts necessary services according to its instructions. The init process provides basic bootstrapping for the Android system and prepares for subsequent file system configuration and mounting. The init process starts the vold process, a file system management service, which is responsible for mounting and managing the Android device's file system. fs_mgr is a dynamic library responsible for parsing the file system configuration file (fstab) and loading the corresponding file format. It converts the file system configuration file's contents into the Android system's loading format. When selecting a file format, select_fstab reads the file system format type processed by the parse_fstab service and then loads the corresponding file system according to the Android system's default process. After successfully loading the file system, the device's partitions are mounted and ready for data storage and access. Finally, the normal Android boot process begins, including the do_mount_all startup process and subsequent processes such as starting services and applications. Of course, when it is determined and known that there is no file system configuration file in the Android system, the Android system will directly enter the Android normal boot process.
[0037] The Android system startup method of this embodiment first determines whether the Android system has a file system configuration file before mounting the file system. The file system configuration file includes configuration information for at least two file system format types. In response to the existence of the file system configuration file in the Android system, the method parses the file system configuration file and obtains configuration information for each format file, with each format file corresponding to a specific file system format type. The file system format type in the Android system is then obtained. Finally, the format file corresponding to the file system format type in the Android system is selected for loading and the file system partition is mounted. Because the file system configuration file can be used to parse the format file for the appropriate file system, the Android system can load different file system format types, improving the adaptability and compatibility of applications.
[0038] Another embodiment of the present invention provides an Android system startup device, referring to Figure 3 As shown, the device 300 mainly includes: a judgment module 301, configured to judge whether there is a file system configuration file in the Android system, and the file system configuration file includes configuration information of at least two file system format types; a parsing module 302, configured to parse the file system configuration file in response to the existence of the file system configuration file in the Android system and obtain various format files, and one format file corresponds to the configuration information of one file system format type; an acquisition module 303, configured to obtain the format type of the file system in the Android system; a loading module 304, configured to select a format file corresponding to the format type of the file system in the Android system for loading, and mount the file system partition.
[0039] In one example, the file system format type includes at least the Ext4 format and the F2FS format.
[0040] In one example, the configuration information of the file system format type includes at least a partition source location point, a mount point, a file system format type, a mount flag, and a file system management flag.
[0041] In one example, the loading module 304 further includes: in response to the absence of a file system configuration file in the Android system, loading a default format file of the Android system.
[0042] In one example, obtaining the format type of the file system in the Android system includes: reading super block information of data in the file system, and determining the format type of the file system according to the super block information.
[0043] In one example, the apparatus 300 further includes an initialization module configured to initialize the Android system before determining whether there is a file system configuration file in the Android system, to form a file system configuration and an environment required for mounting.
[0044] In one example, initializing the Android system includes sequentially loading a bootloader process, an init process, a vold process, and an fs_mgr process.
[0045] The details of other operations performed by each module in this embodiment can be referred to the aforementioned embodiments and will not be elaborated here.
[0046] The Android system boot device of this embodiment first determines whether the Android system has a file system configuration file before mounting the file system. The file system configuration file includes configuration information for at least two file system format types. In response to the existence of the file system configuration file in the Android system, the device parses the file system configuration file and obtains configuration information for each format file, with each format file corresponding to a specific file system format type. The device then obtains the file system format type in the Android system and selects the format file corresponding to the file system format type in the Android system for loading, thereby mounting the file system partition. Because the file system configuration file can be used to parse the format file for the appropriate file system, the Android system can load different file system format types, thereby improving the adaptability and compatibility of applications.
[0047] An Android system startup device in an embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal.
[0048] The present application also provides an electronic device, comprising: a memory for storing programs or instructions executable by a processor; and a processor for executing the above programs or instructions to implement the various processes of the above-mentioned Android system startup method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0049] Figure 4 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. Electronic device 400 may include an internal communication bus 401, a processor 402, a read-only memory (ROM) 403, a random access memory (RAM) 404, and a communication port 405. When used in a personal computer, electronic device 400 may also include a hard disk 406. Internal communication bus 401 enables data communication between components of electronic device 400. Processor 402 can make decisions and issue prompts. In some embodiments, processor 402 may be composed of one or more processors. Communication port 405 enables data communication between electronic device 400 and the outside world. In some embodiments, electronic device 400 can send and receive information and data from a network via communication port 405. Electronic device 400 may also include various forms of program storage units and data storage units, such as hard disk 406, read-only memory (ROM) 403, and random access memory (RAM) 404, capable of storing various data files used for computer processing and / or communication, as well as possible programs or instructions executed by processor 402. The result processed by the processor 402 is transmitted to the user device through the communication port 405 and displayed on the user interface.
[0050] The aforementioned Android system startup method may be implemented as a computer program, stored in the hard disk 406 , and recorded in the processor 402 for execution to implement any Android system startup method in this application.
[0051] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, the various processes of the above-mentioned Android system startup method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0052] For those skilled in the art, the above invention disclosure is intended only as an example and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and amendments to this application. Such modifications, improvements, and amendments are suggested in this application and remain within the spirit and scope of the exemplary embodiments of this application.
[0053] Although the present application has been described with reference to the current specific embodiments, ordinary technicians in this technical field should recognize that the above embodiments are only used to illustrate the present application, and various equivalent changes or substitutions can be made without departing from the spirit of the present application. Therefore, as long as the changes and modifications to the above embodiments are within the scope of the essential spirit of the present application, they will fall within the scope of the claims of the present application.< / type> < / src>
Claims
1. A method for starting an Android system, characterized in that: include: Determine whether the Android system has a file system configuration file, where the file system configuration file includes configuration information of at least two file system format types; In response to the existence of the file system configuration file in the Android system, the file system configuration file is parsed to obtain configuration information of various format files, wherein each format file corresponds to a file system format type; Obtain the format type of the file system in the Android system; A format file corresponding to the format type of the file system in the Android system is selected for loading, and the file system partition is mounted.
2. The Android system startup method according to claim 1, wherein: The file system format types include at least Ext4 format and F2FS format.
3. The Android system startup method according to claim 2, wherein: The configuration information of the file system format type includes at least a partition source location point, a mount point, a file system format type, a mount flag, and a file system management flag.
4. The Android system startup method according to claim 1, wherein: The method further includes: in response to the absence of the file system configuration file in the Android system, loading a default format file of the Android system.
5. The Android system startup method according to claim 1, wherein: Acquiring the format type of the file system in the Android system includes: reading super block information of data in the file system, and determining the format type of the file system according to the super block information.
6. The Android system startup method according to claim 1, wherein: The method further includes: before determining whether the Android system has a file system configuration file, initializing the Android system to form the file system configuration and the environment required for mounting.
7. The Android system startup method according to claim 6, wherein: Initializing the Android system includes sequentially loading a bootloader process, an init process, a vold process, and an fs_mgr process.
8. An Android system startup device, characterized in that: include: a determination module configured to determine whether the Android system has a file system configuration file, wherein the file system configuration file includes configuration information of at least two file system format types; a parsing module configured to, in response to the existence of the file system configuration file in the Android system, parse the file system configuration file and obtain configuration information of various format files, wherein each format file corresponds to a file system format type; an acquisition module, configured to acquire a format type of a file system in the Android system; The loading module is configured to select a format file corresponding to the format type of the file system in the Android system for loading and mount the file system partition.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the Android system startup method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the Android system startup method according to any one of claims 1 to 7 are implemented.