CN110543369A - Construction method and device of storage space structure of android system and construction structure of storage space structure of android system - Google Patents

Construction method and device of storage space structure of android system and construction structure of storage space structure of android system Download PDF

Info

Publication number
CN110543369A
CN110543369A CN201910860334.9A CN201910860334A CN110543369A CN 110543369 A CN110543369 A CN 110543369A CN 201910860334 A CN201910860334 A CN 201910860334A CN 110543369 A CN110543369 A CN 110543369A
Authority
CN
China
Prior art keywords
storage directory
storage
data
partition
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910860334.9A
Other languages
Chinese (zh)
Inventor
王旭宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gome Vision (beijing) Technology Co Ltd
Original Assignee
Gome Vision (beijing) Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gome Vision (beijing) Technology Co Ltd filed Critical Gome Vision (beijing) Technology Co Ltd
Priority to CN201910860334.9A priority Critical patent/CN110543369A/en
Publication of CN110543369A publication Critical patent/CN110543369A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0817Cache consistency protocols using directory methods
    • G06F12/0824Distributed directories, e.g. linked lists of caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The invention discloses a construction method, a construction device and a construction structure of a storage space structure of an android system, wherein a first storage directory is established in a data partition, and the first storage directory is used for storing a preset application; then the preset application in the first storage directory is softly linked with a second storage directory under the system partition, so that the system can identify the preset application stored in the first storage directory as a system application; setting the attribute and the authority of the first storage directory to ensure the storage safety of the first storage directory; and modifying the mirror image packaging process, upgrading the mirror image packaging process and deleting the mirror image packaging process and the mirror image packaging process when factory settings are restored, and ensuring that the preset application in the first storage directory normally runs as the same as the preset application originally stored in the system partition. The preset application stored in the first storage directory occupies the storage space of the data partition when being upgraded, does not influence the storage of other data in the data partition, and not only ensures that the storage space for storing the preset application is large enough, but also ensures that the storage space is not wasted.

Description

Construction method and device of storage space structure of android system and construction structure of storage space structure of android system
Technical Field
the invention relates to the field of system storage, in particular to a method and a device for constructing a storage space structure of an android system and a construction structure of the storage space structure of the android system.
background
The Android system divides the entire storage space into a plurality of partitions, and each partition stores specific content. The system partition is used for storing applications and data preset by the system, the partition has a read-only property and cannot be modified when the system runs, and the size of the partition is fixed and cannot be expanded when the system is designed. This makes subsequent applications potentially unsettable because the system partition is full. The partition division of Android determines the size of the partition to be determined when a product is designed, and the partition division cannot be modified in the subsequent upgrading process, otherwise the system is damaged.
In a product, the preset application of the system is likely to be changed during subsequent software update upgrades, and more likely, the preset application is gradually increased. Thus, the problem of the increase of subsequent preset applications is considered when designing the partition. Since the future cannot be predicted, a large enough space must be reserved for the preset application.
The existing solutions are generally two, one is to reserve a large enough system partition, which wastes storage space with a high probability. And the other type of the method is to separately divide a partition to store the preset application, but the problem of storage space waste cannot be solved.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a method and a device for constructing a storage space structure of an android system, which can ensure that the storage space is sufficient and do not waste the storage space, and a construction structure thereof.
the technical scheme adopted by the invention for solving the technical problems is as follows:
On the one hand, the method comprises the following steps of,
a construction method of a storage space structure of an android system comprises the following steps:
Creating a first storage directory in the data partition, wherein the first storage directory is used for storing preset applications;
and setting the preset application stored in the first storage directory as a system application.
further, setting the first storage directory to be read-only attribute;
And setting the user creating the first storage directory and the group where the user is located as root authority.
Further, when the android system starts mandatory access control, setting the security policy configuration file authority of the android system as a system file.
further, modifying the mirror image packaging process of the data partition, and packaging the data partition into a system mirror image file when the data partition is mirror image packaged.
Further, the setting the preset application stored in the first storage directory as a system application includes:
And when the system is compiled, all the preset applications stored in the first storage directory are softly linked into a second storage directory, and the second storage directory is positioned in a system partition and used for identifying the applications in the second storage directory as system applications by the system.
further, the upgrading mode of the data partition is changed into differential upgrading.
further, when factory settings are restored, the retaining the contents stored in the first storage directory includes:
Modifying the deleting mode of the data partition when the factory setting is restored into conditional deletion;
And setting a configuration file for the conditional deletion, wherein the configuration file is used for setting a conditional deletion program and reserving the contents stored in the first storage directory.
Further, the configuration file is used for setting a conditional deletion program, and the retaining of the content stored in the first storage directory includes:
receiving a factory setting restoration instruction, and executing a condition deletion program;
Acquiring a judging program from the configuration file, wherein the judging program is used for judging whether the pre-deleted data belongs to the read first storage directory;
If the pre-deleted data belongs to the first storage directory, the pre-deleted data is not deleted; and if the pre-deleted data does not belong to the first storage directory, deleting the pre-deleted data.
on the other hand, in the case of a liquid,
a construction device of an android system storage space structure comprises:
The device comprises a catalog establishing unit, a data partitioning unit and a storage unit, wherein the catalog establishing unit is used for establishing a first storage catalog in a data partition, and the first storage catalog is used for storing preset applications;
And the system application setting unit is used for setting the preset application stored in the first storage directory as the system application.
on the other hand, in the case of a liquid,
a storage space structure of an android system comprises a first storage directory unit and a second storage directory unit;
The first storage directory unit is arranged in the data partition and used for storing preset applications;
the second storage directory unit is arranged in the system partition and used for identifying the application in the second storage directory as a system application by the system;
And the preset application stored in the first storage directory unit is softly linked to the second storage directory unit.
has the advantages that:
the technical scheme of the invention provides a method for constructing a storage space structure of an android system, which comprises the steps of establishing a first storage directory in a data partition, wherein the first storage directory is used for storing a preset application; then, setting the preset application stored in the first storage directory as a system application; ensuring that the preset application stored in the first storage directory operates normally; the preset application stored in the first storage directory occupies the storage space of the data partition when being upgraded, does not influence the storage of other data in the data partition, and not only ensures that the storage space for storing the preset application is large enough, but also ensures that the storage space is not wasted.
drawings
Fig. 1 is a flowchart of a method for constructing a storage space structure of an android system according to an embodiment of the present invention;
Fig. 2 is a schematic structural diagram of a device for constructing a storage space structure of an android system provided in an embodiment of the present invention;
Fig. 3 is a schematic structural diagram of a storage space structure of an android system provided in the embodiment of the present invention;
Fig. 4 is a specific structural schematic diagram of a storage space structure of an android system provided in the embodiment of the present invention.
Detailed Description
It should be noted that the main partitions of the Android system include:
Modem partition, bootloader partition, boot partition, recovery partition, system partition, and data partition, wherein system partition and data partition are the system partition and data partition mentioned in the claims
Modem partitioning: the method realizes the necessary communication function of the mobile phone, generally speaking RADIO is to flash the modem partition, the part is not moved in all the adaptive ROM, otherwise, the call is unstable;
Bootloader partition: the method mainly executes hardware detection to ensure that the hardware can work normally, and then copies the second firmware bootloader to a memory (RAM) to start execution.
Some hardware initialization work is also carried out, memory size information and the like are obtained, and then a certain starting mode is entered according to the key of a user. For example, it is known to use a power key and other keys to access recovery, fastboot, or a start interface for selecting a start mode.
Wherein, fastboot mode: the fastboot is a simple flashing protocol defined by android, and a user can flash through a fastboot command line tool. For example, the command of fastboot flash boot is to flash the contents of boot. Common mobile phone manufacturers do not directly provide the fastboot mode flash, and always provide their own proprietary flash tools and flash methods. Such as the odn of samsung, the RSD of motorcycle, the pink screen of huashi, etc. But are essentially the same, all by flashing the software directly into the various partitions. This is commonly referred to as a line brush, and is the more primitive method. When the mobile phone is not started, the mobile phone can be brushed in by using a tool provided by the manufacturer;
Boot partition: when we just press the power key to start up, we enter the normal start mode. The Secondarstageobootloader starts from the boot partition. The Boot partition is fixed in format, first a header, then a Linux kernel, and finally a ramdisk serving as a root file system. After the Linux kernel is started, the init program in the root file system is executed, and the init program reads the start script files (init.
after the android kernel mounts/nfroot/android fs, a system library, a program and the like are initialized and loaded according to init. Rc scripts include many processes for file system initialization, loading. Rc mainly works as follows:
1) setting some environment variables;
2) creating directories such as system, sdcard, data, cache and the like;
3) putting some file systems mount to some directories, such as mount tmpfs tmpfs/sqlite _ stmt _ journals;
4) Setting user groups and permissions of some files;
5) Setting some thread parameters;
6) Setting the size of a TCP cache;
a root file system has an important configuration file, called default.
recovery partition: recovery mode: recovery is a standard flashing protocol defined by android. When entering the recovery mode, the secondary database bootloader starts to be started from the recovery partition, the recovery partition is actually a simple Linux system, and after the kernel is started, the first program init (the init program is the source of all programs of the Linux system) is started to be executed. init will start a procedure called recovery (and hence the name of recovery mode). Through the recovery program, the user can perform operations of clearing data, installing a flash package and the like. Common mobile phone manufacturers provide a simple recovery flash, and can only perform update operation. The card cannot be swiped; if the card is required to be swiped, the third party Recovery needs to be swiped in advance, and then the machine swiping package is selected.
system partitioning: the Library, runtime, frame, core application are all in the system partition, except that the linux Kernel part is in the boot partition
A typical system partition contains the following categories of directories,
5.0,/vendor/app: the applications under the directory will be identified as system applications.
5.1,/system/priv-app: privileged apps, which are more privileged than System _ apps, not only have the System _ App identity true, but also have the Priv-App identity set.
5.2、/system/app
the core application files (. apk), are all put in this. Like Phone, Alarm Clock, Browser, Contacts, etc.
5.3、/system/framework
The core program library of the Android system, namely the library of the application frame part, is placed here. Like core. jar, frame-res. apk, frame. jar, etc.
5.4、/system/lib
The Library part stores all dynamic link libraries (. SO files), which are required by the JNI layer, Dalvik virtual machine, native Library, and HAL layer, because the apk under the system application/system/app is the SO that it will not decompress to the program's directory, SO its applied SO should be placed under the/system/lib. When the SO of a system apk is loaded, an SO file for the application is searched from the directory;
5.5、/system/media/audio/(notification,alarms,ringtones,ui)
storing sound files of the system, such as alarm tones, incoming call tones, etc. Most of these sound files are in the format of ogg.
5.6、/system/bin
Stored are some executable files, essentially written in C/C + +. Where there is an important command called app _ process. Commonly known as zygate. (Zygote means egg from which all Android processes are born). Zygote first loads the dalvik virtual machine and then spawns a process called system _ server. system _ server, as its name implies, is a system service called Android, which mainly manages the entire Android system. After the system _ server finishes starting, a program called a launcher is searched, and after the system _ server finishes starting, the execution launcher is started by zygate, which is the desktop program that we often see.
5.7、system/xbin
Stored are extended executables, i.e. the directory may be empty. A commonly used busybox is placed under the directory. Various symbolic link commands established by Busybox are placed in the directory.
5.8、system/build.prop
the file format of build is the same as that of default in the root file system, and is called as attribute configuration file. They all define some attribute values that the code can read or modify. There are some naming conventions for attribute values:
ro starts with a representation of read-only properties, i.e. the value code of these properties is not modifiable.
the values of the properties that indicate the beginning of persistence are saved in a file so that they remain after a reboot.
Other attributes generally begin with the category to which they belong, which are readable and writable, but which modifications are not retained after restart.
5.9、/system/etc
the directory holds a number of profiles, unlike the property profiles, which may be somewhat less regular below. Generally, some scripted programs, also known as GPS profiles (GPS. conf) and APN profiles (APN-conf. xml) are placed in this directory. Some files used for camera special effects like HTC are also placed under this directory.
Data partitioning: after the desktop program is started, APPs are generally downloaded and installed, and are all installed in the data/APP directory. All data generated by the Android program are basically stored in the data/data directory. wipedata is essentially a formatted data partition, so all APP and program data we install is lost.
6.1、/data/app
What is put is the user's own installed application execution file (. apk).
6.2、/data/data/<app-package-name>
Files created with content. The references file (× xml), which is created by context.
6.3、/data/anr/traces.txt
when your application program generates anr (application is Not responding) error, Android will automatically write the code stack list of the problem point in this file, you can see his content directly with cat command.
6.4、/data/system/dropbox/***.txt
the method mainly comprises log files written when the apk generates the crash in the system, and logs such as system _ app _ crash and data _ app _ crash are mainly used.
6.5、/data/location/gps
is for GPS location provider.
6.6、/data/system/location/location.gps
The general text file mainly records the final longitude and latitude coordinates. Get lastknownlocation () is at this value.
6.7、/data/property/persist.sys.timezone
This file is also a generic text file. Mainly records the time zone used by the current system.
6.7 image File packaging
img, ramdisk, img, userdata, img image files are packed with cpio, compressed with gzip, and can be verified by file command:
file ramdisk.img
And (3) outputting: img: gzip compressed data, from Unix, last modified: Wed Mar 1817: 16: 102009
After Android source code is compiled, system and userdata folders are generated in addition to system. After the Android source code is compiled, a root folder is generated, files under root are the same as files in ramdisk.
8, oem partition: the system is a subarea additionally arranged for global customization function, various configuration parameters corresponding to different countries are added in the subarea, for example, some function switches are required to be opened in some areas, other areas are required to be closed, at this time, item.img is required, otherwise, two versions are required;
Systeminfo partition: is a partition set up specifically for adding system partition checks that check if system partition resources are changed, such as apk is deleted or some permissions are changed, in order to prevent the system from being changed causing the handset to be monitored. Bin files, in which all system files and their corresponding sha1 values are stored.
the persistence partition is used for saving protected information such as an account number and a password used by an frp (factory reset) function, and avoiding being cleared after the factory setting is restored.
the Persist partition is an ext4 partition of the system, and since our line brush package does not contain the partition, you need to manually repair the partition, and the partition contains DRM related files, a sensor registry, and your wifi, Bluetooth and mac addresses.
Generally, the unlocking of the mobile phone is to force that the access to the account information in the PERSIST partition is forbidden, so that the system can work without reading the account information by being matched with a modified system.
The invention is further illustrated with reference to the following figures and examples.
referring to fig. 1, an embodiment of the present invention provides a method for constructing a storage space structure of an android system, including the following steps:
s101, creating a first storage directory in a data partition, wherein the first storage directory is used for storing preset applications;
And S102, setting the preset application stored in the first storage directory as a system application.
according to the construction method of the storage space structure of the android system, provided by the embodiment of the invention, a first storage directory is created in a data partition, and the first storage directory is used for storing a preset application; then, setting the preset application stored in the first storage directory as a system application; ensuring that the preset application stored in the first storage directory operates normally; the preset application stored in the first storage directory occupies the storage space of the data partition when being upgraded, does not influence the storage of other data in the data partition, and not only ensures that the storage space for storing the preset application is large enough, but also ensures that the storage space is not wasted.
As an improved description of the foregoing embodiment, an embodiment of the present invention further provides another method for constructing a storage space structure of an android system, including the following steps:
s101, creating a first storage directory in a data partition, wherein the first storage directory is used for storing preset applications;
In order to ensure the security of the first storage directory, as an optional implementation manner in the embodiment of the present invention, the first storage directory is set as a read-only attribute; and when the android system starts the mandatory access control, setting the security policy configuration file authority of the android system as a system file. Illustratively, if the system turns selinux on, the policy privilege needs to be set to system _ file.
And setting the user creating the first storage directory and the group where the user is located as root authority.
Root means a type existing in UNIX system, AIX, BSD, and the like. And UNIX-like SYSTEMs, such as Linux, a famous tripod, such as Debian stabilized to be used in servers, Redhat suitable for long-term operation of mature old tracks, Linux distribution such as Ubuntu and archlinux, and Android SYSTEMs, which are more popular, are equivalent to SYSTEM (XP and below)/TrustedInsteller (Vista and above) users in Windows SYSTEMs. It has all the rights in the system, such as starting or stopping a process, deleting or adding users, adding or disabling hardware, etc. The root directory of the root is not accessed by other users by default, which enhances the security of the whole system to a certain extent.
S102, setting the preset application stored in the first storage directory as a system application;
As a preferred implementation manner of the embodiment of the present invention, setting the preset application stored in the first storage directory as a system application includes:
And all the preset applications stored in the first storage directory are linked to a second storage directory, and the second storage directory is positioned in the system partition and used for identifying the applications in the second storage directory as system applications by the system.
As an optional implementation manner in this embodiment of the present invention, all the preset applications stored in the first storage directory are linked to the second storage directory: and when the system is compiled, all the preset applications stored in the first storage directory are softly linked into the second storage directory.
The soft link is also called symbol link, and the file after the soft link contains the path name of another file. May be any file or directory and may link files of different file systems.
in some alternative embodiments, the image packaging process of the data partition is modified for packaging into the system image file when the data partition is image packaged. Therefore, when the preset application stored in the first storage directory is upgraded, only the preset application mirror image needs to be packaged into the system file, and the normal upgrade of the preset application is ensured.
The so-called image file is similar to the rar ZIP compressed package, and a specific series of files are made into a single file according to a certain format, so that a user can conveniently download and use the single file, such as an operating system, games and the like. The most important characteristic of the method is that the method can be identified by specific software and can be directly recorded on an optical disc. In fact, the image file in the general sense can be expanded again, and more information can be contained in the image file. Such as system files, boot files, partition table information, etc., so that the image file may contain all the information for a partition or even a hard disk. In the usual sense, the recording software can directly record the content contained in the supported image file onto the optical disc. The mirror image file cannot be directly used, and can be used only after being decompressed by some virtual CD-ROM tools. The principle of the virtual optical drive is the same as that of the physical optical drive, for example, you buy a game optical disc, then you can play the game smoothly by adding the game optical disc into the physical optical drive, and what needs to be added into the virtual optical drive is an image file (iso file, which is equivalent to a game optical disc), and after you have loaded the virtual optical drive, you have one more optical drive in your computer, that is the virtual optical drive. The image file is then loaded to complete the installation of the game, and if so, the image it requires can be reloaded into the game.
It should be noted that, when the preset application is upgraded, for example, when the OTA is upgraded, the preset application in the first storage directory is modified. In some optional embodiments, in order to ensure that the data of the data partition is not damaged during system upgrade, the upgrade mode of the data partition where the first storage directory is located is changed into differential upgrade during system compilation.
the OTA is called the Over-the-Air Technology, i.e. the space download Technology. OTA upgrading is a standard software upgrading mode provided by an Android system. The OTA upgrading system is powerful in function, can be upgraded without loss, mainly automatically downloads an OTA upgrading package and upgrades automatically through a network [ such as WIFI and 3G ], but also supports that the upgrading package for upgrading the OTA from the OTA upgrading package to an SD card is very small, generally several M to dozens of M, if you upgrade with the network, the upgrading is completed by clicking several times on the system basically, and most importantly, the OTA upgrading does not need to backup data, all upgrading work is done in as short as several minutes, and all data can be well preserved without loss.
It should be noted that there are two types of upgrade in the upgrade process: whole package upgrade and difference upgrade. For example, a version may be upgraded from a lower level to a higher level, either in whole packages or differentially. And the difference is upgraded into binary comparison between the installed apk and the latest apk, so that a difference packet is obtained. When the user upgrades, only the differential packet needs to be downloaded, and the differential packet and the installed apk are locally used for synthesizing a new apk for installation. The differential upgrading does not need to download a complete upgrading packet, only needs to download the updated differential packet, and performs updating and upgrading on the original application, so that the size of the updating packet can be greatly reduced, the updating flow and waiting time of a user are reduced, and the user experience is better.
and when factory settings are restored, the android system formats the data partitions and deletes internal data. In order to prevent the first storage directory from being deleted when the factory settings are restored, in some optional embodiments, when the factory settings are restored, a deletion mode of the data partitions when the factory settings are restored is modified into conditional deletion;
and setting a configuration file for the conditional deletion, wherein the configuration file is used for setting the conditional deletion program and reserving the contents stored in the first storage directory.
in the field of computer science, a configuration file (english: configuration file) is a computer file that can configure parameters and initial settings for some computer programs. The configuration file is used for setting a conditional deletion program, and the retention of the content stored in the first storage directory includes:
Receiving a factory setting restoration instruction, and executing a condition deletion program;
acquiring a judgment program from the configuration file, wherein the judgment program is used for judging whether the pre-deleted data belongs to the read first storage directory or not;
If the pre-deleted data belongs to the first storage directory, the pre-deleted data is not deleted; and if the pre-deleted data does not belong to the first storage directory, deleting the pre-deleted data.
According to the method for constructing the storage space structure of the android system, the first storage directory is created in the data partition and used for storing the preset application, and then the preset application in the first storage directory is in soft link with the second storage directory under the system partition, so that the system can identify the preset application stored in the first storage directory as the system application; setting the attribute and the authority of the first storage directory to ensure the storage safety of the first storage directory; and modifying the mirror image packaging process, upgrading the mirror image packaging process and deleting the mirror image packaging process and the mirror image packaging process when factory settings are restored, and ensuring that the preset application in the first storage directory normally runs as the same as the preset application originally stored in the system partition.
In an embodiment, the present invention further provides a device for constructing a storage space structure of an android system, as shown in fig. 2, including:
a directory creating unit 21, configured to create a first storage directory in the data partition, where the first storage directory is used to store a preset application;
A system application setting unit 22, configured to set a preset application stored in the first storage directory as a system application;
specifically, the system application setting unit 22 is configured to link all the preset applications stored in the first storage directory to a second storage directory, where the second storage directory is located in the system partition, and is used for the system to identify the applications in the second storage directory as system applications. That is, the preset applications stored in the first storage directory are all soft-linked to the second storage directory at the time of system compilation.
And the packaging process modifying unit 23 is used for modifying the mirror packaging process of the data partitions and packaging the data partitions into the system mirror image file when the data partitions are packaged in a mirror image mode.
An attribute authority setting unit 24, configured to set the first storage directory as a read-only attribute; and setting the user creating the first storage directory and the group where the user is located as root authority. And the method is also used for setting the security policy configuration file authority of the android system as a system file when the android system starts the mandatory access control.
and the upgrading mode modifying unit 25 is used for changing the upgrading mode of the data partition into differential upgrading.
A deletion mode modification unit 26, configured to modify, when factory settings are restored, a deletion mode when the factory settings of the data partition are restored to conditional deletion;
and setting a configuration file for the conditional deletion, wherein the configuration file is used for setting the conditional deletion program and reserving the contents stored in the first storage directory.
Specifically, the deletion mode modification unit 26 is configured to receive a factory reset instruction, and execute a conditional deletion program;
acquiring a judgment program from the configuration file, wherein the judgment program is used for judging whether the pre-deleted data belongs to the read first storage directory or not;
if the pre-deleted data belongs to the first storage directory, the pre-deleted data is not deleted; and if the pre-deleted data does not belong to the first storage directory, deleting the pre-deleted data.
the device for constructing the storage space structure of the android system comprises a directory creation unit, a storage unit and a storage unit, wherein the directory creation unit is used for creating a first storage directory for storing preset applications; the system application setting unit is used for softly linking the preset application stored in the first storage directory unit to a second storage directory unit of the system partition, so that the system can identify the preset application as the system application; the packaging process modification unit is used for modifying the mirror image packaging process of the data partitions so as to package the mirror images of the data partitions into system mirror image files; the attribute authority setting unit is used for setting the read-only attribute of the first storage directory and the authority of the user and the group, and ensuring the safety of the first storage directory; the upgrading mode modification unit is used for modifying the upgrading mode of the data partition into differential upgrading to prevent the data of the data partition from being damaged; the deletion mode modification unit is used for modifying the deletion mode of the data partition into conditional deletion, and ensuring that the first storage directory is not deleted when factory settings are restored.
In an embodiment, the present invention further provides a storage space structure of an android system, as shown in fig. 3, including a first storage directory unit 311 and a second storage directory unit 321;
the first storage directory unit 311 is disposed in the data partition 310 and is used for storing a preset application;
The second storage directory unit 321 is disposed in the system partition 320, and is used for the system to identify an application in the second storage directory as a system application;
The preset application stored in the first storage directory unit 311 is soft-linked into the second storage directory unit 321.
according to the storage space structure of the android system, the preset application is stored in the first storage directory unit of the data partition, so that the space of the data partition is occupied, the storage of other files in the data partition is not influenced, and the storage space is not wasted. At the same time, the first storage directory unit is softly linked with the second storage directory unit located in the system partition, so that the system can identify the preset application stored in the first storage directory unit as the preset application.
As a specific description of the foregoing embodiment, an embodiment of the present invention further provides a specific construction method for a storage space structure of an android system, where the constructed storage space structure is shown in fig. 4, and the construction method includes the following steps:
once, the partition structure is determined at system compile time. Unlike the native Android in which data is a null partition, the data partition in the design is provided with preset applications. The data partition is considered when generating the image file or OTA upgrade package.
and secondly, creating a ro _ Data directory in the Data partition to store the preset application. To ensure security, ro _ data needs to be set to a read-only attribute, and both the user and the group are set to root. If the system turns selinux on, the sepolicy privilege needs to be set to system _ file.
and thirdly, the application in the ro _ data is used as the system application. Applications in the Android system under/vendor/app directory would be identified as system applications. We soft link all applications in/data/ro _ data under/vendor/app, directory/vendor is actually a soft link of/system/vendor. Note that these linking actions are all done during the system compilation process.
and fourthly, modifying the native mirror image packaging process, and packaging the data partitions into system mirror image files.
Fifthly, the OTA upgrade can modify the preset application in the ro _ data, so that the data partition in the OTA upgrade adopts differential upgrade, and the preset application is replaced under the condition of not destroying the data partition data.
And modifying the operation on the data partitions when the data partitions are restored to be delivered from the factory. The native Android formats the data partition when the data partition is restored to be delivered from a factory, and modifies the data partition into a condition deleting mode. The configuration file is used to tell the system data partition the directory that needs to be reserved, here ro _ data. When the factory is restored, all data except the reserved directory is deleted.
The specific construction method of the storage space structure of the android system provided by the embodiment of the invention has the following main design ideas: an ro _ data directory is created in the data partition and used for storing preset applications, the directory is guaranteed to be read only through permission setting and only can be accessed by a root user, and the system is enabled to identify the applications in the directory as system applications through soft links. The problem of insufficient preset application space can be flexibly solved, and the storage space is avoided.
it is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
it will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
the storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. a construction method of a storage space structure of an android system is characterized by comprising the following steps:
Creating a first storage directory in the data partition, wherein the first storage directory is used for storing preset applications;
And setting the preset application stored in the first storage directory as a system application.
2. The method of claim 1, further comprising:
Setting the first storage directory to be read-only;
And setting the user creating the first storage directory and the group where the user is located as root authority.
3. the method of claim 1, further comprising: and when the android system starts mandatory access control, setting the security policy configuration file authority of the android system as a system file.
4. The method of claim 1, further comprising: and modifying the mirror image packaging process of the data partition, and packaging the data partition into a system mirror image file when the data partition is subjected to mirror image packaging.
5. The method of claim 1, further comprising: and changing the upgrading mode of the data partition into differential upgrading.
6. The method of claim 1, wherein: the setting of the preset application stored in the first storage directory as a system application comprises:
and when the system is compiled, all the preset applications stored in the first storage directory are softly linked into a second storage directory, and the second storage directory is positioned in a system partition and used for identifying the applications in the second storage directory as system applications by the system.
7. The method of claim 1, further comprising:
When factory settings are restored, modifying the deleting mode of the data partitions when the factory settings are restored into conditional deletion;
And setting a configuration file for the conditional deletion, wherein the configuration file is used for setting a conditional deletion program and reserving the contents stored in the first storage directory.
8. The method of claim 7, wherein: the configuration file is used for setting a conditional deletion program, and the step of reserving the contents stored in the first storage directory comprises the following steps:
receiving a factory setting restoration instruction, and executing a condition deletion program;
acquiring a judging program from the configuration file, wherein the judging program is used for judging whether the pre-deleted data belongs to the read first storage directory;
If the pre-deleted data belongs to the first storage directory, the pre-deleted data is not deleted; and if the pre-deleted data does not belong to the first storage directory, deleting the pre-deleted data.
9. The utility model provides a construction equipment of tall and erect system storage space structure of ann, its characterized in that includes:
The device comprises a catalog establishing unit, a data partitioning unit and a storage unit, wherein the catalog establishing unit is used for establishing a first storage catalog in a data partition, and the first storage catalog is used for storing preset applications;
And the system application setting unit is used for setting the preset application stored in the first storage directory as the system application.
10. the utility model provides an tall and erect system storage space structure of ann which characterized in that: the storage device comprises a first storage directory unit and a second storage directory unit;
The first storage directory unit is arranged in the data partition and used for storing preset applications;
the second storage directory unit is arranged in the system partition and used for identifying the application in the second storage directory as a system application by the system;
and the preset application stored in the first storage directory unit is softly linked to the second storage directory unit.
CN201910860334.9A 2019-09-11 2019-09-11 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system Pending CN110543369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910860334.9A CN110543369A (en) 2019-09-11 2019-09-11 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910860334.9A CN110543369A (en) 2019-09-11 2019-09-11 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system

Publications (1)

Publication Number Publication Date
CN110543369A true CN110543369A (en) 2019-12-06

Family

ID=68713408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910860334.9A Pending CN110543369A (en) 2019-09-11 2019-09-11 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system

Country Status (1)

Country Link
CN (1) CN110543369A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111814118A (en) * 2020-07-08 2020-10-23 广东小天才科技有限公司 Anti-cracking method and family education machine
CN113126893A (en) * 2020-01-16 2021-07-16 深圳市万普拉斯科技有限公司 Method, device, storage medium and computer equipment for expanding system partition
CN113805956A (en) * 2021-06-15 2021-12-17 荣耀终端有限公司 Operating system configuration method, operating system configuration device, operating system storage medium, and program product
CN113852717A (en) * 2021-09-27 2021-12-28 努比亚技术有限公司 Wallpaper module position migration method and device and computer-readable storage medium
CN113934461A (en) * 2021-09-26 2022-01-14 厦门亿联网络技术股份有限公司 DEX-based android system formatting method and device
CN115344313A (en) * 2022-08-22 2022-11-15 亿咖通(湖北)技术有限公司 Android system partition mounting method, electronic device and machine-readable storage medium
CN116049097A (en) * 2022-05-30 2023-05-02 荣耀终端有限公司 Management method of camera database file and electronic equipment
CN116204353A (en) * 2022-12-08 2023-06-02 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110319051A1 (en) * 2010-06-25 2011-12-29 EmergenSee, LLC Emergency Notification System for Mobile Devices
CN102521031A (en) * 2011-12-13 2012-06-27 华为终端有限公司 Management method of preset application programs of mobile terminal and mobile terminal
CN103235703A (en) * 2013-04-11 2013-08-07 东莞宇龙通信科技有限公司 Method and device for storing preset resource
CN103383660A (en) * 2013-04-01 2013-11-06 华为终端有限公司 Method and device for realizing functions of cache partition of Android system as well as terminal equipment
CN107632835A (en) * 2017-09-22 2018-01-26 北京小米移动软件有限公司 Using installation method and device
CN109408071A (en) * 2018-09-17 2019-03-01 深圳市泰衡诺科技有限公司 The control method and mobile terminal of mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110319051A1 (en) * 2010-06-25 2011-12-29 EmergenSee, LLC Emergency Notification System for Mobile Devices
CN102521031A (en) * 2011-12-13 2012-06-27 华为终端有限公司 Management method of preset application programs of mobile terminal and mobile terminal
CN103383660A (en) * 2013-04-01 2013-11-06 华为终端有限公司 Method and device for realizing functions of cache partition of Android system as well as terminal equipment
CN103235703A (en) * 2013-04-11 2013-08-07 东莞宇龙通信科技有限公司 Method and device for storing preset resource
CN107632835A (en) * 2017-09-22 2018-01-26 北京小米移动软件有限公司 Using installation method and device
CN109408071A (en) * 2018-09-17 2019-03-01 深圳市泰衡诺科技有限公司 The control method and mobile terminal of mobile terminal

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126893B (en) * 2020-01-16 2023-06-16 深圳市万普拉斯科技有限公司 Method, device, storage medium and computer equipment for expanding system partition
CN113126893A (en) * 2020-01-16 2021-07-16 深圳市万普拉斯科技有限公司 Method, device, storage medium and computer equipment for expanding system partition
CN111814118A (en) * 2020-07-08 2020-10-23 广东小天才科技有限公司 Anti-cracking method and family education machine
CN113805956A (en) * 2021-06-15 2021-12-17 荣耀终端有限公司 Operating system configuration method, operating system configuration device, operating system storage medium, and program product
CN113805956B (en) * 2021-06-15 2022-11-11 荣耀终端有限公司 Configuration method and device of operating system and storage medium
CN113934461A (en) * 2021-09-26 2022-01-14 厦门亿联网络技术股份有限公司 DEX-based android system formatting method and device
CN113934461B (en) * 2021-09-26 2023-10-13 厦门亿联网络技术股份有限公司 DEX-based android system formatting method and device
CN113852717A (en) * 2021-09-27 2021-12-28 努比亚技术有限公司 Wallpaper module position migration method and device and computer-readable storage medium
CN113852717B (en) * 2021-09-27 2024-03-19 努比亚技术有限公司 Wallpaper module position migration method, equipment and computer readable storage medium
CN116049097A (en) * 2022-05-30 2023-05-02 荣耀终端有限公司 Management method of camera database file and electronic equipment
CN116049097B (en) * 2022-05-30 2023-11-07 荣耀终端有限公司 Management method of camera database file and electronic equipment
CN115344313B (en) * 2022-08-22 2023-08-11 亿咖通(湖北)技术有限公司 Android system partition mounting method, electronic equipment and machine-readable storage medium
CN115344313A (en) * 2022-08-22 2022-11-15 亿咖通(湖北)技术有限公司 Android system partition mounting method, electronic device and machine-readable storage medium
CN116204353A (en) * 2022-12-08 2023-06-02 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium
CN116204353B (en) * 2022-12-08 2023-10-20 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium

Similar Documents

Publication Publication Date Title
CN110543369A (en) Construction method and device of storage space structure of android system and construction structure of storage space structure of android system
CN105867947B (en) Data processing method and device after preset application program updating
CN107506221B (en) Application program upgrading method, device and equipment
US10261770B2 (en) Install file size optimization and installation verification system
US8407700B2 (en) Methods and systems for merging virtualization sublayers
CN105786538B (en) software upgrading method and device based on android system
US20160054990A1 (en) Method Of And Terminal For Updating Library File In System Application
US20090307781A1 (en) Program execution control method, its device, and execution control program for same
CN102622241A (en) Software upgrading method and software upgrading device
US8176482B1 (en) Methods and systems for inserting software applications into images
CN105637521B (en) Data processing method and intelligent terminal
CN107220074B (en) Method and device for accessing and upgrading supporting layer software function
JP2004530201A (en) Methods for loading and running applications in embedded environments
CN103714287A (en) Method and device for obtaining temporary Root authority
CN104007992A (en) Methods and devices for program updating and starting
US8225316B1 (en) Methods and systems for creating and applying patches for virtualized applications
CN108182070B (en) Method and device for customizing android system ROM and terminal equipment
WO2009059473A1 (en) Java-based terminal system
CN113867768A (en) Operating system processing method and device, electronic equipment and storage medium
CN112286543B (en) Application service deployment method and device
JP4828842B2 (en) Reinstallation software creation method, reinstallation software creation program, installation method, installation program, and computer device
CN103309696A (en) Method and device for updating Java card extended library, and Java card
CN109271792B (en) Terminal peripheral control method and device based on Android local layer hook
CN103761118A (en) Intelligent card and method for deploying applications in same
US20070079279A1 (en) Embedded device with software registry

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191206

RJ01 Rejection of invention patent application after publication