CN113741812B - 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
CN113741812B
CN113741812B CN202110909882.3A CN202110909882A CN113741812B CN 113741812 B CN113741812 B CN 113741812B CN 202110909882 A CN202110909882 A CN 202110909882A CN 113741812 B CN113741812 B CN 113741812B
Authority
CN
China
Prior art keywords
storage area
storage
memory
addresses
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.)
Active
Application number
CN202110909882.3A
Other languages
Chinese (zh)
Other versions
CN113741812A (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 Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110909882.3A priority Critical patent/CN113741812B/en
Publication of CN113741812A publication Critical patent/CN113741812A/en
Application granted granted Critical
Publication of CN113741812B publication Critical patent/CN113741812B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a memory partition updating method, wherein the memory partition updating method comprises the following steps: acquiring a plurality of first storage area addresses based on a 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 a corresponding relation between the plurality of second storage area addresses and a total storage area address; based on the first corresponding relation and the second corresponding relation, the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses is established. According to the method and the device for updating the memory area partition, the technical problem that the offset of the starting address cannot be calculated across the partition in the related technology is solved, the calculation process of updating the memory area partition across the partition is reduced, and the updating efficiency of the memory area partition is improved.

Description

Memory partition updating method and device, electronic device and storage medium
Technical Field
The present invention relates to the field of computer storage, and in particular, to a method, an apparatus, an electronic device, and a storage medium for updating a memory partition.
Background
During daily use of computer devices, computer systems are updated more and more frequently. The size of the new version system software is often inconsistent with that of the old version system software, so that the situation that the partition address and the partition size of the new version system are inconsistent with those of the old version system can occur in the updating process, and further the situation that the partition is not corresponding, the address cannot be accessed and the like in the updating process can be caused, and finally, the updating process is abnormal or crashed.
In order to solve the problem that the partitions are inconsistent in the system updating process, in the prior art, a new version system partition list and an old version system partition list are acquired to obtain each initial address of the new version system partition, and the offset of each initial address of the new version system partition relative to each initial address of the old version system partition is calculated to obtain the partition address after the system updating. 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 the offset of the start address cannot be calculated across partitions.
Aiming at the technical problem that the offset of the starting address cannot be calculated across the partitions in the related art, no effective solution is proposed at present.
Disclosure of Invention
In this embodiment, a method, an apparatus, an electronic device, and a storage medium for updating a memory partition are provided to solve the problem that an offset of a start address cannot be calculated across partitions in the related art.
In a first aspect, in this embodiment, there is provided a method for updating a memory partition, 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 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 a 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 smaller than the sum of the storage spaces of the plurality of first storage areas;
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 a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of an updated memory;
and establishing a plurality of corresponding relations between the first storage area addresses and the 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 number of all storage units of a plurality of first storage areas, wherein each storage unit at least comprises one byte;
and establishing the 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.
In some embodiments, the method further comprises, before the obtaining the plurality of second storage area addresses based on the partition update requirement:
acquiring the minimum storage space of each image file of system software to be updated, wherein the system software to be updated is 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 smaller than the minimum storage space of the image file corresponding to the second storage area.
In some embodiments, the establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses further includes:
and acquiring a plurality of image files of the system software to be updated, and storing each image file into the first storage area sequentially 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 the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses 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 on the plurality of second storage areas.
In some embodiments, the establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses based on the first correspondence and the second correspondence includes:
sequentially acquiring the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area from 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 from a plurality of first storage areas;
and storing the corresponding relation between the storage unit address of the total storage area and the storage unit address of the second storage area into a storage space.
In some embodiments, the establishing the 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 the plurality of first storage area addresses and the plurality of second storage area addresses.
In a second aspect, in this embodiment, there is provided an updating apparatus for a memory partition, including:
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 updating 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 a 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 smaller than the sum of the storage spaces 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 partition updating requirements and establishing a second corresponding relation, wherein the second corresponding relation is a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of the updated memory;
and the third relation establishing module is used for establishing the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation.
In a third aspect, in this embodiment, there is provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for updating a memory partition according to the first aspect.
In a fourth aspect, in this 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, the method for updating the memory partition provided in the embodiment obtains a plurality of first memory area addresses based on a first space division result, wherein the first space division result is a space division result before updating the 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 a 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 smaller than the sum of the storage spaces of the plurality of first storage areas; 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 a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of an updated memory; and establishing a plurality of corresponding relations between the first storage area addresses and the second storage area addresses based on the first corresponding relation and the second corresponding relation. The corresponding relation between the first storage area and the second storage area is established through the total storage area, the total storage area address corresponding to the initial 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 initial address of the second storage area and the first storage area address is finally established, the first storage area or the second storage area is not required to be split, the technical problem that the offset of the initial address cannot be calculated across the areas in the related art is solved, and the updating efficiency of the storage area areas is improved.
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 other features, objects, and advantages 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 embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a block diagram of a terminal hardware structure of a method for updating a memory partition according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for updating a memory partition according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the total memory area of an embodiment of the present invention;
FIG. 4 is a schematic diagram of the total memory area of another embodiment of the present invention;
FIG. 5 is a schematic diagram of the total memory area of another embodiment of the present invention;
FIG. 6 is a schematic diagram of the total memory area of another embodiment of the present invention;
FIG. 7 is a flow chart of a system software update method according to an embodiment of the invention;
FIG. 8 is a block diagram of an update apparatus for a memory partition according to an embodiment of the present invention.
Detailed Description
For a clearer understanding of the objects, technical solutions and advantages of the present application, the present application is described and illustrated below with reference to the accompanying drawings and examples.
Unless defined otherwise, technical or scientific terms used herein shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," "these," and the like in this application are not intended to be limiting in number, but rather are singular or plural. The terms "comprising," "including," "having," and any variations thereof, as used in the present application, are intended to cover a non-exclusive inclusion; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (units) is not limited to the list of steps or modules (units), but may include other steps or modules (units) not listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this application are 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 an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. Typically, the character "/" indicates that the associated object is an "or" relationship. The terms "first," "second," "third," and the like, as referred to in this application, merely distinguish similar objects and do not represent a particular ordering of objects.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or similar computing device. For example, the method is run on a terminal, and fig. 1 is a block diagram of the hardware structure of the terminal of the memory partition updating method of the present embodiment. As shown in fig. 1, the terminal may include one or more (only one is shown in fig. 1) processors 102 and a memory 104 for storing data, wherein the processors 102 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and is not intended to limit the structure of the terminal. 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.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to the method of updating a memory partition in the present embodiment, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-described method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In the process of updating computer system software, since the files of the new version system software and the old version system software are not consistent, the memory space division area of the old version system software may not match with the new version system software, and thus, a new space division area needs to be established based on the new version system software. However, in the system updating process, the new space division area is a virtual division area, so that the address of the new space division area needs to be mapped to the address of the original space division area, and the related file of the new system software can be stored in the physical area of the memory.
Because the space division areas are mutually independent, two or more space division areas cannot be mapped to the same space division area, namely, a mapping relation between a new space division area and an original space division area cannot be established across the subareas. Therefore, a total space area needs to be established in the middle, and a mapping relation between the new space division area and the original space division area is directly established with the total space area, so that a mapping relation between the new space division area and the original space division area is indirectly established.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for updating a memory partition according to an embodiment of the invention. In this embodiment, the method for updating a memory partition includes:
s202: and 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 the memory.
Illustratively, a plurality of first memory area addresses are obtained based on a space division result before the memory partition update, wherein the first space division result includes but is not limited to a space division result of a physical address of a memory, the first memory area includes but is not limited to each physical partition before the memory partition update, and the first memory area addresses include but are not limited to a start address and an end address of the first memory area, a part or all of a memory unit address of the first memory area, and the like.
Illustratively, the memory in the present invention includes, but is not limited to, nonvolatile storage media such as nand flash memory, nor flash memory, TF card, and the like.
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 a 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 smaller 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, and a first correspondence is established between the addresses of the first memory areas and the addresses of the total memory areas. Wherein the storage space of the total storage area is not smaller than the sum of the storage spaces of the plurality of first storage areas, thereby ensuring that each address of the first storage areas can find the corresponding total storage area address in the total storage area. It will be appreciated that the system will typically have access to the first memory area and the total memory area will only be accessed during the updating 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 are combined to form 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 partition updating requirements, and establishing a second corresponding relation, wherein the second corresponding relation is a corresponding relation between the plurality of second storage area addresses and the total storage area address, and the partition updating requirements are space dividing requirements of the updated memory.
Illustratively, the second storage area is established based on partition update requirements, and each address of the second storage area is established with an address of the total storage area in a second correspondence. The partition update requirement comprises a storage space partition requirement after the storage partition is updated.
S208: based on the first corresponding relation and the second corresponding relation, the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses is established.
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 between 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, the second storage area 1, the second storage area 2 and the second storage area 3 are established based on partition updating requirements, and the correspondence between the three second storage area addresses and the total storage area address is established. Based on the correspondence between the addresses of the second storage area 1, the second storage area 2 and the second storage area 3 and the total storage area address, and the correspondence between the addresses of the first storage area 1, the first storage area 2, the first storage area 3 and the first storage area 4 and the total storage area address, the correspondence between the three second storage area addresses and the four first storage area addresses is established.
The embodiment obtains 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 the plurality of first storage area addresses, and establishing a first corresponding relation, wherein the first corresponding relation is a 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 smaller than the sum of the storage spaces of the plurality of first storage areas; 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 a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of an updated memory; based on the first corresponding relation and the second corresponding relation, the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses is established. The corresponding relation between the first storage area and the second storage area is established through the total storage area, the total storage area address corresponding to the initial 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 initial 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 the second storage area address is further mapped to the first storage area address, the direct corresponding relation between the first storage area address and the second storage area address is not needed, the first storage area and the second storage area are always corresponding to one total storage area, the problem that the offset of the initial address cannot be calculated across the partition in the related technology is solved, the computing process of updating the storage area partition across the partition 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 includes:
step 1: acquiring the number of all storage units of the plurality of first storage areas, wherein each storage unit at least comprises one byte;
step 2: the total memory area is established, and the number of memory cells of the total memory area is not less than the number of all memory cells of the plurality of first memory areas.
Illustratively, the number of memory units in all the first memory areas is counted, and a total memory area in which the number of memory units is not lower than the number of memory units in all the first memory areas is established, wherein the memory units are the minimum memory unit of the memory, and can be set as one byte or a plurality of bytes.
The present embodiment may also obtain the start addresses and the end addresses of all the first memory areas, calculate the memory space of each first memory area based on the start addresses and the end addresses of the first memory areas, obtain the sum of the memory spaces of the plurality of first memory areas, and establish a total memory area in which the memory space is not lower than the sum of the memory spaces of the plurality of first memory areas.
According to the method and the device, the number of all storage units of the plurality of first storage areas is obtained, the total storage area is built based on the number of all storage units of the plurality of first storage areas, cross-partition management and mapping of all storage units in the first storage areas can be achieved based on the total storage area, and the technical problem that in the prior art, only internal storage units can be managed based on the first storage areas is solved.
In another embodiment, before the obtaining the plurality of second memory area addresses based on the partition update requirement 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 obtained, and a minimum storage space of each image file of the system software to be updated is further obtained. The system software to be updated refers to the system software which is ready to be installed in the system updating process of a computer or other equipment; the 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 guide file, partition table information and the like.
In one embodiment, the system software to be updated includes a plurality of image files and the start address of the partition and the partition size required for each image file.
Step 2: and establishing a second storage area corresponding to each image file based on the minimum storage space of the image file, wherein the storage space of the second storage area is not smaller 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 smaller 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 appreciated 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 be adapted to the system software to be updated, and thus the problem that the same image file may need to be stored across partitions may exist. For example, a certain image file of the system software to be updated needs 1000 storage units of storage space, while a partition to be written needs only 800 storage units, and the image file needs to be split to store the image file in the partition.
According to the method and the device for updating the image files, the minimum storage space of each image file of the system software to be updated is obtained, the second storage area corresponding to each image file is built based on the minimum storage space of each image file, and the problem of cross-partition caused by direct storage of the image files 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 mirror image files of the system software to be updated, and storing each mirror image file into the first storage area sequentially based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses.
Each image file of the system software to be updated is obtained 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 embodiment, a plurality of image files of the system software to be updated are obtained, each image file is divided into a plurality of image subfiles based on the size of a storage unit of the second storage area, and each image subfile is sequentially stored into a storage unit of the first storage area corresponding to each storage unit of the second storage area corresponding to the image file.
In one embodiment, the starting address of each second storage area is obtained, each image file and the starting address of the second storage area corresponding to the image file are transmitted to the interface of the updating module, the updating module updates the system software after obtaining the content, and the image file is stored in the first storage area based on the corresponding relation between the second storage area address and the first storage area address.
According to the embodiment, the plurality of mirror image files of the system software to be updated are obtained, each mirror image file is stored in the first storage area corresponding to the corresponding second storage area sequentially based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses, the mirror image files of the system software to be updated are not required to be split, and are directly stored in the first storage area, and therefore the storage speed of the mirror image files and the update 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:
a second memory area control unit is established based on the plurality of second memory area addresses, the second memory area control unit being for executing operation instructions to the plurality of second memory areas.
Illustratively, a second storage area control unit is established in the system software for implementing centralized control of operations of reading, writing, erasing, storing, etc. of the plurality of second storage areas.
In one embodiment, the second storage area control unit is used for realizing the storage operation of the image file of the system software to be updated.
In this embodiment, the second storage area control unit is established based on the plurality of second storage area addresses, and the second storage area control unit is configured to execute an operation instruction for the second storage area, so that unified operation is performed on the plurality of second storage areas, and the integration level of the plurality of second storage areas is improved.
In another embodiment, establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses based on the first correspondence and the second correspondence includes:
step 1: sequentially acquiring the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area from 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 from the plurality of first storage areas;
step 2: and storing the corresponding relation between the storage unit address of the total storage area and the storage unit address of the second storage area into a storage space.
Illustratively, based on the correspondence between the total memory area address and the first memory area address, the memory unit address of the total memory area corresponding to each memory unit of the second memory area is obtained in the total memory area, and based on the correspondence between the total memory area address and the second memory area address, the memory unit address of the first memory area corresponding to the memory unit of the total memory area is obtained in the first memory area, so as to establish the correspondence between the memory unit address of the second memory area and the memory unit address of the first memory area, and the correspondence between the memory unit address of the total memory area and the memory unit address of the second memory area is saved to the relevant memory space. It can be appreciated that, in this embodiment, the correspondence between the addresses of the first storage area and the addresses of the second storage area may also be saved to 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 correspondence between the first storage area address and the total storage address is established, for example, a correspondence between the 3 rd partition 3 unit (the 3 rd storage unit of the 3 rd first storage area) address and the total partition 3 unit (the 3 rd storage unit of the total storage area) in the first storage area is established, and a correspondence between the second storage area address and the total storage area address is established, for example, a correspondence between the 4 th partition 1 unit and the total partition 3 unit in the second storage area is established. And through the total partition 3 units, establishing the corresponding relation between the partition 3 units in the first storage area and the partition 1 units in the 4 partitions in the second storage area.
Referring to fig. 6, fig. 6 is a schematic diagram of a total memory area according to another embodiment of the invention. For example, as shown in fig. 6, when there is a bad block in the memory, a situation may occur in which the first memory area address does not correspond to the second memory area address, and thus 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 where the operation such as storage or erasing cannot be performed. However, since the storage space of each first storage area is fixed and independent, the corresponding relationship can only be established within 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, so that the corresponding relationship between the addresses of the first storage area and the addresses of the second storage areas cannot be established across the partitions.
In one embodiment, as shown in FIG. 6, the 3 partition 2 units and the 4 partition 1 units in the first storage area are bad blocks, and the 4 partition 1 units of the second storage area should correspond to the 3 partition 2 units of the first storage area in the absence of bad blocks. When there is a bad block in the 3 partition 2 unit of the first memory area, then the next memory unit, i.e., the 3 partition 3 unit of the first memory area, needs to be acquired and its address is corresponding to the 4 partition 1 unit of the second memory area.
According to the method, the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area are sequentially obtained from the total storage area, the storage unit addresses of the first storage areas corresponding to the storage units of the total storage area are sequentially obtained from the plurality of first storage areas, so that the storage units of the first storage areas and the second storage areas can establish a corresponding relation across the subareas, the storage units of the corresponding second storage areas are directly obtained when the storage units of the first storage areas are required to be accessed, and the access speed of the subareas of the storage areas is improved.
In another embodiment, establishing the 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 the plurality of first storage area addresses and the plurality of second storage area addresses.
By way of example, a mapping relationship list is established on the basis of the plurality of first memory area addresses and the plurality of second memory area addresses, by means of which memory units of the corresponding first memory area can be accessed quickly on the basis of the memory unit addresses of the second memory area.
The mapping relationship list further illustratively includes a fast index channel for fast matching the second memory area address and mapping to the memory location of the corresponding first memory area.
In this embodiment, a mapping relationship list of the first storage area address and the second storage area address is established, and when the first storage area needs to be accessed, the mapping relationship list can be directly searched and mapped, so that the convenience of access of the first storage area is improved, and the updating efficiency of the storage area partition is further improved.
In another embodiment, a sum of the storage spaces of the plurality of first storage areas is less than or equal to the storage space of the memory.
The sum of the storage spaces of the plurality of first storage areas may be the storage space of the entire 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, it is only necessary to establish a total memory area for the memory partition that needs to be updated across the partition, and it is not necessary to establish a total memory area for all partitions of the memory.
Referring to fig. 7, in another embodiment, the system software updating method includes: acquiring a starting address and a storage space of a second storage area corresponding to each image file based on system software to be updated, and establishing a corresponding relation between a first storage area address and a second storage area address through a total storage area; calling a system upgrading interface, and transmitting the starting 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 the second storage area control unit.
It should be noted that the steps illustrated in the above-described flow or 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 other than that illustrated herein.
The embodiment also provides a device for updating a memory partition, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. The terms "module," "unit," "sub-unit," and the like as used below may refer to a combination of software and/or hardware that performs a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
Fig. 8 is a block diagram of the structure of an updating apparatus of a memory partition of the present embodiment, as shown in fig. 8, including:
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 updating 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 smaller than the sum of the storage spaces of the plurality of first storage areas;
the first relation building module is further used for obtaining the number of all storage units of the plurality of first storage areas, and 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 partition updating requirements and establishing a second corresponding relation, wherein the second corresponding relation is a corresponding relation between the plurality of second storage area addresses and the total storage area address, and the partition updating requirements are space dividing requirements of the updated storage;
The third relation establishing module is used for establishing the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation;
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 storage unit address of the total storage area and the storage unit address of the second storage area into a storage space;
the third relation establishing module is further used for establishing a mapping relation list of the plurality of first storage area addresses and the plurality of second storage area addresses;
the updating device of the memory partition further comprises a second memory area establishing module;
the second storage area establishing module is used for acquiring the minimum storage space of each mirror 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;
establishing a second storage area corresponding to each image file based on the minimum storage space of each image file, wherein the storage space of the second storage area is not smaller than the minimum storage space of the image file corresponding to the second storage area;
The second storage area establishing module is further used for acquiring a plurality of mirror image files of the system software to be updated, and storing each mirror image file into the first storage area sequentially 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 further 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 on the plurality of second storage areas.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the various modules described above may be located in the same processor; or the above modules may be located in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described 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 updating a memory;
s2, 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 a 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 partition updating requirements, and establishing a second corresponding relation, wherein the second corresponding relation is a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of the updated memory;
s4, based on the first corresponding relation and the second corresponding relation, the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses is established.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and are not described in detail in this embodiment.
In addition, in combination with the method for updating the memory partition provided in the above embodiment, a storage medium may be provided in this embodiment. The storage medium has a computer program stored thereon; 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 made by one of ordinary skill in the art without undue burden from the present application, are within the scope of the present application in light of the embodiments provided herein.
It is evident that the drawings are only examples or embodiments of the present application, from which the present application can also be adapted to other similar situations by a person skilled in the art without the inventive effort. In addition, it should be appreciated that while the development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as an admission of insufficient detail.
The term "embodiment" in this application means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the 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. It will be clear or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the patent. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A method for updating a memory partition, comprising:
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 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 a 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 smaller than the sum of the storage spaces of the plurality of first storage areas;
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 a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of an updated memory;
and establishing a plurality of corresponding relations between the first storage area addresses and the second storage area addresses based on the first corresponding relation and the second corresponding relation.
2. The method of updating a memory partition of claim 1, wherein the establishing a total memory area based on the plurality of first memory area addresses comprises:
acquiring the number of all storage units of a plurality of first storage areas, wherein each storage unit at least comprises one byte;
and establishing the 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.
3. The method for updating a memory partition according to claim 1, wherein before 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 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 smaller than the minimum storage space of the image file corresponding to the second storage area.
4. The method for updating a memory partition according to claim 3, wherein said establishing the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses further comprises:
and acquiring a plurality of image files of the system software to be updated, and storing each image file into the first storage area sequentially based on the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses.
5. The method for updating a memory partition according to claim 1, wherein after the establishing of the correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses, further comprises:
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 on the plurality of second storage areas.
6. The method of updating a memory partition according to claim 1, wherein establishing correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses based on the first correspondence and the second correspondence comprises:
sequentially acquiring the storage unit addresses of the total storage area corresponding to each storage unit of each second storage area from 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 from a plurality of first storage areas;
and storing the corresponding relation between the storage unit address of the total storage area and the storage unit address of the second storage area into a storage space.
7. The method of updating a memory partition according to claim 1, wherein the establishing correspondence between the plurality of first memory area addresses and the plurality of second memory area addresses comprises:
and establishing a mapping relation list of the plurality of first storage area addresses and the plurality of second storage area addresses.
8. An apparatus for updating a memory partition, comprising:
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 updating 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 a 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 smaller than the sum of the storage spaces 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 partition updating requirements and establishing a second corresponding relation, wherein the second corresponding relation is a corresponding relation between the plurality of second storage area addresses and a total storage area address, and the partition updating requirements are space dividing requirements of the updated memory;
and the third relation establishing module is used for establishing the corresponding relation between the plurality of first storage area addresses and the plurality of second storage area addresses based on the first corresponding relation and the second corresponding relation.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of updating a memory partition of any of claims 1 to 7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of updating a memory partition of any of claims 1 to 7.
CN202110909882.3A 2021-08-09 2021-08-09 Memory partition updating method and device, electronic device and storage medium Active CN113741812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110909882.3A CN113741812B (en) 2021-08-09 2021-08-09 Memory partition updating method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110909882.3A CN113741812B (en) 2021-08-09 2021-08-09 Memory partition updating method and device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113741812A CN113741812A (en) 2021-12-03
CN113741812B true CN113741812B (en) 2024-04-12

Family

ID=78730410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110909882.3A Active CN113741812B (en) 2021-08-09 2021-08-09 Memory partition updating method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113741812B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677940A (en) * 2013-12-27 2014-03-26 上海斐讯数据通信技术有限公司 Method and system for updating operating system of T cards in trans-partition mode
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109324758A (en) * 2018-08-24 2019-02-12 华为技术有限公司 Data migration method, device and storage equipment
CN109710286A (en) * 2018-11-30 2019-05-03 歌尔科技有限公司 Method for upgrading system, device, equipment and storage medium
CN112860291A (en) * 2021-02-08 2021-05-28 杭州涂鸦信息技术有限公司 Firmware upgrading method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102275710B1 (en) * 2015-02-02 2021-07-09 삼성전자주식회사 Memory Device and Memory System capable of over-writing and Operating Method thereof
TWI534618B (en) * 2015-07-13 2016-05-21 群聯電子股份有限公司 Mapping table updating method, memory control circuit unit and memory storage device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677940A (en) * 2013-12-27 2014-03-26 上海斐讯数据通信技术有限公司 Method and system for updating operating system of T cards in trans-partition mode
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109324758A (en) * 2018-08-24 2019-02-12 华为技术有限公司 Data migration method, device and storage equipment
CN109710286A (en) * 2018-11-30 2019-05-03 歌尔科技有限公司 Method for upgrading system, device, equipment and storage medium
CN112860291A (en) * 2021-02-08 2021-05-28 杭州涂鸦信息技术有限公司 Firmware upgrading method and device

Also Published As

Publication number Publication date
CN113741812A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
CN108388599B (en) Electronic device, data migration and calling method and storage medium
CN112765271B (en) Block chain transaction index storage method and device, computer equipment and medium
CN111124464A (en) Method and system for differential upgrade of embedded system and computer readable storage medium
CN111221840A (en) Data processing method and device, data caching method, storage medium and system
CN111679728B (en) Data reading method and device
CN112035529A (en) Caching method and device, electronic equipment and computer readable storage medium
KR20160048173A (en) Storage processing method, device and terminal
CN113741812B (en) Memory partition updating method and device, electronic device and storage medium
CN104063377A (en) Information processing method and electronic equipment using same
CN111142885B (en) eSIM equipment management method, device, equipment and storage medium
CN111143240B (en) Image storage method, system and terminal equipment
CN115718641A (en) Memory simulation method and device, storage medium and electronic device
WO2016023276A1 (en) Data processing method and device for storage card
CN113986312B (en) Software upgrading method and device, electronic equipment and computer readable storage medium
CN114253730A (en) Method, device and equipment for managing database memory and storage medium
CN114756501A (en) Inter-chip communication method, device, system and storage medium
CN115080068A (en) Resource file transmission method, device, equipment and storage medium
CN115269530A (en) Data synchronization method, electronic device and computer-readable storage medium
CN112948291A (en) Data transmission method, electronic device and readable storage medium
CN112380411A (en) Sensitive word processing method and device, electronic equipment, system and storage medium
CN112261168A (en) Multi-IP port user information searching method, terminal equipment and storage medium
CN107688543B (en) Data management method and device based on EEPROM
CN112579003B (en) Key value pair adjustment method, key value pair adjustment device, storage medium and electronic device
CN114567644B (en) Data synchronization method and device and electronic equipment
CN116739599A (en) Transaction isolation processing method and device

Legal Events

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