WO2018145392A1 - 差分升级方法及装置、终端、存储介质、处理器 - Google Patents
差分升级方法及装置、终端、存储介质、处理器 Download PDFInfo
- Publication number
- WO2018145392A1 WO2018145392A1 PCT/CN2017/090082 CN2017090082W WO2018145392A1 WO 2018145392 A1 WO2018145392 A1 WO 2018145392A1 CN 2017090082 W CN2017090082 W CN 2017090082W WO 2018145392 A1 WO2018145392 A1 WO 2018145392A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- version
- partition
- size
- space
- adjacent
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/658—Incremental updates; Differential updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present invention relates to the field of communications, and in particular to a differential upgrade method and apparatus, a terminal, a storage medium, and a processor.
- differential upgrade technology has been widely applied to system version upgrades of mobile terminals.
- the differential upgrade package is small and is delivered from the server through an air interface. It can quickly upgrade the system version of the terminal system partition that has not changed. Now, the system version is constantly optimized, and new applications are added. If the new version upgraded by the differential upgrade on the old system version is larger than the size of the loaded version partition, the differential upgrade will fail. It is common in system version upgrades of non-intelligent products such as function machines, data cards, and routers, especially in small memory (memory). In this case, the current processing method is to set a threshold of the size of the differential packet. If the differential packet is larger than the threshold, the differential upgrade of the system version is not performed, and the upgrade fails.
- the embodiment of the present invention provides a differential upgrade method and device, a terminal, a storage medium, and a processor, so as to solve at least the problem that the version partition size in the related art is insufficient to cause the system version upgrade to fail.
- a differential upgrade method including: acquiring a size of a remaining space in a version partition in a terminal; determining whether a difference between a size of the remaining space and a size of the differential upgrade packet is less than a first predetermined threshold; If the result is less than the first predetermined threshold, the version partition is expanded; the number of versions after the system version is upgraded according to the differential upgrade package It is written in the version partition after the expansion.
- the difference between the size of the expanded version partition and the size of the unexpanded version partition is greater than or equal to the size of the differential upgrade package.
- expanding the version partition includes: determining whether a remaining space of the adjacent partition adjacent to the version partition is greater than a second predetermined threshold; and if the determination result is greater than a second predetermined threshold, the neighboring The predetermined space in the partition is borrowed to the version partition; wherein the predetermined space is greater than or equal to the size of the differential upgrade package.
- borrowing the predetermined space in the adjacent partition to the version partition includes: moving the data in the adjacent partition by a predetermined distance in a direction away from the version partition; and corresponding to the predetermined distance remaining in the adjacent partition The space is allocated to the version partition; wherein the size of the space corresponding to the predetermined distance is a predetermined space.
- the method further includes: backing up the original boot load file in the partition storing the boot load file, and obtaining the backup boot load file; and the address information of the expanded version partition and The address information of the moved adjacent partition is updated to the backup boot file to obtain the updated boot load file.
- the method further includes: deleting the original startup load file; using the updated startup load file, loading System Files.
- a differential upgrade apparatus including: an acquisition module configured to acquire a size of a remaining space in a version partition in a terminal; and a determination module configured to determine a size of the remaining space and a size of the differential upgrade package. Whether the difference is smaller than the first predetermined threshold; the expansion module is configured to expand the version partition if the determination result is less than the first predetermined threshold; and the writing module is configured to upgrade the system version according to the differential upgrade package The version data is written to the expanded version partition.
- the expansion module is further configured to determine whether a remaining space of the adjacent partition adjacent to the version partition is greater than a second predetermined threshold; and if the determination result is greater than a second predetermined threshold, the adjacent The reserved space in the partition is borrowed to the version partition; wherein, the reservation is empty The greater than or equal to the size of the differential upgrade package.
- the expansion module is further configured to: move the data in the adjacent partitions by a predetermined distance in a direction away from the version partition; and allocate a space corresponding to the predetermined distance remaining in the adjacent partitions to the version partition; The size of the space corresponding to the predetermined distance is a predetermined space.
- the device further includes: a backup module, configured to back up the original boot load file in the partition storing the boot load file to obtain the backup boot load file; and the update module is set to partition the expanded version. The address information and the address information of the moved neighboring partition are updated to the backup boot file to obtain the updated boot load file.
- a terminal including: a processor, configured to acquire a size of a remaining space in a version partition in a terminal, where the version partition is used to store version data of a system version; and determine a remaining space size and Whether the difference between the sizes of the differential upgrade packets is less than a first predetermined threshold; and if the determination result is less than the first predetermined threshold, the version partition is expanded; the reader/writer is configured to upgrade the system version according to the differential upgrade package The later version data is written to the expanded version partition.
- a storage medium is also provided.
- the storage medium is configured to store program code for performing the following steps: obtaining a remaining space size in a version partition in the terminal, wherein the version partition is used to store version data of the system version; determining the remaining space size and the size of the differential upgrade package Whether the difference is smaller than the first predetermined threshold; if the result of the determination is less than the first predetermined threshold, the version partition is expanded; and the version data after the system version is upgraded according to the differential upgrade package is written into the expanded version partition.
- a storage medium comprising a stored program, wherein the program is executed to perform the method of any of the above.
- a processor for running a program wherein the program is executed to perform the method of any of the above.
- the version partition is expanded, thereby enabling the system to be implemented.
- the upgraded version of the system version can be written to the expanded version of the partition, and the system version can be upgraded. Therefore, the problem that the version partition size in the related technology is insufficient and the system version upgrade fails is ensured, which ensures the success of the system version. upgrade.
- FIG. 1 is a block diagram showing the hardware structure of a mobile terminal according to a differential upgrade method according to an embodiment of the present invention
- FIG. 2 is a flow chart of a differential upgrade method according to an embodiment of the present invention.
- FIG. 3 is a structural block diagram of a differential upgrading apparatus according to an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of an upgrade method according to a preferred embodiment of the present invention.
- FIG. 6 is a schematic diagram of a FLASH partition provided in accordance with a preferred embodiment of the present invention.
- FIG. 7 is a schematic diagram of data movement provided in accordance with a preferred embodiment of the present invention.
- FIG. 1 is a hardware structural block diagram of a mobile terminal of a differential upgrade method according to an embodiment of the present invention.
- the mobile terminal 10 may include one or more (only one shown in the figure) processor 102 (processor 102
- the processing device may include, but is not limited to, a Microcontroller Unit (MCU) or a Field Programmable Gate Array (FPGA), a memory 104 for storing data, and a transmission for communication functions.
- MCU Microcontroller Unit
- FPGA Field Programmable Gate Array
- Device 106 It will be understood by those skilled in the art that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
- the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
- the memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the differential upgrade method in the embodiment of the present invention, and the processor 102 executes various programs by running software programs and modules stored in the memory 104. Functional application and data processing, that is, the above method is implemented.
- Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
- memory 104 may further include memory remotely located relative to processor 102, which may be connected to mobile terminal 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- Transmission device 106 is for receiving or transmitting data via a network.
- the above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10.
- the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
- the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
- NIC Network Interface Controller
- RF Radio Frequency
- FIG. 2 is a flowchart of a differential upgrade method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps:
- Step S202 Acquire a remaining space size in a version partition in the terminal.
- Step S204 determining whether the difference between the size of the remaining space and the size of the differential upgrade package is less than a first predetermined threshold
- Step S206 if the result of the determination is less than the first predetermined threshold, the version partition is expanded;
- Step S208 the version data after the system version is upgraded according to the differential upgrade package is written into the expanded version partition.
- the version partition may be expanded, and the version data after the system version is upgraded may be written and expanded.
- the system version upgrade can be completed. Therefore, the problem that the version partition size in the related technology is insufficient and the system version upgrade fails is ensured, and the system version is successfully upgraded.
- the differential upgrade of the version may be directly performed.
- the difference between the size of the expanded version partition and the size of the unexpanded version partition is greater than or equal to the size of the differential upgrade package, that is, the expanded version partition can accommodate the upgraded system version. Version data.
- the first predetermined threshold may be set according to actual conditions, but it should be noted that the first predetermined threshold is a positive number.
- the foregoing step S206 may be performed as: determining whether a remaining space of the adjacent partition adjacent to the version partition is greater than a second predetermined threshold; if the determination result is greater than a second predetermined threshold, The predetermined space in the adjacent partition is borrowed to the version partition; wherein the predetermined space is greater than or equal to the size of the differential upgrade package. That is, the version partition is expanded by borrowing a certain space from the adjacent partition.
- the predetermined space may be set according to actual conditions, for example, may be set according to the size of the differential upgrade package, but is not limited thereto.
- borrowing a predetermined space in an adjacent partition to the version partition may be performed by: moving data in the adjacent partition by a predetermined distance away from the version partition; The space corresponding to the predetermined distance of the vacancy is allocated to the version partition; wherein the size of the space corresponding to the predetermined distance is a predetermined space.
- the size of the adjacent partition includes address 1 to address 4, where address 1 stores data 1 and address 2 stores data 2 Address 3 stores data 3, and address 4 is empty, that is, the correspondence between data and address in the adjacent partition is as follows:
- the expansion of the version partition includes:
- the size of the space corresponding to the address 1 is the predetermined space.
- the foregoing second predetermined threshold may be set according to actual conditions. If the remaining space of the adjacent partition is insufficient, the space may be borrowed from the next partition of the adjacent partition to ensure the version partition upgrade. The need for space.
- the method may further include: reading the version data in the version partition, and upgrading the data of the differential upgrade package to the version data according to the difference algorithm to obtain the upgraded version data. .
- the method may further include: backing up the original boot load file in the partition storing the boot load file to obtain the backup boot load file; partitioning the expanded version Address information and adjacent partitions after the move The address information is updated to the backup boot file to get the updated boot load file.
- boot load file records information such as the size of each partition and the start address of each partition.
- the foregoing method may further include: deleting the original boot load file; and loading the system file by using the updated boot load file.
- the execution body of the foregoing steps may be a terminal or the like, but is not limited thereto.
- the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
- the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
- a differential upgrade device is also provided, which is used to implement the foregoing embodiments and preferred embodiments, and has not been described again.
- the term "module” may implement a combination of software and/or hardware of a predetermined function.
- the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
- FIG. 3 is a structural block diagram of a differential upgrading apparatus according to an embodiment of the present invention. As shown in FIG. 3, the apparatus includes:
- the obtaining module 32 is configured to obtain a remaining space size in the version partition in the terminal;
- the determining module 34 is connected to the obtaining module 32, and is configured to determine whether the difference between the remaining space size and the size of the differential upgrade packet is less than a first predetermined threshold;
- the expansion module 36 is connected to the determination module 34, and is set to be smaller than the judgment result. Expanding the version partition with a predetermined threshold;
- the writing module 38 is connected to the expansion module 36, and is configured to write the version data after the system version is upgraded according to the differential upgrade package into the expanded version partition.
- the expansion module 36 expands the version partition, thereby enabling the version version of the system version to be upgraded. It can be written to the expanded version partition, and the system version can be upgraded. Therefore, the problem that the version partition size in the related technology is insufficient and the system version upgrade fails is ensured, and the system version is successfully upgraded.
- the difference between the size of the expanded version partition and the size of the unexpanded version partition is greater than or equal to the size of the differential upgrade package, that is, the expanded version partition can accommodate the upgraded system version. Version data.
- the first predetermined threshold may be set according to actual conditions, but it should be noted that the first predetermined threshold is a positive number.
- the expansion module 36 may further be configured to determine whether a remaining space of an adjacent partition adjacent to the version partition is greater than a second predetermined threshold; and in a case where the determination result is greater than a second predetermined threshold Next, the predetermined space in the adjacent partition is borrowed to the version partition; wherein the predetermined space is greater than or equal to the size of the differential upgrade package.
- the predetermined space may be set according to actual conditions, for example, may be set according to the size of the differential upgrade package, but is not limited thereto.
- the expansion module 36 may further be configured to move data in the adjacent partitions by a predetermined distance in a direction away from the version partition; and allocate a space corresponding to a predetermined distance left by the adjacent partitions to the version partition. Wherein the size of the space corresponding to the predetermined distance is a predetermined space.
- the apparatus may further include: a backup module, connected to the expansion module 36, configured to store the boot load file in the partition to the original boot load The device performs backup to obtain the backup boot load file; the update module is connected to the expansion module 36, and is configured to update the address information of the expanded version partition and the address information of the moved neighboring partition to the backup boot file. , get the updated startup load file.
- a backup module connected to the expansion module 36, configured to store the boot load file in the partition to the original boot load The device performs backup to obtain the backup boot load file
- the update module is connected to the expansion module 36, and is configured to update the address information of the expanded version partition and the address information of the moved neighboring partition to the backup boot file. , get the updated startup load file.
- the apparatus may further include: a deleting module, configured to delete the original boot load file after the version data upgraded by the differential upgrade package to the system version is written into the expanded version partition.
- the startup load file records information such as the size of each partition and the start address of each partition.
- boot load file is used to load system files.
- the above device may be located in the terminal, but is not limited thereto.
- each of the above modules may be implemented by software or hardware.
- the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are in any combination.
- the forms are located in different processors.
- FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in FIG. 4, the terminal includes:
- the processor 42 is configured to acquire a remaining space size in the version partition in the terminal, determine whether a difference between the remaining space size and the size of the differential upgrade packet is less than a first predetermined threshold, and if the determination result is less than a first predetermined threshold, Expand the version partition;
- the reader/writer 44 is connected to the processor 42 and is configured to write the version data after the system version is upgraded according to the differential upgrade package into the expanded version partition.
- the foregoing processor 32 expands the version partition by using the foregoing terminal, because the difference between the size of the remaining space in the version partition and the size of the differential upgrade package is less than the first predetermined threshold, thereby enabling the version version of the system version to be upgraded. It can be written to the expanded version partition, and the system version can be upgraded. Therefore, the problem that the version partition size in the related technology is insufficient and the system version upgrade fails is ensured, and the system version is successfully upgraded.
- the difference between the size of the expanded version partition and the size of the unexpanded version partition is greater than or equal to the size of the differential upgrade package, that is, the expanded version partition can accommodate the upgraded system version. Version data.
- the first predetermined threshold may be set according to actual conditions, but it should be noted that the first predetermined threshold is a positive number.
- the processor 42 may be further configured to determine whether a remaining space of the adjacent partition adjacent to the version partition is greater than a second predetermined threshold; and in a case where the determination result is greater than a second predetermined threshold Next, the predetermined space in the adjacent partition is borrowed to the version partition; wherein the predetermined space is greater than or equal to the size of the differential upgrade package.
- the predetermined space may be set according to actual conditions, for example, may be set according to the size of the differential upgrade package, but is not limited thereto.
- the processor 42 may further be configured to move data in the adjacent partitions by a predetermined distance in a direction away from the version partition; and a space corresponding to a predetermined distance left by the adjacent partitions. Assigned to the version partition; wherein the size of the space corresponding to the predetermined distance is a predetermined space.
- the reader/writer 44 is further configured to back up the original boot load file in the partition storing the boot load file to obtain the backup boot load file; and the processor 42 may further expand the The address information of the version partition and the address information of the moved neighboring partition are updated to the backup boot file to obtain the updated boot load file.
- the processor 42 may be further configured to delete the original boot load file after the version data after the upgrade of the system version according to the differential upgrade package is written into the expanded version partition.
- the startup load file records information such as the size of each partition and the start address of each partition.
- boot load file is used to load system files.
- Embodiments of the present invention also provide a storage medium.
- the above storage medium may be set to store program code for executing the steps of the method in Embodiment 1.
- the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
- ROM Read-Only Memory
- RAM Random Access Memory
- a mobile hard disk e.g., a hard disk
- magnetic memory e.g., a hard disk
- Embodiments of the present invention also provide a processor for running a program, wherein the program is executed to perform the steps of any of the above methods.
- the preferred embodiment of the present invention provides a differential partitioning method for dynamic partitioning.
- the dynamic expansion of the loading system partition solves the problem that the partition size is insufficient and the upgrade fails.
- the method includes:
- the differential upgrade package of the old and new system versions is downloaded to the mobile terminal through the air interface, and the integrity verification package is checked for integrity. After the verification is passed, the flash (Flash) partition space reserved for the differential package is written and restarted. The phone enters the Recover mode for differential upgrade.
- the partition space must be expanded.
- the size of the expanded space is the size of the differential packet.
- the threshold is taken as a positive number because any partition must have a certain amount of buffer space, because there is a high probability that there will be bad blocks in the partition. Then save the bootloader file in the partition that stores the bootloader file and continue to use the original bootloader file to continue the upgrade process. Then judge Break the size of the remaining space of the partition adjacent to the version partition.
- the partition is sized by the area of the differential packet size to the partition.
- the starting position of the partition is shifted backward by the size of the differential packet, and the address of this partition is updated to the backup bootloader.
- the remaining space of the adjacent partition is not enough, continue to borrow space from the next partition to ensure the need for the version partition upgrade space.
- the partition after the version partition is generally the file system partition or the user partition (depending on different systems), and the space is sufficient.
- the UA upgrade agent
- FIG. 5 is a schematic flowchart of an upgrade method according to a preferred embodiment of the present invention. As shown in FIG. 5, the specific interaction steps of the method are as follows:
- S502 Perform integrity check on the differential packet, mainly whether the version is matched, whether the packet size is correct, and whether the data is tampered with. If the package is incorrect, the upgrade will end directly.
- S504 Read the size of the loaded version partition and the size of the loaded version, and calculate the remaining space of the partition. If the size of the remaining space minus the size of the differential packet is less than a certain positive threshold, then the partition space must be expanded. The size of the expanded space is the size of the differential packet. If the version partition space is sufficient, then the UA is upgraded according to the normal upgrade process, and the upgrade completes the restart of the terminal.
- the adjacent partition is a file system partition or a user data partition, and there are more space remaining, so the data of the adjacent partition of the version partition is directly moved, and the moving size is the differential packet size.
- S508 The UA performs an upgrade process, and reads the version data of the version partition, and according to the check The algorithm divides the data of the differential package into the version data, and then writes the upgraded version data back to the version partition to complete the version upgrade.
- FIG. 6 is a schematic diagram of a FLASH partition according to a preferred embodiment of the present invention. As shown in FIG. 6, the FLASH partition is divided into a Boot partition, a Kernel partition, a version or a system partition, and a file system partition. It should be noted that, when the version partition size is insufficient, the adjacent partition borrowing space may be used, but preferably, the file partition may be borrowed, but is not limited thereto.
- FIG. 7 is a schematic diagram of data movement according to a preferred embodiment of the present invention. As shown in FIG. 7, the address bits store data from low to high, and move data 1 to a high address, so address 1 does not store data. Expansion for version partitioning.
- the version file amss.mbn is about 40 megabytes
- the allocation space is 50 megabytes
- the file system efs.mbn is about 60 megabytes
- the allocation space is close to 75 megabytes. If it is 128 megabytes of memory space, it is basically used up. Of course, if the memory is 256 megabytes, then the space is quite sufficient.
- the 5 megabytes of file system space is reserved to store the downloaded differential packets.
- the maximum number of differential packets will not exceed 10% of the version file, that is, it will not exceed 4.5 megabytes.
- the differential package is generally about 2 megabytes, then if you upgrade once, the version partition will occupy 2 megabytes of space, there is not much space left, and some space is reserved to ensure bad blocks, version buffer space. .
- the threshold of the remaining space of the version partition is set to 5 megabytes, then the remaining 5 megabytes of version space can be upgraded at most twice. If you want to upgrade the third time, you must expand the space to the file system. If the differential packet is 2 megabytes, then Move the file system space to the high address by 2 megabytes to ensure differential upgrade of the version.
- the version partition since the difference between the size of the remaining space in the version partition and the size of the differential upgrade packet is less than the first predetermined threshold, the version partition is expanded, and the version data after the system version is upgraded can be written and expanded. In the later version partition, the system version upgrade can be completed. Therefore, the problem that the version partition size in the related technology is insufficient and the system version upgrade fails is ensured, and the system version is successfully upgraded.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供了一种差分升级方法及装置、终端、存储介质、处理器;其中,该方法包括:获取终端中版本分区中的剩余空间大小,其中,版本分区用于存储系统版本的版本数据;判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。通过本发明,解决了相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
Description
本发明涉及通信领域,具体而言,涉及一种差分升级方法及装置、终端、存储介质、处理器。
目前,差分升级技术已经广泛的应用于移动终端的系统版本升级。差分升级包很小,通过空口的方式从服务器下发,它能够实现对终端系统分区未发生变化的系统版本进行快速升级。现在,系统版本不停的优化,新的应用也不断加入,如果在旧的系统版本上通过差分升级升到的新版本大小大于了装载版本分区的大小,那么差分升级则会失败,这种情况在特别是在小内存(内存紧张)的功能机、数据卡、路由器等非智能产品的系统版本升级中常见。针对这种情况,目前的处理方式是设定一个差分包大小的阈值,在升级时如果差分包大于这个阈值则不进行系统版本的差分升级,同时上报升级失败。
针对相关技术中的上述技术问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种差分升级方法及装置、终端、存储介质、处理器,以至少解决相关技术中的版本分区大小不够导致系统版本升级失败的问题。
根据本发明的一个实施例,提供了一种差分升级方法,包括:获取终端中版本分区中的剩余空间大小;判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;将依据差分升级包对系统版本进行升级后的版本数
据写入扩容后的版本分区中。
在本发明实施例中,扩容后的版本分区的空间大小与未扩容的版本分区的空间大小之差大于或者等于差分升级包的大小。
在本发明实施例中,对版本分区进行扩容包括:判断与版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;在判断结果为大于第二预定阈值的情况下,将相邻分区中的预定空间借用给版本分区;其中,预定空间大于或者等于差分升级包的大小。
在本发明实施例中,将相邻分区中的预定空间借用给版本分区包括:将相邻分区中的数据沿远离版本分区的方向移动预定距离;将相邻分区中空余出的预定距离所对应的空间分配给版本分区;其中,预定距离所对应的空间的大小为预定空间。
在本发明实施例中,对版本分区进行扩容之后,方法还包括:在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;将扩容后的版本分区的地址信息和移动后的相邻分区的地址信息更新到备份的启动装载文件中,得到更新后的启动装载文件。
在本发明实施例中,在将依据差分升级包对系统版本升级后的版本数据写入扩容后的版本分区中之后,方法还包括:删除原始启动装载文件;利用更新后的启动装载文件,加载系统文件。
根据本发明的一个实施例,提供了一种差分升级装置,包括:获取模块,设置为获取终端中版本分区中的剩余空间大小;判断模块,设置为判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;扩容模块,设置为在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;写入模块,设置为将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
在本发明实施例中,扩容模块,还设置为判断与版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;以及在判断结果为大于第二预定阈值的情况下,将相邻分区中的预定空间借用给版本分区;其中,预定空
间大于或者等于差分升级包的大小。
在本发明实施例中,扩容模块,还设置为将相邻分区中的数据沿远离版本分区的方向移动预定距离;以及将相邻分区中空余出的预定距离所对应的空间分配给版本分区;其中,预定距离所对应的空间的大小为预定空间。
在本发明实施例中,装置还包括:备份模块,设置为在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;更新模块,设置为将扩容后的版本分区的地址信息和移动后的相邻分区的地址信息更新到备份的启动装载文件中,得到更新后的启动装载文件。
根据本发明的一个实施例,提供了一种终端,包括:处理器,设置为获取终端中版本分区中的剩余空间大小,其中,版本分区用于存储系统版本的版本数据;判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;以及在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;读写器,设置为将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
根据本发明的又一个实施例,还提供了一种存储介质。该存储介质设置为存储用于执行以下步骤的程序代码:获取终端中版本分区中的剩余空间大小,其中,版本分区用于存储系统版本的版本数据;判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
根据本发明的又一个实施例,还提供了一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述任一项所述的方法。
根据本发明的又一个实施例,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述任一项所述的方法。
通过本发明,由于在版本分区中的剩余空间大小与差分升级包的大小之差小于第一预定阈值的情况下,对版本分区进行扩容,进而可以使得系
统版本升级后的版本数据可以写入扩容后的版本分区中,进而可以完成系统版本升级,因此,可以解决相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是本发明实施例的一种差分升级方法的移动终端的硬件结构框图;
图2是根据本发明实施例的差分升级方法的流程图;
图3是根据本发明实施例的差分升级装置的结构框图;
图4是根据本发明实施例提供的终端的结构示意图;
图5是根据本发明优选实施例提供的升级方法的流程示意图;
图6是根据本发明优选实施例提供的FLASH分区的示意图;
图7是根据本发明优选实施例提供的数据移动的示意图。
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
实施例1
本申请实施例1所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本发明实施例的一种差分升级方法的移动终端的硬件结构框图。如图1所示,移动终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102
可以包括但不限于微处理器(Microcontroller Unit,简称MCU)或可编程逻辑器件(Field Programmable Gate Array,简称FPGA)等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,移动终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的差分升级方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种运行于上述移动终端的差分升级方法,图2是根据本发明实施例的差分升级方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,获取终端中版本分区中的剩余空间大小;
步骤S204,判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;
步骤S206,在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;
步骤S208,将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
通过上述步骤,由于在版本分区中的剩余空间大小与差分升级包的大小之差小于第一预定阈值的情况下,对版本分区进行扩容,进而可以使得系统版本升级后的版本数据可以写入扩容后的版本分区中,进而可以完成系统版本升级,因此,可以解决相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
需要说明的是,上述版本分区用于存储系统版本的版本数据,但并不限于此。
需要说明的是,在上述判断结果为大于或者等于上述第一预定阈值的情况下,可以直接进行版本的差分升级。
需要说明的是,上述扩容后的版本分区的空间大小与未扩容的版本分区的空间大小之差大于或者等于差分升级包的大小,即能够保证扩容后的版本分区能够容纳升级后的系统版本的版本数据。
需要说明的是,上述第一预定阈值可以根据实际情况进行设定,但需要说明的是,第一预定阈值为一个正数。
在本发明的一个实施例中,上述步骤S206可以表现为:判断与版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;在判断结果为大于第二预定阈值的情况下,将相邻分区中的预定空间借用给版本分区;其中,预定空间大于或者等于差分升级包的大小。即通过向相邻分区借用一定的空间来对版本分区进行扩容。
需要说明的是,上述预定空间可以根据实际情况进行设定,比如可以根据差分升级包的大小进行设定,但并不限于此。
需要说明的是,将相邻分区中的预定空间借用给版本分区可以表现为:将相邻分区中的数据沿远离版本分区的方向移动预定距离;将相邻分区中
空余出的预定距离所对应的空间分配给版本分区;其中,预定距离所对应的空间的大小为预定空间。
以低于所述版本分区所在的地址的相邻分区为例来说明对版本分区的扩容:相邻分区的大小包括地址1到地址4,其中,地址1上存储数据1,地址2存储数据2,地址3存储数据3,地址4为空的,即相邻分区中数据和地址的对应关系如下:
数据1,数据2,数据3
地址1,地址2,地址3,地址4
那么,对版本分区的扩容包括:
(1)将数据3移至地址4,将数据2移至地址3,将数据1移至地址2,因而地址1此时为空,即相邻分区中数据和地址的对应关系变为:
数据1,数据2,数据3
地址1,地址2,地址3,地址4
(2)将相邻分区的起始地址变更为地址2;将空余的地址1化为版本分区里面,即将版本分区的结束地址变更为地址1,完成了对版本分区的扩容。
上述地址1对应的空间大小为上述预定空间。
需要说明的是,上述第二预定阈值可以根据实际情况进行设定,在相邻分区的剩余空间不足的情况下,还可以继续向上述相邻分区的下一个分区借用空间,以保证版本分区升级空间的需要。
需要说明的是,在上述步骤S208之前,上述方法还可以包括:将版本分区中的版本数据读出,根据差分算法,将差分升级包的数据差分升级到版本数据中,得到升级后的版本数据。
在本发明的一个实施例中,在上述步骤S206之后,上述方法还可以包括:在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;将扩容后的版本分区的地址信息和移动后的相邻分区
的地址信息更新到备份的启动装载文件中,得到更新后的启动装载文件。
需要说明的是,启动装载文件中记录有每个分区的空间大小和每个分区的起始地址等信息。
需要说明的是,在上述步骤S208之后,上述方法还可以包括:删除原始启动装载文件;利用更新后的启动装载文件,加载系统文件。
在本发明实施例中,上述步骤的执行主体可以为终端等,但不限于此。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例2
在本实施例中还提供了一种差分升级装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图3是根据本发明实施例的差分升级装置的结构框图,如图3所示,该装置包括:
获取模块32,设置为获取终端中版本分区中的剩余空间大小;
判断模块34,与上述获取模块32连接,设置为判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;
扩容模块36,与上述判断模块34连接,设置为在判断结果为小于第
一预定阈值的情况下,对版本分区进行扩容;
写入模块38,与上述扩容模块36连接,设置为将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
通过上述装置,由于在版本分区中的剩余空间大小与差分升级包的大小之差小于第一预定阈值的情况下,上述扩容模块36对版本分区进行扩容,进而可以使得系统版本升级后的版本数据可以写入扩容后的版本分区中,进而可以完成系统版本升级,因此,可以解决相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
需要说明的是,上述版本分区用于存储系统版本的版本数据,但并不限于此。
需要说明的是,上述扩容后的版本分区的空间大小与未扩容的版本分区的空间大小之差大于或者等于差分升级包的大小,即能够保证扩容后的版本分区能够容纳升级后的系统版本的版本数据。
需要说明的是,上述第一预定阈值可以根据实际情况进行设定,但需要说明的是,第一预定阈值为一个正数。
在本发明的一个实施例中,上述扩容模块36,还可以设置为判断与版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;以及在判断结果为大于第二预定阈值的情况下,将相邻分区中的预定空间借用给版本分区;其中,预定空间大于或者等于差分升级包的大小。
需要说明的是,上述预定空间可以根据实际情况进行设定,比如可以根据差分升级包的大小进行设定,但并不限于此。
需要说明的是,上述扩容模块36,还可以设置为将相邻分区中的数据沿远离版本分区的方向移动预定距离;以及将相邻分区中空余出的预定距离所对应的空间分配给版本分区;其中,预定距离所对应的空间的大小为预定空间。
在本发明的一个实施例中,上述装置还可以包括:备份模块,与上述扩容模块36连接,设置为在存储启动装载文件的分区对原始启动装载文
件进行备份,得到备份的启动装载文件;更新模块,与上述扩容模块36连接,设置为将扩容后的版本分区的地址信息和移动后的相邻分区的地址信息更新到备份的启动装载文件中,得到更新后的启动装载文件。
在本发明的一个实施例中,上述装置还可以包括:删除模块,设置为在将依据差分升级包对系统版本升级后的版本数据写入扩容后的版本分区中之后,删除原始启动装载文件。
需要说明的是,需要说明的是,启动装载文件中记录有每个分区的空间大小和每个分区的起始地址等信息。
需要说明的是,上述更新后的启动装载文件用于加载系统文件。
需要说明的是,上述装置可以位于终端中,但并不限于此。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例3
本发明实施例还提供了一种终端,图4是根据本发明实施例提供的终端的结构示意图,如图4所示,该终端包括:
处理器42,设置为获取终端中版本分区中的剩余空间大小;判断剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;以及在判断结果为小于第一预定阈值的情况下,对版本分区进行扩容;
读写器44,与上述处理器42连接,设置为将依据差分升级包对系统版本进行升级后的版本数据写入扩容后的版本分区中。
通过上述终端,由于在版本分区中的剩余空间大小与差分升级包的大小之差小于第一预定阈值的情况下,上述处理器32对版本分区进行扩容,进而可以使得系统版本升级后的版本数据可以写入扩容后的版本分区中,进而可以完成系统版本升级,因此,可以解决相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
需要说明的是,上述版本分区用于存储系统版本的版本数据,但并不限于此。
需要说明的是,上述扩容后的版本分区的空间大小与未扩容的版本分区的空间大小之差大于或者等于差分升级包的大小,即能够保证扩容后的版本分区能够容纳升级后的系统版本的版本数据。
需要说明的是,上述第一预定阈值可以根据实际情况进行设定,但需要说明的是,第一预定阈值为一个正数。
在本发明的一个实施例中,上述处理器42,还可以设置为判断与版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;以及在判断结果为大于第二预定阈值的情况下,将相邻分区中的预定空间借用给版本分区;其中,预定空间大于或者等于差分升级包的大小。
需要说明的是,上述预定空间可以根据实际情况进行设定,比如可以根据差分升级包的大小进行设定,但并不限于此。
在本发明的一个实施例中,上述处理器42,还可以设置为将相邻分区中的数据沿远离版本分区的方向移动预定距离;以及将相邻分区中空余出的预定距离所对应的空间分配给版本分区;其中,预定距离所对应的空间的大小为预定空间。
在本发明的一个实施例中,上述读写器44还设置为在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;以上述处理器42还可以将扩容后的版本分区的地址信息和移动后的相邻分区的地址信息更新到备份的启动装载文件中,得到更新后的启动装载文件。
在本发明的一个实施例中,上述处理器42,还可以设置为在将依据差分升级包对系统版本升级后的版本数据写入扩容后的版本分区中之后,删除原始启动装载文件。
需要说明的是,需要说明的是,启动装载文件中记录有每个分区的空间大小和每个分区的起始地址等信息。
需要说明的是,上述更新后的启动装载文件用于加载系统文件。
实施例4
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行实施例1中的方法的步骤的程序代码。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本发明的实施例还提供了一种处理器,该处理器用于运行程序,其中,该程序运行时执行上述任一项方法中的步骤。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
为了更好的理解本发明,以下结合优选的实施例对本发明做进一步解释。
本发明优选实施例提出了一种动态分区的差分升级方法,通过对装载系统分区进行动态扩容,解决了分区大小不够导致升级失败问题。该方法包括:
将新旧两个系统版本的差分升级包通过空口的方式下载到移动终端,对差分升级包进行完整性校验,校验通过后,写入预留给差分包的闪存(Flash)分区空间,重启手机进入恢复(Recover)模式进行差分升级。
首先,读取装载版本分区的大小和装载的版本大小,算出分区的剩余空间大小。如果剩余空间大小减去差分包的大小小于某一个正数阈值,这时就必须对分区空间进行扩容,扩容的空间大小为差分包的大小。阈值取为正数是因为任何的分区都必须有一定的缓冲空间,因为分区中极有可能存在无法使用的坏块。接着在存储启动装载(Bootloader)文件的分区备份Bootloader文件,继续使用原始Bootloader文件继续升级流程。然后判
断相邻于版本分区的分区剩余空间大小,如果剩余空间大小大于某个阈值(一般取得比较大,保证剩余空间足够),则向此分区借差分包大小的区域给版本分区,就需要把此分区的起始位置向后移差分包大小的距离,同时将此分区的地址更新到备份的Bootloader中。如果相邻分区剩余空间不够,则继续向下一个分区借空间来保证版本分区升级空间的需要。一般来讲,版本分区后的分区一般是文件系统分区或者user分区(因不同系统而异),空间都是足够的。最后UA(升级代理)完成差分升级,同时升级完成后,需要将备份的Bootloader文件更新到原始文件,重启样机完成系统加载。
图5是根据本发明优选实施例提供的升级方法的流程示意图,如图5所示,该方法具体的交互步骤如下:
S501:通过空口将版本差分升级包下载到移动终端
S502:对差分包进行完整性校验,主要是版本是否比配,包大小是否正确,数据是否被篡改。包如果不正确则此次升级直接结束。
S503:将差分包写入预留的Flash分区。
S504:读取装载版本分区的大小和装载的版本大小,算出分区的剩余空间大小。如果剩余空间大小减去差分包的大小小于某一个正数阈值,这时就必须对此分区空间进行扩容,扩容的空间大小为差分包的大小。如果版本分区空间足够,那么就UA就按照正常升级流程进行升级,升级完成重启终端。
S505:在移动相邻下一个分区之前,先对Bootloader文件进行备份,分区信息改变后,同步也要升级Bootloader文件。
S506:一般版本分区后相邻的分区为文件系统分区或者user data分区,空间剩余比较多,所以直接移动版本分区的相邻分区的数据,移动大小为差分包大小。
S507:把移动后新的分区地址更新到备份的Bootloader文件。
S508:UA执行升级流程,将版本分区的版本数据读出,同时根据查
分算法,将差分包的数据差分升级到版本数据中,然后将升级后的版本数据重新写回版本分区中,完成版本升级。
S509:升级完成后,删除旧的Bootloader文件,使用新的Bootloader文件,重启终端,加载系统文件。
图6是根据本发明优选实施例提供的FLASH分区的示意图,如图6所示,该FLASH分区分为引导(Boot)分区、核(Kernel)分区、版本或系统分区和文件系统分区。需要说明的是,当版本分区大小不够的情况下,可以是相邻分区借用空间使用,但优选的,可以向文件分区借用,但并不限于此。
图7是根据本发明优选实施例提供的数据移动的示意图,如图7所示,地址位由低到高存储数据,将数据1向高地址处移动一格,那么地址1就不存储数据,用于版本分区的扩容。
以一款手机内存为128M到256M左右为例。版本文件amss.mbn大约40兆左右,分配空间50兆,文件系统efs.mbn大约60兆,分配空间接近75兆。如果是128兆的内存空间,基本上就被使用完,当然如果内存是256兆,那么空间还比较充足。
以128兆配置来说明,保留5兆的文件系统空间来存储下载的差分包,按照查分算法,差分包最大不会超过版本文件的10%,也就是不会超过4.5兆,根据功能机差分升级的经验,差分包一般在2兆左右,那么如果升级一次,版本分区就会被占用2兆的空间,本来所剩的空间不多,同时还要预留一部分空间来保证坏块,版本缓冲空间。如果版本分区剩余空间的阈值设置为5兆,那么剩下的5兆的版本空间最多能升级两次,如果还要升级第三次就必须向文件系统扩容空间,如果差分包2兆,那么就把文件系统空间向高地址移动2兆,来保证版本的差分升级。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执
行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
通过本发明,由于在版本分区中的剩余空间大小与差分升级包的大小之差小于第一预定阈值的情况下,对版本分区进行扩容,进而可以使得系统版本升级后的版本数据可以写入扩容后的版本分区中,进而可以完成系统版本升级,因此,可以解决相关技术中的版本分区大小不够导致系统版本升级失败的问题,保证了系统版本的成功升级。
Claims (13)
- 一种差分升级方法,包括:获取终端中版本分区中的剩余空间大小;判断所述剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;在判断结果为小于所述第一预定阈值的情况下,对所述版本分区进行扩容;将依据所述差分升级包对系统版本进行升级后的版本数据写入扩容后的所述版本分区中。
- 根据权利要求1所述的方法,其中,扩容后的所述版本分区的空间大小与未扩容的所述版本分区的空间大小之差大于或者等于所述差分升级包的大小。
- 根据权利要求1所述的方法,其中,对所述版本分区进行扩容包括:判断与所述版本分区相邻的相邻分区的剩余空间是否大于第二预定阈值;在判断结果为大于所述第二预定阈值的情况下,将所述相邻分区中的预定空间借用给所述版本分区;其中,所述预定空间大于或者等于所述差分升级包的大小。
- 根据权利要求3所述的方法,其中,将所述相邻分区中的预定空间借用给所述版本分区包括:将所述相邻分区中的数据沿远离所述版本分区的方向移动预定距离;将所述相邻分区中空余出的预定距离所对应的空间分配给所述 版本分区;其中,所述预定距离所对应的空间的大小为所述预定空间。
- 根据权利要求4所述的方法,其中,对所述版本分区进行扩容之后,所述方法还包括:在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;将扩容后的所述版本分区的地址信息和移动后的所述相邻分区的地址信息更新到所述备份的启动装载文件中,得到更新后的启动装载文件。
- 根据权利要求5所述的方法,其中,在将依据所述差分升级包对所述系统版本升级后的版本数据写入扩容后的所述版本分区中之后,所述方法还包括:删除所述原始启动装载文件;利用所述更新后的启动装载文件,加载系统文件。
- 一种差分升级装置,包括:获取模块,设置为获取终端中版本分区中的剩余空间大小;判断模块,设置为判断所述剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;扩容模块,设置为在判断结果为小于所述第一预定阈值的情况下,对所述版本分区进行扩容;写入模块,设置为将依据所述差分升级包对系统版本进行升级后的版本数据写入扩容后的所述版本分区中。
- 根据权利要求7所述的装置,其中,所述扩容模块,还设置为判断与所述版本分区相邻的相邻分区的剩余空间是否大于第二预 定阈值;以及在判断结果为大于所述第二预定阈值的情况下,将所述相邻分区中的预定空间借用给所述版本分区;其中,所述预定空间大于或者等于所述差分升级包的大小。
- 根据权利要求8所述的装置,其中,所述扩容模块,还设置为将所述相邻分区中的数据沿远离所述版本分区的方向移动预定距离;以及将所述相邻分区中空余出的预定距离所对应的空间分配给所述版本分区;其中,所述预定距离所对应的空间的大小为所述预定空间。
- 根据权利要求9所述的装置,其中,所述装置还包括:备份模块,设置为在存储启动装载文件的分区对原始启动装载文件进行备份,得到备份的启动装载文件;更新模块,设置为将扩容后的所述版本分区的地址信息和移动后的所述相邻分区的地址信息更新到所述备份的启动装载文件中,得到更新后的启动装载文件。
- 一种终端,包括:处理器,设置为获取终端中版本分区中的剩余空间大小,其中,所述版本分区用于存储系统版本的版本数据;判断所述剩余空间大小与差分升级包的大小之差是否小于第一预定阈值;以及在判断结果为小于所述第一预定阈值的情况下,对所述版本分区进行扩容;读写器,设置为将依据所述差分升级包对所述系统版本进行升级后的版本数据写入扩容后的所述版本分区中。
- 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行权利要求1至6中任一项所述的方法。
- 一种处理器,所述处理器用于运行程序,其中,所述程序运 行时执行权利要求1至6中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710066987.0 | 2017-02-07 | ||
CN201710066987.0A CN108399079A (zh) | 2017-02-07 | 2017-02-07 | 差分升级方法及装置、终端 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018145392A1 true WO2018145392A1 (zh) | 2018-08-16 |
Family
ID=63094388
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/090082 WO2018145392A1 (zh) | 2017-02-07 | 2017-06-26 | 差分升级方法及装置、终端、存储介质、处理器 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108399079A (zh) |
WO (1) | WO2018145392A1 (zh) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110221856B (zh) * | 2019-06-25 | 2024-03-19 | 努比亚技术有限公司 | 一种可穿戴设备升级方法、可穿戴设备及存储介质 |
CN112416381A (zh) * | 2019-08-22 | 2021-02-26 | 中兴通讯股份有限公司 | 差分升级方法、装置、服务器及可读存储介质 |
CN112752154A (zh) * | 2019-10-29 | 2021-05-04 | 青岛海尔多媒体有限公司 | 软件升级方法及装置、智能电视 |
CN114303131B (zh) * | 2019-11-18 | 2024-09-20 | 深圳市欢太科技有限公司 | 一种文件处理方法、文件处理装置及终端设备 |
CN112947952A (zh) * | 2019-11-26 | 2021-06-11 | 中盈优创资讯科技有限公司 | 通讯设备版本管理方法及装置 |
CN111596945B (zh) * | 2020-04-03 | 2021-09-14 | 红石阳光(北京)科技股份有限公司 | 嵌入式系统动态多分区固件的差分升级方法 |
CN113778490A (zh) * | 2021-09-16 | 2021-12-10 | 深圳市易平方网络科技有限公司 | 基于智能终端的软件升级处理方法、装置、智能终端 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070042766A1 (en) * | 2003-02-05 | 2007-02-22 | Samsung Electronics Co., Ltd. | System and method for delta-based over-the-air software upgrades for a wireless mobile station |
CN104077234A (zh) * | 2014-07-10 | 2014-10-01 | 三星电子(中国)研发中心 | 一种嵌入式系统分区的动态调整方法和装置 |
CN104714811A (zh) * | 2013-12-13 | 2015-06-17 | 中兴通讯股份有限公司 | 差分升级包的制作方法及装置、系统差分升级方法及装置 |
CN106231140A (zh) * | 2016-09-30 | 2016-12-14 | 努比亚技术有限公司 | 一种移动终端fota升级容错装置及方法 |
-
2017
- 2017-02-07 CN CN201710066987.0A patent/CN108399079A/zh not_active Withdrawn
- 2017-06-26 WO PCT/CN2017/090082 patent/WO2018145392A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070042766A1 (en) * | 2003-02-05 | 2007-02-22 | Samsung Electronics Co., Ltd. | System and method for delta-based over-the-air software upgrades for a wireless mobile station |
CN104714811A (zh) * | 2013-12-13 | 2015-06-17 | 中兴通讯股份有限公司 | 差分升级包的制作方法及装置、系统差分升级方法及装置 |
CN104077234A (zh) * | 2014-07-10 | 2014-10-01 | 三星电子(中国)研发中心 | 一种嵌入式系统分区的动态调整方法和装置 |
CN106231140A (zh) * | 2016-09-30 | 2016-12-14 | 努比亚技术有限公司 | 一种移动终端fota升级容错装置及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN108399079A (zh) | 2018-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018145392A1 (zh) | 差分升级方法及装置、终端、存储介质、处理器 | |
KR101915830B1 (ko) | 풀링된 파티션 레이아웃 및 표현 기법 | |
CN111796856B (zh) | 差分升级方法及装置、存储介质、计算机设备 | |
CN103970557B (zh) | 存储设备启动系统的方法及存储设备 | |
US20110004871A1 (en) | Embedded electronic device and firmware updating method thereof | |
CN106155915B (zh) | 数据存储的处理方法及装置 | |
CN110704335A (zh) | 一种基于异步环形缓冲区的数据读取、写入方法及装置 | |
CN112162773B (zh) | 差分升级方法及装置、存储介质、终端 | |
CN106708543A (zh) | 一种操作系统的ota升级方法及装置 | |
US10942811B2 (en) | Data processing method for solid state drive | |
CN112667265B (zh) | 一种引导程序更新方法及装置 | |
CN102650949A (zh) | 一种存储设备的固件升级的方法及装置 | |
CN114661223A (zh) | 管理固态驱动器的写入移除 | |
JP2000222292A (ja) | フラッシュメモリを利用したデータ管理方法 | |
CN112860291A (zh) | 固件升级方法及装置 | |
CN114840449A (zh) | 基于MCU片内flash的数据存储方法、装置、设备及存储介质 | |
US9588884B2 (en) | Systems and methods for in-place reorganization of device storage | |
CN111124294B (zh) | 一种扇区映射信息的管理方法及装置、存储介质和设备 | |
WO2017173924A1 (zh) | 切换文件系统的方法及装置 | |
KR101676175B1 (ko) | 전원 손실 이후 데이터 손실을 방지하기 위한 메모리 저장 장치 및 방법 | |
CN106598475A (zh) | 一种实现分区切换的方法及装置 | |
CN116009923A (zh) | 一种固件差分升级的控制方法、装置及存储介质 | |
WO2020107469A1 (zh) | 程序处理方法、设备及存储介质 | |
US8209475B2 (en) | Write timeout control methods for flash memory and memory devices using the same | |
CN109407989B (zh) | 一种元数据刷写的方法和装置 |
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: 17896307 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: 17896307 Country of ref document: EP Kind code of ref document: A1 |