Movatterモバイル変換


[0]ホーム

URL:


CN113741812A - Memory partition updating method and device, electronic device and storage medium - Google Patents

Memory partition updating method and device, electronic device and storage medium
Download PDF

Info

Publication number
CN113741812A
CN113741812ACN202110909882.3ACN202110909882ACN113741812ACN 113741812 ACN113741812 ACN 113741812ACN 202110909882 ACN202110909882 ACN 202110909882ACN 113741812 ACN113741812 ACN 113741812A
Authority
CN
China
Prior art keywords
storage area
storage
addresses
memory
corresponding relation
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.)
Granted
Application number
CN202110909882.3A
Other languages
Chinese (zh)
Other versions
CN113741812B (en
Inventor
柴昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co LtdfiledCriticalZhejiang Dahua Technology Co Ltd
Priority to CN202110909882.3ApriorityCriticalpatent/CN113741812B/en
Publication of CN113741812ApublicationCriticalpatent/CN113741812A/en
Application grantedgrantedCritical
Publication of CN113741812BpublicationCriticalpatent/CN113741812B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application relates to a method for updating a memory partition, which comprises the following steps: acquiring a plurality of first memory area addresses based on the first space division result; establishing a total storage area based on a plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address; acquiring a plurality of second storage area addresses based on partition updating requirements, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and the total storage area address; and establishing the corresponding relation between a plurality of first storage area addresses and a plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation. By the method and the device, the technical problem that the offset of the initial address cannot be calculated across partitions in the related technology is solved, the calculation process of updating the partitions of the storage area across partitions is reduced, and the updating efficiency of the partitions of the storage area is improved.

Description

Memory partition updating method and device, electronic device and storage medium
Technical Field
The present application relates to the field of computer storage, and in particular, to a method and an apparatus for updating a memory partition, an electronic apparatus, and a storage medium.
Background
Computer systems are updated more and more frequently during the daily use of computer equipment. Since the size of the new version of system software is often inconsistent with the size of the old version of system software, the situation that the partition address and the partition size of the new version of system are inconsistent with the size of the old version of system may occur in the updating process, so that the situations that the partitions do not correspond and the addresses cannot be accessed occur in the updating process, and finally the updating process is abnormal or crashed.
In order to solve the problem of inconsistent partitions in the system updating process, in the prior art, a new version system partition list and an old version system partition list are obtained, each start address of the new version system partition is obtained, the offset of each start address of the new version system partition relative to each start address of the old version system partition is calculated, and the partition address after the system updating is obtained. However, since each partition of the old version system is fixed and independent of each other, the offset of the start address of the new version system partition can only be calculated inside each partition, and cannot be calculated across partitions.
Aiming at the technical problem that the offset of the starting address cannot be calculated across partitions in the related art, no effective solution is provided at present.
Disclosure of Invention
In the embodiment, a method, a device, an electronic device and a storage medium for updating a memory partition are provided to solve the problem that the offset of a start address cannot be calculated across partitions in the related art.
In a first aspect, in this embodiment, a method for updating a memory partition is provided, including:
acquiring a plurality of first storage area addresses based on a first space division result, wherein the first space division result is a space division result before updating of a memory;
establishing a total storage area based on a plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas;
acquiring a plurality of second storage area addresses based on a partition updating requirement, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirement is the space partition requirement of the updated memory;
and establishing the corresponding relation between a plurality of first storage area addresses and a plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation.
In some of these embodiments, said establishing a total memory area based on a plurality of said first memory area addresses comprises:
acquiring the quantity of all storage units of a plurality of first storage areas, wherein the storage units at least comprise one byte;
and establishing the total storage area, wherein the number of the storage units of the total storage area is not less than the number of all the storage units of the plurality of first storage areas.
In some embodiments, the obtaining the plurality of second memory area addresses based on the partition update requirement further comprises:
acquiring the minimum storage space of each image file of system software to be updated, wherein the system software to be updated is the system software to be installed in the system updating process;
and establishing the second storage area corresponding to the image file based on the minimum storage space of each image file, wherein the storage space of the second storage area is not less than the minimum storage space of the image file corresponding to the second storage area.
In some embodiments, the establishing a correspondence relationship between a plurality of the first memory area addresses and a plurality of the second memory area addresses further includes:
and acquiring a plurality of image files of the system software to be updated, and sequentially storing each image file into the first storage area based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses.
In some embodiments, the establishing a correspondence relationship between a plurality of the first memory area addresses and a plurality of the second memory area addresses further includes:
and establishing a second storage area control unit based on a plurality of second storage area addresses, wherein the second storage area control unit is used for executing operation instructions of the plurality of second storage areas.
In some embodiments, the establishing a correspondence relationship between a plurality of first memory area addresses and a plurality of second memory area addresses based on the first correspondence relationship and the second correspondence relationship includes:
sequentially acquiring the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area in the total storage area, and sequentially acquiring the storage unit addresses of the first storage areas corresponding to the storage units of the total storage area in the plurality of first storage areas;
and storing the corresponding relation between the address of the storage unit of the total storage area and the address of the storage unit of the second storage area in a storage space.
In some embodiments, the establishing a correspondence between a plurality of the first memory area addresses and a plurality of the second memory area addresses includes:
and establishing a mapping relation list of a plurality of first storage area addresses and a plurality of second storage area addresses.
In a second aspect, in this embodiment, an apparatus for updating a memory partition is provided, including:
the device comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a plurality of first storage area addresses based on a first space division result, and the first space division result is a space division result before updating of a memory;
a first relation establishing module, configured to establish a total storage area based on a plurality of first storage area addresses, and establish a first corresponding relation, where the first corresponding relation is a corresponding relation between the plurality of first storage area addresses and a total storage area address, and a storage space of the total storage area is not less than a sum of storage spaces of the plurality of first storage areas;
a second relation establishing module, configured to obtain multiple second storage area addresses based on a partition update requirement, and establish a second corresponding relation, where the second corresponding relation is a corresponding relation between the multiple second storage area addresses and a total storage area address, and the partition update requirement is an updated space partition requirement of the memory;
a third relationship establishing module, configured to establish a correspondence between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first correspondence and the second correspondence.
In a third aspect, in this embodiment, there is provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for updating the memory partition according to the first aspect when executing the computer program.
In a fourth aspect, in the present embodiment, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the method for updating a memory partition according to the first aspect described above.
Compared with the related art, in the method for updating the memory partition provided in this embodiment, a plurality of first memory area addresses are obtained based on a first space division result, where the first space division result is a space division result before the memory is updated; establishing a total storage area based on a plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas; acquiring a plurality of second storage area addresses based on a partition updating requirement, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirement is the space partition requirement of the updated memory; and establishing the corresponding relation between a plurality of first storage area addresses and a plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation. The method comprises the steps of establishing a corresponding relation between a first storage area and a second storage area through a total storage area, obtaining a total storage area address corresponding to a starting address of the second storage area in the total storage area, further obtaining a first storage area address corresponding to the total storage area address in the first storage area, and finally establishing a corresponding relation between the starting address of the second storage area and the first storage area address.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a block diagram of a terminal hardware architecture of a method for updating memory partitions according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for updating a memory partition according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a total memory area of one embodiment of the present invention;
FIG. 4 is a schematic diagram of a total memory area of another embodiment of the present invention;
FIG. 5 is a schematic diagram of a total memory area of another embodiment of the present invention;
FIG. 6 is a schematic diagram of a total memory area of another embodiment of the present invention;
FIG. 7 is a flowchart illustrating a system software update method according to an embodiment of the invention;
fig. 8 is a block diagram of an updating apparatus for a memory partition according to an embodiment of the present invention.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the method is executed on a terminal, and fig. 1 is a block diagram of a hardware structure of the terminal according to the method for updating a memory partition in this embodiment. As shown in fig. 1, the terminal may include one or more processors 102 (only one shown in fig. 1) and amemory 104 for storing data, wherein theprocessor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include atransmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
Thememory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the method for updating the memory partition in the embodiment, and theprocessor 102 executes various functional applications and data processing by running the computer programs stored in thememory 104, so as to implement the method described above. Thememory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, thememory 104 may further include memory located remotely from theprocessor 102, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Thetransmission device 106 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, thetransmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, thetransmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the updating process of the computer system software, because the files of the new version system software and the old version system software are not consistent, the memory space division region of the old version system software may not be matched with the new version system software, and therefore a new space division region needs to be established based on the new version system software. However, in the system updating process, the new space division region is a virtual division region, so that the address of the new space division region needs to be mapped to the address of the original space division region, and the related file of the new version of system software can be stored in the physical region of the memory.
However, since the space-dividing regions are independent from each other, two or more space-dividing regions cannot be mapped to the same space-dividing region, that is, a mapping relationship between a new space-dividing region and an original space-dividing region cannot be established across partitions. Therefore, a total space region needs to be established in the middle, and the new space division region and the original space division region both directly establish a mapping relationship with the total space region, thereby indirectly establishing a mapping relationship between the new space division region and the original space division region.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for updating a memory partition according to an embodiment of the present invention. In this embodiment, the method for updating a memory partition includes:
s202: a plurality of first storage area addresses are acquired based on a first space division result, and the first space division result is a space division result before updating of the memory.
Illustratively, a plurality of first memory area addresses are obtained based on a space division result before the update of the memory partitions, wherein the first space division result includes, but is not limited to, a space division result of physical addresses of the memory, the first memory area includes, but is not limited to, each physical partition before the update of the memory partitions, the first memory area addresses include, but are not limited to, a start address and an end address of the first memory area, a partial or full memory location address of the first memory area, and the like.
The memory in the invention includes, but is not limited to, a nand flash memory, a nor flash memory, a TF card and other non-volatile storage media.
S204: and establishing a total storage area based on the plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas.
Illustratively, a total memory area is established on the basis of a plurality of first memory areas, and a total memory area address is established, establishing a first correspondence relationship between the address of the first memory area and the address of the total memory area. The storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas, so that each address of the first storage area can find the corresponding total storage area address in the total storage area. It will be appreciated that typically the system will have access to the first memory area and the total memory area will only be accessed during the update of the memory partition.
Referring to fig. 3, fig. 3 is a schematic diagram of a total memory area according to an embodiment of the invention. Specifically, four first storage areas of the memory are acquired based on the first space division result: the first storage area 1, the first storage area 2, the first storage area 3 and the first storage area 4 establish a total storage area on the basis of the four first storage areas, so that the space range of the total storage area covers the space ranges of the four first storage areas.
S206: and acquiring a plurality of second storage area addresses based on the partition updating requirement, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and the total storage area address, and the partition updating requirement is the space partition requirement of the updated memory.
Illustratively, the second storage area is established based on partition updating requirements, and each address of the second storage area is established with the address of the total storage area to form a second corresponding relation. The partition updating requirement comprises a storage space dividing requirement after the memory partition is updated.
S208: and establishing the corresponding relation between a plurality of first storage area addresses and a plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation.
Illustratively, a total memory area address corresponding to the first memory area address is acquired in the total memory area, and a second memory area address corresponding to the total memory area address is acquired in the second memory area, thereby establishing a correspondence relationship of the first memory area address and the second memory area address.
Referring to fig. 4, fig. 4 is a schematic diagram of a total memory area according to another embodiment of the invention. Specifically, a second storage area 1, a second storage area 2 and a second storage area 3 are established based on partition updating requirements, and a corresponding relation between three second storage area addresses and a total storage area address is established. And establishing the corresponding relation between the three second storage area addresses and the four first storage area addresses based on the corresponding relation between the second storage area 1, the second storage area 2, the second storage area 3 and the total storage area address and the corresponding relation between the first storage area 1, the first storage area 2, the first storage area 3, the first storage area 4 and the total storage area address.
The embodiment acquires a plurality of first storage area addresses based on a first space division result, wherein the first space division result is a space division result before updating a memory; establishing a total storage area based on a plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas; acquiring a plurality of second storage area addresses based on a partition updating requirement, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirement is the space partition requirement of the updated memory; and establishing the corresponding relation between a plurality of first storage area addresses and a plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation. The corresponding relation between a first storage area and a second storage area is established through a total storage area, the total storage area address corresponding to the starting address of the second storage area is obtained in the total storage area, the first storage area address corresponding to the total storage area address is further obtained in the first storage area, the corresponding relation between the starting address of the second storage area and the first storage area address is finally established, the second storage area address can be mapped to the total storage area address based on the corresponding relation, and then is further mapped to the first storage area address, the corresponding relation is not required to be directly established for the first storage area address and the second storage area address, the first storage area and the second storage area always only correspond to one total storage area, the condition of cross partition updating is avoided, the technical problem that the offset of the starting address cannot be calculated in a cross partition manner in the related technology is solved, the computing process of updating the storage area partition across partitions is reduced, and the updating efficiency of the storage area partition is improved.
In another embodiment, establishing the total memory area based on the plurality of first memory area addresses comprises:
step 1: acquiring the quantity of all storage units of a plurality of first storage areas, wherein the storage units at least comprise one byte;
step 2: and establishing a total storage area, wherein the number of storage units of the total storage area is not less than the number of all storage units of the plurality of first storage areas.
Illustratively, the number of memory cells in all the first memory areas is counted, and a total memory area in which the number of memory cells is not less than the number of memory cells in all the first memory areas is established, wherein the memory cells are the minimum unit of memory and can be set to one byte or a plurality of bytes.
Illustratively, the present embodiment may further acquire the start addresses and the end addresses of all the first storage areas, calculate the storage space of each first storage area based on the start addresses and the end addresses of the first storage areas, obtain the sum of the storage spaces of the plurality of first storage areas, and establish a total storage area having a storage space not lower than the sum of the storage spaces of the plurality of first storage areas.
In this embodiment, the number of all the storage units of the plurality of first storage areas is obtained, the total storage area is established based on the number of all the storage units of the plurality of first storage areas, cross-partition management and mapping of all the storage units in the first storage area can be realized based on the total storage area, and the technical problem that in the prior art, only the internal storage units can be managed based on the first storage area is solved.
In another embodiment, before obtaining the plurality of second storage area addresses based on the partition update requirement, the method further comprises:
step 1: and acquiring the minimum storage space of each image file of the system software to be updated, wherein the system software to be updated is the system software to be installed in the system updating process.
Illustratively, the system software to be updated is acquired, and further, the minimum storage space of each image file of the system software to be updated is acquired. The system software to be updated refers to system software which is prepared to be installed by a computer or other equipment in the system updating process; the mirror image file refers to a file which is manufactured and stored in a certain format for the system software to be updated, and comprises contents such as a system file, a boot file, partition table information and the like.
In one embodiment, the system software to be updated includes a plurality of image files and a start address and a partition size of a partition required by each image file.
Step 2: and establishing a second storage area corresponding to the image file based on the minimum storage space of each image file, wherein the storage space of the second storage area is not less than the minimum storage space of the image file corresponding to the second storage area.
Illustratively, a second storage area is established for each image file, and the storage space of the second storage area is not less than the minimum storage space of the image file, so as to ensure that the image file can be stored in the storage space corresponding to the second storage area.
It can be understood that, because the system software to be updated is not consistent with the original system software, the base address and the partition size of the existing memory partition cannot adapt to the system software to be updated, and thus the same image file may have a problem of cross-partition storage. For example, a certain image file of system software to be updated needs a storage space of 1000 storage units, and a partition to be written has only 800 storage units, and the image file needs to be split to store the image file into the partition.
In the embodiment, the minimum storage space of each image file of the system software to be updated is obtained, and the second storage area corresponding to the image file is established based on the minimum storage space of each image file, so that the problem of cross-partition caused by directly storing the image file based on the first storage area is avoided.
In another embodiment, after establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses, the method further includes:
and acquiring a plurality of image files of the system software to be updated, and sequentially storing each image file into the first storage area based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses.
Illustratively, each image file of the system software to be updated is acquired respectively, and each image file is stored in the corresponding first storage area in sequence based on the corresponding relation between the second storage area address and the first storage area address.
In one specific embodiment, a plurality of image files of the system software to be updated are acquired, each image file is divided into a plurality of image subfiles based on the size of the storage unit of the second storage area, and each image subfile is sequentially stored in the storage unit of the first storage area corresponding to each storage unit of the second storage area corresponding to the image file.
In one specific embodiment, a start address of each second storage area is acquired, each image file and the start address of the second storage area corresponding to the image file are transmitted to an interface of an updating module, the updating module updates system software after acquiring the content, and stores the image file to the first storage area based on the corresponding relationship between the second storage area address and the first storage area address.
In the embodiment, the plurality of image files of the system software to be updated are obtained, and each image file is stored into the corresponding first storage area corresponding to the corresponding second storage area based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses in sequence, so that the image files of the system software to be updated do not need to be split and directly stored into the first storage area, and the storage speed of the image files and the updating speed of the system software are improved.
In another embodiment, after establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses, the method further includes:
and establishing a second storage area control unit based on the plurality of second storage area addresses, wherein the second storage area control unit is used for executing operation instructions of the plurality of second storage areas.
Illustratively, a second storage area control unit is established in the system software for realizing centralized control of reading, writing, erasing, storing and the like of the plurality of second storage areas.
In one specific embodiment, the storage operation of the image file of the system software to be updated is realized based on the second storage area control unit.
The embodiment establishes the second storage area control unit based on the plurality of second storage area addresses, and the second storage area control unit is used for executing the operation instruction on the second storage area, so that the plurality of second storage areas are operated in a unified manner, and the integration level of the plurality of second storage areas is improved.
In another embodiment, establishing the correspondence between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first correspondence and the second correspondence includes:
step 1: sequentially acquiring the storage unit address of the total storage area corresponding to each storage unit of each second storage area in the total storage area, and sequentially acquiring the storage unit address of the first storage area corresponding to the storage unit of the total storage area in the plurality of first storage areas;
step 2: and storing the corresponding relation between the address of the storage unit of the total storage area and the address of the storage unit of the second storage area in a storage space.
Illustratively, based on the corresponding relation between the total storage area address and the first storage area address, the storage unit address of the total storage area corresponding to each storage unit of the second storage area is obtained in the total storage area, and based on the corresponding relation between the total storage area address and the second storage area address, the storage unit address of the first storage area corresponding to the storage unit of the total storage area is obtained in the first storage area, so as to establish the corresponding relation between the storage unit address of the second storage area and the storage unit address of the first storage area, and the corresponding relation between the storage unit address of the total storage area and the storage unit address of the second storage area is saved to the related storage space. It is understood that, in this embodiment, the corresponding relationship between the addresses of the storage units in the first storage area and the addresses of the storage units in the second storage area may also be stored in the relevant storage space.
Referring to fig. 5, fig. 5 is a schematic diagram of a total memory area according to another embodiment of the invention. Specifically, a corresponding relationship between the first storage area address and the total storage address is established, for example, a corresponding relationship between the 3 rd partition 3 unit (the 3 rd storage unit of the 3 rd first storage area) address in the first storage area and the 3 rd partition 3 unit (the 3 rd storage unit of the total storage area) in the first storage area is established, and a corresponding relationship between the second storage area address and the total storage area address is established, for example, a corresponding relationship between the 4 th partition 1 unit in the second storage area and the 3 rd partition unit in the total storage area is established. Through the total partition 3 unit, the corresponding relation between the partition 3 unit in the first storage area and the partition 1 unit in the second storage area is established.
Referring to fig. 6, fig. 6 is a schematic diagram of a total memory area according to another embodiment of the invention. Illustratively, as shown in fig. 6, when a bad block exists in the memory, there may be a case where the first memory area address does not correspond to the second memory area address, and therefore, it is necessary to establish a correspondence relationship between the first memory area address and the second memory area address. The bad block refers to a memory cell in the memory that cannot be operated by memory or erase. However, since the storage space of each first storage area is fixed and independent from each other, the corresponding relationship can only be established in the storage space range of the first storage area, that is, the address of the same first storage area cannot correspond to the addresses of two or more second storage areas, and thus the corresponding relationship between the address of the first storage area and the address of the second storage area cannot be established across partitions.
In one embodiment, as shown in fig. 6, the 3-partition 2 unit and the 4-partition 1 unit in the first storage area are bad blocks, and the 4-partition 1 unit of the second storage area should correspond to the 3-partition 2 unit of the first storage area in the case that there is no bad block. When a bad block exists in the 3-partition-2 unit of the first storage area, the next storage unit, namely the 3-partition-3 unit of the first storage area, needs to be acquired, and the address of the next storage unit corresponds to the 4-partition-1 unit of the second storage area.
In this embodiment, the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area are sequentially acquired in the total storage area, and the storage unit addresses of the first storage areas corresponding to the storage unit of the total storage area are sequentially acquired in the plurality of first storage areas, so that the storage units of the first storage areas and the storage units of the second storage areas can establish a corresponding relationship across partitions, and when the storage unit of the first storage area needs to be accessed, the corresponding storage unit of the second storage area is directly acquired, thereby improving the access speed of the storage area partitions.
In another embodiment, establishing correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses includes:
and establishing a mapping relation list of a plurality of first storage area addresses and a plurality of second storage area addresses.
Illustratively, a mapping relation list is established based on a plurality of first storage area addresses and a plurality of second storage area addresses, and the corresponding storage units of the first storage area can be quickly accessed through the mapping relation list based on the storage unit addresses of the second storage areas.
Illustratively, the mapping relationship list further includes a fast index channel for fast matching the address of the second storage area and mapping to the storage unit of the corresponding first storage area.
The embodiment establishes the mapping relation list of the first storage area address and the second storage area address, and when the first storage area needs to be accessed, the first storage area address and the second storage area address can be directly retrieved and mapped in the mapping relation list, so that the access convenience of the first storage area is improved, and the updating efficiency of the storage area partition is further improved.
In another embodiment, the sum of the storage spaces of the plurality of first storage areas is less than or equal to the storage space of the memory.
Illustratively, the sum of the storage spaces of the plurality of first storage areas may be the storage space of the whole memory, or may be only a part of the storage space of the memory. It will be appreciated that during an update of a memory partition, the total storage area need only be established for memory partitions that need to be updated across partitions, and need not be established for all partitions of memory.
Referring to fig. 7, in another embodiment, a system software updating method includes: acquiring the initial address and the storage space of a second storage area corresponding to each image file based on system software to be updated, and establishing the corresponding relation between the address of the first storage area and the address of the second storage area through a total storage area; calling a system upgrading interface, and transmitting the initial address of the second storage area, the image file of the system software to be updated and the size of the image file into the system upgrading interface; and acquiring the address of the second storage area address corresponding to the image file in the first storage area, namely the actual storage address, through the corresponding relation between the first storage area address and the second storage area address, and writing the image file into the actual storage address through a second storage area control unit.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
In this embodiment, a device for updating a memory partition is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. The terms "module," "unit," "subunit," and the like as used below may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 8 is a block diagram showing the structure of the memory partition update apparatus according to the present embodiment, and as shown in fig. 8, the apparatus includes:
the acquisition module is used for acquiring a plurality of first storage area addresses based on a first space division result, wherein the first space division result is a space division result before the updating of the memory;
the first relation establishing module is used for establishing a total storage area based on a plurality of first storage area addresses and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas;
the first relation establishing module is further used for acquiring the number of all storage units of the plurality of first storage areas, wherein the storage units at least comprise one byte;
establishing a total storage area, wherein the number of storage units of the total storage area is not less than the number of all storage units of the plurality of first storage areas;
the second relation establishing module is used for acquiring a plurality of second storage area addresses based on the partition updating requirement and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and the total storage area address, and the partition updating requirement is the space partition requirement of the updated memory;
a third relation establishing module, configured to establish a correspondence between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first correspondence and the second correspondence;
the third relation establishing module is further used for sequentially acquiring the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area in the total storage area, and sequentially acquiring the storage unit addresses of the first storage areas corresponding to the storage units of the total storage area in the plurality of first storage areas;
storing the corresponding relation between the address of the storage unit of the total storage area and the address of the storage unit of the second storage area in a storage space;
the third relation establishing module is also used for establishing a mapping relation list of a plurality of first storage area addresses and a plurality of second storage area addresses;
the updating device of the memory partition also comprises a second memory area establishing module;
the second storage area establishing module is used for acquiring the minimum storage space of each image file of the system software to be updated, and the system software to be updated is the system software to be installed in the system updating process;
establishing a second storage area corresponding to the image file based on the minimum storage space of each image file, wherein the storage space of the second storage area is not less than the minimum storage space of the image file corresponding to the second storage area;
the second storage area establishing module is also used for acquiring a plurality of image files of the system software to be updated and storing each image file into the first storage area in sequence based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses;
the updating device of the memory partition also comprises a control module;
and the control module is used for establishing a second storage area control unit based on the plurality of second storage area addresses, and the second storage area control unit is used for executing operation instructions of the plurality of second storage areas.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a plurality of first storage area addresses based on a first space division result, wherein the first space division result is a space division result before the updating of the memory;
s2, establishing a total storage area based on the plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is the corresponding relation between the plurality of first storage area addresses and the total storage area address, and the storage space of the total storage area is not less than the sum of the storage spaces of the plurality of first storage areas;
s3, acquiring a plurality of second storage area addresses based on the partition updating requirement, and establishing a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the plurality of second storage area addresses and the total storage area address, and the partition updating requirement is the space partition requirement of the updated memory;
s4, based on the first corresponding relation and the second corresponding relation, establishing the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.
In addition, in combination with the method for updating a memory partition provided in the foregoing embodiment, a storage medium may also be provided in this embodiment. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements the method of updating a memory partition of any of the above embodiments.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

CN202110909882.3A2021-08-092021-08-09Memory partition updating method and device, electronic device and storage mediumActiveCN113741812B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110909882.3ACN113741812B (en)2021-08-092021-08-09Memory partition updating method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110909882.3ACN113741812B (en)2021-08-092021-08-09Memory partition updating method and device, electronic device and storage medium

Publications (2)

Publication NumberPublication Date
CN113741812Atrue CN113741812A (en)2021-12-03
CN113741812B CN113741812B (en)2024-04-12

Family

ID=78730410

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110909882.3AActiveCN113741812B (en)2021-08-092021-08-09Memory partition updating method and device, electronic device and storage medium

Country Status (1)

CountryLink
CN (1)CN113741812B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103677940A (en)*2013-12-272014-03-26上海斐讯数据通信技术有限公司Method and system for updating operating system of T cards in trans-partition mode
US20160224247A1 (en)*2015-02-022016-08-04Yeong-Jae WOOMemory system, including memory device capable of overwrite operation, and method of operating the memory system
US20170017570A1 (en)*2015-07-132017-01-19Phison Electronics Corp.Mapping table updating method, memory control circuit unit and memory storage device
CN108595113A (en)*2018-03-222018-09-28维沃移动通信有限公司A kind of method and terminal of subregion adjustment
CN109324758A (en)*2018-08-242019-02-12华为技术有限公司 Data migration method, device and storage device
CN109710286A (en)*2018-11-302019-05-03歌尔科技有限公司 System upgrade method, apparatus, device and storage medium
CN112860291A (en)*2021-02-082021-05-28杭州涂鸦信息技术有限公司Firmware upgrading method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103677940A (en)*2013-12-272014-03-26上海斐讯数据通信技术有限公司Method and system for updating operating system of T cards in trans-partition mode
US20160224247A1 (en)*2015-02-022016-08-04Yeong-Jae WOOMemory system, including memory device capable of overwrite operation, and method of operating the memory system
US20170017570A1 (en)*2015-07-132017-01-19Phison Electronics Corp.Mapping table updating method, memory control circuit unit and memory storage device
CN108595113A (en)*2018-03-222018-09-28维沃移动通信有限公司A kind of method and terminal of subregion adjustment
CN109324758A (en)*2018-08-242019-02-12华为技术有限公司 Data migration method, device and storage device
CN109710286A (en)*2018-11-302019-05-03歌尔科技有限公司 System upgrade method, apparatus, device and storage medium
CN112860291A (en)*2021-02-082021-05-28杭州涂鸦信息技术有限公司Firmware upgrading method and device

Also Published As

Publication numberPublication date
CN113741812B (en)2024-04-12

Similar Documents

PublicationPublication DateTitle
CN108388599B (en)Electronic device, data migration and calling method and storage medium
US8417848B2 (en)Method and apparatus for implementing multiple service processing functions
EP3125501A1 (en)File synchronization method, server, and terminal
CN112269665B (en)Memory processing method and device, electronic equipment and storage medium
WO2021114025A1 (en)Incremental data determination method, incremental data determination apparatus, server and terminal device
CN105224421A (en)Data backup method and device and electronic equipment
CN108243254A (en)Electronic device, the method and storage medium of the publication of application upgrade version
CN110688201A (en)Log management method and related equipment
CN112306507A (en)Picture resource processing method, device, terminal and storage medium
CN114461149B (en)K8 s-based distributed data storage method and device
CN114490083A (en)CPU resource binding method and device, storage medium and electronic device
CN104063377A (en)Information processing method and electronic equipment using same
CN113568349A (en)Data processing method and device, terminal equipment and readable storage medium
CN113741812A (en)Memory partition updating method and device, electronic device and storage medium
CN114363293A (en)Device management method, system, readable storage medium and computer device
CN109298889A (en)A kind of method, startup advertisement update method and terminal device generating bootstrap
CN118467124A (en)Task scheduling method, device, computer equipment, program product and storage medium
CN115412505B (en)Data flow limiting method and device, electronic equipment and nonvolatile storage medium
CN117762455A (en)Updating method and device of BIOS firmware file, storage medium and electronic equipment
CN117539629A (en)Resource allocation method and device, storage medium and electronic equipment
CN110751204A (en)Data fusion method and device, storage medium and electronic device
CN104768133A (en)Method, device and gateway equipment for achieving single call among trunking systems
CN113360185A (en)Processing method and device for micro control unit of air conditioner outdoor unit and micro control unit
CN111427603A (en)Application program upgrading method and device
CN112380411A (en)Sensitive word processing method and device, electronic equipment, system and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp