Multi-system starting method and device, equipment and storage medium
By setting up independent partitions for each system in multi-system terminal devices and using multiple sets of kernels to process mirror files, complete isolation between systems is achieved, data leakage and resource waste are solved, and security and fluency are improved.
Patent Information
- Application Number
- CN202311872929.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In existing multi-system terminal devices, data between systems is not completely isolated, and there is a risk of data leakage and damage.
By setting up independent partitions for each system, storing image files in different partition locations, and processing image files through multiple sets of kernels, complete isolation between systems is achieved, and only the partition mirror files of the target system are loaded, and other partition mirror files are not visible to the current system.
It reduces the risk of data leakage, improves the security and fluency of the system, reduces resource waste and energy consumption, and avoids system crashes and data loss.
Smart Images

Figure CN120234050A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dual - system, and particularly to a multi - system startup method, device, equipment and storage medium. Background Art
[0002] Due to the openness of the source code, the Android system has become the reason for major domestic terminal manufacturers and developers to join this system platform, and gives developers greater space and freedom, which has further promoted the development of the Android system.
[0003] Currently, a single - system mobile phone can no longer meet the needs of users. Therefore, dual - system or multi - system mobile phones have emerged. A dual - system mobile phone refers to running two systems on the same hardware device, one system for work and one system for life, so as to achieve both work and life without interference.
[0004] For multi - systems, the data required to be loaded by multiple systems is not completely isolated. When one system is breached by malware, the data of the remaining systems may also be threatened, and there is a risk of data leakage. Summary of the Invention
[0005] The present invention provides a multi - system startup method, device, equipment and storage medium to solve the problem of data leakage risk when there are multiple systems on a terminal device in the prior art.
[0006] In a first aspect, the present invention provides a multi - system startup method. The multi - system is set on a terminal device, and the multi - system includes at least two systems. The method includes:
[0007] In response to a system startup instruction, determine a target system corresponding to the system startup instruction. The target system is any one of the multiple systems.
[0008] Obtain target partition information corresponding to the target system. The target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition. An image file corresponding to the target system is stored in each partition. The access locations of the partitions corresponding to each system are different.
[0009] According to the access location corresponding to each partition, load the image file corresponding to the target system, and control the kernel corresponding to the target system to process the image file to enter the target system.
[0010] Optionally, determining the target system corresponding to the system startup instruction includes:
[0011] Control the bootloader to read the value of the flag bit in the misc partition; the value is the information written to the flag bit in the misc partition according to the target system after receiving the system startup instruction;
[0012] Determine the target system corresponding to the system startup instruction according to the read value.
[0013] Optionally, after determining the target system corresponding to the system startup instruction, the method further includes:
[0014] Write a system switching message in the kernel startup parameters, and the system switching message is used to instruct the terminal device to enter the target system after startup.
[0015] Optionally, when in the linux kernel loading stage, determining the target system corresponding to the system startup instruction includes:
[0016] Determine the target system according to the value of the flag bit in the misc partition;
[0017] According to the access locations corresponding to each partition respectively, loading the mirror file corresponding to the target system includes:
[0018] Load the mirror file in the first access location corresponding to the dtbo partition, and load the mirror file in the second access location corresponding to the boot partition; the first access location and the second access location correspond to the target system; the dtbo partition is used to store the mirror file related to the vendor device tree; the boot partition is used to store the mirror file related to the linux kernel.
[0019] Optionally, when in the partition mounting stage of the init stage, determining the target system corresponding to the system startup instruction includes:
[0020] Read the system switching message in the kernel startup parameters, and determine the target system according to the system switching message;
[0021] According to the access locations corresponding to each partition respectively, loading the mirror file corresponding to the target system includes:
[0022] Load the mirror file in the third access location corresponding to the super partition, and load the mirror file in the fourth access location corresponding to the userdata partition; the third access location and the fourth access location correspond to the target system; the super partition is used to store the mirror file related to the operating system; the userdata partition is used to store the mirror file related to applications and user data.
[0023] Optionally, after entering the target system, the method further includes:
[0024] Adding attribute information to an attribute file, where the attribute information is used to indicate to the terminal device that it has entered the target system; the attribute file is a file obtained by the terminal device after entering the target system;
[0025] Obtaining configuration information corresponding to the target system, and disabling a target application according to the configuration information; the configuration information indicates the target application that is prohibited from being used after entering the target system.
[0026] Optionally, obtaining target partition information corresponding to the target system includes:
[0027] Querying the partition table according to the target system to obtain target partition information corresponding to the target system; the partition table is set in the terminal device before the system starts; the partition table includes partition information corresponding to multiple systems.
[0028] In a second aspect, the present invention provides a multi-system startup device, where the multi-system is set on a terminal device, and the multi-system includes at least two systems; the device includes:
[0029] A determination module, configured to determine a target system corresponding to the system startup instruction in response to the system startup instruction; the target system is any one of the multiple systems;
[0030] An acquisition module, configured to acquire target partition information corresponding to the target system; the target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition; an image file corresponding to the target system is stored in each partition; the access locations of the partitions corresponding to each system are different;
[0031] A processing module, configured to load the image file corresponding to the target system according to the access location corresponding to each partition, and control the kernel corresponding to the target system to process the image file to enter the target system.
[0032] In a third aspect, the present invention provides an electronic device, including: at least one processor and a memory;
[0033] The memory stores computer execution instructions;
[0034] At least one processor executes the computer execution instructions stored in the memory, so that at least one processor executes the method according to any item of the first aspect.
[0035] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method according to any one of the first aspect.
[0036] A multi-system startup method, device, equipment and storage medium provided by the present invention, wherein the multi-system is set on a terminal device, and the multi-system includes at least two systems; the method includes: in response to a system startup instruction, determining a target system corresponding to the system startup instruction; the target system is any one of the multiple systems; obtaining target partition information corresponding to the target system; the target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition respectively; mirror files corresponding to the target system are stored in each partition; the access locations of the partitions corresponding to each system are different; according to the access location corresponding to each partition respectively, loading the mirror file corresponding to the target system, and controlling the kernel corresponding to the target system to process the mirror file so as to enter the target system. By setting different partitions for different systems and accessing the corresponding partitions according to the startup target system to obtain mirror files, while the mirror files of the remaining partitions are not loaded and are invisible to the currently running system, the security risk of data leakage is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0038] Figure 1 It is a schematic diagram of an application scenario of multi-system startup provided by an embodiment of the present invention;
[0039] Figure 2 It is a schematic flowchart of a multi-system startup method provided by an embodiment of the present invention;
[0040] Figure 3 It is a schematic flowchart of another multi-system startup method provided by an embodiment of the present invention;
[0041] Figure 4 It is a schematic structural diagram of a multi-system startup device provided by an embodiment of the present invention;
[0042] Figure 5 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present invention.
[0043] Through the above-mentioned accompanying drawings, specific embodiments of the present invention have been shown, and there will be more detailed descriptions hereinafter. These drawings and text descriptions are not intended to limit the scope of the inventive concept in any way, but to illustrate the concept of the present invention to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0044] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present invention.
[0045] To meet the needs of users, two or more systems can be set on more and more terminal devices to meet different usage scenarios. A dual-system terminal device or a multi-system terminal device refers to a device that runs two or more operating systems on the same hardware device. However, existing dual-system terminal devices cannot completely isolate the data of the two systems and are at risk of being attacked by malicious software. For example, when one operating system is compromised, the data of the other system may also be threatened, thereby leaking user data and privacy.
[0046] Based on the above problems, through analysis, it is found that for current dual-system terminal devices, the two systems use the same flash memory, and the data of the two systems are stored in the same partition, with a certain degree of partition sharing and incomplete data isolation, thus there are risks of data leakage and data corruption.
[0047] To solve the risks of data leakage and data corruption existing in dual-system terminal devices, it can be considered to physically completely isolate the user data and system data used when the two systems are started. For example, if system 1 corresponds to partition 1 and system 2 corresponds to partition 2, then when using system 1, data is obtained from partition 1, and when using system 2, data is obtained from partition 2. Figure 1 This is a schematic diagram of the application scenario of a multi-system startup method provided by an embodiment of the present invention. As Figure 1 shown, for the scenario of a dual system, it can include a personal system and a work system. For the two systems, corresponding systems, kernels, and Secondary Boot Loaders are respectively set. The Secondary Boot Loader is used to execute the operation steps corresponding to the abl stage during startup, and the operation steps corresponding to the init stage during startup to obtain the image file. The kernel is used to process the image file to start the corresponding system.
[0048] The present invention has multiple sets of independent kernels and systems. When starting up and cold starting into the system, by clicking the switch button, the terminal device shuts down and restarts into another system. Multiple sets of system images are rearranged and signed, and individual images need to be deeply modified and normalized. The characteristic of this system is to achieve complete isolation of data and applications of multiple sets of systems during use.
[0049] Figure 2The flowchart of a multi-system startup method provided by an embodiment of the present invention. The multi-system is set on a terminal device, and the multi-system includes at least two systems; as Figure 2 shown, the method includes steps S201 to S203:
[0050] Step S201, in response to a system startup instruction, determine a target system corresponding to the system startup instruction; the target system is any one of multiple systems.
[0051] There are multiple systems on the terminal device. According to the user's needs, different systems can be applied to different scenarios. Exemplarily, when there are two systems on the terminal device, that is, a dual-system, one system can be a work system and one system can be a life system.
[0052] After receiving the system startup instruction, the target system corresponding to the system startup instruction can be determined first. Optionally, when the user triggers the system startup instruction, corresponding information can be written to a preset location, so that when the terminal device starts up, the target system can be determined according to the information stored in the preset location.
[0053] Exemplarily, when the terminal device has a dual-system (System A and System B), when the user can select the system to enter when powering on, if the user selects to enter System A, then the identifier 1 can be written to the preset location. If the user selects to enter System B, then the identifier 2 can be written to the preset location. When the terminal device starts up, this information can be obtained from the preset location. When the obtained information is the identifier 1, the target system can be determined to be System A.
[0054] Exemplarily, when the terminal device has a dual-system, it can also be set as follows: when the user starts up, default to enter one system (such as System A). When switching to another system (such as System B), the identifier 1 can be written to the preset location. When the terminal device starts up, read the information in the preset location. When it is the identifier 1, the target system can be determined to be System B. When no information is written to the preset location, the target system can be determined to be System A.
[0055] Step S202, obtain target partition information corresponding to the target system; the target partition information includes each partition corresponding to the target system, and the access locations respectively corresponding to each partition; the mirror file corresponding to the target system is stored in each partition; the access locations of the partitions corresponding to each system are different.
[0056] During the startup process, the system needs to obtain the image file. The image files corresponding to different systems are stored in different partitions so that the system can obtain the image file from the corresponding partition when starting up. Before obtaining the image file from the partition corresponding to the target system, the target partition information corresponding to the target system can be obtained first.
[0057] The target partition information refers to the information recording the access locations of the partitions corresponding to each system. Five partitions can be set for each system respectively: the boot partition (storing the image file related to the linux kernel), the dtbo partition (storing the image file related to the vendor device tree), the cache partition (storing the image file related to the upgrade), the super partition (storing the image file related to the android operating system), and the userdata partition (storing the image file related to the applications and user data). In addition, other partitions can also be set according to the actual scenario.
[0058] Exemplarily, the target partition information can record that the access location corresponding to the boot partition of system A is location 1, the access location corresponding to the dtbo partition of system A is location 2, etc., and can also record that the access location corresponding to the boot-d partition of system B is location 3, the access location corresponding to the dtbo-d partition of system B is location 4, etc.
[0059] Exemplarily, the above partition information can be stored in a preset form in advance. When it is necessary to obtain the target partition information corresponding to the target system, the corresponding target partition information can be obtained from the preset form.
[0060] Step S203: Load the image file corresponding to the target system according to the access location corresponding to each partition, and control the kernel corresponding to the target system to process the image file to enter the target system.
[0061] After obtaining the target partition information, the corresponding image file can be loaded according to the access location corresponding to each partition.
[0062] For a multi-system terminal device, multiple kernels can also be set, and the image file is processed by different kernels to enter the corresponding system.
[0063] Exemplarily, for system A, a kernel 1 is set, and for system B, a kernel 2 is set. When starting system A, the image file corresponding to system A is processed by kernel 1.
[0064] By setting multiple partitions, isolation of data required by different systems during storage is achieved. When a system starts up, it fetches the mirror file from the corresponding partition. At this time, the mirror files in other partitions are not loaded, and the mirror files in other partitions are completely invisible to the system to be started currently, reducing the risk of data leakage.
[0065] A multi-system startup method provided by the present invention, where the multi-system is set on a terminal device, and the multi-system includes at least two systems; the method includes: in response to a system startup instruction, determining a target system corresponding to the system startup instruction; the target system is any one of the multiple systems; obtaining target partition information corresponding to the target system; the target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition respectively; the mirror file corresponding to the target system is stored in each partition; the access locations of the partitions corresponding to each system are different; according to the access location corresponding to each partition respectively, loading the mirror file corresponding to the target system, controlling the kernel corresponding to the target system to process the mirror file, so as to enter the target system. By setting different partitions for different systems, accessing the corresponding partition according to the target system to be started to obtain the mirror file, while the mirror files in the remaining partitions are not loaded and are invisible to the currently running system, reducing the security risk of data leakage.
[0066] Optionally, determining the target system corresponding to the system startup instruction includes:
[0067] Controlling the boot loader to read the value of the flag bit in the misc partition; the value is the information written to the flag bit in the misc partition according to the target system after receiving the system startup instruction;
[0068] Determining the target system corresponding to the system startup instruction according to the read value.
[0069] When the system starts up, before the linux kernel is loaded, a program, that is, the boot loader, can be run first to initialize the hardware device and establish the memory space mapping. When running the boot loader, the value of the flag bit in the misc partition can be read, and the target system can be determined according to the obtained value.
[0070] The misc partition contains various system configurations saved in the form of switch quantities. By storing the value indicating the target system in this partition, the data in the misc partition can be read when running the boot loader to determine the target system.
[0071] The value of the flag bit is that when the user triggers a switch or enters the target system, a reboot command is issued and a rebootsecond command is created to write this value in the misc partition. When writing this value, different values are written according to different target systems. Exemplarily, when the target system is System A, flag 1 can be written to a preset location, and when the user selects to enter System B, flag 2 can be written to the preset location. Correspondingly, according to the process of writing a value to the flag bit, when the terminal device starts up and the obtained value is flag 1, it can be determined that the target system is System A.
[0072] By writing a value indicating the target partition in the misc partition, the target system can be determined before the linux kernel is loaded.
[0073] Optionally, after determining the target system corresponding to the system startup instruction, the method further includes:
[0074] Writing a system switch message in the kernel startup parameters, where the system switch message is used to indicate that the terminal device enters the target system after startup.
[0075] After determining the target system, a system switch message can also be written in the kernel startup parameter cmdline. This system switch message is also used to indicate the system that the terminal device is to enter after startup, so that after the subsequent kernel starts, it can be recognized that the system to enter is the target system.
[0076] Optionally, when the terminal device is a dual-system terminal device, when the target system is System A, a system switch message 1 can be written in the cmdline, and when the target system is System B, a system switch message 2 can be written in the cmdline.
[0077] Optionally, when it is a dual-system terminal device, it defaults to entering System A. When switching from System A to System B, a system switch message can be written in the cmdline. When switching from System B to System A, a system switch message does not need to be written in the cmdline.
[0078] By writing a system switch message in the kernel startup parameters, it is used to determine the target system based on the information in the kernel startup parameters after the kernel starts.
[0079] Optionally, when in the linux kernel loading stage, determining the target system corresponding to the system startup instruction includes:
[0080] Determining the target system according to the value of the flag bit in the misc partition;
[0081] Loading the mirror file corresponding to the target system according to the access locations corresponding to each partition, including:
[0082] Load the image file in the first access location corresponding to the dtbo partition and the image file in the second access location corresponding to the boot partition; the first access location and the second access location correspond to the target system; the dtbo partition is used to store the image file related to the vendor device tree; the boot partition is used to store the image file related to the linux kernel.
[0083] When entering the linux kernel startup phase, the corresponding image files can be loaded from the dtbo partition and the boot partition. Since this process and the above BootLoader program loading process are both in the startup abl phase, the value of the flag bit can be obtained from the misc partition to determine the target system.
[0084] After determining the target system, the image files can be loaded according to the access locations corresponding to the dtbo partition and the boot partition respectively. Exemplarily, when the target system is System A, the first access location corresponding to the dtbo partition of System A and the second access location corresponding to the boot partition of System A can be determined according to the target partition information, so that the image file related to the vendor device tree can be obtained from the first access location, and the image file related to the linux kernel can be obtained from the second access location.
[0085] Alternatively, when the terminal device is a dual-system terminal device, including the original system and the new system, the partition corresponding to the original system is the native partition, and the partition corresponding to the new system is the new partition, so as to obtain the corresponding image file according to the target system.
[0086] By determining the access locations corresponding to the dtbo partition and the boot partition respectively after entering the linux kernel startup phase according to the value of the flag bit in the misc partition, the image file can be accurately obtained.
[0087] Optionally, when in the partition mounting phase of the init phase, determining the target system corresponding to the system startup instruction includes:
[0088] Read the system switching message in the kernel startup parameters and determine the target system according to the system switching message;
[0089] Loading the image file corresponding to the target system according to the access location corresponding to each partition includes:
[0090] Load the image file in the third access location corresponding to the super partition and the image file in the fourth access location corresponding to the userdata partition; the third access location and the fourth access location correspond to the target system; the super partition is used to store the image file related to the operating system; the userdata partition is used to store the image file related to applications and user data.
[0091] In the partition mounting stage of the init phase, that is, the main module partition mounting stage, the corresponding image files can be loaded from the super partition and the userdata partition. At this time, since the current stage is different from the above-mentioned abl startup stage, the target system cannot be directly determined according to the value of the flag bit obtained from the misc partition. At this time, the target system can be determined according to the system switching message written to the kernel startup parameters in the early stage.
[0092] After determining the target system, the image files can be loaded according to the access locations corresponding to the super partition and the userdata partition respectively.
[0093] By relying on the system switching message in the kernel startup parameters, accurately determine the access locations corresponding to the super partition and the userdata partition respectively, so as to accurately obtain the image files.
[0094] Optionally, after entering the target system, the method further includes:
[0095] Add attribute information to the property file, where the attribute information is used to indicate to the terminal device that it has currently entered the target system; the property file is the file obtained by the terminal device after entering the target system;
[0096] Obtain the configuration information corresponding to the target system, and disable the target application according to the configuration information; the configuration information indicates the target application that is prohibited from being used after entering the target system.
[0097] When entering the target system, it is also possible to notify the terminal device (upper layer) of the currently entered system, so that the terminal device can perform corresponding operations. Optionally, attribute information can be added to the property file (property file), which is the file read by the terminal device after entering the target system, so that the terminal can determine the currently entered target system.
[0098] For different target systems, different configuration information can be set. The configuration information is used to represent the disabled target applications, so that according to the currently entered target system, some applications can be disabled to meet the user's needs.
[0099] Exemplarily, when the terminal device enters System A, it is desired to prohibit Application 1, and when the terminal device enters System B, it is desired to prohibit Application 2. Then, when the terminal device enters System A, it can be determined that the currently entered system is System A based on the attribute information added to the attribute file, so that Application 1 can be prohibited from being used.
[0100] By adding attribute information to the attribute file, the terminal device can determine the currently entered system to prohibit the use of the corresponding application.
[0101] Optionally, obtaining the target partition information corresponding to the target system includes:
[0102] Querying the partition table according to the target system to obtain the target partition information corresponding to the target system; the partition table is set in the terminal device before the system starts; the partition table includes partition information corresponding to multiple systems respectively.
[0103] The partition information corresponding to each system can be written into the partition table. The partition information includes the partition name, the allocated storage space size, the partition type attribute, etc. The partition information will be written into the terminal device before the system starts. Thus, during the system startup process, after determining to enter the target system, the corresponding target partition information can be determined by querying the partition table.
[0104] Correspondingly, before issuing the startup instruction, it is also necessary to store the mirror files corresponding to the respective partitions of different systems into the corresponding target partitions.
[0105] By writing the target partition information into the partition table, the recording of the target partition information can be achieved for subsequent querying from the partition table.
[0106] Figure 3 It is a schematic flowchart of another multi-system startup method provided by an embodiment of the present invention. If only System A exists currently, when System B is added, the terminal device becomes a dual-system terminal device, and the system that the terminal device defaults to boot into is System A. The dual-system startup steps include:
[0107] Step S301, configure the partition table, and add a set of partitions (including boot_d, dtbo_d, cache_d (mirror files related to upgrade), super_d, userdata_d) to the partition table;
[0108] Step S302, at the start of startup, before the linux kernel is loaded, read the value of the flag bit written in the misc partition to determine the system to be switched, for example: System B;
[0109] Step S303: When the switched system is System B, add a system switching message (System A switches to System B) to the cmdline;
[0110] Step S304: During the linux kernel loading phase, select the corresponding partitions boot_d and dtbo_d of System B for loading according to the value of the flag bit read from the misc partition;
[0111] Step S305: Read the cmdline, determine whether there is a system switching message written by the underlying layer, and mount the corresponding super_d partition and userdata_d partition of System B when the main module is mounted;
[0112] Step S306: When switching to System B, add attribute information to the property file for the upper layer to obtain that the current system is System B;
[0113] Step S307: When the system is restarted after switching (when switching from System A to System B), issue a restart command, create a rebootsecond command, indicating that the system is started to System B, and write the system switching flag bit to the misc partition.
[0114] Through the method of the present invention, complete data isolation can be achieved. Starting from the boot loading after BootLoader, the files in the relevant partitions used by multiple systems are completely isolated and invisible to each other, improving data security.
[0115] In addition, the existing dual-system terminal devices will cause certain waste in resource usage, require more memory and processor resources, have a higher power consumption, and are more likely to generate heat. This is because the dual-system terminal devices or multi-system terminal devices adopt virtualization technology and divide the dual system into a foreground domain and a background domain, and the two systems run simultaneously. Although resource sharing and resource control can be achieved, the process is complex, and resource sharing is inevitable, which may lead to phenomena such as the lag or crash of some applications. The present invention can also solve the above problems through the above method. Since only one system is started when the system is started, and the other system is in a completely shutdown state, the power consumption is at the level of a single system, thereby improving the fluency of the system.
[0116] In addition, since the dual-system terminal devices adopt virtualization technology, it is possible that two systems access a hardware resource simultaneously, which will lead to data asynchronization, and then problems such as system crashes or the loss of data of running applications. The present invention uses a method of multiple partitions, and there are two sets of partitions starting from the kernel loading. Only one system is online during use, and there is no problem of sharing hardware resources.
[0117] Figure 4Schematic diagram of a multi-system startup device provided by an embodiment of the present invention. The multi-system is set on a terminal device, and the multi-system includes at least two systems. The device includes:
[0118] A determination module 401, configured to determine a target system corresponding to the system startup instruction in response to the system startup instruction. The target system is any one of the multiple systems.
[0119] An acquisition module 402, configured to acquire target partition information corresponding to the target system. The target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition. An image file corresponding to the target system is stored in each partition. The access locations of the partitions corresponding to each system are different.
[0120] A processing module 403, configured to load the image file corresponding to the target system according to the access location corresponding to each partition, and control the kernel corresponding to the target system to process the image file, so as to enter the target system.
[0121] Optionally, when the determination module 401 determines the target system corresponding to the system startup instruction, it is specifically configured to:
[0122] Control the bootloader to read the value of the flag bit in the misc partition. The value is the information written to the flag bit in the misc partition according to the target system after receiving the system startup instruction.
[0123] Determine the target system corresponding to the system startup instruction according to the read value.
[0124] Optionally, the device further includes:
[0125] A writing module, configured to write a system switching message in the kernel startup parameter after determining the target system corresponding to the system startup instruction. The system switching message is used to indicate that the terminal device enters the target system after startup.
[0126] Optionally, when in the linux kernel loading stage, when the determination module 401 determines the target system corresponding to the system startup instruction, it is specifically configured to:
[0127] Determine the target system according to the value of the flag bit in the misc partition.
[0128] When the control module 403 loads the image file corresponding to the target system according to the access location corresponding to each partition, it is specifically configured to:
[0129] Load the image file in the first access location corresponding to the dtbo partition, and load the image file in the second access location corresponding to the boot partition; the first access location and the second access location correspond to the target system; the dtbo partition is used to store the image file related to the vendor device tree; the boot partition is used to store the image file related to the linux kernel.
[0130] Optionally, when in the partition mounting stage of the init phase, when the determining module 401 determines the target system corresponding to the system startup instruction, it specifically is used for:
[0131] Read the system switching message in the kernel startup parameters, and determine the target system according to the system switching message;
[0132] When the control module 403 loads the image file corresponding to the target system according to the access location corresponding to each partition respectively, it specifically is used for:
[0133] Load the image file in the third access location corresponding to the super partition, and load the image file in the fourth access location corresponding to the userdata partition; the third access location and the fourth access location correspond to the target system; the super partition is used to store the image file related to the operating system; the userdata partition is used to store the image file related to applications and user data.
[0134] Optionally, the device further includes an adding module, which is used for:
[0135] After entering the target system, add attribute information to the attribute file, where the attribute information is used to indicate to the terminal device that it has entered the target system; the attribute file is the file obtained by the terminal device after entering the target system;
[0136] Obtain the configuration information corresponding to the target system, and disable the target application according to the configuration information; the configuration information indicates the target application that is prohibited from being used after entering the target system.
[0137] Optionally, when the obtaining module 402 obtains the target partition information corresponding to the target system, it specifically is used for:
[0138] Query the partition table according to the target system to obtain the target partition information corresponding to the target system; the partition table is set in the terminal device before the system starts; the partition table includes the partition information corresponding to multiple systems.
[0139] The multi-system startup device provided by the embodiments of the present invention can implement the above as Figure 2 andFigure 3 The multi-system startup method of the illustrated embodiment has a similar implementation principle and technical effect, which will not be elaborated here.
[0140] Figure 5 The following is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. As Figure 5 shown, the electronic device provided in this embodiment includes: at least one processor 501 and a memory 502. Among them, the processor 501 and the memory 502 are connected through a bus 503.
[0141] In the specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the method in the above method embodiment.
[0142] For the specific implementation process of the processor 501, reference can be made to the above method embodiment. Its implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0143] In the above Figure 5 illustrated embodiment, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated: CPU), and may also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, abbreviated: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0144] The memory may include high-speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
[0145] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0146] An embodiment of the present invention further provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When a processor executes the computer-executable instructions, the methods in the above method embodiments are implemented.
[0147] For the above-mentioned computer-readable storage medium, the above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0148] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0149] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps included in the above method embodiments; and the foregoing storage medium includes various media that can store program codes, such as ROM, RAM, magnetic disks, or optical disks.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. However, such modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A multi-system startup method, characterized in that, The multi - system is set on a terminal device, and the multi - system includes at least two systems; The method includes: In response to a system startup instruction, determine a target system corresponding to the system startup instruction; The target system is any one of the multiple systems; Obtain target partition information corresponding to the target system; The target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition respectively; An image file corresponding to the target system is stored in each partition; The access locations of the partitions corresponding to each system are different; According to the access location corresponding to each partition respectively, load the image file corresponding to the target system, and control the kernel corresponding to the target system to process the image file to enter the target system.
2. The method according to claim 1, characterized in that, Determining the target system corresponding to the system startup instruction includes: Control the bootloader to read the value of the flag bit in the misc partition; The value is the information written to the flag bit in the misc partition according to the target system after receiving the system startup instruction; Determine the target system corresponding to the system startup instruction according to the read value.
3. The method according to claim 2, wherein After determining the target system corresponding to the system startup instruction, the method further includes: Write a system - switching message in the kernel startup parameters, and the system - switching message is used to indicate that the terminal device enters the target system after startup.
4. The method according to claim 2, characterized in that, When in the linux kernel loading stage, determining the target system corresponding to the system startup instruction includes: Determine the target system according to the value of the flag bit in the misc partition; According to the access location corresponding to each partition respectively, loading the image file corresponding to the target system includes: Load the image file in the first access location corresponding to the dtbo partition, and load the image file in the second access location corresponding to the boot partition; The first access location and the second access location correspond to the target system; The dtbo partition is used to store the image file related to the vendor device tree; The boot partition is used to store the image file related to the linux kernel.
5. The method according to claim 3, characterized in that, When in the partition mounting stage of the init phase, determining the target system corresponding to the system startup instruction includes: Read the system - switching message in the kernel startup parameters, and determine the target system according to the system - switching message; According to the access location corresponding to each partition respectively, loading the image file corresponding to the target system includes: Load the image file in the third access location corresponding to the super partition, and load the image file in the fourth access location corresponding to the userdata partition; The third access location and the fourth access location correspond to the target system; The super partition is used to store the image file related to the operating system; The userdata partition is used to store the image file related to applications and user data.
6. The method according to any one of claims 1-5, characterized in that, After entering the target system, the method further includes: Add attribute information to the attribute file, where the attribute information is used to indicate to the terminal device that it has entered the target system; the attribute file is the file obtained after the terminal device enters the target system. Obtain the configuration information corresponding to the target system, and disable the target application according to the configuration information; the configuration information indicates the target application that is prohibited from being used after entering the target system.
7. The method according to any one of claims 1-5, characterized in that Obtain the target partition information corresponding to the target system, including: Query the partition table according to the target system to obtain the target partition information corresponding to the target system; the partition table is set on the terminal device before the system starts; the partition table includes the partition information corresponding to multiple systems.
8. A multi-system startup device, characterized in that, The multiple systems are set on the terminal device, and the multiple systems include at least two systems; the device includes: A determination module, configured to determine the target system corresponding to the system startup instruction in response to the system startup instruction; the target system is any one of the multiple systems. An acquisition module, configured to acquire the target partition information corresponding to the target system; the target partition information includes each partition corresponding to the target system, and the access location corresponding to each partition; the mirror file corresponding to the target system is stored in each partition; the access locations of the partitions corresponding to each system are different. A processing module, configured to load the mirror file corresponding to the target system according to the access location corresponding to each partition, and control the kernel corresponding to the target system to process the mirror file to enter the target system.
9. An electronic device, characterized in that, Including: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the method according to any one of claims 1 to 7 is implemented.