[go: up one dir, main page]

WO2015071507A1 - Method and device for efficiently updating data in electronic devices - Google Patents

Method and device for efficiently updating data in electronic devices Download PDF

Info

Publication number
WO2015071507A1
WO2015071507A1 PCT/ES2014/000050 ES2014000050W WO2015071507A1 WO 2015071507 A1 WO2015071507 A1 WO 2015071507A1 ES 2014000050 W ES2014000050 W ES 2014000050W WO 2015071507 A1 WO2015071507 A1 WO 2015071507A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
entry
data set
update
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/ES2014/000050
Other languages
Spanish (es)
French (fr)
Inventor
Pablo Pedro SÁNCHEZ ESPESO
Álvaro DÍAZ SUÁREZ
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Universidad de Cantabria
Original Assignee
Universidad de Cantabria
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Universidad de Cantabria filed Critical Universidad de Cantabria
Publication of WO2015071507A1 publication Critical patent/WO2015071507A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions
    • G06F9/44542Retargetable

Definitions

  • the present invention has its field of application in the efficient updating of data in electronic devices and more specifically, in the efficient updating of software in electronic devices, especially in embedded electronic devices (also called embedded electronic devices).
  • Embedded electronic system is called electronic circuits that perform specific tasks in a certain more complex electronic system, such as the electronic control unit (ECU, Electronic Control Unit) of a car.
  • ECU Electronic Control Unit
  • Electronic devices such as mobile phones, PDAs (Personal Digital Assistants), tablets, televisions, routers ... store different types of software (for example, applications or operating system) supplied either by the manufacturers themselves electronic device, telecommunication operators or third parties that, in many cases, must be updated often.
  • software for example, applications or operating system
  • firmware An example of a type of software stored by electronic devices is firmware.
  • the firmware can be defined as a set of machine instructions for specific purposes, recorded in a memory, which establishes the lower level logic that controls the operation (for example, controls electronic circuits) of an electronic device of any type. It is strongly integrated with the electronics of the device. That is, the firmware is the software responsible for controlling and operating the device to correctly execute the external instructions or in other words, it is the software that has direct interaction and controls the hardware.
  • firmware is stored in ROM or Flash memory chips. For this reason (stored in Flash / ROM memory chips), software that runs on embedded or embedded systems is often considered firmware. This code includes both the startup code and the operating system. In some applications, the application software is even considered as an element of the system firmware.
  • the electronic devices consist of electronic data storage units (memory) to store these software instructions and in general any type of data they need.
  • memory electronic data storage units
  • RAM Random Access Memory
  • RAM Random Access Memory
  • non-volatile memory there are other types of memory units that are non-volatile (that is, they keep storing the information even without power supply).
  • An example of this type of non-volatile memory is the so-called flash memory, formed by non-volatile chips for the storage of information that can be electronically erased and programmed.
  • Other examples of non-volatile memory are the ROM and the EEPROM. These memories, unlike RAM, can preserve data for a long time without having to maintain the power supply, but they are more expensive and require, as we will see, a more complex operating interface.
  • the firmware is normally stored in non-volatile memory units.
  • the firmware of a device is usually updated frequently (for example, when there is a new version of it) and this poses problems, since, as we said the operation interface with the Non-volatile memories are complex and are more thought to save data in the long term and not to be updated frequently.
  • the first method consists in the development of the firmware in a modular way, in such a way that it is only necessary to transmit the modules that are required.
  • the second method consists of incremental updates, where only the changes with respect to the old software (the one that is already stored in the device at the time of the update) are transmitted.
  • Updates are made by building the new firmware from the old one (the one that is currently running on the device) by means of a script (usually known as a "script") with the differences between the updated firmware and the one currently running on the device. device.
  • This script generated with the differences between the code of the new firmware and that of the old one, will be the update that is transmitted through a communications network.
  • the writing in flash memory presents some particular aspects that must be taken into account.
  • Once a block is deleted it is only possible to write once in a memory location. If you want to rewrite a memory location, you must delete the entire memory block again and rewrite the block positions that you do not want to modify.
  • the present invention has in account this behavior to reduce rewrites and thereby reduce consumption and communication and operation time.
  • the present invention proposes a method and system that solves, in a simple manner, the problems presented by the firmware update in the existing devices. Said solution allows updating the software in a fast way, with low power consumption and that minimizes the number of deletions of the non-volatile memory unit (for example, flash) at an advantageous cost.
  • the non-volatile memory unit for example, flash
  • the present invention describes a method for the efficient updating of data in an electronic device connected to a communication network, where the electronic device consists of at least a first non-volatile memory unit and a second non-volatile memory unit.
  • volatile type memory that stores data sets and a processor, where in the first memory unit is stored a first table with at least one entry for each data set with a position field indicating a position in one of the memory units of said data set and a validity field indicating whether said entry is valid or not
  • the method comprises the following steps: a) Receive through the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units b) For each data set that includes a new version in the update file: b1) Store this new version of the data set in free positions of one of the memory units b2) Add to the first table an entry for said data set indicating in the position field, the position of the new version of said data set in the memory unit where the new version of said data set has been stored.
  • the new version of a data set can be stored in the first or second memory units and in the entry corresponding to said data set in the second table, the position in the corresponding memory unit is indicated where it is stored. has stored said new version of said data set
  • the first memory unit can be of the flash type and the second memory unit can be of the RAM type.
  • said data sets are part of the firmware of the device.
  • the update data file is sent by a server to the electronic device through the communications network.
  • a comparison of a new version of the data sets with the data sets stored in the device is produced and from said comparison the update data file is obtained.
  • Said data sets can be data objects that can be functions, variables or any other type of data objects.
  • Said second field can not only indicate if the entry is valid or not, but in the case of being invalid it can indicate a new position in the table for said data set.
  • the first table there may be a field for each entry indicating the version number of the data set to which that entry belongs or a field for each entry indicating the index of the second table it refers to.
  • Said free positions in which the new version of the data set is stored may be at the end of all the data sets stored in the memory unit where it is to be stored.
  • the electronic device can be an electronic device can be an embedded electronic device and / or without Memory Management Unit MMU (English Memory Management Unit).
  • MMU English Memory Management Unit
  • the present invention describes an electronic device for the efficient updating of data, where said electronic device is connected to a communications network and comprises:
  • the first memory unit also stores a first table with at least one entry for each data set with a position field indicating a position of said data set in the memory units (in the first or in the second) and a validity field that indicates if said entry is valid or not;
  • the second memory unit stores a second table with an entry for each data set that indicates for each data set, the valid position in the memory units (in the first or the second) of said data set
  • a receiver for receiving via the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units and
  • a processor connected to the receiver and to the at least first and second memory units.
  • the processor contains means to analyze the update file and, for each data set from which a new version is included in the update file, store the new version of said data set in free positions of one of the units of memory, add to the first table an entry for said data set indicating in the position field the position in the memory unit where said new version has been stored and indicate in the validity field that said entry is valid and in the Other entries of said table for said data set indicate in the validity field that said entry is not valid and, based on the information in the first table, update the second table stored in the second memory unit in a manner that in the entry corresponding to each data set from which a new version is included in the update file, the position in the unit is indicated of memory where it has stored said new version
  • Said electronic device can be a mobile phone, a tablet, a PDAs (of English, Personal Digital Assistants, Personal Digital Assistant), MP-3 player, a digital camera, an intelligent television, wireless network node or similar device.
  • PDAs of English, Personal Digital Assistants, Personal Digital Assistant
  • MP-3 player of a digital camera
  • an intelligent television wireless network node or similar device.
  • the present invention describes a computer program product comprising computer executable instructions for performing any of the methods described above when the program is executed on a computer.
  • the present invention discloses a digital data storage medium that encodes a program of instructions executable by machine, to perform any of the methods described above.
  • Figure 1 shows schematically part of the update process according to an embodiment of the present invention.
  • Figure 2 shows schematically the process of accessing a function through an address table.
  • Figure 3 schematically shows the address tables that are part of the update process according to an embodiment of the present invention.
  • Figure 4 shows schematically part of the update process in an address table according to an embodiment of the present invention.
  • Figure 5 schematically shows the address tables that are part of the update process according to an embodiment of the present invention.
  • FIG. 6 shows a block diagram where the update process according to an embodiment of the present invention is described.
  • electronic device is used in the present text to refer to any type of mobile or fixed electronic device, such as a mobile phone, a tablet, a PDA (of English, Personal Digital Assistants, personal digital assistants), MP-player. 3, digital cameras or smart televisions among others.
  • PDA Personal Digital Assistants, personal digital assistants
  • MP-player digital cameras or smart televisions among others.
  • the present invention is not limited to the devices named above since the embodiments of the present invention They can be used in a wide variety of electronic devices.
  • the electronic devices can be adapted to access nodes (for example servers) through a communication network (mobile or fixed) to obtain update information to change the software stored in their memory units.
  • nodes for example servers
  • a communication network mobile or fixed
  • the update information may comprise information that modifies, changes or corrects the firmware of the device or any other software component stored in the electronic device.
  • this update information can be an executable set of instructions that can be used to add new services to the electronic device (at the request of the user, the service provider or the device manufacturer) and / or to improve or correct errors in some existing function of the electronic device.
  • the present invention proposes a method and device for safely, rapidly updating software (eg firmware) in an electronic device.
  • software eg firmware
  • said electronic device includes at least one processor or CPU (from the English Computer Processing Unit), at least one first memory unit (or a group of first memory units) and a second memory unit ( or a group of second memory units).
  • the electronic device may also consist of a communications interface that allows you to access a communications network to send and receive information.
  • the first memory units are of the nonvolatile type (e.g., a flash memory) and the second are of the volatile type (e.g., a RAM).
  • the nonvolatile type e.g., a flash memory
  • the volatile type e.g., a RAM
  • These memory units can be connected via a communication bus with the rest of the units of the device.
  • the firmware to be updated is stored in one or more of the first memory units (flash type memory). In alternative embodiments, the firmware to be updated may be stored in one or more of the second memory units or part in one or more of the first memory units and part in one or more of the second memory units.
  • the position of each firmware element in the memory units must be known, so each firmware function must be carefully placed in a known memory location (or from the default positions) in order to be able to generate an address table that identifies the location in the memory of each function. For this, for example, you can separate each object (functions, data ...) during the linking of the firmware in a separate section for each object. This will help to identify each object more easily.
  • One of the characteristics on which the invention is based is in the rewriting of the functions updated in the free spaces of the non-volatile memory (flash memory). Thanks to this, we avoid the problems of code displacement and will only change the position of the updated functions while the non-updated functions will remain in the same memory position they had before the update.
  • FIG. 1 An example of this process can be seen in Figure 1, where a map of the original memory is shown on the left (before the update) and on the right a map of the memory after the update.
  • the function to be updated is function 1.
  • This updated function 1 may have been received by the electronic device of a server through the communication network (for example, a mobile telephone network) to the one that the electronic device is connected to.
  • the communication network for example, a mobile telephone network
  • This updated function 1 is copied at the beginning of the free space (which may be, for example, at the end of the current firmware). Thanks to this, as can be seen in the memory on the right of figure 1, no address of the other functions (the non-updated ones) is altered, since the displacement problem does not affect them.
  • This new function will be copied by the device in the address that is told (for example the user can decide) by updating.
  • the update sent to the device contains information about the address where each part of the new code should be copied. This process of copying is done by the device itself (the processor) in the space that the user indicated when generating the update.
  • the table when starting the firmware load (when the device is booted, restarted or updated) the table will be copied into the RAM, processing it to eliminate the old entries and leaving only the valid entries, since when the device is turned off the RAM is deleted, so it is necessary to re-copy the table to RAM.
  • the new entries in the RAM memory must be renewed in order for the updated firmware to start functioning.
  • Figure 3 shows an example of the proposed process.
  • an address table is kept in the first memory unit (flash memory).
  • the update has consisted of the introduction of a new function 2, this update has caused its position in the flash memory to change (from being in Direction 2 to being in Direction 4) and therefore , the table where your address appears in the memory must be modified. What is done is to remove the old reference of this function from the address table and the subsequent inclusion of a new entry at the end of the table with the new reference. Thanks to this, it has only been necessary to add new information in the flash memory without needing to erase it.
  • this new table is passed to the second memory unit (RAM) with a process that removes the old entries (in this case, the function) 2) and write only the updated addresses without changing the position of each function in this second table.
  • the address of each function will be correct even after an update of the function and its position within the table will not change, so calls to a function will always point to that position in the table and you will not need to change these calls even if the function is updated and therefore change the location of the function in the flash memory.
  • an update file (script) will be generated that will be obtained from the difference between the new firmware that is to be installed in the electronic device and the firmware that is stored at that moment in the device.
  • This update file can be generated by the same server in which the new firmware is stored or in another node of the communications network.
  • This update file generated with the differences between the code of the new firmware and that of the old one, will be the update that is transmitted through the communications network.
  • firmware objects For a correct ordering of firmware objects, one option is to separate the objects (functions, variables ...) during the linking of the firmware in a different section each. In one embodiment these sections would be Operating System, drivers and applications. This separation is a proposal of example that facilitates the correct understanding of the technique that is going to be described next, but the Separation can be done in other ways that the firmware designer sees fit and that are known in the state of the art. One could even not separate the parts, since it is not necessary for the correct operation of the present invention.
  • a free space will be introduced between each section of the firmware stored in the memory of the device.
  • this first address table (the one stored in the flash memory) will have at least three fields, for each object (for example a function) the first one will indicate the position of the object in memory (the address of the object in the memory), the second will indicate if the entry in the table is valid or has been updated and the third party will keep the index in the second table (the table stored in the RAM) to which it refers (to avoid losing references during the update, since the position in the RAM table should not be altered since it helps to be more efficient when doing a direct search (positional access) in the RAM table of the address.
  • this second field for example, you can choose a value so that if it has that value (in Figure 4 FFF..FF), the entry will be valid and if it has another value it will be an indication that the entry is not valid .
  • this second field will not only indicate if the entry is valid or not, but in the case of being invalid it will indicate the new position in the table for said function (see figure 4).
  • Figure 5 shows the table saved in the flash memory after the update (on the left) and the table stored in the RAM memory. You can see how the table stored in RAM is minimal, since it will only contain the memory addresses where each function is located, since the identifier of each function can even be its position in the table. (In one embodiment, each function has a unique numeric identifier which is its position in the RAM table).
  • firmware version field that allows to delay firmware versions without having to update nothing or help recover the system of failed updates. For this a process similar to the one used would be followed, adding a new field in the Flash memory table indicating in which version that entry was added, and in case it is necessary to make an outdated, the process of copying the Flash memory table RAM will be responsible for omitting entries higher than that version and keeping the old ones.
  • the first step shown is the comparison (603) of the two firmwares (the current 601 and the new 602) to identify the objects (for example, functions or variables) that are modified with the new firmware and generate an update with these new objects
  • the electronic device for example, by means of a communication network (604).
  • the new firmware can be supplied by the manufacturers of the electronic device, telecommunication operators or third parties and the node that compares these firmwares, generates the update file and sends it to the electronic device, it can be a server belonging to the supplier of the firmware or a server external to the firmware provider.
  • the device stores these new objects in the holes that are not written in the flash memory (605) and adds the new address in the memory (or addresses if several objects are updated) of the object, creating a new entry in the table of the flash memory (606). Once this is done we can say that the system would be updated. It would only be possible to pass the address table to the RAM by deleting the old (invalid) entries 607 in order to execute the code (608) without errors in the addresses.
  • the updates are achieved in a simple, fast and efficient way, with low power consumption and minimizing the number of deletions of the non-volatile memory unit, so that , for all these characteristics, the useful life of the electronic device is increased.
  • the application of the present invention is not limited to updating the firmware but can be applied to the updating of any data stored in the electronic device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method and a device for efficiently updating data in electronic devices, solving problems presented by existing techniques in a simple manner. The invention allows the device to be updated rapidly, with low energy consumption, and minimising the number of times the non-volatile memory unit (for example, flash) is erased, at a profitable cost.

Description

MÉTODO Y DISPOSITIVO PARA LA ACTUALIZACIÓN EFICIENTE DE DATOS EN DISPOSITIVOS ELECTRÓNICOS  METHOD AND DEVICE FOR EFFICIENT UPDATING OF DATA IN ELECTRONIC DEVICES

D E S C R I P C I Ó N D E S C R I P C I O N

CAMPO TÉCNICO DE LA INVENCIÓN TECHNICAL FIELD OF THE INVENTION

La presente invención tiene su campo de aplicación en la actualización eficiente de datos en dispositivos electrónicos y más concretamente, en la actualización eficiente de software en dispositivos electrónicos, especialmente en dispositivos electrónicos embebidos (también llamados dispositivos electrónicos empotrados). Se denomina sistema electrónico embebido a los circuitos electrónicos que realizan tareas específicas en un determinado sistema electrónico más complejo, como por ejemplo la unidad de control electrónico (ECU, Electronic Control Unit) de un automóvil. The present invention has its field of application in the efficient updating of data in electronic devices and more specifically, in the efficient updating of software in electronic devices, especially in embedded electronic devices (also called embedded electronic devices). Embedded electronic system is called electronic circuits that perform specific tasks in a certain more complex electronic system, such as the electronic control unit (ECU, Electronic Control Unit) of a car.

ANTECEDENTES DE LA INVENCIÓN BACKGROUND OF THE INVENTION

Los dispositivos electrónicos como teléfonos móviles, PDAs (del inglés, Personal Digital Assistants, Asistentes digitales personales), tabletas, televisores, routers... almacenan distintos tipos de software (por ejemplo, aplicaciones o sistema operativo) suministrados bien de los propios fabricantes del dispositivo electrónico, de operadores de telecomunicación o de terceras partes que, en muchos casos, deben ser actualizados a menudo. Electronic devices such as mobile phones, PDAs (Personal Digital Assistants), tablets, televisions, routers ... store different types of software (for example, applications or operating system) supplied either by the manufacturers themselves electronic device, telecommunication operators or third parties that, in many cases, must be updated often.

Un ejemplo de un tipo de software que almacenan los dispositivos electrónicos es el firmware. El firmware se puede definir como un conjunto de instrucciones de máquina para propósitos específicos, grabado en una memoria, que establece la lógica de más bajo nivel que controla el funcionamiento (por ejemplo, controla los circuitos electrónicos) de un dispositivo electrónico de cualquier tipo. Está fuertemente integrado con la electrónica del dispositivo. Es decir, el firmware es el software encargado de controlar y hacer funcionar el dispositivo para ejecutar correctamente las instrucciones externas o en otras palabras, es el software que tiene interacción directa y controla el hardware. An example of a type of software stored by electronic devices is firmware. The firmware can be defined as a set of machine instructions for specific purposes, recorded in a memory, which establishes the lower level logic that controls the operation (for example, controls electronic circuits) of an electronic device of any type. It is strongly integrated with the electronics of the device. That is, the firmware is the software responsible for controlling and operating the device to correctly execute the external instructions or in other words, it is the software that has direct interaction and controls the hardware.

Tradicionalmente, el firmware se almacena en chips de memoria ROM o Flash. Por esta razón (almacenarse en chips de memoria Flash/ROM), al software que se ejecuta en sistemas embebidos o empotrados, se le suele considerar firmware. Dicho código incluye tanto el código de inicio como el sistema operativo. En algunas aplicaciones, incluso se considera al software de aplicación como elemento del firmware del sistema. Traditionally, the firmware is stored in ROM or Flash memory chips. For this reason (stored in Flash / ROM memory chips), software that runs on embedded or embedded systems is often considered firmware. This code includes both the startup code and the operating system. In some applications, the application software is even considered as an element of the system firmware.

Los dispositivos electrónicos constan de unidades electrónicas de almacenamiento de datos (memoria) para almacenar estas instrucciones software y en general cualquier tipo de datos que necesiten. Hay numerosos tipos de memorias, conocidas del estado de la técnica. Esas unidades deben estar configuradas para recibir datos electrónicos de una fuente externa o interna, preservar los datos durante un cierto tiempo y suministrarlos cuando se le soliciten. The electronic devices consist of electronic data storage units (memory) to store these software instructions and in general any type of data they need. There are numerous types of memories, known from the state of the art. These units must be configured to receive electronic data from an external or internal source, preserve the data for a certain time and supply it when requested.

Hay por ejemplo, un tipo de unidades de memoria que son volátiles (es decir, se borran si hay una interrupción del suministro de energía) como las RAM (del inglés Random Access Memory, Memorias de Acceso Aleatorio). Estas memorias son baratas y rápidas, pero deben estar continuamente con alimentación eléctrica para no perder la información que almacenan. Esto hace que las memorias RAM sean caras de operar y consuman mucha energía. Por lo tanto este tipo de memorias se usan para almacenamiento a corto plazo, para facilitar la transferencia rápida de datos que se van a usar rápidamente en los dispositivos electrónicos y se modifiquen frecuentemente. There are for example, a type of memory units that are volatile (that is, they are erased if there is an interruption in the power supply) such as RAM (from the Random Access Memory, Random Access Memories). These memories are cheap and fast, but they must be continuously powered so as not to lose the information they store. This makes RAM memories expensive to operate and consume a lot of power. Therefore, this type of memory is used for short-term storage, to facilitate the rapid transfer of data that will be used quickly in devices electronic and are modified frequently.

Hay otros tipos de unidades de memoria que son no volátiles (es decir, que sigue almacenando la información aún sin suministro de energía). Un ejemplo de este tipo de memorias no volátiles es la llamada memoria flash, formada por chips no volátiles para el almacenamiento de información que pueden ser electrónicamente borrado y programados. Otros ejemplos de memoria no volátil son la ROM y la EEPROM. Estas memorias, al contrario de las RAM, pueden preservar los datos largo tiempo sin necesidad de mantener el suministro eléctrico, pero son más caras y requieren, como veremos, un interfaz de operación más complejo. There are other types of memory units that are non-volatile (that is, they keep storing the information even without power supply). An example of this type of non-volatile memory is the so-called flash memory, formed by non-volatile chips for the storage of information that can be electronically erased and programmed. Other examples of non-volatile memory are the ROM and the EEPROM. These memories, unlike RAM, can preserve data for a long time without having to maintain the power supply, but they are more expensive and require, as we will see, a more complex operating interface.

Por razones obvias de seguridad, al ser fundamental para el funcionamiento del dispositivo, normalmente el firmware se almacena en unidades de memoria no- volátiles. For obvious security reasons, being fundamental to the operation of the device, the firmware is normally stored in non-volatile memory units.

Por otro lado, para asegurar un correcto funcionamiento del dispositivo, el firmware de un dispositivo suele ser actualizado frecuentemente (por ejemplo, cuando hay una nueva versión del mismo) y esto plantea problemas, ya que, como hemos dicho el interfaz de operación con las memorias no volátiles es complejo y están más pensadas para guardar datos a largo plazo y no para ser actualizadas frecuentemente. On the other hand, to ensure proper operation of the device, the firmware of a device is usually updated frequently (for example, when there is a new version of it) and this poses problems, since, as we said the operation interface with the Non-volatile memories are complex and are more thought to save data in the long term and not to be updated frequently.

Las modificaciones del software para actualizar la versión o para corregir errores (lo que se conoce de manera general como actualizar el software) puede ser un punto muy crítico en el funcionamiento de dispositivos electrónicos. En dispositivos en el que el consumo es un factor importante, como por ejemplo, los dispositivos inalámbricos, es importante que el proceso de actualización sea eficiente. Una actualización eficiente nos permitirá aumentar la vida útil del dispositivo al reducir su consumo durante la actualización. Esto es especialmente importante cuando hablamos de software fundamental que se actualiza frecuentemente como es el firmware. Estas actualizaciones se suelen realizar a través de redes de comunicación que comunican el dispositivo electrónico a actualizar con el nodo (servidor) donde se encuentra el nuevo software. Esta red puede ser una red de cable, de fibra, sin hilos, una red de telefonía móvil, de fibra óptica o cualquier otro tipo de red de comunicación a la que esté conectado el dispositivo electrónico y que le permita comunicarse. Opcionalmente las actualizaciones pueden cargarse directamente en el dispositivo, por ejemplo mediante una unidad de memoria externa (como un USB, un CD o cualquiera otra) que se inserta en el dispositivo. Software modifications to update the version or to correct errors (what is generally known as updating the software) can be a very critical point in the operation of electronic devices. In devices where consumption is an important factor, such as wireless devices, it is important that the update process be efficient. An efficient update will allow us to increase the useful life of the device by reducing its consumption during the update. This is especially important when we talk about fundamental software that is updated frequently as is the firmware. These updates are usually made through communication networks that communicate the electronic device to be updated with the node (server) where the new software is located. This network can be a cable, fiber, wireless network, a mobile telephony network, fiber optic network or any other type of communication network to which the electronic device is connected and which allows it to communicate. Optionally the updates can be loaded directly into the device, for example by means of an external memory unit (such as a USB, a CD or any other) that is inserted into the device.

Actualmente, existen distintas estrategias a la hora de actualizar el firmware. La más simple manera consiste en cargar completamente todo el firmware nuevo. Esta técnica es una de las más utilizadas ya que permite actualizar el firmware de una manera muy sencilla. Sin embargo, el consumo de potencia en la transmisión y durante la actualización es muy alto debido a que es necesario la transmisión de todo el firmware para cada actualización. Además, al ser necesario un borrado previo de las memorias no-volátiles (como flash o EEPROM), se reduce la vida útil de dichas memorias cuyos ciclos de borrado están limitados (el fabricante no garantiza que el dispositivo funcione después de un cierto número de borrados). Currently, there are different strategies when updating the firmware. The simplest way is to fully load all the new firmware. This technique is one of the most used because it allows to update the firmware in a very simple way. However, the power consumption in the transmission and during the update is very high because it is necessary to transmit all the firmware for each update. In addition, as a previous erase of the non-volatile memories (such as flash or EEPROM) is necessary, the life of said memories whose erase cycles are limited is reduced (the manufacturer does not guarantee that the device will work after a certain number of years). deleted).

Por esto, se han desarrollado técnicas de reducción del tamaño de las actualizaciones. Estas técnicas tienen un impacto importante en el consumo de energía utilizado durante la transmisión, y por lo tanto, en el tiempo de vida de estos dispositivos, los cuales están habitualmente alimentados por baterías. Dentro de la técnica de reducción del tamaño de la actualización existen dos métodos distintos. El primer método consiste en el desarrollo del firmware de modo modular, de tal modo que únicamente sea necesario transmitir los módulos que sean requeridos. El segundo método consiste en actualizaciones increméntales, donde únicamente los cambios respecto al software antiguo (el que ya está almacenado en el dispositivo en el momento de la actualización) son transmitidos. Un ejemplo de estas técnicas se pueden ve en el documento "Efficient code distribution in wireless sensor networks" de N. Reijers y K.Langendoen publicado en la "WSNA Ό3 Proceedings of the 2nd ACM international conference on Wireless sensor networks and applications", 2003, donde los autores utilizan una técnica de actualización basada en las diferencias entre el firmware antiguo y el nuevo. Las actualizaciones son realizadas construyendo el nuevo firmware a partir del antiguo (el que actualmente se ejecuta en el dispositivo) mediante una secuencia de comandos (normalmente conocida como "script") con las diferencias entre el firmware actualizado y el que actualmente se ejecuta en el dispositivo. Este script generado con las diferencias entre el código del nuevo firmware y el del viejo, será la actualización que se transmita a través de una red de comunicaciones. Because of this, techniques have been developed to reduce the size of the updates. These techniques have an important impact on the energy consumption used during the transmission, and therefore, in the lifespan of these devices, which are usually powered by batteries. Within the technique of reducing the size of the update there are two different methods. The first method consists in the development of the firmware in a modular way, in such a way that it is only necessary to transmit the modules that are required. The second method consists of incremental updates, where only the changes with respect to the old software (the one that is already stored in the device at the time of the update) are transmitted. An example of these techniques can be seen in the document "Efficient code distribution in wireless sensor networks" by N. Reijers and K.Langendoen published in the "WSNA Ό3 Proceedings of the 2nd ACM international conference on Wireless sensor networks and applications", 2003 , where the authors use an update technique based on the differences between the old and the new firmware. Updates are made by building the new firmware from the old one (the one that is currently running on the device) by means of a script (usually known as a "script") with the differences between the updated firmware and the one currently running on the device. device. This script generated with the differences between the code of the new firmware and that of the old one, will be the update that is transmitted through a communications network.

El problema de este tipo de técnicas radica en que el tamaño de los scripts de actualización no es necesariamente congruente con la extensión real de la actualización. Esto es debido a que un pequeño cambio en una de las instrucciones puede resultar en un desplazamiento de las posiciones de las instrucciones en la memoria. Esto hace que se necesite reordenar el código para que coincidan los saltos y las llamadas a funciones (conjuntos de instrucciones que permiten llevar a cabo una determinada acción o función en el dispositivo electrónico), por lo que se tiene que modificar una gran parte del código, dando lugar a un script muy grande cuando lo realmente actualizado es muy poco. The problem with this type of technique is that the size of the update scripts is not necessarily congruent with the actual extension of the update. This is because a small change in one of the instructions may result in a shift of the positions of the instructions in the memory. This makes it necessary to reorder the code to match the jumps and calls to functions (sets of instructions that allow to carry out a certain action or function in the electronic device), so a large part of the code has to be modified , resulting in a very large script when what is really updated is very little.

Este problema intenta ser solucionado en otros documentos del estado de la técnica como en "Remote Incremental Linking for Energy-Efficient Reprogramming of Sensor Networks" de J. Koshy y R. Pandey publicado en " Proceeedings of the Second European Workshop on Wireless Sensor Networks", 2005, donde los autores proponen la introducción de un "espacio de reserva" o "slop space" entre las funciones del firmware de forma que permitan a la función aumentar de tamaño sin que modifique las posiciones de las demás funciones. Esto permite escribir la nueva función en la misma posición inicial sin desplazar las posiciones de las instrucciones de otras funciones y, por lo tanto, sin necesidad de actualizar las referencias a las posiciones de las funciones. Esto tiene el inconveniente de que en el caso de que el crecimiento de la función sea mayor que su "slop space", entonces se desplazan las posiciones de las instrucciones de otras funciones y, por lo tanto, vuelve a tener que ser necesario actualizar más referencias de las que en un principio serían necesarias. This problem attempts to be solved in other documents of the state of the art as in "Remote Incremental Linking for Energy-Efficient Reprogramming of Sensor Networks" of J. Koshy and R. Pandey published in "Proceedings of the Second European Workshop on Wireless Sensor Networks" , 2005, where the authors propose the introduction of a "space of reservation" or "slop space" between the functions of the firmware in a way that allows the function to increase size without changing the positions of the other functions. This allows writing the new function in the same initial position without shifting the positions of the instructions of other functions and, therefore, without the need to update the references to the positions of the functions. This has the disadvantage that in the event that the growth of the function is greater than its "slop space", then the positions of the instructions of other functions are displaced and, therefore, it has to be necessary to update more references that would be necessary at the beginning.

Otras técnicas de actualización se basan en el uso de máquinas virtuales (como se describe por ejemplo en "VM*: Synthesizing scalable runtime environments for sensor networks" de de J. Koshy y R. Pandey, Proc. 3rd ACM Conf. Embedded Networked Sensor Systems (SENSYSV05), 2005). Estas técnicas proponen el uso de la tecnología de virtualización y presentan el problema de su complejidad. El consumo de potencia durante la compilación en tiempo de ejecución, el linkado y el proceso de ejecución es mucho mayor que si se usara código nativo, por lo que el sobrecoste en términos de uso de energía es prohibitivo. Other update techniques are based on the use of virtual machines (as described for example in "VM *: Synthesizing scalable runtime environments for sensor networks" by J. Koshy and R. Pandey, Proc. 3rd ACM Conf. Embedded Networked Sensor Systems (SENSYSV05), 2005). These techniques propose the use of virtualization technology and present the problem of its complexity. The power consumption during the compilation at run time, the link and the execution process is much higher than if native code were used, so the extra cost in terms of energy use is prohibitive.

Existen otras técnicas basadas en el uso del linkado dinámico, donde se cargan dinámicamente distintos módulos en el dispositivo usando código independiente de la posición. Para esto, los módulos se envían mensajes y se comunican a través de una tabla de saltos. There are other techniques based on the use of dynamic linkage, where different modules are dynamically loaded into the device using code independent of the position. For this, the modules send messages and communicate through a table of jumps.

Un trabajo sobre este campo es "Zephyr: Efficient incremental reprogramming of sensor nodes using function cali indirections and difference computation" de R. K. Panta, S. Bagchi, y S. Midkiff, en USENIX Ό9, 2009, en donde los autores presentan una combinación de las dos técnicas más efectivas hasta el momento: el uso de llamadas indirectas a funciones (código independiente de la posición) y el uso de las diferencias entre firmwares para generar un script de linkado. La principal mejora de esta técnica, es que reduce el tamaño del script de actualización pero su problema principal reside en la dependencia entre funciones. En otras palabras, aunque el código sea independiente de la posición, esto no hace que dentro del mismo código, si una función llama a otra función que haya cambiado de posición debido a una actualización, la dirección de llamada no se recalcula en tiempo de ejecución, sino que hay que modificar las direcciones de llamada de todas las funciones que usen la nueva función. Mediante esta técnica es necesario el borrado y la reescritura completa de la memoria flash cada vez que haya una actualización, ya que dicha técnica lo que hace es que a partir del firmware actual (el antiguo) y del script de actualización genera un firmware nuevo dentro del dispositivo y lo sustituye en la memoria, borrando el anterior firmware (es decir, no reutiliza las partes ya grabadas en la memoria flash que son iguales). Debido a esto es necesario el borrado completo de la memoria flash para grabar el firmware actualizado aun cuando los cambios en este sean mínimos, por lo que el tiempo empleado y, sobre todo, el consumo se ven muy afectados a la hora de actualizar. Esto es un grave problema ya que lo que se busca en estos tipos de sistemas es una actualización rápida y con un bajo consumo. Si a esto le sumamos el hándicap de que la vida útil de una memoria flash se ve mermada por el número de borrados que se la haga, nos da como resultado que este tipo de actualización no es el más adecuado. A work on this field is "Zephyr: Efficient incremental reprogramming of sensor nodes using function cali indirections and difference computation" of RK Panta, S. Bagchi, and S. Midkiff, in USENIX Ό9, 2009, where the authors present a combination of the two most effective techniques so far: the use of indirect calls to functions (code independent of the position) and the use of differences between firmwares to generate a linking script. The The main improvement of this technique is that it reduces the size of the update script but its main problem lies in the dependency between functions. In other words, even if the code is independent of the position, this does not mean that within the same code, if a function calls another function that has changed position due to an update, the call address is not recalculated at run time , but you have to modify the call addresses of all the functions that use the new function. Using this technique it is necessary to erase and completely rewrite the flash memory every time there is an update, since this technique does is that from the current firmware (the old one) and the update script generates a new firmware inside of the device and replaces it in the memory, deleting the previous firmware (that is, it does not reuse the parts already recorded in the flash memory that are the same). Due to this it is necessary to completely erase the flash memory to record the updated firmware even when the changes in it are minimal, so that the time spent and, above all, the consumption are greatly affected when updating. This is a serious problem since what is sought in these types of systems is a fast update and with a low consumption. If we add to this the handicap that the useful life of a flash memory is reduced by the number of deletions that are made, it gives us as a result that this type of update is not the most appropriate.

Además la escritura en memoria flash presenta algunos aspectos particulares que hay que tener en cuenta. Antes de poder escribir en la memoria flash, es necesario borrar el bloque de memoria o banco en el que se va a escribir. El borrado de un bloque es un proceso que requiere no solo tiempo sino también una cierta cantidad de energía. Una vez borrado un bloque solo es posible escribir una vez en una posición de memoria. Si se desea re-escribir una posición de memoria es necesario borrar todo el bloque de memoria otra vez y re-escribir las posiciones del bloque que no se deseen modificar. La presente invención tiene en cuenta este comportamiento para reducir las re-escrituras y con ello reducir el consumo y tiempo de comunicación y operación. In addition, the writing in flash memory presents some particular aspects that must be taken into account. Before writing to the flash memory, it is necessary to erase the block of memory or bank in which it is going to be written. Erasing a block is a process that requires not only time but also a certain amount of energy. Once a block is deleted, it is only possible to write once in a memory location. If you want to rewrite a memory location, you must delete the entire memory block again and rewrite the block positions that you do not want to modify. The present invention has in account this behavior to reduce rewrites and thereby reduce consumption and communication and operation time.

Resumiendo, tal como hemos visto, en el estado de la técnica existen varias soluciones para la actualización del software, que van desde las técnicas más simples consistentes en la actualización de todo el firmware (son muy ineficientes en tiempo y consumo), hasta técnicas más complejas que no requieren cambiar todo el firmware, algunas de las cuales se han descrito anteriormente. Todas estas técnicas muestran distintas debilidades como excesivo tiempo o consumo de la actualización. In summary, as we have seen, in the state of the art there are several solutions for updating the software, ranging from the simplest techniques consisting in updating all the firmware (they are very inefficient in time and consumption), to more technical complex that do not require changing all the firmware, some of which have been described above. All these techniques show different weaknesses such as excessive time or consumption of the update.

Por lo tanto, lo que se busca es una técnica que permita que las actualizaciones del software en un dispositivo electrónico sean reducidas en tiempo y consumo así como que dicha actualización se realice mediante un procesado más eficiente (y por lo tanto con un menor consumo energético), con el objeto, entre otros, de aumentar la vida útil del dispositivo electrónico. Y este es el propósito de la presente invención. Therefore, what is sought is a technique that allows software updates in an electronic device to be reduced in time and consumption and that this update be made through more efficient processing (and therefore with a lower energy consumption) ), with the purpose, among others, of increasing the useful life of the electronic device. And this is the purpose of the present invention.

La técnica que se propone en la presente invención para solucionar estos problemas puede ser usada por cualquier dispositivo pero es especialmente beneficiosa en dispositivos sin Unidad de Gestión de Memoria MMU (del inglés Memory Management Unit), ya que los dispositivos con Unidad de Gestión de memoria pueden solucionar parte de estos inconvenientes con otros recursos. La mayoría de los procesadores de sistemas embebidos no disponen de Unidad de Gestión de Memoria y por ello la presente invención está especialmente dirigida a estos dispositivos embebidos. SUMARIO DE LA INVENCIÓN The technique proposed in the present invention to solve these problems can be used by any device but is especially beneficial in devices without MMU Memory Management Unit, since the devices with Memory Management Unit They can solve part of these problems with other resources. Most processors of embedded systems do not have a Memory Management Unit and therefore the present invention is especially directed to these embedded devices. SUMMARY OF THE INVENTION

La presente invención propone un método y sistema que resuelve, de manera simple, los problemas que presenta la actualización de firmware en los dispositivos existentes. Dicha solución permite la actualización del software de una manera rápida, con bajo consumo de energía y que minimiza el número de borrados de la unidad de memoria no volátil (por ejemplo, flash) a un coste ventajoso. The present invention proposes a method and system that solves, in a simple manner, the problems presented by the firmware update in the existing devices. Said solution allows updating the software in a fast way, with low power consumption and that minimizes the number of deletions of the non-volatile memory unit (for example, flash) at an advantageous cost.

En un primer aspecto, la presente invención describe un método para la actualización eficiente de datos en un dispositivo electrónico conectado a una red de comunicaciones, donde el dispositivo electrónico consta de al menos una primera unidad de memoria de tipo no volátil y una segunda unidad de memoria de tipo volátil que almacenan conjuntos de datos y de un procesador, donde en la primera unidad de memoria se encuentra almacenada una primera tabla con al menos una entrada para cada conjunto de datos con un campo de posición que indica una posición en una de las unidades de memoria de dicho conjunto de datos y un campo de validez que indica de si dicha entrada es válida o no, donde el método comprende las siguientes etapas: a) Recibir a través de la red de comunicaciones, un fichero de datos de actualización que incluye una nueva versión de al menos uno de los conjuntos de datos almacenados en las unidades de memoria b) Para cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización: b1) Almacenar dicha nueva versión del conjunto de datos en posiciones libres de una de las unidades de memoria b2) Añadir a la primera tabla una entrada para dicho conjunto de datos indicando en el campo de posición, la posición de la nueva versión de dicho conjunto de datos en la unidad de memoria donde se ha almacenado la nueva versión de dicho conjunto de datos e indicando en el campo de validez que dicha entrada es válida y en el resto de entradas de dicha tabla para dicho conjunto de datos indicar en el campo de validez que no son válidas c) Basándose en la información que hay en la primera tabla, actualizar una segunda tabla almacenada en la segunda unidad de memoria con una entrada para cada conjunto de datos, donde para cada conjunto de datos, indica su posición válida (i.e. actualizada) en una de las unidades de memoria (esto es, para cada conjunto de datos indica la posición en memoria de la versión más actualizada de dicho conjunto de datos). In a first aspect, the present invention describes a method for the efficient updating of data in an electronic device connected to a communication network, where the electronic device consists of at least a first non-volatile memory unit and a second non-volatile memory unit. volatile type memory that stores data sets and a processor, where in the first memory unit is stored a first table with at least one entry for each data set with a position field indicating a position in one of the memory units of said data set and a validity field indicating whether said entry is valid or not, where the method comprises the following steps: a) Receive through the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units b) For each data set that includes a new version in the update file: b1) Store this new version of the data set in free positions of one of the memory units b2) Add to the first table an entry for said data set indicating in the position field, the position of the new version of said data set in the memory unit where the new version of said data set has been stored. indicating in the field of validity that said entry is valid and in the rest of entries of said table for said data set indicate in the validity field that they are not valid c) Based on the information in the first table, update a second table stored in the second memory unit with an entry for each data set, where for each data set, it indicates its valid (ie updated) position in one of the memory units (that is, for each set of data it indicates the position in memory of the most updated version of said data set).

Es decir, la nueva versión de un conjunto de datos se puede almacenar en la primera o segunda unidades de memoria y en la entrada que corresponde a dicho conjunto de datos en la segunda tabla, se indica la posición en la unidad de memoria correspondiente donde se ha almacenado dicha nueva versión de dicho conjunto de datos  That is, the new version of a data set can be stored in the first or second memory units and in the entry corresponding to said data set in the second table, the position in the corresponding memory unit is indicated where it is stored. has stored said new version of said data set

La primera unidad de memoria puede ser de tipo flash y la segunda unidad de memoria puede ser de tipo RAM. The first memory unit can be of the flash type and the second memory unit can be of the RAM type.

En una realización, dichos conjuntos de datos forman parte del firmware del dispositivo. In one embodiment, said data sets are part of the firmware of the device.

En una realización, el fichero de datos de actualización es enviado por un servidor al dispositivo electrónico a través de la red de comunicaciones. En una realización, previamente al paso a), se produce una comparación de una nueva versión de los conjuntos de datos con los conjuntos de datos almacenados en el dispositivo y de dicha comparación se obtiene el fichero de datos de actualización. In one embodiment, the update data file is sent by a server to the electronic device through the communications network. In an embodiment, prior to step a), a comparison of a new version of the data sets with the data sets stored in the device is produced and from said comparison the update data file is obtained.

Dichos conjuntos de datos pueden ser objetos de datos que pueden ser funciones, variables o cualquier otro tipo de objetos de datos. Said data sets can be data objects that can be functions, variables or any other type of data objects.

Dicho segundo campo no sólo puede indicar si la entrada es válida o no, si no que en el caso de ser no válida puede indicar una nueva posición en la tabla para dicho conjunto de datos. Said second field can not only indicate if the entry is valid or not, but in the case of being invalid it can indicate a new position in the table for said data set.

En la primera tabla puede existir un campo para cada entrada indicando el número de versión del conjunto de datos al que pertenece dicha entrada o un campo para cada entrada indicando el índice de la segunda tabla al que hace referencia. In the first table there may be a field for each entry indicating the version number of the data set to which that entry belongs or a field for each entry indicating the index of the second table it refers to.

Dichas posiciones libres en las que se almacenan la nueva versión del conjunto de datos puede estar al final de todos los conjuntos de datos almacenados en la unidad de memoria donde se va a almacenar. Said free positions in which the new version of the data set is stored may be at the end of all the data sets stored in the memory unit where it is to be stored.

El dispositivo electrónico puede ser un dispositivo electrónico puede ser un dispositivo electrónico embebido y/o sin Unidad de Gestión de Memoria MMU (del inglés Memory Management Unit). The electronic device can be an electronic device can be an embedded electronic device and / or without Memory Management Unit MMU (English Memory Management Unit).

En un segundo aspecto, la presente invención describe un dispositivo electrónico para la actualización eficiente de datos, donde dicho dispositivo electrónico está conectado a una red de comunicaciones y comprende: In a second aspect, the present invention describes an electronic device for the efficient updating of data, where said electronic device is connected to a communications network and comprises:

Al menos una primera unidad de memoria de tipo no volátil y una segunda unidad de memoria de tipo volátil que almacenan conjuntos de datos; At least one first memory unit of non-volatile type and a second unit of volatile type memory that store data sets;

donde la primera unidad de memoria almacena también una primera tabla con al menos una entrada para cada conjunto de datos con un campo de posición que indica una posición de dicho conjunto de datos en las unidades de memoria (en la primera o en la segunda) y un campo de validez que indica de si dicha entrada es válida o no; wherein the first memory unit also stores a first table with at least one entry for each data set with a position field indicating a position of said data set in the memory units (in the first or in the second) and a validity field that indicates if said entry is valid or not;

donde la segunda unidad de memoria almacena una segunda tabla con una entrada para cada conjunto de datos que indica para cada conjunto de datos, la posición válida en las unidades de memoria (en la primera o en la segunda) de dicho conjunto de datos where the second memory unit stores a second table with an entry for each data set that indicates for each data set, the valid position in the memory units (in the first or the second) of said data set

Un receptor para a recibir través de la red de comunicaciones, un fichero de datos de actualización que incluye una nueva versión de al menos uno de los conjuntos de datos almacenados en las unidades de memoria y  A receiver for receiving via the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units and

un procesador conectado al receptor y a las al menos primera y segunda unidades de memoria. a processor connected to the receiver and to the at least first and second memory units.

En una realización el procesador contiene medios para analizar el fichero de actualización y, para cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización, almacenar la nueva versión del dicho conjunto de datos en posiciones libres de una de las unidades de memoria, añadir a la primera tabla una entrada para dicho conjunto de datos indicando en el campo de posición la posición en la unidad de memoria donde se ha almacenado dicha nueva versión e indicar en el campo de validez que dicha entrada es válida y en el resto de entradas de dicha tabla para dicho conjunto de datos indicar en el campo de validez que dicha entrada no es válida y para, basándose en la información que hay en la primera tabla, actualizar la segunda tabla almacenada en la segunda unidad de memoria de manera que en la entrada que corresponde a cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización, se indica la posición en la unidad de memoria donde se ha almacenado dicha nueva versión In one embodiment, the processor contains means to analyze the update file and, for each data set from which a new version is included in the update file, store the new version of said data set in free positions of one of the units of memory, add to the first table an entry for said data set indicating in the position field the position in the memory unit where said new version has been stored and indicate in the validity field that said entry is valid and in the Other entries of said table for said data set indicate in the validity field that said entry is not valid and, based on the information in the first table, update the second table stored in the second memory unit in a manner that in the entry corresponding to each data set from which a new version is included in the update file, the position in the unit is indicated of memory where it has stored said new version

Dicho dispositivo electrónico puede ser un teléfono móvil, una tableta, una PDAs (del inglés, Personal Digital Assistants, Asistente digital personal), reproductor MP-3, una cámara digital, una televisión inteligente, nodo de red inalámbrica o dispositivo similar. Said electronic device can be a mobile phone, a tablet, a PDAs (of English, Personal Digital Assistants, Personal Digital Assistant), MP-3 player, a digital camera, an intelligent television, wireless network node or similar device.

En un tercer aspecto, la presente invención describe un producto de programa de ordenador que comprende instrucciones ejecutables por ordenador para realizar cualquiera de los métodos descritos anteriormente cuando el programa es ejecutado en un ordenador. In a third aspect, the present invention describes a computer program product comprising computer executable instructions for performing any of the methods described above when the program is executed on a computer.

En un cuarto aspecto, la presente invención describe un medio de almacenamiento de datos digitales que codifica un programa de instrucciones ejecutable por máquina, para realizar cualquiera de los métodos descritos anteriormente. In a fourth aspect, the present invention discloses a digital data storage medium that encodes a program of instructions executable by machine, to perform any of the methods described above.

Para un entendimiento más completo de la invención, sus objetos y ventajas, puede tenerse referencia a la siguiente memoria descriptiva y a los dibujos adjuntos. For a more complete understanding of the invention, its objects and advantages, reference may be made to the following specification and the accompanying drawings.

DESCRIPCIÓN DE LOS DIBUJOS DESCRIPTION OF THE DRAWINGS

Para complementar la descripción que se está realizando y con objeto de ayudar a una mejor comprensión de las características de la invención, de acuerdo con unos ejemplos preferentes de realizaciones prácticas de la misma, se acompaña como parte integrante de esta descripción un juego de dibujos en donde, con carácter ilustrativo y no limitativo, se ha representado lo siguiente: La Figura 1 muestra esquemáticamente parte del proceso de actualización de acuerdo a una realización de la presente invención. To complement the description that is being made and in order to help a better understanding of the characteristics of the invention, according to preferred examples of practical embodiments thereof, an assembly of drawings is included as an integral part of this description. where, with illustrative and non-limiting character, the following has been represented: Figure 1 shows schematically part of the update process according to an embodiment of the present invention.

La Figura 2 muestra esquemáticamente el proceso de acceso a una función a través de una tabla de direcciones. Figure 2 shows schematically the process of accessing a function through an address table.

La Figura 3 muestra esquemáticamente las tablas de direcciones que forman parte del proceso de actualización de acuerdo a una realización de la presente invención. Figure 3 schematically shows the address tables that are part of the update process according to an embodiment of the present invention.

La Figura 4 muestra esquemáticamente parte del proceso de actualización en una tabla de direcciones de acuerdo a una realización de la presente invención. Figure 4 shows schematically part of the update process in an address table according to an embodiment of the present invention.

La Figura 5 muestra esquemáticamente las tablas de direcciones que forman parte del proceso de actualización de acuerdo a una realización de la presente invención. Figure 5 schematically shows the address tables that are part of the update process according to an embodiment of the present invention.

La Figura 6 muestra un diagrama de bloques donde se describe el proceso de actualización de acuerdo a una realización de la presente invención. Figure 6 shows a block diagram where the update process according to an embodiment of the present invention is described.

DESCRIPCIÓN DETALLADA DE LA INVENCIÓN DETAILED DESCRIPTION OF THE INVENTION

La expresión dispositivo electrónico se usa en el presente texto para referirse a cualquier tipo de dispositivo electrónico móvil o fijo, como pueden ser un teléfono móvil, una tableta, una PDAs (del inglés, Personal Digital Assistants, Asistentes digitales personales), reproductor MP-3, cámaras digitales o televisiones inteligentes entre otros. La presente invención no está limitada a los dispositivos nombrados anteriormente ya que las realizaciones de la presente invención pueden ser empleados en una gran variedad de dispositivos electrónicos. The term "electronic device" is used in the present text to refer to any type of mobile or fixed electronic device, such as a mobile phone, a tablet, a PDA (of English, Personal Digital Assistants, personal digital assistants), MP-player. 3, digital cameras or smart televisions among others. The present invention is not limited to the devices named above since the embodiments of the present invention They can be used in a wide variety of electronic devices.

Los dispositivos electrónicos pueden estar adaptados para acceder a nodos (por ejemplo servidores) a través de una red de comunicación (móvil o fija) para obtener información de actualización para cambiar el software que tiene almacenado en sus unidades de memoria. The electronic devices can be adapted to access nodes (for example servers) through a communication network (mobile or fixed) to obtain update information to change the software stored in their memory units.

La información de actualización puede comprender información que modifica, cambia o corrige el firmware del dispositivo o cualquier otro componente software almacenado en el dispositivo electrónico. En una realización esta información de actualización puede ser un conjunto de instrucciones ejecutable que puede servir para añadir nuevos servicios al dispositivo electrónico (bajo petición del usuario, del proveedor del servicio o del fabricante del dispositivo) y/o para mejorar o corregir errores en alguna función ya existente del dispositivo electrónico. The update information may comprise information that modifies, changes or corrects the firmware of the device or any other software component stored in the electronic device. In one embodiment this update information can be an executable set of instructions that can be used to add new services to the electronic device (at the request of the user, the service provider or the device manufacturer) and / or to improve or correct errors in some existing function of the electronic device.

La presente invención propone un método y dispositivo para actualizar de forma segura, rápida eficaz software (por ejemplo firmware) en un dispositivo electrónico. The present invention proposes a method and device for safely, rapidly updating software (eg firmware) in an electronic device.

En una realización de la presente invención, dicho dispositivo electrónico incluye al menos un procesador o CPU (del inglés Computer Processing Unit), al menos una primera unidad de memoria (o un grupo de primeras unidades de memoria) y una segunda unidad de memoria (o un grupo de segundas unidades de memoria). El dispositivo electrónico también puede constar de un ¡nterfaz de comunicaciones que le permite acceder a una red de comunicaciones para enviar y recibir información. In an embodiment of the present invention, said electronic device includes at least one processor or CPU (from the English Computer Processing Unit), at least one first memory unit (or a group of first memory units) and a second memory unit ( or a group of second memory units). The electronic device may also consist of a communications interface that allows you to access a communications network to send and receive information.

En una realización, las primeras unidades de memoria son del tipo no volátil (por ejemplo, una memoria flash) y, las segundas son del tipo volátil (por ejemplo, una memoria RAM). In one embodiment, the first memory units are of the nonvolatile type (e.g., a flash memory) and the second are of the volatile type (e.g., a RAM).

Estas unidades de memoria pueden estar conectadas mediante un bus de comunicación con el resto de unidades del dispositivo. These memory units can be connected via a communication bus with the rest of the units of the device.

En una realización, el firmware a actualizar está almacenado en una o varias de las primeras unidades de memoria (memoria de tipo flash). En realizaciones alternativas, el firmware a actualizar puede estar almacenado en una o varias de las segundas unidades de memoria o parte en una o varias de las primeras unidades de memoria y parte en una o varias de las segundas unidades de memoria. De acuerdo con la presente invención, se debe conocer la posición de cada elemento del firmware en las unidades de memoria por lo que se debe colocar cuidadosamente cada función del firmware en una posición de memoria conocida (o partir de las posiciones por defecto) para poder generar una tabla de direcciones que identifique la ubicación en la memoria de cada función. Para ello, por ejemplo, se puede separar cada objeto (funciones, datos...) durante el linkado del firmware en una sección independiente para cada objeto. Esto ayudará a identificar cada objeto más fácilmente. In one embodiment, the firmware to be updated is stored in one or more of the first memory units (flash type memory). In alternative embodiments, the firmware to be updated may be stored in one or more of the second memory units or part in one or more of the first memory units and part in one or more of the second memory units. According to the present invention, the position of each firmware element in the memory units must be known, so each firmware function must be carefully placed in a known memory location (or from the default positions) in order to be able to generate an address table that identifies the location in the memory of each function. For this, for example, you can separate each object (functions, data ...) during the linking of the firmware in a separate section for each object. This will help to identify each object more easily.

Una de las características en las que se basa la invención es en la reescritura de las funciones actualizadas en los espacios libres de la memoria no volátil (memoria flash). Gracias a esto, evitamos los problemas de desplazamiento del código y únicamente cambiarán de posición las funciones actualizadas mientras que las funciones no actualizadas permanecerán en la misma posición de memoria que tenían antes de la actualización. One of the characteristics on which the invention is based is in the rewriting of the functions updated in the free spaces of the non-volatile memory (flash memory). Thanks to this, we avoid the problems of code displacement and will only change the position of the updated functions while the non-updated functions will remain in the same memory position they had before the update.

Un ejemplo de este proceso se puede observar en la Figura 1 , donde se muestra a la izquierda un mapa de la memoria original (antes de la actualización) y a la derecha un mapa de la memoria después de la actualización. En el caso ilustrado en la Figura 1 , la función que va a ser actualizada es la función 1. Esta función 1 actualizada puede haber sido recibida por el dispositivo electrónico de un servidor a través de la red de comunicaciones (por ejemplo, una red de telefonía móvil) a la que el dispositivo electrónico está conectado. An example of this process can be seen in Figure 1, where a map of the original memory is shown on the left (before the update) and on the right a map of the memory after the update. In the illustrated case in Figure 1, the function to be updated is function 1. This updated function 1 may have been received by the electronic device of a server through the communication network (for example, a mobile telephone network) to the one that the electronic device is connected to.

Dicha función 1 actualizada es copiada al principio del espacio libre (que puede estar por ejemplo al final del firmware actual). Gracias a esto, como se puede observar en la memoria de la derecha de la figura 1 , ninguna dirección de las otras funciones (las no actualizadas) se ve alterada, ya que no les afecta el problema del desplazamiento. This updated function 1 is copied at the beginning of the free space (which may be, for example, at the end of the current firmware). Thanks to this, as can be seen in the memory on the right of figure 1, no address of the other functions (the non-updated ones) is altered, since the displacement problem does not affect them.

Esta nueva función será copiada por el dispositivo en la dirección que se le diga (por ejemplo el usuario lo puede decidir) mediante la actualización. La actualización mandada al dispositivo contiene información sobre la dirección donde cada parte del código nuevo debe ser copiada. Este proceso de copiar lo realiza el propio dispositivo (el procesador) en el espacio que el usuario le ha indicado al generar la actualización. This new function will be copied by the device in the address that is told (for example the user can decide) by updating. The update sent to the device contains information about the address where each part of the new code should be copied. This process of copying is done by the device itself (the processor) in the space that the user indicated when generating the update.

Para escribir esta nueva función no será necesario borrar la anterior función y las llamadas de otras funciones a dicha función actualizada se podrán hacer sin errores, ya que el acceso se hará a través de una tabla de direcciones. La técnica de la tabla de direcciones permite un direccionamiento correcto a una función independientemente de la posición real de las instrucciones (código) que constituyen dicha función en la memoria). Un ejemplo de este acceso por tabla de direcciones se muestra en la figura 2. To write this new function it will not be necessary to delete the previous function and the calls of other functions to said updated function can be done without errors, since the access will be done through a table of addresses. The technique of the address table allows correct addressing to a function independently of the actual position of the instructions (code) that constitute that function in the memory). An example of this access by address table is shown in Figure 2.

En esta figura se muestra un ejemplo en el que la función 1 necesita saltar (también conocido por "llamar", en inglés "cali") a la función 3 (es decir, una de las acciones de la función 1 es llevar a cabo la función 3 o en otras palabras, una de las instrucciones de la función 1 es realizar las instrucciones de la función 3). Este salto o llamada se realiza a través de esta tabla intermedia de direcciones. Como se ve en la figura 3, en esta tabla se almacena para cada función almacenada en memoria, la posición de esa función (también llamada la dirección) en la memoria. Entonces, la función que quiere llamar a otra función (en el caso de la figura, la función 1 ), en vez de indicar la posición real en la memoria (la dirección) de la función a la que está llamando (en este caso la función 3) lo que hace es indicar la posición de la tabla correspondiente a dicha función. Al ejecutarse la función 1 , en vez de ir directamente a la posición de la función 3, se irá a la posición de la tabla indicada por la función 1 , se obtendrá la dirección de la función 3 y se hará un salto a esta dirección (la de la función 3), tal como se muestra en la figura 2. This figure shows an example in which function 1 needs to jump (also known as "call", in English "cali") to function 3 (that is, one of the actions of function 1 is to carry out the function 3 or in other words, one of the instructions of function 1 is to perform the instructions of function 3). This jump or call is made through this intermediate address table. As seen in Figure 3, in this table is stored for each function stored in memory, the position of that function (also called the address) in memory. Then, the function that wants to call another function (in the case of the figure, function 1), instead of indicating the actual position in the memory (the address) of the function it is calling (in this case the function 3) what it does is indicate the position of the table corresponding to said function. When executing function 1, instead of going directly to the position of function 3, it will go to the position of the table indicated by function 1, the address of function 3 will be obtained and a jump will be made to this address ( that of function 3), as shown in figure 2.

Por lo tanto, ante una actualización de la manera propuesta anteriormente, no será necesario el cambio de direcciones de las funciones que llamen a la función actualizada, sino que únicamente con modificar la entrada de la tabla para que apunten a la nueva dirección es suficiente. Therefore, before an update in the manner proposed above, it will not be necessary to change the addresses of the functions that call the updated function, but only to modify the entry of the table so that they point to the new address is sufficient.

Cuando se actualiza una función y, por lo tanto, tal como se ve en la figura 1 , cambia la posición en memoria de una función, habría que cambiar la entrada en la tabla para esa función y poner la nueva dirección de dicha función. Pero si el proceso se hiciera así, llegaríamos al mismo problema descrito anteriormente: que una actualización de una función supondría borrar y reescribir la tabla en flash nuevamente. When a function is updated and, therefore, as shown in Figure 1, the memory position of a function changes, the entry in the table for that function would have to be changed and the new address of said function should be set. But if the process were done this way, we would arrive at the same problem described above: that an update of a function would suppose to delete and rewrite the table in flash again.

Para evitar este borrado, lo que se propone es no actualizar la misma entrada de la tabla, sino que se invalida y se añade una nueva entrada al igual que se hace cuando se actualiza una función (tal como se ha mostrado en la figura 1 ). Para que esto se pueda hacer con mayor facilidad y eficacia, se usará una segunda tabla en una segunda unidad de memoria de tipo RAM, la cual tiene un acceso de lectura y escritura mucho más rápido (es decir, el tiempo de acceso a memoria es mucho menor en la memoria RAM) y por lo tanto un consumo menor, además de que se puede borrar y reescribir tantas veces como se desee sin afectar significativamente a la vida útil de la memoria. To avoid this deletion, what is proposed is not to update the same entry in the table, but it is invalidated and a new entry is added just as it is done when a function is updated (as shown in figure 1) . For this to be done more easily and effectively, a second table will be used in a second RAM-type memory unit, which has an access reading and writing much faster (that is, the memory access time is much shorter in RAM) and therefore a lower consumption, besides that it can be erased and rewritten as many times as desired without significantly affecting the useful life of memory.

Para ello, al iniciar la carga del firmware (cuando el dispositivo se arranca, se reinicia o se actualiza) se copiará la tabla en la RAM procesándola para eliminar las entradas antiguas y dejando únicamente las entradas válidas, ya que cuando el dispositivo se apaga la RAM se borra, por lo que es necesario volver a copiar la tabla a RAM. Además, cada vez que se hace una nueva actualización hay que renovar las entradas nuevas en la memoria RAM para que empiece a funcionar el firmware actualizado. To do this, when starting the firmware load (when the device is booted, restarted or updated) the table will be copied into the RAM, processing it to eliminate the old entries and leaving only the valid entries, since when the device is turned off the RAM is deleted, so it is necessary to re-copy the table to RAM. In addition, each time a new update is made, the new entries in the RAM memory must be renewed in order for the updated firmware to start functioning.

En la figura 3 se muestra un ejemplo, del proceso propuesto. Como se puede apreciar tras introducir la actualización, se mantiene una tabla de direcciones en la primera unidad de memoria (memoria flash). En el ejemplo de la figura, la actualización ha consistido en la introducción de una nueva función 2, esta actualización ha hecho que su posición en la memoria flash cambie (de estar en la Dirección 2 a estar en la Dirección 4) y por lo tanto, la tabla donde aparece su dirección en la memoria se tenga que modificar. Lo que se hace es eliminar la referencia vieja de esta función de la tabla de direcciones y la posterior inclusión de una nueva entrada al final de la tabla con la nueva referencia. Gracias a esto únicamente se ha tenido que añadir nueva información en la memoria flash sin necesidad de un borrado de esta. Una vez que se ha hecho esto, la actualización esta completa y lo único que falta es que esta nueva tabla se pase a la segunda unidad de memoria (memoria RAM) con un procesado que elimine las entradas viejas (en este caso la de la función 2) y escribir únicamente las direcciones actualizadas sin variar la posición de cada función en esta segunda tabla. Con este proceso, en esta segunda tabla, la dirección de cada función será la correcta aún después de una actualización de la función y su posición dentro de la tabla no variará, por lo que las llamadas a una función siempre apuntarán a esa posición en la tabla y no hará falta cambiar estas llamadas aunque se actualice la función y por lo tanto cambie la ubicación de la función en la memoria flash. Figure 3 shows an example of the proposed process. As you can see after entering the update, an address table is kept in the first memory unit (flash memory). In the example of the figure, the update has consisted of the introduction of a new function 2, this update has caused its position in the flash memory to change (from being in Direction 2 to being in Direction 4) and therefore , the table where your address appears in the memory must be modified. What is done is to remove the old reference of this function from the address table and the subsequent inclusion of a new entry at the end of the table with the new reference. Thanks to this, it has only been necessary to add new information in the flash memory without needing to erase it. Once this has been done, the update is complete and the only thing missing is that this new table is passed to the second memory unit (RAM) with a process that removes the old entries (in this case, the function) 2) and write only the updated addresses without changing the position of each function in this second table. With this process, in this second table, the address of each function will be correct even after an update of the function and its position within the table will not change, so calls to a function will always point to that position in the table and you will not need to change these calls even if the function is updated and therefore change the location of the function in the flash memory.

Por supuesto, las llamadas a una función no se harán a través de la primera tabla (la que está en la memoria flash) sino a esta segunda tabla almacenada en la memoria RAM. Of course, calls to a function will not be made through the first table (the one in the flash memory) but to this second table stored in RAM.

En una realización, para realizar la actualización, se generará un fichero de actualización (script) que se obtendrá de la diferencia entre el nuevo firmware que se quiere instalar en el dispositivo electrónico y el firmware que está almacenado en ese momento en el dispositivo. Este fichero de actualización puede ser generado por el mismo servidor en el que está almacenado el nuevo firmware o en otro nodo de la red de comunicaciones. In an embodiment, in order to perform the update, an update file (script) will be generated that will be obtained from the difference between the new firmware that is to be installed in the electronic device and the firmware that is stored at that moment in the device. This update file can be generated by the same server in which the new firmware is stored or in another node of the communications network.

Este fichero de actualización generado con las diferencias entre el código del nuevo firmware y el del viejo, será la actualización que se transmita a través de la red de comunicaciones. This update file generated with the differences between the code of the new firmware and that of the old one, will be the update that is transmitted through the communications network.

Para que el fichero de actualización sea generado con el menor tamaño posible y para que se conozca fácilmente y sin error la posición de cada elemento del firmware en memoria hay que ordenar correctamente las partes del código del firmware. In order for the update file to be generated with the smallest possible size and for the position of each firmware element in memory to be easily and without error known, the parts of the firmware code must be ordered correctly.

Para una correcta ordenación de objetos del firmware, una opción es separar los objetos (funciones, variables...) durante el linkado del firmware en una sección diferente cada una. En una realización estas secciones serían Sistema Operativo, drivers y aplicaciones. Esta separación es una propuesta de ejemplo que facilita la correcta comprensión de la técnica que se va a describir a continuación, pero la separación puede realizarse de otras maneras que el diseñador del firmware vea conveniente y que son conocidas en el estado de la técnica. Se podría incluso no separar las partes, ya que no es necesario para el correcto funcionamiento de la presente invención. For a correct ordering of firmware objects, one option is to separate the objects (functions, variables ...) during the linking of the firmware in a different section each. In one embodiment these sections would be Operating System, drivers and applications. This separation is a proposal of example that facilitates the correct understanding of the technique that is going to be described next, but the Separation can be done in other ways that the firmware designer sees fit and that are known in the state of the art. One could even not separate the parts, since it is not necessary for the correct operation of the present invention.

En una realización, se introducirá un espacio libre entre cada sección del firmware almacenado en la memoria del dispositivo. Cuanto mayor sea el tamaño libre de la memoria flash, mejor ya que se tendrá más espacio para actualizar las funciones sin tener que borrar y reescribir la memoria flash. In one embodiment, a free space will be introduced between each section of the firmware stored in the memory of the device. The larger the free size of the flash memory, the better as you will have more space to update the functions without having to erase and rewrite the flash memory.

La tabla de direcciones puede ser más compleja de lo descrito en los ejemplos presentados hasta ahora. En una realización, esta primera tabla de direcciones (la que está guardada en la memoria flash) tendrá al menos tres campos, para cada objeto (por ejemplo una función) el primero indicará la posición del objeto en memoria (la dirección del objeto en la memoria), el segundo indicará si la entrada en la tabla es válida o ha sido actualizada y el tercero guardara el índice en la segunda tabla (la tabla almacenada en la memoria RAM) al que hace referencia (para no perder referencias durante la actualización, ya que la posición en la tabla RAM no debe ser alterada ya que ayuda a ser más eficientes al hacer una búsqueda directa (acceso posicional) en la tabla RAM de la dirección. The address table can be more complex than described in the examples presented so far. In an embodiment, this first address table (the one stored in the flash memory) will have at least three fields, for each object (for example a function) the first one will indicate the position of the object in memory (the address of the object in the memory), the second will indicate if the entry in the table is valid or has been updated and the third party will keep the index in the second table (the table stored in the RAM) to which it refers (to avoid losing references during the update, since the position in the RAM table should not be altered since it helps to be more efficient when doing a direct search (positional access) in the RAM table of the address.

Para el segundo campo por ejemplo, se puede elegir un valor de manera que si tiene ese valor (en la figura 4 FFF..FF), la entrada será válida y si tiene otro valor pues será una indicación de que la entrada no es válida. Opcionalmente este segundo campo no sólo indicará si la entrada es válida o no, si no que en el caso de ser inválida indicará la nueva posición en la tabla para dicha función (ver figura 4). For the second field for example, you can choose a value so that if it has that value (in Figure 4 FFF..FF), the entry will be valid and if it has another value it will be an indication that the entry is not valid . Optionally this second field will not only indicate if the entry is valid or not, but in the case of being invalid it will indicate the new position in the table for said function (see figure 4).

En caso de que la tabla sea actualizada con una nueva referencia, esta se añadirá en la última posición de la tabla, y la anterior entrada a la tabla se indicará como invalida marcando la nueva posición de la referencia en la tabla. Esto se puede ver en la Figura 4, donde a la izquierda puede verse la tabla antes de la actualización y a la derecha, puede verse la tabla después de haber actualizado la función 2. Al haber actualizado la función 2, su dirección cambiará por lo que se ha puesto su entrada inicial a invalida (poniendo una nueva posición en el segundo campo de posición actual y se crea una nueva entrada en la tabla (en la posición X+1 ) con la nueva dirección. In case the table is updated with a new reference, it is will add in the last position of the table, and the previous entry to the table will be indicated as invalid by marking the new position of the reference in the table. This can be seen in Figure 4, where on the left the table can be seen before the update and on the right, the table can be seen after having updated function 2. Having updated function 2, its address will change so that its initial entry has been set to invalid (placing a new position in the second current position field and a new entry is created in the table (in position X + 1) with the new address.

Esta adición de una nueva entrada a la tabla no implica el borrado de memoria flash ya que escribe sobre posiciones "limpias" todo el rato. Hasta ahora esta tabla es almacenada en Flash, para que los cambios sea persistentes, pero ahora entraría el proceso de pasar esta tabla a la segunda unidad de memoria (la memoria RAM), para lo cual un proceso se encargará de ir leyendo la tabla y eliminar las entradas inválidas, quedando en RAM únicamente las entradas válidas. Estas acciones las realiza el procesador del dispositivo cuando le llega una actualización. This addition of a new entry to the table does not imply the erasure of flash memory since it writes about "clean" positions all the time. Until now this table is stored in Flash, so that the changes are persistent, but now it would enter the process of passing this table to the second memory unit (RAM), for which a process will be responsible for reading the table and eliminate invalid entries, leaving only valid entries in RAM. These actions are performed by the device's processor when an update arrives.

Esto reduce el tamaño de memoria RAM utilizado (al solo almacenar las entradas validas). En la Figura 5 se muestra la tabla guardada en la memoria flash después de la actualización (a la izquierda) y la tabla almacenada en la memoria RAM. Se puede apreciar como la tabla almacenada en memoria RAM es mínima, ya que solo contendrá las direcciones de memoria en donde se encuentra cada función, ya que el identificador de cada función puede incluso ser su posición en la tabla. (En una realización, cada función tiene un identificador numérico único que es su posición en la tabla de la memoria RAM). This reduces the size of RAM used (by only storing valid entries). Figure 5 shows the table saved in the flash memory after the update (on the left) and the table stored in the RAM memory. You can see how the table stored in RAM is minimal, since it will only contain the memory addresses where each function is located, since the identifier of each function can even be its position in the table. (In one embodiment, each function has a unique numeric identifier which is its position in the RAM table).

Además de estos campos especificados, es opcional añadir un campo de versión de firmware que permita retrasar versiones de firmware sin tener que actualizar nada o ayudar a recuperar el sistema de actualizaciones fallidas. Para ello se seguiría un proceso similar al utilizado, añadiendo un nuevo campo en la tabla de memoria Flash indicando en que versión se añadió esa entrada, y en caso de que sea necesario hacer una desactualización, el proceso de copia de la tabla de memoria Flash a RAM se encargará de omitir las entradas superiores a esa versión y quedándose con las antiguas. In addition to these specified fields, it is optional to add a firmware version field that allows to delay firmware versions without having to update nothing or help recover the system of failed updates. For this a process similar to the one used would be followed, adding a new field in the Flash memory table indicating in which version that entry was added, and in case it is necessary to make an outdated, the process of copying the Flash memory table RAM will be responsible for omitting entries higher than that version and keeping the old ones.

En resumen, gracias a la invención propuesta, para cada actualización solo será necesaria el envío de la nueva función (o funciones) actualizada (s), añadiéndola en un hueco sin escribir de la primera memoria (flash) como por ejemplo al final, añadir la nueva dirección en la entrada de la tabla en la primera memoria y actualizar la tabla en la segunda memoria RAM a partir de esta primera tabla (eliminando las entradas inválidas y quedándose en RAM únicamente las entradas válidas). In summary, thanks to the proposed invention, for each update it will only be necessary to send the new updated function (or functions), adding it in an empty space of the first memory (flash), for example at the end, add the new address in the entry of the table in the first memory and update the table in the second RAM from this first table (eliminating the invalid entries and remaining in RAM only the valid entries).

Un diagrama completo de una realización de la presente invención toda esta técnica es mostrado en la Figura 6, desde la comparación de los dos firmwares hasta la ejecución del firmware actualizado. A complete diagram of an embodiment of the present invention all this technique is shown in Figure 6, from the comparison of the two firmwares to the execution of the updated firmware.

El primer paso que se muestra es la comparación (603) de los dos firmwares (el actual 601 y el nuevo 602) para identificar los objetos (por ejemplo, funciones o variables) que son modificados con el nuevo firmware y generar una actualización con estos nuevos objetos. Una vez que se identifican dicha actualización, se envía al dispositivo electrónico (por ejemplo, mediante una red de comunicación) (604). El nuevo firmware puede ser suministrado por los propios fabricantes del dispositivo electrónico, de operadores de telecomunicación o de terceras partes y el nodo que compara estos firmwares, genera el fichero de actualización y lo envía al dispositivo electrónico, puede ser un servidor perteneciente al suministrador del firmware o un servidor externo al suministrador del firmware. El dispositivo almacena estos nuevos objetos en los huecos que no estén escritos de la memoria flash (605) y añade la dirección nueva en la memoria (o direcciones si son varios objetos los actualizados) del objeto, creando una nueva entrada en la tabla de la memoria flash (606). Una vez realizado esto podemos decir que el sistema estaría actualizado. Solo quedaría pasar la tabla de direcciones a la memoria RAM eliminando las entradas antiguas (no válidas) 607 para poder ejecutar el código (608) sin errores en las direcciones. The first step shown is the comparison (603) of the two firmwares (the current 601 and the new 602) to identify the objects (for example, functions or variables) that are modified with the new firmware and generate an update with these new objects Once said update is identified, it is sent to the electronic device (for example, by means of a communication network) (604). The new firmware can be supplied by the manufacturers of the electronic device, telecommunication operators or third parties and the node that compares these firmwares, generates the update file and sends it to the electronic device, it can be a server belonging to the supplier of the firmware or a server external to the firmware provider. The device stores these new objects in the holes that are not written in the flash memory (605) and adds the new address in the memory (or addresses if several objects are updated) of the object, creating a new entry in the table of the flash memory (606). Once this is done we can say that the system would be updated. It would only be possible to pass the address table to the RAM by deleting the old (invalid) entries 607 in order to execute the code (608) without errors in the addresses.

Con la técnica de actualización de datos descrita en la presente invención, se consigue que las actualizaciones se realicen de manera simple, rápida y eficiente, con bajo consumo de energía y minimizando el número de borrados de la unidad de memoria no volátil, por lo que, por todas estas características, se aumenta la vida útil del dispositivo electrónico. With the data update technique described in the present invention, the updates are achieved in a simple, fast and efficient way, with low power consumption and minimizing the number of deletions of the non-volatile memory unit, so that , for all these characteristics, the useful life of the electronic device is increased.

Aunque muchas de las realizaciones expuestas de la presente invención se refieran a la actualización del firmware, la aplicación de la presente invención no está limitada a la actualización del firmware sino que puede aplicarse a la actualización de cualesquiera datos almacenado en el dispositivo electrónico. Although many of the disclosed embodiments of the present invention relate to updating the firmware, the application of the present invention is not limited to updating the firmware but can be applied to the updating of any data stored in the electronic device.

Aunque muchas de las realizaciones expuestas de la presente invención se refieran a memorias tipo flash y RAM, la aplicación de la presente invención no está limitada a este tipo de memorias sino que puede aplicarse a una gran variedad de tipos de memoria. Although many of the disclosed embodiments of the present invention relate to flash type memories and RAM, the application of the present invention is not limited to this type of memories but can be applied to a wide variety of memory types.

Algunas realizaciones preferidas de la invención se describen en las reivindicaciones que se incluyen seguidamente. Some preferred embodiments of the invention are described in the following claims.

En este texto, la palabra "comprende" y sus variantes (como "comprendiendo", etc.) no deben interpretarse de forma excluyente, es decir, no excluyen la posibilidad de que lo descrito incluya otros elementos, pasos, etc. Descrita suficientemente la naturaleza de la invención, así como la manera de realizarse en la práctica, hay que hacer constar la posibilidad de que sus diferentes partes podrán fabricarse en variedad de materiales, tamaños y formas, pudiendo igualmente introducirse en su constitución o procedimiento, aquellas variaciones que la práctica aconseje, siempre y cuando las mismas, no alteren el principio fundamental de la presente invención. In this text, the word "comprises" and its variants (such as "understanding", etc.) must not be interpreted in an exclusive manner, that is, they do not exclude the possibility that what is described includes other elements, steps, etc. Having sufficiently described the nature of the invention, as well as the manner in which it is carried out in practice, it is necessary to state the possibility that its different parts may be manufactured in a variety of materials, sizes and shapes, and it may also be introduced in its constitution or procedure, those variations that the practice advises, as long as they do not alter the fundamental principle of the present invention.

La descripción y los dibujos simplemente ilustran los principios de la invención. Por lo tanto, debe apreciarse que los expertos en la técnica podrán concebir varias disposiciones que, aunque no se hayan descrito o mostrado explícitamente en este documento, representan los principios de la invención y están incluidas dentro de su alcance. Además, todos los ejemplos descritos en este documento se proporcionan principalmente por motivos pedagógicos para ayudar al lector a entender los principios de la invención y los conceptos aportados por el (los) inventor(es) para mejorar la técnica, y deben considerarse como no limitativos con respecto a tales ejemplos y condiciones descritos de manera específica. Además, todo lo expuesto en este documento relacionado con los principios, aspectos y realizaciones de la invención, así como los ejemplos específicos de los mismos, abarcan equivalencias de los mismos. The description and the drawings simply illustrate the principles of the invention. Therefore, it should be appreciated that those skilled in the art will be able to devise various provisions which, although not explicitly described or shown in this document, represent the principles of the invention and are included within its scope. In addition, all the examples described in this document are provided primarily for pedagogical reasons to help the reader understand the principles of the invention and the concepts contributed by the inventor (s) to improve the technique, and should be considered as non-limiting. with respect to such examples and conditions described specifically. In addition, everything set forth in this document related to the principles, aspects and embodiments of the invention, as well as the specific examples thereof, encompass equivalences thereof.

Aunque la presente invención se ha descrito con referencia a realizaciones específicas, los expertos en la técnica deben entender que los anteriores y diversos otros cambios, omisiones y adiciones en la forma y el detalle de las mismas pueden realizarse sin apartarse del espíritu y del alcance de la invención tal como se definen mediante las siguientes reivindicaciones. Although the present invention has been described with reference to specific embodiments, those skilled in the art should understand that the foregoing and various other changes, omissions and additions in the form and detail thereof may be made without departing from the spirit and scope of the invention. the invention as defined by the following claims.

Claims

R E I V I N D I C A C I O N E S 1 . Método para la actualización eficiente de datos en un dispositivo electrónico conectado a una red de comunicaciones, donde el dispositivo electrónico consta de al menos una primera unidad de memoria de tipo no volátil y una segunda unidad de memoria de tipo volátil y de un procesador, donde en las unidades de memoria se encuentran almacenados conjuntos de datos, donde en la primera unidad de memoria se encuentra almacenada una primera tabla con al menos una entrada para cada conjunto de datos con un campo de posición que indica una posición en una de las unidades de memoria de dicho conjunto de datos y un campo de validez que indica de si dicha entrada es válida o no, donde el método comprende las siguientes etapas: a) Recibir a través de la red de comunicaciones, un fichero de datos de actualización que incluye una nueva versión de al menos uno de los conjuntos de datos almacenados en las unidades de memoria b) Para cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización: b1 ) Almacenar dicha nueva versión del conjunto de datos en posiciones libres de una de las unidades de memoria b2) Añadir a la primera tabla una entrada para dicho conjunto de datos indicando en el campo de posición la posición en la unidad de memoria donde se ha almacenado la nueva versión de dicho conjunto de datos e indicando en el campo de validez que dicha entrada es válida y en el resto de entradas de dicha tabla para dicho conjunto de datos indicar en el campo de validez que no son válidas c) Basándose en la información que hay en la primera tabla, actualizar una segunda tabla almacenada en la segunda unidad de memoria con una entrada para cada conjunto de datos, donde para cada conjunto de datos, indica su posición válida en una de las unidades de memoria. one . Method for efficiently updating data in an electronic device connected to a communication network, where the electronic device consists of at least one first non-volatile memory unit and a second volatile-type memory unit and a processor, where data sets are stored in the memory units, where in the first memory unit a first table with at least one entry is stored for each data set with a position field indicating a position in one of the units of data. memory of said data set and a validity field indicating whether said entry is valid or not, where the method comprises the following steps: a) Receive through the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units b) For each data set from which a new version is included tion in the update file: b1) Store this new version of the data set in free positions of one of the memory units b2) Add to the first table an entry for said data set indicating in the position field the position in the memory unit where the new version of said data set has been stored and indicating in the validity field that said entry is valid and in the rest of entries of said table for said data set indicate in the validity field that no They are valid c) Based on the information in the first table, update a second table stored in the second memory unit with an entry for each data set, where for each data set, it indicates its valid position in one of the units of data. memory. 2. Método según cualquiera de las reivindicaciones anteriores donde la primera unidad de memoria es de tipo flash y la segunda unidad de memoria es de tipo RAM. Method according to any one of the preceding claims wherein the first memory unit is of the flash type and the second memory unit is of the RAM type. 3. Método según cualquiera de las reivindicaciones anteriores donde dichos conjuntos de datos forman parte del firmware del dispositivo. Method according to any of the preceding claims wherein said data sets form part of the firmware of the device. 4. Método según cualquiera de las reivindicaciones anteriores donde el fichero de datos de actualización es enviado por un servidor al dispositivo electrónico a través de la red de comunicaciones. Method according to any of the preceding claims wherein the update data file is sent by a server to the electronic device through the communication network. 5. Método según cualquiera de las reivindicaciones anteriores donde previamente al paso a), se produce una comparación de una nueva versión de los conjuntos de datos con los conjuntos de datos almacenados en el dispositivo y de dicha comparación se obtiene el fichero de datos de actualización. Method according to any of the previous claims, where previously to step a), a comparison of a new version of the data sets with the data sets stored in the device is produced and from said comparison the update data file is obtained . 6. Método según cualquiera de las reivindicaciones anteriores donde dichos conjuntos de datos son objetos de datos que pueden ser funciones, variables o cualquier otro tipo de objetos de datos. Method according to any one of the preceding claims wherein said data sets are data objects that can be functions, variables or any other type of data objects. 7. Método según cualquiera de las reivindicaciones anteriores donde dicho segundo campo no sólo indica si la entrada es válida o no, si no que en el caso de ser no válida indicará una nueva posición en la tabla para dicho conjunto de datos. Method according to any of the preceding claims wherein said second field not only indicates whether the entry is valid or not, but that in the case of being invalid it will indicate a new position in the table for said set of data. 8. Método según cualquiera de las reivindicaciones anteriores donde en la primera tabla existe un campo para cada entrada indicando el número de versión del conjunto de datos al que pertenece dicha entrada. Method according to any of the preceding claims wherein in the first table there is a field for each entry indicating the version number of the data set to which said entry belongs. 9. Método según cualquiera de las reivindicaciones anteriores donde en la primera tabla existe un campo para cada entrada indicando el índice de la segunda tabla al que hace referencia. 9. Method according to any of the preceding claims wherein in the first table there is a field for each entry indicating the index of the second table to which it refers. 10. Método según cualquiera de las reivindicaciones anteriores donde el dispositivo electrónico es un dispositivo electrónico sin Unidad de Gestión de Memoria MMU (del inglés Memory Management Unit). Method according to any of the preceding claims wherein the electronic device is an electronic device without Memory Management Unit (MMU). 11. Dispositivo electrónico para la actualización eficiente de datos, donde dicho dispositivo electrónico está conectado a una red de comunicaciones y comprende:11. Electronic device for the efficient update of data, where said electronic device is connected to a communications network and comprises: - al menos una primera unidad de memoria de tipo no volátil y una segunda unidad de memoria de tipo volátil que almacenan conjuntos de datos, donde la al menos una primera unidad de memoria de tipo no volátil almacena una primera tabla con al menos una entrada para cada conjunto de datos con un campo de posición que indica una posición de dicho conjunto de datos en una de las unidades de memoria y un campo de validez que indica de si dicha entrada es válida o no; y la al menos una segunda unidad de memoria de tipo volátil almacena una segunda tabla con una entrada para cada conjunto de datos que indica para cada conjunto de datos, la posición válida en una de las unidades de memoria de dicho conjunto de datos; - at least a first non-volatile type memory unit and a second volatile type memory unit that stores data sets, where the at least one first non-volatile memory unit stores a first table with at least one entry for each data set with a position field indicating a position of said data set in one of the memory units and a validity field indicating whether said entry is valid or not; and the at least one second volatile-type memory unit stores a second table with an entry for each data set indicating for each data set, the valid position in one of the memory units of said data set; - un receptor para a recibir través de la red de comunicaciones, un fichero de datos de actualización que incluye una nueva versión de al menos uno de los conjuntos de datos almacenados en las unidades de memoria; y - un procesador conectado al receptor y a las al menos primera y segunda unidades de memoria. - a receiver for receiving via the communications network, an update data file that includes a new version of at least one of the data sets stored in the memory units; Y - a processor connected to the receiver and to the at least first and second memory units. 12. Dispositivo electrónico según la reivindicación 11 donde el procesador contiene medios para analizar el fichero de actualización y, para cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización, almacenar la nueva versión del dicho un conjunto de datos en posiciones libres de una de las unidades de memoria, añadir a la primera tabla una entrada para dicho al menos un conjunto de datos indicando en el campo de posición la posición en la unidad de memoria donde se ha almacenado dicha nueva versión e indicar en el campo de validez que dicha entrada es válida y en el resto de entradas de dicha tabla para dicho conjunto de datos indicar en el campo de validez que dicha entrada no es válida y para, basándose en la información que hay en la primera tabla, actualizar la segunda tabla almacenada en la segunda unidad de memoria de manera que en la entrada que corresponde a cada conjunto de datos del que se incluye una nueva versión en el fichero de actualización, se indica la posición en la unidad de memoria donde se ha almacenado dicha nueva versión The electronic device according to claim 11, wherein the processor contains means for analyzing the update file and, for each data set from which a new version is included in the update file, storing the new version of the said data set in free positions of one of the memory units, add to the first table an entry for said at least one data set indicating in the position field the position in the memory unit where said new version has been stored and indicate in the field of validity that said entry is valid and in the rest of entries of said table for said data set indicate in the validity field that said entry is not valid and, based on the information in the first table, update the second table stored in the second memory unit so that in the entry corresponding to each data set of which a new version is included in the fich update, the position in the memory unit where the new version has been stored is indicated. 13. Dispositivo electrónico de acuerdo a cualquiera de las reivindicaciones anteriores 11 o 12 donde dicho dispositivo electrónico es un teléfono móvil, una tableta, una PDAs (del inglés, Personal Digital Assistants, Asistente digital personal), reproductor MP-3, cámara digital, una televisión inteligente, nodo de red inalámbrica o dispositivo similar. 13. Electronic device according to any of the preceding claims 11 or 12 wherein said electronic device is a mobile phone, a tablet, a PDAs (of English, Personal Digital Assistants, Personal Digital Assistant), MP-3 player, digital camera, an intelligent television, wireless network node or similar device. 14. Un producto de programa de ordenador que comprende instrucciones ejecutables por ordenador para realizar el procedimiento según cualquiera de las reivindicaciones 1 a 10, cuando el programa es ejecutado en un ordenador. 14. A computer program product comprising executable computer instructions for performing the method according to any of claims 1 to 10, when the program is executed on a computer. 15. Un medio de almacenamiento de datos digitales que codifica un programa de instrucciones ejecutable por máquina, para realizar un procedimiento según cualquiera de las reivindicaciones 1 a 10. 15. A digital data storage medium that encodes a program of instructions executable by machine, to perform a method according to any of claims 1 to 10.
PCT/ES2014/000050 2013-11-13 2014-03-27 Method and device for efficiently updating data in electronic devices Ceased WO2015071507A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
ES201301076A ES2481343B2 (en) 2013-11-13 2013-11-13 Method and device for updating data in electronic devices
ESP201301076 2013-11-13

Publications (1)

Publication Number Publication Date
WO2015071507A1 true WO2015071507A1 (en) 2015-05-21

Family

ID=51256990

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/ES2014/000050 Ceased WO2015071507A1 (en) 2013-11-13 2014-03-27 Method and device for efficiently updating data in electronic devices

Country Status (2)

Country Link
ES (1) ES2481343B2 (en)
WO (1) WO2015071507A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030084229A1 (en) * 2001-10-23 2003-05-01 Ho Tat N. Methods and apparatus for modifying programs stored in read only memory
US20050228959A1 (en) * 2004-04-08 2005-10-13 St Incard S.R.L. Method for patching ROM instructions in an electronic embedded system including at least a further memory portion

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030084229A1 (en) * 2001-10-23 2003-05-01 Ho Tat N. Methods and apparatus for modifying programs stored in read only memory
US20050228959A1 (en) * 2004-04-08 2005-10-13 St Incard S.R.L. Method for patching ROM instructions in an electronic embedded system including at least a further memory portion

Also Published As

Publication number Publication date
ES2481343R2 (en) 2015-06-09
ES2481343B2 (en) 2015-10-23
ES2481343A2 (en) 2014-08-05

Similar Documents

Publication Publication Date Title
Koshy et al. Remote incremental linking for energy-efficient reprogramming of sensor networks
KR100558631B1 (en) Method for fast wake-up of flash memory system
KR100584338B1 (en) Software update method and system
CN106708543B (en) OTA (over the air) upgrading method and device of operating system
US20070016719A1 (en) Memory device including nonvolatile memory and memory controller
US8775758B2 (en) Memory device and method for performing a write-abort-safe firmware update
US20140337593A1 (en) System and method for reading and writing data with a shared memory hash table
CN106155915B (en) Data storage processing method and device
ATE382892T1 (en) FLASH MEMORY DATA CORRECTION AND SCRUB TECHNIQUES
JP6013626B2 (en) Non-volatile memory writing mechanism
JP2005242897A (en) Flash disk drive
CN103440205A (en) Method and device for storing data of set top box
Shafi et al. No-reboot and zero-flash over-the-air programming for wireless sensor networks
US10417128B2 (en) Memory coherence in a multi-core, multi-level, heterogeneous computer architecture implementing hardware-managed and software managed caches
ES2664020T3 (en) A method of dynamic data protection during the execution of a software code in intermediate language on a digital device
US10430177B2 (en) Method for updating a package
ES2481343B2 (en) Method and device for updating data in electronic devices
CN107168719A (en) Application program running method and device, terminal and computer readable storage medium
US20190286447A1 (en) Information processing device
JP6575157B2 (en) Firmware download method and firmware embedded device
US20110099556A1 (en) Updating system for a microcontroller and associated methods
CN101339513B (en) Data updating method for basic input/output system
KR20150051813A (en) Apparatus and method for dynamically controlling security in a computing device with a plurality of security modules
Lehniger et al. Heuristic for page-based incremental reprogramming of wireless sensor nodes
JP5520880B2 (en) Flash memory device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14862255

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14862255

Country of ref document: EP

Kind code of ref document: A1