CN105843656B - System upgrading method for insufficient disk space, terminal equipment and server - Google Patents

System upgrading method for insufficient disk space, terminal equipment and server Download PDF

Info

Publication number
CN105843656B
CN105843656B CN201610255784.1A CN201610255784A CN105843656B CN 105843656 B CN105843656 B CN 105843656B CN 201610255784 A CN201610255784 A CN 201610255784A CN 105843656 B CN105843656 B CN 105843656B
Authority
CN
China
Prior art keywords
upgrade package
partition
upgrade
available space
size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610255784.1A
Other languages
Chinese (zh)
Other versions
CN105843656A (en
Inventor
彭芃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Technology Group Co Ltd
Original Assignee
TCL Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Technology Group Co Ltd filed Critical TCL Technology Group Co Ltd
Priority to CN201610255784.1A priority Critical patent/CN105843656B/en
Publication of CN105843656A publication Critical patent/CN105843656A/en
Application granted granted Critical
Publication of CN105843656B publication Critical patent/CN105843656B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Abstract

The invention provides a system upgrading method with insufficient disk space, terminal equipment and a server, wherein the method comprises the following steps: calculating the size of the available space of each partition in the terminal equipment disk; accumulating the sizes of the available spaces of all the partitions, and judging whether the sizes of the available spaces of all the partitions are smaller than the size of the upgrade package; when the size of the upgrade package is not smaller than the size of the upgrade package, sequentially distributing the download quantity of the upgrade package for each partition and sending distribution records to a server, so that the server divides the upgrade package into a plurality of upgrade package fragments according to distribution results and then returns the upgrade package fragments to the terminal equipment; receiving a plurality of upgrade package fragments issued by a server, writing each upgrade package fragment into a corresponding partition according to a distribution record, and performing system upgrade by using the plurality of upgrade package fragments. The invention improves the stability of system upgrading and the experience of the user.

Description

System upgrading method for insufficient disk space, terminal equipment and server
Technical Field
The invention belongs to the technical field of internet, and particularly relates to a system upgrading method for insufficient disk space, terminal equipment and a server.
Background
At present, with the continuous change of application versions of various operating systems, system upgrade has become an indispensable function of terminal devices such as mobile phones and televisions. The terminal equipment can solve the possible problems of the current system through system upgrading, so that the user can obtain the latest user experience. Meanwhile, the equipment manufacturer can solve the software problem in time through system upgrading and push value-added services such as advertisements to the user, so the system upgrading is also an effective way for the equipment manufacturer to create revenue.
In The prior art, The system upgrade of The terminal device mostly adopts an FOTA (Firmware Over The Air) upgrade mode, that is, an upgrade package is pushed to The terminal device through a network server, and then The terminal device uses The upgrade package for upgrade. However, since the memory chip of the terminal device is generally divided into several partitions, each partition has different functions, and generally, the FOTA upgrade method downloads the upgrade package into a certain fixed partition, for example: and when the whole upgrade package cannot be accommodated in the partition space, the data partition or the cache partition prompts that the storage space of the terminal equipment of the user is insufficient, and the user is required to clean the data by himself or the current system of the terminal equipment forcibly cleans the data. However, both of these processes have certain drawbacks: in the former, if a user cannot operate or does not want to manually clear data, the terminal equipment cannot smoothly complete system upgrade; the latter may then result in the user's mistaken deletion of some useful data, which may lead to a poor experience for the user.
Disclosure of Invention
The embodiment of the invention aims to provide a system upgrading method with insufficient disk space, terminal equipment and a server, and aims to solve the problem that the terminal equipment cannot smoothly complete system upgrading or bad experience is brought to a user due to the FOTA upgrading mode.
The embodiment of the invention is realized in such a way that a system upgrading method with insufficient disk space comprises the following steps:
calculating the size of the available space of each partition in the terminal equipment disk;
accumulating the size of the available space of all the partitions, and judging whether the size of the available space of all the partitions is smaller than the size of the upgrade package;
when the size of the available space of all the partitions is larger than or equal to the size of the upgrade package, sequentially distributing the download amount of the upgrade package for each partition, and sending a distribution record to a server, so that the server divides the upgrade package into a plurality of upgrade package fragments according to the distribution record and then sequentially returns to the terminal equipment;
and receiving a plurality of upgrade package fragments issued by the server, writing each upgrade package fragment into a corresponding partition according to the distribution record, and performing system upgrade by using the plurality of upgrade package fragments.
In the method for upgrading a system with insufficient disk space according to the embodiment of the present invention, before accumulating the sizes of the available spaces of all the partitions and determining whether the sizes of the available spaces of all the partitions are smaller than the size of the upgrade package, the method further includes:
judging whether the partition with the largest available space is enough to accommodate the upgrade package;
when the partition with the largest available space can not accommodate the upgrade package, the method enters the steps of accumulating the size of the available space of all the partitions and judging whether the size of the available space of all the partitions is smaller than that of the upgrade package;
and when the partition with the largest available space is enough to accommodate the upgrade package, downloading the upgrade package to the partition with the largest available space, and performing system upgrade by using the upgrade package.
In the upgrade method for a system with insufficient disk space according to the embodiment of the present invention, sequentially allocating download amounts of upgrade packages to partitions specifically includes:
and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
In the method for upgrading a system with insufficient disk space according to the embodiment of the present invention, the upgrading a system using a plurality of upgrade package fragments specifically includes:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition;
sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command;
performing read-only locking on the upgrade package in the memory;
checking the integrity of the upgrade package in the memory;
if the verification fails, deleting the upgrade package in the memory, and returning to the step of loading the upgrade package segments in each partition into the memory in sequence according to the record;
and if the verification is passed, the system is upgraded by using the upgrade package.
Another objective of an embodiment of the present invention is to provide a method for upgrading a system with insufficient disk space, including:
receiving a request for inquiring the size of an upgrade package required by system upgrade, which is sent by a terminal device, and returning the size of the upgrade package to the terminal device according to the request, so that the terminal device distributes the download amount of the upgrade package of each partition in a disk according to the size of the upgrade package;
receiving a distribution record of the download amount of the upgrade package distributed by each partition sent by the terminal equipment, and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record;
and sequentially sending the plurality of upgrade package fragments to the terminal equipment, so that the terminal equipment respectively writes each upgrade package fragment into the corresponding subarea according to the distribution record, and carries out system upgrade by using the plurality of upgrade package fragments.
In the method for upgrading a system with insufficient disk space according to the embodiment of the present invention, the correspondingly dividing an upgrade package into a plurality of upgrade package fragments according to the allocation record specifically includes:
and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
Another object of an embodiment of the present invention is to provide a terminal device, including:
the first calculation module is used for calculating the size of the available space of each partition in the terminal equipment disk;
the second calculation module is used for accumulating the size of the available space of all the partitions;
the second judgment module is used for judging whether the size of the available space of all the partitions is smaller than the size of the upgrade package;
the second downloading module is used for sequentially distributing the downloading quantity of the upgrade package for each partition when the size of the available space of all the partitions is larger than or equal to the size of the upgrade package, and sending a distribution record to the server, so that the server sequentially returns the upgrade package to the terminal equipment after dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record; receiving a plurality of upgrade package fragments issued by the server, and writing each upgrade package fragment into a corresponding partition according to the distribution record;
and the second upgrading module is used for upgrading the system by utilizing the plurality of upgrading package fragments.
In the terminal device according to the embodiment of the present invention, the method further includes:
the first judgment module is used for judging whether the partition with the largest available space can sufficiently accommodate the upgrade package, and controlling the second calculation module to accumulate the size of the available space of all the partitions when the partition with the largest available space can not accommodate the upgrade package;
the first downloading module is used for downloading the upgrade package to the partition with the largest available space when the partition with the largest available space is enough to accommodate the upgrade package;
and the first upgrading module is used for upgrading the system by using the upgrading packet.
In the terminal device according to the embodiment of the present invention, the second downloading module is specifically configured to:
and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
In the terminal device according to the embodiment of the present invention, the second upgrade module is specifically configured to:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition;
sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command;
performing read-only locking on the upgrade package in the memory;
checking the integrity of the upgrade package in the memory;
if the verification fails, deleting the upgrade package in the memory, and loading the upgrade package segments in each partition into the memory again;
and if the verification is passed, the system is upgraded by using the upgrade package.
Another object of an embodiment of the present invention is to provide a server, including:
the receiving module is used for receiving a request for inquiring the size of an upgrade package required by system upgrade, which is sent by terminal equipment, and returning the size of the upgrade package to the terminal equipment according to the request, so that the terminal equipment distributes the download quantity of the upgrade package of each partition in a disk according to the size of the upgrade package;
the upgrade package segmentation module is used for receiving a distribution record of the download amount of the upgrade package distributed by each partition sent by the terminal equipment and correspondingly segmenting the upgrade package into a plurality of upgrade package segments according to the distribution record;
and the sending module is used for sending the plurality of upgrade package fragments to the terminal equipment in sequence, so that the terminal equipment writes each upgrade package fragment into the corresponding subarea according to the distribution record respectively, and carries out system upgrade by using the plurality of upgrade package fragments.
In the server according to the embodiment of the present invention, the upgrade package segmentation module is specifically configured to:
and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
The system upgrading method, the terminal equipment and the server with insufficient disk space provided by the embodiment of the invention have the following beneficial effects:
the embodiment of the invention firstly calculates the size of the available space of each partition in the terminal equipment disk; accumulating the size of available space of all partitions in the disk, if the size of the available space of all the partitions in the disk is larger than the size of an upgrade package, distributing corresponding download quantity of the upgrade package for each partition according to the size of the upgrade package and the size of the available space of each partition in the disk, sending distribution records to a server, enabling the server to correspondingly divide the upgrade package into a plurality of upgrade package fragments according to the distribution records, finally receiving the plurality of upgrade package fragments issued by the server by terminal equipment, respectively writing the plurality of upgrade package fragments into corresponding partitions according to the distribution records, and performing system upgrade by utilizing the plurality of upgrade package fragments, thereby avoiding the problem that the terminal equipment can not successfully complete system upgrade or bring bad experience to users when the available space of a fixed partition used for storing the upgrade package in the disk is insufficient in the prior art, the available space in each partition in the disk can be fully utilized, and the stability of system upgrading and the experience of a user are greatly improved.
Drawings
Fig. 1 is a flowchart of a specific implementation of a system upgrading method for insufficient disk space according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a specific implementation of a system upgrade method for insufficient disk space according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a flowchart of a specific implementation of a system upgrading method with insufficient disk space according to a first embodiment of the present invention, where an execution subject of the method is a terminal device described in the embodiment of the present invention. Referring to fig. 1, the method for upgrading a system with insufficient disk space provided in this embodiment includes:
in S101, the size of the available space of each partition in the terminal device disk is calculated.
In this embodiment, some partitions in the disk need to have a certain reserved space, which may be a guarantee of normal operation of the system, so when a certain reserved space is needed in a partition, an available space of the partition is a free space in the partition except the reserved space, and when a reserved space is not needed in a partition, an available space of the partition is a free space of the partition.
In S102, determining whether the partition with the largest available space is enough to accommodate the upgrade package, and when the partition with the largest available space is enough to accommodate the upgrade package, entering step S103; when the partition with the largest available space cannot accommodate the upgrade package, the process proceeds to step S104.
In this embodiment, before determining whether the partition with the largest available space is enough to accommodate the upgrade package, the size of the upgrade package required for system upgrade needs to be queried for the server, and then, according to the size of the largest available space and the size of the upgrade package, it is determined whether the partition with the largest available space is enough to accommodate the upgrade package, and when the size of the largest available space is greater than or equal to the size of the upgrade package, it is determined that the partition with the largest available space is enough to accommodate the upgrade package, at this time, step S103 is performed; when the size of the maximum available space is smaller than the size of the upgrade package, it indicates that the partition with the maximum available space cannot accommodate the upgrade package, and then step S104 is entered.
In S103, the upgrade package is downloaded to the partition with the largest available space, and system upgrade is performed using the upgrade package.
In this embodiment, when the size of the maximum available space in the terminal device is larger than the size of the upgrade package, the terminal device sends a corresponding download instruction to the server, where the download instruction includes an identifier of the partition having the maximum available space, so that the server can add the identifier of the partition having the maximum available space to the upgrade package according to the download instruction sent by the terminal device, so that when the terminal device receives the upgrade package returned by the server, the upgrade package is written into the partition having the maximum available space, and finally, the terminal device performs system upgrade by using the upgrade package, and finishes the process after the upgrade is completed.
In S104, accumulating the sizes of the available spaces of all the partitions, and determining whether the sizes of the available spaces of all the partitions are smaller than the size of the upgrade package, and when the sizes of the available spaces of all the partitions are larger than or equal to the size of the upgrade package, entering step S105; when the size of the available space of all partitions is smaller than the size of the upgrade package, the process proceeds to step S107.
In S105, sequentially allocating upgrade package download amounts to the partitions, and sending an allocation record to the server, so that the server divides the upgrade package into a plurality of upgrade package fragments according to the allocation record and then sequentially returns the upgrade package fragments to the terminal device;
in this embodiment, the sequentially allocating the upgrade package download amount to each partition specifically includes: and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
In S106, a plurality of upgrade package fragments delivered by the server are received, and each upgrade package fragment is written into a corresponding partition according to the distribution record, and system upgrade is performed using the plurality of upgrade package fragments.
In this embodiment, according to the corresponding relationship between the partition identifier and the download amount of the upgrade package in the distribution record, when the terminal device receives a plurality of upgrade package fragments issued by the server, the terminal device may respectively write each upgrade package fragment into each corresponding partition according to the distribution record. Further, the system upgrading by using a plurality of upgrade package fragments specifically includes:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition; sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command; performing read-only locking on the upgrade package in the memory; checking the integrity of the upgrade package in the memory; if the verification fails, deleting the upgrade package in the memory, and returning to the step of loading the upgrade package segments in each partition into the memory in sequence according to the record; and if the verification is passed, the system is upgraded by using the upgrade package.
In this embodiment, after the upgrade package segments are combined into a complete upgrade package in the memory, the memory loaded with the upgrade package is read-only locked, so that it can be ensured that the part of the memory can only be read, cannot be rewritten and recycled, and the upgrade package cannot be damaged in the upgrade process.
In S107, the present system upgrade is abandoned.
In this embodiment, when the cumulative size of the available space of all the partitions in the disk is still smaller than the size of the upgrade package, it indicates that the disk cannot accommodate the upgrade package, and at this time, the terminal device may automatically give up the upgrade, and prompt the user about prompt information that the disk space is insufficient and the upgrade fails, so that the user takes corresponding remedial measures according to the prompt information.
As can be seen from the above, in the system upgrading method for insufficient disk space provided in this embodiment, the size of the available space of each partition in the disk of the terminal device is first calculated, and it is determined whether the partition with the largest available space is enough to accommodate the upgrade package; when the partition with the largest available space can not accommodate the upgrade package, accumulating the size of the available space of all the partitions in the disk, if the size of the available space of all the partitions in the disk is larger than the size of the upgrade package, distributing corresponding download amount of the upgrade package for each partition according to the size of the upgrade package and the size of the available space of each partition in the disk, sending distribution records to a server, enabling the server to correspondingly divide the upgrade package into a plurality of upgrade package fragments according to the distribution records, finally receiving the plurality of upgrade package fragments sent by the server by the terminal device, respectively writing the plurality of upgrade package fragments into the corresponding partitions according to the distribution records, and utilizing the plurality of upgrade package fragments to carry out system upgrade, thereby avoiding the problem that the terminal device can not smoothly complete the system upgrade or bring bad experience to a user when the available space of a fixed partition for storing the upgrade package in the disk is insufficient in the prior art, the available space in each partition in the disk can be fully utilized, and the stability of system upgrading and the experience of a user are greatly improved.
Fig. 2 is a flowchart of a specific implementation of a system upgrading method with insufficient disk space according to a second embodiment of the present invention, where an execution subject of the method is a server in the implementation of the present invention. Referring to fig. 2, the method for upgrading a system with insufficient disk space provided in this embodiment includes:
in S201, receiving a request for querying a size of an upgrade package required for system upgrade, sent by a terminal device, and returning the size of the upgrade package to the terminal device according to the request, so that the terminal device allocates the download amount of the upgrade package of each partition in a disk according to the size of the upgrade package;
in S202, receiving a distribution record of download amount of the upgrade package distributed by each partition sent by the terminal device, and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record;
in S203, the plurality of upgrade package fragments are sequentially sent to the terminal device, so that the terminal device writes each upgrade package fragment into a corresponding partition according to the distribution record, and performs system upgrade using the plurality of upgrade package fragments.
In this embodiment, the correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record specifically includes: and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
The system upgrading method with insufficient disk space provided by the embodiment can also avoid the problem that in the prior art, when the available space of the fixed partition used for storing the upgrade package in the disk is insufficient, the terminal device can not smoothly complete the system upgrading or bad experience is brought to a user, the available space in each partition in the disk can be fully utilized, and the stability of the system upgrading and the experience of the user are greatly improved.
Fig. 3 is a schematic structural diagram of a terminal device according to a third embodiment of the present invention, where the terminal device is configured to execute the method according to the embodiment of the present invention shown in fig. 1. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 3, the terminal device provided in this embodiment includes:
the first calculating module 31 is configured to calculate the size of an available space of each partition in a disk of the terminal device;
a second calculating module 35, configured to accumulate sizes of available spaces of all partitions;
a second judging module 36, configured to judge whether the size of the available space of all the partitions is smaller than the size of the upgrade package;
the second downloading module 37 is configured to, when the size of the available space of all the partitions is greater than or equal to the size of the upgrade package, sequentially allocate an upgrade package downloading amount to each partition, and send an allocation record to the server, so that the server divides the upgrade package into a plurality of upgrade package fragments according to the allocation record and then sequentially returns the upgrade package fragments to the terminal device; respectively writing each upgrade package fragment into a corresponding partition according to the mark in each upgrade package fragment; when the size of the available space of all the partitions is smaller than that of the upgrade package, abandoning the system upgrade;
and a second upgrade module 38, configured to perform system upgrade using a plurality of the upgrade package fragments.
Optionally, the terminal device further includes:
the first judging module 32 is configured to judge whether the partition with the largest available space is enough to accommodate the upgrade package, and when the partition with the largest available space cannot accommodate the upgrade package, control the second calculating module to accumulate sizes of available spaces of all the partitions;
a first downloading module 33, configured to download the upgrade package to the partition with the largest available space when the partition with the largest available space is enough to accommodate the upgrade package;
a first upgrade module 34, configured to perform system upgrade using the upgrade package;
optionally, the second downloading module 37 is specifically configured to:
and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
Optionally, the second upgrade module 38 is specifically configured to:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition;
sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command;
performing read-only locking on the upgrade package in the memory;
checking the integrity of the upgrade package in the memory;
if the verification fails, deleting the upgrade package in the memory, and loading the upgrade package segments in each partition into the memory again;
and if the verification is passed, the system is upgraded by using the upgrade package.
Optionally, the available space is a free space in the partition except for the reserved space.
It should be noted that, since each module in the terminal device provided in the embodiment of the present invention is based on the same concept as the method embodiment shown in fig. 1 of the present invention, the technical effect brought by the module is the same as the method embodiment shown in fig. 1 of the present invention, and specific contents may refer to the description in the method embodiment shown in fig. 1 of the present invention, and are not described again here.
Therefore, it can be seen that, in the terminal device provided in this embodiment, the size of the available space of each partition in the disk of the terminal device is calculated at first, and whether the partition with the largest available space is enough to accommodate the upgrade package is determined; when the partition with the largest available space can not accommodate the upgrade package, accumulating the size of the available space of all the partitions in the disk, if the size of the available space of all the partitions in the disk is larger than the size of the upgrade package, distributing corresponding download amount of the upgrade package for each partition according to the size of the upgrade package and the size of the available space of each partition in the disk, sending distribution records to a server, enabling the server to correspondingly divide the upgrade package into a plurality of upgrade package fragments according to the distribution records, finally receiving the plurality of upgrade package fragments sent by the server by the terminal device, respectively writing the plurality of upgrade package fragments into the corresponding partitions according to the distribution records, and utilizing the plurality of upgrade package fragments to carry out system upgrade, thereby avoiding the problem that the terminal device can not smoothly complete the system upgrade or bring bad experience to a user when the available space of a fixed partition for storing the upgrade package in the disk is insufficient in the prior art, the available space in each partition in the disk can be fully utilized, and the stability of system upgrading and the experience of a user are greatly improved.
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention, which is used for executing the method according to the embodiment of the present invention shown in fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 4, the server provided in this embodiment includes:
a receiving module 41, configured to receive a request, sent by a terminal device, for querying a size of an upgrade package required for system upgrade, and return the size of the upgrade package to the terminal device according to the request, so that the terminal device allocates, according to the size of the upgrade package, an upgrade package download amount of each partition in a disk;
the upgrade package segmentation module 42 is configured to receive a distribution record of download amounts of the upgrade packages distributed by the partitions and sent by the terminal device, and segment the upgrade packages into a plurality of upgrade package segments according to the distribution record;
and the sending module 43 is configured to send the plurality of upgrade package fragments to the terminal device in sequence, so that the terminal device writes each upgrade package fragment into a corresponding partition according to the distribution record, and performs system upgrade by using the plurality of upgrade package fragments.
Optionally, the upgrade package segmentation module 42 is specifically configured to:
and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
The server provided by the embodiment can also avoid the problem that in the prior art, when the available space of the fixed partition for storing the upgrade package in the disk is insufficient, the terminal device can not smoothly complete system upgrade or bring poor experience to a user, the available space in each partition in the disk can be fully utilized, and the stability of system upgrade and the experience of the user are greatly improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (12)

1. A system upgrading method for disk space shortage is characterized by comprising the following steps:
calculating the size of the available space of each partition in the terminal equipment disk;
accumulating the sizes of the available spaces of all the partitions, and judging whether the sizes of the available spaces of all the partitions are smaller than the size of the upgrade package;
when the size of the available space of all the partitions is larger than or equal to the size of the upgrade package, sequencing the partitions from large to small according to the available space, sequentially distributing the download quantity of the upgrade package for each partition, and sending a distribution record to a server, so that the server sequentially returns the upgrade package to the terminal equipment after dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record;
and receiving a plurality of upgrade package fragments issued by the server, writing each upgrade package fragment into a corresponding partition according to the distribution record, and performing system upgrade by using the plurality of upgrade package fragments.
2. The method for upgrading a system with insufficient disk space according to claim 1, wherein the step of accumulating the sizes of the available spaces of all the partitions and determining whether the sizes of the available spaces of all the partitions are smaller than the size of the upgrade package further comprises the steps of:
judging whether the partition with the largest available space is enough to accommodate the upgrade package;
when the partition with the largest available space can not accommodate the upgrade package, the method enters the steps of accumulating the size of the available space of all the partitions and judging whether the size of the available space of all the partitions is smaller than that of the upgrade package;
and when the partition with the largest available space is enough to accommodate the upgrade package, downloading the upgrade package to the partition with the largest available space, and performing system upgrade by using the upgrade package.
3. The method for upgrading a system with insufficient disk space according to claim 1, wherein the sequentially allocating download amounts of upgrade packages to the partitions specifically comprises:
and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
4. The method for upgrading a system with insufficient disk space according to claim 2, wherein the upgrading the system by using a plurality of upgrade package fragments specifically comprises:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition;
sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command;
performing read-only locking on the upgrade package in the memory;
checking the integrity of the upgrade package in the memory;
if the verification fails, deleting the upgrade package in the memory, and returning to the step of loading the upgrade package segments in each partition into the memory in sequence according to the record;
and if the verification is passed, the system is upgraded by using the upgrade package.
5. A system upgrading method for disk space shortage is characterized by comprising the following steps:
receiving a request for inquiring the size of an upgrade package required by system upgrade, which is sent by a terminal device, and returning the size of the upgrade package to the terminal device according to the request, so that the terminal device sorts the partitions in the disk from large to small according to the available space, and allocates the download amount of the upgrade package of each partition in the disk according to the size of the upgrade package;
receiving a distribution record of the download amount of the upgrade package distributed by each partition sent by the terminal equipment, and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record;
and sequentially sending the plurality of upgrade package fragments to the terminal equipment, so that the terminal equipment respectively writes each upgrade package fragment into the corresponding subarea according to the distribution record, and carries out system upgrade by using the plurality of upgrade package fragments.
6. The method for upgrading a system with insufficient disk space according to claim 5, wherein the correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record specifically comprises:
and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
7. A terminal device, comprising:
the first calculation module is used for calculating the size of the available space of each partition in the terminal equipment disk;
the second calculation module is used for accumulating the size of the available space of all the partitions;
the second judgment module is used for judging whether the size of the available space of all the partitions is smaller than that of the upgrade package;
the second downloading module is used for sequencing the partitions from large to small according to the available space when the size of the available space of all the partitions is larger than or equal to the size of the upgrade package, sequentially distributing the download quantity of the upgrade package for each partition, and sending a distribution record to the server so that the server sequentially returns the upgrade package to the terminal equipment after dividing the upgrade package into a plurality of upgrade package fragments according to the distribution record; receiving a plurality of upgrade package fragments issued by the server, and writing each upgrade package fragment into a corresponding partition according to the distribution record;
and the second upgrading module is used for upgrading the system by utilizing the plurality of upgrading package fragments.
8. The terminal device of claim 7, further comprising:
the first judgment module is used for judging whether the partition with the largest available space can sufficiently accommodate the upgrade package, and controlling the second calculation module to accumulate the size of the available space of all the partitions when the partition with the largest available space can not accommodate the upgrade package;
the first downloading module is used for downloading the upgrade package to the partition with the largest available space when the partition with the largest available space is enough to accommodate the upgrade package;
and the first upgrading module is used for upgrading the system by using the upgrading packet.
9. The terminal device of claim 7, wherein the second download module is specifically configured to:
and sequencing the partitions according to the available space from large to small, and sequentially distributing the download amount of the upgrade packages from the partition with the largest available space.
10. The terminal device of claim 7, wherein the second upgrade module is specifically configured to:
acquiring distribution records of the download quantity of the upgrade package distributed by the terminal equipment for each partition;
sequentially loading the upgrade package fragments in each partition into a memory according to the distribution records, and combining the upgrade package fragments into a complete upgrade package through a cat command;
performing read-only locking on the upgrade package in the memory;
checking the integrity of the upgrade package in the memory;
if the verification fails, deleting the upgrade package in the memory, and loading the upgrade package segments in each partition into the memory again;
and if the verification is passed, the system is upgraded by using the upgrade package.
11. A server, comprising:
the receiving module is used for receiving a request for inquiring the size of an upgrade package required by system upgrade, which is sent by terminal equipment, returning the size of the upgrade package to the terminal equipment according to the request, sequencing all partitions in a disk from large to small according to available space by the terminal equipment, and distributing the download quantity of the upgrade package of each partition in the disk according to the size of the upgrade package;
the upgrade package segmentation module is used for receiving a distribution record of the download amount of the upgrade package distributed by each partition sent by the terminal equipment and correspondingly segmenting the upgrade package into a plurality of upgrade package segments according to the distribution record;
and the sending module is used for sending the plurality of upgrade package fragments to the terminal equipment in sequence, so that the terminal equipment writes each upgrade package fragment into the corresponding subarea according to the distribution record respectively, and carries out system upgrade by using the plurality of upgrade package fragments.
12. The server according to claim 11, wherein the upgrade package splitting module is specifically configured to:
and correspondingly dividing the upgrade package into a plurality of upgrade package fragments according to the corresponding relation between each partition identifier and the download amount of the upgrade package in the distribution record, and adding a corresponding partition identifier for each upgrade package fragment.
CN201610255784.1A 2016-04-22 2016-04-22 System upgrading method for insufficient disk space, terminal equipment and server Active CN105843656B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610255784.1A CN105843656B (en) 2016-04-22 2016-04-22 System upgrading method for insufficient disk space, terminal equipment and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610255784.1A CN105843656B (en) 2016-04-22 2016-04-22 System upgrading method for insufficient disk space, terminal equipment and server

Publications (2)

Publication Number Publication Date
CN105843656A CN105843656A (en) 2016-08-10
CN105843656B true CN105843656B (en) 2020-12-01

Family

ID=56590297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610255784.1A Active CN105843656B (en) 2016-04-22 2016-04-22 System upgrading method for insufficient disk space, terminal equipment and server

Country Status (1)

Country Link
CN (1) CN105843656B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992312A (en) * 2016-10-25 2018-05-04 中兴通讯股份有限公司 A kind of upgrade package delivery method and device
CN106970816B (en) * 2017-03-31 2021-01-26 Oppo广东移动通信有限公司 Software upgrading processing method and device and audio playing equipment
CN106909428A (en) * 2017-03-31 2017-06-30 广东欧珀移动通信有限公司 Software updating control method, device and electronic equipment
CN107092506A (en) * 2017-04-12 2017-08-25 惠州Tcl移动通信有限公司 A kind of application program for mobile terminal installation suggestion method and system
CN107193651B (en) * 2017-04-18 2019-11-12 广州视源电子科技股份有限公司 Dual system internal memory sharing method and device
CN107273156A (en) * 2017-06-06 2017-10-20 珠海全志科技股份有限公司 A kind of OTA upgrade methods and device
CN107220008B (en) * 2017-06-27 2020-08-07 北京小米移动软件有限公司 Storage space reservation method and device
TWI722269B (en) * 2018-01-26 2021-03-21 和碩聯合科技股份有限公司 Firmware updating method and electronic device using the same
CN108446130A (en) * 2018-03-12 2018-08-24 北京百瑞互联技术有限公司 OTA upgrade methods
CN110502256A (en) * 2018-05-18 2019-11-26 佛山市顺德区美的电热电器制造有限公司 A kind of method for upgrading software, terminal and storage medium
CN108572837A (en) * 2018-06-11 2018-09-25 广州视源电子科技股份有限公司 Method for upgrading software, device, readable storage medium storing program for executing and computer equipment
CN109450962B (en) * 2018-08-30 2021-08-10 百度在线网络技术(北京)有限公司 Data transmission method, packaging server, storage server and readable storage medium
CN109947450B (en) * 2019-03-19 2023-03-17 深圳创维-Rgb电子有限公司 System file upgrading method and device, mobile terminal and readable storage medium
CN110134416A (en) * 2019-04-12 2019-08-16 平安普惠企业管理有限公司 Oftware updating method, device and computer readable storage medium
CN110221856B (en) * 2019-06-25 2024-03-19 努比亚技术有限公司 Wearable device upgrading method, wearable device and storage medium
CN112817617A (en) * 2019-11-18 2021-05-18 华为技术有限公司 Software upgrading method, device and system
CN113010195B (en) * 2019-12-19 2023-03-10 深圳Tcl数字技术有限公司 System upgrading method, storage medium and terminal equipment
CN113094077B (en) * 2019-12-23 2023-08-01 深圳Tcl数字技术有限公司 System differential upgrading method and device, intelligent terminal and storage medium
CN111124451A (en) * 2019-12-24 2020-05-08 山东有人信息技术有限公司 Distributed backup upgrading method
CN111459524A (en) * 2020-04-02 2020-07-28 安谋科技(中国)有限公司 Software upgrading method, device and system
CN114661322B (en) * 2022-03-11 2023-05-23 荣耀终端有限公司 Upgrade method of operating system, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7249152B2 (en) * 2002-05-24 2007-07-24 Oracle International Corporation Dynamic disk space management by multiple database server instances in a cluster configuration

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557407B (en) * 2008-04-11 2013-07-10 盛大计算机(上海)有限公司 Transmission and storage method of program-ordering data of high definition media P2P
CN102622184A (en) * 2011-01-27 2012-08-01 北京东方广视科技股份有限公司 Data storage system and method
CN102163155A (en) * 2011-03-09 2011-08-24 深圳创维数字技术股份有限公司 Upgrade controlling device and method for upgrading memory device
CN102096722B (en) * 2011-03-21 2013-03-27 华为数字技术(成都)有限公司 File storage method and device
CN103237300B (en) * 2013-04-28 2015-09-09 小米科技有限责任公司 A kind of method of file download, Apparatus and system
CN104077234B (en) * 2014-07-10 2017-03-08 三星电子(中国)研发中心 A kind of dynamic adjusting method of embedded system subregion and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7249152B2 (en) * 2002-05-24 2007-07-24 Oracle International Corporation Dynamic disk space management by multiple database server instances in a cluster configuration

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VB实现大型文件的分割与还原;张小娜,郭飞燕;《电脑学习》;20090430;全文 *
海啸文件分割器将超大文件切成碎片;吴宏;《https://article.pchome.net/content-659424.html》;20080704;第1-3页 *

Also Published As

Publication number Publication date
CN105843656A (en) 2016-08-10

Similar Documents

Publication Publication Date Title
CN105843656B (en) System upgrading method for insufficient disk space, terminal equipment and server
CN110058873B (en) Application page updating method, device, equipment and storage medium
CN110096302B (en) Software data storage and upgrading method, device, equipment and storage medium
US20050257023A1 (en) Device memory management during electronic file updating
CN111796856B (en) Differential upgrading method and device, storage medium and computer equipment
CN107122133B (en) Data storage method and device
CN107506221A (en) Application program updating method, apparatus and equipment
CN103559054A (en) Implementing and deleting method and device for intelligent terminal multi-operation system
CN110337036A (en) Upgrade method, device and the storage medium of set-top box
WO2018145392A1 (en) Differential update method and device, terminal, storage medium, and processor
CN105867962A (en) System upgrading method and device
CN110968589A (en) Self-adding ID management method and device in distributed system
CN110990356B (en) Real-time automatic capacity expansion method and system for logical mirror image
CN110737389B (en) Method and device for storing data
CN111562929A (en) Method, device and equipment for generating patch file and storage medium
CN107957878B (en) Embedded equipment software online upgrading method based on storage resource redistribution
CN104778068A (en) Management system and management method of software installation package for mobile terminal
CN112269665B (en) Memory processing method and device, electronic equipment and storage medium
CN112379867B (en) Embedded operating system, method and storage medium based on modular development
US20170090820A1 (en) Method and device for operating a many-core system
CN114296764A (en) System upgrading method and device, storage medium and electronic equipment
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
CN111984299A (en) Data loading method and equipment
CN112312212A (en) Upgrading method of digital television system and related device
CN113268266B (en) Multi-version coexistence management method, system and medium for applet rendering framework

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 516006 TCL technology building, No.17, Huifeng Third Road, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Applicant after: TCL Technology Group Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. nineteen District

Applicant before: TCL RESEARCH AMERICA Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant