CN114138344A - System checking method and terminal - Google Patents

System checking method and terminal Download PDF

Info

Publication number
CN114138344A
CN114138344A CN202010924084.3A CN202010924084A CN114138344A CN 114138344 A CN114138344 A CN 114138344A CN 202010924084 A CN202010924084 A CN 202010924084A CN 114138344 A CN114138344 A CN 114138344A
Authority
CN
China
Prior art keywords
partition
check
terminal
portable
memory card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010924084.3A
Other languages
Chinese (zh)
Other versions
CN114138344B (en
Inventor
孙哲
黄虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN202010924084.3A priority Critical patent/CN114138344B/en
Publication of CN114138344A publication Critical patent/CN114138344A/en
Application granted granted Critical
Publication of CN114138344B publication Critical patent/CN114138344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating

Landscapes

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

Abstract

The invention discloses a system checking method and a terminal, which are used for checking a portable system in an external memory card and starting the checked portable system. The method comprises the following steps: the method comprises the steps that a terminal monitors that an external memory card containing a portable system is inserted, a user restarts the system of the portable system after selecting to start the portable system, and each partition of the external memory card is read in a kernel starting stage of the system restart of the portable system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition; the terminal carries out first verification on each partition information of the external memory card according to the partition table information stored in the first verification partition; and after the first check is passed, the terminal performs a second check on the system partition of the external memory card according to the system check file stored in the second check partition, and if the second check is passed, the portable system is started.

Description

System checking method and terminal
Technical Field
The invention relates to the technical field of multiple systems, in particular to a system verification method and a terminal.
Background
With the development of multimedia technology, the storage space inside the terminal cannot meet the actual application requirements, and the storage space can be expanded through an external memory card. Most of the existing external memory cards store some file information, such as video files, picture files, txt files, and the like, and a terminal can solve the problem of limited terminal storage space by storing some relatively large files on a T card and accessing the files on the T card. In the prior art, the portable system on the external memory card cannot be verified.
Disclosure of Invention
The invention provides a system verification method and a terminal, which are used for verifying a portable system in an external storage device and starting the verified portable system.
In a first aspect, the present invention provides a method for system verification, the method comprising:
the method comprises the steps that a terminal monitors that an external memory card containing a portable system is inserted, a user restarts the system of the portable system after selecting to start the portable system, and each partition of the external memory card is read in a kernel starting stage of the system restart of the portable system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
the terminal carries out first verification on each partition information of the external memory card according to the partition table information stored in the first verification partition;
and after the first check is passed, the terminal performs a second check on the system partition of the external memory card according to the system check file stored in the second check partition, and if the second check is passed, the portable system is started.
The portable system checking method provided by the invention mainly aims at checking the portable system of the external memory card of the terminal, and the checked portable system is started, so that the terminal can use the portable system of the external memory card, since there is no portable system currently stored on an external storage device, and if the portable system needs to be read using a file system, namely, the system partition is required to be mounted, but no portable system exists in the current external memory card, so when the external memory card is inserted into the current local system of the terminal, the system partition in the device is not mounted, the portable system is not verified, only the reading operation without the file system is carried out, in addition, the portable system can be started after the verification is passed, therefore, the terminal can use the portable system on the external memory card, and the experience of the user in using the terminal is effectively improved.
In addition, the invention can solve the problem that the portable system is still started after the original partition in the external memory card is damaged by checking the information of each partition, for example, the portable system cannot be started if the checking fails after the user self-adjusts the size of the partition.
In a possible implementation manner, the performing, by the terminal, a second check on the system partition of the external memory card according to the system check file stored in the second check partition includes:
the terminal creates a temporary directory at the mounting process stage of the restart of the system of the terminal, mounts the second check partition to the temporary directory, and reads a system check file stored in the second check partition;
and the terminal determines a check value of the data in the system partition according to a preset check algorithm, compares whether a check code stored in the system check file is consistent with the check value or not, and determines that the second check is passed if the check code is consistent with the check value.
The embodiment of the invention provides a method for checking a system partition in an external memory card, because a file system exists in a second checking partition, reading data of the second checking partition can be executed only after the second checking partition is mounted, therefore, the invention creates a temporary directory at the stage of the mounting process of the native system starting, mounts the second check partition on the temporary directory, reads the system check file stored by the second check partition, thereby, the integrity of the system partition is checked, since all data in the system partition is checked in the embodiment, even if the data in the system partition is modified by a small amount, it can be checked out and the start-up of the portable system can be interrupted, therefore, the portable system can be effectively prevented from being started after being maliciously tampered, and the safety of the portable system is improved.
In one possible implementation, if the second check-up is passed, then booting up the portable system includes:
the terminal replaces a system partition mounted under a local directory with a system partition of an external memory card at the mounting process stage of restarting the local system, and then runs a portable system in the system partition to execute an android starting stage of starting the portable system;
and the terminal interrupts the flow of the system mount data partition of the terminal at the android starting stage of the portable system starting, uses the equipment identification of the external memory card to mount the data partition, and continues to start the portable system.
The embodiment of the invention also provides a method for starting the portable system, which can verify the portable system after receiving the instruction of a user to start the portable system, and can start the portable system after the portable system is verified to pass, so that the portable system on the external memory card can be used by a terminal. In addition, since the system partition in the present invention does not include data strongly related to a drive or hardware, the portable system with an external memory card in the present invention has versatility.
In one possible implementation, the method further includes:
and the terminal checks the version number of the portable system in the system partition according to the original system version number in the first check partition in the android starting stage of starting the portable system.
The invention also provides a method for continuously verifying the portable system in the process of starting the portable system, which can prevent the portable system of an unofficial version from running at the terminal according to the mode of verifying the version number of the portable system.
In a possible implementation manner, the verifying, by the terminal, the version number of the portable system in the system partition according to the original system version number in the first verification partition includes:
if the terminal does not acquire the original system version number and/or the version number of the portable system within the preset time, determining that the verification fails; or the like, or, alternatively,
and the terminal encrypts the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, the terminal determines that the verification is passed.
The embodiment provides two ways for checking the version number of the portable system, so that when a user writes an unofficial version of the portable system by himself, the portable system is not started, in one case, the portable system written by himself does not carry the system version number, in the other case, the system version number in the portable system written by him is the unofficial version, so that the encryption way of the original system version number in the first check partition is unknown, the check is failed, and the start of the portable system is terminated.
In a second aspect, the present invention provides a system check terminal, including: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the terminal to perform the following:
the processor is configured to perform the following process:
monitoring that an external memory card containing a portable system is inserted through the external interface, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card on the external interface at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
according to partition table information stored in a first check partition, performing first check on each partition information of the external memory card;
and after the first check is passed, performing second check on the system partition of the external memory card according to the system check file stored in the second check partition, and starting the portable system if the second check is passed.
As an optional implementation, the processor is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
As an optional implementation, the processor is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
As an optional implementation manner, the processor is specifically further configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
As an optional implementation, the processor is specifically configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, determining that the verification is passed.
In a third aspect, the present invention provides an apparatus for system verification, the apparatus comprising: reading unit, first check unit and second check unit, wherein:
the reading unit is used for monitoring that an external memory card containing a portable system is inserted, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
the first checking unit is used for carrying out first checking on the partition information of the external memory card according to the partition table information stored in the first checking partition;
and the second checking unit is used for checking the system partition of the external memory card for the second time according to the system checking file stored in the second checking partition after the first checking is passed, and starting the portable system if the second checking is passed.
As an optional implementation manner, the second checking unit is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
As an optional implementation manner, the second checking unit is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
As an optional implementation manner, the apparatus further includes a third checking unit configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
As an optional implementation manner, the third verification unit is specifically configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, determining that the verification is passed.
In a fourth aspect, the present invention provides a computer storage medium having stored thereon a computer program which, when executed by a processing unit, performs the steps of the method of the first aspect.
In addition, for technical effects brought by any one implementation manner of the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1A is a schematic diagram of a terminal into which an external memory card is inserted according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a terminal into which an external memory card is inserted according to an embodiment of the present invention;
FIG. 2 is a flowchart of a system verification method according to an embodiment of the present invention;
FIG. 3A is a diagram of an external memory card plug-in terminal according to an embodiment of the present invention;
FIG. 3B is a diagram of an external memory card plug-in terminal according to an embodiment of the present invention;
fig. 3C is a schematic diagram of a terminal for triggering a system restart process according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating an embodiment of a specific implementation that a terminal checks a version number of a portable system according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating an embodiment of a method for integrity check of a portable system according to the present invention;
fig. 6 is a schematic diagram of a system verification terminal according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a system verification apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a system verification terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Some of the words that appear in the text are explained below:
1. the term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
2. The term "terminal", or "terminal device", in the embodiment of the present invention, is a device located at the outermost periphery of a network in a computer network, and can access a wireless local area network WLAN to perform input of user information and output of processing results, and includes a desktop computer, a mobile phone, a notebook, a tablet computer, a POS machine, and a vehicle-mounted computer.
The application scenario described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not form a limitation on the technical solution provided in the embodiment of the present invention, and it can be known by a person skilled in the art that with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems. In the description of the present invention, the term "plurality" means two or more unless otherwise specified.
Example one
In the prior art, a portable system of an external storage card on a terminal is not available, the portable system is stored on the external storage card of the terminal in the embodiment of the invention, and the terminal can check the portable system after being powered on and select to start the portable system after the check is passed. The external memory card in the embodiment of the present invention may be, but is not limited to, an SD card, a T card, and the like, and the portable system in the embodiment of the present invention is an operating system, and may be, but is not limited to, an android system. Among them, the T card, i.e., the TF card, is a kind of flash memory card.
As shown in fig. 1A and fig. 1B, schematic diagrams of a terminal into which an external memory card is inserted according to an embodiment of the present invention are shown, where the external memory card is a T card.
The invention provides a method for verifying a portable system of an external memory card, which is characterized in that whether the portable system meets the requirement and is not tampered can be verified by a method for verifying the portable system of the external memory card through a local system carried by a terminal, so that the portable system can be started after the terminal passes the verification.
In the embodiment of the invention, the verification process of the portable system is completed in the execution process of the starting process of the android system, so the starting process of the android system is simply introduced at first.
The android system is divided into four layers from top to bottom: the system comprises an application layer, an application program framework layer, a system operation library layer and a linux kernel layer; the Linux kernel provides memory management, process management, network protocols and various drivers (such as a display driver, a camera driver, a Bluetooth driver and the like) for the android system; the system operation library layer is used for starting the system operation library layer and comprises a C/C + + library and an android runtime; the application framework layer provides various components and services for the development of the application layer; the application layer is mainly written by java programs, contains various resource files and can interact with users.
The starting process of the whole Android system can be generally divided into three stages, which are respectively: a Boot Loader Boot stage of a system Boot Loader; a linux Kernel starting stage, namely a Kernel starting stage; and starting an Android system, namely, at a starting stage of ramdisk. The Boot Loader can be understood as preparation for an operating system before starting, and is used for initializing hardware equipment, establishing a mapping image of a memory space, preparing an environment for finally calling a system kernel, and transmitting necessary data to the kernel; the Linux kernel is started mainly for completing initialization of the Linux kernel and performing system setting; after initialization of the Linux kernel is completed, the Android system can be loaded, and the init process can be started firstly when the Android system is loaded; the init process is the first process of a user space in the Android system, the process number is 1, the init process is a key process in starting of the Android system, and the init process is simply summarized as follows:
(1) a directory of files required to start the system is created and mounted.
(2) The attribute service is initialized and started. The attribute service here, like the registry manager in the Windows operating system, is used to record some information of users, software, etc.
(3) Rc profile is parsed and incubator zygate process is started.
The Zygote process starts a key service System Server which is mainly used for creating an application program process and creating and starting a System; system Server process initiation is used primarily to create System services. The final step in the system launch is the launch Launcher, which is used to launch the application and to display and manage the shortcut icons or other desktop components of the application.
In addition, the ROM in the Android system is divided into different areas for placing different programs, and the ROM in the Android system is mainly divided into the following partitions:
root/boot: storing a bootstrap program, including a kernel and a memory operating program;
system: storing an Android system and system applications;
repetition: recovering the partition, wherein the system can be recovered by entering the partition;
data: a user data area containing user data: contact person, short message, setting, user installation program;
c/cache: the android system cache region is used for storing data and application programs which are accessed most frequently by the system;
cndot/misc: including some miscellaneous content such as system settings and system function enablement disable settings;
sdcard: the user's own storage area can deposit files such as photos, music, videos.
When the computer is started and powered on, the Bootloader is loaded firstly, reads the ROM back to find the operating system, and loads the Linux kernel into the RAM. When the Linux kernel is started, a driver is loaded to mount a root file system, wherein mounting refers to a process of making computer files and directories on a storage device (such as a hard disk, a CD-ROM or a shared resource) accessible to a user through the file system of the computer by an operating system.
As shown in fig. 2, an embodiment of the present invention provides a system verification method, which can verify a portable system in an external memory card during a restart of a terminal system, so that a terminal can start the portable system after the verification is passed, and a specific implementation flow of the method is as follows:
200, monitoring that an external memory card containing a portable system is inserted by a terminal, restarting a local system after a user selects to start the portable system, and reading each partition of the external memory card at a kernel starting stage of restarting the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
step 201, the terminal performs first verification on each partition information of the external memory card according to partition table information stored in a first verification partition;
optionally, the partition information in this embodiment includes, but is not limited to: partition size, starting location of the partition, partition name, etc. That is, the first check in this embodiment is used to check whether the partition information is corrupted, for example, whether the size of each partition is modified.
In implementation, the terminal compares whether each piece of partition information of the external memory card is consistent with each piece of partition information in the partition table information according to the partition table information stored in the first check partition, for example, whether the size of each partition of the external memory card is consistent with the size of each partition in the partition table information, whether the name of each partition of the external memory card is consistent with the name of each partition in the partition table information, whether the initial position of each partition of the external memory card is consistent with the initial position of each partition in the partition table information, and if the initial positions of the partitions of the external memory card are consistent with the initial positions of each partition in the partition table information, it is determined that each piece of partition information is not modified and verified to pass the verification.
For example, the partition table information includes partitions starting from a location of 0x0000 to a location of 0x0300, where every 92 bits length represents a size of one partition, a first 92 bits represents a size of a system partition, a second 92 bits represents a size of a data partition, a third 92 bits represents a size of a first check partition, and a fourth 92 bits represents a size of a second check partition.
As an optional implementation manner, before the system restart procedure triggered after receiving the instruction to start the portable system, the terminal further includes:
after the terminal is powered on, according to a monitoring event for inserting the external memory card, whether an interface for starting the portable system is popped up after the external memory card containing the portable system is monitored to be inserted is determined;
and the terminal restarts the system after receiving an instruction of starting the portable system selected by the user.
In implementation, as shown in fig. 3A and 3B, after the terminal is powered on, after the external memory card is determined to be inserted into the terminal, an interface for starting the portable system is popped up, as shown in fig. 3C, if the user clicks to start the portable system, a system restart process is triggered, and after the portable system is verified, the portable system is started. It should be noted that, the local system starts to be started after the terminal is powered on, a monitoring event is registered in a kernel starting stage of the local system starting, and is used for monitoring whether the external memory card is inserted into the terminal, and after the external memory card is determined to be inserted into the terminal according to a monitoring result, an interface whether the portable system is started or not is popped up. The monitoring event in the embodiment can solve the problem that the external memory card of the terminal cannot be processed in the terminal starting process.
As an optional implementation manner, in this embodiment, the process of performing the first verification on the partition information of the external memory card is completed in a kernel start stage of a system restart process.
Step 202, after the first check is confirmed to pass, the terminal performs a second check on the system partition of the external memory card according to the system check file stored in the second check partition, and if the second check passes, the portable system is started.
It should be noted that, in this embodiment, the process of performing the second check on the system partition of the external memory card is performed at the stage of the mount flow of the native system startup.
Optionally, this embodiment provides a way of performing a second check on the system partition:
the terminal creates a temporary directory at the mounting process stage of the restart of the system of the terminal, mounts the second check partition to the temporary directory, and reads a system check file stored in the second check partition;
and the terminal determines a check value of the data in the system partition according to a preset check algorithm, compares whether a check code stored in the system check file is consistent with the check value or not, and determines that the second check is passed if the check code is consistent with the check value.
Optionally, the preset check algorithm in this embodiment may be, but is not limited to, hash check.
In this embodiment, the preset verification algorithm used by the terminal may be obtained in the system partition of the external memory card, or may also be obtained in the data partition, the first verification partition, or the second verification partition of the external memory card, which is not limited in this embodiment. Optionally, the external memory card in this embodiment further includes an additional partition for storing required data or a preset verification algorithm. Specifically, if the preset algorithm is hash check, the terminal may read a check value (e.g., hash value) in a system check file at a mount process stage of the system start, perform check (e.g., hash check) on data in the system partition by using the check value (e.g., hash value), and start the portable system if the check passes.
It should be noted that, in this embodiment, the verification process of the terminal on the portable system is performed during the restart process of the terminal, and the terminal is a system restart process triggered after receiving an instruction to start the portable system. In the process of restarting the system, the local system can check the data in the system partition by using the vbmeta check data in one protection partition, and when the check values are consistent, a normal system starting process is carried out, so that the local system of one terminal can only identify one system, if a plurality of systems are to be identified, a plurality of vbmeta check data are required to be built in, and a plurality of system partitions are prepared, so that switching between the two systems can be realized.
In order to solve the above problems, in the process of restarting the system, in order to not destroy the verification of the local system partition of the terminal, in the kernel starting stage of the restart process of the local system, the local system normally executes the verification of the local system partition, and after the verification of the local system partition is successful, the portable system starts to be verified, that is, each partition of the external memory card can be read; or, in a kernel starting stage of a system restarting process, the local system normally executes the verification of the local system partition, meanwhile, reads each partition of the external memory card, after the local system partition is successfully verified and the first verification passes, the terminal performs second verification on the system partition of the external device according to a system verification file stored in the second verification partition, and if the second verification passes, the portable system is started.
Optionally, in a kernel starting stage of starting the local system, after the local system successfully performs verification on the local system partition, reading each partition of the external memory card, and performing first verification on each partition information of the external device according to partition table information stored in a first verification partition; or the like, or, alternatively,
in a kernel starting stage of starting a local system, the local system executes the check of a local system partition, reads each partition of an external storage card, performs first check on the partition information of the external device according to partition table information stored in a first check partition, if the local system partition is successfully checked and the first check passes, the terminal performs second check on the system partition of the external device according to a system check file stored in a second check partition, and if the second check passes, the portable system is started.
The portable system in the embodiment of the invention is a general system, and comprises the following four partitions:
1) the system partition is used for storing system files, which can be understood as storing files of a portable system, system application and the like;
2) and the data partition is used for storing the data of the user, such as: contact person, short message, setting, user installation program;
3) the first check subarea stores the information of the subarea table; the first check partition has no file system and can not be mounted, and a terminal can directly read the first check partition;
optionally, the first check partition further includes an original system version number.
4) The second check partition is used for storing a system check file; the second check partition is provided with a file system and can be read only by the terminal after mounting.
The external memory card in the embodiment of the invention can burn the data or files of the four partitions into the external memory card through the burning tool, and because the system partition in the invention is burnt with the system file which only contains the files of the portable system and the system application and does not contain the contents related to the drive or the hardware (can be understood as not containing the private file of a manufacturer), the portable system in the embodiment has universality, and the portable system does not have strong related contents with equipment and does not have high coupling.
As an optional implementation manner, this embodiment further provides a verification method, including:
and the terminal checks the version number of the portable system in the system partition according to the original system version number in the first check partition in the android starting stage of starting the portable system.
As an optional implementation manner, if the first check fails, the current native startup process is interrupted, and the system is restarted to return to the native system; or the like, or, alternatively,
if the second check fails, interrupting the current local starting process, and restarting the system to return to the local system; or the like, or, alternatively,
if the version number of the portable system in the system partition is verified according to the original system version number in the first verification partition and the verification fails, the current local starting process is interrupted, and the system is restarted and returned to the local system.
It should be noted that, in the embodiment of the present invention, the portable system may be verified in two different verification manners, and the portable system may also be verified in combination with a third verification manner after the two verification manners pass, where the external memory card is subjected to the first verification, that is, the information of each partition is verified, so that the portable system is not started after the size of each partition is adjusted, and the portable system is considered as not an official version and is automatically modified; the external memory card is checked for the second time, namely the system partition is checked, so that the portable system cannot be started after the data in the system partition is replaced, and the integrity of the system partition is ensured; the version number of the portable system of the external memory card is verified, so that the portable system cannot be started when the system version number or the system version number is not the official version number, and the portable system is prevented from being started when a user burns the portable system of the unofficial version in the external memory card.
It should be noted that, the process of checking the version number of the portable system by the terminal is performed in an android startup phase of starting the portable system.
In this embodiment, after the second check-up is passed, the portable system may be started, and the specific implementation manner is as follows:
the terminal replaces a system partition mounted under a local directory with a system partition of an external memory card at the mounting process stage of restarting the local system, and then runs a portable system in the system partition to execute an android starting stage of starting the portable system;
and the terminal interrupts the flow of the system mount data partition of the terminal at the android starting stage of the portable system starting, uses the equipment identification of the external memory card to mount the data partition, and continues to start the portable system.
It should be noted that, in this embodiment, the start-up process executed after the data partition is mounted is the same as that in the prior art, and since the start-up process of the portable system in the embodiment of the present invention is based on the start-up process of the local system, the start-up process is universal, and any terminal equipped with an android system can use the portable system in the external memory card of the present invention. One interrupt processing is used for replacing a system partition mounted under a local directory with a system partition of an external memory card at the stage of the mounting process of the local system, the other interrupt processing is used for interrupting the process of mounting a data partition of the local system, the data partition is mounted by using equipment identification of the external memory card, and after the two interrupt processing is executed, the system started by the local system is actually a portable system.
The embodiment further provides a method for starting the portable system, which is used for the terminal to check the portable system after receiving an instruction for starting the portable system, and start the portable system after the check is passed, so that the use of the portable system in the external memory card is realized, and the terminal can realize the use of a plurality of operating systems.
As an optional implementation manner, in an android startup stage of starting the portable system, the version number of the portable system in the system partition is checked according to the original system version number in the first check partition, where a specific checking manner includes any one of the following:
1) if the terminal does not acquire the original system version number and/or the version number of the portable system within the preset time, determining that the verification fails;
2) and the terminal encrypts the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, the terminal determines that the verification is passed.
In the verification mode, in an android startup stage of starting the portable system, the portable system sends the version number of the portable system recorded in the system to the driver for verification (the driver is notified in a node writing mode):
one mode is that the driver does not acquire the version number of the portable system within preset time and/or determines that the verification fails if the version number of the original system in the first verification partition is not acquired;
the other mode is that if the driver obtains the version number of the portable system and the version number of the original system within the preset time, the version number of the portable system is compared with the version number of the original system, if the version numbers of the portable system and the version number of the original system are consistent, the portable system passes the verification, otherwise, the current local starting process is interrupted, and the system is restarted and returns to the local system.
It should be noted that, in this embodiment, the process of checking the version number of the portable system by the terminal is executed after the device identifier of the external memory card is used to mount the data partition in the android startup phase of the portable system; in practice, the version number of the portable system in this embodiment is the version number encrypted according to the preset algorithm.
As shown in fig. 4, a specific execution flow for the terminal to verify the version number of the portable system is as follows:
step 400, after the second check is passed, in the mounting process stage of the local system, the terminal replaces the system partition mounted in the local directory with the system partition of the external memory card;
for example, the replaced local directory is mount-t ext4/dev/block/mmcblk1p1/system, where mount is a command to perform a mount operation, i.e., a mount command is used to replace a system partition, -t ext4 indicates that the file system of the external memory card is in an ext4 format, dev/block/mmcblk1p1 is a device name of the external memory card (i.e., a device name corresponding to the portable system), and system is a system partition of the external memory card (i.e., a system partition to be replaced).
Step 401, the terminal runs the portable system in the system partition to execute an android startup phase of startup of the portable system;
it is easy to understand that, since the terminal replaces the system partition mounted under the local directory with the system partition of the external memory card, the current system partition in which the local system operates is actually a portable system in the external memory card.
As an optional implementation manner, in the mount process stage of the local system, after the terminal replaces the system partition mounted in the local directory with the system partition of the external memory card, the method further includes: and the terminal creates a preset link of a preset directory under the system partition directory.
In practice, creating some key links, such as a/product directory, that point to key directories under a system directory requires pointing to the/system/product directory, such as a mount-o bind/system/product/product.
Step 402, the terminal interrupts the flow of the system mount data partition of the terminal at the android starting stage of the portable system starting;
step 403, the terminal uses the device identifier of the external memory card to mount the data partition;
after the terminal runs the portable system in the system partition, the currently started portable system is the portable system in the external memory card, so that the version number of the currently running portable system can be checked in the process of starting the portable system. However, before checking the version number of the portable system, the process of mounting the data partition by the native system needs to be interrupted, since the native system needs to use a configuration file when mounting the data partition, and the configuration file is stored in the vendor partition, and since the configuration file in the vendor partition has high coupling with the driver and the hardware, in this embodiment, data in the vendor partition is not replaced, and then, if the process of mounting the data partition by the native system is normally executed, the read configuration file is user data in the data partition of the native system, and is not a data partition of an external memory card.
Therefore, the terminal of this embodiment interrupts the flow of mounting the data partition of the local system, and uses the device identifier of the external memory card to mount the data partition, thereby completing the replacement of the data partition, and reading the user data in the data partition of the external memory card.
Step 404, the terminal decrypts the data partition according to the existing mode and notifies the driver in a node writing mode after the data partition is decrypted successfully, and the written node content can be obtained by encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system;
step 405, after receiving the version number of the encryption system, the driver compares whether the version number of the original system is consistent with the version number of the encryption system; if yes, go to step 406, otherwise go to step 407;
step 406, continuing to start the portable system;
step 407, the portable system is interrupted to start, and the system is restarted to return to the local system.
As shown in fig. 5, the embodiment further provides a method for integrity check of a portable system, and the specific implementation flow is as follows:
500, starting up and powering up the terminal;
step 501, according to a monitoring event for inserting an external memory card, after the external memory card is determined to be inserted into a terminal, whether an interface of a portable system is started is popped up;
step 502, receiving an instruction for starting the portable system, and restarting the system;
step 503, reading each partition of the external memory card in a kernel starting stage of the system restart of the local computer, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
step 504, performing first verification on each partition information of the external memory card according to the partition table information stored in the first verification partition;
step 505, judging whether the first check is passed, if so, executing step 506, otherwise, executing step 515;
step 506, creating a temporary directory at the stage of the mounting process started by the native system, and mounting the second check-up partition on the temporary directory;
step 507, reading a system check file stored in the second check partition, and determining a check value of data in the system partition by the terminal according to a preset check algorithm;
step 508, comparing whether the check code stored in the system check file is consistent with the check value, if so, executing step 509, otherwise, executing step 515;
step 509, in the process phase of the local system, replacing the system partition mounted in the local directory with a system partition of an external memory card, and operating the portable system in the system partition to execute an android startup phase of starting the portable system;
step 510, the terminal interrupts the flow of the local system mounting data partition in the android starting stage of the portable system starting, and uses the device identifier of the external memory card to mount the data partition;
step 511, carrying out decryption operation on the data partition according to a preset mode;
the preset mode is the same as the encryption and decryption operation of the data partition in the prior art;
step 512, after the decryption is successful, checking the version number of the portable system in the system partition according to the original system version number in the first check partition;
step 513, determining whether the verification passes, if the verification passes, executing step 514, otherwise, executing step 515;
optionally, if the terminal does not acquire the original system version number and/or the version number of the portable system within a preset time, determining that the verification fails; or the like, or, alternatively,
and the terminal encrypts the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the version number of the original system is the same as the version number of the encrypted system, the terminal determines that the verification is passed, namely, the terminal compares whether the version number of the original system is consistent with the version number of the encrypted system.
Step 514, the portable system continues to be started.
Step 515, the portable system is interrupted from being started, and the system is restarted to return to the local system.
Example two
Based on the same inventive concept, the embodiment of the present invention further provides a system check terminal, and since the terminal is the terminal in the method in the embodiment of the present invention and the principle of the terminal to solve the problem is similar to that of the method, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
As shown in fig. 6, the terminal includes: a processor 600 and an external interface 601, wherein the processor 600 is configured to perform the following processes:
monitoring that an external memory card containing a portable system is inserted through the external interface, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card on the external interface at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
according to partition table information stored in a first check partition, performing first check on each partition information of the external memory card;
and after the first check is passed, performing second check on the system partition of the external memory card according to the system check file stored in the second check partition, and starting the portable system if the second check is passed.
As an optional implementation, the processor 600 is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
As an optional implementation, the processor 600 is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
As an optional implementation manner, the processor 600 is further specifically configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
As an optional implementation, the processor 600 is specifically configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, determining that the verification is passed.
EXAMPLE III
Based on the same inventive concept, the embodiment of the present invention further provides a system verification apparatus, and since the apparatus is an apparatus in the method in the embodiment of the present invention, and the principle of the apparatus for solving the problem is similar to that of the method, the apparatus may be implemented by referring to the method, and repeated details are not repeated.
As shown in fig. 7, the apparatus includes: a reading unit 700, a first verification unit 701 and a second verification unit 702, wherein:
the reading unit 700 is configured to monitor that an external memory card including a portable system is inserted, restart the local system after a user selects to start the portable system, and read each partition of the external memory card at a kernel start stage of the local system, where the external memory card includes a system partition, a data partition, a first verification partition, and a second verification partition;
the first verification unit 701 is configured to perform first verification on each partition information of the external memory card according to the partition table information stored in the first verification partition;
the second check unit 702 is configured to perform a second check on the system partition of the external memory card according to the system check file stored in the second check partition after the first check is passed, and start the portable system if the second check is passed.
As an optional implementation manner, the second checking unit 702 is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
As an optional implementation manner, the second checking unit 702 is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
As an optional implementation manner, the apparatus further includes a third checking unit configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
As an optional implementation manner, the third verification unit is specifically configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain an encrypted system version number, and verifying the encrypted system version number according to the original system version number.
Example four
Based on the same inventive concept, the embodiment of the present invention further provides a system check terminal, and since the terminal is the terminal in the method in the embodiment of the present invention and the principle of the terminal to solve the problem is similar to that of the method, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
As shown in fig. 8, the terminal 800 includes: a Radio Frequency (RF) circuit 810, a power supply 820, a processor 830, a memory 840, an input unit 850, a display unit 860, a camera 870, a communication interface 880, and a Wireless Fidelity (Wi-Fi) module 890. Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 8 is not intended to be limiting, and that the terminal provided by the embodiments of the present application may include more or less components than those shown, or some components may be combined, or a different arrangement of components may be provided.
The following describes the various components of the terminal 800 in detail with reference to fig. 8:
the RF circuitry 810 may be used for receiving and transmitting data during a communication or conversation. Specifically, the RF circuit 810 sends downlink data of the base station to the processor 830 for processing; and in addition, sending the uplink data to be sent to the base station. Generally, the RF circuit 810 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
In addition, the RF circuit 810 may also communicate with networks and other terminals via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The Wi-Fi technology belongs to a short-distance wireless transmission technology, and the terminal 800 may connect to an Access Point (AP) through a Wi-Fi module 890, thereby implementing Access to a data network. The Wi-Fi module 890 may be used for receiving and transmitting data during communication.
The terminal 800 may be physically connected to other terminals through the communication interface 880. Optionally, the communication interface 880 is connected to the communication interface of the other terminal through a cable, so as to implement data transmission between the terminal 800 and the other terminal.
In the embodiment of the present application, the terminal 800 can implement a communication service and send information to other contacts, so the terminal 800 needs to have a data transmission function, that is, the terminal 800 needs to include a communication module inside. Although fig. 8 illustrates communication modules such as the RF circuit 810, the Wi-Fi module 890 and the communication interface 880, it is to be understood that at least one of the above-described components or other communication modules (e.g., a bluetooth module) for enabling communication are present in the terminal 800 for data transmission.
For example, when the terminal 800 is a mobile phone, the terminal 800 may include the RF circuit 810 and may further include the Wi-Fi module 890; when the terminal 800 is a computer, the terminal 800 may include the communication interface 880 and may further include the Wi-Fi module 890; when the terminal 800 is a tablet computer, the terminal 800 may include the Wi-Fi module.
The memory 840 may be used to store software programs and modules. The processor 830 executes various functional applications and data processing of the terminal 800 by executing the software programs and modules stored in the memory 840, and when the processor 830 executes the program codes in the memory 840, part or all of the processes in embodiment 1 of the present invention can be implemented.
Alternatively, the memory 840 may mainly include a program storage area and a data storage area. Wherein, the storage program area can store an operating system, various application programs and the like; the storage data area may store data created according to the use of the terminal, such as use duration information of an application, and the like.
Further, the memory 840 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 850 may be used to receive numeric or character information input by a user and generate key signal inputs related to user settings and function control of the terminal 800.
Alternatively, the input unit 850 may include a touch panel 851 and other input terminals 852.
The touch panel 851, also referred to as a touch screen, can collect touch operations of a user on or near the touch panel 851 (for example, operations of the user on or near the touch panel 851 using any suitable object or accessory such as a finger or a stylus), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 851 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 830, and can receive and execute commands sent by the processor 830. In addition, the touch panel 851 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave.
Optionally, the other input terminals 852 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 860 may be used to display information input by a user or information provided to a user and various menus of the terminal 800. The display unit 860 is a display system of the terminal 800, and is configured to present an interface and implement human-computer interaction.
The display unit 860 may include a display panel 861. Alternatively, the Display panel 861 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
Further, the touch panel 851 may cover the display panel 861, and when the touch panel 851 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 830 to determine the type of touch event, and then the processor 830 provides a corresponding visual output on the display panel 861 according to the type of touch event.
Although in fig. 8, the touch panel 851 and the display panel 861 are two separate components to implement the input and output functions of the terminal 800, in some embodiments, the touch panel 851 and the display panel 861 may be integrated to implement the input and output functions of the terminal 800.
The processor 830 is a control center of the terminal 800, connects various components using various interfaces and lines, and performs various functions of the terminal 800 and processes data by operating or executing software programs and/or modules stored in the memory 840 and calling data stored in the memory 840, thereby implementing various services based on the terminal.
Optionally, the processor 830 may include one or more processing units. Optionally, the processor 830 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 830.
The camera 870 is configured to implement a shooting function of the terminal 800, and shoot pictures or videos. The camera 870 may also be used to implement a scanning function of the terminal 800, and scan a scanned object (two-dimensional code/barcode).
The terminal 800 also includes a power supply 820 (e.g., a battery) for powering the various components. Optionally, the power supply 820 may be logically connected to the processor 830 through a power management system, so as to implement functions of managing charging, discharging, power consumption, and the like through the power management system.
It should be noted that, the processor 830 according to the embodiment of the present invention can execute the following steps:
monitoring that an external memory card containing a portable system is inserted, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
according to partition table information stored in a first check partition, performing first check on each partition information of the external memory card;
and after the first check is passed, performing second check on the system partition of the external memory card according to the system check file stored in the second check partition, and starting the portable system if the second check is passed.
As an optional implementation, the processor is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
As an optional implementation, the processor is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
As an optional implementation manner, the processor is specifically further configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
As an optional implementation, the processor is specifically configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain an encrypted system version number, and verifying the encrypted system version number according to the original system version number.
An embodiment of the present invention further provides a computer-readable non-volatile storage medium, which includes program code, and when the program code runs on a computing terminal, the program code is configured to enable the computing terminal to execute the following steps:
monitoring that an external memory card containing a portable system is inserted, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
according to partition table information stored in a first check partition, performing first check on each partition information of the external memory card;
and after the first check is passed, performing second check on the system partition of the external memory card according to the system check file stored in the second check partition, and starting the portable system if the second check is passed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for system verification, the method comprising:
the method comprises the steps that a terminal monitors that an external memory card containing a portable system is inserted, a user restarts the system of the portable system after selecting to start the portable system, and each partition of the external memory card is read in a kernel starting stage of the system restart of the portable system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
the terminal carries out first verification on each partition information of the external memory card according to the partition table information stored in the first verification partition;
and after the first check is passed, the terminal performs a second check on the system partition of the external memory card according to the system check file stored in the second check partition, and if the second check is passed, the portable system is started.
2. The method according to claim 1, wherein the second checking of the system partition of the external memory card by the terminal according to the system check file stored in the second checking partition comprises:
the terminal creates a temporary directory at the mounting process stage of the restart of the system of the terminal, mounts the second check partition to the temporary directory, and reads a system check file stored in the second check partition;
and the terminal determines a check value of the data in the system partition according to a preset check algorithm, compares whether a check code stored in the system check file is consistent with the check value or not, and determines that the second check is passed if the check code is consistent with the check value.
3. The method of claim 1, wherein booting the portable system if the second check-up passes comprises:
the terminal replaces a system partition mounted under a local directory with a system partition of an external memory card at the mounting process stage of restarting the local system, and then runs a portable system in the system partition to execute an android starting stage of starting the portable system;
and the terminal interrupts the flow of the system mount data partition of the terminal at the android starting stage of the portable system starting, uses the equipment identification of the external memory card to mount the data partition, and continues to start the portable system.
4. A method according to any of claims 1-3, characterized in that the method further comprises:
and the terminal checks the version number of the portable system in the system partition according to the original system version number in the first check partition in the android starting stage of starting the portable system.
5. The method of claim 4, wherein the terminal checking the version number of the portable system in the system partition according to the original system version number in the first checking partition comprises:
if the terminal does not acquire the original system version number and/or the version number of the portable system within the preset time, determining that the verification fails; or the like, or, alternatively,
and the terminal encrypts the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, the terminal determines that the verification is passed.
6. A system check terminal, comprising: a processor and an external interface, wherein:
the processor is configured to perform the following process:
monitoring that an external memory card containing a portable system is inserted through the external interface, restarting the local system after a user selects to start the portable system, and reading each partition of the external memory card on the external interface at a kernel starting stage of the restart of the local system, wherein the external memory card comprises a system partition, a data partition, a first verification partition and a second verification partition;
according to partition table information stored in a first check partition, performing first check on each partition information of the external memory card;
and after the first check is passed, performing second check on the system partition of the external memory card according to the system check file stored in the second check partition, and starting the portable system if the second check is passed.
7. The terminal of claim 6, wherein the processor is specifically configured to:
creating a temporary directory at the mounting process stage of the restart of the native system, mounting the second check partition on the temporary directory, and reading a system check file stored by the second check partition;
and determining a check value of the data in the system partition according to a preset check algorithm, comparing whether a check code stored in the system check file is consistent with the check value, and determining that the second check is passed if the check code is consistent with the check value.
8. The terminal of claim 6, wherein the processor is specifically configured to:
in the mounting process stage of the restart of the local system, replacing the system partition mounted under the local directory with the system partition of the external memory card, and then operating the portable system in the system partition to execute the android starting stage of the start of the portable system;
and in the android starting stage of starting the portable system, interrupting the flow of mounting the data partition of the system of the portable system, using the equipment identifier of the external memory card to mount the data partition, and continuing to start the portable system.
9. The terminal of any of claims 6-8, wherein the processor is further configured to:
and in an android starting stage of starting the portable system, checking the version number of the portable system in the system partition according to the original system version number in the first check partition.
10. The terminal of claim 9, wherein the processor is further configured to:
if the original system version number and/or the version number of the portable system are not acquired within the preset time, determining that the verification fails; or the like, or, alternatively,
and encrypting the version number of the currently running portable system according to the encryption algorithm of the currently running portable system to obtain the version number of the encrypted system, and if the original system version number is the same as the version number of the encrypted system, determining that the verification is passed.
CN202010924084.3A 2020-09-04 2020-09-04 System verification method and terminal Active CN114138344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010924084.3A CN114138344B (en) 2020-09-04 2020-09-04 System verification method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010924084.3A CN114138344B (en) 2020-09-04 2020-09-04 System verification method and terminal

Publications (2)

Publication Number Publication Date
CN114138344A true CN114138344A (en) 2022-03-04
CN114138344B CN114138344B (en) 2024-06-04

Family

ID=80438466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010924084.3A Active CN114138344B (en) 2020-09-04 2020-09-04 System verification method and terminal

Country Status (1)

Country Link
CN (1) CN114138344B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011150499A (en) * 2010-01-21 2011-08-04 Dainippon Printing Co Ltd Thin client system, thin client terminal, and thin client program
CN103077350A (en) * 2012-12-13 2013-05-01 北京奇虎科技有限公司 Searching and killing method and system for malicious code
CN103514015A (en) * 2013-09-16 2014-01-15 亚太宝龙科技(湖南)有限公司 Method and device for booting operation system from storage medium
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104750532A (en) * 2015-04-27 2015-07-01 东南大学 Android-based dual-system land verification PAD (portable android device) and starting method
CN106096419A (en) * 2016-06-06 2016-11-09 北京壹人壹本信息科技有限公司 The method of operating system security startup, Apparatus and system
CN106250172A (en) * 2016-07-18 2016-12-21 北京理工大学 A kind of Android double startup method of shared kernel subregion
CN107729198A (en) * 2017-10-18 2018-02-23 深圳合纵富科技有限公司 A kind of Android system firmware method of calibration and device
TWI649694B (en) * 2017-10-30 2019-02-01 國立臺灣大學 Android dynamic framework and method thereof
CN110909318A (en) * 2019-11-22 2020-03-24 展讯通信(上海)有限公司 Operating system anti-theft method and device for user equipment and terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011150499A (en) * 2010-01-21 2011-08-04 Dainippon Printing Co Ltd Thin client system, thin client terminal, and thin client program
CN103077350A (en) * 2012-12-13 2013-05-01 北京奇虎科技有限公司 Searching and killing method and system for malicious code
CN103514015A (en) * 2013-09-16 2014-01-15 亚太宝龙科技(湖南)有限公司 Method and device for booting operation system from storage medium
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104750532A (en) * 2015-04-27 2015-07-01 东南大学 Android-based dual-system land verification PAD (portable android device) and starting method
CN106096419A (en) * 2016-06-06 2016-11-09 北京壹人壹本信息科技有限公司 The method of operating system security startup, Apparatus and system
CN106250172A (en) * 2016-07-18 2016-12-21 北京理工大学 A kind of Android double startup method of shared kernel subregion
CN107729198A (en) * 2017-10-18 2018-02-23 深圳合纵富科技有限公司 A kind of Android system firmware method of calibration and device
TWI649694B (en) * 2017-10-30 2019-02-01 國立臺灣大學 Android dynamic framework and method thereof
CN110909318A (en) * 2019-11-22 2020-03-24 展讯通信(上海)有限公司 Operating system anti-theft method and device for user equipment and terminal

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
(-: LYSM :-): "驱动 获取系统版本", Retrieved from the Internet <URL:《https://blog.csdn.net/Simon798/article/details/106476977》> *
张宏民等: "微机常见故障与维护", 31 December 1997, 《山西科学技术出版社》, pages: 126 *
慷齐资讯编著: "FreeBSD & Windows 集成组网实务", 30 September 2000, 《中国铁道出版社》, pages: 62 - 66 *

Also Published As

Publication number Publication date
CN114138344B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
EP3073379B1 (en) Firmware recovery method, device and terminal
US11222118B2 (en) Method for updating selinux security policy and terminal
CN110457894B (en) root authority distribution method and device, storage medium and terminal equipment
CN110869907B (en) Method and terminal for browsing application page
US10628588B2 (en) Information processing apparatus and computer readable storage medium
CN110442426B (en) Password resetting method, device and storage medium
CN106487798B (en) Data synchronization method and device
CN108958807B (en) Terminal system starting method and terminal
CN112463199A (en) System upgrading method and terminal
US9928134B2 (en) Method and apparatus for repairing dynamic link library file
EP3499365A1 (en) Method and device for use in accessing container
CN115357295B (en) System rollback method, device and storage medium
CN114138344B (en) System verification method and terminal
CN113656148B (en) Container management method, device, electronic equipment and readable storage medium
CN114138547A (en) System starting method and terminal
CN110968852B (en) Virtual machine password management method, system, equipment and computer storage medium
CN114138343A (en) Terminal and terminal starting method
KR20130120709A (en) Method for managing information for network connection and an electronic device thereof
CN108959955B (en) File processing method and device
CN111444539A (en) Authority processing method and device, storage medium and terminal
CN110365756B (en) Access method, electronic device and computer storage medium
CN117667241B (en) Device loading method and device, electronic device and storage medium
CN108990058B (en) Soft SIM and embedded security unit
CN110597543A (en) Intelligent terminal upgrading method, electronic equipment and storage medium
CN114090132A (en) Application program starting method, application program starting device and equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Applicant after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Applicant before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant