Method for efficiently storing data
A method for efficiently storing data in a physical data memory involves comparing new data with already stored old data or a copy thereof. Only the non-matching data portions of the comparison are transmitted to the data memory and stored therein. The data stored in the data memory are addressed via a memory management in such a manner that the new data and the old data jointly use common data portions at the same physical storage location.
1 . A method for efficiently storing data in a physical data memory, the method comprising:
storing, by a memory management unit of the physical data memory, a second software image comprising a base image and a plurality of differences from a first software image, wherein the physical data memory is a flash memory;
receiving, by the memory management unit, a third software image, wherein the third software image is an update of the second software image, and wherein the received third software image includes a plurality of differences from the second software image and at least one additional difference, wherein the at least one additional difference is one of the plurality of differences from the first software image;
transmitting, by the memory management unit, the plurality of differences from the second software image to the physical data memory;
storing, by the memory management unit, the third software image in the physical data memory by storing the plurality of differences from the second software image, which were transmitted by the memory management unit, in the physical data memory and maintaining the base image of the second software image and at least one of the plurality of differences from the first software image in a current location in the physical memory; and
transmitting, by the memory management unit to a central processing unit external to the physical memory, a memory mapping of the third software image.
2 . The method of claim 1 , wherein the plurality of differences from a first software image and the plurality of differences from the second software image are pages.
3 . The method of claim 1 , wherein the plurality of differences from a first software image and the plurality of differences from the second software image are segments, wherein a size of the segments is dynamically adapted based on data contents of the segments.
4 . The method of claim 1 , wherein the plurality of differences from a first software image and the plurality of differences from the second software image are pages, wherein a size of the pages is specified based on hardware used.
5 . The method of claim 1 , wherein the memory management unit is software.
6 . The method of claim 1 , wherein the memory management unit is hardware.
7 . The method of claim 1 , further comprising:
accessing, by the central processing unit from the physical data memory via the memory management unit, the second and third software images; and
simultaneously executing, by the central processing unit, the second and third software images.
8 . The method of claim 1 , wherein the storing of the third software image further comprises:
marking as free, by the memory management unit, locations in the physical data memory storing differences of the plurality of differences from the first software image other than the least one of the plurality of differences from the first software image.
9 . The method of claim 1 , further comprising:
creating, by the central processing unit, a new mapping table for the third software image based on the memory mapping of the third software image transmitted by the memory management unit.
10 . The method of claim 9 , wherein the mapping table includes virtual page numbers for accessing the third software image, the method further comprising:
receiving, by the memory management unit from the central processing unit, a request to access a portion of the third software image, wherein the portion of the third software image is identified in the request by a virtual page number of the virtual page numbers;
accessing, by the memory management unit from the physical data memory using a physical data memory location corresponding to the virtual page number, the portion of the third software image; and
transmitting, from the memory management unit to the physical data memory, the requested portion of the third software image.