[go: up one dir, main page]

WO2016008139A1 - Method and device for installing system of user equipment - Google Patents

Method and device for installing system of user equipment Download PDF

Info

Publication number
WO2016008139A1
WO2016008139A1 PCT/CN2014/082416 CN2014082416W WO2016008139A1 WO 2016008139 A1 WO2016008139 A1 WO 2016008139A1 CN 2014082416 W CN2014082416 W CN 2014082416W WO 2016008139 A1 WO2016008139 A1 WO 2016008139A1
Authority
WO
WIPO (PCT)
Prior art keywords
user equipment
image file
storage space
system image
drive letter
Prior art date
Application number
PCT/CN2014/082416
Other languages
French (fr)
Chinese (zh)
Inventor
余鑫
柯元旦
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2014/082416 priority Critical patent/WO2016008139A1/en
Publication of WO2016008139A1 publication Critical patent/WO2016008139A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/445Program loading or initiating

Definitions

  • Embodiments of the present invention relate to electronic technologies, and in particular, to a system installation method and apparatus for user equipment.
  • intelligent terminals have spread to all aspects of people's lives.
  • the user does not satisfy the functions of the smart terminal when purchasing the smart terminal.
  • SD card Secure Digital Memory Card
  • users may need to brush, that is, replace The system firmware of the phone.
  • the brushing machine can make the intelligent terminal better meet the needs of the user, the brushing machine is a dangerous operation for the intelligent terminal. Once the operation is incorrect, the intelligent terminal is difficult to restore the original system.
  • An existing brush mode is: The user takes out the SD card in the smart terminal, downloads the system recovery installation package to the SD card, and then inserts the SD card into the smart terminal, and finally enters a recovery mode for system recovery. .
  • This method requires the SD card to be inserted and removed, which is troublesome, and if the recovery partition is damaged during the flashing process, the system of the smart terminal cannot be restored.
  • the embodiment of the invention provides a system installation method and device for a user equipment, so as to overcome the cumbersome problem of the recovery operation process of the user equipment system in the prior art.
  • a first aspect of the present invention provides a system installation method for a user equipment, including:
  • the method is applied after the user device enters the bootloader phase and before the system image is loaded.
  • the storage space corresponding to the drive letter is: in a random access memory (RAM) storage;
  • RAM random access memory
  • generating a drive letter corresponding to the user equipment includes:
  • the memory block of the preset size is requested from the RAM, and a drive letter corresponding to the user equipment is generated, and the storage space corresponding to the drive letter is the memory block.
  • the storage space corresponding to the drive letter is: a storage space in a flash (Flash) chip .
  • the system image file is written and After the file partition corresponding to the user equipment, the method further includes:
  • the reading from the storage space corresponding to the drive letter Taking the system image file includes:
  • system image file When the system image file is smaller than the storage space, after the system image file is completely stored to the storage space, the system image file is read from the storage space; When the system image file is larger than the storage space, after the system image file portion is stored to the storage space, the stored system image file is read from the storage space.
  • a second aspect of the present invention provides a user equipment, including:
  • a receiving module configured to receive a boot command, enter a bootloader stage, and a detecting module, configured to detect whether a system triggering command is received;
  • a drive letter generating module if the detecting module detects that the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment
  • a presentation module configured to present the drive letter generated by the drive letter generating module to a computer connected to the user device through a data line, so that the computer displays the drive letter;
  • a storage module configured to receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter;
  • An installation module configured to read the system image file from a storage space corresponding to the drive letter, and write the system image file to a file partition corresponding to the user equipment, to install an operating system of the user equipment .
  • the storage space corresponding to the drive letter is: a storage space in a random access memory (RAM);
  • the drive letter generating module is configured to: if the detecting module detects that the installation system triggering instruction is received, request a memory block of a preset size from the RAM, and generate a corresponding memory device A drive letter; the storage space corresponding to the drive letter is the memory block.
  • the storage space corresponding to the drive letter is: a space in a flash (Flash) chip.
  • the method further includes:
  • a restarting module configured to restart the user equipment after the installation module writes the system image file to a file partition corresponding to the user equipment.
  • the installing module is in the storage corresponding to the drive letter When the system image file is read in space, it is specifically used to:
  • the system image file When the system image file is smaller than the storage space, the system is in the storage module After the system image is completely stored in the storage space, the system image file is read from the storage space;
  • the storage module When the system image file is larger than the storage space, after the storage module stores the system image file portion to the storage space, the stored system image file is read from the storage space. .
  • a third aspect of the present invention provides a user equipment, including: a processor and a memory; the memory stores an execution instruction, and when the user equipment is running, the processor and the memory communicate with each other. Executing the execution instruction by the processor causes the user equipment to perform the method as described in the first aspect or the first to fifth possible implementation manners of the first aspect.
  • the system installation method of the user equipment is applied to the user equipment before loading the system image file, first receiving the boot command, entering the bootloader phase, and secondly detecting whether there is a system trigger command installed, and if so, calling the preset system installation An algorithm, and generating a drive letter corresponding to the user equipment, presenting the generated drive letter to a computer connected to the user equipment through the data line, so that the computer displays the drive letter, and then receiving the storage of the system image file to the corresponding drive letter
  • the storage space instruction stores the system image file to the storage space corresponding to the drive letter, and finally reads the system image file from the storage space corresponding to the drive letter, and writes the system image file to the file partition corresponding to the user device, Install the operating system of the user device.
  • the system image file is stored in the storage space corresponding to the drive letter, and finally the system image file is written to the user equipment to install the operating system of the user equipment, so that the user equipment system is installed.
  • the process is easy to operate.
  • FIG. 1 is a flowchart of a method for restoring a user equipment system according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram 1 of a user equipment according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram 2 of a user equipment according to Embodiment 1 of the present invention.
  • FIG. 4 is a schematic structural diagram of a user equipment according to Embodiment 2 of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the present invention.
  • the user equipment involved in the embodiments of the present invention may include, but is not limited to, a mobile phone, a personal digital assistant (PDA), a wireless handheld device, a wireless netbook, a portable computer, a motion imaging expert. Moving Picture Experts Group Audio Layer III (MP3) Player or Motion Picture Experts Group Audio Layer IV (MP4) player.
  • a mobile phone is taken as an example for description.
  • FIG. 1 is a flowchart of a method for installing a user equipment according to an embodiment of the present invention. As shown in FIG. 1 , the method in this embodiment may include:
  • Step 101 Receive the boot command and enter the bootloader phase.
  • the power-on command can be generally set to an instruction issued by the user after pressing the power button, or can be set as a command issued by the user to press other physical buttons in the user equipment.
  • the embodiment of the present invention does not limit the physical button that issues the power-on command.
  • Step 102 Detect whether an installation system trigger instruction is received.
  • Step 103 If a system trigger command is received, a drive letter corresponding to the user equipment is generated.
  • the user equipment detects whether the installation system triggering instruction is received. After detecting that the installation system triggering instruction is received, the user equipment invokes a system installation algorithm preset in the system, and generates and the user. The drive letter corresponding to the device.
  • the storage space corresponding to the drive letter may be a random access memory (Random Access Memory, RAM for short) or a flash memory (Flash) chip.
  • RAM Random Access Memory
  • flash flash memory
  • the storage space corresponding to the drive letter may be a memory block in the RAM, and after the user equipment receives the installation system trigger instruction, the system installation algorithm is in the RAM. Apply for a memory block and generate a drive letter corresponding to the memory block.
  • the storage space corresponding to the drive letter is a Flash chip, after the user equipment receives the installation system trigger instruction, the system installation algorithm generates a drive letter corresponding to the Flash chip.
  • the user equipment After the user equipment receives the boot command and enters the bootloader phase, if it detects that the installation system trigger command is received, the user equipment does not enter the normal mode, that is, enters the mode of loading the operating system stored in the user equipment, and does not enter recovery (recovery). Mode and fast boot mode, but enter the installation system mode, in which the user device invokes the preset system installation algorithm and executes the system installation algorithm to enable the user device to install the operating system or upgrade the operating system. . It should be noted that, when the user equipment performs the system installation algorithm, the user equipment may perform step 103-step 106 in this embodiment.
  • the installation system triggering command received by the user equipment may be an instruction issued by the user to press any one of the physical buttons of the user equipment, and the physical key of the user equipment may be, for example, a volume increase button or a volume decrease button. .
  • Embodiments of the present invention do not limit how to issue an installation system trigger command.
  • the embodiment of the present invention can be applied to the following scenario: a scenario in which a user device cannot restore the original operating system due to an incorrect operation; or a scenario in which the user upgrades the operating system of the user device.
  • Step 104 Present the generated drive letter to a computer connected to the user equipment through a data line, so that the computer displays the drive letter.
  • the generated disk needs to be generated.
  • the character is presented to the computer such that the system image file is stored in the storage space of the user device corresponding to the drive letter by the drive letter displayed on the computer.
  • a universal serial bus (USB) data line is required to connect the user equipment to the computer.
  • the user equipment and the computer may be connected before the user equipment receives the power-on command, or after the user equipment receives the power-on command, or after the user equipment detects the installation system trigger command.
  • the embodiment of the present invention does not limit the timing of connecting the user equipment to the computer.
  • the computer scans When the USB bus detects that the level changes, that is, the device is inserted, the computer can request the user equipment connected to the USB data line to send the descriptor of the user equipment. When the computer obtains these descriptors, the display interface of the computer can be A drive letter corresponding to the user device is presented.
  • Step 105 Receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter.
  • the user can operate in the computer, and put the system image file into the drive letter presented to the computer.
  • the computer can write the system image file into the The storage space corresponding to the drive letter, gp, the computer sends the system image file to the user equipment, and the user equipment stores the system image file to the storage space corresponding to the drive letter.
  • the system image file may be a system image file corresponding to any version of the operating system that matches the user equipment, gp, and only the hardware configuration of the user equipment is required to support the system image file, for example: when the user equipment is Android operating system, the system image file at this time can be: AndroidBeta, Android 1.0, Android 1.6 and so on. When the hardware of the user equipment supports the Android 1.6 version of the operating system, the system image file can only be any version of the system image file lower than the Android 1.6 version of the operating system.
  • the system image file may be downloaded from the Internet through a computer, or the system image file may be pre-stored in the computer.
  • Step 106 Read the system image file from a storage space corresponding to the drive letter, and write the system image file to a file partition corresponding to the user equipment to install an operating system of the user equipment.
  • the user equipment when the user equipment reads the system image file from the storage space corresponding to the drive letter, and writes the system image file to the file partition corresponding to the user equipment, the stored The system image file is verified to determine if the stored system image file matches the user device.
  • the system installation algorithm checks the stored system image file to determine whether the system image file stored by the user device is legal, whether Whether the malicious system image file matches the hardware configuration of the user device. If the verification result is: The system image file is legal, not a malicious system image file, and matches the hardware configuration of the user device, the system installation algorithm will mirror the system. The file is written to a file partition corresponding to the user equipment, and the file partition is located in the Flash chip. After the system image file is written to the file partition corresponding to the user equipment, the system installation algorithm can control the user equipment to restart, after restarting.
  • the mobile phone first enters the bootloader stage, loads the system image file into the RAM from the Flash chip in the mobile phone, thereby completing the loading process of the operating system, so that the mobile phone displays the interface corresponding to the operating system, so that the user can display according to the The interface performs the corresponding operations and completes the process of installing the operating system of the user device.
  • the file image file corresponding to the user equipment may be written into the system file partition, and the additional application required by the user equipment is written into the data partition.
  • the user equipment may first detect the size of the system image file, if the storage space required by the system image file is greater than the size of the storage space corresponding to the drive letter.
  • ⁇ ⁇ in the process of processing on the side of the transmission, in the process of the user equipment to store the system image file to the storage space corresponding to the drive letter, while storing the stored system image file to the file partition corresponding to the user device
  • the system image file can be completely written into the file partition corresponding to the user device; if the storage space required for the system image file is smaller than the drive letter
  • the size of the corresponding storage space can be stored in the file partition corresponding to the user equipment after the system image file is completely stored in the storage space corresponding to the drive letter.
  • the system installation method of the user equipment provided by the embodiment of the present invention is applied before the user equipment loads the system image file.
  • the user equipment receives the boot command and enters the bootloader phase. If the system trigger command is detected before the system image file is loaded, the preset system installation algorithm may be invoked to generate a drive letter corresponding to the user equipment, and the generated disk is generated.
  • the character is presented to the computer connected to the user equipment through the data line, so that the computer displays the drive letter; then the user equipment receives the system image file sent by the computer, and stores the system image file to the storage space corresponding to the drive letter; The system image file is read from the storage space corresponding to the drive letter, and the system image file is written to the corresponding file partition, so that the operating system corresponding to the system image file can be installed.
  • the user equipment and the computer are connected through a data line, and after the user equipment enters the bootloader stage, and before loading the system image file, the user The device can present the corresponding drive letter to the computer and receive the system image file transmitted by the computer, so that the operating system can be installed through the system image file.
  • the method provided by the embodiment of the present invention can be applied after the user equipment enters the bootloader stage, and before the system image file is loaded, the mobile phone that fails to be flashed, or the mobile phone that is difficult to recover, or the recovery partition is damaged during the brushing process.
  • the mobile phone can be used for system recovery by using the solution provided by the embodiment of the present invention; thus, a reliable system recovery or system installation method is provided.
  • FIG. 2 is a schematic structural diagram of a user equipment according to Embodiment 1 of the present invention. As shown in FIG. 2, the user equipment 200 includes:
  • the receiving module 201 is configured to receive a booting command, and enter a bootloader stage; and the detecting module 202 is configured to detect whether the installation system triggering instruction is received;
  • a drive letter generating module 203 if the detecting module 202 detects that the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment;
  • the presentation module 204 is configured to present the drive letter generated by the drive letter generating module 203 to a computer connected to the user equipment through the data line, so that the computer displays the drive letter;
  • a storage module 205 configured to receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter;
  • the installation module 206 is configured to read the system image file from the storage space corresponding to the drive letter, and write the system image file to the file partition corresponding to the user equipment to install the operation system of the user equipment.
  • the storage space corresponding to the drive letter is: a storage space in the random access memory RAM;
  • the drive letter generating module 203 is specifically configured to: if the detecting module detects that the installation system triggering instruction is received, request a memory block of a preset size from the RAM, and generate a drive letter corresponding to the user equipment; a storage space corresponding to the drive letter For the memory block.
  • the storage space corresponding to the drive letter is: Space in the flash (Flash) chip.
  • the above user equipment 200 may further include:
  • the restarting module 207 is configured to restart the user equipment after the installation module 206 writes the system image file to the file partition corresponding to the user equipment.
  • the installation module 206 is specifically configured to: when the system image file is smaller than the storage space, after the storage module 206 completely stores the system image file to the storage space, the system image file is read from the storage space;
  • the storage module 206 When the system image file is larger than the storage space, after the storage module 206 stores the system image file portion to the storage space, the stored system image file is read from the storage space.
  • the user equipment 200 provided in the embodiment of the present invention may be used to implement the technical solution in the method embodiment shown in FIG. 1.
  • the implementation principle and technical effects are described in the embodiment shown in FIG.
  • the user equipment 300 includes: a processor 301 and a memory 302.
  • the memory stores program instructions.
  • the processor performs storage.
  • the program instructions in the memory are specifically configured to: receive a boot command, and enter a boot loader stage;
  • the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment; presenting the generated drive letter to a computer connected to the user equipment through the data line, so that the computer displays the drive letter;
  • the system image file is read from the storage space corresponding to the drive letter, and the system image file is written to the file partition corresponding to the user device to install the operating system of the user device.
  • the method is applied after the user device enters the boot loader phase and before the system image is loaded.
  • the storage space corresponding to the drive letter is: the storage space in the random access memory RAM; if the installation system trigger instruction is received, generating the drive letter corresponding to the user equipment includes: if receiving the installation system trigger instruction, A memory block of a preset size is requested from the RAM, and a drive letter corresponding to the user equipment is generated, and the storage space corresponding to the drive letter is a memory block.
  • the storage space corresponding to the drive letter is: Storage space in the flash (Flash) chip.
  • the method further includes:
  • reading the system image file from the storage space corresponding to the drive letter includes: When the system image file is smaller than the storage space, after the system image file is completely stored in the storage space, the system image file is read from the storage space. ;
  • the user equipment 300 provided by the embodiment of the present invention may be used to implement the technical solution in the method embodiment shown in FIG. 1.
  • the implementation principle and technical effects are described in the embodiment shown in FIG.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the above-described method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

A method and a device for installing system of user equipment are provided by the embodiment of the present invention. The method and device are applied before the user equipment loads a system image file, first of all, receiving a boot instruction, getting into bootloader phase; second, detecting whether there is a trigger instruction for installing system, if there is, calling a preset algorithm for installing system, and generating letters corresponding to the user equipment, sending the letters to a computer connected to the user equipment via a data line, in order to make the computer display the letters, then receiving a instruction for storing the system image file to storage space corresponding to the letters, and storing the system image file to storage space corresponding to the letters, finally, reading the system image file from the storage space corresponding to the letters, and writing the system image file to file partition corresponding to the user equipment, to install operating system of the user equipment, making the process of installing system of the user equipment easy to operate.

Description

用户设备的系统安装方法和装置  System installation method and device for user equipment
技术领域 Technical field
本发明实施例涉及电子技术, 尤其涉及一种用户设备的系统安装方法和 装置。  Embodiments of the present invention relate to electronic technologies, and in particular, to a system installation method and apparatus for user equipment.
背景技术 Background technique
随着智能终端的发展, 智能终端已普及到人们生活的方方面面。 用户 在使用智能终端时, 已不满足购买智能终端时智能终端所拥有的功能。 为 了能够使用高级程序、 修改系统程序或者把某些程序安装到安全数码卡 ( Secure Digital Memory Card, 简称为: SD卡)上, 从而使智能终端更适 合自己的需求, 用户可能需要刷机, 即更换手机的系统固件。 虽然刷机可 以使智能终端更好的满足用户的需求, 但刷机对智能终端来说是一种危险 的操作, 一旦操作不正确就会导致智能终端难以恢复原来的系统。  With the development of intelligent terminals, intelligent terminals have spread to all aspects of people's lives. When using a smart terminal, the user does not satisfy the functions of the smart terminal when purchasing the smart terminal. In order to be able to use advanced programs, modify system programs, or install certain programs on a Secure Digital Memory Card (SD card), so that the smart terminal is more suitable for your needs, users may need to brush, that is, replace The system firmware of the phone. Although the brushing machine can make the intelligent terminal better meet the needs of the user, the brushing machine is a dangerous operation for the intelligent terminal. Once the operation is incorrect, the intelligent terminal is difficult to restore the original system.
现有的一种刷机模式为: 用户将智能终端中的 SD卡取出, 并将系统 恢复安装包下载到 SD卡上, 然后将 SD卡插入智能终端中, 最后进入恢 复 (recovery ) 模式进行系统恢复。 这种方法需要插拔 SD卡, 比较麻烦, 并且如果在刷机过程中 recovery分区被刷坏, 就无法使得智能终端的系统 进行恢复。 发明内容  An existing brush mode is: The user takes out the SD card in the smart terminal, downloads the system recovery installation package to the SD card, and then inserts the SD card into the smart terminal, and finally enters a recovery mode for system recovery. . This method requires the SD card to be inserted and removed, which is troublesome, and if the recovery partition is damaged during the flashing process, the system of the smart terminal cannot be restored. Summary of the invention
本发明实施例提供一种用户设备的系统安装方法和装置, 以克服现有 技术中用户设备系统恢复操作过程繁琐的问题。  The embodiment of the invention provides a system installation method and device for a user equipment, so as to overcome the cumbersome problem of the recovery operation process of the user equipment system in the prior art.
本发明第一方面提供一种用户设备的系统安装方法, 包括:  A first aspect of the present invention provides a system installation method for a user equipment, including:
接收开机指令, 进入启动加载 (bootloader) 阶段;  Receiving the boot command and entering the bootloader phase;
检测是否接收到安装系统触发指令;  Detecting whether a system trigger command is received;
若接收到所述安装系统触发指令, 则生成与所述用户设备对应的盘 将生成的所述盘符呈现给与所述用户设备通过数据线连接的计算机, 以使所述计算机显示所述盘符; Generating a disk corresponding to the user equipment if the installation system triggering instruction is received And generating the generated drive letter to a computer connected to the user equipment through a data line, so that the computer displays the drive letter;
接收所述计算机发送的系统镜像文件, 并将所述系统镜像文件存储至 所述盘符对应的存储空间;  Receiving a system image file sent by the computer, and storing the system image file to a storage space corresponding to the drive letter;
从所述盘符对应的存储空间中读取所述系统镜像文件, 并将所述系统 镜像文件写入所述用户设备对应的文件分区, 以安装所述用户设备的操作 系统。  And reading the system image file from the storage space corresponding to the drive letter, and writing the system image file to a file partition corresponding to the user equipment to install an operation system of the user equipment.
在第一方面的第一种可能的实现方式中, 所述方法应用于所述用户设 备进入 bootloader阶段之后, 且加载系统镜像之前。  In a first possible implementation of the first aspect, the method is applied after the user device enters the bootloader phase and before the system image is loaded.
结合第一方面或第一方面的第一种可能的实现方式, 在第一方面的第 二种可能的实现方式中, 所述盘符对应的存储空间为: 随机存取存储器 (RAM)中的存储空间;  With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the storage space corresponding to the drive letter is: in a random access memory (RAM) storage;
所述若接收到所述安装系统触发指令, 则生成与所述用户设备对应的 盘符包括:  And if the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment includes:
若接收到所述安装系统触发指令, 则从所述 RAM中申请预设大小的 内存块, 并生成与所述用户设备对应的盘符, 所述盘符对应的存储空间为 所述内存块。  If the installation system triggering instruction is received, the memory block of the preset size is requested from the RAM, and a drive letter corresponding to the user equipment is generated, and the storage space corresponding to the drive letter is the memory block.
结合第一方面或第一方面的第一种可能的实现方式, 在第一方面的第 三种可能的实现方式中, 所述盘符对应的存储空间为: 闪存 (Flash ) 芯片 中的存储空间。  With reference to the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the storage space corresponding to the drive letter is: a storage space in a flash (Flash) chip .
结合第一方面或第一方面的第一至第三种任一种可能的实现方式, 在 第一方面的第四种可能的实现方式中, 所述将所述系统镜像文件写入与所 述用户设备对应的文件分区之后, 还包括:  In combination with the first aspect or the first to the third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the system image file is written and After the file partition corresponding to the user equipment, the method further includes:
重新启动所述用户设备。  Restart the user device.
结合第一方面或第一方面的第一至第四种任一种可能的实现方式, 在 第一方面的第五种可能的实现方式中, 所述从所述盘符对应的存储空间中 读取所述系统镜像文件包括:  With reference to the first aspect, or any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation manner of the first aspect, the reading from the storage space corresponding to the drive letter Taking the system image file includes:
当所述系统镜像文件比所述存储空间小时, 在将所述系统镜像文件完 全存储至所述存储空间之后, 再从所述存储空间中读取所述系统镜像文 件; 当所述系统镜像文件比所述存储空间大时, 在将所述系统镜像文件部 分存储至所述存储空间之后, 从所述存储空间中读取已存储的所述系统镜 像文件。 When the system image file is smaller than the storage space, after the system image file is completely stored to the storage space, the system image file is read from the storage space; When the system image file is larger than the storage space, after the system image file portion is stored to the storage space, the stored system image file is read from the storage space.
本发明第二方面提供一种用户设备, 包括:  A second aspect of the present invention provides a user equipment, including:
接收模块, 用于接收开机指令, 进入启动加载 (bootloader) 阶段; 检测模块, 用于检测是否接收到安装系统触发指令;  a receiving module, configured to receive a boot command, enter a bootloader stage, and a detecting module, configured to detect whether a system triggering command is received;
盘符生成模块, 若所述检测模块检测到接收到安装系统触发指令, 则 生成与所述用户设备对应的盘符;  a drive letter generating module, if the detecting module detects that the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment;
呈现模块, 用于将所述盘符生成模块生成的所述盘符呈现给与所述用 户设备通过数据线连接的计算机, 以使所述计算机显示所述盘符;  a presentation module, configured to present the drive letter generated by the drive letter generating module to a computer connected to the user device through a data line, so that the computer displays the drive letter;
存储模块, 用于接收计算机发送的系统镜像文件, 并将所述系统镜像 文件存储至所述盘符对应的存储空间;  a storage module, configured to receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter;
安装模块, 用于从所述盘符对应的存储空间中读取所述系统镜像文 件, 并将所述系统镜像文件写入所述用户设备对应的文件分区, 以安装所 述用户设备的操作系统。  An installation module, configured to read the system image file from a storage space corresponding to the drive letter, and write the system image file to a file partition corresponding to the user equipment, to install an operating system of the user equipment .
在第二方面的第一种可能的实现方式中, 所述盘符对应的存储空间 为: 随机存取存储器 (RAM ) 中的存储空间;  In a first possible implementation manner of the second aspect, the storage space corresponding to the drive letter is: a storage space in a random access memory (RAM);
所述盘符生成模块, 具体用于: 若所述检测模块检测到接收到所述安 装系统触发指令, 则从所述 RAM中申请预设大小的内存块, 并生成与所 述用户设备对应的盘符; 所述盘符对应的存储空间为所述内存块。  The drive letter generating module is configured to: if the detecting module detects that the installation system triggering instruction is received, request a memory block of a preset size from the RAM, and generate a corresponding memory device A drive letter; the storage space corresponding to the drive letter is the memory block.
在第二方面的第二种可能的实现方式中, 所述盘符对应的存储空间 为: 闪存 (Flash) 芯片中的空间。  In a second possible implementation manner of the second aspect, the storage space corresponding to the drive letter is: a space in a flash (Flash) chip.
结合第二方面或第二方面的第一或第二种可能的实现方式, 在第二方 面的第三种可能的实现方式中, 还包括:  With reference to the second aspect or the first or second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the method further includes:
重启模块, 用于在所述安装模块将所述系统镜像文件写入与所述用户 设备对应的文件分区之后, 重新启动所述用户设备。  And a restarting module, configured to restart the user equipment after the installation module writes the system image file to a file partition corresponding to the user equipment.
结合第二方面或第二方面的第一至第三种任一种可能的实现方式, 在 第二方面的第四种可能的实现方式中, 所述安装模块在从所述盘符对应的 存储空间中读取所述系统镜像文件时, 具体用于:  With reference to the second aspect or the first to the third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the installing module is in the storage corresponding to the drive letter When the system image file is read in space, it is specifically used to:
当所述系统镜像文件比所述存储空间小时, 在所述存储模块将所述系 统镜像文件完全存储至所述存储空间之后, 从所述存储空间中读取所述系 统镜像文件; When the system image file is smaller than the storage space, the system is in the storage module After the system image is completely stored in the storage space, the system image file is read from the storage space;
当所述系统镜像文件比所述存储空间大时, 在所述存储模块将所述系 统镜像文件部分存储至所述存储空间之后, 从所述存储空间中读取已存储 的所述系统镜像文件。  When the system image file is larger than the storage space, after the storage module stores the system image file portion to the storage space, the stored system image file is read from the storage space. .
本发明第三方面提供一种用户设备, 其特征在于, 包括: 处理器和存储 器; 所述存储器存储执行指令, 当所述用户设备运行时, 所述处理器与所述 存储器之间通信, 所述处理器执行所述执行指令使得所述用户设备执行如第 一方面或第一方面的第一至第五种任一种可能实现方式中所述的方法。  A third aspect of the present invention provides a user equipment, including: a processor and a memory; the memory stores an execution instruction, and when the user equipment is running, the processor and the memory communicate with each other. Executing the execution instruction by the processor causes the user equipment to perform the method as described in the first aspect or the first to fifth possible implementation manners of the first aspect.
本发明实施例提供的用户设备的系统安装方法, 应用于用户设备加载 系统镜像文件之前, 首先接收开机指令, 进入 bootloader阶段, 其次检测 是否有安装系统触发指令, 若有, 调用预置的系统安装算法, 并生成与用 户设备对应的盘符, 将生成的盘符呈现给与用户设备通过数据线连接的计 算机, 以使计算机显示所述盘符, 然后接收将系统镜像文件存储至盘符对 应的存储空间的指令, 并将系统镜像文件存储至盘符对应的存储空间, 最 后从盘符对应的存储空间中读取系统镜像文件, 并将系统镜像文件写入至 用户设备对应的文件分区, 以安装用户设备的操作系统。 其中, 通过生成 与用户设备对应的盘符, 并将系统镜像文件存入至盘符对应的存储空间, 最后将系统镜像文件写入用户设备, 以安装用户设备的操作系统, 使得用 户设备系统安装的过程容易操作。 附图说明  The system installation method of the user equipment provided by the embodiment of the present invention is applied to the user equipment before loading the system image file, first receiving the boot command, entering the bootloader phase, and secondly detecting whether there is a system trigger command installed, and if so, calling the preset system installation An algorithm, and generating a drive letter corresponding to the user equipment, presenting the generated drive letter to a computer connected to the user equipment through the data line, so that the computer displays the drive letter, and then receiving the storage of the system image file to the corresponding drive letter The storage space instruction stores the system image file to the storage space corresponding to the drive letter, and finally reads the system image file from the storage space corresponding to the drive letter, and writes the system image file to the file partition corresponding to the user device, Install the operating system of the user device. After the drive letter corresponding to the user equipment is generated, the system image file is stored in the storage space corresponding to the drive letter, and finally the system image file is written to the user equipment to install the operating system of the user equipment, so that the user equipment system is installed. The process is easy to operate. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述 中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是 本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳 动性的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, a brief description of the drawings to be used in the description of the embodiments will be briefly made. It is obvious that the drawings in the following description are some embodiments of the present invention. It will be apparent to those skilled in the art that other drawings may be obtained from these drawings without the inventive labor.
图 1为本发明实施例提供的用户设备系统恢复方法的流程图; 图 2为本发明实施例一提供的用户设备的结构示意图一;  1 is a flowchart of a method for restoring a user equipment system according to an embodiment of the present invention; FIG. 2 is a schematic structural diagram 1 of a user equipment according to Embodiment 1 of the present invention;
图 3为本发明实施例一提供的用户设备的结构示意图二;  3 is a schematic structural diagram 2 of a user equipment according to Embodiment 1 of the present invention;
图 4为本发明实施例二提供的用户设备的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然,所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。 FIG. 4 is a schematic structural diagram of a user equipment according to Embodiment 2 of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. The embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the present invention.
需要说明的是: 本发明各实施例中所涉及的用户设备可以包括但不限 于手机、 个人数字助理 (Personal Digital Assistant, 简称为: PDA) 、 无 线手持设备、 无线上网本、 便携电脑、 动态影像专家压缩标准音频层面 3 ( Moving Picture Experts Group Audio Layer III, 简称为: MP3 ) 播放器或 动态影像专家压缩标准音频层面 4 ( Moving Picture Experts Group Audio Layer IV, 简称: MP4 ) 播放器等。 本发明实施例中以手机为例进行说明。  It should be noted that the user equipment involved in the embodiments of the present invention may include, but is not limited to, a mobile phone, a personal digital assistant (PDA), a wireless handheld device, a wireless netbook, a portable computer, a motion imaging expert. Moving Picture Experts Group Audio Layer III (MP3) Player or Motion Picture Experts Group Audio Layer IV (MP4) player. In the embodiment of the present invention, a mobile phone is taken as an example for description.
图 1为本发明实施例提供的用户设备的系统安装方法的流程图, 如图 1所示, 本实施例的方法可以包括:  FIG. 1 is a flowchart of a method for installing a user equipment according to an embodiment of the present invention. As shown in FIG. 1 , the method in this embodiment may include:
歩骤 101 : 接收开机指令, 进入启动加载 (bootloader) 阶段。  Step 101: Receive the boot command and enter the bootloader phase.
具体的, 在手机接收开机指令之后, 会首先进入 bootloader阶段。 其 中, 开机指令一般可以设置为用户按下电源键后发出的指令, 也可以设置 为用户按下用户设备中其他物理按键所发出的指令, 本发明实施例不对发 出开机指令的物理按键加以限制。  Specifically, after the mobile phone receives the boot command, it will first enter the bootloader phase. The power-on command can be generally set to an instruction issued by the user after pressing the power button, or can be set as a command issued by the user to press other physical buttons in the user equipment. The embodiment of the present invention does not limit the physical button that issues the power-on command.
歩骤 102: 检测是否接收到安装系统触发指令。  Step 102: Detect whether an installation system trigger instruction is received.
歩骤 103 : 若有接收到安装系统触发指令, 则生成与用户设备对应的 盘符。  Step 103: If a system trigger command is received, a drive letter corresponding to the user equipment is generated.
具体的, 在用户设备进入 bootloader阶段后, 用户设备会检测是否接 收到安装系统触发指令, 当检测到接收有安装系统触发指令后, 用户设备 会调用系统中预置的系统安装算法, 生成与用户设备对应的盘符。  Specifically, after the user equipment enters the bootloader phase, the user equipment detects whether the installation system triggering instruction is received. After detecting that the installation system triggering instruction is received, the user equipment invokes a system installation algorithm preset in the system, and generates and the user. The drive letter corresponding to the device.
可选的,盘符对应的存储空间可以为随机存取存储器(Random Access Memory, 简称为: RAM ) 或闪存 (Flash) 芯片。 当盘符对应的存储空间 为 RAM时, 具体的, 该盘符对应的存储空间可以为 RAM中的一个内存 块, 用户设备在接到安装系统触发指令之后, 系统安装算法会在 RAM中 申请一个内存块, 并生成与所述内存块对应的盘符。 当盘符对应的存储空 间为 Flash芯片时, 用户设备在接到安装系统触发指令之后, 系统安装算 法会生成与所述 Flash芯片对应的盘符。 Optionally, the storage space corresponding to the drive letter may be a random access memory (Random Access Memory, RAM for short) or a flash memory (Flash) chip. When the storage space corresponding to the drive letter is RAM, specifically, the storage space corresponding to the drive letter may be a memory block in the RAM, and after the user equipment receives the installation system trigger instruction, the system installation algorithm is in the RAM. Apply for a memory block and generate a drive letter corresponding to the memory block. When the storage space corresponding to the drive letter is a Flash chip, after the user equipment receives the installation system trigger instruction, the system installation algorithm generates a drive letter corresponding to the Flash chip.
在用户设备接收开机指令进入 bootloader阶段之后, 若检测到接收有 安装系统触发指令, 则用户设备不会进入正常模式, 即进入加载用户设备 中存储的操作系统的模式, 也不进入恢复 (recovery ) 模式和快速启动 ( fastboot)模式, 而是进入安装系统模式, 在该模式下, 用户设备会调用 预置的系统安装算法, 并执行系统安装算法, 以使用户设备可以安装操作 系统或者升级操作系统。需要说明的是,用户设备执行该系统安装算法时, 可以是用户设备执行本实施例中的歩骤 103-歩骤 106。  After the user equipment receives the boot command and enters the bootloader phase, if it detects that the installation system trigger command is received, the user equipment does not enter the normal mode, that is, enters the mode of loading the operating system stored in the user equipment, and does not enter recovery (recovery). Mode and fast boot mode, but enter the installation system mode, in which the user device invokes the preset system installation algorithm and executes the system installation algorithm to enable the user device to install the operating system or upgrade the operating system. . It should be noted that, when the user equipment performs the system installation algorithm, the user equipment may perform step 103-step 106 in this embodiment.
其中, 用户设备接收到的安装系统触发指令可以为用户长按用户设备 物理按键中的任何一个按键所发出的指令, 用户设备的物理按键例如可以 为音量增加键、 也可以为音量减小键等。 本发明实施例不对如何发出安装 系统触发指令加以限制。  The installation system triggering command received by the user equipment may be an instruction issued by the user to press any one of the physical buttons of the user equipment, and the physical key of the user equipment may be, for example, a volume increase button or a volume decrease button. . Embodiments of the present invention do not limit how to issue an installation system trigger command.
本发明实施例可以应用于以下场景: 用户由于错误操作而导致用户设 备无法恢复原本的操作系统的场景; 或者, 用户为用户设备的操作系统进 行升级的场景。  The embodiment of the present invention can be applied to the following scenario: a scenario in which a user device cannot restore the original operating system due to an incorrect operation; or a scenario in which the user upgrades the operating system of the user device.
歩骤 104: 将生成的所述盘符呈现给与所述用户设备通过数据线连接 的计算机, 以使所述计算机显示所述盘符。  Step 104: Present the generated drive letter to a computer connected to the user equipment through a data line, so that the computer displays the drive letter.
具体的, 当用户设备中的系统安装算法生成盘符后, 为了可以将与用 户设备对应的系统镜像文件存储至所述盘符对应的用户设备的存储空间 中, 就需要将生成的所述盘符呈现给计算机, 以使系统镜像文件通过在计 算机上显示的盘符存储至与盘符对应的用户设备的存储空间中。  Specifically, after the system installation algorithm in the user equipment generates the drive letter, in order to store the system image file corresponding to the user equipment in the storage space of the user equipment corresponding to the drive letter, the generated disk needs to be generated. The character is presented to the computer such that the system image file is stored in the storage space of the user device corresponding to the drive letter by the drive letter displayed on the computer.
可选的, 为了将用户设备对应的盘符呈现给计算机, 就需要使用通用 串行总线 (Universal Serial Bus , 简称为: USB )数据线将用户设备与计算 机连接起来。 用户设备与计算机可以在用户设备接收开机指令之前连接, 也可以在用户设备接收开机指令之后连接, 还可以在用户设备检测到安装 系统触发指令之后连接。 本发明实施例不对用户设备与计算机连接的时机 加以限制。  Optionally, in order to present the drive letter corresponding to the user equipment to the computer, a universal serial bus (USB) data line is required to connect the user equipment to the computer. The user equipment and the computer may be connected before the user equipment receives the power-on command, or after the user equipment receives the power-on command, or after the user equipment detects the installation system trigger command. The embodiment of the present invention does not limit the timing of connecting the user equipment to the computer.
进一歩的, 当用户设备与计算机通过 USB 数据线连接后, 计算机扫 描 USB 总线检测到电平有变化时, 即获知有设备插入, 计算机可以要求 与 USB 数据线连接的用户设备发送该用户设备的描述符, 当计算机得到 这些描述符后, 计算机的显示界面上可以呈现与用户设备对应的盘符。 Further, when the user device and the computer are connected through the USB data cable, the computer scans When the USB bus detects that the level changes, that is, the device is inserted, the computer can request the user equipment connected to the USB data line to send the descriptor of the user equipment. When the computer obtains these descriptors, the display interface of the computer can be A drive letter corresponding to the user device is presented.
歩骤 105 : 接收计算机发送的系统镜像文件, 并将所述系统镜像文件 存储至所述盘符对应的存储空间。  Step 105: Receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter.
可选的, 当用户设备将盘符呈现给计算机后, 用户可以在计算机中操 作, 将系统镜像文件放入呈现给计算机的盘符内, 此时, 计算机可以将该 系统镜像文件写入所述盘符对应的存储空间, gp, 计算机将该系统镜像文 件发送给用户设备, 用户设备将该系统镜像文件存储至所述盘符对应的存 储空间。  Optionally, after the user equipment presents the drive letter to the computer, the user can operate in the computer, and put the system image file into the drive letter presented to the computer. At this time, the computer can write the system image file into the The storage space corresponding to the drive letter, gp, the computer sends the system image file to the user equipment, and the user equipment stores the system image file to the storage space corresponding to the drive letter.
其中, 系统镜像文件可以为与用户设备匹配的任何一个版本的操作系 统对应的系统镜像文件, gp, 只需要所述用户设备的硬件配置支持所述系 统镜像文件即可, 例如: 当用户设备为安卓操作系统, 此时的系统镜像文 件可以为: AndroidBeta, Android 1.0、 Android 1.6等。 而当用户设备的硬 件最高支持 Android 1.6版本的操作系统, 所述系统镜像文件就只能是比 Android 1.6版本的操作系统低的任何一个版本的系统镜像文件。  The system image file may be a system image file corresponding to any version of the operating system that matches the user equipment, gp, and only the hardware configuration of the user equipment is required to support the system image file, for example: when the user equipment is Android operating system, the system image file at this time can be: AndroidBeta, Android 1.0, Android 1.6 and so on. When the hardware of the user equipment supports the Android 1.6 version of the operating system, the system image file can only be any version of the system image file lower than the Android 1.6 version of the operating system.
所述系统镜像文件可以通过计算机从互联网下载, 或者所述系统镜像 文件可以是预先存储在计算机中的。  The system image file may be downloaded from the Internet through a computer, or the system image file may be pre-stored in the computer.
歩骤 106: 从所述盘符对应的存储空间中读取所述系统镜像文件, 并 将所述系统镜像文件写入所述用户设备对应的文件分区, 以安装所述用户 设备的操作系统。  Step 106: Read the system image file from a storage space corresponding to the drive letter, and write the system image file to a file partition corresponding to the user equipment to install an operating system of the user equipment.
可选的, 当用户设备从所述盘符对应的存储空间中读取所述系统镜像 文件, 并将所述系统镜像文件写入至所述用户设备对应的文件分区之前, 会对所存储的系统镜像文件进行校验, 以确定所存储的系统镜像文件是否 与用户设备匹配。  Optionally, when the user equipment reads the system image file from the storage space corresponding to the drive letter, and writes the system image file to the file partition corresponding to the user equipment, the stored The system image file is verified to determine if the stored system image file matches the user device.
具体的, 当用户设备将系统镜像文件存入盘符对应的存储空间后, 系 统安装算法会对所存储的系统镜像文件进行校验, 以确定用户设备所存储 的系统镜像文件是否合法, 是否为恶意系统镜像文件, 是否与与用户设备 的硬件配置匹配, 若校验结果为: 所述系统镜像文件合法, 不是恶意系统 镜像文件, 并且与用户设备的硬件配置匹配, 系统安装算法会将系统镜像 文件写入与用户设备对应的文件分区, 所述文件分区位于 Flash芯片中, 当将系统镜像文件写入与用户设备对应的文件分区完成后, 系统安装算法 可以控制用户设备重新启动, 在重启的过程中, 手机首先进入 bootloader 阶段, 从手机中的 Flash芯片中将系统镜像文件加载到 RAM中运行, 从 而完成操作系统的加载过程, 以使手机显示操作系统对应的界面, 使得用 户可以根据显示的界面执行相应的操作, 完成了安装用户设备的操作系统 的过程。 Specifically, after the user equipment stores the system image file in the storage space corresponding to the drive letter, the system installation algorithm checks the stored system image file to determine whether the system image file stored by the user device is legal, whether Whether the malicious system image file matches the hardware configuration of the user device. If the verification result is: The system image file is legal, not a malicious system image file, and matches the hardware configuration of the user device, the system installation algorithm will mirror the system. The file is written to a file partition corresponding to the user equipment, and the file partition is located in the Flash chip. After the system image file is written to the file partition corresponding to the user equipment, the system installation algorithm can control the user equipment to restart, after restarting. In the process, the mobile phone first enters the bootloader stage, loads the system image file into the RAM from the Flash chip in the mobile phone, thereby completing the loading process of the operating system, so that the mobile phone displays the interface corresponding to the operating system, so that the user can display according to the The interface performs the corresponding operations and completes the process of installing the operating system of the user device.
其中, 将系统镜像文件写入与用户设备对应的文件分区可以为, 将用 户设备操作系统所需的程序写入系统文件分区, 将用户设备所需的附加的 应用程序写入数据分区等。  The file image file corresponding to the user equipment may be written into the system file partition, and the additional application required by the user equipment is written into the data partition.
可选的, 用户设备在将系统镜像文件存储至盘符对应的存储空间之 前, 可以首先检测所述系统镜像文件的大小, 若系统镜像文件所需的存储 空间大于盘符对应的存储空间的大小, 则采用边传输边处理的方案, §卩, 在用户设备将系统镜像文件存储至盘符对应的存储空间的过程中, 一边存 储一边将存储的系统镜像文件写入与用户设备对应的文件分区, 存储结束 (即系统镜像文件完全传输至盘符对应的存储空间时) 的时候系统镜像文 件可以完全被写入与用户设备对应的文件分区中; 若系统镜像文件所需的 存储空间小于盘符对应的存储空间的大小, 则可以等系统镜像文件完全存 储至盘符对应的存储空间之后, 再将系统镜像文件写入与用户设备对应的 文件分区中。  Optionally, before storing the system image file in the storage space corresponding to the drive letter, the user equipment may first detect the size of the system image file, if the storage space required by the system image file is greater than the size of the storage space corresponding to the drive letter. , in the process of processing on the side of the transmission, § 卩, in the process of the user equipment to store the system image file to the storage space corresponding to the drive letter, while storing the stored system image file to the file partition corresponding to the user device When the storage ends (that is, when the system image file is completely transferred to the storage space corresponding to the drive letter), the system image file can be completely written into the file partition corresponding to the user device; if the storage space required for the system image file is smaller than the drive letter The size of the corresponding storage space can be stored in the file partition corresponding to the user equipment after the system image file is completely stored in the storage space corresponding to the drive letter.
本发明实施例提供的用户设备的系统安装方法, 应用于用户设备加载 系统镜像文件之前。 首先用户设备接收开机指令, 进入 bootloader阶段; 在加载系统镜像文件之前, 若检测到安装系统触发指令, 则可以调用预置 的系统安装算法, 生成与用户设备对应的盘符, 并将生成的盘符呈现给与 用户设备通过数据线连接的计算机, 以使计算机显示所述盘符; 然后用户 设备接收计算机发送的系统镜像文件, 并将系统镜像文件存储至盘符对应 的存储空间; 最后用户设备从盘符对应的存储空间中读取系统镜像文件, 并将系统镜像文件写入对应的文件分区, 以便可以安装系统镜像文件对应 的操作系统。其中, 本发明实施例中, 用户设备和计算机通过数据线连接, 用户设备在进入 bootloader阶段之后, 且在加载系统镜像文件之前, 用户 设备可以将对应的盘符呈现给计算机, 并接收计算机传输的系统镜像文 件, 从而可以通过该系统镜像文件实现操作系统的安装。 由此使得用户设 备的系统安装过程容易操作。 并且, 由于本发明实施例提供的方法可以应 用在用户设备进入 bootloader阶段之后, 且在加载系统镜像文件之前, 所 以对于刷机失败的手机, 或者系统难以恢复的手机, 或者刷机过程中 recovery分区被损坏的手机, 均可以利用本发明实施例提供的方案进行系 统恢复; 由此提供了一种可靠的系统恢复或系统安装方法。 The system installation method of the user equipment provided by the embodiment of the present invention is applied before the user equipment loads the system image file. First, the user equipment receives the boot command and enters the bootloader phase. If the system trigger command is detected before the system image file is loaded, the preset system installation algorithm may be invoked to generate a drive letter corresponding to the user equipment, and the generated disk is generated. The character is presented to the computer connected to the user equipment through the data line, so that the computer displays the drive letter; then the user equipment receives the system image file sent by the computer, and stores the system image file to the storage space corresponding to the drive letter; The system image file is read from the storage space corresponding to the drive letter, and the system image file is written to the corresponding file partition, so that the operating system corresponding to the system image file can be installed. In the embodiment of the present invention, the user equipment and the computer are connected through a data line, and after the user equipment enters the bootloader stage, and before loading the system image file, the user The device can present the corresponding drive letter to the computer and receive the system image file transmitted by the computer, so that the operating system can be installed through the system image file. This makes the system installation process of the user equipment easy to operate. Moreover, since the method provided by the embodiment of the present invention can be applied after the user equipment enters the bootloader stage, and before the system image file is loaded, the mobile phone that fails to be flashed, or the mobile phone that is difficult to recover, or the recovery partition is damaged during the brushing process. The mobile phone can be used for system recovery by using the solution provided by the embodiment of the present invention; thus, a reliable system recovery or system installation method is provided.
图 2为本发明实施例一提供的用户设备的结构示意图,如图 2所示, 该 用户设备 200包括:  FIG. 2 is a schematic structural diagram of a user equipment according to Embodiment 1 of the present invention. As shown in FIG. 2, the user equipment 200 includes:
接收模块 201, 用于接收开机指令, 进入启动加载 bootloader阶段; 检测模块 202, 用于检测是否接收到安装系统触发指令;  The receiving module 201 is configured to receive a booting command, and enter a bootloader stage; and the detecting module 202 is configured to detect whether the installation system triggering instruction is received;
盘符生成模块 203,若检测模块 202检测到接收到安装系统触发指令, 则生成与用户设备对应的盘符;  a drive letter generating module 203, if the detecting module 202 detects that the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment;
呈现模块 204, 用于将盘符生成模块 203生成的盘符呈现给与用户设 备通过数据线连接的计算机, 以使计算机显示盘符;  The presentation module 204 is configured to present the drive letter generated by the drive letter generating module 203 to a computer connected to the user equipment through the data line, so that the computer displays the drive letter;
存储模块 205, 用于接收所述计算机发送的系统镜像文件, 并将系统 镜像文件存储至盘符对应的存储空间;  a storage module 205, configured to receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter;
安装模块 206, 用于从盘符对应的存储空间中读取系统镜像文件, 并 将系统镜像文件写入用户设备对应的文件分区, 以安装用户设备的操作系 统。  The installation module 206 is configured to read the system image file from the storage space corresponding to the drive letter, and write the system image file to the file partition corresponding to the user equipment to install the operation system of the user equipment.
可选的, 盘符对应的存储空间为: 随机存取存储器 RAM中的存储空 间;  Optionally, the storage space corresponding to the drive letter is: a storage space in the random access memory RAM;
盘符生成模块 203, 具体用于: 若检测模块检测到接收到安装系统触 发指令, 则从 RAM中申请预设大小的内存块, 并生成与用户设备对应的 盘符; 盘符对应的存储空间为内存块。  The drive letter generating module 203 is specifically configured to: if the detecting module detects that the installation system triggering instruction is received, request a memory block of a preset size from the RAM, and generate a drive letter corresponding to the user equipment; a storage space corresponding to the drive letter For the memory block.
可选的, 盘符对应的存储空间为: 闪存 (Flash) 芯片中的空间。  Optionally, the storage space corresponding to the drive letter is: Space in the flash (Flash) chip.
进一歩的, 如图 3所示, 对于上述用户设备 200, 其还可以进一歩的包 括:  Further, as shown in FIG. 3, for the above user equipment 200, it may further include:
重启模块 207, 用于在安装模块 206将系统镜像文件写入与用户设备 对应的文件分区之后, 重新启动用户设备。 可选的, 安装模块 206具体用于: 当系统镜像文件比存储空间小时, 在存储模块 206将系统镜像文件完全存储至存储空间之后, 从存储空间中 读取系统镜像文件; The restarting module 207 is configured to restart the user equipment after the installation module 206 writes the system image file to the file partition corresponding to the user equipment. Optionally, the installation module 206 is specifically configured to: when the system image file is smaller than the storage space, after the storage module 206 completely stores the system image file to the storage space, the system image file is read from the storage space;
当系统镜像文件比存储空间大时, 在存储模块 206将系统镜像文件部 分存储至存储空间之后, 从存储空间中读取已存储的系统镜像文件。  When the system image file is larger than the storage space, after the storage module 206 stores the system image file portion to the storage space, the stored system image file is read from the storage space.
本发明实施例提供的用户设备 200, 可用于执行图 1所示的方法实施 例中的技术方案, 其实现原理和技术效果参见图 1所示实施例中的描述, 不再赘述。  The user equipment 200 provided in the embodiment of the present invention may be used to implement the technical solution in the method embodiment shown in FIG. 1. The implementation principle and technical effects are described in the embodiment shown in FIG.
图 4为本发明实施例二提供的用户设备的结构示意图, 如图 4所示, 该 用户设备 300包括: 处理器 301和存储器 302; 存储器存储程序指令, 当用 户设备运行时, 处理器执行存储在所述存储器中的程序指令, 具体用于执行: 接收开机指令, 进入启动加载 boot loader阶段;  4 is a schematic structural diagram of a user equipment according to Embodiment 2 of the present invention. As shown in FIG. 4, the user equipment 300 includes: a processor 301 and a memory 302. The memory stores program instructions. When the user equipment is running, the processor performs storage. The program instructions in the memory are specifically configured to: receive a boot command, and enter a boot loader stage;
检测是否接收到安装系统触发指令;  Detecting whether a system trigger command is received;
若接收到安装系统触发指令, 则生成与用户设备对应的盘符; 将生成的盘符呈现给与用户设备通过数据线连接的计算机, 以使计算 机显示盘符;  If the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment; presenting the generated drive letter to a computer connected to the user equipment through the data line, so that the computer displays the drive letter;
接收计算机发送的系统镜像文件, 并将系统镜像文件存储至盘符对应 的存储空间;  Receiving a system image file sent by the computer, and storing the system image file to a storage space corresponding to the drive letter;
从盘符对应的存储空间中读取系统镜像文件, 并将系统镜像文件写入 用户设备对应的文件分区, 以安装用户设备的操作系统。  The system image file is read from the storage space corresponding to the drive letter, and the system image file is written to the file partition corresponding to the user device to install the operating system of the user device.
可选的, 方法应用于用户设备进入 boot loader 阶段之后, 且加载系 统镜像之前。  Optionally, the method is applied after the user device enters the boot loader phase and before the system image is loaded.
可选的,盘符对应的存储空间为:随机存取存储器 RAM中的存储空间; 若接收到安装系统触发指令, 则生成与用户设备对应的盘符包括: 若接收到安装系统触发指令, 则从 RAM中申请预设大小的内存块, 并 生成与用户设备对应的盘符, 盘符对应的存储空间为内存块。  Optionally, the storage space corresponding to the drive letter is: the storage space in the random access memory RAM; if the installation system trigger instruction is received, generating the drive letter corresponding to the user equipment includes: if receiving the installation system trigger instruction, A memory block of a preset size is requested from the RAM, and a drive letter corresponding to the user equipment is generated, and the storage space corresponding to the drive letter is a memory block.
可选的, 盘符对应的存储空间为: 闪存 (Flash) 芯片中的存储空间。 进一歩的, 将系统镜像文件写入与用户设备对应的文件分区之后, 还 包括:  Optionally, the storage space corresponding to the drive letter is: Storage space in the flash (Flash) chip. Further, after the system image file is written to the file partition corresponding to the user equipment, the method further includes:
重新启动用户设备。 进一歩的, 从盘符对应的存储空间中读取系统镜像文件包括: 当系统镜像文件比存储空间小时, 在将系统镜像文件完全存储至存储 空间之后, 再从存储空间中读取系统镜像文件; Restart the user device. Further, reading the system image file from the storage space corresponding to the drive letter includes: When the system image file is smaller than the storage space, after the system image file is completely stored in the storage space, the system image file is read from the storage space. ;
当系统镜像文件比存储空间大时, 在将系统镜像文件部分存储至存储 空间之后, 从存储空间中读取已存储的系统镜像文件。  When the system image file is larger than the storage space, after the system image file portion is stored to the storage space, the stored system image file is read from the storage space.
本发明实施例提供的用户设备 300, 可用于执行图 1所示的方法实施 例中的技术方案, 其实现原理和技术效果参见图 1所示实施例中的描述, 不再赘述。  The user equipment 300 provided by the embodiment of the present invention may be used to implement the technical solution in the method embodiment shown in FIG. 1. The implementation principle and technical effects are described in the embodiment shown in FIG.
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分 歩骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算 机可读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的歩 骤; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存 储程序代码的介质。  One of ordinary skill in the art will appreciate that all or a portion of the steps of implementing the various method embodiments described above can be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the above-described method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围。  Finally, it should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting thereof; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.

Claims

权 利 要 求 书 Claim
1、 一种用户设备的系统安装方法, 其特征在于, 包括: A system installation method for a user equipment, comprising:
接收开机指令, 进入启动加载 boot loader阶段;  Receiving the boot command, entering the boot loader stage;
检测是否接收到安装系统触发指令;  Detecting whether a system trigger command is received;
若接收到所述安装系统触发指令, 则生成与所述用户设备对应的盘 符;  And if the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment;
将生成的所述盘符呈现给与所述用户设备通过数据线连接的计算机, 以使所述计算机显示所述盘符;  And generating the generated drive letter to a computer connected to the user equipment through a data line, so that the computer displays the drive letter;
接收所述计算机发送的系统镜像文件, 并将所述系统镜像文件存储至 所述盘符对应的存储空间;  Receiving a system image file sent by the computer, and storing the system image file to a storage space corresponding to the drive letter;
从所述盘符对应的存储空间中读取所述系统镜像文件, 并将所述系统 镜像文件写入所述用户设备对应的文件分区, 以安装所述用户设备的操作 系统。  And reading the system image file from the storage space corresponding to the drive letter, and writing the system image file to a file partition corresponding to the user equipment to install an operation system of the user equipment.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述方法应用于所述 用户设备加载系统镜像之前。  2. The method according to claim 1, wherein the method is applied before the user equipment loads the system image.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述盘符对应的 存储空间为: 随机存取存储器 RAM中的存储空间;  The method according to claim 1 or 2, wherein the storage space corresponding to the drive letter is: a storage space in the random access memory RAM;
所述若接收到所述安装系统触发指令, 则生成与所述用户设备对应的 盘符包括:  And if the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment includes:
若接收到所述安装系统触发指令, 则从所述 RAM中申请预设大小的内 存块, 并生成与所述用户设备对应的盘符, 所述盘符对应的存储空间为所 述内存块。  And if the installation system triggering instruction is received, applying a preset size memory block from the RAM, and generating a drive letter corresponding to the user equipment, where the storage space corresponding to the drive letter is the memory block.
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述盘符对应的 存储空间为: 闪存 Flash芯片中的存储空间。  The method according to claim 1 or 2, wherein the storage space corresponding to the drive letter is: a storage space in the flash memory chip.
5、 根据权利要求 1-4任一项所述的方法, 其特征在于, 所述将所述 系统镜像文件写入与所述用户设备对应的文件分区之后, 还包括:  The method according to any one of claims 1-4, wherein after the writing the system image file to the file partition corresponding to the user equipment, the method further includes:
重新启动所述用户设备。  Restart the user device.
6、 根据权利要求 1-5任一项所述的方法, 其特征在于, 所述从所述 盘符对应的存储空间中读取所述系统镜像文件包括:  The method according to any one of claims 1-5, wherein the reading the system image file from the storage space corresponding to the drive letter comprises:
当所述系统镜像文件比所述存储空间小时, 在将所述系统镜像文件完 全存储至所述存储空间之后, 再从所述存储空间中读取所述系统镜像文 件; When the system image file is smaller than the storage space, after the system image file is finished After all storage to the storage space, the system image file is read from the storage space;
当所述系统镜像文件比所述存储空间大时, 在将所述系统镜像文件部 分存储至所述存储空间之后, 从所述存储空间中读取已存储的所述系统镜 像文件。  When the system image file is larger than the storage space, the stored system image file is read from the storage space after the system image file portion is stored to the storage space.
7、 一种用户设备, 其特征在于, 包括:  7. A user equipment, comprising:
接收模块, 用于接收开机指令, 进入启动加载 boot loader阶段; 检测模块, 用于检测是否接收到安装系统触发指令;  a receiving module, configured to receive a boot command, enter a boot loader phase; and a detection module, configured to detect whether a system trigger command is received;
盘符生成模块, 若所述检测模块检测到接收到安装系统触发指令, 则 生成与所述用户设备对应的盘符;  a drive letter generating module, if the detecting module detects that the installation system triggering instruction is received, generating a drive letter corresponding to the user equipment;
呈现模块, 用于将所述盘符生成模块生成的所述盘符呈现给与所述用 户设备通过数据线连接的计算机, 以使所述计算机显示所述盘符;  a presentation module, configured to present the drive letter generated by the drive letter generating module to a computer connected to the user device through a data line, so that the computer displays the drive letter;
存储模块, 用于接收所述计算机发送的系统镜像文件, 并将所述系统 镜像文件存储至所述盘符对应的存储空间;  a storage module, configured to receive a system image file sent by the computer, and store the system image file to a storage space corresponding to the drive letter;
安装模块, 用于从所述盘符对应的存储空间中读取所述系统镜像文 件, 并将所述系统镜像文件写入所述用户设备对应的文件分区, 以安装所 述用户设备的操作系统。  An installation module, configured to read the system image file from a storage space corresponding to the drive letter, and write the system image file to a file partition corresponding to the user equipment, to install an operating system of the user equipment .
8、 根据权利要求 7所述的用户设备, 其特征在于, 所述盘符对应的 存储空间为: 随机存取存储器 RAM中的存储空间;  The user equipment according to claim 7, wherein the storage space corresponding to the drive letter is: a storage space in the random access memory RAM;
所述盘符生成模块, 具体用于: 若所述检测模块检测到接收到所述安 装系统触发指令, 则从所述 RAM中申请预设大小的内存块, 并生成与所述 用户设备对应的盘符; 所述盘符对应的存储空间为所述内存块。  The drive letter generating module is configured to: if the detecting module detects that the installation system triggering instruction is received, request a memory block of a preset size from the RAM, and generate a corresponding memory device A drive letter; the storage space corresponding to the drive letter is the memory block.
9、 根据权利要求 7所述的用户设备, 其特征在于, 所述盘符对应的 存储空间为: 闪存 flash芯片中的空间。  The user equipment according to claim 7, wherein the storage space corresponding to the drive letter is: a space in the flash memory chip.
10、根据权利要求 7-9任一项所述的用户设备, 其特征在于, 还包括: 重启模块, 用于在所述安装模块将所述系统镜像文件写入与所述用户 设备对应的文件分区之后, 重新启动所述用户设备。  The user equipment according to any one of claims 7-9, further comprising: a restarting module, configured to write, in the installation module, the system image file to a file corresponding to the user equipment After partitioning, the user device is restarted.
11、 根据权利要求 7- 10任一项所述的用户设备, 其特征在于, 所述 安装模块在从所述盘符对应的存储空间中读取所述系统镜像文件时, 具体 用于: 当所述系统镜像文件比所述存储空间小时, 在所述存储模块将所述系 统镜像文件完全存储至所述存储空间之后, 从所述存储空间中读取所述系 统镜像文件; The user equipment according to any one of claims 7 to 10, wherein the installation module is configured to: when the system image file is read from a storage space corresponding to the drive letter, When the system image file is smaller than the storage space, after the storage module completely stores the system image file to the storage space, the system image file is read from the storage space;
当所述系统镜像文件比所述存储空间大时, 在所述存储模块将所述系 统镜像文件部分存储至所述存储空间之后, 从所述存储空间中读取已存储 的所述系统镜像文件。  When the system image file is larger than the storage space, after the storage module stores the system image file portion to the storage space, the stored system image file is read from the storage space. .
12、 一种用户设备, 其特征在于, 包括: 处理器和存储器; 所述存储器 存储程序指令, 当所述用户设备运行时, 所述处理器执行存储在所述存储器 中的程序指令使得所述用户设备执行如权利要求 1~6任一项所述的方法。  12. A user equipment, comprising: a processor and a memory; the memory storing program instructions, when the user equipment is running, the processor executing program instructions stored in the memory to cause the The user equipment performs the method of any one of claims 1 to 6.
PCT/CN2014/082416 2014-07-17 2014-07-17 Method and device for installing system of user equipment WO2016008139A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/082416 WO2016008139A1 (en) 2014-07-17 2014-07-17 Method and device for installing system of user equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/082416 WO2016008139A1 (en) 2014-07-17 2014-07-17 Method and device for installing system of user equipment

Publications (1)

Publication Number Publication Date
WO2016008139A1 true WO2016008139A1 (en) 2016-01-21

Family

ID=55077832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082416 WO2016008139A1 (en) 2014-07-17 2014-07-17 Method and device for installing system of user equipment

Country Status (1)

Country Link
WO (1) WO2016008139A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485736A (en) * 2021-06-17 2021-10-08 厦门亿联网络技术股份有限公司 System incremental updating method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060242395A1 (en) * 2005-03-09 2006-10-26 Wyse Technology Inc. Operating system boot from network location
US20090249332A1 (en) * 2008-03-28 2009-10-01 International Business Machines Corporation Method and a computing device
CN102752364A (en) * 2012-05-22 2012-10-24 华为终端有限公司 Data transmission method and device
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment
CN103246527A (en) * 2012-02-07 2013-08-14 腾讯科技(深圳)有限公司 Mobile terminal operating system updating method and system and computer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060242395A1 (en) * 2005-03-09 2006-10-26 Wyse Technology Inc. Operating system boot from network location
US20090249332A1 (en) * 2008-03-28 2009-10-01 International Business Machines Corporation Method and a computing device
CN103246527A (en) * 2012-02-07 2013-08-14 腾讯科技(深圳)有限公司 Mobile terminal operating system updating method and system and computer
CN102752364A (en) * 2012-05-22 2012-10-24 华为终端有限公司 Data transmission method and device
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485736A (en) * 2021-06-17 2021-10-08 厦门亿联网络技术股份有限公司 System incremental updating method and device
CN113485736B (en) * 2021-06-17 2024-05-07 厦门亿联网络技术股份有限公司 System increment updating method and device

Similar Documents

Publication Publication Date Title
WO2017067448A1 (en) Firmware-over-the-air upgrade method, system and computer storage medium
CN105138347A (en) A differential upgrade package generation method, software upgrade method and corresponding device
CN102945176B (en) Method and device for starting and upgrading terminal equipment
WO2019062635A1 (en) Update method and device
CN114341800B (en) Method and apparatus for improving runtime performance after application update in an electronic device
CN115328563B (en) System startup method and electronic device
WO2014194865A1 (en) Firmware upgrade method and apparatus, and communication device
US10628588B2 (en) Information processing apparatus and computer readable storage medium
US9891862B2 (en) Forensic data acquisition apparatus and method for guaranteeing integrity of flash memory in smart device
CN109375937A (en) System upgrading method and device, terminal equipment and storage medium
WO2018032757A1 (en) Method and device for updating component
CN102646043A (en) Mobile terminal software upgrading method, upgrading device and mobile terminal
US20130227262A1 (en) Authentication device and authentication method
CN106528347B (en) A data backup method and mobile terminal
CN116266467A (en) Memory device with secure boot update and auto-restore
CN104285210A (en) Method, device and system for restoring operating system on portable communication device
KR20150087177A (en) Operating system recovery method and apparatus, and terminal device
CN115951949A (en) Method, device and computing device for recovering configuration parameters of BIOS
CN107145282A (en) The brush machine method and apparatus of smart machine based on Android operation system
WO2012031474A1 (en) Method and device for starting up terminal equipment
WO2013167010A2 (en) Mobile terminal and startup method therefor
CN114090045B (en) A firmware upgrade method and related equipment applied to multi-chip microcomputer control system
WO2018049798A1 (en) Method and apparatus for reconstructing cache partition
WO2018014687A1 (en) Parameter passing method and apparatus, and computer storage medium
CN111381892B (en) Data processing method, device, equipment and machine-readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14897611

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14897611

Country of ref document: EP

Kind code of ref document: A1