Downloading method of pac packet, starting method of terminal equipment, system and equipment
By dividing the storage areas of SLC mode and TLC mode according to the partition importance in the storage medium, and storing the partition image files to the corresponding areas, the problem of important partition data being damaged in the secondary furnace is solved, which improves production efficiency and reduces the defect rate.
Patent Information
- Application Number
- CN202510136451.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, the accuracy of the partition image files of important partitions under the secondary furnace process cannot be ensured, resulting in low production efficiency and high defect rate.
Through a method of downloading a pac package, in response to the download instruction, the storage medium is divided based on the pre-configured logical unit configuration information, and the storage area corresponding to different storage modes is obtained, and the partition image file is stored in the corresponding SLC mode or TLC mode storage area according to the importance of the partition.
It ensures the integrity of important partition data during the secondary furnace passing process, improves production efficiency and reduces the defect rate.
Smart Images

Figure CN120066611A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of storage devices, and particularly to a method for downloading a pac package, a method for starting a terminal device, a system, and a device. Background Art
[0002] Currently, in most embedded system design solutions on the market that use UFS (Universal Flash Storage) as the storage medium, when downloading an image file to the storage medium, in order to improve the storage space, most LUs (Logical Units) are configured in the TLC (Trinary-Level Cell) mode. Only the image files corresponding to the spl (Secondary Program Loader) and bootloader related to startup are placed in the LU corresponding to SLC (Single-Level Cell), and all other image files are placed in the LU corresponding to TLC.
[0003] The LU storage medium configured in TLC has poor stability at high temperatures. In high-temperature situations, some storage bits will experience bit inversion. During the production process, since the machine embedded with the storage medium needs to go through a second reflow after downloading the image file, the partition image files of some important partitions are damaged, which not only affects the factory production efficiency but also causes problems such as an increase in the defective rate. Summary of the Invention
[0004] The technical problem to be solved by the present disclosure is to overcome the defect in the prior art that it is impossible to ensure the accuracy of the partition image files of important partitions under the second reflow process, resulting in low production efficiency and high defective rate, and to provide a method for downloading a pac package (a fixed package used in Android devices), a method for starting a terminal device, a system, and a device.
[0005] The present disclosure solves the above technical problem through the following technical solutions:
[0006] According to a first aspect of the present disclosure, there is provided a method for downloading a pac package. The downloading method is applied to a terminal device and includes:
[0007] In response to a download instruction, divide the storage medium based on pre-configured logical unit configuration information to obtain storage areas corresponding to different storage modes, where the storage modes include the SLC mode and the TLC mode;
[0008] Download the PAC package, and store the partition image file of the first partition information in the corresponding storage area based on the matching result between the first partition information in the PAC package and the pre-configured second partition information.
[0009] Optionally, the first partition information includes a first partition identifier and the size of the corresponding partition image file, and the second partition information includes a second partition identifier corresponding to the target storage mode;
[0010] The steps of downloading the PAC package and storing the partition image file of the first partition information in the corresponding storage area based on the matching result between the first partition information in the PAC package and the pre-configured second partition information include:
[0011] Download the first partition information in the PAC package;
[0012] In response to the matching of the first partition identifier and the second partition identifier, divide a corresponding storage sub-area in the first storage area in the target storage mode according to the size of the partition image file, or, in response to the non-matching of the first partition identifier and the second partition identifier, divide the corresponding storage sub-area in the second storage area in other storage modes according to the size of the partition image file;
[0013] Wherein, the storage sub-area is used to store the partition image file corresponding to the first partition identifier;
[0014] Download the partition image file in the PAC package;
[0015] Determine the target storage sub-area based on the first partition identifier corresponding to the partition image file, and store the partition image file in the target storage sub-area.
[0016] Optionally, the target storage mode is the SLC mode, the first storage area includes a number of logical units, and the second partition information includes the second partition identifiers corresponding to different logical units;
[0017] The step of dividing a corresponding storage sub-area in the first storage area in the target storage mode in response to the matching of the first partition identifier and the second partition identifier includes:
[0018] In response to the matching of the first partition identifier and the second partition identifier, determine the target logical unit according to the matching second partition identifier;
[0019] Divide the corresponding storage sub-area in the target logical unit.
[0020] Optionally, after the step of determining the target logical unit according to the matched second partition identifier in response to the first partition identifier matching the second partition identifier, the download method further includes:
[0021] In response to the target logical unit corresponding to multiple second partition identifiers and the matched second partition identifier being the target second partition identifier, creating first partition storage information corresponding to the target logical unit and storing the first partition storage information in a preset storage area corresponding to the target logical unit;
[0022] After the step of partitioning the corresponding storage sub-region in the target logical unit, the download method further includes:
[0023] In response to the target logical unit corresponding to multiple second partition identifiers, writing the first address information corresponding to the storage sub-region into the first partition storage information.
[0024] Optionally, the step of determining the target storage sub-region based on the first partition identifier corresponding to the partition image file and storing the partition image file in the target storage sub-region includes:
[0025] Determining the target logical unit based on the first partition identifier corresponding to the partition image file;
[0026] In response to the target logical unit including the first partition storage information, obtaining the first address information corresponding to the first partition identifier from the first partition storage information;
[0027] Storing the partition image file in the target storage sub-region corresponding to the first address information.
[0028] Optionally, after the step of partitioning the corresponding storage sub-region in the second storage area in other storage modes in response to the first partition identifier not matching the second partition identifier, the download method further includes:
[0029] Writing the second address information corresponding to the storage sub-region into the second partition storage information;
[0030] The second partition storage information is provided in a preset storage area corresponding to the second storage area.
[0031] Optionally, the step of determining the target storage sub-region based on the first partition identifier corresponding to the partition image file and storing the partition image file in the target storage sub-region includes:
[0032] Obtaining the second address information corresponding to the first partition identifier from the second partition storage information;
[0033] Store the partition image file in the target storage sub-region corresponding to the second address information.
[0034] According to a second aspect of the present disclosure, there is provided a startup method for a terminal device, the startup method comprising:
[0035] Receive a startup instruction, and obtain first target partition information required to be loaded in the spl stage and / or the bootloader stage;
[0036] Based on a matching result between the first target partition information and pre-configured second partition information, determine a target partition image file corresponding to the first target partition information in a storage medium;
[0037] Load the target partition image file;
[0038] Wherein, the partition image file in the storage medium is obtained by using the download method described in the first aspect of the present disclosure.
[0039] According to a third aspect of the present disclosure, there is provided a download system for a pac package, the download system being applied to a terminal device, the download system comprising a partitioning module and a download module;
[0040] The partitioning module is configured to, in response to a download instruction, partition a storage medium based on pre-configured logical unit configuration information to obtain storage regions corresponding to different storage modes, the storage modes including an SLC mode and a TLC mode;
[0041] The download module is configured to download the pac package, and based on a matching result between first partition information in the pac package and pre-configured second partition information, store the partition image file of the first partition information in a corresponding storage region.
[0042] According to a fourth aspect of the present disclosure, there is provided a startup system for a terminal device, the startup system comprising a receiving module, a determining module, and a loading module;
[0043] The receiving module is configured to receive a startup instruction, and obtain first target partition information required to be loaded in the spl stage and / or the bootloader stage;
[0044] The determining module is configured to, based on a matching result between the first target partition information and pre-configured second partition information, determine a target partition image file corresponding to the first target partition information in a storage medium;
[0045] The loading module is configured to load the target partition image file;
[0046] Among them, the partition image file in the storage medium is obtained by using the download system described in the third aspect of the present disclosure.
[0047] According to a fifth aspect of the present disclosure, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the download method described in the first aspect of the present disclosure, or the startup method of the terminal device described in the second aspect of the present disclosure, is implemented.
[0048] According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the download method described in the first aspect of the present disclosure, or the startup method of the terminal device described in the second aspect of the present disclosure, is implemented.
[0049] According to a seventh aspect of the present disclosure, there is provided a computer program product, including a computer program. When the computer program is executed by a processor, the download method described in the first aspect of the present disclosure, or the startup method of the terminal device described in the second aspect of the present disclosure, is implemented.
[0050] According to an eighth aspect of the present disclosure, there is provided a chip, which includes at least one processor. The processor is configured to execute program instructions to execute the download method described in the first aspect of the present disclosure, or the startup method of the terminal device described in the second aspect of the present disclosure.
[0051] According to a ninth aspect of the present disclosure, there is provided a chip module, which includes at least one processor. The processor is configured to execute program instructions to execute the download method described in the first aspect of the present disclosure, or the startup method of the terminal device described in the second aspect of the present disclosure.
[0052] On the basis of conforming to common general knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred examples of the present disclosure.
[0053] The positive and progressive effects of the present disclosure are as follows: during the process of downloading the pac package to the terminal device, according to the importance of different partitions, the size ratio relationship of the storage areas in the TLC mode and the SLC mode in the storage medium is selected and configured by itself, and different partitions are placed in the storage areas corresponding to the TLC mode or the SLC mode according to customer requirements, so as to realize customizing to place important partitions in the storage area corresponding to the SLC mode, sacrificing a small part of the storage space to ensure that the data in the important partitions is not damaged during the process of reflow soldering. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is the first flowchart of the download method of the pac package in Embodiment 1 of the present disclosure;
[0055] Figure 2 It is a flowchart of step S12 in the method for downloading a pac package in Embodiment 1 of the present disclosure;
[0056] Figure 3 It is a second flowchart of the method for downloading a pac package in Embodiment 1 of the present disclosure;
[0057] Figure 4 It is a flowchart of the method for starting a terminal device in Embodiment 2 of the present disclosure;
[0058] Figure 5 It is a schematic diagram of modules of the pac package download system in Embodiment 3 of the present disclosure;
[0059] Figure 6 It is a schematic diagram of modules of the terminal device startup system in Embodiment 4 of the present disclosure;
[0060] Figure 7 It is a schematic diagram of the structure of an electronic device in Embodiment 5 of the present disclosure. Detailed implementation manners
[0061] The present disclosure will be further described below by way of embodiments, but the present disclosure is not limited to the scope of the described embodiments.
[0062] In the embodiments of the present disclosure, prefix words such as "first" and "second" are only used to distinguish different described objects, and do not limit the position, order, priority, quantity, content, etc. of the described objects. The use of ordinal numbers and other prefix words for distinguishing described objects in the embodiments of the present disclosure does not limit the described objects. For the statement of the described objects, refer to the description in the claims or the context of the embodiments, and no redundant limitation should be formed due to the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, the meaning of "a plurality" is two or more.
[0063] As a memory technology, UFS is mainly applied to mobile devices and consumer electronic products with high storage performance requirements, and is commonly used as a storage medium in various embedded system design solutions.
[0064] The physical blocks in UFS generally include two storage modes. The first is the TLC mode. This storage mode has poor high-temperature resistance, but due to its low price, low production cost, and more storage information space in the same physical block than the SLC mode, most of the physical blocks in a UFS storage medium adopt this mode; the second is the SLC mode. This storage mode has strong high-temperature resistance and fast read and write speeds, but is expensive. Usually, only a small part of the storage physical blocks in the SLC mode are provided in a UFS to store partition data related to startup (for example, storing spl image files, bootloader image files, etc.).
[0065] In the download scheme of traditional embedded system design, the storage physical blocks of UFS are not configured. Instead, the corresponding system image files are simply written into different partitions. For example, the SPL partition and the bootloader partition are written into the LUs (Logical Units) corresponding to the original SLC in the UFS storage medium, and all other image files are written into the corresponding LUs in TLC mode. This method only requires managing a GPT partition table (GUID Partition Table, a hard disk partition format).
[0066] However, after some manufacturers write the corresponding image files into the UFS storage medium, there is a need for secondary reflow. However, due to the poor high-temperature resistance of the storage physical blocks in TLC mode, some bit reversals may occur during the secondary reflow process (for example, a certain bit in 000 is reversed to 001), causing important data in some partitions to be damaged, resulting in problems such as inability to boot.
[0067] In view of this, the present disclosure provides a method for downloading a PAC package, a method for starting a terminal device, a system, and a device to solve the problem in the prior art that the partition image files of important partitions cannot be ensured to be accurate under the secondary reflow process, resulting in low production efficiency and high defect rate.
[0068] The following explanations are made for the relevant terms appearing in the specification:
[0069] UFS: A high-speed storage technology, usually used for memory storage in mobile devices such as mobile phones and tablets. Its transmission speed can reach several hundred megabytes per second, greatly improving the read and write performance of storage devices.
[0070] SLC: Single-Level Cell. The oxide film between the floating gate and the source is thinner. When writing data, a voltage is applied to the charge in the floating gate, and then through the source, the stored charge can be eliminated. In this way, 1 information unit can be stored, that is, 1 bit / cell (each storage unit stores 1 bit of information). It has a fast speed, the longest lifespan, a high price (about more than 3 times the price of MLC), good stability (data is not easily lost at high temperatures), and a write-erase lifespan of about 100,000 times.
[0071] MLC (Multi-Level Cell): Multi-level storage, which stores two units of information in one Floating Gate (the part that stores charge in a flash memory cell). Then, by using charges of different potentials (Levels), precise reading and writing are controlled through the voltage stored in the memory, that is, 2 bit / cell. The speed is average, the lifespan is average, and the price is average, with a write-erase lifespan of about 3000 - 10,000 times. MLC stores two bits of data per cell by using a large number of voltage levels, and the data density is relatively large, and it can store more than 4 values at a time. Therefore, the MLC architecture can have a relatively good storage density.
[0072] TLC: Three-level storage, each cell can store 1 / 2 more data than MLC, with a total of eight charge values, that is, 3 bit / cell, also known as 8LC. The required access time is longer, so the transfer speed is slower. TLC is cheap, with the lowest production cost per megabyte, but it has a short lifespan, only about 1000 write-erase cycles, and it is less stable than SLC and is prone to data loss after high-temperature baking.
[0073] LU: Logical Unit. The physical storage space of a UFS device can have several independent logical address spaces, and the logical address space is called LU;
[0074] LUN (Logical Unit Number): Logical Unit Number, used to indicate different logical storage units in a UFS memory, and each LUN has a unique number.
[0075] SPL: Second-stage Program Loader, which executes the first-stage startup program and is mainly responsible for moving the second-stage code of u-boot (Universal Boot Loader, a bootloader) / lk (LK Bootloader, which loads and boots the Linux (an operating system) kernel) from the storage medium flash (a non-volatile memory) to the system memory for running;
[0076] BOOTLOADER: Bootloader, also known as the second-stage startup program, mainly loads the system image file required for subsequent startup into the system memory for execution.
[0077] Example 1
[0078] In a specific embodiment of the present disclosure, a method for downloading a pac package is provided. This download method is applied to a terminal device, such as Figure 1 shown, and this download method includes:
[0079] S11. In response to a download instruction, divide a storage medium based on pre-configured logical unit configuration information to obtain storage areas corresponding to different storage modes, where the storage modes include the SLC mode and the TLC mode;
[0080] S12. Download a pac package, and store the partition image file of the first partition information into the corresponding storage area based on the matching result between the first partition information in the pac package and the pre-configured second partition information.
[0081] Specifically, pre-configure the logical unit configuration information and the second partition information. The logical unit configuration information includes the number of divisions of logical units (LUs) in the entire storage medium, the size of each LU, and the corresponding storage mode type. The second partition information includes the storage positions of different partitions in the storage medium. Among them, the storage position of the important partition is set in the storage area corresponding to the SLC mode, and the storage position of the non-important partition is set in the storage area corresponding to the TLC mode or the MLC mode.
[0082] It should be noted that which partitions are important partitions and which partitions are non-important partitions can be set according to actual needs. Then, according to the storage area size and importance required by each partition, configure the size of each LU and the corresponding storage mode in the logical unit configuration information, and configure the storage positions of each partition in the second partition information.
[0083] For example, the logical unit configuration information includes three LUs (LUN0, LUN1, LUN2). Among them, the storage modes of LUN0 and LUN1 are both the SLC mode, and the storage mode of LUN2 is the TLC mode. Of course, LUs with the storage mode of MLC can also be configured according to actual needs, and this specific implementation manner does not limit this.
[0084] When the download instruction is received in step S11, for example, the download button on the mobile terminal is pressed, triggering the mobile terminal to enter the bootloader stage. The ufs is initialized, the pre-configured logical unit configuration information is queried, the storage medium is divided into logical units according to the logical unit configuration information, and the storage mode corresponding to each logical unit is configured. For example, continuing with the above example, the storage medium is divided into three logical units, and the storage modes of LUN0 and LUN1 are configured as the SLC mode to form the storage area corresponding to the SLC mode, and the storage mode of LUN2 is configured as the TLC mode to form the storage area corresponding to the TLC mode.
[0085] Among them, for a logical unit with the configured storage mode being the SLC mode, when its original storage mode is the TLC mode, it is necessary to simulate the TLC mode as the SLC mode. For example, when the original storage mode of a logical unit is the TLC mode, a logical unit can store 3 bits (for example, store 000, 001, 010, 011...). By masking the potentials of the TLC mode and only retaining 2 potentials (only able to store 0 or 1), a storage mode of the SLC mode is formed. After simulating the TLC mode as the SLC mode, since the precision requirements of the two potentials are greatly reduced, the read and write speed will increase. By sacrificing a part of the storage space of the TLC, the read and write performance and stability are improved.
[0086] During the process of downloading the pac package in step S12, according to the logical units corresponding to different partitions in the second partition information in the storage medium, determine the storage locations in the storage medium corresponding to each first partition information in the pac package, and then store the partition image file in the storage area corresponding to the storage area. Thus, it is realized to store the partition image file of the important partition in the storage area of the SLC mode, avoiding the data in the important partition being damaged due to secondary reflow soldering. Among them, the mobile terminal can be connected to the PC end through usb (Universal Serial Bus) to download the pac package according to the download tool of the PC (Personal Computer) end.
[0087] Among them, the terminal device can include mobile phones, various intelligent wearable devices, industrial electronics related products, etc.
[0088] In this specific embodiment, the logical unit configuration information and the second partition information are added in the download stage of the pac package, and multiple download logics corresponding to the second partition information of the LUs are newly added, supporting the self-selection of the size ratio relationship between the logical units of the TLC mode and the SLC mode in the ufs according to the importance of the partition, supporting the configuration of different partitions to be placed in different logical units configured as the TLC mode or the SLC mode, supporting the simulation configuration of some LUs in the TLC mode as the SLC mode, sacrificing a part of the storage space, in exchange for placing the important partition data in the storage block of the more stable and better high-temperature resistant SLC mode, improving the stability in the production process.
[0089] In a specific embodiment, the first partition information includes a first partition identifier and the corresponding partition image file size, and the second partition information includes a second partition identifier corresponding to the target storage mode;
[0090] As Figure 2 shown, step S12 includes:
[0091] S121. Download the first partition information in the pac package;
[0092] S122. In response to the first partition identifier matching the second partition identifier, divide a corresponding storage sub-region in the first storage area in the target storage mode according to the size of the partition image file, or, in response to the first partition identifier not matching the second partition identifier, divide a corresponding storage sub-region in the second storage area in other storage modes according to the size of the partition image file;
[0093] Among them, the storage sub-region is used to store the partition image file corresponding to the first partition identifier;
[0094] S123. Download the partition image file in the pac package;
[0095] S124. Determine the target storage sub-region based on the first partition identifier corresponding to the partition image file, and store the partition image file in the target storage sub-region.
[0096] Specifically, the second partition information may include the second partition identifiers (such as each partition name) that need to be stored in the storage area corresponding to the target storage mode. For example, if partition A, partition B, and partition C are important partitions, and partition D, partition E, and partition F are non-important partitions, then the partition image files corresponding to partition A, partition B, and partition C need to be stored in the storage area corresponding to the SLC mode. Therefore, the second partition information can be configured as LUN0: A, LUN1: BC, and the partitions not included in the second partition information are non-important partitions, and their corresponding partition image files can be stored in the storage area corresponding to the TLC mode.
[0097] During the download process of the pac package, the first partition information in the pac package will be sent first. The first partition information includes the partition identifiers and sizes of each partition that need to be downloaded to the UFS. The mobile terminal can determine how many partitions need to be downloaded based on the first partition information, and thus can allocate the storage space of the storage medium according to the first partition information.
[0098] For example, if the first partition information includes partitions ABCDEF, it can be determined that the partitions where the first partition information matches the second partition information include partitions ABC. Then, storage sub-regions that meet the sizes of the partition image files of partitions A, B, and C are respectively divided in the first storage area corresponding to the SLC mode, and storage sub-regions that meet the sizes of the partition image files of partitions D, E, and F are divided in the second storage sub-region corresponding to the TLC mode.
[0099] When downloading the partition image file subsequently, directly store the partition image file of each partition in the allocated storage sub-region.
[0100] In a specific embodiment, the target storage mode is the SLC mode. The first storage area includes a number of logical units, and the second partition information includes second partition identifiers corresponding to different logical units;
[0101] If S122 determines that the first partition identifier matches the second partition identifier, the steps of partitioning a corresponding storage sub-area in the first storage area of the target storage mode include:
[0102] S1221. In response to the first partition identifier matching the second partition identifier, determine the target logical unit according to the matching second partition identifier;
[0103] S1222. In response to the target logical unit corresponding to multiple second partition identifiers and the matching second partition identifier being the target second partition identifier, create first partition storage information corresponding to the target logical unit, and store the first partition storage information in a preset storage area corresponding to the target logical unit;
[0104] S1223. Partition a corresponding storage sub-area in the target logical unit;
[0105] S1224. In response to the target logical unit corresponding to multiple second partition identifiers, write the first address information corresponding to the storage sub-area into the first partition storage information;
[0106] If S122 determines that the first partition identifier does not match the second partition identifier, after the steps of partitioning a corresponding storage sub-area in the second storage area of other storage modes, the download method further includes:
[0107] S1225. Write the second address information corresponding to the storage sub-area into the second partition storage information;
[0108] S1226. The second partition storage information is disposed in a preset storage area corresponding to the second storage area.
[0109] Specifically, in the bootloader stage, a repartition operation needs to be performed according to the first partition information sent by the PC-side download tool. By querying the second partition information table, the number of first partition storage information that needs to be created is obtained. For example, a gpt partition table can be created to store the storage addresses and partition sizes allocated for each partition. The number of created gpt partition tables corresponds to the total number of logical units for which new partition tables are required.
[0110] By traversing the first partition information in a loop, compare the first partition identifier in the first partition information with the second partition identifier in the second partition information: If the first partition identifier matches the second partition identifier, further query whether the logical unit where the second partition identifier is located includes multiple second partition identifiers. If so, determine that the logical unit needs to create a GPT partition table. If not, it means that the logical unit only stores the partition image file of a single partition, so there is no need to create a GPT partition table. Subsequently, directly fill the partition image file corresponding to the partition identifier into the logical unit. If the first partition identifier and the second partition identifier do not match, directly divide the partition into the logical unit in the TLC mode. Since there are usually multiple partitions in the TLC mode, a GPT partition table needs to be created, and the partition identifier divided into the TLC mode and the storage address assigned to it are filled into the GPT partition table. The created GPT partition table is stored in the preset storage area of the corresponding logical unit.
[0111] Among them, the target partition identifier corresponding to the creation of the GPT partition table in each logical unit can be preset in advance, so as to create the GPT partition table when receiving the target partition identifier. When receiving other partition identifiers in the logical unit, there is no need to create a GPT partition table, and only the assigned storage address and partition size need to be written into the GPT partition table.
[0112] For example, the logical units corresponding to the SLC mode include LUN0 and LUN1. LUN0 stores only the partition image file of a single partition A, and LUN1 stores the partition image files of two partitions B and C, and the partition B is preset as the target partition identifier. By traversing the partitions ABCDEF in the first partition information, and the partition A in the first partition information matches the partition A in the second partition information, the target logical unit can be determined as LUN0. Since LUN0 stores the partition image file of a single partition, there is no need to create a GPT partition table; the partition B in the first partition information matches the partition B in the second partition information, the target logical unit can be determined as LUN1. Since LUN1 includes two partitions and the partition B is the target partition identifier, a GPT partition table gpt(0) is created, and gpt(0) is stored in the head and tail areas of the LUN0 logical unit, and the storage address (0x000000 - 0x000100) allocated for the partition B according to the size of the partition image file corresponding to the partition B is written into gpt(0); the partition C in the first partition information matches the partition C in the second partition information, the target logical unit can be determined as LUN1. Although LUN1 includes two partitions, the partition C is not the target partition identifier, which means that a GPT partition table has been created in LUN1, and the storage address (0x000101 - 0x100000) allocated for the partition C can be directly written into it. Similarly, for the partitions DEF in the first partition information, they do not match the second partition information, and the partition D is the target partition identifier, then a GPT partition table gpt(1) is created when traversing to the partition D, and gpt(1) is written into the head area of the LUN2 logical unit, and the storage address allocated for the partition D is written into gpt(1). When traversing to the partitions E and F later, the corresponding storage addresses can be directly written into gpt(1).
[0113] In a specific embodiment, step S124 includes:
[0114] S1241. Determine a target logical unit based on the first partition identifier corresponding to the partition image file;
[0115] S1242. In response to the target logical unit including the first partition storage information, obtain the first address information corresponding to the first partition identifier from the first partition storage information;
[0116] S1243. Store the partition image file into the target storage sub-region corresponding to the first address information;
[0117] S1244. Obtain the second address information corresponding to the first partition identifier from the second partition storage information;
[0118] S1245. Store the partition image file into the target storage sub-region corresponding to the second address information.
[0119] Specifically, the PC - side download tool sequentially transmits the partition image files corresponding to each partition through USB. The bootloader of the mobile terminal compares the obtained partition identifier with the second - partition information. If it matches the second - partition identifier in the second - partition information, the target logical unit can be determined according to the second - partition identifier, and further check whether there is a corresponding GPT in the target logical unit Partition table, if any, write it according to the corresponding GPT partition table GPT(n) to the corresponding of the target logical unit In the storage address, if not, it means that the entire target logical unit only needs to store the partition image file of a single partition, and it can be directly written; if it does not match the second - partition information, it means that this partition does not need to be placed in the logical unit in SLC mode. Therefore, it can be written to the corresponding storage address according to the partition table GPT(1) corresponding to the logical unit in TLC mode
[0120] In a specific example, as Figure 3 shown, starting from when the download instruction is received, enter step S1: USF initialization, and set the LU quantity and storage mode according to the logical unit configuration information
[0121] Step S2: The PC - side download tool sends the first - partition information in the pac package to the mobile terminal
[0122] Step S3: The bootloader repartitions, queries the second - partition information to obtain the number of GPT partition tables to be created, and creates GPT partition tables
[0123] Step S4: Compare the first - partition identifier in the first - partition information with the second - partition identifier in the second - partition information
[0124] Step S5: Determine whether the partition identifiers match. If so, enter step S6; if not, enter step S7
[0125] Step S6: Determine whether the target logical unit corresponding to the matching second - partition identifier includes a GPT partition table. If so, enter step S8; if not, enter step S9
[0126] S7: Fill the first - partition identifier and the address information allocated for this first - partition identifier into the GPT partition table corresponding to the TLC mode
[0127] S8: Fill the first - partition identifier and the address information allocated for this first - partition identifier into the GPT partition table corresponding to the target logical unit
[0128] S9: Determine whether all the partition identifiers in the first - partition information have been matched. If so, enter step S10; if not, enter step S4
[0129] S10: Receive each partition image file from the USB, write the partition image file into the corresponding storage address, and end the download process of the PAC package.
[0130] In the process of downloading the PAC package to the terminal device, this embodiment selects the storage area size ratio relationship of the TLC mode and the SLC mode in the storage medium according to the importance of different partitions, and places different partitions in the storage area corresponding to the TLC mode or the SLC mode according to customer needs, so as to customize the placement of important partitions in the storage area corresponding to the SLC mode, sacrifice a small part of the storage space, and ensure that the data of important partitions is not damaged during the secondary furnace process.
[0131] Example 2
[0132] In a specific embodiment of the present disclosure, a method for starting a terminal device is provided, such as Figure 4 As shown, the startup method includes:
[0133] S21, receiving a startup instruction, and obtaining the first target partition information to be loaded in the spl stage and / or the bootloader stage;
[0134] S22, determining a target partition image file corresponding to the first target partition information in the storage medium based on a matching result between the first target partition information and the pre-configured second partition information;
[0135] S23, loading the target partition image file;
[0136] The partition image file in the storage medium is obtained by using the downloading method described in any of the above embodiments.
[0137] Specifically, the boot process of a mobile device usually includes the romcode (code solidified inside the processor) stage, the spl stage, the bootloader stage, and the kernel (real-time operating system) stage. Among them, for the romcode stage, when the power is long pressed to start, the boot chip starts to execute from the preset code solidified in the ROM (read-only memory), loads the spl corresponding code into the IRAM (internal random access memory), and jumps to the spl stage code; the spl stage is mainly responsible for loading the bootloader from the storage medium flash (for example, ufs) into the ddr (double data rate) memory, and jumps to the bootloader stage code; the bootloader stage is mainly responsible for reading the kernel-related boot image file from the flash, loading it into the ddr memory, and jumping to the kernel stage start code; the kernel stage starts the Linux kernel.
[0138] After downloading the pac package using the download method of any of the above embodiments, since the storage paths of some important partitions in the download process are changed, in the spl stage, it is necessary to first read the second partition information and query whether the partition identifier to be loaded in the spl stage is in the second partition information. If so, obtain the corresponding partition image data from the corresponding logical unit configured in the SLC mode for loading; if not, obtain the corresponding partition image data from the logical unit configured in the TLC mode for loading.
[0139] Similarly, in the bootloader stage, query whether the partition identifier to be loaded in the bootloader stage is in the second partition information. If it is, obtain the corresponding partition image file from the corresponding logical unit configured in the SLC mode for loading; if not, obtain the corresponding partition image file from the logical unit configured in the TLC mode for loading.
[0140] It should be noted that since the number of partitions to be loaded in the spl stage is less than that in the bootloader stage, a third partition information can be set separately according to the partitions to be loaded in the spl stage, which only includes the partition information to be loaded in the spl stage and stored in the SLC mode, so as to directly obtain the corresponding partition image file for loading according to this third partition information and avoid information redundancy.
[0141] In this embodiment, during the process of downloading the pac package to the terminal device, according to the importance of different partitions, the size ratio relationship between the storage areas in the TLC mode and the SLC mode in the storage medium is selected by itself, and different partitions are placed in the storage areas corresponding to the TLC mode or the SLC mode according to customer requirements, so as to realize the customization of placing important partitions in the storage area corresponding to the SLC mode, sacrificing a small part of the storage space to ensure that the data of important partitions is not damaged during the second reflow process.
[0142] Embodiment 3
[0143] In a specific embodiment of the present disclosure, a download system for a pac package is provided. The download system is applied to a terminal device, such as Figure 5 shown. The download system includes a partitioning module 101 and a download module 102;
[0144] The partitioning module 101 is configured to partition the storage medium based on pre-configured logical unit configuration information in response to a download instruction, so as to obtain storage areas corresponding to different storage modes, where the storage modes include the SLC mode and the TLC mode;
[0145] The download module 102 is configured to download the pac package and store the partition image file of the first partition information in the corresponding storage area based on the matching result between the first partition information in the pac package and the pre-configured second partition information.
[0146] In a specific embodiment, the first partition information includes a first partition identifier and the corresponding partition image file size, and the second partition information includes a second partition identifier corresponding to the target storage mode;
[0147] The download module 102 includes a first download unit, a partitioning unit, a second download unit, and a determination unit;
[0148] The first download unit is used to download the first partition information in the pac package;
[0149] The partitioning unit is configured to, in response to the first partition identifier matching the second partition identifier, partition a corresponding storage sub-region in the first storage area in the target storage mode according to the partition image file size, or, in response to the first partition identifier not matching the second partition identifier, partition a corresponding storage sub-region in the second storage area in other storage modes according to the partition image file size;
[0150] Wherein, the storage sub-region is used to store the partition image file corresponding to the first partition identifier;
[0151] The second download unit is used to download the partition image file in the pac package;
[0152] The determination unit is configured to determine the target storage sub-region based on the first partition identifier corresponding to the partition image file, and store the partition image file in the target storage sub-region.
[0153] In a specific embodiment, the target storage mode is the SLC mode, the first storage area includes a plurality of logical units, and the second partition information includes second partition identifiers corresponding to different logical units;
[0154] In response to the first partition identifier matching the second partition identifier, the partitioning unit is further configured to, in response to the first partition identifier matching the second partition identifier, determine the target logical unit according to the matching second partition identifier; and partition a corresponding storage sub-region in the target logical unit.
[0155] In a specific embodiment, the download module 102 further includes a creation unit and a writing unit;
[0156] The creation unit is configured to, in response to the target logical unit corresponding to multiple second partition identifiers and the matching second partition identifier being the target second partition identifier, create first partition storage information corresponding to the target logical unit, and store the first partition storage information in the preset storage area corresponding to the target logical unit;
[0157] The writing unit is configured to, in response to the target logical unit corresponding to multiple second partition identifiers, write the first address information corresponding to the storage sub-region into the first partition storage information.
[0158] In a specific embodiment, the determination unit is further configured to determine a target logical unit based on a first partition identifier corresponding to a partition image file; in response to the target logical unit including first partition storage information, obtain first address information corresponding to the first partition identifier from the first partition storage information; and store the partition image file in a target storage sub-region corresponding to the first address information.
[0159] In a specific embodiment, in response to the first partition identifier not matching the second partition identifier, the partitioning unit is further configured to write second address information corresponding to the storage sub-region into the second partition storage information;
[0160] The second partition storage information is disposed in a preset storage region corresponding to the second storage region.
[0161] In a specific embodiment, the determination unit is further configured to obtain second address information corresponding to the first partition identifier from the second partition storage information; and store the partition image file in a target storage sub-region corresponding to the second address information.
[0162] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution.
[0163] In the process of downloading the pac package to the terminal device in this embodiment, according to the importance of different partitions, the size ratio relationship of the storage areas in the TLC mode and the SLC mode in the storage medium is selected by itself, and different partitions are placed in the storage areas corresponding to the TLC mode or the SLC mode according to customer requirements, so as to realize customizing to place important partitions in the storage area corresponding to the SLC mode, sacrificing a small part of the storage space to ensure that the data of the important partitions is not damaged during the process of reflow soldering.
[0164] Embodiment 4
[0165] In a specific embodiment of the present disclosure, a startup system for a terminal device is provided. As Figure 6 shown, the startup system includes a receiving module 201, a determination module 202, and a loading module 203;
[0166] The receiving module 201 is configured to receive a startup instruction and obtain first target partition information to be loaded in the spl stage and / or the bootloader stage;
[0167] The determination module 202 is configured to determine a target partition image file corresponding to the first target partition information in the storage medium based on a matching result between the first target partition information and pre-configured second partition information;
[0168] The loading module 203 is configured to load the target partition image file;
[0169] Wherein, the partition image file in the storage medium is obtained by using the download system described in any of the above embodiments.
[0170] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present disclosure.
[0171] In the process of downloading the pac package to the terminal device in this embodiment, according to the importance of different partitions, the size ratio relationship of the storage areas in the TLC mode and the SLC mode in the storage medium is selected and configured by itself, and different partitions are placed in the storage areas corresponding to the TLC mode or the SLC mode according to customer requirements, so as to realize customizing to place important partitions in the storage area corresponding to the SLC mode, sacrificing a small part of the storage space to ensure that the data in the important partitions is not damaged during the process of reflow soldering.
[0172] Embodiment 5
[0173] Figure 7 FIG. is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the download method of the pac package described in any of the above embodiments or the startup method of the terminal device is implemented. Figure 7 The shown electronic device 30 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure.
[0174] As Figure 7 shown, the electronic device 30 may be presented in the form of a general computing device, for example, it may be a server device. The components of the electronic device 30 may include but are not limited to: at least one of the above processors 31, at least one of the above memories 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).
[0175] The bus 33 includes a data bus, an address bus, and a control bus.
[0176] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.
[0177] The memory 32 may also include a program tool 325 (or utility) having a set (at least one) of program modules 324. Such program modules 324 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0178] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the pac package download method provided in any of the above embodiments, or the startup method of the terminal device.
[0179] The electronic device 30 can also be connected to one or more external devices 34 (such as a keyboard, a pointing device, etc.) ) Communication. This communication can be carried out through the input / output (I / O) interface 35. Also, the electronic device 30 can further communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 36. As shown in the figure, the network adapter 36 communicates with other modules of the electronic device 30 through the bus 33. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0180] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of the two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.
[0181] Embodiment 6
[0182] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the pac package download method provided in any of the above embodiments, or the startup method of the terminal device.
[0183] Among them, the readable storage medium can more specifically include but is not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0184] Embodiment 7
[0185] The embodiments of the present disclosure also provide a computer program product, including a computer program, which when executed by a processor, implements the download method of the pac package or the startup method of the terminal device described in any one of the above embodiments.
[0186] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.
[0187] Embodiment 8
[0188] The embodiments of the present disclosure also provide a chip, which includes at least one processor, and the processor is used to execute program instructions to execute the download method of the pac package or the startup method of the terminal device described in any one of the above embodiments.
[0189] Embodiment 9
[0190] The embodiments of the present disclosure also provide a chip module, which includes at least one processor, and the processor is used to execute program instructions to execute the download method of the pac package or the startup method of the terminal device described in any one of the above embodiments.
[0191] Although the specific embodiments of the present disclosure have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Without departing from the principles and essence of the present disclosure, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present disclosure.
Claims
1. A method for downloading a pac package, characterized in that: The download method is applied to a terminal device, and the download method includes: In response to the download instruction, the storage medium is divided based on the pre-configured logic unit configuration information to obtain storage areas corresponding to different storage modes, wherein the storage modes include an SLC mode and a TLC mode; The PAC package is downloaded, and based on the matching result between the first partition information in the PAC package and the pre-configured second partition information, the partition image file of the first partition information is stored in the corresponding storage area.
2. The downloading method according to claim 1, characterized in that: The first partition information includes a first partition identifier and a corresponding partition image file size, and the second partition information includes a second partition identifier corresponding to the target storage mode; The step of downloading the PAC package and storing the partition image file of the first partition information in the PAC package to the corresponding storage area based on the matching result between the first partition information in the PAC package and the pre-configured second partition information comprises: Download the first partition information in the PAC package; In response to the first partition identifier matching the second partition identifier, a corresponding storage sub-area is divided in the first storage area in the target storage mode according to the size of the partition image file, or, in response to the first partition identifier not matching the second partition identifier, a corresponding storage sub-area is divided in the second storage area in other storage modes according to the size of the partition image file; The storage sub-area is used to store the partition image file corresponding to the first partition identifier; Download the partition image file in the pac package; A target storage sub-area is determined based on the first partition identifier corresponding to the partition image file, and the partition image file is stored in the target storage sub-area.
3. The downloading method according to claim 2, characterized in that: The target storage mode is an SLC mode, the first storage area includes a plurality of logical units, and the second partition information includes second partition identifiers corresponding to different logical units; In response to the first partition identifier matching the second partition identifier, the step of dividing the corresponding storage sub-area in the first storage area of the target storage mode comprises: In response to the first partition identifier matching the second partition identifier, determining a target logical unit according to the matched second partition identifier; The corresponding storage sub-area is divided in the target logical unit.
4. The downloading method according to claim 3, characterized in that: After the step of determining the target logical unit according to the matched second partition identifier in response to the first partition identifier matching the second partition identifier, the download method further includes: In response to the target logical unit corresponding to a plurality of the second partition identifiers, and the matched second partition identifier is the target second partition identifier, creating first partition storage information corresponding to the target logical unit, and storing the first partition storage information in a preset storage area corresponding to the target logical unit; After the step of dividing the corresponding storage sub-area in the target logical unit, the download method further includes: In response to the target logical unit corresponding to a plurality of the second partition identifiers, the first address information corresponding to the storage sub-area is written into the first partition storage information.
5. The downloading method according to claim 4, characterized in that: The step of determining a target storage sub-area based on the first partition identifier corresponding to the partition image file and storing the partition image file in the target storage sub-area comprises: Determine the target logical unit based on the first partition identifier corresponding to the partition image file; In response to the target logical unit including the first partition storage information, acquiring the first address information corresponding to the first partition identifier from the first partition storage information; The partition image file is stored in the target storage sub-area corresponding to the first address information.
6. The downloading method according to claim 2, characterized in that: After the step of dividing the corresponding storage sub-area in the second storage area of the other storage mode in response to the first partition identifier not matching the second partition identifier, the download method further includes: Writing the second address information corresponding to the storage sub-area into the second partition storage information; The second partition storage information is set in a preset storage area corresponding to the second storage area.
7. The downloading method according to claim 6, characterized in that: The step of determining a target storage sub-area based on the first partition identifier corresponding to the partition image file and storing the partition image file in the target storage sub-area comprises: Acquire the second address information corresponding to the first partition identifier from the second partition storage information; The partition image file is stored in the target storage sub-area corresponding to the second address information.
8. A method for starting a terminal device, characterized in that: The startup method comprises: Receive a startup instruction and obtain the first target partition information that needs to be loaded in the spl stage and / or the bootloader stage; Based on a matching result between the first target partition information and the pre-configured second partition information, determining a target partition image file corresponding to the first target partition information in a storage medium; Loading the target partition image file; Wherein, the partition image file in the storage medium is obtained by using the downloading method according to any one of claims 1 to 7.
9. A pac package download system, characterized in that: The download system is applied to a terminal device, and the download system comprises a partitioning module and a downloading module; The partitioning module is used to partition the storage medium based on the pre-configured logic unit configuration information in response to the download instruction to obtain storage areas corresponding to different storage modes, wherein the storage modes include an SLC mode and a TLC mode; The download module is used to download the PAC package, and based on the matching result between the first partition information in the PAC package and the pre-configured second partition information, store the partition image file of the first partition information in the corresponding storage area.
10. A startup system for a terminal device, characterized in that: The startup system includes a receiving module, a determining module and a loading module; The receiving module is used to receive a startup instruction and obtain the first target partition information that needs to be loaded in the spl stage and / or the bootloader stage; The determination module is used to determine the target partition image file corresponding to the first target partition information in the storage medium based on the matching result between the first target partition information and the pre-configured second partition information; The loading module is used to load the target partition image file; Wherein, the partition image file in the storage medium is obtained by using the download system as claimed in claim 9.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the download method described in any one of claims 1 to 7 or the terminal device startup method described in claim 8 is implemented.