CN116775063A - EMMC self-adaptive upgrading method, device, computer equipment and storage medium - Google Patents

EMMC self-adaptive upgrading method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116775063A
CN116775063A CN202210215700.7A CN202210215700A CN116775063A CN 116775063 A CN116775063 A CN 116775063A CN 202210215700 A CN202210215700 A CN 202210215700A CN 116775063 A CN116775063 A CN 116775063A
Authority
CN
China
Prior art keywords
capacity
emmc
upgrade
user data
upgrade package
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.)
Pending
Application number
CN202210215700.7A
Other languages
Chinese (zh)
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.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Priority to CN202210215700.7A priority Critical patent/CN116775063A/en
Publication of CN116775063A publication Critical patent/CN116775063A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses an EMMC self-adaptive upgrading method, a device, a computer device and a storage medium, wherein the EMMC self-adaptive upgrading method comprises the following steps: acquiring a first capacity of the EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, and comprises a plurality of partitions, and the partitions comprise user data partitions; acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package; and when the difference value between the first capacity and the second capacity is larger than the capacity threshold value, the user data partition is adjusted according to the first capacity and the capacity threshold value so as to realize the self-adaptive upgrading of the EMMC. According to the application, one upgrade package can support the upgrade of the same series of EMMC with different capacities, the upgrade packages of different partitions are prevented from being additionally added to automatically adapt to the EMMC with different capacities, the data size of the upgrade file is small, the software maintenance is convenient, and the competitiveness of the product is improved.

Description

EMMC self-adaptive upgrading method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to an EMMC adaptive upgrade method, apparatus, computer device, and storage medium.
Background
An embedded multimedia card (English full name: embeded Multi Media Card, abbreviated to EMMC) is established by the MMC society, and is mainly aimed at the standard specification of an embedded memory of a mobile electronic product such as a mobile phone or a tablet computer. The EMMC is used as an important component of equipment hardware, bears important responsibility for storing data resources, and can be configured with EMMC with different capacities in the same series of products according to different equipment positioning. In order to adapt to the EMMC with different capacities, the upgrade files of the device system need to be prepared with upgrade packages with different capacities, and as the capacities of the adapted EMMC are increased, the upgrade files become larger and larger, meanwhile, when the software is compiled and packaged, the packaging flow of the EMMC with different capacities needs to be increased, and the software is inconvenient to maintain.
Disclosure of Invention
The embodiment of the application provides an EMMC self-adaptive upgrading method, device, computer equipment and storage medium, so that one upgrading package can support the upgrading of the same series of EMMC with different capacities, the addition of upgrading packages of different partitions is avoided to automatically adapt to the EMMC with different capacities, the data size of upgrading files is small, software maintenance is convenient, and the competitiveness of products is improved.
In one aspect, the present application provides an EMMC adaptive upgrade method, which includes:
acquiring a first capacity of an EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the plurality of partitions comprise user data partitions;
acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
In some embodiments of the present application, the obtaining the first capacity of the EMMC includes:
and calling a preset self-adaptive function to initialize the EMMC, and acquiring a first capacity of the EMMC through the initialization of the EMMC.
In some embodiments of the present application, the obtaining the second capacity of the upgrade package includes:
acquiring a third capacity of each partition in the upgrade package;
and determining the second capacity of the upgrade package according to the third capacity.
In some embodiments of the present application, the adjusting the user data partition according to the first capacity and the capacity threshold comprises:
re-dividing the user data partition according to the first capacity and the capacity threshold;
and writing the user partition data in the user data partition backed up in advance into the user data partition after repartitioning.
In some embodiments of the present application, the repartitioning the user data partition according to the first capacity and the capacity threshold comprises:
acquiring a third capacity of the upgrade package, wherein the third capacity is the sum of the capacities of all the partitions except the user data partition in the upgrade package;
and re-dividing the user data partition according to the third capacity, the first capacity and the capacity threshold.
In some embodiments of the present application, the repartitioning the user data partition according to the third capacity, the first capacity, and the capacity threshold comprises:
determining a fourth capacity according to the third capacity, the first capacity and the capacity threshold;
and according to the fourth capacity, the user data partition is repartitioned.
In some embodiments of the present application, before the repartitioning the user data partition according to the first capacity and the capacity threshold, the method further comprises:
acquiring user partition data stored in the user data partition;
and backing up the user partition data.
In another aspect, the present application provides an EMMC adaptive upgrade apparatus, including:
the data acquisition unit is used for acquiring a first capacity of the EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the partitions comprise user data partitions;
the data comparison unit is used for acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and the partition adjusting unit is used for adjusting the user data partition according to the first capacity and the capacity threshold value when the difference value between the first capacity and the second capacity is larger than the capacity threshold value so as to realize the self-adaptive upgrading of the EMMC.
In another aspect, the present application also provides a computer apparatus, including:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the EMMC adaptive upgrade method of any one of the first aspects.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program to be loaded by a processor to perform the steps of the EMMC adaptive upgrade method of any one of the first aspects.
When the difference between the first capacity and the second capacity is larger than the capacity threshold, the user data partition in the upgrade package is adjusted according to the first capacity and the capacity threshold, so that one upgrade package can support the upgrade of the same series of EMMC with different capacities, the upgrade packages of different partitions are prevented from being additionally added to automatically adapt to the EMMC with different capacities, the data size of upgrade files is small, software maintenance is convenient, and the competitiveness of products is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scene of an EMMC adaptive upgrade system provided in an embodiment of the present application;
fig. 2 is a flow chart of an embodiment of an EMMC adaptive upgrade method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an embodiment of an EMMC adaptive upgrade apparatus provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of an embodiment of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the drawings are merely for convenience in describing the present application and simplifying the description, and do not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described as "exemplary" in this disclosure is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
It should be noted that, because the method of the embodiment of the present application is executed in the computer device, the processing objects of each computer device exist in the form of data or information, for example, time, which is essentially time information, it can be understood that in the subsequent embodiment, if the size, the number, the position, etc. are all corresponding data, so that the computer device can process the data, which is not described herein in detail.
The embodiment of the application provides an EMMC self-adaptive upgrading method, an EMMC self-adaptive upgrading device, computer equipment and a storage medium, and the method, the device, the computer equipment and the storage medium are respectively described in detail below.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of an EMMC adaptive upgrade system according to an embodiment of the present application, where the EMMC adaptive upgrade system may include a computer device 100, and an EMMC adaptive upgrade apparatus, such as the computer device in fig. 1, is integrated in the computer device 100.
In the embodiment of the present application, the computer device 100 is mainly configured to obtain a first capacity of an EMMC and a preset upgrade package, where the upgrade package is a preset upgrade file for upgrading the EMMC, and the upgrade package includes a plurality of partitions, and the plurality of partitions includes a user data partition; acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package; when the difference value between the first capacity and the second capacity is larger than the capacity threshold, the user data partition is adjusted according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC, so that one upgrading package can support the upgrading of the same series of EMMC with different capacities, the upgrading package of different partitions is prevented from being additionally added to automatically adapt to the EMMC with different capacities, the data size of the upgrading file is small, the software maintenance is convenient, and the competitiveness of products is improved.
In the embodiment of the present application, the computer device 100 may be an independent server, or may be a server network or a server cluster formed by servers, for example, the computer device 100 described in the embodiment of the present application includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud server formed by a plurality of servers. Wherein the Cloud server is composed of a large number of computers or web servers based on Cloud Computing (Cloud Computing).
It is to be understood that the computer device 100 used in embodiments of the present application may be a device that includes both receive and transmit hardware, i.e., a device having receive and transmit hardware capable of performing bi-directional communications over a bi-directional communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may be one of a mobile phone, a tablet computer, a notebook computer, and the like.
It will be appreciated by those skilled in the art that the application environment shown in fig. 1 is merely an application scenario of the present application, and is not limited to the application scenario of the present application, and other application environments may further include more or fewer computer devices than those shown in fig. 1, for example, only 1 computer device is shown in fig. 1, and it will be appreciated that the EMMC adaptive upgrade system may further include one or more other services, which is not limited herein.
In addition, as shown in fig. 1, the EMMC adaptive upgrade system may further include a memory 200 for storing data, such as capacity data, for example, an actual capacity of the EMMC configured by the computer device 100, a capacity of a preset upgrade package, such as a preset capacity threshold.
It should be noted that, the schematic view of the scenario of the EMMC adaptive upgrade system shown in fig. 1 is only an example, and the EMMC adaptive upgrade system and the scenario described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art know, along with the evolution of the EMMC adaptive upgrade system and the appearance of the new service scenario, the technical solutions provided by the embodiments of the present application are applicable to similar technical problems.
Firstly, in the embodiment of the present application, an EMMC adaptive upgrade method is provided, an execution subject of the EMMC adaptive upgrade method is an EMMC adaptive upgrade apparatus, the EMMC adaptive upgrade apparatus is applied to a computer device, and the EMMC adaptive upgrade method includes: acquiring a first capacity of an EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the plurality of partitions comprise user data partitions; acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package; and when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
Fig. 2 is a schematic flow chart of an embodiment of an EMMC adaptive upgrade method according to an embodiment of the present application, where the EMMC adaptive upgrade method includes:
s100, acquiring a first capacity of the EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the partitions comprise user data partitions.
An embedded multimedia card (English full name: embeded Multi Media Card, abbreviated to EMMC) is established by the MMC society, and is mainly aimed at the standard specification of an embedded memory of a mobile electronic product such as a mobile phone or a tablet computer. The EMMC consists of an embedded memory solution, in which a controller is integrated in a package, providing a standard interface and managing flash memory, with a multimedia Card (english: multi Media Card, abbreviated: MMC) interface, a flash memory device and a main controller, the EMMC being an EMMC configured by a device, for example, the EMMC configured by the computer device 100 in fig. 1, the first capacity being the actual capacity of the EMMC, and the EMMC of different capacities being configured by the same product series depending on the location of the device, for example, 8G, 16G, 32G, etc.
The preset upgrade package is a preset upgrade file for upgrading the EMMC, the preset upgrade package can be obtained from the upgrade file of the device for configuring the EMMC, and upgrade packages with different capacities are generally configured in the traditional upgrade file, but in order to reduce the data volume and the software maintenance cost of the upgrade file, the same upgrade package is used for the EMMC with the same series of EMMCs with different capacities, and the preset upgrade package is the upgrade package corresponding to the EMMC with the smallest capacity in the EMMC with the same series of EMMCs with different capacities. The upgrade package includes a plurality of Partitions, and the plurality of Partitions may include, besides a User Data partition (User Data Area), other Partitions such as a startup partition (Boot Area Partitions), a User encryption and decryption User partition (Replay Protected Memory Block Partitions, RPMB Partitions), a general partition (General Purpose Partitions, GPP), and the like.
Because the same upgrade package is used by the same series of EMMCs with different capacities, the preset upgrade package is not necessarily adapted to the EMMCs, in order to achieve adaptive upgrade of the EMMCs, in this embodiment, first capacity of the EMMCs and the preset upgrade package are obtained first, so that in a subsequent step, whether the preset upgrade package is adapted to the EMMCs is judged according to the first capacity, that is, whether a plurality of partitions in the upgrade package are normal with respect to the EMMCs, and in the case that the partition of the plurality of partitions is abnormal, user data partitions in the upgrade package are adjusted, so that the preset upgrade package is adapted to the EMMCs.
In a specific embodiment, in step S100, the step of obtaining the first capacity of the EMMC includes:
s110, calling a preset self-adaptive function to initialize the EMMC, and acquiring a first capacity of the EMMC through the initialization of the EMMC.
In this embodiment, an adaptive function for acquiring the first capacity is preset, and when the first capacity of the EMMC needs to be acquired, the preset adaptive function is called to initialize the EMMC, and in the process of initializing the EMMC by the adaptive function, the adaptive function may call the EMMC driver, and the first capacity of the EMMC is acquired by calling the EMMC driver to read a register in the EMMC. For example, when the device is based on a Uboot system starting architecture, an emmc_self_adaptation function may be added to the Uboot and packaged in a CMD form, and when the first capacity of the EMMC needs to be obtained, the first capacity of the EMMC may be obtained by calling the emmc_self_adaptation function to initialize the EMMC.
S200, obtaining a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is a sum of capacities of all partitions in the upgrade package.
The second capacity is the sum of the capacities of all the partitions in the upgrade package, for example, when the upgrade package comprises a startup partition, a user encryption and decryption user partition, a general partition and a user data partition, the second capacity is the sum of the capacities of the startup partition, the user encryption and decryption user partition, the general partition and the user data partition. The capacity threshold is a preset capacity threshold for measuring whether a plurality of partitions in the upgrade package divide a normal capacity, and the inventor finds that for EMMC with capacity of 4G to 128G, the reserved capacity is different from 50M to 1024M, that is, the preset capacity threshold is 1% of the first capacity.
In this embodiment, after the first capacity and the preset upgrade package are acquired, the second capacity of the upgrade package is acquired, a difference value between the first capacity and the second capacity is compared with a preset threshold value, and whether a plurality of partitions in the upgrade package are normally divided is determined according to a comparison result between the difference value between the first capacity and the second capacity and the preset threshold value. For example, when the first capacity is T1 and the second capacity is T2, and the preset capacity threshold is P, comparing the difference between the first capacity and the second capacity, i.e., T1-T2, and the preset capacity threshold P, and determining whether the division of the plurality of partitions in the upgrade package is normal according to the comparison result.
In a specific embodiment, in step S200, the step of obtaining the second capacity of the upgrade package includes:
s210, obtaining third capacity of each partition in the upgrade package;
s220, determining the second capacity of the upgrade package according to the third capacity.
The upgrade package includes a plurality of partitions, each partition has its corresponding capacity, for example, the capacity of the boot area partition and the user encryption and decryption user partition is typically 4MB, and the capacity of the user data partition is typically the total capacity minus the capacities occupied by other partitions. In order to obtain the second capacity of the upgrade package, that is, the sum of the capacities of all the partitions in the upgrade package, the embodiment first obtains the third capacity of each partition in the upgrade package, and then adds the third capacities of each partition to obtain the second capacity of the upgrade package.
And S300, when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
The difference value between the first capacity and the second capacity represents the difference value between the actual capacity of the EMMC and the partition capacity, and when the difference value between the first capacity and the second capacity is not greater than the capacity threshold value, the difference value indicates that the partition capacity in the preset upgrade package is normally partitioned, and the EMMC can directly use the upgrade package to upgrade without adjusting the user data partition. When the difference between the first capacity and the second capacity is greater than the capacity threshold, it indicates that the capacity of the partition divided in the preset upgrade package is smaller than the actual capacity of the EMMC, and the user data partition needs to be adjusted.
Typically, the capacity of the other partitions of the several partitions except the user data partition is fixed, for example, the capacity of the boot partition and the user encryption and decryption user partition is typically 4MB. In this embodiment, when the difference between the first capacity and the second capacity is greater than a capacity threshold, that is, the capacity of the partition divided in the preset upgrade package is smaller than the actual capacity of the EMMC, the user data partition is adjusted according to the first capacity and the capacity threshold, so as to implement adaptive upgrade of the EMMC.
In one embodiment, the step of adjusting the user data partition according to the first capacity and the capacity threshold in step S300 includes:
s310, re-dividing the user data partition according to the first capacity and the capacity threshold;
s320, writing the user partition data in the user data partition backed up in advance into the user data partition after repartitioning.
The user partition data is data stored in the user data partition, when the difference between the first capacity and the second capacity is greater than the capacity threshold, the embodiment reclassifies the user data partition according to the first capacity and the capacity threshold, and writes the user partition data backed up in advance into the reclassifed user data partition, so that the EMMC can be upgraded by using a preset upgrade package, thereby realizing the adaptive upgrade of the EMMC.
In one embodiment, step S310 includes:
s311, obtaining a third capacity of the upgrade package, wherein the third capacity is the sum of the capacities of all the partitions except the user data partition in the upgrade package;
s312, the user data partition is divided again according to the third capacity, the first capacity and the capacity threshold.
The third capacity is the sum of the capacities of all the partitions except the user data partition in the upgrade package, for example, when the partitions comprise the user data partition, the starting partition, the user encryption and decryption user partition and the universal partition, the third capacity is the sum of the capacities of the starting partition, the user encryption and decryption user partition and the universal partition. When the user data partition is re-divided, the third capacity of the upgrade package is obtained first, and then the user data partition is re-divided according to the third capacity, the first capacity and the capacity threshold value, so as to realize the self-adaptive upgrade of the EMMC.
In one embodiment, step S312 includes:
s3121, determining a fourth capacity according to the third capacity, the first capacity and the capacity threshold;
and S3122, re-dividing the user data partition according to the fourth capacity.
The fourth capacity is the difference value between the third capacity, the first capacity and the capacity threshold, the calculation formula of the fourth capacity is T4=T1-T2-P, wherein T4 is the fourth capacity, T1 is the first capacity, T2 is the second capacity, and P is the capacity threshold. When the user data partition is re-divided, the fourth capacity is first determined according to the third capacity, the first capacity and the capacity threshold, and then the fourth capacity is used as the capacity of the user data partition to re-divide the user data partition.
In a specific embodiment, before step S310, the method further includes:
s301, acquiring user partition data stored in the user data partition;
s302, backing up the user partition data.
In order to avoid the loss of the user partition data stored in the user data partition, the embodiment acquires the user partition data stored in the user data partition, backs up the user partition data, and erases the user partition data in the user partition data before the user data partition is re-divided according to the first capacity and the capacity threshold. For example, when the device starts the architecture based on the Uboot system, the device enters a recovery mode to erase the user partition data in the user partition data.
In order to better implement the EMMC self-adaptive upgrade method in the embodiment of the present application, on the basis of the EMMC self-adaptive upgrade method, the embodiment of the present application further provides an EMMC self-adaptive upgrade apparatus, as shown in fig. 3, where the EMMC self-adaptive upgrade apparatus 600 includes:
a data obtaining unit 601, configured to obtain a first capacity of an EMMC and a preset upgrade package, where the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package includes a plurality of partitions, and the plurality of partitions includes a user data partition;
a data comparing unit 602, configured to obtain a second capacity of the upgrade package, and compare a difference between the first capacity and the second capacity with a preset capacity threshold, where the second capacity is a sum of capacities of all partitions in the upgrade package;
and a partition adjustment unit 603, configured to adjust the user data partition according to the first capacity and the capacity threshold when the difference between the first capacity and the second capacity is greater than the capacity threshold, so as to implement adaptive upgrade of the EMMC.
In the embodiment of the application, when the difference between the first capacity and the second capacity is larger than the capacity threshold, the user data partition in the upgrade package is adjusted according to the first capacity and the capacity threshold, so that one upgrade package can support the upgrade of the same series of EMMC with different capacities, the upgrade packages of different partitions are prevented from being additionally added to automatically adapt to the EMMC with different capacities, the upgrade file data size is small, the software maintenance is convenient, and the competitiveness of products is improved.
In some embodiments of the present application, the data acquisition unit 601 is specifically configured to:
and calling a preset self-adaptive function to initialize the EMMC, and acquiring a first capacity of the EMMC through the initialization of the EMMC.
In some embodiments of the present application, the data comparing unit 602 is specifically configured to:
acquiring a third capacity of each partition in the upgrade package;
and determining the second capacity of the upgrade package according to the third capacity.
In some embodiments of the present application, the partition adjusting unit 603 is specifically configured to:
re-dividing the user data partition according to the first capacity and the capacity threshold;
and writing the user partition data in the user data partition backed up in advance into the user data partition after repartitioning.
In some embodiments of the present application, the partition adjusting unit 603 is specifically further configured to:
acquiring a third capacity of the upgrade package, wherein the third capacity is the sum of the capacities of all the partitions except the user data partition in the upgrade package;
and re-dividing the user data partition according to the third capacity, the first capacity and the capacity threshold.
In some embodiments of the present application, the partition adjusting unit 603 is specifically further configured to:
determining a fourth capacity according to the third capacity, the first capacity and the capacity threshold;
and according to the fourth capacity, the user data partition is repartitioned.
In some embodiments of the present application, the EMMC adaptive upgrade apparatus 600 further includes:
a partition obtaining unit, configured to obtain user partition data stored in the user data partition;
and the data backup unit is used for backing up the user partition data.
The embodiment of the application also provides a computer device, which integrates any of the EMMC self-adaptive upgrading devices provided by the embodiment of the application, and the computer device comprises:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to perform, by the processor, the steps of the EMMC adaptive upgrade method described in any of the EMMC adaptive upgrade method embodiments described above.
The embodiment of the application also provides computer equipment which integrates any of the EMMC self-adaptive upgrading devices provided by the embodiment of the application. As shown in fig. 4, a schematic structural diagram of a computer device according to an embodiment of the present application is shown, specifically:
the computer device may include one or more processors 701 of a processing core, memory 702 of one or more computer readable storage media, power supply 703, and input unit 704, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 4 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 701 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 702, and calling data stored in the memory 702, thereby performing overall monitoring of the computer device. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide access to the memory 702 by the processor 701.
The computer device further comprises a power supply 703 for powering the various components, preferably the power supply 703 is logically connected to the processor 701 by a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 703 may also include one or more of any component, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.
The computer device may further comprise an input unit 704, which input unit 704 may be used for receiving input numerical or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 701 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 executes the application programs stored in the memory 702, so as to implement various functions, as follows:
acquiring a first capacity of an EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the plurality of partitions comprise user data partitions;
acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like. On which a computer program is stored, which is loaded by a processor to perform the steps of any of the EMMC adaptive upgrade methods provided by the embodiments of the present application. For example, the loading of the computer program by the processor may perform the steps of:
acquiring a first capacity of an EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the plurality of partitions comprise user data partitions;
acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of one embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of other embodiments, which are not described herein again.
In the implementation, each unit or structure may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit or structure may be referred to the foregoing method embodiments and will not be repeated herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The foregoing describes in detail a method, apparatus, computer device and storage medium for adaptively upgrading EMMC provided by the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (10)

1. The adaptive upgrade method of the EMMC is characterized by comprising the following steps of:
acquiring a first capacity of an EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the plurality of partitions comprise user data partitions;
acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and when the difference value between the first capacity and the second capacity is larger than the capacity threshold, adjusting the user data partition according to the first capacity and the capacity threshold so as to realize the self-adaptive upgrading of the EMMC.
2. The method for adaptively upgrading EMMC according to claim 1, wherein said obtaining the first capacity of EMMC comprises:
and calling a preset self-adaptive function to initialize the EMMC, and acquiring a first capacity of the EMMC through the initialization of the EMMC.
3. The EMMC adaptive upgrade method according to claim 1, wherein the obtaining the second capacity of the upgrade package includes:
acquiring a third capacity of each partition in the upgrade package;
and determining the second capacity of the upgrade package according to the third capacity.
4. The EMMC adaptive upgrade method of claim 1, wherein the adjusting the user data partition according to the first capacity and the capacity threshold comprises:
re-dividing the user data partition according to the first capacity and the capacity threshold;
and writing the user partition data in the user data partition backed up in advance into the user data partition after repartitioning.
5. The EMMC adaptive upgrade method of claim 4, wherein the repartitioning the user data partition according to the first capacity and the capacity threshold comprises:
acquiring a third capacity of the upgrade package, wherein the third capacity is the sum of the capacities of all the partitions except the user data partition in the upgrade package;
and re-dividing the user data partition according to the third capacity, the first capacity and the capacity threshold.
6. The EMMC adaptive upgrade method of claim 5, wherein the repartitioning the user data partition according to the third capacity, the first capacity, and the capacity threshold comprises:
determining a fourth capacity according to the third capacity, the first capacity and the capacity threshold;
and according to the fourth capacity, the user data partition is repartitioned.
7. The EMMC adaptive upgrade method of claim 4, wherein prior to repartitioning the user data partition according to the first capacity and the capacity threshold, the method further comprises:
acquiring user partition data stored in the user data partition;
and backing up the user partition data.
8. An EMMC adaptive upgrade apparatus, wherein the EMMC adaptive upgrade apparatus comprises:
the data acquisition unit is used for acquiring a first capacity of the EMMC and a preset upgrade package, wherein the upgrade package is a preset upgrade file for upgrading the EMMC, the upgrade package comprises a plurality of partitions, and the partitions comprise user data partitions;
the data comparison unit is used for acquiring a second capacity of the upgrade package, and comparing a difference value between the first capacity and the second capacity with a preset capacity threshold, wherein the second capacity is the sum of the capacities of all the partitions in the upgrade package;
and the partition adjusting unit is used for adjusting the user data partition according to the first capacity and the capacity threshold value when the difference value between the first capacity and the second capacity is larger than the capacity threshold value so as to realize the self-adaptive upgrading of the EMMC.
9. A computer device, the computer device comprising:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the EMMC adaptive upgrade method of any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon a computer program, the computer program being loaded by a processor to perform the steps of the EMMC adaptive upgrade method of any one of claims 1 to 7.
CN202210215700.7A 2022-03-07 2022-03-07 EMMC self-adaptive upgrading method, device, computer equipment and storage medium Pending CN116775063A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210215700.7A CN116775063A (en) 2022-03-07 2022-03-07 EMMC self-adaptive upgrading method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210215700.7A CN116775063A (en) 2022-03-07 2022-03-07 EMMC self-adaptive upgrading method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116775063A true CN116775063A (en) 2023-09-19

Family

ID=88010285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210215700.7A Pending CN116775063A (en) 2022-03-07 2022-03-07 EMMC self-adaptive upgrading method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116775063A (en)

Similar Documents

Publication Publication Date Title
CN106445834B (en) Managing operating state data in a memory module
CN103198450B (en) Image processing system
US20120110308A1 (en) Method for controlling bmc having customized sdr
US20100064036A1 (en) Peripheral device operation method, peripheral device and host
CN112214247B (en) System starting method and related equipment
US9715267B2 (en) Method for switching operating systems and electronic apparatus
CN111522602B (en) Method for starting communication device
US10996876B2 (en) Systems and methods for dynamically modifying memory namespace allocation based on memory attributes and application requirements
CN104516779B (en) System switching method and chip
US11797184B2 (en) SD card hot plugging identification method, SD card identification module and electronic device
CN110399168A (en) Majority according to disk storage server system start method, device and equipment
US10649832B2 (en) Technologies for headless server manageability and autonomous logging
US11226755B1 (en) Core dump in a storage device
CN110532032B (en) Startup file system detection method and related equipment
CN117389944A (en) Dual-path CPU control method, system, device and storage medium
CN116775063A (en) EMMC self-adaptive upgrading method, device, computer equipment and storage medium
CN115794232A (en) VPD (virtual private display) acquisition method, device, equipment and computer-readable storage medium
CN114048465B (en) Stack state detection method, device, equipment and storage medium
CN111078407B (en) Memory management method and device, storage medium and electronic equipment
CN114281570A (en) Embedded control circuit, control method, device and chip
CN109933292B (en) Memory command processing method, terminal and storage medium
CN115525208A (en) Storage management method, storage device, and storage medium
CN112948315A (en) Storage area sharing method, storage medium and electronic device
CN113010303A (en) Data interaction method and device between processors and server
CN117687703B (en) Method, device and system for starting server, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination