Method for generating an update file and corresponding server device, method for updating and corresponding client device, method for updating and corresponding system.

The method of generating software update files by constraining memory locations and using an exclusive-or operator for IoT devices addresses inefficiencies in data transmission and resource usage, achieving efficient and energy-saving updates.

FR3139216B1Active Publication Date: 2024-10-18STMICROELECTRONICS (ROUSSET) SAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022008639
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2024-10-18
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

Existing software update techniques for IoT devices with limited bandwidth and energy constraints result in inefficient data transmission and resource usage, particularly due to conventional compression methods requiring significant computational resources and memory space.

Method used

A method for generating an update file that includes only the binary differences between software versions by constraining memory locations during compilation and using an exclusive-or operator for comparison, allowing direct in-memory updates without requiring additional memory space or complex decompression.

Benefits of technology

This approach minimizes data transmission and memory resource usage, enabling efficient software updates with reduced energy consumption and bandwidth requirements, particularly suitable for IoT devices with limited network resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000023_0000
    Figure 00000023_0000
  • Figure 00000023_0001
    Figure 00000023_0001
  • Figure 00000023_0002
    Figure 00000023_0002
Patent Text Reader

Abstract

The process of generating an update file from an earlier version (FW_vN) to a later version of software (FW_vN+1) includes: - a compilation (CMPLR) of source code (vN+1_code) generating a binary file of the later version (vN+1_bin); - a linking (LNKR) allocating memory locations to sections of the binary file of the later version (vN+1_bin), the memory locations of said sections of the later version (vN+1_bin) being constrained to be identical (vN_ScttrF) to the memory locations of the corresponding sections of the earlier version (FW_vN); - a comparison between the binary file (vN+1_bin) of the later version (FW_vN+1) and a binary file (vN_bin) of the earlier version (FW_vN); and - a construction of the update file (ΔFW, ΔFW_cpr) containing the differences (DAT_diff), by memory regions (Offst_1-Lgth_1, …, Offst_k-Lgth_k), between said compared binary files (vN+1_bin, vN_bin).Figure for the abridged version: Fig 6.
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Method for generating an update file and corresponding server device, update method and corresponding client device, update method and corresponding system.

[0001] Embodiments and implementations relate to techniques for updating software, including generating an update file by a server device, and updating the software by a client device.

[0002] Software update techniques may be critical features in terms of power consumption bandwidth to transmit the update file to client devices, especially for cases with limited bandwidth, and aiming at power saving.

[0003] This is for example the case in over-the-air (OTA) update campaigns for client devices of the Internet of Things (IoT) type deployed in the field, where typically the network bandwidth is limited and expensive and where typically the IoT client devices tend to be very energy-efficient.

[0004] For example, networks having a limited bandwidth and aiming at energy saving, can be of the “LPWAN” type (acronym for the English terms “Low Power Wide Area Network”) such as “LoRaWAN”, “BLE”, “Cat-Ml”, “NB-IoT” (respectively for “Long Range WAN”, “Bluetooth Low Energy”, “Machine Type Communication, Category 1” and “Narrow Band-IoT”), or of the “Wi-Fi” type (the communication protocol governed by the standards of the IEEE 802.11 group).

[0005] Reducing the amount of data transmitted has a considerable effect on energy savings when receiving the update file by the loT client device and also on the cost of the associated bandwidth.

[0006] That being said, in absolute terms it is always advantageous to limit the quantity of data transmitted and the energy consumption, even in communication systems which are not particularly limited in this regard (for example in communications of the “LTE”, “4G”, “5G” type respectively for “Long Term Evolution”, “4th Generation”, “5th Generation” in English), for reasons of efficiency and / or sobriety in the use of available resources.

[0007] [Fig. 1] illustrates an example of a classic technique for limiting the amount of data in an FWupdt update file of an old version of software. FW_vN to a new version FWvN+1. Different modules App, UTIL, HAL, SBSFU and different functions MWfuncl, MWfunc2_vN, MWfuncN of the software occupy memory regions, represented by the respective rectangles, of a memory.

[0008] The FWupdt update file communicates the memory regions that have been modified "XX..X" from the old version to the new version of the software, and not those that are unchanged "0". That being said, if a memory region is added or removed in the volume of memory, or if the modification of a function MWfunc2_vN+l modifies the size of the corresponding memory region (larger or smaller), then all the following memory regions are shifted MWfunc2_vN+l, ..., MWfuncN, UTIL, HAL, SBSFU, even if their content is not modified in the new version. Indeed, the classic memory mapping mechanisms assign memory locations to successive positions in the memory, to successive functions of the code. Consequently, the memory regions positioned successively after the location of a modification are typically all shifted, and are communicated as modified memory regions "XX..X" in the FWupdt update file.

[0009] On the other hand, conventional compression techniques, for example typically “ZIP” or “RAR” compression, have performance limits and require providing client devices with a corresponding decompression means. However, this type of decompression means can represent a relatively large part, for example 10% to 15%, of the code recorded in the memory, particularly in the simplest and least expensive IoT devices.

[0010] There is therefore a need to improve techniques for reducing the amount of data transmitted in a software update file, and a need to reduce memory resources.

[0011] Implementations and embodiments proposed below make it possible to send an extremely small update file, comprising almost only the binary differences between the versions of the software, in a manner compatible with current and usual software architectures. In addition, the "decompression" of the update file is simple and requires few resources, and the recording of the update can be done "in place" directly in the memory, without requiring a "buffer" memory space the size of the entire software.

[0012] According to one aspect, there is provided in this regard a method of generating an update file from a previous version of software to a later version of the software, comprising: - a compilation of source code generating a binary file of the later version; - a link edition assigning memory locations of a memory to sections of the binary file of the later version, the memory locations of said sections of the later version being constrained to be identical to the memory locations of the corresponding sections of the earlier version; - a comparison between the binary file of the later version and a binary file of the earlier version; and - a construction of the update file including the differences, by memory regions, between said compared binary files.

[0013] Said “link editing” may be referred to as “mapping”.

[0014] Thus, since the mapping of the binary data of the later version is constrained by the mapping of the earlier version, then, in particular, a modification of a section does not cause a shift in the sections located after this modified section and which have not been modified, the respective positions of the sections being constrained, that is to say imposed, during the mapping. Consequently, only the memory regions of the binary file which correspond to portions of the source code which are actually modified are actually modified after the mapping. Thus, only these memory regions of the binary file are communicated in the update file.

[0015] Furthermore, it is understood that a section corresponds to the size in memory allowing the code of an elementary object (for example a function or a scalar) from the source code to be housed. Typically in this case, a section can have a size between 8 bits and n*8 bits (an integer multiple “n” of an 8-bit byte) when an 8-bit byte is the elementary size of the processor. The memory regions correspond to the granularity in which the differences are communicated. In absolute terms, the memory regions can have a size between 1 bit and an entire memory page (i.e. the maximum size accessible in the memory). In practice, the memory regions can have a size of 16 bytes, or more.

[0016] According to one embodiment, the update file does not include memory regions not showing differences between said compared binary files, and in which the update file includes an identification of the memory locations, in the binary file of the previous version, of the memory regions showing said differences between said compared binary files.

[0017] This corresponds to a compression technique in which the update file does not contain information concerning memory regions that do not differ from the previous version.

[0018] According to one mode of implementation: - said comparison between said binary files is made bit-by-bit by an exclusive-or operator; and - the said construction of the update file includes the results of the com bit-by-bit comparison by the exclusive-or operator, to communicate said differences between said compared binary files.

[0019] The exclusive-or operator advantageously allows the differences to be introduced directly into the memory receiving the update, without needing to store an entire image of the binary file of the later version, because the exclusive-or operator is its own inverse.

[0020] According to one embodiment, if the binary file of the later version has a section of larger size in memory than the memory location allocated to this section in the earlier version, then the link edition allocates a new memory location, free in the earlier version, to said larger section, and introduces a call instruction to the new memory location, in the memory location allocated to this section in the earlier version.

[0021] Thus, no section between the memory location assigned to the modified section in the earlier version and the new memory location is shifted or modified, despite the larger size of the modified section.

[0022] According to one embodiment, if the binary file of the later version has a section of smaller size in memory than the memory location allocated to this section in the earlier version, then the link edition allocates the same memory location having this same size and leaves empty the excess size of the memory location.

[0023] Thus, no section located after the memory location assigned to the modified section in the earlier version is shifted or modified, despite the smaller size of the modified section.

[0024] Particularly in this embodiment, the modified section could be completely erased, and thus have a zero size in memory. In this case, the mapping allocates the same memory location having the same size as in the earlier version, leaving this memory location empty in the later version.

[0025] According to another aspect, there is provided a method of updating a previous version of software contained in a memory to a later version of the software, comprising: - reception of an update file containing the differences, by memory regions, between a binary file of the later version and a binary file of the earlier version; - a replacement, in the part of the memory containing the binary file of the previous version, of the bits of the memory regions presenting differences by the bits of the memory regions of the binary file of the later version.

[0026] In other words, it is proposed to replace the bits of the binary file directly in the memory, to update only the differences of the point of view of the binary data contained in the memory, and not from the point of view "functional" code objects (functions and scalar data) that were changed in the later version.

[0027] According to one mode of implementation: - said update file does not include memory regions not showing differences between said compared binary files, and includes an identification of the memory locations, in the binary file of the previous version, of the memory regions showing said differences between said compared binary files; - said replacement comprises reading said identification and selective access to said identified memory locations.

[0028] This “decompression” mechanism, roughly corresponding to access to a memory address, has the advantage of being extremely simple to implement, and of not requiring computational resources as is usually the case in algorithmic decompression mechanisms (for example of the “zip” or “rar” type).

[0029] According to one mode of implementation: - said update file includes the result of a bit-by-bit comparison by an exclusive-or operator between the binary file of the later version and the binary file of the earlier version, to communicate said differences between said compared binary files; - said replacement comprises a transformation of the bits contained in said memory regions of the binary file of the previous version by the exclusive-or operator with the bits of said result of the bit-by-bit comparison by the exclusive-or operator between said binary files.

[0030] According to an embodiment of the method for updating a previous version of software to a later version of the software, the previous version having been updated from a previous version with the previous update file, and the later version corresponding to a return to said previous version: - the update file is the previous update file; - said replacement comprises a transformation of the bits contained in said memory regions of the binary file of the previous version by the exclusive-or operator with the bits of said regions of the result of the comparison of the previous update file.

[0031] According to another aspect, there is also provided a method of updating from a previous version of software to a later version of the software, for at least one device, comprising: - a method of generating an update file from the previous version of software to the later version of the software as defined above, by a device server ; - communication to at least one device of the update file, via a communication network; - a method of updating from a previous version of software to the later version of the software as defined above, by said at least one client device.

[0032] For example, the communication can be adapted for a communication network of the “LPWAN” type (for “Low Power Wide Area Network” in English) such as “LoRaWAN”, “BLE”, “Cat-Ml”, “NB-IoT” (respectively for “Long Range WAN”, “Bluetooth Low Energy”, “Machine Type Communication, Category 1” and “Narrow Band-IoT” in English), but also of the “Wi-Fi” type (defined by the IEEE 802.11 standard), of the “LTE 4G / 5G” type (for “Long Term Evolution, 4th / 5th generation”) or of the wired connection type such as Ethemet or USB.

[0033] According to another aspect, there is also provided a server device, capable of generating an update file from a previous version of software to a later version of the software, comprising: - a compiler configured to compile source code so as to generate a binary file of the later version; - a linker configured to assign memory locations of a memory to sections of the binary file of the later version, such that the memory locations of said sections of the later version are constrained to be identical to the memory locations of the corresponding sections of the earlier version; - a compressor configured for: — compare the binary file of the later version with a binary file of the earlier version; and for — construct the update file containing the differences, by memory regions, between said compared binary files.

[0034] According to one embodiment, the compressor is configured to construct the update file not comprising the memory regions not exhibiting differences between said compared binary files, and to construct the update file comprising an identification of the memory locations, in the binary file of the previous version, of the memory regions exhibiting said differences between said compared binary files.

[0035] According to one embodiment, the compressor is configured to: - compare said binary files bit-by-bit by an exclusive-or operator; and - construct the update file containing the results of the bit-by-bit comparison by the exclusive-or operator, to communicate said differences between said compared binary files.

[0036] According to one embodiment, the link editor is configured, if the binary file of the later version comprises a section of larger size in memory than the memory location allocated to this section in the earlier version, to allocate a new memory location, free in the earlier version, to said larger section, and to introduce a call instruction to the new memory location, in the memory location allocated to this section in the earlier version.

[0037] According to one embodiment, the linker is configured, if the binary file of the later version has a section of smaller size in memory than the memory location allocated to this section in the earlier version, to allocate the same memory location having this same size and leave empty the excess size of the memory location.

[0038] According to another aspect, there is also provided a client device capable of updating a previous version of software contained in a memory to a later version of the software, comprising: - reception means configured to receive an update file comprising the differences, by memory regions, between a binary file of the later version and a binary file of the earlier version; - processing means configured to replace, in the part of the memory containing the binary file of the previous version, bits of the memory regions presenting differences by the bits of the memory regions of the binary file of the later version.

[0039] According to one embodiment: - the reception means are configured to receive the update file not comprising the memory regions not showing differences between said compared binary files, and comprising an identification of the memory locations, in the binary file of the previous version, of the memory regions showing said differences between said compared binary files; - the processing means are configured to read said identification and selectively access said identified memory locations.

[0040] According to one embodiment: - the reception means are configured to receive an update file comprising the result of a bit-by-bit comparison by an exclusive-or operator between the binary file of the later version and the binary file of the earlier version, to communicate said differences between said compared binary files; - the processing means are configured to transform the bits contained in said memory regions of the binary file of the previous version by the exclusive-or operator with the bits of said result of the bit-by-bit comparison by the or- operator exclusive between said binary files.

[0041] According to one embodiment, in the client device capable of updating a previous version of software to a later version of the software, the previous version having been updated from a previous version with the previous update file, and the later version corresponding to a return to said previous version: - the reception means are configured to retrieve the previous update file as an update file; - the processing means are configured to transform the bits contained in said memory regions of the binary file of the previous version by the exclusive-or operator with the bits of said result of the previous update file.

[0042] According to another aspect, there is also provided a system comprising a server device as defined above and at least one client device as defined above, the server device being able to communicate said update file from the previous version of a software to the later version of the software, to said at least one client device by a communication network, and the client device being able to update the previous version of a software to the later version of the software with this update file.

[0043] Other advantages and characteristics of the invention will appear on examining the detailed description of modes of implementation and embodiment, which are in no way limiting, and the appended drawings in which:

[0044] [Fig.l] previously described, illustrates a case of the prior art;

[0045] [Fig.2] ;

[0046] [Fig.3] ;

[0047] [Fig.4] ;

[0048] [Fig.5] ;

[0049] [Fig.6] ;

[0050] [Fig.7] ;

[0051] [Fig.8] ;

[0052] [Fig.9] ;

[0053] [Fig. 10] illustrate embodiments and methods of implementing the invention.

[0054] [Fig.2] illustrates a method for generating an update file from a previous version of software to a later version of the software. The software is for example a firmware (usually "firmware" in English) of a client device of the loT type, while the generation of the update file can be implemented by a server device, capable of carrying out software update campaigns of the client devices remotely.

[0055] The method of generating the update file comprises: - a step 310, described in detail below in relation to [Fig.3], in which a source code is compiled, generating a binary file of the later version; - a step 320, described in detail below in relation to [Fig.3], in which a link edition, or "mapping", is carried out for a memory of the client devices, so as to assign memory locations to sections of the binary file of the later version, the memory locations of said sections of the later version being constrained to be identical to the memory locations of the corresponding sections of the earlier version; - a step 410, described in detail below in relation to [Fig.4], in which the binary file of the later version and a binary file of the earlier version are compared; and - a step 420, described in detail below in relation to [Fig.4], in which the update file is constructed, so that the update file includes the differences, by memory regions, between said compared binary files.

[0056] It will be noted that the method of generating the update file makes it possible to minimize the quantity of data transmitted with a “computer” approach, that is to say during the compilation and mapping of the code; unlike the classic techniques of patches superimposed on the old version (“patching” in English) or inserted in free locations provided for this purpose in the old version (“padding” in English), which are done with a “programming” approach when writing the code.

[0057] [Fig. 3] illustrates the compilation step 310 and the link editing step 320, or “mapping” step 320, of the method described in relation to [Fig. 2], for example implemented within a server device. The server device may comprise in this regard a BLD_bin means capable of constructing the binary file according to steps 310 and 320. The BLD_bin means may be a hardware means of the processing unit or processor type, or a software means implemented by a pluripotent hardware device, such as a processing unit or a processor.

[0058] On the one hand, a CMPLR compiler is configured to compile a source code vN+l_code so as to generate a binary file vN+l_bin of the later version of the software FW_vN+l, according to step 310.

[0059] The vN+l_code source code is written in a "human-readable" programming language (.s / .c / .h), such as C, C++, Python, or others. The programmer who develops the vN+l_code source code of the later version has no particular constraint to respect in order to obtain a generation of an update file of a minimal amount of data.

[0060] The binary file vN+l_bin, also called an executable file, is a file whose references have all been resolved and which can be placed in memory to be executed. The binary file vN+l_bin is written in a “machine language”, and contains elementary instructions or functions, coded in binary in memory sections. A section of the binary file corresponds to an elementary logical entity containing a sequence of bytes corresponding to a piece of data or code that must be placed in a physical location of the memory. Typically, a section can have a size defined in bytes, or even at least 4 bytes, and for example a section can correspond to a 32-bit word (4 bytes) to encode a jump or call instruction to a memory address, as well as the 32 bits to identify said address.

[0061] On the other hand, a link editor LNKR is configured to perform the mapping of the binary file vN+l_bin, that is to say to assign memory locations, in the memory intended to contain the software, to each section of the binary file vN+l_bin generated by the compiler CMPLR, according to step 320.

[0062] The LNKR linker is in particular configured to perform a static mapping constrained by a vN_ScttrF configuration file. The configuration file constraining the LNKR linker corresponds to the vN_ScttrF mapping file (usually "scatter file" in English) of the sections of the previous version of the FW_vN software.

[0063] Thus, the LNKR linker is configured so that the memory locations of the sections of the later version FW_vN+1 are forced to be identical to the memory locations of the corresponding sections of the earlier version FW_vN.

[0064] In fact, during the mapping step 320, all sections of the binary file of the later version vN+l_bin already existing in the binary file of the earlier version vN_bin are placed in the same memory location. The new sections of the binary file of the later version vN+l_bin can be placed in new memory locations (see below "#200" in relation to [Fig.6]).

[0065] Furthermore, the mapping file vN+l_ScttrF of the sections of the file of the later version vN+l_bin is extracted by a means adapted to this regard MAP EXTRCT, in order in particular to constrain the mapping of a possible future update from this “later” version vN+1.

[0066] [Fig.4] illustrates the comparison step 410 and the construction step 420 of the method described in relation to [Fig.2], for example implemented within the server device. The server device may comprise in this respect a means, called compressor, CPRSSR capable of constructing the update file according to steps 410 and 420. The CPRSSR compressor may be a hardware means of the processing unit or processor type, or a software means implemented by a pluripotent hardware device, such as a processing unit or a processor.

[0067] On the one hand, the CPRSSR compressor is configured to compare, according to step 410, the binary file of the later version vN+l_bin, compiled and mapped in steps 310 and 320, with the binary file vN_bin of the earlier version obtained earlier in the same way.

[0068] Advantageously, the comparison means for performing step 410 is configured to perform said bit-by-bit comparison by an exclusive-or operator xor, between said binary files N+l_bin, vN_bin.

[0069] The result (which will be called "uncompressed result file") AFW coming out of the bit-by-bit comparison by the exclusive-or operator xor is a binary file having the size of the largest binary file among the earlier version vN and the later version vN+1. Each bit, in the AFW result file, corresponds to a position of respective bits in the compared binary files vN+1_bin, vN_bin, and the value of each bit in the AFW result file is "0" when at this position in the compared binary files vN+1, vN, the bits are identical; and is "1" when at this position in the compared binary files vN+1, vN, the bits are different.

[0070] This in fact makes it possible to communicate the differences between said compared binary files, which is sufficient to update the entire binary file to the later version vN+l_bin, knowing the earlier version vN_bin.

[0071] Alternatively, it will be noted that an equivalent mechanism for identifying differences, such as by the not-exclusive-or operator providing the same result in which the “0” and “1” are reversed, could also be chosen.

[0072] On the other hand, the compressor CPRSSR is configured to construct, according to step 420, the update file AFW, AFW_cpr comprising the differences DAT_diff, by memory regions, between said compared binary files vN+l_bin, vN_bin.

[0073] Thus, if the comparison 410 is made bit-by-bit by an exclusive-or xor operator, then the construction of the AFW update file, AFW_cpr advantageously includes the “before compression” AFW result file obtained during the bit-by-bit comparison by the exclusive-or xor operator, or “uncompressed AFW update file”.

[0074] However, in the uncompressed AFW update file, the zeros "0", representing identities between the versions, do not need to be sent. It is thus proposed to compress the AFW_cpr update file by removing the zeros "0", and by introducing a DSCR header to describe the mapping of the differences DAT_diff in the binary files vN_bin, vN+l_bin. The CPRRS compressor may include a concatenation means CONCAT provided to generate the DSCR header and group the data groups comprising DAT differences.

[0075] In this regard, reference is made to [Fig.5].

[0076] [Fig.5] illustrates the structure of the compressed update file AFW_cpr generated by the concatenation means CONCAT described previously in relation to [Fig.4],

[0077] In this example, the differences DAT_diff are communicated by memory regions, DIFF_1, DIFF_2, ..., DIFF_k. Each memory region DIFF_i, i=[l, 2, ..., k], corresponds to a portion of the AFW comparison result file, which can for example be identified by a respective starting address Offst_i and a respective length Lght_i. The memory regions are chosen to define the granularity in which the differences DIFF_1, DIFF_2, ..., DIFF_k are communicated. Indeed, if a single bit changes in a given memory region, then this entire memory region of the AFW comparison result file is communicated (i.e. in this case a single “1” and the rest “0”).

[0078] In absolute terms, the memory regions can have a size between 1 bit and an entire memory page (i.e. the maximum size accessible in the memory). In practice, the memory regions can have a size defined in bytes, and for example a size of at least 16 bytes.

[0079] This makes it possible on the one hand to correspond to a reasonably minimal quantity of modifications in the binary file vN+l_bin occurring in practice in the event of modification of a reasonably minimal portion of code; on the other hand, the threshold on the size of the memory regions, for example of at least 16 bytes, makes it possible to compensate for the quantity of information to be added in the DSCR header to identify said memory regions DIFF_1, ..., DIFF_k.

[0080] Thus, the DSCR header includes at least the identification of the memory locations, in the binary file of the previous version vN_bin, of the memory regions presenting said differences DIFF_1, ..., DIFF_k.

[0081] Advantageously, the DSCR header may include: the number “k” of memory regions containing differences NBR(k); the designation “vN->vN+l” of the earlier version vN and of the later version vN+1 to which the update applies; a signature Sign_vN, possibly truncated, of the earlier version of the software; a signature Sign_vN+l, possibly truncated, of the later version of the software; pairs containing the starting addresses Offst_l, Offst_2, ..., Offst_k and the length Lgnth_l, Lgnth_2, ..., Lgnth_k, for respectively each memory region DIFF_1, DIFF_2, ..., DIFF_k. In addition, fields may be left free in the structure of the compressed update file AFW_cpr, for example reserved for other future functionalities.

[0082] [Fig.6] illustrates, from a global point of view, the method of generating the AFW_cpr update file and its advantages, as well as particular and advantageous modes of implementation.

[0083] The earlier version of the FW_vN software and the later version of the FW_vN+l software are schematically represented (in [Fig.6] and [Fig.7]) according to the respective memory mappings of their binary files, obtained after compilation of the source code of the respective versions.

[0084] Each rectangle App, MWfuncl-MWfuncN, UTIL, HAL, SBSFU, represents one or more memory location(s) containing a module of the software App, UTIL, HAL, SBSFU, or a function of the software MWfuncl-MWfuncN.

[0085] The modules and functions are each encoded by elementary objects of the binary code, each object being contained in a section of the memory, at a respective memory location.

[0086] Since the mapping of the memory locations of the sections of the later version FW_vN+1 have all been constrained, during the compilation steps 310 and mapping 320, to locations identical to the locations of the corresponding sections of the earlier version FW_vN; then the differences DIFF_1, DIFF_2 in the binary file of the later version FW_vN+1 only correspond to effective modifications of the source code of the later version FW_vN+1.

[0087] The result of the xor comparison of the later version FW_vN+l with respect to the earlier version FW_vN thus exposes differences DIFF_1, DIFF_2, only at the locations of the binary file FW_vN+l corresponding to actual modifications of the source code of the later version.

[0088] Indeed, the constraint of mapping the binary file of the later version FW_vN+l on the mapping of the binary file of the earlier version FW_vN makes it possible in particular not to generate an offset of all the memory regions MWfuncN, UTIL, HAL, SBSFU, positioned after a modified function MWfunc2_vN+l and whose size of the corresponding memory location has been modified.

[0089] Consequently, in the compiled binary files, the amount of data that has changed between the earlier version FW_vN and the later version FW_vN+1 is minimized, and the compression isolating the memory regions containing differences DIFF_1, DIFF_2 exclusively makes it possible to generate an extremely compact update file.

[0090] The AFW_cpr update file is compressed so as not to include memory regions not showing differences 0, ..., 0 (App, MWfuncl, MWfuncN, UTIL, HAL, SBSFU) between said compared binary files vN+l_bin, vN_bin. A DSCR identification of the memory locations of the memory regions showing said differences DIFF_1, DIFF_2 is communicated in the compressed AFW_cpr update file.

[0091] Furthermore, in order to allow all possible modifications in the source code, while preserving the benefit of the memory section constraint during mapping, it is advantageously proposed that if the binary file vN+l_bin of the later version FW_vN+l includes a modified section MWfunc2_vN+l of larger size sz_200 than the size sz_100 of the first memory location #100 assigned to this MWfunc2_vN section in the earlier version FW_vN, then the LNKR linker assigns a new memory location #200, free in the earlier version FW_vN, to said modified section MWfunc2_vN+l, larger. At the same time, the LNKR mapping automatically introduces a call or jump instruction Call_#200 to the new memory location #200, located in the first memory location #100.

[0092] Thus, the function MWfunc2_vN+l can be modified without any constraint on the size sz_200 of the corresponding section(s) of the later version FW_vN+l. Furthermore, the section size of the call or jump instruction Call_#200 is typically compatible (i.e., less than or equal to) the size sz_100 of any section, constraining the first memory location #100.

[0093] For the same purpose, if the binary file vN+l_bin of the later version FW_vN+l includes a modified section MWfunc2_vN+l of smaller size (not shown) than the size sz_100 of the memory location #100 assigned to this section MWfunc2_vN in the earlier version FW_vN, then the LNKR mapping assigns the same memory location #100 having this same size sz_100, leaving empty, or vacant, the excess size of this memory location.

[0094] By "leave empty" or "leave vacant" is meant that this part of the memory is not used to contain useful information, this part of the memory being able for example to be filled with an arbitrary value, for example zeros "0".

[0095] [Fig.7] illustrates the corresponding method of updating the previous version of the software FW_vN, contained in the memory of a client device, to a later version of the software FW_vN+1, with the compressed update file AFW_cpr generated in the manner previously described in relation to Figures 2 to 6.

[0096] The client device comprises said memory, typically a non-volatile memory such as a “Flash” or “EEPROM” (for “Electrically Erasable Programmable Read Only Memory”) memory, in which the binary file of the previous version of the software FW_vN is recorded; reception means (not shown), configured to receive the AFW update file, advantageously compressed AFW_cpr, as described above; and processing means configured to replace, in the part of the memory containing the binary file of the previous version FW_vN, the bits of the memory regions having differences by the bits of the corresponding memory regions of the binary file of the later version FW_vN+1.

[0097] Thus, writing the later version of the software FW_vN+l, from the AFW update file, AFW_cpr, can be done directly in the memory instead of instead of the previous version FW_vN. In other words, it is not necessary to provide a memory space at least as large as the size of the entire software to store the update file containing the entire software, before accessing it at runtime.

[0098] The processing means are capable of decompressing the compressed update file AFW_cpr, i.e. for example configured to read said DSCR identification and selectively access said identified memory locations.

[0099] The processing means may also be configured in this regard to "reconstruct" the AFW comparison results file, by filling with zeros "0" (i.e. the neutral term of the bit replacement operator in memory, the exclusive-or operator in the example below) the memory regions which are not identified in the DSCR header.

[0100] In the case where said construction of the AFW update file, AFW_cpr is done with the results of the bit-by-bit comparison by the xor exclusive-or operator, then the software update can advantageously take advantage of the property of the xor operator according to which "A xor B = C <=> B = C xor A", i.e. the property according to which the xor operator is its own inverse.

[0101] Indeed, given that the AFW update file was generated by: FW_vN xor FW_vN+l = AFW, then the later version FW_vN+l is obtained, from the earlier version FW_vN and the AFW update file, by: FW_vN+l = FW_vN xor AFW.

[0102] More particularly, in the example described above in relation to [Fig.6]: DIFF_1 xor MWfunc2_vN = Call_#200 (for the first memory location #100); and DIFF_2 xor 0...0 = MWfunc2_vN+l (for the new memory location #200).

[0103] [Fig.8] illustrates another advantage of the property of the xor exclusive-or operator that it is its own inverse (i.e., "A xor B xor B = A"), in a case where the later version corresponds to a return to a previous version FW_vN, in place before the last FW_vN+l update was performed.

[0104] Thus, in this case of the method for updating from a previous version of software to a later version of the software, the previous version “FW_vN+1” has been updated from a previous version “FW_vN” with the previous update file AFW_cpr (vN->vN+1), for example as described previously in relation to [Fig.7], and the later version corresponding to a return to said previous version “FW_vN”.

[0105] The previous update file AFW_cpr (vN->vN+l), allows, thanks to the properties of the exclusive-or operator xor, to return directly to the said previous version FW_vN, by applying the replacement mechanism described above without distinction.

[0106] In detail, FW_vN+l xor AFW = FW_vN ; and DIFF_1 xor Call_#200= MWfunc2_vN ; and DIFF_2 xor MWfunc2_vN+l = 0.. .0.

[0107] [Fig.9] illustrates another advantage of the exclusive-or operator property, allowing, from an update file from a FW_vl version to a FW_v2 version, and from an update file from a FW_v2 version to a FW_v3 version, to immediately create the update file for the FW_vl version to the FW_v3 version.

[0108] Indeed, by construction: AFW(vl->v3) = AFW(vl->v2) xor AFW(v2->v3).

[0109] This allows in practice to design, by the server device, update files update to catch up on failures for certain client devices in a past update campaign, in a way that benefits from both great simplicity and being adapted to specific cases.

[0110] [Fig. 10] schematically illustrates a system comprising a server device SRV and at least one client device DEV, capable of communicating together via an NTW communication network.

[0111] The server device SRV is able to generate the update file AFW_cpr from the previous version of a software FW_vN to the later version of the software FW_vN+1, according to the method described previously in relation to figures 2 to 6, and is able to communicate said update file AFW_cpr to the client devices via the communication network NTW.

[0112] The DEV client devices are able to update the previous version of a FW_vN software contained in their memories, to the later version of the FW_vN+1 software with the AFW_cpr update file thus communicated.

[0113] For example, the NTW communication network can advantageously be a network relatively limited in bandwidth and data rate, for example networks of the “LPWAN” type (for “Low Power Wide Area Network” in English) such as “LoRaWAN”, “BLE”, “Cat-Ml”, “NB-IoT” (respectively for “Long Range WAN”, “Bluetooth Low Energy”, “Machine Type Communication, Category 1” and “Narrow Band-IoT” in English).

[0114] That being said, the NTW communication network may also not be particularly limited in terms of bandwidth and data rate, for example networks of the “Wi-Fi” type (defined by the IEEE 802.11 standard), of the “LTE 4G / 5G” type (for “Long Terni Evolution, 4th / 5th generation”) or of the wired connection type such as Ethemet or USB.

Claims

Claims

1. Method for generating an update file from a previous version of software (FW_vN) to a later version of the software (FW_vN+l), comprising: - a compilation (CMPLR) of a source code (vN+l_code) generating a binary file (vN+l_bin) of the later version (FW_vN+l); - a link edition (LNKR) assigning memory locations of a memory to sections of the binary file (vN+l_bin) of the later version (FW_vN+l), the memory locations of said sections of the later version (FW_vN+l) being constrained to the identical (vN_ScttrF) of the memory locations of the corresponding sections of the previous version (FW_vN); - a comparison, made bit-by-bit by an exclusive-or operator (xor), between the binary file (vN+l_bin) of the later version (FW_vN+l) and a binary file (vN_bin) of the earlier version (FW_vN);and - a construction of the update file (AFW, AFW_cpr) comprising the results of the bit-by-bit comparison by the exclusive-or operator (xor), to communicate the differences (DAT_diff), by memory regions (Offst_l-Lgth_l, ..., Offst_k-Lgth_k), between said compared binary files (vN+l_bin, vN_bin).;

2. Method according to claim 1, in which the update file (AFW_cpr) is free of memory regions free of differences (0, ..., 0) between said compared binary files (vN+l_bin, vN_bin), and in which the update file (AFW_cpr) comprises an identification (DSCR) of the memory locations, in the binary file (vN_bin, vN+l_bin) of the previous version (FW_vN), of the memory regions having said differences (DIFF_1, ..., DIFF_k) between said compared binary files (vN+l_bin, vN_bin).

3. Method according to one of claims 1 or 2, in which, if the binary file (vN+l_bin) of the later version (FW_vN+l) comprises a section (MWfunc2_vN+l) of larger size in memory (sz_200) than the memory location (#100; sz_100) allocated to this section (MWfunc2_vN) in the earlier version (FW_vN), then the link edition (LNKR) allocates a new memory location (#200; sz_200), free in the earlier version (FW_vN), to said larger section (MWfunc2_vN+l), and introduces a call instruction (Call_#200) to the new memory location (#200), in the memory location (#100; sz_100) assigned to this section (MWfunc2_vN) in the previous version.

4. Method according to one of claims 1 to 3, in which, if the binary file (vN+l_bin) of the later version (FW_vN+l) comprises a section (MWfunc2_vN+l) of smaller size in memory than the memory location (#100; sz_100) allocated to this section (MWfunc2_vN) in the earlier version, then the link edition (LNKR) allocates the same memory location having this same size (#100; sz_100) and leaves empty the excess size of the memory location (#100; sz_100).

5. Method for updating a previous version of software (FW_vN) contained in a memory to a later version of the software (FW_vN+l), comprising: - receiving an update file (AFW, AFW_cpr) comprising the result of a bit-by-bit comparison by an exclusive-or operator (xor) between the binary file of the later version (vN+l_bin) and the binary file of the previous version (vN_bin), to communicate the differences (DAT_diff), by memory regions (Offst_l-Lgth_l, ..., Offst_k-Lgth_k), between a binary file (vN+l_bin) of the later version (FW_vN+l) and a binary file (vN_bin) of the earlier version (FW_vN); - a replacement, in the part of the memory containing the binary file (vN_bin) of the earlier version (FW_vN), of the bits of the memory regions having differences by the bits of the memory regions of the binary file (vN+l_bin) of the later version (FW_vN+l), the replacement comprising a transformation of the bits contained in said memory regions of the binary file of the earlier version (vN_bin) by the exclusive-or operator (xor) with the bits of said result of the bit-by-bit comparison by the exclusive-or operator (xor) between said binary files (vN+l_bin, vN_bin).

6. Method according to claim 5, in which: - said update file (AFW_cpr) is free from memory regions free from differences (0, ..., 0) between said compared binary files (vN+l_bin, vN_bin), and comprises an identification (DSCR) of the memory locations, in the binary file (vN_bin, vN+l_bin) of the previous version (FW_vN), of the memory regions presenting said differences (DIFF_1, ..., DIFF_k) between said compared binary files (vN+l_bin, vN_bin);

7.

8.

9. - said replacement comprises a reading of said identification (DSCR) and a selective access to said identified memory locations. Method, according to one of claims 5 or 6, for updating a previous version of software (FW_vN+l) to a later version of the software (FW_vN), the previous version (FW_vN+l) having been updated from a previous version (FW_vN) with the previous update file (AFW, AFW_cpr), and the later version (FW_vN) corresponding to a return to said previous version (FW_vN), in which: - the update file (AFW, AFW_cpr) is the previous update file; - said replacement comprises a transformation of the bits contained in said memory regions of the binary file of the previous version by the exclusive-or operator (xor) with the bits of said regions of the result of the comparison of the previous update file. Method for updating from a previous version of software (FW_vN) to a later version of the software (FW_vN+l), for at least one device, comprising: - a method for generating an update file (AFW, AFW_cpr) from the previous version of software (FW_vN) to the later version of the software (FW_vN+l) according to one of claims 1 to 4, by a server device (SRV); - communication to at least one device of the update file (AFW, AFW_cpr), via a communication network (NTW); - a method for updating from a previous version of software (FW_vN) to the later version of the software (FW_vN+1) according to one of claims 5 to 7, by said at least one client device (DEV). Server device, capable of generating an update file from a previous version of software (FW_vN) to a later version of the software (FW_vN+l), comprising: - a compiler (CMPLR) configured to compile a source code (vN+l_code) so as to generate a binary file (vN+l_bin) of the later version (FW_vN+l); - a link editor (LNKR) configured to assign memory locations of a memory to sections of the binary file (vN+l_bin) of the later version (FW_vN+l), so that the memory locations of said sections of the later version (FW_vN+l) are constrained to be identical (vN_ScttrF) to the memory locations of the corresponding sections of the previous version (FW_vN); - a compressor (CPRSSR) configured to: — compare bit-by-bit by an exclusive-or operator (xor), the binary file (vN+l_bin) of the later version (FW_vN+l) with a binary file (vN_bin) of the previous version (FW_vN); and to — construct the update file (AFW, AFW_cpr) comprising the results of the bit-by-bit comparison by the exclusive-or operator (xor), to communicate the differences (DAT_diff), by memory regions, between said compared binary files (vN+l_bin, vN_bin).

10. Server device according to claim 9, wherein the compressor is configured to construct the update file (AFW_cpr) free of memory regions free of differences (0, ..., 0) between said compared binary files (vN+l_bin, vN_bin), and to construct the update file (AFW_cpr) comprising an identification (DSCR) of the memory locations, in the binary file (vN_bin, vN+l_bin) of the previous version (FW_vN), of the memory regions having said differences (DIFF_1, ..., DIFF_k) between said compared binary files (vN+l_bin, vN_bin).

11. Server device according to one of claims 9 or 10, wherein the link editor (LNKR) is configured, if the binary file (vN+l_bin) of the later version (FW_vN+l) comprises a section (MWfunc2_vN+l) of larger size in memory (sz_200) than the memory location (#100; sz_100) allocated to this section (MWfunc2_vN) in the earlier version (FW_vN), to allocate a new memory location (#200; sz_200), free in the earlier version (FW_vN), to said larger section (MWfunc2_vN+l), and to introduce a call instruction (Call_#200) to the new memory location (#200), in the memory location (#100; sz_100) allocated to this section (MWfunc2_vN) in the previous version.

12. Server device according to one of claims 9 to 11, wherein the link editor (LNKR) is configured, if the binary file (vN+l_bin) of the later version (FW_vN+l) comprises a section (MWfunc2_vN+l) of smaller size in memory than the memory location (#100; sz_100) allocated to this section (MWfunc2_vN) in the earlier version, to allocate the same memory location having this same size (#100; sz_100) and leave empty the excess size of the memory location (#100; sz_100).

13.

14.

15. Client device capable of updating a previous version of software (FW_vN) contained in a memory, to a later version of the software (FW_vN+l), comprising: - reception means configured to receive an update file (AFW, AFW_cpr) comprising the result of a bit-by-bit comparison by an exclusive-or operator (xor) between the binary file of the later version (vN+l_bin) and the binary file of the earlier version (vN_bin), to communicate the differences (DAT_diff), by memory regions (Offst_l-Lgth_l, Offst_k-Lgth_k), between a binary file (vN+l_bin) of the later version (FW_vN+l) and a binary file (vN_bin) of the earlier version (FW_vN); - processing means configured to replace, in the part of the memory containing the binary file (vN_bin) of the previous version (FW_vN), bits of the memory regions having differences by the bits of the memory regions of the binary file (vN+l_bin) of the later version (FW_vN+l), by transforming the bits contained in said memory regions of the binary file of the previous version (vN_bin) by the exclusive-or operator (xor) with the bits of said result of the bit-by-bit comparison by the exclusive-or operator (xor) between said binary files (vN+l_bin, vN_bin). The client device of claim 13, wherein: - the reception means are configured to receive the update file (AFW_cpr) free from memory regions free from differences (0, ..., 0) between said compared binary files (vN+l_bin, vN_bin), and comprising an identification (DSCR) of the memory locations, in the binary file (vN_bin, vN+l_bin) of the previous version (FW_vN), of the memory regions presenting said differences (DIFF_1, ..., DIFF_k) between said compared binary files (vN+l_bin, vN_bin); - the processing means are configured to read said identification (DSCR) and selectively access said identified memory locations. A client device, according to one of claims 13 or 14, capable of updating an earlier version of software (FW_vN+l) to a later version of the software (FW_vN), the earlier version (FW_vN+l) having been updated from a previous version (FW_vN) with the earlier update file (AFW, AFW_cpr), and the version ul lower (FW_vN) corresponding to a return to said previous version (FW_vN), in which: - the receiving means are configured to retrieve the previous update file as an update file (AFW, AFW_cpr); - the processing means are configured to transform the bits contained in said memory regions of the binary file of the previous version (vN_bin) by the exclusive-or operator (xor) with the bits of said result of the previous update file.

16. System comprising a server device (SRV) according to one of claims 9 to 12, and at least one client device (DEV) according to one of claims 13 to 15, the server device being able to communicate said update file (AFW_cpr) from the previous version of a software (FW_vN) to the later version of the software (FW_vN+1), to said at least one client device (DEV) by a communication network (NTW), and the client device (DEV) being able to update the previous version of a software (FW_vN) to the later version of the software (FW_vN+1) with this update file (AFW_cpr).