WO2019062703A1 - 升级方法、嵌入式系统 - Google Patents
升级方法、嵌入式系统 Download PDFInfo
- Publication number
- WO2019062703A1 WO2019062703A1 PCT/CN2018/107291 CN2018107291W WO2019062703A1 WO 2019062703 A1 WO2019062703 A1 WO 2019062703A1 CN 2018107291 W CN2018107291 W CN 2018107291W WO 2019062703 A1 WO2019062703 A1 WO 2019062703A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- upgrade
- application
- kernel
- executable file
- address
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/658—Incremental updates; Differential updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present invention relates to the field of the Internet, and in particular to an upgrade method and an embedded system.
- the upgraded application needs to be backed up, and the upgrade efficiency is greatly reduced.
- the server version is fragmented and it is difficult to maintain and manage the embedded system.
- the entire package will still be upgraded during the upgrade, which will slow down the upgrade process.
- the upgrade process will consume too much resources and cannot meet the space requirement of reducing the storage medium of the embedded device.
- the existing upgrade method for the above needs to provide a backup area for upgrading the firmware, resulting in waste of resources and low efficiency of upgrading, and no effective solution has been proposed yet.
- the embodiment of the present invention provides an upgrade method and an embedded system, so as to at least solve the technical problem that the existing upgrade mode needs to provide a backup area for the upgrade firmware, resulting in waste of resources and low upgrade efficiency.
- an upgrade method including: parsing a received upgrade packet to obtain an upgrade component type and an upgrade address; and if the upgrade component type is an application, obtaining an application upgrade package according to the upgrade address; Write the application upgrade package to the partition where the application is located.
- an embedded system includes: an application executable file and a kernel service executable file; wherein the kernel service executable file is provided with a unified external interface, and the application executable file This includes applications written according to the interface, which are programmed by calling the interface during the writing of the application.
- an apparatus for upgrading includes: a parsing module, configured to parse the received upgrade packet, to obtain an upgrade component type and an upgrade address, and an obtaining module, configured to upgrade the component type
- the application upgrade package is obtained according to the upgrade address; the write module is used to write the application upgrade package to the partition where the application is located.
- a computer terminal comprising: a processor; and a memory coupled to the processor for providing an instruction to the processor to process the following processing steps: parsing the received upgrade report If the upgrade component type is an application, obtain the application upgrade package according to the upgrade address; and write the application upgrade package to the partition where the application is located.
- a storage medium comprising a stored program, wherein the device in which the storage medium is located is controlled to execute the above-described upgrade method when the program is running.
- a processor for executing a program, wherein the program is executed to perform the above-described upgrade method.
- the application upgrade package is directly written into the partition where the application is located, and the upgraded component type and the upgrade address are obtained by parsing the received upgrade packet; if the upgrade component type is an application, according to the upgrade address, Obtain the application upgrade package; write the application upgrade package to the partition where the application is located, and achieve the purpose of completing the application upgrade without upgrading the firmware of the backup application, thereby achieving the technical effect of reducing the space requirement of the storage medium, thereby solving the existing
- the upgrade method requires a backup area for upgrading the firmware, resulting in technical problems of wasted resources and low upgrade efficiency.
- FIG. 1 is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- FIG. 2 is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- 3a is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- 3b is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- FIG. 4 is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- FIG. 5 is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- FIG. 6 is a flow chart showing the steps of an optional upgrade method according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of an upgrading apparatus according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of an embedded system according to an embodiment of the present invention.
- FIG. 9 is a schematic structural diagram of an optional embedded system according to an embodiment of the present invention.
- FIG. 10 is a spatial layout diagram of a multi-bin upgrade of an optional 0-Flash upgrade space according to an embodiment of the present invention
- FIG. 11 is a schematic diagram of an optional upgrade app bin according to an embodiment of the present invention.
- FIG. 12 is a schematic diagram of an optional upgrade kernel bin in accordance with an embodiment of the present invention.
- FIG. 13 is a schematic diagram of an optional upgrade kernel bin in accordance with an embodiment of the present invention.
- FIG. 14 is a block diagram showing the hardware structure of a computer terminal according to an embodiment of the present invention.
- FOTA Firmware Over-The-Air
- the over-the-air downloading software for mobile terminals refers to the firmware upgrade service for devices with networking functions through cloud upgrade technology. Users can use the network to get on-demand and easy.
- the extended method acquires the smart device system upgrade package, and performs cloud upgrade through FOTA to complete system repair and optimization.
- Kernel The most basic part of the operating system, part of the software used to provide secure access to the computer hardware for the application; the kernel involved in this application can be separated from the upgraded firmware of the embedded device. The kernel is used to provide the underlying functionality for the embedded operating system (OS).
- OS embedded operating system
- the application involved in this application may be an application separated by the upgrade firmware of the embedded device, and the App is a business code developed by the business party using the API provided by the kernel.
- API Application Programming Interface
- Boot Loader A bootloader for completing the load start task of the entire system in the embedded operating system. Before the operating system kernel runs, it can initialize the hardware device and establish a memory space map. The system's hardware and software environment can be brought to a suitable state in order to prepare the correct environment for the final call to the operating system kernel.
- URL Uniform Resource Locator
- Cyclic Redundancy Check refers to a commonly used error checking and verification algorithm in the field of data communication. It has the function of data transmission error detection. It performs polynomial calculation on data and the result is obtained. Attached to the frame, the receiving device also performs a similar algorithm to ensure the correctness and integrity of the data transmission.
- Message digest algorithm refers to an algorithm that softens an input of arbitrary length to produce a pseudo-random input with a fixed length.
- the main feature is that the encryption process does not require a key, and the encrypted data cannot be decrypted. Only the same plaintext data is input. The same ciphertext can be obtained after the same message digest algorithm.
- Binary files (bin) its use depends on the system or application, where bin is an abbreviation of the file format binary, an executable file with the suffix ".bin”, only indicates that the file is in binary format Does not indicate that it has an inevitable connection with an application.
- Multi-bin refers to the existing .bin file into a .bin file such as kernel bin, app bin, etc.
- An embodiment of an upgrade method is also provided in accordance with an embodiment of the present invention, and it should be noted that the steps illustrated in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer executable instructions, and The logical order is shown in the flowchart, but in some cases the steps shown or described may be performed in a different order than the ones described herein.
- the upgrade method provided in this embodiment can be used in the process of upgrading an embedded device by using an upgrade channel in the kernel, and the application upgrade package can be completed without backing up the application upgrade package in the backup partition. Upgrades or updates effectively reduce the space requirements for storage media in embedded devices.
- the storage capacity of the network or the storage medium of the embedded device is limited.
- the file size of the application upgrade package is usually required.
- ordinary upgrades need to occupy the same amount of storage space.
- the upgrade method usually used for application upgrades is mainly differential upgrade, for example, embedded system, RT-thread or Guangsheng.
- the differential upgrade mode can achieve a better compression effect, only need 5%-20% of the original upgrade firmware, you can complete the upgrade, greatly reducing the resource occupation, therefore, become the current manufacturers The preferred way to upgrade your device.
- the process of upgrading in the differential upgrade mode is to push the upgrade message to the server, and the device downloads the differential upgrade package. After the download is completed, the device enters the boot load state, and then replaces the differential package with the patch mode (only the difference portion is upgraded). There are firmware for upgrade purposes.
- the differential upgrade also requires a certain amount of backup area, and the differential upgrade package varies with the difference between the two versions. That is, the existing upgrade mode requires different backup areas and takes up a large upgrade space. Moreover, these backup areas are only upgraded in actual use, and there is a waste in some sense.
- a multi-bin upgrade without a flash upgrade space can be implemented, that is, the backup area can be reduced to 0, thereby reducing the cost of the IoT device.
- FIG. 1 is a flow chart showing the steps of an upgrade method in accordance with an embodiment of the present invention.
- step S101 the received upgrade packet is parsed to obtain an upgrade component type and an upgrade address.
- the execution entity may be an embedded device.
- the upgrade component is upgraded firmware
- the upgrade component type may be, but not limited to, an application and a kernel
- the upgrade address may be a URL address.
- the embedded device may parse the upgrade message in the upgrade message to obtain the upgrade component type and the address of the upgrade package. .
- the application may identify the upgrade component type by using a binary code format.
- the upgrade component type may be represented by “1”, and the upgrade may be represented by “0”.
- the component type is the kernel.
- the URL address can be stored in a storage medium (for example, a Nor-Flash medium) of the embedded device.
- a storage medium for example, a Nor-Flash medium
- Step S103 If the upgrade component type is an application, obtain an application upgrade package according to the upgrade address.
- the upgrade address may be: a URL address stored in the storage medium, where the URL address may be used to indicate an address of an application upgrade package.
- the foregoing upgrade package may be obtained by downloading, wherein the type of the upgrade package is set corresponding to the upgrade component type, and may be, but not limited to, a kernel upgrade package and an application upgrade package.
- the application upgrade package is downloaded according to the URL address.
- whether the application is determined according to the type of the upgrade component obtained by the parsing, if it is an application, restarting into the kernel state (that is, in the kernel), obtaining an application upgrade package according to the upgrade address.
- the system can be restarted and entered into the kernel state when it is determined that the upgrade component type in the embedded device is an application. Specifically, the upgrade channel of the application is pre-implanted in the kernel.
- step S105 the application upgrade package is written to the partition where the application is located.
- the application upgrade package may be directly written into the partition where the application is located to complete the application upgrade and update.
- the upgraded packet is parsed to obtain the upgrade component type and the upgraded address; if the upgrade component type is an application, the application upgrade package is obtained according to the upgrade address; Write to the partition where the application is located.
- the kernel code is relatively stable, generally does not need to be upgraded or updated, the application is mainly business logic code, and the update frequency is high, in order to meet the needs of the business party to frequently update the application
- the above-mentioned embodiment of the present application uses the method of directly writing the application upgrade package to the partition where the application is located, so that it can be directly implemented in the process of upgrading the embedded device without backing up the application upgrade package. Write the partition where the application is located to complete the upgrade and update of the application.
- the solution provided by the foregoing embodiment of the present application achieves the purpose of completing the application upgrade without backing up the application upgrade package, thereby achieving the technical effect of reducing the space requirement of the storage medium, thereby solving the problem that the existing upgrade mode needs to be upgraded.
- the firmware provides a backup area, which causes technical problems of wasted resources and low upgrade efficiency.
- step S105 that is, after writing the application upgrade package to the partition where the application is located, as shown in FIG. 2, the method further includes the following steps:
- Step S201 performing firmware integrity verification on the upgraded application by using a message digest algorithm
- step S203 if the verification is successful, the upgraded application is started, and the version information of the upgraded application is reported.
- the message digest algorithm may be a fifth version of the message digest algorithm, that is, the MD5 algorithm, which is a hash function widely used in the field of computer security to provide integrity protection of messages or data.
- the MD5 algorithm which is a hash function widely used in the field of computer security to provide integrity protection of messages or data.
- the firmware integrity of the upgraded application may be verified, and when the verification is successful, the upgraded version is started. Kernel and application, and report the upgraded kernel and application version information to complete the upgrade.
- the message digest algorithm described above may also be used to perform firmware integrity verification on the upgraded kernel.
- FIG. 3a is a flowchart of steps of an optional upgrade method according to an embodiment of the present invention. As shown in FIG. 3a, the foregoing upgrade method further includes the following steps:
- Step S301 if the upgrade component type is a kernel, download a kernel upgrade package according to the upgrade address;
- step S301 whether the application is determined according to the type of the upgrade component obtained by the parsing, and the upgrade package of the kernel to be upgraded is downloaded according to the URL address of the kernel firmware to be upgraded.
- Step S303 writing a kernel upgrade package to the kernel backup partition
- Step S305 restarting into the boot load state, copying the kernel upgrade package in the kernel backup partition to the partition where the kernel is located.
- the boot load state can be restarted and entered, and after the boot load state program is entered, the kernel upgrade package that has been backed up is Copy to the partition where the kernel is located.
- the kernel code is relatively stable, and generally does not need to be frequently upgraded and updated.
- the kernel firmware can be, but is not limited to, the backup kernel firmware. The implementation completes the upgrade and update of the kernel without increasing the resource burden of the embedded device.
- FIG. 3b is a flow chart of an optional upgrade method according to an embodiment of the present invention. As shown in FIG. 3b, the upgrade method further includes the following steps:
- step S302 if the upgrade component type is a kernel, the kernel upgrade package is downloaded according to the upgrade address.
- step S302 can be referred to the related description in step S301, and details are not described herein again.
- Step S304 writing the above kernel upgrade package to the partition where the application is located.
- both the kernel upgrade and the app upgrade can occupy the space of the app bin.
- step S302 to step S304 in a process in which the FOTA component in the kernel interacts with the remote server, if the upgrade component type is a kernel, the kernel bin is downloaded from the remote server, and the application is written. Partition, that is, overwrite the download address of the download kernel bin in the app bin location.
- Step S306 restarting to enter the boot loading state, and writing the kernel upgrade package in the partition where the application is located to the partition where the kernel is located.
- the Boot Loader checks the kernel bin, and the kernel bin is moved from the space where the app is located to the space where the kernel is located, and jumps. Go to the kernel; the kernel's FOTA component continues to upgrade the app bin. Optionally, you can still upgrade according to the previous app upgrade method to complete the kernel bin upgrade.
- the foregoing upgrade method further includes the following method steps:
- Step S401 performing integrity verification on the upgraded kernel by using a cyclic redundancy algorithm
- step S403 if the verification is successful, the upgraded kernel is started, and the version information of the upgraded kernel is reported.
- step S306 that is, after the kernel upgrade package in the partition where the application is located is written in the partition where the kernel is located, the foregoing step S401 to step S403 may be performed.
- step S401 to step S403 may be performed.
- the integrity of the upgrade may be verified according to the cyclic redundancy algorithm by using the verification firmware in the boot load described above. If the verification is successful, the download process is determined. No error or data loss, start the upgraded kernel, and report the version information of the upgraded kernel to complete the upgrade.
- FIG. 5 is a flow chart of steps of an optional upgrade method according to an embodiment of the present invention. As shown in FIG. 5, the upgrade is performed before the application upgrade package is obtained according to the upgrade address. The method also includes the following steps:
- Step S501 storing the obtained upgrade address to a storage medium
- Step S503 restarting to enter the kernel state, reading the upgrade address from the storage medium, and triggering obtaining the application upgrade package according to the upgrade address.
- the URL address may be stored in a storage medium (for example, a Nor-Flash medium) of the embedded device, and the kernel state is restarted.
- the URL address is read in the Nor-Flash medium, and the above step S103 is triggered to obtain the application upgrade package according to the URL address obtained by the above reading.
- FIG. 6 is a flow chart of steps of an optional upgrade method according to an embodiment of the present application. As shown in FIG. 6, the upgrade method provided by the present application can be implemented by the following steps:
- Step S1 Parsing the received upgrade packet to obtain an upgrade component type and an upgrade address.
- the upgrade address may be a URL address of the upgrade component.
- step S2 it is determined whether the upgrade component type is an application.
- step S3 if the upgrade component type is an application, the process proceeds to step S3, and if the upgrade component type is a kernel, the process proceeds to step S6.
- step S3 if the upgrade component type is an application, the kernel is restarted.
- step S3 the restarting into the kernel state triggering step S4.
- step S4 the upgrade package is obtained according to the upgrade address.
- the upgrade address may be: a URL address stored in the storage medium, and the URL address may be used to indicate an address of the application upgrade package.
- step S5 the upgrade package is written to the partition where the object to be upgraded corresponding to the upgrade component type is located.
- the upgrade package is an application upgrade package.
- step S6 the kernel upgrade package is downloaded according to the upgrade address.
- the upgrade package of the kernel to be upgraded may be downloaded according to the URL address of the kernel firmware to be upgraded obtained by the parsing.
- step S7 the kernel upgrade package is written to the kernel backup partition.
- Step S8 restarting into the boot load state, copying the kernel upgrade package in the kernel backup partition to the partition where the kernel is located.
- the present application further provides an optional solution.
- step S101 parsing the obtained upgrade message
- the upgrade component type and the upgrade address are obtained.
- the foregoing method further includes: restarting to enter a startup loading state, triggering obtaining an upgrade package according to the upgrade address.
- the load upgrade channel and the network protocol stack can be started at the boot load, so that the upgrade and update of the application and the kernel without backup firmware can be completed.
- the upgraded packet is parsed and the upgrade component type and the upgrade address are obtained, there is no need to consider upgrading.
- the object is an application or a kernel, and both can be restarted into the boot load state, and restarted into the boot load state, and the upgrade package corresponding to the object to be upgraded is triggered according to the upgrade address.
- the loading is started from the storage medium of the embedded device, the URL address is read, the application upgrade package is downloaded based on the URL address, and the application is directly The upgrade package is written to the partition where the application is located, and the firmware integrity check is performed by the message digest algorithm. If an error occurs when downloading the upgrade package of the application, the upgrade and update can be implemented by re-downloading the application firmware after the restart.
- the object to be upgraded is a kernel
- the boot load is read from the storage medium of the embedded device
- the URL address of the kernel firmware is read
- the upgrade package of the kernel is downloaded based on the URL address, and directly
- the upgrade package of the kernel is written to the partition where the kernel is located, and the firmware integrity check is performed by the message digest algorithm. If an error occurs when the upgrade package of the download kernel is detected, the kernel firmware can be re-downloaded after the restart to be upgraded and updated.
- the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
- the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
- FIG. 7 is a schematic structural diagram of an upgrade apparatus according to an embodiment of the present invention.
- the upgrade apparatus includes the following modules. a parsing module 10, an obtaining module 12, and a writing module 14, wherein
- the parsing module 10 is configured to parse the received upgrade packet to obtain an upgrade component type and an upgrade address.
- the obtaining module 12 is configured to obtain an application upgrade package according to the upgrade address if the upgrade component type is an application, and write the module 14 to use Write the application upgrade package to the partition where the application is located.
- the parsing module 10, the obtaining module 12, and the writing module 14 correspond to the steps S101 to S105 in the first embodiment, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps, but It is not limited to the contents disclosed in the above embodiment 1. It should be noted that the above module can be operated as a part of the device in the computer terminal provided in Embodiment 3.
- the parsing module is configured to parse the received upgrade packet to obtain an upgrade component type and an upgrade address, and the obtaining module is configured to obtain an application according to the upgrade address if the upgrade component type is an application. Upgrade package; write module for writing the application upgrade package to the partition where the application is located.
- the kernel code is relatively stable, generally does not need to be upgraded or updated, the application is mainly business logic code, and the update frequency is high, in order to meet the needs of the business party to frequently update the application
- the embodiment of the present application does not need to write the application upgrade package to the partition where the application is located, so that the upgrade firmware of the application can be upgraded without the backup firmware of the application. Write directly to the partition where the application is located to complete the upgrade or update of the application.
- the purpose of the application upgrade can be completed without upgrading the firmware of the backup application, thereby realizing the technical effect of reducing the space requirement of the storage medium, thereby solving the existing upgrade mode needs to be Upgrading the firmware provides a backup area, resulting in technical waste of wasted resources and inefficient upgrades.
- the upgrading apparatus further includes: a storage module, configured to store the obtained upgrade address to the storage medium; and a first triggering module, configured to restart into the kernel state, and read from the storage medium Upgrade the address and trigger the application upgrade package based on the upgrade address.
- the application upgrade package is obtained according to the upgrade address.
- the foregoing upgrading apparatus further includes the following module: a first downloading module, configured to: if the upgrade component type is a kernel, download a kernel upgrade package according to the upgrade address; and the first backup module is configured to upgrade the kernel The package is written to the kernel backup partition; the first copy module is used to reboot into the boot load state, and the kernel upgrade package in the kernel backup partition is copied to the partition where the kernel is located.
- a first downloading module configured to: if the upgrade component type is a kernel, download a kernel upgrade package according to the upgrade address
- the first backup module is configured to upgrade the kernel The package is written to the kernel backup partition; the first copy module is used to reboot into the boot load state, and the kernel upgrade package in the kernel backup partition is copied to the partition where the kernel is located.
- the foregoing upgrading apparatus further includes: a second downloading module, configured to download a kernel upgrade package according to the upgrade address if the upgrade component type is a kernel; and a second backup module, The kernel upgrade package is used to write the partition where the application is located; the second copy module is configured to restart into the boot load state, and write the kernel upgrade package in the partition where the application is located to the kernel. Partition.
- the foregoing upgrading apparatus further includes: a first verification module, configured to perform integrity verification on the upgraded kernel by using a cyclic redundancy algorithm; and a first startup module, configured to If the verification is successful, start the upgraded kernel and report the version information of the upgraded kernel.
- the foregoing upgrading apparatus further includes the following module: a second triggering module, configured to restart to enter a startup loading state, and trigger an acquisition of the upgrade package according to the upgrade address.
- the foregoing upgrading apparatus further includes: a second verification module, configured to perform firmware integrity verification on the upgraded application by using a message digest algorithm; and a second startup module, configured to If the verification is successful, start the upgraded application and report the version information of the upgraded application.
- An embedded system that can implement the foregoing upgrade method is also provided according to an embodiment of the present invention. It should be noted that further details of the embodiments of the present application described with reference to the foregoing Embodiment 1 will be described with reference to FIG. 8. A suitable embedded system for implementing the principles of the present application.
- FIG. 8 is a schematic structural diagram of an embedded system according to an embodiment of the present application.
- the depicted structure is only an example of a suitable environment, and does not impose any limitation on the scope of use or function of the present application.
- the embedded system should also not be construed as having any dependency or requirement on any of the components shown in Figure 8 or a combination thereof.
- the above embedded system includes: an application executable file 80 and a kernel service executable file 82;
- the above kernel service executable file is provided with an externally unified interface 84.
- the application executable file includes an application written according to the above interface, and is programmed by calling the interface in the process of writing the application.
- the application executable file that is, the app bin
- the app bin may be generated by the compiler system.
- the developer may write the app bin according to the servicecall interface and the syscall interface in the IDE development environment.
- the above kernel service executable file 82 includes a kernel executable file 821 and a service framework layer executable file 823;
- the above-mentioned kernel executable file 821 is provided with a first interface 8211 provided by the kernel, and the service framework layer executable file 823 is provided with a second interface 8231 provided by the service framework layer, and the application executable file includes the first interface according to the foregoing The application written by the second interface above.
- the first interface 8211 is a syscall interface
- the second interface 8231 is a service call interface.
- the external unified API provided by the framework bin the service call interface
- the external unified API provided by the kernel bin the syscall interface
- the kernel bin includes but is not limited to: a kernel component and a non-essential component.
- the system call mode that is, the SWI system call mode
- the non-system call mode can be implemented according to requirements (that is, the interface is stored in an array). In the call, according to the API number).
- any of the invocation methods implemented by the above syscall interface needs to maintain the consistency of the external interface.
- the above framework bin includes but is not limited to: a framework component and a non-essential component.
- service call interface is a service interface provided by the framework, and can be called by using a non-system call mode.
- the foregoing determining, according to the space size of the application executable file, the service framework layer executable file, and the kernel executable file, compiling the target component into the application executable file, and the foregoing service.
- the framework layer executable or the above kernel executable including:
- the above target component is compiled in the above application executable file, the above service framework layer executable file, and the executable file having the smallest space size in the above kernel executable file.
- the kernel bin and the app bin are flexibly compiled, so that the space size layout of the execution files of the kernel bin and the app bin are equal.
- both the kernel upgrade and the app upgrade can occupy the space of the app bin.
- the present application further provides an optional multi-bin upgrade solution that does not need to provide a Flash space, and describes an upgrade process of the app bin by using the following optional implementation manners:
- determining the type of the firmware to be upgraded is an app according to the upgraded packet received by the parsing. Then download the app bin upgrade package from the remote server and prepare for the app upgrade.
- the FOTA component downloads the upgraded app bin of the remote server into the space of the original app bin.
- the kernel triggers the system to restart, and the downloaded app bin is checked in the kernel. If the verification succeeds, the jump to the app bin space is performed to implement the app bin upgrade;
- the app bin is continuously verified during the power-on process. If the verification is not successful, the FOTA component interacts with the remote server. Re-upgrade the app bin.
- the kernel bin can also be upgraded by the following optional implementation manner:
- the type of the firmware to be upgraded is kernel
- the kernel bin upgrade package is downloaded from the remote server, and the kernel upgrade is prepared.
- both the kernel upgrade and the app upgrade can occupy the space of the app bin.
- the FOTA component downloads the kernel bin from the remote server and writes the partition where the app is located, that is, Overwrite the download address of the kernel bin in the space of the app bin.
- the Boot Loader verifies the kernel bin, and the kernel bin is moved from the space where the app is located to the space where the kernel is located, and jumps. Go to the kernel; the kernel's FOTA component continues to upgrade the app bin. Optionally, you can still upgrade according to the previous app upgrade method to complete the kernel bin upgrade.
- Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
- the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
- the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
- the computer terminal may execute the program code of the following steps in the method for upgrading the application program: parsing the received upgrade message to obtain an upgrade component type and an upgrade address; if the upgrade component type is an application, according to the upgrade address, Obtain the application upgrade package; write the application upgrade package to the partition where the application is located.
- Fig. 14 is a block diagram showing the hardware configuration of a computer terminal.
- computer terminal 14 may include one or more (shown in the figures 142a, 142b, ..., 142n) processor 142 (processor 142 may include, but is not limited to, a microprocessor MCU or programmable A processing device such as a logic device FPGA, a memory 144 for storing data, and a transmission device 146 for communication functions.
- processor 142 may include, but is not limited to, a microprocessor MCU or programmable A processing device such as a logic device FPGA, a memory 144 for storing data, and a transmission device 146 for communication functions.
- it can also include: display, input/output interface (I/O interface), universal serial bus (USB) port (which can be included as one of the ports of the I/O interface), network interface, power supply And / or camera.
- I/O interface input/output interface
- USB universal serial bus
- FIG. 14 is merely illustr
- processors 142 and/or other data processing circuits may be referred to herein generally as "data processing circuits.”
- the data processing circuit may be embodied in whole or in part as software, hardware, firmware or any other combination.
- the data processing circuitry can be a single, separate processing module, or all or part of any of the other components incorporated into computer terminal 14.
- the data processing circuit is controlled as a processor (e.g., selection of a variable resistance terminal path connected to the interface).
- the processor 142 can call the information and the application stored in the memory by the transmission device to perform the following steps: parsing the received upgrade packet to obtain an upgrade component type and an upgrade address; if the upgrade component type is an application, obtaining the upgrade address according to the upgrade address Apply the upgrade package; write the application upgrade package to the partition where the application is located.
- the memory 144 can be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the upgrade method in the embodiment of the present application, and the processor 142 executes each by executing a software program and a module stored in the memory 144.
- a functional application and data processing, that is, the above upgrade method is implemented.
- Memory 144 may include high speed random access memory and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
- memory 144 can further include memory remotely located relative to processor 142, which can be connected to computer terminal 14 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- Transmission device 146 is for receiving or transmitting data via a network.
- the network specific examples described above may include a wireless network provided by a communication provider of computer terminal 14.
- transmission device 146 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
- NIC Network Interface Controller
- the transmission device 146 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
- RF Radio Frequency
- the display can be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with the user interface of computer terminal 14.
- LCD liquid crystal display
- the computer terminal 14 shown in FIG. 14 above may include hardware components (including circuits), software components (including computer code stored on a computer readable medium), or A combination of both hardware and software components. It should be noted that FIG. 14 is only one example of a specific embodiment, and is intended to show the types of components that may be present in the computer terminal 14 described above.
- the computer terminal includes: a processor; and a memory, connected to the processor, for providing the processor with an instruction to process the following processing steps: parsing the received upgrade message, obtaining the upgrade component type and upgrading Address: If the upgrade component type is an application, obtain the application upgrade package according to the upgrade address; write the application upgrade package to the partition where the application is located.
- the processor may use the transmission device to call the information and the application stored in the memory to perform the following steps: parsing the received upgrade message, and obtaining the upgrade component type and the upgrade address; if the upgrade component type is an application, obtaining the application according to the upgrade address Upgrade package; write the application upgrade package to the partition where the application is located.
- the foregoing processor may further execute the following program code: store the obtained upgrade address to the storage medium; restart into the kernel state, read the upgrade address from the storage medium, and trigger an application upgrade package according to the upgrade address.
- the foregoing processor may further execute the following program code: perform firmware integrity verification on the upgraded application by using a message digest algorithm; if the verification succeeds, start the upgraded application, and report the upgraded Version information for the app.
- the foregoing processor may further execute the following program code: if the verification fails, re-execute obtaining the application upgrade package according to the upgrade address.
- the foregoing processor may further execute the following program code: if the upgrade component type is a kernel, download the kernel upgrade package according to the upgrade address; write the kernel upgrade package to the kernel backup partition; restart into the boot load state, and the kernel backup The kernel upgrade package in the partition is copied to the partition where the kernel is located.
- the foregoing processor may further execute the following program code: if the upgrade component type is a kernel, download a kernel upgrade package according to the upgrade address; and write the kernel upgrade package to a partition where the application is located Restarting into the boot load state, writing the kernel upgrade package in the partition where the application is located to the partition where the kernel is located.
- the foregoing processor may further execute the following program code: performing integrity verification on the upgraded kernel by using a cyclic redundancy algorithm; in case of successful verification, starting the upgraded kernel and reporting the upgraded Version information of the kernel.
- the foregoing processor may further execute the following program code: if the upgrade component type is a kernel, download a kernel upgrade package according to the upgrade address; write the kernel upgrade package to a kernel backup partition; restart to start Loading the state, copying the kernel upgrade package in the kernel backup partition to the partition where the kernel is located.
- the foregoing processor may further execute the following program code: restarting into a startup loading state, triggering obtaining an upgrade package according to the upgrade address.
- a solution for upgrading an application is provided.
- the upgrade component type and the upgrade address are obtained by parsing the received upgrade packet. If the upgrade component type is an application, the application upgrade package is obtained according to the upgrade address; the application upgrade package is written to the partition where the application is located, thereby achieving no backup application.
- the upgrade firmware can complete the application upgrade, which solves the technical problem that the existing upgrade method needs to provide a backup area for the upgrade firmware, resulting in waste of resources and low upgrade efficiency.
- the structure shown in FIG. 14 is only a schematic, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
- Fig. 14 does not limit the structure of the above electronic device.
- the computer terminal may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 14, or have a different configuration than that shown in FIG.
- Embodiments of the present invention also provide a storage medium.
- the foregoing storage medium may be used to save the program code executed by the upgrade method provided in Embodiment 1 above.
- the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
- the storage medium is configured to store program code for performing the following steps: parsing the received upgrade message, obtaining an upgrade component type and an upgrade address; and if the upgrade component type is an application, according to the upgrade Address, get the application upgrade package; write the application upgrade package to the partition where the application is located.
- the storage medium is configured to store program code for performing the following steps: storing the obtained upgrade address to the storage medium; rebooting into the kernel state, reading the upgrade address from the storage medium, triggering the basis Upgrade the address to get the application upgrade package.
- the storage medium is configured to store program code for performing the following steps: performing firmware integrity check on the upgraded application by using a message digest algorithm; and starting if the verification is successful, starting The upgraded application and report the version information of the upgraded application.
- the storage medium is configured to store program code for performing the following steps: storing the obtained upgrade address to the storage medium; rebooting into the kernel state, reading the upgrade address from the storage medium, triggering the basis Upgrade the address to get the application upgrade package.
- the storage medium is configured to store program code for performing the following steps: performing firmware integrity check on the upgraded application by using a message digest algorithm; and starting if the verification is successful, starting The upgraded application and report the version information of the upgraded application.
- the storage medium is configured to store program code for performing the following steps: in case the verification fails, re-execution acquires the application upgrade package according to the upgrade address.
- the storage medium is configured to store program code for performing the following steps: if the upgrade component type is a kernel, downloading a kernel upgrade package according to the upgrade address; Write to the kernel backup partition; reboot into the boot load state, copy the kernel upgrade package in the kernel backup partition to the partition where the kernel is located.
- the storage medium is configured to store program code for performing the following steps: if the upgrade component type is a kernel, downloading a kernel upgrade package according to the upgrade address; upgrading the kernel The packet is written to the partition where the application is located; the reboot enters the boot load state, and the kernel upgrade package in the partition where the application is located is written to the partition where the kernel is located.
- the storage medium is configured to store program code for performing the following steps: restarting into the boot load state, triggering acquisition of the upgrade package according to the upgrade address.
- the disclosed technical contents may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of a unit is only a logical function division.
- multiple units or components may be combined or may be integrated into Another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
- the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
一种升级方法、嵌入式系统。其中,该方法包括:解析接收到的升级报文,得到升级组件类型和升级地址(S102);若升级组件类型为应用,根据升级地址,获取应用升级包(S104);将应用升级包写入应用所在的分区(S106)。通过该方法解决了现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
Description
本申请要求2017年09月26日递交的申请号为201710885055.9、发明名称为“升级方法和装置”的中国专利申请的优先权,以及要求2017年09月30日递交的申请号为201710938082.8、发明名称为“升级方法、嵌入式系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及互联网领域,具体而言,涉及一种升级方法、嵌入式系统。
在嵌入式运行环境下,由于网络或者嵌入式设备存储介质的存储资源受限,在应用需要升级时,通常需要压缩应用升级包的文件大小,目前的OTA(Over-the-Air,空中下载技术)升级类型有两种:整包升级和差分升级,目前应用升级通常采用的升级方式主要是差分升级,例如,嵌入式系统等OTA厂商都使用差分升级方式进行升级,差分升级方式可以实现一个较好的压缩效果,只需要原有升级固件的5%-20%空间,即可完成升级,大大减少了资源占用,因此,成为目前各厂家升级设备的首选方式。
但是,采用差分升级方式进行应用升级时,仍存在很多不容忽视的缺点,例如:需要对升级的应用进行备份,升级效率大大降低;服务端版本碎片较多,不易对嵌入式系统维护管理;在一些情况下在差分压缩升级包后,升级时仍然会升级整包,拉低升级速度,升级过程会消耗过多的资源,满足不了减少嵌入式设备的存储介质的空间需求。
针对上述的现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种升级方法、嵌入式系统,以至少解决现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
根据本发明实施例的一个方面,提供了一种升级方法,包括:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
根据本发明实施例的另一方面,还提供了一种嵌入式系统,包括:应用可执行文件 以及内核服务可执行文件;其中,内核服务可执行文件设置有对外统一的接口,应用可执行文件包括根据接口编写的应用,在编写应用的过程中,通过调用接口进行编程。
根据本发明实施例的另一方面,还提供了一种升级装置,包括:解析模块,用于解析接收到的升级报文,得到升级组件类型和升级地址;获取模块,用于若升级组件类型为应用,根据升级地址,获取应用升级包;写入模块,用于将应用升级包写入应用所在的分区。
根据本发明实施例的另一方面,还提供了一种计算机终端,包括:处理器;以及存储器,与处理器连接,用于为处理器提供处理以下处理步骤的指令:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
根据本发明实施例的另一方面,还提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行上述的升级方法。
根据本发明实施例的另一方面,还提供了一种处理器,处理器用于运行程序,其中,程序运行时执行上述的升级方法。
在本发明实施例中,采用直接将应用升级包写入应用所在的分区的方式,通过解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区,达到了无需备份应用的升级固件即可完成应用升级的目的,从而实现了减少存储介质的空间需求的技术效果,进而解决了现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种可选的升级方法的步骤流程图;
图2是根据本发明实施例的一种可选的升级方法的步骤流程图;
图3a是根据本发明实施例的一种可选的升级方法的步骤流程图;
图3b是根据本发明实施例的一种可选的升级方法的步骤流程图;
图4是根据本发明实施例的一种可选的升级方法的步骤流程图;
图5是根据本发明实施例的一种可选的升级方法的步骤流程图;
图6是根据本发明实施例的一种可选的升级方法的步骤流程图;
图7是根据本发明实施例的一种升级装置的结构示意图;
图8是根据本发明实施例的一种嵌入式系统的结构示意图;
图9是根据本发明实施例的一种可选的嵌入式系统的结构示意图;
图10是根据本发明实施例的一种可选的0-Flash升级空间的多bin升级的空间布局图;
图11是根据本发明实施例的一种可选的升级app bin的示意图;
图12是根据本发明实施例的一种可选的升级kernel bin的示意图;
图13是根据本发明实施例的一种可选的升级kernel bin的示意图;以及
图14是根据本发明实施例的一种计算机终端的硬件结构框图。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本申请实施例进行描述的过程中出现的部分名词或术语适用于如下解释:
无线升级(Firmware Over-The-Air,FOTA):也即移动终端的空中下载软件,是指通过云端升级技术,为具有连网功能的设备提供固件升级服务,用户可以通过网络以按需、易扩展的方式获取智能设备系统升级包,并通过FOTA进行云端升级,完成系统修复和优化。
内核(kernel):是指操作系统最基本的部分,用于为应用程序提供对计算机硬件的 安全访问的一部分软件;本申请中所涉及的内核,可以为由嵌入式设备的升级固件分离得出的内核,用于为嵌入式操作系统(OS)提供基础功能。
应用(Application,App):本申请中所涉及的应用可以是由嵌入式设备的升级固件分离得出的应用,App为业务方使用kernel提供的API开发的业务代码。
应用程序编程接口(Application Programming Interface,API):是指预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力,而无需访问源码,或内部工作机制。
启动装载(Boot Loader):是一种用于在嵌入式操作系统中,完成整个系统的加载启动任务的引导程序,在操作系统内核运行前运行,可以初始化硬件设备、建立内存空间映射图,从而可以将系统的软硬件环境带到一个合适状态,以便于为最终调用操作系统内核准备好正确的环境。
统一资源定位符(Uniform Resource Locator,URL):是指每一个信息资源在WWW上的统一且唯一的资源定位标志,也即网络地址。
循环冗余校验算法(Cyclic Redundancy Check,CRC):是指数据通信领域中一种常用的查错校验算法,具有数据传输查错的功能,通过对数据进行多项式计算,并将得到的结果附在帧的后面,接收设备也执行类似的算法,以保证数据传输的正确性和完整性。
消息摘要算法:是指一种将任意长度的输入柔和产生长度固定的伪随机输入的算法,其主要特征是加密过程不需要密钥,并且经过加密的数据无法被解密,只有输入相同的明文数据经过相同的消息摘要算法,才可以得到相同的密文。
二进制文件(binary files,bin):其用途依系统或应用而定,其中,bin是一种文件格式binary的缩写,一个后缀名为“.bin”的可执行文件,仅表明该文件为binary格式,不表明其与某种应用程序存在必然的联系性。
多bin:是指将现有单独的.bin文件分成kernel bin、app bin等.bin文件。
实施例1
根据本发明实施例,还提供了一种升级方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
需要说明的是,本实施例所提供的一种升级方法可用于嵌入式设备升级应用的过程中,通过在内核中植入升级通道,无需在备份分区中备份应用升级包,即可完成应用的升级或更新,有效减少了对嵌入式设备中存储介质的空间需求。
在嵌入式运行环境下,由于网络、或者嵌入式设备存储介质的存储资源受限,在应用需要升级时,通常需要压缩应用升级包的文件大小,目前的OTA升级类型有两种:整包升级和差分升级,一般情况下,普通升级需要占用等量的存储空间,为节省存储空间,目前应用升级通常采用的升级方式主要是差分升级,例如,嵌入式系统,RT-thread或广升等都使用差分升级方式进行升级,差分升级方式可以实现一个较好的压缩效果,只需要原有升级固件的5%-20%空间,即可完成升级,大大减少了资源占用,因此,成为目前各厂家升级设备的首选方式。
具体的,差分升级方式实现升级的过程为服务端推送升级消息,设备端下载差分升级包,下载完成之后,重启进入启动装载状态,然后在将差分包以补丁方式(只升级差异部分)替换原有固件,从而达到升级目的。
但是,差分升级也需要一定量的备份区,且差分升级包随着两个版本之间的差异而不同,也即,现有的升级方式都需要不同大小的备份区域,占用较大升级空间,并且,这些备份区域在实际使用中只为升级,存在某种意义上的浪费。
基于本申请所提供的升级方法,可以实现无需Flash升级空间的多bin升级,也即,可以使备份区域减少为0,从而减少物联网设备的成本投入。
具体的,在上述运行环境下,本申请提供了如图1所示的升级方法。图1是根据本发明实施例的升级方法的步骤流程图。
步骤S101,解析接收到的升级报文,得到升级组件类型和升级地址。
可选的,在上述步骤S101中,执行主体可以为嵌入式设备。具体的,上述升级组件也即为升级固件,上述升级组件类型可以为但不限于:应用、内核;上述升级地址可以为URL地址。
在一种可选的实施例中,在嵌入式设备接收到服务端推送的升级消息后,嵌入式设备可以对该升级消息中的升级报文进行解析,得到上述升级组件类型和升级包的地址。
需要说明的是,作为一种可选的实施例,本申请可以通过二进制编码形式,对升级组件类型进行标识,例如,可以以“1”表示升级组件类型为应用,可以以“0”表示升级组件类型为内核。
此外,仍需说明的是,在解析得到URL地址之后,可以将该URL地址,存储至嵌 入式设备的存储介质(例如,Nor-Flash介质)中。
步骤S103,若升级组件类型为应用,根据升级地址,获取应用升级包。
可选的,在上述步骤S103中,上述升级地址可以为:上述存储介质中存储的URL地址,该URL地址可以用于指示应用升级包的地址。
需要说明的是,可以通过下载的方式获取上述升级包,其中,升级包的类型与上述升级组件类型相对应设置,可以为但不限于:内核升级包、应用升级包。
在一种可选的实施例中,在确定上述升级对象为应用时,在解析得到URL地址之后,根据URL地址下载应用升级包。
在一种可选的实施例中,可以根据解析得到的升级组件类型,确定是否为应用,若为应用,重启进入内核状态(即在内核中)后,根据升级地址,获取应用升级包。
需要说明的是,由于不能在应用运行时,直接将应用升级包写入该应用所在的分区,因此,可以在确定嵌入式设备中的升级组件类型为应用的情况下重启系统,并进入内核状态,具体的,该内核中预先植入有应用的升级通道。
步骤S105,将应用升级包写入应用所在的分区。
在一种可选的实施例中,无需备份应用,可以在下载得到该应用升级包后,直接将该应用升级包写入应用所在的分区,完成应用的升级和更新。
基于上述步骤S101至步骤S105所限定的方案可以获知,解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
容易注意到的是,由于在实际的应用环境中,内核的代码较为稳定,一般不需要进行升级或更新,应用主要为业务逻辑代码,更新频率较高,为了满足业务方频繁更新应用的需求,且不需要额外的备份分区,本申请上述实施例采用直接将应用升级包写入应用所在的分区的方式,因而可以实现在嵌入式设备升级应用的过程中,无需备份应用升级包,即可直接写入应用所在的分区,完成应用的升级和更新。
通过本申请上述实施例所提供的方案,达到了无需备份应用升级包即可完成应用升级的目的,从而实现了减少存储介质的空间需求的技术效果,进而解决了现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
在一种可选的实施例中,在执行步骤S105之后,也即在将应用升级包写入应用所在的分区之后,如图2所示,上述方法还包括如下步骤:
步骤S201,通过消息摘要算法对升级后的应用进行固件完整性校验;
步骤S203,在校验成功的情况下,启动升级后的应用,并上报升级后的应用的版本信息。
具体的,上述消息摘要算法可以为消息摘要算法第五版本,也即MD5算法,为计算机安全领域广泛使用的一种散列函数,用以提供消息或数据的完整性保护。
在一种可选的实施例中,在将应用升级包写入应用所在的分区之后,还可以通过对升级后的应用的固件完整性进行校验,并在校验成功时,启动已升级的内核和应用,并上报升级后的内核和应用的版本信息,完成升级。
在另一种可选的实施例中,上述消息摘要算法还可以用于对升级后内核进行固件完整性校验。
在一种可选的实施例中,图3a是根据本发明实施例的一种可选的升级方法的步骤流程图,如图3a所示,上述升级方法还包括如下步骤:
步骤S301,若升级组件类型为内核,根据升级地址下载内核升级包;
具体的,在上述步骤S301中,可以根据解析得到的升级组件类型,确定是否为应用;并根据解析得到的待升级内核固件的URL地址,下载待升级内核的升级包。
步骤S303,将内核升级包写入内核备份分区;
步骤S305,重启进入启动装载状态,将内核备份分区中的内核升级包拷贝至内核所在的分区。
在一种可选的实施方式中,在将上述内核升级包写入内核备份分区进行备份之后,可以重启并进入启动装载状态,并在进入启动装载状态程序之后,将已进行备份的内核升级包拷贝到内核所在的分区。
由于在实际应用中,内核代码较为稳定,一般不需要进行频繁的升级和更新,基于上述步骤S301至步骤S305所提供的可选技术方案,在升级内核时,可以但不限于备份内核固件,以实现在不增加嵌入式设备的资源负担的情况下,完成内核的升级和更新。
此外,仍存在一种可选的实施例,图3b是根据本发明实施例的一种可选的升级方法的步骤流程图,如图3b所示,上述升级方法还包括如下步骤:
步骤S302,若升级组件类型为内核,根据升级地址下载内核升级包。
可选的,上述步骤S302中的实施方式可以参见步骤S301中的相关描述,此处不再赘述。
步骤S304,将上述内核升级包写入上述应用所在的分区。
需要说明的是,为达到将kernel bin和app bin的空间等分的目的,对kernel升级和 app升级均可以占用app bin的空间。
可选的,在上述步骤S302至步骤S304中,在kernel中的FOTA组件与远程服务器进行交互的过程中,若发升级组件类型为内核,则从远端服务器下载kernel bin,写入app所在的分区,也即,将下载kernel bin的下载地址覆盖在app bin位置。
步骤S306,重启进入启动装载状态,将上述应用所在的分区内的上述内核升级包写入上述内核所在的分区。
在上述步骤S306中,在下载完kernel bin之后进行重启,Boot Loader对kernel bin进行校验,并将kernel bin从app所在的空间位置,搬运到(写入)kernel所在的空间位置,并跳转到kernel;kernel的FOTA组件继续对app bin进行升级,可选的,仍然可以按照之前的app升级方式进行升级,从而完成kernel bin的升级。
需要说明的是,如果在搬运kernel bin的过程中出现断电,则在Boot Loader中进行校验并再次对kernel bin进行搬运。
作为一种可选的实施方式,在上述步骤S305之后,也即将内核备份分区中的内核升级包拷贝至内核所在的分区之后,如图4所示,上述升级方法还包括如下方法步骤:
步骤S401,通过循环冗余算法对升级后的内核进行完整性校验;
步骤S403,在校验成功的情况下,启动升级后的内核,并上报升级后的内核的版本信息。
需要说明的是,本申请还可以在上述步骤S306之后,也即,在将所述应用所在的分区内的所述内核升级包写入所述内核所在的分区之后,执行上述步骤S401至步骤S403所提供的可选实施方式。
基于上述步骤S401至步骤S403所提供的可选方案,可以通过上述启动装载中的校验固件,根据循环冗余算法对升级后的完整性进行校验,若校验成功,则确定下载过程并未出现错误或者数据丢失,启动升级后的内核,并上报升级后的内核的版本信息,完成升级。
在一种可选的实施例中,图5是根据本发明实施例的一种可选的升级方法的步骤流程图,如图5所示,在根据升级地址,获取应用升级包之前,上述升级方法还包括如下步骤:
步骤S501,将得到的升级地址存储至存储介质;
步骤S503,重启进入内核状态,从存储介质读取升级地址,触发根据升级地址,获取应用升级包。
在一种可选的实施例中,在解析升级报文得到URL地址之后,可以将该URL地址,存储至嵌入式设备的存储介质(例如,Nor-Flash介质)中,重启进入内核状态,从Nor-Flash介质中读取URL地址,触发上述步骤S103,根据上述读取得到的URL地址,获取应用升级包。
为便于理解本申请,根据本发明实施例,本申请还提供了一种可选的实施方式对本申请进行说明,图6是根据本申请实施例的一种可选的升级方法的步骤流程图,如图6所示,本申请提供的升级方法可以通过如下步骤实现:
步骤S1:解析接收到的升级报文,得到升级组件类型和升级地址。
可选的,可以在接收到升级指令的情况下,执行上述步骤S1中,上述升级地址可以为升级组件的URL地址。
步骤S2,确定升级组件类型是否为应用。
具体的,若升级组件类型为应用,则进入步骤S3,若升级组件类型为内核,则进入步骤S6。
步骤S3,升级组件类型为应用,则重启进入内核状态。
具体的,在上述步骤S3中,重启进入内核状态触发步骤S4。
步骤S4,根据升级地址,获取升级包。
具体的,上述升级地址可以为:上述存储介质中存储的URL地址,该URL地址可以用于指示应用升级包的地址。
步骤S5,将升级包写入升级组件类型对应的待升级对象所在的分区。
在上述步骤S5中,该升级包为应用升级包。
步骤S6,根据升级地址下载内核升级包。
具体的,可以根据解析得到的待升级内核固件的URL地址,下载待升级内核的升级包。
步骤S7,将内核升级包写入内核备份分区。
步骤S8,重启进入启动装载状态,将所述内核备份分区中的内核升级包拷贝至内核所在的分区。
为解决现有技术中存在的上述技术问题,本申请还提供了另外一种可选的方案,在执行上述步骤S101之后,也即在解析获取到的升级报文,得到升级组件类型和升级地址之后,上述方法还包括:重启进入启动装载状态,触发根据升级地址,获取升级包。
需要说明的是,在上述可选的实施方式中,可以在启动装载植入升级通道和网络协 议栈,从而能完成应用和内核的无备份固件的升级和更新。
在一种可选的实施例中,由于在上述启动装载(Boot Loader)植入升级通道和网络协议栈,在解析获取到的升级报文,得到升级组件类型和升级地址之后,无需考虑待升级对象是应用或是内核,均可以重启进入启动装载状态,并重启进入启动装载状态,触发根据升级地址来下载与待升级对象对应的升级包。
在一种可选的实施例中,如果待升级对象是应用,则启动装载从嵌入式设备的存储介质中,读取URL地址,基于该URL地址下载应用的升级包,并直接将该应用的升级包写入应用所在分区,通过消息摘要算法进行固件完整性校验,如果检测出下载应用的升级包时出错,则重启之后重新下载应用固件即可实现升级和更新。
在另一种可选的实施例中,如果待升级对象是内核,则启动装载从嵌入式设备的存储介质中,读取内核固件的URL地址,基于该URL地址下载内核的升级包,并直接将该内核的升级包写入内核所在分区,通过消息摘要算法进行固件完整性校验,如果检测出下载内核的升级包时出错,则重启之后重新下载内核固件即可实现升级和更新。
基于上述可选的实施方式,从而能够实现无需备份应用固件和内核固件,根据上述启动装载提供的植入升级通道,直接完成应用和内核的升级和更新。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。
实施例2
根据本发明实施例,还提供了一种用于实施上述升级方法的升级装置,图7是根据本发明实施例的一种升级装置的结构示意图,如图7所示,上述升级装置包括如下模块:解析模块10、获取模块12和写入模块14,其中,
解析模块10,用于解析接收到的升级报文,得到升级组件类型和升级地址;获取模块12,用于若升级组件类型为应用,根据升级地址,获取应用升级包;写入模块14,用于将应用升级包写入应用所在的分区。
此处需要说明的是,上述解析模块10、获取模块12和写入模块14对应于实施例1中的步骤S101至步骤S105,三个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例1所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例3提供的计算机终端中。
基于上述实施例所限定的方案可以获知,解析模块,用于解析接收到的升级报文,得到升级组件类型和升级地址;获取模块,用于若升级组件类型为应用,根据升级地址,获取应用升级包;写入模块,用于将应用升级包写入应用所在的分区。
容易注意到的是,由于在实际的应用环境中,内核的代码较为稳定,一般不需要进行升级或更新,应用主要为业务逻辑代码,更新频率较高,为了满足业务方频繁更新应用的需求,且不需要额外的备份分区,本申请上述实施例采用直接将应用升级包写入应用所在的分区的方式,因而可以实现在嵌入式设备升级应用的过程中,无需备份应用的升级固件,即可直接写入应用所在的分区,完成应用的升级或更新。
通过本申请上述实施例所提供的方案,达到了无需备份应用的升级固件即可完成应用升级的目的,从而实现了减少存储介质的空间需求的技术效果,进而解决了现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
在一种可选的实施方式中,上述升级装置还包括如下模块:存储模块,用于将得到的升级地址存储至存储介质;第一触发模块,用于重启进入内核状态,从存储介质读取升级地址,触发根据升级地址,获取应用升级包。
在一种可选的实施方式中,在校验失败的情况下,重新执行根据升级地址,获取应用升级包。
在一种可选的实施方式中,上述升级装置还包括如下模块:第一下载模块,用于若升级组件类型为内核,根据升级地址下载内核升级包;第一备份模块,用于将内核升级包写入内核备份分区;第一拷贝模块,用于重启进入启动装载状态,将内核备份分区中的内核升级包拷贝至内核所在的分区。
在一种可选的实施方式中,上述升级装置还包括如下模块:第二下载模块,用于若所述述升级组件类型为内核,根据所述升级地址下载内核升级包;第二备份模块,用于将所述内核升级包写入所述应用所在的分区;第二拷贝模块,用于重启进入启动装载状 态,将所述应用所在的分区内的所述内核升级包写入所述内核所在的分区。
在一种可选的实施方式中,上述升级装置还包括如下模块:第一校验模块,用于通过循环冗余算法对升级后的内核进行完整性校验;第一启动模块,用于在校验成功的情况下,启动升级后的内核,并上报升级后的内核的版本信息。
在一种可选的实施方式中,上述升级装置还包括如下模块:第二触发模块,用于重启进入启动装载状态,触发根据升级地址,获取升级包。
在一种可选的实施方式中,上述升级装置还包括如下模块:第二校验模块,用于通过消息摘要算法对升级后的应用进行固件完整性校验;第二启动模块,用于在校验成功的情况下,启动升级后的应用,并上报升级后的应用的版本信息。
需要说明的是,本实施例的优选实施方式可以参见实施例1中的相关描述,此处不再赘述。
实施例3
根据本发明实施例,还提供了一种可以实现上述升级方法的嵌入式系统,需要说明的是,参照上述实施例1所描述本申请的各实施方式的进一步细节,将参考图8来描述可用于实现本申请原理的一个合适的嵌入式系统。
图8是根据本申请实施例的一种嵌入式系统的结构示意图,出于描述的目的,所绘结构仅为合适环境的一个示例,并非对本申请的使用范围或功能提出任何局限。也不应将该嵌入式系统,解释为对图8所示的任一组件或其组合具有任何依赖或需求。
如图8所示,上述嵌入式系统,包括:应用可执行文件80以及内核服务可执行文件82;其中,
上述内核服务可执行文件设置有对外统一的接口84,应用可执行文件包括根据上述接口编写的应用,在上述编写应用的过程中,通过调用所述接口进行编程。
具体的,上述应用程序可执行文件,也即app bin,可以由编译系统生成,在一种可选的实施例中,开发者可以在IDE开发环境下,根据servicecall接口和syscall接口编写app bin。
在一种可选的实施方式中,如图9所示,上述内核服务可执行文件82包括内核可执行文件821以及服务框架层可执行文件823;
其中,上述内核可执行文件821设置有内核提供的第一接口8211,上述服务框架层可执行文件823设置有服务框架层提供的第二接口8231,上述应用可执行文件包括根据 上述第一接口与上述第二接口编写的应用。
具体的,上述第一接口8211为syscall接口,上述第二接口8231为service call接口。
作为一种可选的实施方式,在编写app程序的过程中,可以通过调用framework bin所提供对外的统一API:service call接口,以及kernel bin所提供的对外的统一API:syscall接口进行编程。
需要说明的是,上述service call接口和syscall接口并不限定于两个接口,而是两个接口模块,可以为多个接口。
本申请实施例的一种可选的0-Flash升级空间的多bin升级的空间布局如图10所示,可选的,上述kernel bin包括但不限于:kernel组件和非必须组件。
关于上述syscall接口,需要说明的是,其作为kernel所提供的系统接口,可以根据需求实现系统调用方式(也即,SWI系统调用方式)和非系统调用方式(也即,将接口存储在一个数组中,根据API编号进行调用)。
此外,上述syscall接口所实现的任意一种调用方式,均需要保持对外接接口的一致性。
可选的,上述framework bin包括但不限于:framework组件和非必须组件。
关于上述service call接口,需要说明的是,其作为framework提供的service接口,可以单不限于使用非系统调用方式进行调用。
在一种可选的实施方式中,在编译目标组件的过程中,根据上述应用可执行文件、上述服务框架层可执行文件以及上述内核可执行文件的空间大小,确定将上述目标组件编译在上述应用可执行文件、上述服务框架层可执行文件或上述内核可执行文件中。
在一种可选的实施方式中,上述根据上述应用可执行文件、上述服务框架层可执行文件以及上述内核可执行文件的空间大小,确定将上述目标组件编译在上述应用可执行文件、上述服务框架层可执行文件或上述内核可执行文件中,包括:
将上述目标组件编译在上述应用可执行文件、上述服务框架层可执行文件以及上述内核可执行文件中空间大小最小的可执行文件中。
基于本申请所提供的实施例,无需提供备份区域,并且通过灵活编译kernel bin和app bin,从而使得kernel bin和app bin的执行文件的空间大小布局相等。
需要说明的是,为达到将kernel bin和app bin的空间等分的目的,对kernel升级和app升级均可以占用app bin的空间。
此外,还需说明的是,为了等比例分配kernel bin空间和app bin空间,为0-Flash(无 备份区域)升级空间奠定基础,可以依托操作系统高度弹性的优点,对非必须组件(也即,并非必须要求在kernel bin或者app bin进行编译的组件)进行选择性编译,即既可以编译在kernel bin又可以编译在app bin,并且,对外接口需要统一,且向前兼容。
基于上述实施例,本申请还提供了一种可选的无需提供Flash空间的多bin升级方案,并通过如下可选的实施方式对app bin的升级流程进行说明:
作为一种可选的实施例,如图11所示,在kernel bin中的FOTA组件和远端服务器进行交互的过程中,根据解析接收到的升级报文,确定待升级固件的类型为app,则从远端服务器下载app bin升级包,准备进行app升级。
进一步的,FOTA组件把远端服务器的升级app bin下载到原来app bin的空间中。
更进一步的,待更新的app bin下载完毕之后,kernel触发系统重启,在kernel中对下载的app bin进行检验,若校验成功则跳转到app bin空间执行,实现app bin的升级;
需要说明的是,如果在升级app的过程中发生断电情况,在重新上电开机的过程中,继续对app bin进行校验,如果校验未成功,FOTA组件会和远端服务器进行交互,重新对app bin进行升级。
此外,仍存在一种可选的实施例,如图12所示,本申请所提供的无需提供Flash空间的多bin升级方案中,还可以通过如下可选的实施方式对kernel bin进行升级:
在kernel bin中的FOTA组件和远端服务器进行交互的过程中,根据解析接收到的升级报文,确定待升级固件的类型为kernel,则从远端服务器下载kernel bin升级包,准备进行kernel升级。
为达到将kernel bin和app bin的空间等分的目的,对kernel升级和app升级均可以占用app bin的空间,FOTA组件从远端服务器下载kernel bin,并写入app所在的分区,也即,将kernel bin的下载地址覆盖在app bin的空间位置。
如图13所示,在下载完kernel bin之后进行重启,Boot Loader对kernel bin进行校验,并将kernel bin从app所在的空间位置,搬运到(写入)kernel所在的空间位置,并跳转到kernel;kernel的FOTA组件继续对app bin进行升级,可选的,仍然可以按照之前的app升级方式进行升级,从而完成kernel bin的升级。
需要说明的是,如果在搬运kernel bin的过程中出现断电,则在Boot Loader中进行校验并再次对kernel bin进行搬运。
需要说明的是,本实施例的优选实施方式可以参见实施例1和实施例2中的相关描述,此处不再赘述。
实施例4
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行应用程序的升级方法中以下步骤的程序代码:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
图14示出了一种计算机终端的硬件结构框图。如图14所示,计算机终端14可以包括一个或多个(图中采用142a、142b,……,142n来示出)处理器142(处理器142可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器144、以及用于通信功能的传输装置146。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为I/O接口的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图14所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端14还可包括比图14中所示更多或者更少的组件,或者具有与图14所示不同的配置。
应当注意到的是上述一个或多个处理器142和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算机终端14中的其他元件中的任意一个。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。
处理器142可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
存储器144可用于存储应用软件的软件程序以及模块,如本申请实施例中的升级方法对应的程序指令/数据存储装置,处理器142通过运行存储在存储器144内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的升级方法。存储器144可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪 存、或者其他非易失性固态存储器。在一些实例中,存储器144可进一步包括相对于处理器142远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端14。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置146用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端14的通信供应商提供的无线网络。在一个实例中,传输装置146包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置146可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算机终端14的用户界面进行交互。
此处需要说明的是,在一些可选实施例中,上述图14所示的计算机终端14可以包括硬件元件(包括电路)、软件元件(包括存储在计算机可读介质上的计算机代码)、或硬件元件和软件元件两者的结合。应当指出的是,图14仅为特定具体实例的一个实例,并且旨在示出可存在于上述计算机终端14中的部件的类型。
在本实施例中,上述计算机终端,包括:处理器;以及存储器,与处理器连接,用于为处理器提供处理以下处理步骤的指令:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
可选的,上述处理器还可以执行如下步骤的程序代码:将得到的升级地址存储至存储介质;重启进入内核状态,从存储介质读取升级地址,触发根据升级地址,获取应用升级包。
可选的,上述处理器还可以执行如下步骤的程序代码:通过消息摘要算法对升级后的应用进行固件完整性校验;在校验成功的情况下,启动升级后的应用,并上报升级后的应用的版本信息。
可选的,上述处理器还可以执行如下步骤的程序代码:在校验失败的情况下,重新执行根据升级地址,获取应用升级包。
可选的,上述处理器还可以执行如下步骤的程序代码:若升级组件类型为内核,根 据升级地址下载内核升级包;将内核升级包写入内核备份分区;重启进入启动装载状态,将内核备份分区中的内核升级包拷贝至内核所在的分区。
可选的,上述处理器还可以执行如下步骤的程序代码:若所述述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入所述应用所在的分区;重启进入启动装载状态,将所述应用所在的分区内的所述内核升级包写入所述内核所在的分区。
可选的,上述处理器还可以执行如下步骤的程序代码:通过循环冗余算法对升级后的内核进行完整性校验;在校验成功的情况下,启动升级后的内核,并上报升级后的内核的版本信息。
可选的,上述处理器还可以执行如下步骤的程序代码:若所述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入内核备份分区;重启进入启动装载状态,将所述内核备份分区中的所述内核升级包拷贝至所述内核所在的分区。可选的,上述处理器还可以执行如下步骤的程序代码:重启进入启动装载状态,触发根据升级地址,获取升级包。
采用本发明实施例,提供了一种升级应用的方案。通过解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区,从而达到了无需备份应用的升级固件即可完成应用升级的目的,进而解决了现有的升级方式需要为升级固件提供备份区域,导致资源浪费且升级效率较低的技术问题。
本领域普通技术人员可以理解,图14所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图14其并不对上述电子装置的结构造成限定。例如,计算机终端还可包括比图14中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图14所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例5
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可 以用于保存上述实施例1所提供的升级方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:解析接收到的升级报文,得到升级组件类型和升级地址;若升级组件类型为应用,根据升级地址,获取应用升级包;将应用升级包写入应用所在的分区。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将得到的升级地址存储至存储介质;重启进入内核状态,从存储介质读取升级地址,触发根据升级地址,获取应用升级包。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:通过消息摘要算法对升级后的应用进行固件完整性校验;在校验成功的情况下,启动升级后的应用,并上报升级后的应用的版本信息。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将得到的升级地址存储至存储介质;重启进入内核状态,从存储介质读取升级地址,触发根据升级地址,获取应用升级包。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:通过消息摘要算法对升级后的应用进行固件完整性校验;在校验成功的情况下,启动升级后的应用,并上报升级后的应用的版本信息。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:在校验失败的情况下,重新执行根据升级地址,获取应用升级包。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:若所述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入内核备份分区;重启进入启动装载状态,将所述内核备份分区中的所述内核升级包拷贝至所述内核所在的分区。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:若所述述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入所述应用所在的分区;重启进入启动装载状态,将所述应用所在的分区内的所述内核升级包写入所述内核所在的分区。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:重启进入启动装载状态,触发根据升级地址,获取升级包。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
Claims (15)
- 一种升级方法,其特征在于,包括:解析接收到的升级报文,得到升级组件类型和升级地址;若所述升级组件类型为应用,根据所述升级地址,获取应用升级包;将所述应用升级包写入所述应用所在的分区。
- 根据权利要求1所述的方法,其特征在于,根据所述升级地址,获取应用升级包之前,所述方法还包括:将得到的所述升级地址存储至存储介质;重启进入内核状态,从所述存储介质读取所述升级地址。
- 根据权利要求1或2所述的方法,其特征在于,将所述应用升级包写入所述应用所在的分区之后,所述方法还包括:通过消息摘要算法对升级后的所述应用进行完整性校验;在校验成功的情况下,启动升级后的所述应用,并上报升级后的所述应用的版本信息。
- 根据权利要求3所述的方法,其特征在于,在校验失败的情况下,重新执行所述根据所述升级地址,获取应用升级包。
- 根据权利要求1所述的方法,其特征在于,还包括:若所述述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入所述应用所在的分区;重启进入启动装载状态,将所述应用所在的分区内的所述内核升级包写入所述内核所在的分区。
- 根据权利要求1所述的方法,其特征在于,还包括:若所述升级组件类型为内核,根据所述升级地址下载内核升级包;将所述内核升级包写入内核备份分区;重启进入启动装载状态,将所述内核备份分区中的所述内核升级包复制至所述内核所在的分区。
- 根据权利要求6所述的方法,其特征在于,将所述内核备份分区中的所述内核升级包复制至所述内核所在的分区之后,所述方法还包括:通过循环冗余算法对升级后的所述内核进行完整性校验;在校验成功的情况下,启动升级后的所述内核,并上报升级后的所述内核的版本信 息。
- 一种嵌入式系统,其特征在于,包括:应用可执行文件以及内核服务可执行文件;其中,所述内核服务可执行文件设置有对外统一的接口,所述应用可执行文件包括根据所述接口编写的应用,在所述编写应用的过程中,通过调用所述接口进行编程。
- 根据权利要求8所述的系统,其特征在于,内核服务可执行文件包括内核可执行文件以及服务框架层可执行文件;其中,所述内核可执行文件设置有内核提供的第一接口,所述服务框架层可执行文件设置有服务框架层提供的第二接口,所述应用可执行文件包括根据所述第一接口与所述第二接口编写的应用。
- 根据权利要求9所述的系统,其特征在于,在编译目标组件的过程中,根据所述应用可执行文件、所述服务框架层可执行文件以及所述内核可执行文件的空间大小,确定将所述目标组件编译在所述应用可执行文件、所述服务框架层可执行文件或所述内核可执行文件中。
- 根据权利要求10所述的系统,其特征在于,所述根据所述应用可执行文件、所述服务框架层可执行文件以及所述内核可执行文件的空间大小,确定将所述目标组件编译在所述应用可执行文件、所述服务框架层可执行文件或所述内核可执行文件中,包括:将所述目标组件编译在所述应用可执行文件、所述服务框架层可执行文件以及所述内核可执行文件中空间大小最小的可执行文件中。
- 一种升级装置,其特征在于,包括:解析模块,用于解析接收到的升级报文,得到升级组件类型和升级地址;获取模块,用于若所述升级组件类型为应用,根据所述升级地址,获取应用升级包;写入模块,用于将所述应用升级包写入所述应用所在的分区。
- 一种计算机终端,其特征在于,包括:处理器;以及存储器,与所述处理器连接,用于为所述处理器提供处理以下处理步骤的指令:解析接收到的升级报文,得到升级组件类型和升级地址;若所述升级组件类型为应用,根据所述升级地址,获取应用升级包;将所述应用升级包写入所述应用所在的分区。
- 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求1至7中任意一项所述的升级方法。
- 一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时执行权利要求1至7中任意一项所述的升级方法。
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710885055.9 | 2017-09-26 | ||
CN201710885055 | 2017-09-26 | ||
CN201710938082.8 | 2017-09-30 | ||
CN201710938082.8A CN109558160A (zh) | 2017-09-26 | 2017-09-30 | 升级方法、嵌入式系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019062703A1 true WO2019062703A1 (zh) | 2019-04-04 |
Family
ID=65864231
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/106657 WO2019062635A1 (zh) | 2017-09-26 | 2018-09-20 | 升级方法和装置 |
PCT/CN2018/107291 WO2019062703A1 (zh) | 2017-09-26 | 2018-09-25 | 升级方法、嵌入式系统 |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/106657 WO2019062635A1 (zh) | 2017-09-26 | 2018-09-20 | 升级方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109558160A (zh) |
WO (2) | WO2019062635A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134426A (zh) * | 2019-04-18 | 2019-08-16 | 深圳市致宸信息科技有限公司 | 一种嵌入式系统升级方法、装置及终端设备 |
CN110187909A (zh) * | 2019-06-03 | 2019-08-30 | 山东海格尔信息技术股份有限公司 | 一种基于安卓系统的单片机固件升级方法 |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275728B (zh) * | 2019-06-28 | 2023-11-07 | 瓴盛科技有限公司 | 更新固件的系统及其方法 |
CN112559002A (zh) * | 2019-09-26 | 2021-03-26 | 上海汽车集团股份有限公司 | 车辆应用的更新方法、设备及存储介质 |
CN110442548B (zh) * | 2019-10-09 | 2020-01-24 | 广东高云半导体科技股份有限公司 | 片上系统及其接口数据处理方法和装置 |
CN110764813A (zh) * | 2019-10-31 | 2020-02-07 | 京东方科技集团股份有限公司 | 系统软件的升级方法及其运行方法 |
CN110990036A (zh) * | 2019-11-12 | 2020-04-10 | 上海钧正网络科技有限公司 | 换电柜ota升级方法、装置、换电设备和存储介质 |
CN111050313A (zh) * | 2019-12-05 | 2020-04-21 | 上海新微技术研发中心有限公司 | 低速率无线通信快速ota的方法 |
CN111045712A (zh) * | 2019-12-17 | 2020-04-21 | 杭州涂鸦信息技术有限公司 | 一种具有备份功能的单系统升级方法及系统 |
CN112256283A (zh) * | 2020-09-27 | 2021-01-22 | 苏宁智能终端有限公司 | 用于Android设备的应用版本管控方法及装置 |
CN112416392A (zh) * | 2020-11-17 | 2021-02-26 | 四川长虹电器股份有限公司 | 一种基于端云的终端固件动态加载方法 |
CN112631637B (zh) * | 2020-12-30 | 2024-04-02 | 重庆芯讯通无线科技有限公司 | 基于rtos的ota升级方法、系统、设备及存储介质 |
CN113885921A (zh) * | 2021-11-09 | 2022-01-04 | 南京慧尔视智能科技有限公司 | 一种嵌入式系统更新的方法及设备 |
CN114253590A (zh) * | 2021-11-24 | 2022-03-29 | 青岛海尔科技有限公司 | 嵌入式软件的加密式差分升级方法、装置、设备及介质 |
CN115442353B (zh) * | 2022-11-07 | 2023-06-16 | 成都睿乐达机器人科技有限公司 | 一种基于物联网设备的应用升级方法及装置 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102253850A (zh) * | 2011-07-08 | 2011-11-23 | 烽火通信科技股份有限公司 | Iptv机顶盒增量式软件升级方法 |
US20130185563A1 (en) * | 2012-01-12 | 2013-07-18 | Gueorgui Djabarov | Multiple System Images for Over-The-Air Updates |
CN103313229A (zh) * | 2013-05-27 | 2013-09-18 | 华为终端有限公司 | 一种空中下载技术升级的方法及设备 |
CN103580921A (zh) * | 2013-11-08 | 2014-02-12 | 深圳市共进电子股份有限公司 | 一种网络设备自动升级的方法及自动升级系统 |
CN105208447A (zh) * | 2015-09-28 | 2015-12-30 | 北京赛科世纪科技股份有限公司 | 机顶盒升级方法、装置及机顶盒 |
CN105227600A (zh) * | 2014-06-17 | 2016-01-06 | 上海酷宇通讯技术有限公司 | 移动设备系统升级的方法 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014176731A1 (en) * | 2013-04-28 | 2014-11-06 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for upgrading application |
CN104679530B (zh) * | 2013-11-26 | 2017-12-29 | 英业达科技有限公司 | 服务器系统与固件更新方法 |
CN103995721B (zh) * | 2014-05-22 | 2018-01-23 | 广州金山网络科技有限公司 | 一种应用程序的升级方法、装置及系统 |
CN104536775A (zh) * | 2014-11-26 | 2015-04-22 | 四川长虹电器股份有限公司 | 一种Android平台下预置应用的升级方法及系统 |
CN104750527A (zh) * | 2015-03-27 | 2015-07-01 | 广州快飞计算机科技有限公司 | 一种嵌入式系统升级方法及系统 |
CN106484450A (zh) * | 2015-08-28 | 2017-03-08 | 青岛海信移动通信技术股份有限公司 | 一种软件升级方法及装置 |
CN105867962A (zh) * | 2015-12-07 | 2016-08-17 | 乐视移动智能信息技术(北京)有限公司 | 系统升级的方法和装置 |
CN106020884A (zh) * | 2016-05-20 | 2016-10-12 | 江苏华辉云控科技有限公司 | 网络摄像机系统在线升级方法 |
CN106201586B (zh) * | 2016-06-28 | 2019-12-20 | 青岛海信移动通信技术股份有限公司 | 一种基于ota的系统升级方法及终端、系统 |
-
2017
- 2017-09-30 CN CN201710938082.8A patent/CN109558160A/zh active Pending
-
2018
- 2018-09-20 WO PCT/CN2018/106657 patent/WO2019062635A1/zh active Application Filing
- 2018-09-25 WO PCT/CN2018/107291 patent/WO2019062703A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102253850A (zh) * | 2011-07-08 | 2011-11-23 | 烽火通信科技股份有限公司 | Iptv机顶盒增量式软件升级方法 |
US20130185563A1 (en) * | 2012-01-12 | 2013-07-18 | Gueorgui Djabarov | Multiple System Images for Over-The-Air Updates |
CN103313229A (zh) * | 2013-05-27 | 2013-09-18 | 华为终端有限公司 | 一种空中下载技术升级的方法及设备 |
CN103580921A (zh) * | 2013-11-08 | 2014-02-12 | 深圳市共进电子股份有限公司 | 一种网络设备自动升级的方法及自动升级系统 |
CN105227600A (zh) * | 2014-06-17 | 2016-01-06 | 上海酷宇通讯技术有限公司 | 移动设备系统升级的方法 |
CN105208447A (zh) * | 2015-09-28 | 2015-12-30 | 北京赛科世纪科技股份有限公司 | 机顶盒升级方法、装置及机顶盒 |
Non-Patent Citations (1)
Title |
---|
CAPTAIN DUCK: "Principle of Linux Syscall (quote)", LINUX (SYSCALL, 13 March 2017 (2017-03-13), Retrieved from the Internet <URL:http:/www.cnblogs.com/z11991/p/6543634.html> * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134426A (zh) * | 2019-04-18 | 2019-08-16 | 深圳市致宸信息科技有限公司 | 一种嵌入式系统升级方法、装置及终端设备 |
CN110187909A (zh) * | 2019-06-03 | 2019-08-30 | 山东海格尔信息技术股份有限公司 | 一种基于安卓系统的单片机固件升级方法 |
CN110187909B (zh) * | 2019-06-03 | 2023-04-14 | 山东海格尔信息技术股份有限公司 | 一种基于安卓系统的单片机固件升级方法 |
Also Published As
Publication number | Publication date |
---|---|
WO2019062635A1 (zh) | 2019-04-04 |
CN109558160A (zh) | 2019-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019062703A1 (zh) | 升级方法、嵌入式系统 | |
US8539471B2 (en) | Updating firmware of an electronic device | |
WO2017067448A1 (zh) | 一种无线固件升级方法、系统及计算机存储介质 | |
KR101143112B1 (ko) | 페일세이프 방식으로 맞춤 소프트웨어 영상 갱신을불휘발성 저장 장치에 적용하는 시스템 및 방법 | |
KR100584338B1 (ko) | 소프트웨어 업데이트 방법 및 시스템 | |
US7971199B1 (en) | Mobile device with a self-updating update agent in a wireless network | |
US8136108B2 (en) | Updating firmware with multiple processors | |
US10437580B2 (en) | Software updating methods and systems | |
US20040123282A1 (en) | Mobile handset with a fault tolerant update agent | |
KR20100066576A (ko) | 펌웨어 이미지 갱신 및 관리 | |
CN108509215B (zh) | 一种系统软件的更换方法、装置、终端设备及存储介质 | |
CN104918114A (zh) | 一种操作系统升级方法及装置 | |
CN111813428A (zh) | 终端固件的升级方法、装置、电子设备及存储介质 | |
TW201621647A (zh) | 作業系統更新方法 | |
CN110007935B (zh) | 一种程序升级的处理方法、装置及设备 | |
RU2635891C2 (ru) | Механизм инсталляции и формат пакета для распараллеливаемых надежных инсталляций | |
KR100986487B1 (ko) | 고장 허용 갱신 에이전트를 구비한 모바일 핸드세트 | |
CN106293790B (zh) | 基于Firefox操作系统的应用程序升级方法和装置 | |
WO2024131374A1 (zh) | 机顶盒跨系统升级方法、装置、机顶盒及存储介质 | |
WO2024148863A1 (zh) | 镜像的编译方法、装置、非易失性可读存储介质及电子设备 | |
WO2019183806A1 (zh) | 资源权限处理方法、装置、存储介质及芯片 | |
CN103559059A (zh) | 一种快速的免介质Linux系统升级方法 | |
WO2023198056A1 (zh) | 嵌入式设备固件更新方法以及嵌入式设备 | |
WO2023092994A1 (zh) | 嵌入式软件的加密式差分升级方法、装置、设备及介质 | |
CN108270832B (zh) | 一种故障重放方法和装置 |
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: 18860431 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: 18860431 Country of ref document: EP Kind code of ref document: A1 |