KR20220085143A - Apparatus for updating program and method thereof - Google Patents
Apparatus for updating program and method thereof Download PDFInfo
- Publication number
- KR20220085143A KR20220085143A KR1020200174973A KR20200174973A KR20220085143A KR 20220085143 A KR20220085143 A KR 20220085143A KR 1020200174973 A KR1020200174973 A KR 1020200174973A KR 20200174973 A KR20200174973 A KR 20200174973A KR 20220085143 A KR20220085143 A KR 20220085143A
- Authority
- KR
- South Korea
- Prior art keywords
- partition
- image
- program
- stored
- xor operation
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30029—Logical and Boolean instructions, e.g. XOR, NOT
Abstract
본 발명은 프로그램 업데이트 장치에 관한 것으로, 업데이트 할 프로그램의 New 이미지를 수신하는 업데이트 이미지 수신부; 동작 파티션인 파티션 A와 예약 파티션인 파티션 B가 설정된 메모리부; 및 상기 New 이미지와 상기 파티션 A에 저장된 OLD 이미지를 배타적 오아(XOR) 연산한 결과인 XOR 연산 결과 이미지를 상기 파티션 B에 저장한 후, 상기 파티션 B에 저장한 상기 XOR 연산 결과 이미지를 이용하여 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 제어부;를 포함한다.The present invention relates to a program update device, comprising: an update image receiving unit for receiving a new image of a program to be updated; a memory unit in which a partition A as an operating partition and a partition B as a reserved partition are set; and storing the XOR operation result image, which is a result of XORing the New image and the OLD image stored in the partition A, in the partition B, and then using the XOR operation result image stored in the partition B and a control unit that updates the OLD image stored in partition A.
Description
본 발명은 프로그램 업데이트 장치 및 방법에 관한 것으로, 보다 상세하게는 비 MMU(Memory Management Unit) 방식으로 메모리에 저장되어 있는 프로그램을 액티브 상태에서 업데이트 할 경우 빠르게 업데이트를 수행할 수 있도록 하는, 프로그램 업데이트 장치 및 방법에 관한 것이다.The present invention relates to a program update apparatus and method, and more particularly, to a program update apparatus capable of rapidly performing update when a program stored in a memory is updated in an active state in a non-MMU (Memory Management Unit) method. and methods.
일반적으로 차량에는 복수의 전자제어장치(ECU : Electronic Control Unit)가 포함된다. 상기 전자제어장치(ECU)를 구동하기 위해서는 구동 프로그램(예 : 펌웨어)이 필요하며, 상기 구동 프로그램은 메모리에 저장된다.In general, a vehicle includes a plurality of electronic control units (ECUs). A driving program (eg, firmware) is required to drive the electronic control unit (ECU), and the driving program is stored in a memory.
상기 메모리는 비 휘발성 메모리로서 플래시 메모리를 포함한다.The memory includes a flash memory as a non-volatile memory.
한편 상기 메모리에 저장된 구동 프로그램은, 오류를 개선하거나 기능을 향상시키기 위하여, 주기적이거나 비주기적으로 프로그램 업데이트가 수행된다.On the other hand, the driving program stored in the memory is periodically or aperiodically program updated in order to improve an error or improve a function.
이 때 상기 메모리에 저장된 프로그램을 업데이트 하는 방식은, MMU(Memory Management Unit) 방식과 비 MMU 방식이 있는데, 먼저 상기 MMU 방식은 하드웨어적인 메모리 주소 스위칭이 가능하여 단일 이미지(바이너리 형태의 프로그램)로 다운로드 가능한 방식이지만, 비 MMU 방식에 비해 하드웨어 단가가 비싸기 때문에 보편적으로 사용하는 방식은 아니다. At this time, there are two methods for updating the program stored in the memory, the MMU (Memory Management Unit) method and the non-MMU method. It is a possible method, but it is not a universally used method because the hardware unit cost is higher than that of the non-MMU method.
다음 상기 비 MMU 방식은 하드웨어적인 메모리 주소 스위칭 유니트가 없기 때문에 직접 준비된 두 개의 메모리 파티션 주소 영역에 해당하는 복수의 업데이트 이미지(바이너리 형태의 업데이트 프로그램)를 미리 생성한 후, 프로그램 업데이트 시 현재 액티브(active) 메모리 파티션 영역에 대한 정보를 취득하여, 상기 미리 생성한 두 개의 이미지 중 비 액티브 파티션 영역에 매핑되는 업데이트 이미지를 다운로드하여 저장한 후, 플래시 부트로더(FBL)에 액티브 파티션의 시작 주소를 상기 업데이트 이미지가 저장된 파티션 영역으로 설정하는 방식이다(이 때 기존 액티브 파티션 영역은 이후 비 액티브 파티션 영역이 된다).Next, since the non-MMU method does not have a hardware memory address switching unit, a plurality of update images (binary-type update programs) corresponding to two directly prepared memory partition address areas are created in advance, and then when the program is updated, the current active ) obtains information on the memory partition area, downloads and stores an update image mapped to the non-active partition area among the two previously created images, and then updates the active partition start address in the flash bootloader (FBL). This is a method of setting the partition area where the image is stored (in this case, the existing active partition area becomes a non-active partition area thereafter).
그러나 상기 비 MMU 방식은 동일한 기능을 수행하는 복수의 업데이트 이미지(바이너리 형태의 업데이트 프로그램)를 미리 생성해야 하기 때문에 개별 업데이트 이미지의 개발과 검증에 소요되는 시간과 비용이 두 배로 소요되는 문제점이 있다. However, since the non-MMU method has to generate a plurality of update images (binary-type update programs) performing the same function in advance, there is a problem in that the time and cost required for developing and verifying individual update images is doubled.
또한 상기 비 MMU 방식으로 상기 프로그램 업데이트를 수행하기 위해서는 해당 파티션 영역에 대한 지우기(erase) 동작을 수행해야 되는데, 플래시 메모리의 특성상 지우기(erase)와 쓰기(write) 동작이 읽기(read) 동작에 비해서 현저히 많은 시간이 소요되기 때문에 전자제어장치(ECU)의 액티브 상태에서 프로그램 업데이트의 수행이 어려운 문제점이 있다. 따라서 가능한 한 메모리 파티션에 대한 지우기(erase)와 쓰기(write) 동작을 최소화 할 필요가 있다. In addition, in order to perform the program update in the non-MMU method, an erase operation must be performed on the corresponding partition area. Due to the characteristics of the flash memory, erase and write operations are different from read operations. Since it takes a significant amount of time, there is a problem in that it is difficult to perform the program update in the active state of the electronic control unit (ECU). Therefore, it is necessary to minimize erase and write operations on the memory partition as much as possible.
또한 상기 기존의 비 MMU 방식은 신 버전(New Version)의 업데이트 프로그램으로 업데이트 한 후 롤백(구 버전 프로그램으로 복귀)이 어려운 문제점이 있다.In addition, the existing non-MMU method has a problem in that it is difficult to rollback (return to the old version program) after updating to the update program of the new version.
따라서 비 MMU 방식으로 메모리에 저장되어 있는 프로그램을 액티브 상태에서 업데이트 할 경우, 단일 이미지의 개발과 다운로드가 가능하게 하고, 또한 지우기(erase) 동작을 수행하지 않도록 함으로써 빠르게 업데이트를 수행할 수 있도록 하며, 또한 롤백도 빠르고 쉽게 할 수 있는 프로그램 업데이트 방법이 필요한 상황이다.Therefore, when the program stored in the memory in the non-MMU method is updated in an active state, it enables the development and download of a single image, and also enables the update to be performed quickly by not performing the erase operation, In addition, there is a need for a program update method that can perform rollback quickly and easily.
본 발명의 배경기술은 대한민국 공개특허 10-2015-0064654호(2015.06.11. 공개, 펌웨어 업데이트 방법 및 그 전자 장치)에 개시되어 있다. Background art of the present invention is disclosed in Korean Patent Application Laid-Open No. 10-2015-0064654 (published on June 11, 2015, firmware update method and electronic device thereof).
본 발명의 일 측면에 따르면, 본 발명은 상기와 같은 문제점을 해결하기 위해 창작된 것으로서, 비 MMU(Memory Management Unit) 방식으로 메모리에 저장되어 있는 프로그램을 액티브 상태에서 업데이트 할 경우, 지우기(erase) 동작을 수행하지 않도록 하면서 빠르게 업데이트를 수행할 수 있도록 하는, 프로그램 업데이트 장치 및 방법을 제공하는 데 그 목적이 있다. According to one aspect of the present invention, the present invention was created to solve the above problems, and when a program stored in a memory in a non-MMU (Memory Management Unit) method is updated in an active state, it is erased. It is an object of the present invention to provide an apparatus and method for updating a program, which allows to perform an update quickly while not performing an operation.
본 발명의 일 측면에 따른 프로그램 업데이트 장치는, 업데이트 할 프로그램의 New 이미지를 수신하는 업데이트 이미지 수신부; 동작 파티션인 파티션 A와 예약 파티션인 파티션 B가 설정된 메모리부; 및 상기 New 이미지와 상기 파티션 A에 저장된 OLD 이미지를 배타적 오아(XOR) 연산한 결과인 XOR 연산 결과 이미지를 상기 파티션 B에 저장한 후, 상기 파티션 B에 저장한 상기 XOR 연산 결과 이미지를 이용하여 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 제어부;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided a program update apparatus, comprising: an update image receiving unit for receiving a new image of a program to be updated; a memory unit in which a partition A as an operating partition and a partition B as a reserved partition are set; and storing the XOR operation result image, which is a result of XORing the New image and the OLD image stored in the partition A, in the partition B, and then using the XOR operation result image stored in the partition B and a controller for updating the OLD image stored in partition A.
본 발명에 있어서, 상기 New 이미지는, 바이너리 형태의 업데이트 프로그램을 의미하고, 상기 OLD 이미지는, 바이너리 형태의 기존 프로그램을 의미하는 것을 특징으로 한다.In the present invention, the New image means an update program in binary format, and the OLD image means an existing program in binary format.
본 발명에 있어서, 상기 업데이트 이미지 수신부는, 상기 New 이미지를 스트리밍 형태로 실시간 다운로드 받는 것을 특징으로 한다.In the present invention, the updated image receiving unit is characterized in that the real-time download of the new image in the form of streaming.
본 발명에 있어서, 상기 제어부는, 파티션 B에 저장한 XOR 연산 결과 이미지와 파티션 A에 저장되어 있는 OLD 이미지를 XOR 연산하여, 이 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하는 방식으로 프로그램 업데이트를 수행하는 것을 특징으로 한다.In the present invention, the control unit performs XOR operation on the XOR operation result image stored in partition B and the OLD image stored in partition A, and transfers the XOR operation result New image to partition A where the OLD image is stored. It is characterized in that the program update is performed by the method of saving.
본 발명에 있어서, 상기 제어부는, 상기 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하기 위하여, 파티션 A에 대하여 섹터 단위로 OLD 이미지를 지우기(erase)하고 New 이미지를 쓰기(write)하는 것을 특징으로 한다.In the present invention, the controller erases the OLD image on a sector-by-sector basis for the partition A and writes the new image in order to store the new image, which is the result of the XOR operation, in the partition A where the OLD image is stored. It is characterized by writing.
본 발명에 있어서, 상기 제어부에 의해 프로그램 업데이트가 완료되면, 상기 메모리부의 파티션 A에는 New 이미지가 저장되어 있고, 파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 한다.In the present invention, when the program update is completed by the control unit, the new image is stored in the partition A of the memory unit, and the image as a result of XOR operation of the new image and the OLD image is stored in the partition B. do.
본 발명에 있어서, 상기 제어부는, 프로그램 롤백을 수행할 경우, 상기 파티션 A의 New 이미지와 상기 파티션 B의 XOR 연산 결과 이미지를 XOR 연산하여, 이 XOR 연산 결과를 상기 파티션 A에 저장하는 방식으로 롤백을 수행하는 것을 특징으로 한다.In the present invention, when performing a program rollback, the control unit performs an XOR operation on the New image of the partition A and the XOR operation result image of the partition B, and stores the XOR operation result in the partition A. characterized by performing
본 발명에 있어서, 상기 제어부에 의해 프로그램 롤백이 완료되면, 상기 메모리부의 파티션 A에는 OLD 이미지가 저장되어 있고, 파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 한다.In the present invention, when the program rollback is completed by the control unit, the OLD image is stored in the partition A of the memory unit, and the image as a result of XOR operation of the New image and the OLD image is stored in the partition B. do.
본 발명의 다른 측면에 따른 프로그램 업데이트 방법은, 업데이트 이미지 수신부가 프로그램 업데이트를 위하여 New 이미지를 수신하는 단계; 제어부가 상기 New 이미지와 메모리부의 파티션 A에 저장된 OLD 이미지를 배타적 오아(XOR) 연산하는 단계; 상기 제어부가 상기 XOR 연산에 따른 XOR 연산 결과 이미지를 상기 메모리부의 파티션 B에 저장하는 단계; 및 상기 제어부가 상기 파티션 B에 저장한 상기 XOR 연산 결과 이미지를 이용하여 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 단계;를 포함하는 것을 특징으로 한다.A program update method according to another aspect of the present invention comprises the steps of: receiving, by an update image receiving unit, a New image for program update; performing an exclusive OR (XOR) operation on the new image and the OLD image stored in partition A of the memory unit; storing, by the controller, an XOR operation result image according to the XOR operation in the partition B of the memory unit; and updating, by the controller, the OLD image stored in the partition A using the XOR operation result image stored in the partition B.
본 발명에 있어서, 상기 New 이미지는, 바이너리 형태의 업데이트 프로그램을 의미하고, 상기 OLD 이미지는, 바이너리 형태의 기존 프로그램을 의미하는 것을 특징으로 한다.In the present invention, the New image means an update program in binary format, and the OLD image means an existing program in binary format.
본 발명에 있어서, 상기 프로그램 업데이트를 위하여 New 이미지를 수신하는 단계에서, 상기 업데이트 이미지 수신부는, 상기 New 이미지를 스트리밍 형태로 실시간 다운로드 받는 것을 특징으로 한다.In the present invention, in the step of receiving the new image for the program update, the update image receiving unit is characterized in that the new image is downloaded in real time in a streaming form.
본 발명에 있어서, 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 단계에서, 상기 제어부는, 파티션 B에 저장한 XOR 연산 결과 이미지와 파티션 A에 저장되어 있는 OLD 이미지를 XOR 연산하여, 이 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하는 방식으로 프로그램 업데이트를 수행하는 것을 특징으로 한다.In the present invention, in the step of updating the OLD image stored in the partition A, the controller performs an XOR operation on the XOR operation result image stored in the partition B and the OLD image stored in the partition A, and the XOR operation result is It is characterized in that the program update is performed in such a way that the new image is stored in the partition A where the OLD image is stored.
본 발명에 있어서, 상기 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하기 위하여, 상기 제어부는, 파티션 A에 대하여 섹터 단위로 OLD 이미지를 지우기(erase)하고 New 이미지를 쓰기(write)하는 것을 특징으로 한다.In the present invention, in order to store the new image, which is the result of the XOR operation, in the partition A in which the OLD image is stored, the controller erases the OLD image in a sector-by-sector unit for partition A and writes the new image. It is characterized by writing.
본 발명에 있어서, 상기 제어부에 의해 프로그램 업데이트가 완료될 경우, 상기 메모리부의 파티션 A에는 New 이미지가 저장되어 있고, 파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 한다.In the present invention, when the program update is completed by the control unit, a new image is stored in partition A of the memory unit, and an image resulting from XOR operation of the new image and the OLD image is stored in partition B do it with
본 발명에 있어서, 상기 프로그램 업데이트 후 프로그램 롤백을 수행하고자 할 경우, 상기 제어부는, 상기 파티션 A의 New 이미지와 상기 파티션 B의 XOR 연산 결과 이미지를 XOR 연산하여, 이 XOR 연산 결과를 상기 파티션 A에 저장하는 방식으로 롤백을 수행하는 것을 특징으로 한다.In the present invention, when a program rollback is to be performed after the program update, the control unit XORs the New image of the partition A and the XOR operation result image of the partition B, and stores the XOR operation result in the partition A It is characterized by performing a rollback in a way of saving.
본 발명에 있어서, 상기 제어부에 의해 프로그램 롤백이 완료될 경우, 상기 메모리부의 파티션 A에는 OLD 이미지가 저장되어 있고, 파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 한다.In the present invention, when the program rollback is completed by the control unit, the OLD image is stored in the partition A of the memory unit, and the image as a result of XOR operation of the New image and the OLD image is stored in the partition B do it with
본 발명의 일 측면에 따르면, 본 발명은 비 MMU 방식으로 메모리에 저장되어 있는 프로그램을 액티브 상태에서 업데이트 할 경우, 단일 이미지의 개발과 다운로드가 가능하게 하고, 또한 메모리 파티션에 대한 지우기(erase)와 쓰기(write) 동작을 최소한으로 수행하도록 함으로써 프로그램을 빠르게 업데이트를 수행할 수 있도록 하며, 또한 롤백도 빠르고 쉽게 수행할 수 있도록 하는 효과가 있다.According to one aspect of the present invention, the present invention enables the development and download of a single image when a program stored in a memory is updated in an active state in a non-MMU manner, and also erases a memory partition and By minimizing the write operation, the program can be updated quickly and rollback can be performed quickly and easily.
도 1은 본 발명의 일 실시예에 따른 프로그램 업데이트 장치의 개략적인 구성을 보인 예시도.
도 2는 본 발명의 일 실시예에 따른 프로그램 업데이트 방법을 설명하기 위한 흐름도.
도 3은 상기 도 2에 있어서, 프로그램 업데이트 방법을 설명하기 위한 예시도.
도 4는 본 발명의 일 실시예에 따른 프로그램 롤백 방법을 설명하기 위한 흐름도.
도 5는 상기 도 4에 있어서, 프로그램 롤백 방법을 설명하기 위한 예시도.1 is an exemplary diagram showing a schematic configuration of a program update apparatus according to an embodiment of the present invention;
2 is a flowchart illustrating a program update method according to an embodiment of the present invention;
3 is an exemplary diagram for explaining a program update method in FIG. 2 .
4 is a flowchart illustrating a program rollback method according to an embodiment of the present invention.
FIG. 5 is an exemplary diagram for explaining a program rollback method in FIG. 4 .
이하, 첨부된 도면을 참조하여 본 발명에 따른 프로그램 업데이트 장치 및 방법의 일 실시예를 설명한다. Hereinafter, an embodiment of a program update apparatus and method according to the present invention will be described with reference to the accompanying drawings.
이 과정에서 도면에 도시된 선들의 두께나 구성요소의 크기 등은 설명의 명료성과 편의상 과장되게 도시되어 있을 수 있다. 또한, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례에 따라 달라질 수 있다. 그러므로 이러한 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In this process, the thickness of the lines or the size of the components shown in the drawings may be exaggerated for clarity and convenience of explanation. In addition, the terms to be described later are terms defined in consideration of functions in the present invention, which may vary according to the intention or custom of the user or operator. Therefore, definitions of these terms should be made based on the content throughout this specification.
도 1은 본 발명의 일 실시예에 따른 프로그램 업데이트 장치의 개략적인 구성을 보인 예시도이다.1 is an exemplary diagram showing a schematic configuration of a program update apparatus according to an embodiment of the present invention.
도 1에 도시된 바와 같이, 본 실시예에 따른 프로그램 업데이트 장치는, 업데이트 이미지 수신부(110), 제어부(120), 및 메모리부(130)를 포함한다.As shown in FIG. 1 , the program update apparatus according to the present embodiment includes an update
상기 업데이트 이미지 수신부(110)는 프로그램을 업데이트 할 New 이미지(즉, 바이너리 형태의 업데이트 프로그램)를 지정된 장치(예 : 서버, 휴대 단말 등)로부터 다운로드 받는다. The update
상기 다운로드 받은 New 이미지(즉, 바이너리 형태의 업데이트 프로그램)는 지정된 버퍼부(미도시)에 저장되어 있다가 다운로드 받을 수 있으며, 스트리밍 방식으로 실시간 다운로드 받을 수도 있다.The downloaded New image (ie, binary update program) may be stored in a designated buffer unit (not shown) and then downloaded, or may be downloaded in real time in a streaming manner.
상기 제어부(120)(예 : ECU, MCU 등)는 상기 다운로드 받은 New 이미지(즉, 바이너리 형태의 업데이트 프로그램)를 현재 액티브(동작) 상태에 있는 메모리부(130)의 파티션(예 : 파티션 A)에 기 저장되어 있는 프로그램(즉, OLD 프로그램 또는 OLD 이미지)의 업데이트를 수행한다. The control unit 120 (eg, ECU, MCU, etc.) converts the downloaded New image (ie, update program in binary format) to a partition (eg, partition A) of the
이 때 상기 제어부(120)는 상기 파티션(예 : 파티션 A)에 저장되어 있는 프로그램(즉, OLD 프로그램 또는 OLD 이미지)의 업데이트를 수행하는 방법에 대해서 도 2 및 도 3을 참조하여 설명한다.In this case, a method for the
도 2는 본 발명의 일 실시예에 따른 프로그램 업데이트 방법을 설명하기 위한 흐름도이고, 도 3은 상기 도 2에 있어서, 프로그램 업데이트 방법을 설명하기 위한 예시도이다.2 is a flowchart illustrating a program update method according to an embodiment of the present invention, and FIG. 3 is an exemplary diagram illustrating the program update method in FIG. 2 .
도 2를 참조하면, 상기 제어부(120)는 프로그램 업데이트를 수행할 경우(S101의 예), New 이미지(즉, 바이너리 형태의 업데이트 프로그램)를 수신한다(S102).Referring to FIG. 2 , when performing a program update (YES in S101), the
이 때 상기 New 이미지(즉, 바이너리 형태의 업데이트 프로그램)는 미리 다운로드 받거나 실시간으로(스트리밍 형태로) 다운로드 받을 수 있다.In this case, the new image (ie, binary update program) may be downloaded in advance or downloaded in real time (in streaming format).
상기 제어부(120)는 상기 New 이미지(즉, 바이너리 형태의 업데이트 프로그램인 New 이미지)와 메모리부(130)의 지정된 영역(예 : 파티션 A)에 저장되어 있는 기존 프로그램(즉, 바이너리 형태로 저장되어 있는 OLD 이미지)을 배타적 오아(XOR) 연산을 수행한다(S103).The
여기서 상기 배타적 오아(XOR) 연산은, "A XOR B = C", "A XOR C = B", "B XOR C = A"와 같은 특성을 갖는다. 즉, New 이미지(즉, 업데이트 프로그램)를 A로 가정하고, OLD 이미지(즉, 기존 프로그램)를 B로 가정하고, XOR 연산 결과 값(XOR 연산 결과 이미지)을 C로 가정할 때, 상기 New 이미지(A)와 상기 OLD 이미지(B)를 XOR 연산하면 XOR 연산 결과 이미지(C)가 산출되고, 상기 New 이미지(A)와 상기 XOR 연산 결과 이미지(C)를 XOR 연산하면 상기 OLD 이미지(B)가 산출되며(즉, 프로그램 롤백에 해당하는 결과가 산출되며), 상기 OLD 이미지(B)와 상기 XOR 연산 결과 이미지(C)를 XOR 연산하면 상기 New 이미지(A)가 산출(즉, 프로그램 업데이트에 해당하는 결과가 산출)되는 특성이 있다.Here, the XOR operation has characteristics such as "A XOR B = C", "A XOR C = B", and "B XOR C = A". That is, assuming that the New image (ie, update program) is A, the OLD image (ie, the existing program) is B, and the XOR operation result value (XOR operation result image) is C, the New image When (A) and the OLD image (B) are XORed, an XOR operation result image (C) is calculated, and when the New image (A) and the XOR operation result image (C) are XORed, the OLD image (B) is calculated (that is, a result corresponding to a program rollback is calculated), and when the OLD image (B) and the XOR operation result image (C) are XORed, the New image (A) is calculated (ie, in program update) There is a characteristic that produces a corresponding result).
상기와 같은 배타적 오아(XOR) 연산의 특성에 따라, 상기 제어부(120)는 New 이미지(A)와 OLD 이미지(B)를 XOR 연산하여(도 3의 (a)의 ① 참조) XOR 연산 결과 이미지(C)를 메모리부(130)의 지정된 영역(예 : 파티션 B, 예약(reserved)된 영역)에 저장한다(S104)(도 3의 (a)의 ② 참조).According to the characteristics of the XOR operation as described above, the
또한 상기와 같은 배타적 오아(XOR) 연산의 특성에 따라, 상기 제어부(120)는 상기 지정된 영역(예 : 파티션 B)에 저장한 XOR 연산 결과 이미지(C)와 지정된 영역(예 : 파티션 A)에 저장되어 있는 OLD 이미지(B)를 XOR 연산한다(S105)(도 3의 (b)의 ① 참조).In addition, according to the characteristics of the exclusive OR (XOR) operation as described above, the
그리고 상기 제어부(120)는 상기 XOR 연산 결과(즉, 상기 파티션 B에 저장한 XOR 연산 결과 이미지(C)와 상기 파티션 A에 저장되어 있던 OLD 이미지(B)를 XOR 연산한 결과인 New 이미지(A))를 상기 OLD 이미지(B)가 저장되어 있던 지정된 영역(예 : 파티션 A)에 저장(즉, 섹터 단위로 지우기(erase)와 쓰기(write)를 통한 업데이트)한다(S106)(도 3의 (b)의 ② 참조).And the
이에 따라 프로그램 업데이트가 완료되면, 상기 메모리부(130)의 파티션 A에는 New 이미지(A)가 저장되고, 상기 메모리부(130)의 파티션 B에는 New 이미지(A)와 OLD 이미지(B)를 XOR 연산한 결과 이미지(C)가 저장된다(도 3의 (c) 참조).Accordingly, when the program update is completed, the new image (A) is stored in the partition A of the
한편 상기와 같이 신 버전(New Version)의 New 이미지(A)로 업데이트가 수행된 후, 오류가 발생하여 다시 롤백(구 버전의 OLD 이미지로 복귀)해야 하는 상황이 발생할 수 있다. On the other hand, after the update is performed to the new image (A) of the new version as described above, there may be a situation in which an error occurs and it is necessary to roll back (revert to the old image of the old version).
이 경우 종래에는 메모리 SWAP(즉, 프로그램 업데이트 시, 파티션 B에 다운로드 받아 저장된 New 이미지를 파티션 A에 옮겨 저장하고, 파티션 A에 저장되어 있던 OLD 이미지는 파티션 B에 옮겨 저장해 두었다가, 롤백 시 New 이미지를 파티션 B에 옮겨 저장하고, OLD 이미지를 다시 파티션 A에 옮겨 저장하는 것)을 통해 롤백을 수행할 수는 있으나, 파티션 A와 파티션 B에 대하여 모두 지우기(erase)와 쓰기(write)를 반복 수행해야 하기 때문에 프로그램 업데이트는 물론, 프로그램 롤백 시에도 많은 시간이 소요되는 문제점이 있었다.In this case, conventionally, memory SWAP (that is, when updating a program, the new image downloaded and stored in partition B is moved to partition A and stored, and the OLD image stored in partition A is moved and stored in partition B, and when rollback, the new image is stored. It is possible to perform rollback by moving and saving the OLD image to partition B, and then moving and saving the OLD image to partition A), but it is necessary to repeatedly erase and write to both partition A and partition B. Therefore, there was a problem that it takes a lot of time to update the program as well as to roll back the program.
반면에 본 실시예에서는 프로그램 업데이트와 프로그램 롤백 시에 업데이트나 롤백 대상이 되는 하나의 지정된 영역(예 : 파티션 A)에 대해서만 지우기(erase)와 쓰기(write)를 수행하므로, 프로그램 업데이트나 프로그램 롤백 시 소요되는 시간을 단축시킬 수 있는 장점이 있다.On the other hand, in this embodiment, erase and write are performed only for one designated area (eg, partition A) to be updated or rolled back during program update and program rollback. There is an advantage in that the time required can be shortened.
도 4는 본 발명의 일 실시예에 따른 프로그램 롤백 방법을 설명하기 위한 흐름도이고, 도 5는 상기 도 4에 있어서, 프로그램 롤백 방법을 설명하기 위한 예시도이다.4 is a flowchart illustrating a program rollback method according to an embodiment of the present invention, and FIG. 5 is an exemplary diagram illustrating the program rollback method in FIG. 4 .
도 4를 참조하면, 메모리부(130)의 파티션 A에 New 이미지(A)가 저장되어 있고, 파티션 B에 XOR 연산 값(즉, 상기 New 이미지(A)와 상기 OLD 이미지(B)를 XOR 연산한 결과 이미지(C))이 저장되어 있는 상태에서(도 5의 (a) 참조), 프로그램 롤백을 수행할 경우(S201의 예), 상기 제어부(120)는 메모리부(130)의 파티션 A에 저장되어 있는 New 이미지(즉, 바이너리 형태의 업데이트 프로그램)를 인출한다(S202).Referring to FIG. 4 , a new image (A) is stored in partition A of the
또한 상기 제어부(120)는 메모리부(130)의 파티션 B에 저장되어 있는 XOR 연산 값(즉, New 이미지(A)와 OLD 이미지(B)를 XOR 연산한 결과 이미지(C))를 인출한다(S203).In addition, the
또한 상기 제어부(120)는 상기 메모리부(130)의 지정된 영역(예 : 파티션 A)에서 인출한 New 이미지(A)와 상기 메모리부(130)의 다른 지정된 영역(예 : 파티션 B)에서 인출한 XOR 연산 결과 이미지(C)를 XOR 연산하여(S204)(도 5의 (b)의 ① 참조), 상기 메모리부(130)의 지정된 영역(예 : 파티션 A)에 저장(즉, 섹터 단위로 지우기(erase)와 쓰기(write)를 통한 롤백)한다(S205)(도 5의 (b)의 ② 참조).In addition, the
이에 따라 롤백이 완료되면, 상기 메모리부(130)의 파티션 A에는 기존의 OLD 이미지(B)가 다시 저장되고, 상기 메모리부(130)의 파티션 B에는 상기 XOR 연산 값(즉, New 이미지(A)와 OLD 이미지(B)를 XOR 연산한 결과 이미지(C))이 그대로 저장된다(도 5의 (c) 참조).Accordingly, when the rollback is completed, the existing OLD image (B) is stored again in the partition A of the
상기와 같이 본 실시예는 프로그램 롤백 시에도 대상 영역(예 : 파티션 A)에 대한 지우기(erase)와 쓰기(write)를 한번만 수행하므로 기존 대비 롤백 시간을 반 이하로 단축시킬 수 있는 효과가 있다.As described above, the present embodiment has the effect of reducing the rollback time by half or less compared to the conventional one, since erase and write of the target area (eg, partition A) is performed only once even during program rollback.
상기와 같이 본 실시예는 비 MMU 방식으로 메모리에 저장되어 있는 프로그램을 액티브 상태에서 업데이트 할 경우, 단일 이미지의 개발과 다운로드가 가능하게 하고, 또한 메모리 파티션에 대한 지우기(erase)와 쓰기(write) 동작을 최소한으로 수행하도록 함으로써, 프로그램을 빠르게 업데이트를 수행할 수 있도록 하며, 또한 롤백도 빠르고 쉽게 수행할 수 있도록 하는 효과가 있다.As described above, this embodiment enables the development and download of a single image when the program stored in the memory is updated in an active state in a non-MMU manner, and also erases and writes to the memory partition. By minimizing the operation, the program can be updated quickly and rollback can be performed quickly and easily.
이상으로 본 발명은 도면에 도시된 실시예를 참고로 하여 설명되었으나, 이는 예시적인 것에 불과하며, 당해 기술이 속하는 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 따라서 본 발명의 기술적 보호범위는 아래의 특허청구범위에 의해서 정하여져야 할 것이다. 또한 본 명세서에서 설명된 구현은, 예컨대, 방법 또는 프로세스, 장치, 소프트웨어 프로그램, 데이터 스트림 또는 신호로 구현될 수 있다. 단일 형태의 구현의 맥락에서만 논의(예컨대, 방법으로서만 논의)되었더라도, 논의된 특징의 구현은 또한 다른 형태(예컨대, 장치 또는 프로그램)로도 구현될 수 있다. 장치는 적절한 하드웨어, 소프트웨어 및 펌웨어 등으로 구현될 수 있다. 방법은, 예컨대, 컴퓨터, 마이크로프로세서, 집적 회로 또는 프로그래밍 가능한 로직 디바이스 등을 포함하는 프로세싱 디바이스를 일반적으로 지칭하는 프로세서 등과 같은 장치에서 구현될 수 있다. 프로세서는 또한 최종-사용자 사이에 정보의 통신을 용이하게 하는 컴퓨터, 셀 폰, 휴대용/개인용 정보 단말기(personal digital assistant: "PDA") 및 다른 디바이스 등과 같은 통신 디바이스를 포함한다.As described above, the present invention has been described with reference to the embodiment shown in the drawings, but this is merely exemplary, and various modifications and equivalent other embodiments are possible therefrom by those skilled in the art to which the art pertains. will understand the point. Therefore, the technical protection scope of the present invention should be defined by the following claims. Implementations described herein may also be implemented as, for example, a method or process, an apparatus, a software program, a data stream, or a signal. Although discussed only in the context of a single form of implementation (eg, discussed only as a method), implementations of the discussed features may also be implemented in other forms (eg, as an apparatus or program). The apparatus may be implemented in suitable hardware, software and firmware, and the like. A method may be implemented in an apparatus such as, for example, a processor, which generally refers to a computer, a microprocessor, a processing device, including an integrated circuit or programmable logic device, and the like. Processors also include communication devices such as computers, cell phones, portable/personal digital assistants (“PDA”) and other devices that facilitate communication of information between end-users.
110 : 업데이트 이미지 수신부
120 : 제어부
130 : 메모리부110: update image receiving unit
120: control unit
130: memory unit
Claims (16)
동작 파티션인 파티션 A와 예약 파티션인 파티션 B가 설정된 메모리부; 및
상기 New 이미지와 상기 파티션 A에 저장된 OLD 이미지를 배타적 오아(XOR) 연산한 결과인 XOR 연산 결과 이미지를 상기 파티션 B에 저장한 후, 상기 파티션 B에 저장한 상기 XOR 연산 결과 이미지를 이용하여 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 제어부;를 포함하는 것을 특징으로 하는 프로그램 업데이트 장치.
an update image receiving unit for receiving a new image of a program to be updated;
a memory unit in which a partition A as an operating partition and a partition B as a reserved partition are set; and
After storing the XOR operation result image, which is a result of XORing the New image and the OLD image stored in the partition A, in the partition B, the partition using the XOR operation result image stored in the partition B A program update device comprising a; a control unit for updating the OLD image stored in A.
상기 New 이미지는, 바이너리 형태의 업데이트 프로그램을 의미하고,
상기 OLD 이미지는, 바이너리 형태의 기존 프로그램을 의미하는 것을 특징으로 하는 프로그램 업데이트 장치.
The method of claim 1,
The new image means an update program in binary form,
The OLD image is a program update device, characterized in that it means an existing program in a binary form.
상기 New 이미지를 스트리밍 형태로 실시간 다운로드 받는 것을 특징으로 하는 프로그램 업데이트 장치.
The method of claim 1, wherein the update image receiving unit,
A program update device, characterized in that the new image is downloaded in real time in a streaming form.
파티션 B에 저장한 XOR 연산 결과 이미지와 파티션 A에 저장되어 있는 OLD 이미지를 XOR 연산하여, 이 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하는 방식으로 프로그램 업데이트를 수행하는 것을 특징으로 하는 프로그램 업데이트 장치.
According to claim 1, wherein the control unit,
It performs program update by performing XOR operation on the XOR operation result image stored in partition B and the OLD image stored in partition A, and storing the new image resulting from the XOR operation in partition A where the OLD image is stored. A program update device, characterized in that.
상기 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하기 위하여,
파티션 A에 대하여 섹터 단위로 OLD 이미지를 지우기(erase)하고 New 이미지를 쓰기(write)하는 것을 특징으로 하는 프로그램 업데이트 장치.
According to claim 4, wherein the control unit,
In order to store the new image, which is the result of the XOR operation, in partition A where the OLD image is stored,
A program update device, characterized in that for partition A, erasing the OLD image in units of sectors and writing the new image.
상기 메모리부의 파티션 A에는 New 이미지가 저장되어 있고,
파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 하는 프로그램 업데이트 장치.
The method of claim 1, wherein when the program update is completed by the control unit,
A new image is stored in partition A of the memory unit,
The program update device, characterized in that the partition B stores the image as a result of XORing the New image and the OLD image.
프로그램 롤백을 수행할 경우,
상기 파티션 A의 New 이미지와 상기 파티션 B의 XOR 연산 결과 이미지를 XOR 연산하여, 이 XOR 연산 결과를 상기 파티션 A에 저장하는 방식으로 롤백을 수행하는 것을 특징으로 하는 프로그램 업데이트 장치.
The method of claim 6, wherein the control unit,
When performing a program rollback,
and performing rollback by performing an XOR operation on the new image of the partition A and the XOR operation result image of the partition B, and storing the XOR operation result in the partition A.
상기 메모리부의 파티션 A에는 OLD 이미지가 저장되어 있고,
파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 하는 프로그램 업데이트 장치.
The method of claim 7, wherein when the program rollback is completed by the control unit,
An OLD image is stored in partition A of the memory unit,
The program update device, characterized in that the partition B stores the image as a result of XORing the New image and the OLD image.
제어부가 상기 New 이미지와 메모리부의 파티션 A에 저장된 OLD 이미지를 배타적 오아(XOR) 연산하는 단계;
상기 제어부가 상기 XOR 연산에 따른 XOR 연산 결과 이미지를 상기 메모리부의 파티션 B에 저장하는 단계; 및
상기 제어부가 상기 파티션 B에 저장한 상기 XOR 연산 결과 이미지를 이용하여 상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 단계;를 포함하는 것을 특징으로 하는 프로그램 업데이트 방법.
receiving, by an update image receiving unit, a new image for program update;
an exclusive OR operation (XOR) operation of the new image and the OLD image stored in partition A of the memory unit;
storing, by the controller, an XOR operation result image according to the XOR operation in the partition B of the memory unit; and
and updating, by the controller, the OLD image stored in the partition A using the XOR operation result image stored in the partition B.
상기 New 이미지는, 바이너리 형태의 업데이트 프로그램을 의미하고,
상기 OLD 이미지는, 바이너리 형태의 기존 프로그램을 의미하는 것을 특징으로 하는 프로그램 업데이트 방법.
10. The method of claim 9,
The new image means an update program in binary form,
The OLD image is a program update method, characterized in that it means an existing program in a binary form.
상기 업데이트 이미지 수신부는,
상기 New 이미지를 스트리밍 형태로 실시간 다운로드 받는 것을 특징으로 하는 프로그램 업데이트 방법.
The method of claim 9, wherein in the step of receiving a New image for the program update,
The update image receiving unit,
A program update method, characterized in that the new image is downloaded in real time in a streaming form.
상기 파티션 A에 저장된 OLD 이미지를 업데이트 시키는 단계에서,
상기 제어부는,
파티션 B에 저장한 XOR 연산 결과 이미지와 파티션 A에 저장되어 있는 OLD 이미지를 XOR 연산하여, 이 XOR 연산 결과인 New 이미지를 상기 OLD 이미지가 저장되어 있던 파티션 A에 저장하는 방식으로 프로그램 업데이트를 수행하는 것을 특징으로 하는 프로그램 업데이트 방법.
10. The method of claim 9,
In the step of updating the OLD image stored in the partition A,
The control unit is
It performs program update by performing XOR operation on the XOR operation result image stored in partition B and the OLD image stored in partition A, and storing this XOR operation result, a new image, in partition A where the OLD image is stored. A program update method, characterized in that.
상기 제어부는,
파티션 A에 대하여 섹터 단위로 OLD 이미지를 지우기(erase)하고 New 이미지를 쓰기(write)하는 것을 특징으로 하는 프로그램 업데이트 방법.
The method of claim 12, wherein in order to store the New image, which is the result of the XOR operation, in the partition A where the OLD image is stored,
The control unit is
A program update method, characterized in that for partition A, erasing the OLD image in units of sectors and writing the new image.
상기 메모리부의 파티션 A에는 New 이미지가 저장되어 있고,
파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 하는 프로그램 업데이트 방법.
The method of claim 9, wherein when the program update is completed by the control unit,
A new image is stored in partition A of the memory unit,
A program update method, characterized in that the partition B stores an image as a result of XORing the New image and the OLD image.
상기 프로그램 업데이트 후 프로그램 롤백을 수행하고자 할 경우,
상기 제어부는,
상기 파티션 A의 New 이미지와 상기 파티션 B의 XOR 연산 결과 이미지를 XOR 연산하여, 이 XOR 연산 결과를 상기 파티션 A에 저장하는 방식으로 롤백을 수행하는 것을 특징으로 하는 프로그램 업데이트 방법.
15. The method of claim 14,
If you want to perform a program rollback after the above program update,
The control unit is
and performing rollback by performing an XOR operation on the new image of the partition A and the XOR operation result image of the partition B, and storing the XOR operation result in the partition A.
상기 메모리부의 파티션 A에는 OLD 이미지가 저장되어 있고,
파티션 B에는 상기 New 이미지와 상기 OLD 이미지를 XOR 연산한 결과 이미지가 저장되는 것을 특징으로 하는 프로그램 업데이트 방법.The method of claim 15, wherein when the program rollback is completed by the control unit,
An OLD image is stored in partition A of the memory unit,
A program update method, characterized in that the partition B stores an image as a result of XORing the New image and the OLD image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200174973A KR20220085143A (en) | 2020-12-15 | 2020-12-15 | Apparatus for updating program and method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200174973A KR20220085143A (en) | 2020-12-15 | 2020-12-15 | Apparatus for updating program and method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20220085143A true KR20220085143A (en) | 2022-06-22 |
Family
ID=82216514
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020200174973A KR20220085143A (en) | 2020-12-15 | 2020-12-15 | Apparatus for updating program and method thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20220085143A (en) |
-
2020
- 2020-12-15 KR KR1020200174973A patent/KR20220085143A/en unknown
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7664923B2 (en) | Method and system for updating software | |
US9026718B2 (en) | Method and apparatus for fault tolerant FOTA update with single backup block write | |
US9632715B2 (en) | Back-up and restoration of data between volatile and flash memory | |
US20130138871A1 (en) | Flash Memory Device and Data Access Method for Same | |
US20040083348A1 (en) | Method and apparatus for performing block caching in a non-volatile memory system | |
KR101822485B1 (en) | Recovering method after a power failure in software remote update for vehicles | |
WO2006067923A1 (en) | Memory controller, nonvolatile storage, nonvolatile storage system, and memory control method | |
US7797573B2 (en) | Memory management method and portable terminal device | |
JP5183662B2 (en) | Memory control device and memory control method | |
JP2008533574A (en) | Method and apparatus for rewriting semiconductor memory means erasable in sector units into first sector | |
CN101025711B (en) | Apparatus and method for controlling flash memory | |
US7055083B2 (en) | Method and apparatus for allocating CRC codes in a flash ROM | |
RU2375769C2 (en) | Automatic back up saving in modifications of embedded software | |
TW202006535A (en) | Firmware updating method | |
US7603587B2 (en) | Updating a memory block without status logging | |
JP2009048557A (en) | Data update device, data update method, and data update program | |
US20100077131A1 (en) | Updating control information in non-volatile memory to control selection of content | |
KR20220085143A (en) | Apparatus for updating program and method thereof | |
JP2001249855A (en) | Method for rewriting data of nonvolatile memory and subscriber circuit | |
JP2007052558A (en) | Flash memory rewrite device, flash memory rewrite method and flash memory rewrite program | |
WO2020039927A1 (en) | Non-volatile storage device, host device, and data storage system | |
KR20090021695A (en) | System for roll back of flash memory and method there of | |
JP2004013536A (en) | Flash memory rewrite control system and method, program for operating processe in flash memory rewrite control method, and information storage medium | |
JP2000243093A (en) | Data storing method for flash memory and data reading out method from flash memory | |
CN110908825A (en) | Data reading method and device, storage equipment and storage medium |