WO2018032460A1 - Device remote upgrade method, apparatus and system - Google Patents

Device remote upgrade method, apparatus and system Download PDF

Info

Publication number
WO2018032460A1
WO2018032460A1 PCT/CN2016/095866 CN2016095866W WO2018032460A1 WO 2018032460 A1 WO2018032460 A1 WO 2018032460A1 CN 2016095866 W CN2016095866 W CN 2016095866W WO 2018032460 A1 WO2018032460 A1 WO 2018032460A1
Authority
WO
WIPO (PCT)
Prior art keywords
nandflash
kernel
remote
configuration information
upgrade
Prior art date
Application number
PCT/CN2016/095866
Other languages
French (fr)
Chinese (zh)
Inventor
韩昌刚
段勇军
夏春
Original Assignee
深圳中兴力维技术有限公司
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 深圳中兴力维技术有限公司 filed Critical 深圳中兴力维技术有限公司
Priority to PCT/CN2016/095866 priority Critical patent/WO2018032460A1/en
Publication of WO2018032460A1 publication Critical patent/WO2018032460A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present invention relates to the field of power environment monitoring, and in particular, to a remote upgrade method, device, and system thereof based on a NandFlash driving device.
  • NandFlash non-linear flash memory, or flash memory, or data
  • a NandFlash-driven device such as a FSU (Field Supervision Unit)) Storage flash memory
  • a large number of bad blocks appear on the storage medium, so that the device's N and Flash memory is occupied, there is no extra space to store useful information.
  • NandFlash has a lot of bad blocks, it will print a lot of bad blocks.
  • the information when the printing time exceeds a certain time (for example, 5 seconds), will cause the watchdog to reset, the device will restart, but it will not be fully started, resulting in failure to start, resulting in the device not working properly.
  • the technical problem to be solved by the present invention is to provide a remote upgrade method, device and system based on the NandFlash driving device, which can enable maintenance personnel to use the processing device in the remote network environment without using the lower station processing device. , Realize remote online upgrade, easy to operate, save manpower, and save operating costs.
  • the present invention provides a remote upgrade based on a NandFlash driving device.
  • the method includes:
  • the NandFlash driver device is remotely upgraded.
  • remotely upgrading the NandFlash driving device including:
  • the remote operation erasing tool erases data in the NandFlash driving device
  • the remote operation programming tool writes NandFlash data
  • the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed
  • the NandFlash partition the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
  • the remote operation erasing tool erases data in the NandFlash driving device, including:
  • the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
  • the remote operation programming tool writes the NandFlash data, including:
  • the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the live running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
  • the present invention provides a remote upgrade device based on a NandFlash driving device, the device comprising: a conversion module, an upgrade module;
  • the conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state;
  • the upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
  • the upgrade module comprises an erasing module, a programming module, and a recovery module, wherein:
  • an erasing module configured to remotely operate the erasing tool to erase data in the NandFlash driving device
  • a programming module configured to remotely operate the programming tool to write NandFlash data, and obtain on-site running configuration information, and remotely save to a designated space of the NandFlash;
  • the recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the live running configuration information.
  • the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed
  • the NandFlash partition the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
  • the erasing module is configured to remotely operate the erasing tool to erase data in the NandFlash driving device, specifically for:
  • the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
  • the programming module is configured to remotely write the NandFlash data through a specific remote programming tool, and obtain the on-site running configuration information, and remotely save the specified space to the NandFlash, specifically for:
  • the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the live running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
  • the recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the site running configuration information, specifically for:
  • the download remote erasing tool and the remote programming tool adopt the following storage methods:
  • the memory is mapped to the medium for saving the file.
  • the present invention further provides a remote upgrade system based on a NandFlash drive device, the system includes: an upgrade device, a NandFlash drive device, wherein the upgrade device is configured to convert an operation state, and the operation is performed The user mode enters the kernel state, and in the kernel state operation state, the NandFlash driver device is remotely upgraded.
  • the upgrading apparatus comprises: a conversion module, an upgrade module;
  • the conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state;
  • the upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
  • the upgrade module comprises an erasing module, a programming module, and a recovery module, wherein:
  • an erasing module configured to remotely operate the erasing tool to erase data in the NandFlash driving device
  • a programming module configured to remotely operate the programming tool to write NandFlash data, and obtain on-site running configuration information, and remotely save to a designated space of the NandFlash;
  • the recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the field running configuration information.
  • the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed
  • the NandFlash partition the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
  • the erasing module is configured to remotely operate the erasing tool to erase data in the NandFlash driving device, specifically for:
  • the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
  • the programming module is configured to remotely write the NandFlash data through a specific remote programming tool, and obtain the on-site running configuration information, and remotely save the specified space to the NandFlash, specifically for:
  • the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the field running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
  • the recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the site running configuration information, specifically for:
  • the system further comprises a memory device, wherein the memory device is configured to store an upgrade file of the upgrade device, the upgrade file in the upgrade device, the remote wipe tool, and the remote programming tool are downloaded by using the following storage manner: in the NandFlash driver
  • the device has no extra space to store files using NandFlash media, and maps the memory to the medium where the files are saved.
  • the tmpfs virtual file system using the memory as a file storage medium is used to store the files, and all the upgrade files are placed in the virtual file system.
  • the remote upgrade scheme based on the NandFlash driving device enables the operation to enter the kernel state from the user state in the application based on the NandFlash driving device by using the conversion operation state, and operates the NandFlash structure and the kernel in the kernel. Handle and kernel related hardware data structure; and in the kernel state operation state, using the remote erasing tool of the present invention to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data, thereby The purpose of remotely upgrading the Na ndFlash drive device is achieved.
  • the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved; ⁇ , also provides a stable use of the kernel backup function, so that when a kernel data is corrupted, it can be quickly booted from another kernel backup space, greatly reducing the failure rate, and solving the scene often fails to start due to kernel damage. Failure problem.
  • FIG. 1 is a flowchart of a remote upgrade method based on a NandFlash driving device according to an embodiment of the present invention.
  • FIG. 2 is a structural diagram of an OOB according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of an upgrade of a remote upgrade method based on a NandFlash driving device according to an embodiment of the present invention.
  • FIG. 4 is a flow chart showing a method for applying a remote upgrade method based on a NandFlash driving device to a remote upgrade application system according to the present invention.
  • FIG. 5 is a schematic structural diagram of a remote upgrade device based on a NandFlash driving device according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a remote upgrade system based on a NandFlash driving device according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a dual-core booting based on a NandFlash driving device according to an embodiment of the present invention.
  • An embodiment of the present invention provides a remote upgrade method based on a NandFlash driving device, where the method includes:
  • S1 Converting the operation state, and causing the operation to enter the kernel state from the user state.
  • the user state enters the kernel state, and the NandFlash structure, the kernel handle, and the kernel-related hardware data structure are operated in the kernel.
  • S2 The NandFlash driver device is remotely upgraded in the kernel state operation state. Includes:
  • S21 The remote operation erasing tool erases data (logical bad block) in the NandFlash driving device. Specific steps:
  • S211 In the kernel state operation state, determine a handle of the NandFlash, and find a NandFlash bad block table BBT (Bad Block Table) that marks the bad block information in the kernel.
  • BBT Bit Block Table
  • S212 In the kernel state operation state, remotely operate the remote erasing tool emseko.so, and erase the kernel N and Flash bad blocks.
  • the specific process is as follows:
  • the remote erasing tool emseko.so is a specific function of the present invention, and its main function is to remotely erase data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash in the kernel.
  • a logical bad block that erases the NandFlash partitions that specify the start and end positions as needed.
  • OOB Out Of Band
  • OOB front end 2 bytes is OxFF OxFF, which is used to identify non-bad blocks; every 256 bytes of data requires 3 bytes of ECC (Error Checking and Correction) check, 8, 9, 10 is the 512 bytes of the first half of the ECC check code ; 13,14,15ecc2[3] is the ECC check code of the latter half of 512 bytes.
  • Bad blocks are managed using BBT.
  • OOB is the data that each page has, but BBT corresponds to each NandFlash, Lin ux automatically creates BBT table, which is convenient for bad block management. Before erasing NandFlash, you must obtain BB T and clear the logical bad block management information. , in order to successfully erase the logical bad block.
  • S221 Download the remote programming tool Nandwrite to the NandFlash-based device, and download the kernel (linux) and file system (yaffs) to the device.
  • S222 remotely burning the kernel (linux) and the file system (yaffs) into the NandFlash driving device by using the remote programming tool Nandwrite, and simultaneously writing the verification information into the NandFlash driving device during the synchronization of the programming.
  • the verification information is verified by u-boot after the NandFlash driver is started.
  • the verification method is as follows: In general, in the remote programming tool Nandwrite, the ECC check function in the OOB (refer to FIG. 2) and the verification based on the u-boot on the NandFlash-driven device system. The function is inconsistent. After the kernel linux and file system yaffs written by the remote programming tool Nandwrite, the u-boot checksum cannot be obtained, and the NandFlash drive device system cannot be started normally. In the present invention, the remote programming tool Nandwrite tool is modified and optimized, so that the verification codes of the u-boot, the kernel, and the nandwr ite are consistent, and a specific remote programming tool Nandwrite is formed, so that the NandFla sh driving device system can be ensured. Normal start.
  • the remote programming tool Nandwrite is a specific function of the present invention, and its main function is to remotely write NandFlash data, and make the verification codes of the u-boot, the kernel, and the remote programming tool consistent. Specifically, including:
  • B data can be verified after the kernel is started
  • S23 Acquire the on-site running configuration information, and save it to the specified space of the NandFlash remotely. [0100] Obtaining on-site running configuration information, the on-site running configuration information includes IP information, various collection amounts, configuration of sensors, and related configuration information of the driving device. Specific steps:
  • the kernel and/or the file system will be rewritten, and the mapping table between the kernel and the NandFlash will be changed, which may result in the loss of the original data file, including the field running configuration information. After restarting the application, the saved file information will be lost. Therefore, you need to save the live running configuration information before upgrading.
  • the field running configuration information data including the IP information is stored in a space that has not been used in the u-boot partition of the NandFlash driving device, that is, the designated space refers to the u-boot of the NandFlash driving device.
  • the live operation configuration information including the on-site IP information is saved in the u-boot. In the NandFlash used, this ensures that these field running configuration information data will not be erased or overwritten during the upgrade process.
  • the remote erase tool eraseko.so and the remote programming tool Nandwrite can use the following storage methods:
  • NandFlash Due to the long running of the device and the NandFlash operation, NandFlash has a large number of logical bad blocks, based on NandFlash.
  • the NandFlash of the drive device has reached 100%, and the file cannot be stored using NandFlash media.
  • the NandFlash media cannot be used to store files.
  • the solution is to use memory to store files and map the memory to a medium that can save files.
  • the tmpfs virtual file system is used.
  • the file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
  • S242 Clear the field running configuration information saved in the u-boot designated space, and prevent the device system from repeatedly reading after the next startup.
  • S242 Please refer to FIG. 3.
  • the embodiment of the invention provides a remote upgrade method based on a NandFlash driving device, and the method includes:
  • S11 First, it is determined whether an upgrade is needed. If the usage rate of NandFlash is too high, for example, 95 ⁇ 3 ⁇ 4, it indicates that an upgrade is required, and the process proceeds to S12; otherwise, it indicates that an upgrade is not required.
  • S12 Establish a tmpfs virtual file system, which is used to store files required for the related upgrade.
  • S13 Download the upgrade file (kernel linux, system file yaffs, remote programming tool Nan dwrite, remote wipe tool eraseko.so) to the device using the FTP tool.
  • upgrade file kernel linux, system file yaffs, remote programming tool Nan dwrite, remote wipe tool eraseko.so
  • S16 Remotely save the live running configuration information including the IP information and the like to the NandFlash designated space.
  • S17 Restart the device, and restore related field operation configuration information before the upgrade.
  • the embodiment of the present invention provides a remote upgrade device based on a NandFlash driving device.
  • the upgrade device 100 is configured to convert an operation state, and the operation is changed from a user state to a kernel state, and the NandFlash driver device is remotely upgraded in a kernel state operation state. .
  • the upgrading apparatus 100 includes: a conversion module 10, an upgrade module 20;
  • the conversion module 10 is configured to convert an operation state, and the operation enters a kernel state from a user state; and operate a NandFlash structure, a kernel handle, and a kernel-related hardware data structure in a kernel state.
  • the upgrade module 20 is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
  • the upgrade module 20 includes: an erase module 22, a programming module 23, and a recovery module 24, wherein:
  • the erasing module 22 is configured to remotely operate the erasing tool to erase data (logical bad blocks) in the NandFlash driving device.
  • the programming module 23 is used for remotely operating the remote programming tool. Nandwrite writes the NandFlash data, and obtains the live running configuration information, and saves it to the designated space of the NandFlash remotely.
  • the recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
  • the erasing module 22 is configured to remotely operate the erasing tool eraseko.so to erase data (logical bad blocks) in the NandFlash driving device. Specifically used for: [0126] In the kernel state operation state, the handle of the NandFlash is determined, and the Nan dFlash bad block table BBT (Bad Block Table) that marks the bad block information in the kernel is found.
  • BBT Bit Block Table
  • the remote wipe tool eraseko.so is remotely operated, and the kernel's NandFlas h bad block is erased.
  • the specific process is as follows:
  • the programming module 23 is configured to remotely write the NandFlash data through a specific remote programming tool Nandwrite, and obtain the on-site running configuration information, and save the data to the specified space of the NandFlash remotely. Specifically used for:
  • the on-site configuration information includes IP information, various acquisition quantities, sensor configuration, and configuration information for the drive device.
  • the field running configuration information data including the IP information is saved in the space of the u-boot partition of the NandFlash driving device that has not been used, that is, the specified space is not yet in the u-boot partition of the NandFlash driving device. The space being used.
  • the remote erasing tool eraseko.so and the remote programming tool Nandwrite can adopt the following storage methods:
  • the NandFlash driving device has no extra space to use NandFlash media to store files, the solution is to use memory to store files, and to store the memory.
  • the t mpfs virtual file system is used.
  • the file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
  • the recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
  • the specific process is as follows:
  • the embodiment of the invention provides a remote upgrade system based on a NandFlash drive device, and the upgrade system includes: an upgrade device 100, a NandFlash drive device 200, and a memory device 300.
  • the upgrading apparatus 100 is configured to convert an operation state, enter an operation from a user state to a kernel state, and remotely upgrade the NandFlash driving device 200 in a kernel state operation state.
  • the memory device 300 is configured to store the file used by the upgrade device 100 for upgrading; the NandFlash drive device 200 has no unnecessary space to use the NandFlash media to store files, and the upgrade file of the upgrade device 100 is stored, including the upgrade file, and remotely erased.
  • the tool and the remote programming tool; the specific method is: mapping the memory device 300 into a medium that can save the file; specifically, using the tmpfs virtual file system, the file system uses the memory as the storage medium of the file system, and places all the upgrade files in In the virtual file system.
  • the upgrading apparatus 100 includes: a conversion module 10, an upgrade module 20;
  • the conversion module 10 is configured to convert an operation state, and the operation enters a kernel state from a user state; and operate a NandFlash structure, a kernel handle, and a kernel-related hardware data structure in a kernel state.
  • the upgrade module 20 is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
  • the upgrade module 20 includes: an erase module 22, a programming module 23, and a recovery module 24, wherein:
  • the erasing module 22 is configured to remotely operate the erasing tool to erase data (logical bad blocks) in the NandFlash driving device.
  • the programming module 23 is used for remotely operating the remote programming tool. Nandwrite writes the NandFlash data, and obtains the live running configuration information, and saves it to the specified space of the NandFlash remotely.
  • the recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
  • the erasing module 22 for remotely operating the erasing tool, eraseko.so, erases data (logical bad blocks) in the NandFlash driving device. Specifically used for:
  • the handle of the NandFlash is determined, and the Nan dFlash bad block table BBT (Bad Block Table) indicating the bad block information in the kernel is found.
  • the remote erasing tool eraseko.so is remotely operated, and the kernel's NandFlas h bad block is erased. The specific process is as follows:
  • the programming module 23 is configured to remotely write NandFlash data through a specific remote programming tool Nandwrite
  • the verification information is also written to the NandFlash driver device during the synchronization of the programming, and the verification information is verified by the u-boot after the NandFlash driver device is started.
  • the on-site configuration information includes IP information, various acquisition quantities, sensor configuration, and configuration information for the drive device.
  • the field running configuration information data including IP information is saved in the NandFlash driving device.
  • the specified space refers to the U of the NandFlash driver.
  • the remote erasing tool eraseko.so and the remote programming tool Nandwrite can adopt the following storage methods:
  • the NandFlash driving device has no extra space to use NandFlash media to store files, the solution is to use memory to store files, and to store the memory.
  • the t mpfs virtual file system is used.
  • the file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
  • the recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
  • the specific process is as follows:
  • a remote upgrade method based on a NandFlash driving device provided according to the present invention is applied to a method for remotely upgrading an application system. The method includes:
  • the new application system can generally upgrade the kernel (linux) and/or the upgrade file system (y affs), and the upgrade method is upgraded by using the NandFlash-based device-based remote upgrade method provided by the present invention:
  • yaffs is mainly used to store files and related programs. For the related programs of the device, you can upgrade from the original program to the newly modified program, and you can add new programs and add new functions.
  • the upgraded new kernel and file system, the modification may include repartitioning the NandFlash partition, deleting the kernel module, adding new monitoring functions, and the like.
  • S24 Upgrade to l.x+, upgrade from 1.x version to l.x+ version.
  • the kernel and the file system do not change much, mainly to slightly modify the kernel, or modify the device.
  • the main program to solve some kind of failure.
  • the upgrade method used in the above S21 to S26 upgrade is performed by using the remote upgrade method based on the NandFlash driver device provided by the present invention.
  • the method and process involved in the upgrade process are detailed in the foregoing embodiments of the present invention. Description, the description will not be repeated here.
  • the tools used in the upgrade (remote programming tool NandFlash, remote wipe tool eraseko.so, tmpfs virtual file system) System tool, one-click upgrade script update), remote programming tool Nandwrite, remote wipe tool erase ko.so, one-click upgrade script update is a unique feature of the present invention, wherein, one-click upgrade script (upda te) mainly Is to put all the operations in the script, upgrade ⁇ , start the script, you can automatically complete the upgrade
  • the upgrade system's networking also needs to restore the on-site configuration information, especially the various acquisitions, sensor configuration, and related configuration of the smart device.
  • a dual-core booting method based on a NandFlash driving device comprising: [0176] S31: u-boot normally loads the NandFlash kernel.
  • S32 Check whether the normal zone kernel is normal. If it is normal, go to S33 for processing; if it is not normal, go to S34 for processing.
  • S33 erasing the backup area, using the remote erasing tool emseko.so of the present invention to erase the backup area by remote, and then using the remote programming tool Nandwrite of the present invention to program the normal area kernel data remotely. Backup area; After completion, transfer to S38.
  • S34 Check whether the kernel of the backup area is normal. If it is normal, go to S53 for processing; if it is not normal, go to S37 for processing.
  • S35 u-boot loads the kernel from the backup area.
  • S36 erasing the normal area data, and writing the backup area kernel data to the normal area kernel; and transferring to S38.
  • the remote upgrade scheme based on the NandFlash driving device enables the operation to enter the kernel state from the user state in the application based on the NandFlash driving device by using the conversion operation state, and operates the NandFlash structure and the kernel in the kernel. Handle and kernel related hardware data structure; and in the kernel state operation state, using the remote erasing tool of the present invention to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data, thereby The purpose of remotely upgrading the Na ndFlash drive device is achieved.
  • the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved; ⁇ , also provides a stable use of kernel backup function, so that when a kernel data is corrupted, you can quickly back up space from another kernel. Startup, greatly reducing the failure rate, and solving the problem that the site often fails to start due to kernel damage.
  • the remote upgrade solution based on the NandFlash driving device provided by the present invention can be applied to the power environment monitoring fields such as a telecommunication room, an I DC room, a railway, a power, etc., and relates to a technical field such as a u-boot, a kernel, a file system, and a N and Flash.
  • FSU Field Supervision Unit
  • a remote upgrade scheme based on the NandFlash driving device provided by the embodiment of the present invention, by using a conversion operation state, the operation is changed from the user state to the kernel state in the application based on the NandFlash driving device, and the NandFlash structure is operated in the kernel. Kernel handle and kernel-related hardware data structure; and in the kernel state operation state, the remote wiping tool of the present invention is used to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data. In order to achieve the purpose of remotely upgrading the NandFlash driver device.
  • the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved; ⁇ , also provides a stable use of the kernel backup function, so that when a kernel data is corrupted, it can be quickly booted from another kernel backup space, greatly reducing the failure rate, and solving the scene often fails to start due to kernel damage. Failure problem.

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)

Abstract

The present invention relates to the field of power environment monitoring. Disclosed are a NandFlash drive device-based remote upgrade method, apparatus and system. The NandFlash drive device-based remote upgrade method comprises: converting an operation state so that the operation enters a kernel mode from a user mode; and upgrading a NandFlash drive device remotely in the operation state of the kernel mode. The present invention also provides a NandFlash drive device-based remote upgrade apparatus and system. According to a NandFlash drive device-based remote upgrade solution provided by the present invention, maintenance personnel can achieve remote online upgrade in a remote networking environment without processing the device on site, the operation is simple, and the labor and the running costs are saved.

Description

发明名称:一种设备的远程升级方法、 装置及*** 技术领域  Title of Invention: Method, Device and System for Remote Upgrade of Equipment
[0001] 本发明涉及动力环境监控领域, 尤其涉及一种基于 NandFlash驱动设备的远程 升级方法、 装置及其***。  [0001] The present invention relates to the field of power environment monitoring, and in particular, to a remote upgrade method, device, and system thereof based on a NandFlash driving device.
背景技术  Background technique
[0002] 在动力环境监控应用中, 基于 NandFlash驱动设备 (例如 FSU (Field Supervision Unit, 区域智能监控单元) ) 经过长吋间的运行后, NandFlash (非线性闪存, 或快闪记忆体, 或资料储存型闪存) 存储介质会出现大量的坏块, 以致设备的 N andFlash内存被占用完, 没有多余的空间来存放有用的信息; 同吋当 NandFlash出 现大量坏块吋, 会打印出大量的坏块信息, 打印吋间超过一定吋间 (例如 5秒) , 会导致看门狗复位, 设备不停重启, 却不能真正完全启动, 导致启动不了, 导致设备无法正常工作。  [0002] In a power environment monitoring application, NandFlash (non-linear flash memory, or flash memory, or data) after a long-running operation based on a NandFlash-driven device (such as a FSU (Field Supervision Unit)) Storage flash memory) A large number of bad blocks appear on the storage medium, so that the device's N and Flash memory is occupied, there is no extra space to store useful information. When NandFlash has a lot of bad blocks, it will print a lot of bad blocks. The information, when the printing time exceeds a certain time (for example, 5 seconds), will cause the watchdog to reset, the device will restart, but it will not be fully started, resulting in failure to start, resulting in the device not working properly.
[0003] 为了清除这些坏块, 通常需要升级内核和 /或文件***来解决。 目前, 升级内 核和 /或文件***的一般做法是需要维护人员下站到基站现场进行升级操作, 例 如, 下站换设备板子, 或者现场进行烧片。 这种操作方案操作复杂, 费吋, 特 别对于一些比较偏远的站点, 下站维护成本高。  [0003] In order to clear these bad blocks, it is usually necessary to upgrade the kernel and / or file system to solve. Currently, the general practice of upgrading the kernel and/or file system is to require maintenance personnel to go to the base station for upgrade operations, for example, to change the equipment board at the next station, or to burn the film on site. This kind of operation scheme is complicated and expensive, especially for some relatively remote sites, and the maintenance cost of the lower station is high.
[0004] 鉴于此, 有必要提供一种新的基于 NandFlash驱动设备的远程升级方法, 以便 可以让维护人员不用下站处理设备, 通过在远端联网的环境下, 实现远程在线 升级, 操作简单, 节省人力, 节约运行成本。  [0004] In view of this, it is necessary to provide a new remote upgrade method based on the NandFlash driving device, so that the maintenance personnel can implement the remote online upgrade in the remote networked environment without using the lower station processing device, and the operation is simple. Save manpower and save operating costs.
技术问题  technical problem
[0005] 有鉴于此, 本发明要解决的技术问题是提供一种基于 NandFlash驱动设备的远 程升级方法、 装置及其***, 可以让维护人员不用下站处理设备, 通过在远端 联网的环境下, 实现远程在线升级, 操作简单, 节省人力, 节约运行成本。 问题的解决方案  [0005] In view of this, the technical problem to be solved by the present invention is to provide a remote upgrade method, device and system based on the NandFlash driving device, which can enable maintenance personnel to use the processing device in the remote network environment without using the lower station processing device. , Realize remote online upgrade, easy to operate, save manpower, and save operating costs. Problem solution
技术解决方案  Technical solution
[0006] 为了解决上述技术问题, 本发明提供一种基于 NandFlash驱动设备的远程升级 方法, 该方法包括: [0006] In order to solve the above technical problem, the present invention provides a remote upgrade based on a NandFlash driving device. Method, the method includes:
[0007] 转换操作状态, 使操作从用户态进入内核态;  [0007] converting the operation state, causing the operation to enter the kernel state from the user state;
[0008] 在内核态操作状态下, 远程升级 NandFlash驱动设备。 [0008] In the kernel mode operation state, the NandFlash driver device is remotely upgraded.
[0009] 其中, 在内核态操作状态下, 远程升级 NandFlash驱动设备, 包括: [0009] Wherein, in the kernel state operation state, remotely upgrading the NandFlash driving device, including:
[0010] 远程操作擦除工具擦除 NandFlash驱动设备中的数据; [0010] the remote operation erasing tool erases data in the NandFlash driving device;
[0011] 远程操作烧写工具写入 NandFlash数据; [0011] the remote operation programming tool writes NandFlash data;
[0012] 获取现场运行配置信息, 远程保存到 NandFlash的指定空间; [0012] obtaining on-site running configuration information, and saving to a specified space of the NandFlash remotely;
[0013] 读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配置信息。 [0013] Read the on-site running configuration information saved in the specified space of the NandFlash, and restore the on-site running configuration information.
[0014] 其中: 该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内核 中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指定起始位置和 结束位置的 NandFlash分区; 该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot. 内核、 远程烧写工具的校验码一致。 [0014] wherein: the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed The NandFlash partition; the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
[0015] 其中, 远程操作擦除工具擦除 NandFlash驱动设备中的数据, 包括:  [0015] wherein the remote operation erasing tool erases data in the NandFlash driving device, including:
[0016] 找到内核中标记坏块信息的 NandFlash坏块表 BBT; [0016] Find the NandFlash bad block table BBT marked in the kernel bad block information;
[0017] 在内核态操作状态下, 远程操作擦除工具清空 BBT中的表信息, 以及擦除内核 的 NandFlash的逻辑坏块。  [0017] In the kernel mode operation state, the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
[0018] 其中, 远程操作烧写工具写入 NandFlash数据, 包括: [0018] wherein the remote operation programming tool writes the NandFlash data, including:
[0019] 下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; [0019] downloading a remote programming tool, a kernel, and a file system to the NandFlash driver device;
[0020] 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中。 [0020] Remotely programming the kernel and file system into the NandFlash driver device using a remote programming tool.
[0021] 其中, 该指定空间是指 NandFlash驱动设备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据保存在 NandFlash驱动设备的 u-boot分区中尚未被使用 的空间。 [0021] wherein, the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the live running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
[0022] 其中, 读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配置 信息, 包括:  [0022] wherein, the field running configuration information saved in the designated space of the NandFlash is read, and the running operation configuration information is restored, including:
[0023] NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场运行配置 信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandFlash驱动设备的现场 运行配置信息;  [0023] After the NandFlash driver device is started, the related field running configuration information saved in the designated space of the NandFlash is read, and written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandFlash driving device is restored;
[0024] 清空 NandFlash指定空间保存的现场运行配置信息。 [0025] 其中, 下载远程擦除工具和远程烧写工具采用以下的存储方式: 在 NandFlash 驱动设备没有多余空间使用 NandFlash介质存储文件吋, 将内存映射成保存文件 的介质。 [0024] Clear the field running configuration information saved in the specified space of the NandFlash. [0025] wherein, the download remote erasing tool and the remote programming tool adopt the following storage methods: When the NandFlash driving device has no extra space to use the NandFlash media to store the file, the memory is mapped to the medium for saving the file.
[0026] 其中, 使用以内存作为文件存储介质的 tmpfs虚拟文件***来存储文件, 将所 有的升级文件放置在该虚拟文件***中。  [0026] wherein a file is stored using a tmpfs virtual file system using a memory as a file storage medium, and all upgrade files are placed in the virtual file system.
[0027] 为了解决上述技术问题, 本发明提供还一种基于 NandFlash驱动设备的远程升 级装置, 该装置包括: 转换模块, 升级模块; 其中: [0027] In order to solve the above technical problem, the present invention provides a remote upgrade device based on a NandFlash driving device, the device comprising: a conversion module, an upgrade module;
[0028] 该转换模块, 用于转换操作状态, 使操作从用户态进入内核态; [0028] the conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state;
[0029] 该升级模块, 用于在内核态操作状态下, 远程升级 NandFlash驱动设备。 [0029] The upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
[0030] 其中, 该升级模块包括擦除模块, 烧写模块, 恢复模块, 其中: [0030] wherein the upgrade module comprises an erasing module, a programming module, and a recovery module, wherein:
[0031] 擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据; [0031] an erasing module, configured to remotely operate the erasing tool to erase data in the NandFlash driving device;
[0032] 烧写模块, 用于远程操作烧写工具写入 NandFlash数据, 以及获取现场运行配 置信息, 远程保存到 NandFlash的指定空间; [0032] a programming module, configured to remotely operate the programming tool to write NandFlash data, and obtain on-site running configuration information, and remotely save to a designated space of the NandFlash;
[0033] 恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场 运行配置信息。 [0033] The recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the live running configuration information.
[0034] 其中: 该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内核 中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指定起始位置和 结束位置的 NandFlash分区; 该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot. 内核、 远程烧写工具的校验码一致。  [0034] wherein: the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed The NandFlash partition; the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
[0035] 其中, 擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据, 具体用于:  [0035] wherein, the erasing module is configured to remotely operate the erasing tool to erase data in the NandFlash driving device, specifically for:
[0036] 找到内核中标记坏块信息的 NandFlash坏块表 BBT;  [0036] Find the NandFlash bad block table BBT marked in the kernel bad block information;
[0037] 在内核态操作状态下, 远程操作擦除工具清空 BBT中的表信息, 以及擦除内核 的 NandFlash的逻辑坏块。  [0037] In the kernel mode operation state, the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
[0038] 其中, 烧写模块, 用于远程通过特定的远程烧写工具写入 NandFlash数据, 以 及获取现场运行配置信息, 远程保存到 NandFlash的指定空间, 具体用于: [0038] wherein, the programming module is configured to remotely write the NandFlash data through a specific remote programming tool, and obtain the on-site running configuration information, and remotely save the specified space to the NandFlash, specifically for:
[0039] 下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; [0039] downloading a remote programming tool, a kernel, and a file system to the NandFlash driver device;
[0040] 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中。 [0041] 其中, 该指定空间是指 NandFlash驱动设备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据保存在 NandFlash驱动设备的 u-boot分区中尚未被使用 的空间。 [0040] Remotely programming the kernel and file system into the NandFlash driver device using a remote programming tool. [0041] Wherein, the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the live running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
[0042] 其中, 恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢 复现场运行配置信息, 具体用于:  [0042] The recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the site running configuration information, specifically for:
[0043] NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场运行配置 信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandFlash驱动设备的现场 运行配置信息; [0043] After the NandFlash driver device is started, the related field running configuration information saved in the specified space of the NandFlash is read, and written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandFlash driving device is restored;
[0044] 清空 NandFlash指定空间保存的现场运行配置信息。  [0044] Clear the field running configuration information saved in the NandFlash specified space.
[0045] 其中, 下载远程擦除工具和远程烧写工具采用以下的存储方式: 在 NandFlash 驱动设备没有多余空间使用 NandFlash介质存储文件吋, 将内存映射成保存文件 的介质。  [0045] wherein, the download remote erasing tool and the remote programming tool adopt the following storage methods: When the NandFlash driving device has no extra space to use NandFlash media to store files, the memory is mapped to the medium for saving the file.
[0046] 其中, 使用以内存作为文件存储介质的 tmpfs虚拟文件***来存储文件, 将所 有的升级文件放置在该虚拟文件***中。  [0046] wherein the file is stored using the tmpfs virtual file system using the memory as a file storage medium, and all the upgrade files are placed in the virtual file system.
[0047]  [0047]
[0048] 为了解决上述技术问题, 本发明还提供一种基于 NandFlash驱动设备的远程升 级***, 该***包括: 升级装置, NandFlash驱动设备; 其中, 该升级装置, 用 于转换操作状态, 使操作从用户态进入内核态, 并在内核态操作状态下, 远程 升级 NandFlash驱动设备。  [0048] In order to solve the above technical problem, the present invention further provides a remote upgrade system based on a NandFlash drive device, the system includes: an upgrade device, a NandFlash drive device, wherein the upgrade device is configured to convert an operation state, and the operation is performed The user mode enters the kernel state, and in the kernel state operation state, the NandFlash driver device is remotely upgraded.
[0049] 其中, 该升级装置包括: 转换模块, 升级模块; [0049] wherein the upgrading apparatus comprises: a conversion module, an upgrade module;
[0050] 该转换模块, 用于转换操作状态, 使操作从用户态进入内核态; [0050] the conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state;
[0051] 该升级模块, 用于在内核态操作状态下, 远程升级 NandFlash驱动设备。 [0051] The upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state.
[0052] 其中, 该升级模块包括擦除模块, 烧写模块, 恢复模块, 其中: [0052] wherein the upgrade module comprises an erasing module, a programming module, and a recovery module, wherein:
[0053] 擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据; [0053] an erasing module, configured to remotely operate the erasing tool to erase data in the NandFlash driving device;
[0054] 烧写模块, 用于远程操作烧写工具写入 NandFlash数据, 以及获取现场运行配 置信息, 远程保存到 NandFlash的指定空间; [0054] a programming module, configured to remotely operate the programming tool to write NandFlash data, and obtain on-site running configuration information, and remotely save to a designated space of the NandFlash;
[0055] 恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场 运行配置信息。 [0056] 其中: 该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内核 中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指定起始位置和 结束位置的 NandFlash分区; 该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot. 内核、 远程烧写工具的校验码一致。 [0055] The recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the field running configuration information. [0056] wherein: the erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the specified starting position and ending position as needed The NandFlash partition; the programming tool is used to remotely write NandFlash data, and to make the verification codes of the u-boot. kernel and remote programming tools consistent.
[0057] 其中, 擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据, 具体用于:  [0057] wherein, the erasing module is configured to remotely operate the erasing tool to erase data in the NandFlash driving device, specifically for:
[0058] 找到内核中标记坏块信息的 NandFlash坏块表 BBT;  [0058] Find the NandFlash bad block table BBT that marks the bad block information in the kernel;
[0059] 在内核态操作状态下, 远程操作擦除工具清空 BBT中的标表信息, 以及擦除内 核的 NandFlash的逻辑坏块。  [0059] In the kernel mode operation state, the remote operation erase tool clears the table information in the BBT and erases the logical bad block of the kernel's NandFlash.
[0060] 其中, 烧写模块, 用于远程通过特定的远程烧写工具写入 NandFlash数据, 以 及获取现场运行配置信息, 远程保存到 NandFlash的指定空间, 具体用于: [0060] wherein, the programming module is configured to remotely write the NandFlash data through a specific remote programming tool, and obtain the on-site running configuration information, and remotely save the specified space to the NandFlash, specifically for:
[0061] 下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; [0061] downloading a remote programming tool, a kernel, and a file system to the NandFlash driver device;
[0062] 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中。 [0062] Remotely program the kernel and file system into the NandFlash driver device using a remote programming tool.
[0063] 其中, 该指定空间是指 NandFlash驱动设备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据保存在 NandFlash驱动设备的 u-boot分区中尚未被使用 的空间。 [0063] wherein the designated space refers to a space that has not been used in the u-boot partition of the NandFlash driving device, and the field running configuration information data is saved in a space that has not been used in the u-boot partition of the NandFlash driving device.
[0064] 其中, 恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢 复现场运行配置信息, 具体用于:  [0064] wherein, the recovery module is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the site running configuration information, specifically for:
[0065] NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场运行配置 信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandFlash驱动设备的现场 运行配置信息; [0065] After the NandFlash driver device is started, the related field running configuration information saved in the specified space of the NandFlash is read, and written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandFlash driving device is restored;
[0066] 清空 NandFlash指定空间保存的现场运行配置信息。  [0066] Clear the field running configuration information saved in the specified space of the NandFlash.
[0067] 其中, 该***还包括内存装置, 该内存装置用于存储升级装置的升级文件, 升 级装置中的升级文件, 远程擦除工具以及远程烧写工具下载采用以下的存储方 式: 在 NandFlash驱动设备没有多余空间使用 NandFlash介质存储文件吋, 将内存 映射成保存文件的介质。  [0067] wherein, the system further comprises a memory device, wherein the memory device is configured to store an upgrade file of the upgrade device, the upgrade file in the upgrade device, the remote wipe tool, and the remote programming tool are downloaded by using the following storage manner: in the NandFlash driver The device has no extra space to store files using NandFlash media, and maps the memory to the medium where the files are saved.
[0068] 其中, 具体是使用以内存作为文件存储介质的 tmpfs虚拟文件***来存储文件 , 将所有的升级文件放置在该虚拟文件***中。 发明的有益效果 [0068] Wherein, specifically, the tmpfs virtual file system using the memory as a file storage medium is used to store the files, and all the upgrade files are placed in the virtual file system. Advantageous effects of the invention
有益效果  Beneficial effect
[0069] 本发明提供的一种基于 NandFlash驱动设备的远程升级方案, 通过采用转换操 作状态, 在基于 NandFlash驱动设备的应用程序中使操作从用户态进入内核态, 在内核中操作 NandFlash结构、 内核句柄和内核相关硬件数据结构; 并在内核态 操作状态下, 利用本发明的远程擦除工具擦除内核中 NandFlash逻辑坏块和经修 改优化远程烧写工具远程写入 NandFlash数据的技术方案, 从而达到远程升级 Na ndFlash驱动设备的目的。 这样, 可以让维护人员不用下站处理设备, 通过在远 端联网的环境下, 利用***提供的升级包, 运行升级脚本, 即可实现远程在线 升级, 操作简单, 节省人力, 节约运行成本; 同吋, 还提供稳定的使用内核备 份功能, 从而使得当一个内核数据损坏后, 可以迅速地从另一个内核备份空间 进行启动, 极大地减少故障率, 解决现场常常出现由于内核损坏而导致启动不 了的故障问题。  [0069] The remote upgrade scheme based on the NandFlash driving device provided by the present invention enables the operation to enter the kernel state from the user state in the application based on the NandFlash driving device by using the conversion operation state, and operates the NandFlash structure and the kernel in the kernel. Handle and kernel related hardware data structure; and in the kernel state operation state, using the remote erasing tool of the present invention to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data, thereby The purpose of remotely upgrading the Na ndFlash drive device is achieved. In this way, the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved;吋, also provides a stable use of the kernel backup function, so that when a kernel data is corrupted, it can be quickly booted from another kernel backup space, greatly reducing the failure rate, and solving the scene often fails to start due to kernel damage. Failure problem.
对附图的简要说明  Brief description of the drawing
附图说明  DRAWINGS
[0070] 图 1表示的是本发明实施例提供的一种基于 NandFlash驱动设备的远程升级方法 的流程图。  1 is a flowchart of a remote upgrade method based on a NandFlash driving device according to an embodiment of the present invention.
[0071] 图 2表示的是本发明实施例提供的一种 OOB结构图。  FIG. 2 is a structural diagram of an OOB according to an embodiment of the present invention.
[0072] 图 3表示的是本发明实施例提供的一种基于 NandFlash驱动设备的远程升级方法 的升级流程图。  [0072] FIG. 3 is a flowchart of an upgrade of a remote upgrade method based on a NandFlash driving device according to an embodiment of the present invention.
[0073] 图 4表示的是根据本发明提供的基于 NandFlash驱动设备的远程升级方法应用于 远程升级应用***的方法的流程图。  [0073] FIG. 4 is a flow chart showing a method for applying a remote upgrade method based on a NandFlash driving device to a remote upgrade application system according to the present invention.
[0074] 图 5表示的是本发明实施例提供的一种基于 NandFlash驱动设备的远程升级装置 的结构示意图。 FIG. 5 is a schematic structural diagram of a remote upgrade device based on a NandFlash driving device according to an embodiment of the present invention.
[0075] 图 6表示的是本发明实施例提供的一种基于 NandFlash驱动设备的远程升级*** 的结构示意图。  6 is a schematic structural diagram of a remote upgrade system based on a NandFlash driving device according to an embodiment of the present invention.
[0076] 图 7表示的是本发明实施例提供的一种基于 NandFlash驱动设备的双内核启动的 流程图。 本发明的实施方式 FIG. 7 is a flowchart of a dual-core booting based on a NandFlash driving device according to an embodiment of the present invention. Embodiments of the invention
[0077] 在此处键入本发明的实施方式描述段落。 下面将参照附图更详细地描述本发明 的示例性实施例。 虽然附图中显示了本发明的示例性实施例, 然而应当理解, 可以以各种形式实现本发明而不应被这里阐述的实施例所限制。 相反, 提供这 些实施例是为了能够更透彻地理解本发明, 并且能够将本发明的范围完整的传 达给本领域的技术人员。  [0077] The description paragraphs of the embodiments of the present invention are entered here. Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While the invention has been described with respect to the preferred embodiments of the embodiments of the invention Rather, these embodiments are provided so that this invention can be more fully understood and the scope of the invention can be fully conveyed by those skilled in the art.
[0078] 请参考图 1。 本发明实施例提供了一种基于 NandFlash驱动设备的远程升级方法 , 该方法包括:  Please refer to FIG. 1. An embodiment of the present invention provides a remote upgrade method based on a NandFlash driving device, where the method includes:
[0079] S1 : 转换操作状态, 使操作从用户态进入内核态。 在基于 NandFlash驱动设备 的应用程序中从用户态进入内核态, 在内核中操作 NandFlash结构、 内核句柄和 内核相关硬件数据结构。  [0079] S1: Converting the operation state, and causing the operation to enter the kernel state from the user state. In the NandFlash-based device-based application, the user state enters the kernel state, and the NandFlash structure, the kernel handle, and the kernel-related hardware data structure are operated in the kernel.
[0080] S2: 在内核态操作状态下, 远程升级 NandFlash驱动设备。 包括: [0080] S2: The NandFlash driver device is remotely upgraded in the kernel state operation state. Includes:
[0081] S21 : 远程操作擦除工具擦除 NandFlash驱动设备中的数据 (逻辑坏块) 。 具体 步骤: [0081] S21: The remote operation erasing tool erases data (logical bad block) in the NandFlash driving device. Specific steps:
[0082] S211 : 在内核态操作状态下, 确定 NandFlash的句柄, 找到内核中标记坏块信 息的 NandFlash坏块表 BBT (Bad Block Table, 坏块链表) 。  [0082] S211: In the kernel state operation state, determine a handle of the NandFlash, and find a NandFlash bad block table BBT (Bad Block Table) that marks the bad block information in the kernel.
[0083] S212: 在内核态操作状态下, 远程操作远程擦除工具 emseko.so, 擦除内核的 N andFlash坏块。 具体过程如下:  [0083] S212: In the kernel state operation state, remotely operate the remote erasing tool emseko.so, and erase the kernel N and Flash bad blocks. The specific process is as follows:
[0084] a) 先清空 BBT中表信息;  [0084] a) first clearing the information in the BBT table;
[0085] b) 远程操作远程擦除工具 eraseko.so擦除内核的 NandFlash逻辑坏块。  [0085] b) Remotely operate the remote wipe tool eraseko.so to erase the kernel's NandFlash logic bad block.
[0086] 其中, 该远程擦除工具 emseko.so是本发明所具有的特定功能, 其主要功能是远 程擦除 NandFlash驱动设备中的数据, 包括擦除内核中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指定起始位置和结束位置的 NandFlash分区。 例如: [0086] wherein the remote erasing tool emseko.so is a specific function of the present invention, and its main function is to remotely erase data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash in the kernel. A logical bad block that erases the NandFlash partitions that specify the start and end positions as needed. E.g:
[0087] 擦除 linux内核分区;  [0087] erasing the linux kernel partition;
[0088] 擦除 yaffs文件***分区。 [0088] Erase the yaffs file system partition.
[0089] 请参考图 2。 本发明实施例提供的一种 OOB (Out Of Band) 结构。 OOB最前端 的 2bytes为 OxFF OxFF, 用于标识为非坏块; 每 256bytes的数据需要 3bytes有 ECC (Error Checking and Correction, 差错检测和纠正) 校验, 8,9,10为 512bytes前半 区的 ECC校验码; 13,14,15ecc2[3]为 512bytes后半区的 ECC校验码。 坏块采用 BBT 来进行管理。 OOB是每个页都有的数据, 但是 BBT对应于每一个 NandFlash, Lin ux自动建立 BBT表, 方便坏块管理使用, 在擦除 NandFlash之前, 必须获取到 BB T, 将逻辑坏块管理信息清空, 才能成功擦除逻辑坏块。 [0089] Please refer to FIG. 2. An OOB (Out Of Band) structure provided by an embodiment of the present invention. OOB front end 2 bytes is OxFF OxFF, which is used to identify non-bad blocks; every 256 bytes of data requires 3 bytes of ECC (Error Checking and Correction) check, 8, 9, 10 is the 512 bytes of the first half of the ECC check code ; 13,14,15ecc2[3] is the ECC check code of the latter half of 512 bytes. Bad blocks are managed using BBT. OOB is the data that each page has, but BBT corresponds to each NandFlash, Lin ux automatically creates BBT table, which is convenient for bad block management. Before erasing NandFlash, you must obtain BB T and clear the logical bad block management information. , in order to successfully erase the logical bad block.
[0090] S22: 远程操作远程烧写工具 Nandwrite写入 NandFlash数据, 包括:  [0090] S22: Remote operation remote programming tool Nandwrite writes NandFlash data, including:
[0091] S221 : 将远程烧写工具 Nandwrite下载到基于 NandFlash驱动设备上, 同吋也将 内核 (linux) 和文件*** (yaffs) 下载到设备中。  [0091] S221: Download the remote programming tool Nandwrite to the NandFlash-based device, and download the kernel (linux) and file system (yaffs) to the device.
[0092] S222:使用远程烧写工具 Nandwrite远程烧写内核 (linux) 与文件*** (yaffs) 到 NandFlash驱动设备中, 在烧写的同吋同步将校验信息也写入 NandFlash驱动设 备中, 这些校验信息, 在 NandFlash驱动设备启动后会通过 u-boot来进行校验。  [0092] S222: remotely burning the kernel (linux) and the file system (yaffs) into the NandFlash driving device by using the remote programming tool Nandwrite, and simultaneously writing the verification information into the NandFlash driving device during the synchronization of the programming. The verification information is verified by u-boot after the NandFlash driver is started.
[0093] 具体地, 校验方法如下: 一般情况下, 在远程烧写工具 Nandwrite中, OOB ( 参考图 2) 中的 ECC校验函数, 与基于 NandFlash驱动设备***上的 u-boot的校验 函数是不一致, 通过远程烧写工具 Nandwrite写入后的内核 linux和文件*** yaffs , 在 u-boot校验吋不能获得通过, NandFlash驱动设备***无法正常启动。 在本发 明中, 远程烧写工具 Nandwrite工具是经过修改优化, 使得 u-boot, 内核, nandwr ite的校验码一致, 形成特定的远程烧写工具 Nandwrite, 这样就可以保证 NandFla sh驱动设备***可以正常启动。  [0093] Specifically, the verification method is as follows: In general, in the remote programming tool Nandwrite, the ECC check function in the OOB (refer to FIG. 2) and the verification based on the u-boot on the NandFlash-driven device system. The function is inconsistent. After the kernel linux and file system yaffs written by the remote programming tool Nandwrite, the u-boot checksum cannot be obtained, and the NandFlash drive device system cannot be started normally. In the present invention, the remote programming tool Nandwrite tool is modified and optimized, so that the verification codes of the u-boot, the kernel, and the nandwr ite are consistent, and a specific remote programming tool Nandwrite is formed, so that the NandFla sh driving device system can be ensured. Normal start.
[0094] 其中, 远程烧写工具 Nandwrite是本发明所具有的特定功能, 其主要功能是远程 写入 NandFlash数据, 以及使得 u-boot、 内核、 远程烧写工具的校验码一致。 具体 包括:  [0094] The remote programming tool Nandwrite is a specific function of the present invention, and its main function is to remotely write NandFlash data, and make the verification codes of the u-boot, the kernel, and the remote programming tool consistent. Specifically, including:
[0095] 根据 512字节的数据大小, 生成 16字节的 OOB数据, 计算 ECC校验码, 保证 00 [0095] According to the data size of 512 bytes, 16 bytes of OOB data are generated, and the ECC check code is calculated to ensure 00
B数据可以在内核启动吋校验通过; B data can be verified after the kernel is started;
[0096] 将 00B和数据写入 linux内核分区; [0096] Write 00B and data to the Linux kernel partition;
[0097] 将 00B和数据写入 yaffs文件***分区; [0097] writing 00B and data to the yaffs file system partition;
[0098] 获取现场运行信息, 保存现场运行配置信息 (包括 IP信息等) 。  [0098] Acquiring on-site operation information, and saving on-site operation configuration information (including IP information, etc.).
[0099] S23: 获取现场运行配置信息, 远程保存到 NandFlash的指定空间。 [0100] 获取现场运行配置信息, 现场运行配置信息包括 IP信息、 各种采集量、 传感器 的配置、 以及驱动设备的相关配置信息。 具体步骤: [0099] S23: Acquire the on-site running configuration information, and save it to the specified space of the NandFlash remotely. [0100] Obtaining on-site running configuration information, the on-site running configuration information includes IP information, various collection amounts, configuration of sensors, and related configuration information of the driving device. Specific steps:
[0101] 由于 NandFlash驱动设备在升级吋, 会重新写入内核和 /或文件***后, 内核与 NandFlash的映射表会发生改变, 会导致原有数据文件丢失, 包括现场运行配置 信息也会丢失, 在重新启动应用程序后, 保存的文件信息会丢失, 因此, 在升 级前, 需要先保存好现场运行配置信息。  [0101] After the NandFlash driver device is upgraded, the kernel and/or the file system will be rewritten, and the mapping table between the kernel and the NandFlash will be changed, which may result in the loss of the original data file, including the field running configuration information. After restarting the application, the saved file information will be lost. Therefore, you need to save the live running configuration information before upgrading.
[0102] 本发明中, 将包括 IP信息等现场运行配置信息数据保存在 NandFlash驱动设备的 u-boot分区中尚未被使用的空间中, 也即: 该指定空间是指 NandFlash驱动设备的 u-boot分区中尚未被使用的空间。 在 NandFlash结构的驱动设备中, 只有 u-boot的 f lash空间在升级过程中没有进行擦除与写入操作处理, 所以, 将包括现场 IP信息 等现场运行配置信息数据保存在 u-boot尚未被使用的 NandFlash中, 这样可以保证 在升级过程中这些现场运行配置信息数据不会被擦除或覆盖。  [0102] In the present invention, the field running configuration information data including the IP information is stored in a space that has not been used in the u-boot partition of the NandFlash driving device, that is, the designated space refers to the u-boot of the NandFlash driving device. The space in the partition that has not been used yet. In the NandFlash structure of the drive device, only the u-boot's lash space is not erased and written during the upgrade process. Therefore, the live operation configuration information including the on-site IP information is saved in the u-boot. In the NandFlash used, this ensures that these field running configuration information data will not be erased or overwritten during the upgrade process.
[0103] 在 S21和 S22中, 远程擦除工具 eraseko.so和远程烧写工具 Nandwrite可以采用以 下的存储方式:  [0103] In S21 and S22, the remote erase tool eraseko.so and the remote programming tool Nandwrite can use the following storage methods:
[0104] 由于设备长吋间的运行, 和进行 NandFlash操作, 导致 NandFlash出现大量的逻 辑坏块, 基于 NandFlash的  [0104] Due to the long running of the device and the NandFlash operation, NandFlash has a large number of logical bad blocks, based on NandFlash.
驱动设备的 NandFlash已经达到 100%吋, 使用 NandFlash介质无法存储文件。  The NandFlash of the drive device has reached 100%, and the file cannot be stored using NandFlash media.
[0105] 所以, 在 NandFlash驱动设备无法使用 NandFlash介质存储文件吋, 解决方法是 使用内存来存储文件, 将内存映射成可以保存文件的介质。 具体是使用 tmpfs虚 拟文件***, 该文件***使用内存作为文件***的存储介质, 将所有的升级文 件放置在虚拟文件***中。 [0105] Therefore, in the NandFlash driver device, the NandFlash media cannot be used to store files. The solution is to use memory to store files and map the memory to a medium that can save files. Specifically, the tmpfs virtual file system is used. The file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
[0106] S24: 读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配置信 息。 具体过程如下: [0106] S24: Read the field running configuration information saved in the specified space of the NandFlash, and restore the live running configuration information. The specific process is as follows:
[0107] S241 : 基于 NandFlash驱动设备应用程序启动后, 读取 NandFlash的 u-boot指定 空间保存的相关现场运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandFlash驱动设备的现场运行配置信息。  [0107] S241: After the NandFlash driver device application is started, the related field operation configuration information saved in the u-boot designated space of the NandFlash is read, and written into the configuration file of the NandFlash driver device, and the field running configuration of the NandFlash driver device is restored. information.
[0108] S242: 清空 u-boot指定空间保存的现场运行配置信息, 避免设备***下次启动 吋重复读取。 [0109] 请参考图 3。 本发明实施例提供了一种基于 NandFlash驱动设备的远程升级方法 , 该方法包括: [0108] S242: Clear the field running configuration information saved in the u-boot designated space, and prevent the device system from repeatedly reading after the next startup. [0109] Please refer to FIG. 3. The embodiment of the invention provides a remote upgrade method based on a NandFlash driving device, and the method includes:
[0110] S11 : 首先确定是否需要升级, 如果 NandFlash使用率太高, 例如 95<¾, 表示需 要升级, 转入 S12; 否则, 表示不需要升级。  [0110] S11: First, it is determined whether an upgrade is needed. If the usage rate of NandFlash is too high, for example, 95<3⁄4, it indicates that an upgrade is required, and the process proceeds to S12; otherwise, it indicates that an upgrade is not required.
[0111] S12: 建立 tmpfs虚拟文件***, 用于存放相关的升级所需要的文件。 [0111] S12: Establish a tmpfs virtual file system, which is used to store files required for the related upgrade.
[0112] S13: 使用 FTP工具把升级文件 (内核 linux, ***文件 yaffs , 远程烧写工具 Nan dwrite, 远程擦除工具 eraseko.so) 下载到设备中。 [0112] S13: Download the upgrade file (kernel linux, system file yaffs, remote programming tool Nan dwrite, remote wipe tool eraseko.so) to the device using the FTP tool.
[0113] S14: 使用远程擦除工具 eraseko.so擦除逻辑坏块。 [0113] S14: Erase the logical bad block using the remote erase tool eraseko.so.
[0114] S15: 使用远程烧写工具 nandwrite重新烧写内核与文件***。 [0114] S15: Re-burning the kernel and the file system using the remote programming tool nandwrite.
[0115] S16: 远程保存包括 IP信息等的现场运行配置信息到 NandFlash指定空间。 [0115] S16: Remotely save the live running configuration information including the IP information and the like to the NandFlash designated space.
[0116] S17: 重启设备, 恢复升级前的相关现场运行配置信息。 [0116] S17: Restart the device, and restore related field operation configuration information before the upgrade.
[0117] 请参考图 4。 本发明实施例提供了一种基于 NandFlash驱动设备的远程升级装置 , 该升级装置 100, 用于转换操作状态, 使操作从用户态进入内核态, 并在内核 态操作状态下, 远程升级 NandFlash驱动设备。  [0117] Please refer to FIG. 4. The embodiment of the present invention provides a remote upgrade device based on a NandFlash driving device. The upgrade device 100 is configured to convert an operation state, and the operation is changed from a user state to a kernel state, and the NandFlash driver device is remotely upgraded in a kernel state operation state. .
[0118] 该升级装置 100包括: 转换模块 10, 升级模块 20;  [0118] The upgrading apparatus 100 includes: a conversion module 10, an upgrade module 20;
[0119] 该转换模块 10, 用于转换操作状态, 使操作从用户态进入内核态; 在内核态中 操作 NandFlash结构、 内核句柄和内核相关硬件数据结构。  [0119] The conversion module 10 is configured to convert an operation state, and the operation enters a kernel state from a user state; and operate a NandFlash structure, a kernel handle, and a kernel-related hardware data structure in a kernel state.
[0120] 该升级模块 20, 用于在内核态操作状态下, 远程升级 NandFlash驱动设备。 该 升级模块 20包括: 擦除模块 22, 烧写模块 23, 恢复模块 24, 其中: [0120] The upgrade module 20 is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state. The upgrade module 20 includes: an erase module 22, a programming module 23, and a recovery module 24, wherein:
[0121] 擦除模块 22, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据 (逻辑 坏块) 。 [0121] The erasing module 22 is configured to remotely operate the erasing tool to erase data (logical bad blocks) in the NandFlash driving device.
[0122] 烧写模块 23, 用于远程操作远程烧写工具 Nandwrite写入 NandFlash数据, 以及 获取现场运行配置信息, 远程保存到 NandFlash的指定空间。  [0122] The programming module 23 is used for remotely operating the remote programming tool. Nandwrite writes the NandFlash data, and obtains the live running configuration information, and saves it to the designated space of the NandFlash remotely.
[0123] 恢复模块 24, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现 场运行配置信息。  [0123] The recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
[0124] 其中:  [0124] wherein:
[0125] 擦除模块 22, 用于远程操作擦除工具 eraseko.so擦除 NandFlash驱动设备中的数 据 (逻辑坏块) 。 具体用于: [0126] 在内核态操作状态下, 确定 NandFlash的句柄, 找到内核中标记坏块信息的 Nan dFlash坏块表 BBT (Bad Block Table, 坏块链表) 。 [0125] The erasing module 22 is configured to remotely operate the erasing tool eraseko.so to erase data (logical bad blocks) in the NandFlash driving device. Specifically used for: [0126] In the kernel state operation state, the handle of the NandFlash is determined, and the Nan dFlash bad block table BBT (Bad Block Table) that marks the bad block information in the kernel is found.
[0127] 在内核态操作状态下, 远程操作远程擦除工具 eraseko.so, 擦除内核的 NandFlas h坏块。 具体过程如下: [0127] In the kernel mode operation state, the remote wipe tool eraseko.so is remotely operated, and the kernel's NandFlas h bad block is erased. The specific process is as follows:
[0128] a) 先清空 BBT中表信息; [0128] a) first clearing the information in the BBT table;
[0129] b) 远程操作远程擦除工具 eraseko.so擦除内核的 NandFlash逻辑坏块。  [0129] b) Remote operation remote wipe tool eraseko.so erases the kernel's NandFlash logic bad block.
[0130] 烧写模块 23, 用于远程通过特定的远程烧写工具 Nandwrite写入 NandFlash数据 , 以及获取现场运行配置信息, 远程保存到 NandFlash的指定空间。 具体用于: [0130] The programming module 23 is configured to remotely write the NandFlash data through a specific remote programming tool Nandwrite, and obtain the on-site running configuration information, and save the data to the specified space of the NandFlash remotely. Specifically used for:
[0131] a) 将远程烧写工具 Nandwrite工具下载到基于 NandFlash驱动设备上, 同吋也将 内核 (linux) 和文件*** (yaffs) 下载到设备中。 [0131] a) Download the remote programming tool Nandwrite tool to the NandFlash-based device, and download the kernel (linux) and file system (yaffs) to the device.
[0132] b) 使用远程烧写工具 Nandwrite远程烧写内核 (linux) 与文件*** (yaffs) 到 NandFlash驱动设备中, 在烧写的同吋同步将校验信息也写入 NandFlash驱动设备 中, 这些校验信息, 在 NandFlash驱动设备启动后会通过 u-boot来进行校验。  [0132] b) using the remote programming tool Nandwrite to remotely write the kernel (linux) and the file system (yaffs) to the NandFlash driver device, and simultaneously write the verification information to the NandFlash driver device during the synchronization of the programming. The verification information is verified by u-boot after the NandFlash driver is started.
[0133] c) 获取现场运行配置信息, 远程保存到 NandFlash的指定空间。 现场运行配置 信息包括 IP信息、 各种采集量、 传感器的配置、 以及驱动设备的相关配置信息。 本发明中, 将包括 IP信息等现场运行配置信息数据保存在 NandFlash驱动设备的 u -boot分区中尚未被使用的空间中, 也即: 该指定空间是指 NandFlash驱动设备的 u -boot分区中尚未被使用的空间。  [0133] c) Obtain the live running configuration information and save it to the specified space of the NandFlash remotely. The on-site configuration information includes IP information, various acquisition quantities, sensor configuration, and configuration information for the drive device. In the present invention, the field running configuration information data including the IP information is saved in the space of the u-boot partition of the NandFlash driving device that has not been used, that is, the specified space is not yet in the u-boot partition of the NandFlash driving device. The space being used.
[0134] 其中, 远程擦除工具 eraseko.so和远程烧写工具 Nandwrite可以采用以下的存储 方式: 在 NandFlash驱动设备没有多余空间使用 NandFlash介质存储文件吋, 解决 方法是使用内存来存储文件, 将内存映射成可以保存文件的介质。 具体是使用 t mpfs虚拟文件***, 该文件***使用内存作为文件***的存储介质, 将所有的 升级文件放置在虚拟文件***中。  [0134] Among them, the remote erasing tool eraseko.so and the remote programming tool Nandwrite can adopt the following storage methods: The NandFlash driving device has no extra space to use NandFlash media to store files, the solution is to use memory to store files, and to store the memory. Map to a medium that can hold files. Specifically, the t mpfs virtual file system is used. The file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
[0135] 恢复模块 24, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现 场运行配置信息。 具体过程如下:  [0135] The recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field. The specific process is as follows:
[0136] a) 基于 NandFlash驱动设备应用程序启动后, 读取 NandFlash的 u-boot指定空间 保存的相关现场运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandFlash驱动设备的现场运行配置信息。 [0137] b) 清空 u-boot指定空间保存的现场运行配置信息, 避免设备***下次启动吋重 复读取。 [0136] a) After the NandFlash driver device application is started, the related field operation configuration information saved in the u-boot designated space of the NandFlash is read, written into the configuration file of the NandFlash driver device, and the field running configuration of the NandFlash driver device is restored. information. [0137] b) Clear the field running configuration information saved in the u-boot specified space to avoid repeated reading after the device system is started next time.
[0138] 请参考图 5。 本发明实施例提供了一种基于 NandFlash驱动设备的远程升级*** , 该升级***包括: 升级装置 100, NandFlash驱动设备 200, 内存装置 300, [0138] Please refer to FIG. 5. The embodiment of the invention provides a remote upgrade system based on a NandFlash drive device, and the upgrade system includes: an upgrade device 100, a NandFlash drive device 200, and a memory device 300.
[0139] 该升级装置 100, 用于转换操作状态, 使操作从用户态进入内核态, 并在内核 态操作状态下, 远程升级 NandFlash驱动设备 200。 [0139] The upgrading apparatus 100 is configured to convert an operation state, enter an operation from a user state to a kernel state, and remotely upgrade the NandFlash driving device 200 in a kernel state operation state.
[0140] 该内存装置 300, 用于存储升级装置 100用于升级的文件; 在 NandFlash驱动设 备 200没有多余空间使用 NandFlash介质存储文件吋, 存储升级装置 100的升级文 件, 包括升级文件, 远程擦除工具以及远程烧写工具; 具体方法是: 将内存装 置 300映射成可以保存文件的介质; 具体是使用 tmpfs虚拟文件***, 该文件*** 使用内存作为文件***的存储介质, 将所有的升级文件放置在该虚拟文件*** 中。  [0140] The memory device 300 is configured to store the file used by the upgrade device 100 for upgrading; the NandFlash drive device 200 has no unnecessary space to use the NandFlash media to store files, and the upgrade file of the upgrade device 100 is stored, including the upgrade file, and remotely erased. The tool and the remote programming tool; the specific method is: mapping the memory device 300 into a medium that can save the file; specifically, using the tmpfs virtual file system, the file system uses the memory as the storage medium of the file system, and places all the upgrade files in In the virtual file system.
[0141] 该升级装置 100包括: 转换模块 10, 升级模块 20;  [0141] The upgrading apparatus 100 includes: a conversion module 10, an upgrade module 20;
[0142] 该转换模块 10, 用于转换操作状态, 使操作从用户态进入内核态; 在内核态中 操作 NandFlash结构、 内核句柄和内核相关硬件数据结构。  [0142] The conversion module 10 is configured to convert an operation state, and the operation enters a kernel state from a user state; and operate a NandFlash structure, a kernel handle, and a kernel-related hardware data structure in a kernel state.
[0143] 该升级模块 20, 用于在内核态操作状态下, 远程升级 NandFlash驱动设备。 该 升级模块 20包括: 擦除模块 22, 烧写模块 23, 恢复模块 24, 其中: [0143] The upgrade module 20 is configured to remotely upgrade the NandFlash driving device in a kernel mode operation state. The upgrade module 20 includes: an erase module 22, a programming module 23, and a recovery module 24, wherein:
[0144] 擦除模块 22, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据 (逻辑 坏块) 。 [0144] The erasing module 22 is configured to remotely operate the erasing tool to erase data (logical bad blocks) in the NandFlash driving device.
[0145] 烧写模块 23, 用于远程操作远程烧写工具 Nandwrite写入 NandFlash数据, 以及 获取现场运行配置信息, 远程保存到 NandFlash的指定空间。  [0145] The programming module 23 is used for remotely operating the remote programming tool. Nandwrite writes the NandFlash data, and obtains the live running configuration information, and saves it to the specified space of the NandFlash remotely.
[0146] 恢复模块 24, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现 场运行配置信息。  [0146] The recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field.
[0147] 其中:  [0147] wherein:
[0148] 擦除模块 22, 用于远程操作擦除工具 eraseko.so擦除 NandFlash驱动设备中的数 据 (逻辑坏块) 。 具体用于:  [0148] The erasing module 22, for remotely operating the erasing tool, eraseko.so, erases data (logical bad blocks) in the NandFlash driving device. Specifically used for:
[0149] 在内核态操作状态下, 确定 NandFlash的句柄, 找到内核中标记坏块信息的 Nan dFlash坏块表 BBT (Bad Block Table, 坏块链表) 。 [0150] 在内核态操作状态下, 远程操作远程擦除工具 eraseko.so, 擦除内核的 NandFlas h坏块。 具体过程如下: [0149] In the kernel state operation state, the handle of the NandFlash is determined, and the Nan dFlash bad block table BBT (Bad Block Table) indicating the bad block information in the kernel is found. [0150] In the kernel mode operation state, the remote erasing tool eraseko.so is remotely operated, and the kernel's NandFlas h bad block is erased. The specific process is as follows:
[0151] a) 先清空 BBT中表信息; [0151] a) first clearing the information in the BBT table;
[0152] b) 远程操作远程擦除工具 eraseko.so擦除内核的 NandFlash逻辑坏块。  [0152] b) Remote operation remote wipe tool eraseko.so erases the kernel's NandFlash logic bad block.
[0153] 烧写模块 23, 用于远程通过特定的远程烧写工具 Nandwrite写入 NandFlash数据 [0153] The programming module 23 is configured to remotely write NandFlash data through a specific remote programming tool Nandwrite
, 以及获取现场运行配置信息, 远程保存到 NandFlash的指定空间。 具体用于: [0154] a) 将远程烧写工具 Nandwrite工具下载到基于 NandFlash驱动设备上, 同吋也将 内核 (linux) 和文件*** (yaffs) 下载到设备中。 And get the live running configuration information, and save it to the specified space of NandFlash remotely. Specifically used to: [0154] a) Download the remote programming tool Nandwrite tool to the NandFlash-based device, and download the kernel (linux) and file system (yaffs) to the device.
[0155] b) 使用远程烧写工具 Nandwrite远程烧写内核 (linux) 与文件*** (yaffs) 到[0155] b) using remote programming tool Nandwrite remote programming kernel (linux) and file system (yaffs) to
NandFlash驱动设备中, 在烧写的同吋同步将校验信息也写入 NandFlash驱动设备 中, 这些校验信息, 在 NandFlash驱动设备启动后会通过 u-boot来进行校验。 In the NandFlash driver device, the verification information is also written to the NandFlash driver device during the synchronization of the programming, and the verification information is verified by the u-boot after the NandFlash driver device is started.
[0156] c) 获取现场运行配置信息, 远程保存到 NandFlash的指定空间。 现场运行配置 信息包括 IP信息、 各种采集量、 传感器的配置、 以及驱动设备的相关配置信息。 本发明中, 将包括 IP信息等现场运行配置信息数据保存在 NandFlash驱动设备的 u[0156] c) Obtain the live running configuration information and save it to the specified space of NandFlash remotely. The on-site configuration information includes IP information, various acquisition quantities, sensor configuration, and configuration information for the drive device. In the present invention, the field running configuration information data including IP information is saved in the NandFlash driving device.
-boot分区中尚未被使用的空间中, 也即: 该指定空间是指 NandFlash驱动设备的 uIn the space that has not been used in the -boot partition, that is: the specified space refers to the U of the NandFlash driver.
-boot分区中尚未被使用的空间。 The space in the -boot partition that has not been used yet.
[0157] 其中, 远程擦除工具 eraseko.so和远程烧写工具 Nandwrite可以采用以下的存储 方式: 在 NandFlash驱动设备没有多余空间使用 NandFlash介质存储文件吋, 解决 方法是使用内存来存储文件, 将内存映射成可以保存文件的介质。 具体是使用 t mpfs虚拟文件***, 该文件***使用内存作为文件***的存储介质, 将所有的 升级文件放置在虚拟文件***中。 [0157] Among them, the remote erasing tool eraseko.so and the remote programming tool Nandwrite can adopt the following storage methods: The NandFlash driving device has no extra space to use NandFlash media to store files, the solution is to use memory to store files, and to store the memory. Map to a medium that can hold files. Specifically, the t mpfs virtual file system is used. The file system uses memory as the storage medium of the file system, and all the upgrade files are placed in the virtual file system.
[0158] 恢复模块 24, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现 场运行配置信息。 具体过程如下: [0158] The recovery module 24 is configured to read the field running configuration information saved in the specified space of the NandFlash, and restore the running configuration information of the field. The specific process is as follows:
[0159] a) 基于 NandFlash驱动设备应用程序启动后, 读取 NandFlash的 u-boot指定空间 保存的相关现场运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复[0159] a) After the NandFlash driver device application is started, the U-boot specified space of the NandFlash is read, and the related field running configuration information saved is written into the configuration file of the NandFlash driver device, and restored.
NandFlash驱动设备的现场运行配置信息。 Field operation configuration information of the NandFlash drive device.
[0160] b) 清空 u-boot指定空间保存的现场运行配置信息, 避免设备***下次启动吋重 复读取。 [0161] 请参考图 6。 一种根据本发明提供的基于 NandFlash驱动设备的远程升级方法应 用于远程升级应用***的方法。 该方法包括: [0160] b) Clear the field running configuration information saved in the u-boot specified space to avoid repeated reading after the device system is started next time. [0161] Please refer to FIG. 6. A remote upgrade method based on a NandFlash driving device provided according to the present invention is applied to a method for remotely upgrading an application system. The method includes:
[0162] 通常情况下, 新的应用***一般可以升级内核 (linux) 和 /或升级文件*** (y affs) , 升级方法采用本发明以上提供的基于 NandFlash驱动设备的远程升级方法 来进行升级: [0162] Generally, the new application system can generally upgrade the kernel (linux) and/or the upgrade file system (y affs), and the upgrade method is upgraded by using the NandFlash-based device-based remote upgrade method provided by the present invention:
[0163] a) 升级 linux内核, 如果内核有刪减, 或者增加新的模块等, 可以将旧的内核 升级为新的内核。  [0163] a) Upgrade the Linux kernel. If the kernel has been deleted, or add a new module, etc., you can upgrade the old kernel to a new one.
[0164] b) 升级 yaffs文件***, yaffs主要用来存放文件和相关程序。 对于设备的相关 程序, 可以从原有的程序升级为新修改的程序, 还可以添加新的程序, 添加新 的功能。  [0164] b) Upgrade the yaffs file system, yaffs is mainly used to store files and related programs. For the related programs of the device, you can upgrade from the original program to the newly modified program, and you can add new programs and add new functions.
[0165] c) 升级的新的内核与文件***, 修改部分可以包括重新划分 NandFlash分区, 刪减内核模块, 添加新的监控功能等。  [0165] c) The upgraded new kernel and file system, the modification may include repartitioning the NandFlash partition, deleting the kernel module, adding new monitoring functions, and the like.
[0166] 升级过程如图 6所示: [0166] The upgrade process is shown in Figure 6:
[0167] S21 : 升级幵始。 [0167] S21: The upgrade starts.
[0168] S22: 升级原始*** l.x。 [0168] S22: Upgrade the original system l.x.
[0169] S23: 判断需要升级到哪个版本?如果升级到 l.x+, 转入 S24处理; 如果升级到 [0169] S23: Determine which version needs to be upgraded? If you upgrade to l.x+, go to S24; if you upgrade to
2.x版本, 转入 S25处理。 2.x version, transferred to S25 processing.
[0170] S24: 升级到 l.x+, 从 1.x版本升级到 l.x+版本, 此种升级, 内核与文件***的 主体变化不大, 主要是对内核做了轻微的修改, 或者修改设备主程序, 以解决 某种故障。 [0170] S24: Upgrade to l.x+, upgrade from 1.x version to l.x+ version. In this upgrade, the kernel and the file system do not change much, mainly to slightly modify the kernel, or modify the device. The main program to solve some kind of failure.
[0171] S25: 升级到 2.x版本, 把设备的 1.X版本的功能, 升级到 2.X的版本, 其中涉及 到内核重新划分 NandFlash分区, 添加新的模块等; 主程序可以替换成另一个版 本, 修改比较多, 设备运行的主要功能都做了较大的改变。  [0171] S25: Upgrade to the 2.x version, upgrade the function of the 1.X version of the device to the 2.X version, which involves re-partitioning the NandFlash partition, adding new modules, etc.; the main program can be replaced with In another version, there are more modifications, and the main functions of the device have been greatly changed.
[0172] S26: 升级成功。  [0172] S26: The upgrade is successful.
[0173] 以上 S21至 S26升级所采用的升级方法采用本发明以上提供的基于 NandFlash驱 动设备的远程升级方法来进行升级, 升级过程中涉及的方法及过程在以上本发 明的实施例中都有详细描述, 在此不再重复描述。 需要指出的是: 升级中所采 用的工具 (远程烧写工具 NandFlash, 远程擦除工具 eraseko.so, tmpfs虚拟文件系 统工具, 一键升级脚本 update) 中, 远程烧写工具 Nandwrite, 远程擦除工具 erase ko.so, 一键升级脚本 update是本发明所特有的功能, 其中, 一键升级脚本 (upda te) 主要是把所有的操作都放在脚本中, 升级吋, 启动脚本, 即可自动完成升级[0173] The upgrade method used in the above S21 to S26 upgrade is performed by using the remote upgrade method based on the NandFlash driver device provided by the present invention. The method and process involved in the upgrade process are detailed in the foregoing embodiments of the present invention. Description, the description will not be repeated here. Need to point out: The tools used in the upgrade (remote programming tool NandFlash, remote wipe tool eraseko.so, tmpfs virtual file system) System tool, one-click upgrade script update), remote programming tool Nandwrite, remote wipe tool erase ko.so, one-click upgrade script update is a unique feature of the present invention, wherein, one-click upgrade script (upda te) mainly Is to put all the operations in the script, upgrade 吋, start the script, you can automatically complete the upgrade
。 无需其它操作。 . No other operations are required.
[0174] 至此, 升级动作已经完成。 升级***的联网还需要进行的是恢复现场运行配置 信息, 尤其是各种采集量, 传感器的配置, 还有智能设备的相关配置。  [0174] At this point, the upgrade action has been completed. The upgrade system's networking also needs to restore the on-site configuration information, especially the various acquisitions, sensor configuration, and related configuration of the smart device.
[0175] 请参考图 7。 一种基于 NandFlash驱动设备的双内核启动方法, 该方法包括: [0176] S31 : u-boot正常加载 NandFlash内核。 [0175] Please refer to FIG. 7. A dual-core booting method based on a NandFlash driving device, the method comprising: [0176] S31: u-boot normally loads the NandFlash kernel.
[0177] S32: 检査正常区内核是否正常, 如果正常, 转入 S33处理; 如果不正常, 转入 S34处理。  [0177] S32: Check whether the normal zone kernel is normal. If it is normal, go to S33 for processing; if it is not normal, go to S34 for processing.
[0178] S33: 擦除备份区, 采用本发明的远程擦除工具 emseko.so通过远程来擦除备份 区, 再采用本发明的远程烧写工具 Nandwrite通过远程来将正常区内核数据烧写 到备份区; 完成后, 转入 S38。  [0178] S33: erasing the backup area, using the remote erasing tool emseko.so of the present invention to erase the backup area by remote, and then using the remote programming tool Nandwrite of the present invention to program the normal area kernel data remotely. Backup area; After completion, transfer to S38.
[0179] S34: 检査备份区内核是否正常, 如果正常, 转入 S53处理; 如果不正常, 转入 S37处理。  [0179] S34: Check whether the kernel of the backup area is normal. If it is normal, go to S53 for processing; if it is not normal, go to S37 for processing.
[0180] S35: u-boot从备份区加载内核。  [0180] S35: u-boot loads the kernel from the backup area.
[0181] S36: 擦除正常区数据, 将备份区内核数据烧写到正常区内核; 转入 S38。  [0181] S36: erasing the normal area data, and writing the backup area kernel data to the normal area kernel; and transferring to S38.
[0182] S37: 启动失败, 结束。 [0182] S37: The startup fails and ends.
[0183] S38: 启动成功, 结束。 [0183] S38: The startup is successful, and the process ends.
[0184] 本发明提供的一种基于 NandFlash驱动设备的远程升级方案, 通过采用转换操 作状态, 在基于 NandFlash驱动设备的应用程序中使操作从用户态进入内核态, 在内核中操作 NandFlash结构、 内核句柄和内核相关硬件数据结构; 并在内核态 操作状态下, 利用本发明的远程擦除工具擦除内核中 NandFlash逻辑坏块和经修 改优化远程烧写工具远程写入 NandFlash数据的技术方案, 从而达到远程升级 Na ndFlash驱动设备的目的。 这样, 可以让维护人员不用下站处理设备, 通过在远 端联网的环境下, 利用***提供的升级包, 运行升级脚本, 即可实现远程在线 升级, 操作简单, 节省人力, 节约运行成本; 同吋, 还提供稳定的使用内核备 份功能, 从而使得当一个内核数据损坏后, 可以迅速地从另一个内核备份空间 进行启动, 极大地减少故障率, 解决现场常常出现由于内核损坏而导致启动不 了的故障问题。 [0184] The remote upgrade scheme based on the NandFlash driving device provided by the present invention enables the operation to enter the kernel state from the user state in the application based on the NandFlash driving device by using the conversion operation state, and operates the NandFlash structure and the kernel in the kernel. Handle and kernel related hardware data structure; and in the kernel state operation state, using the remote erasing tool of the present invention to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data, thereby The purpose of remotely upgrading the Na ndFlash drive device is achieved. In this way, the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved;吋, also provides a stable use of kernel backup function, so that when a kernel data is corrupted, you can quickly back up space from another kernel. Startup, greatly reducing the failure rate, and solving the problem that the site often fails to start due to kernel damage.
[0185] 本发明提供的基于 NandFlash驱动设备的远程升级方案可以应用于电信机房、 I DC机房、 铁路、 电力等动力环境监控领域, 涉及到 u-boot, 内核、 文件***、 N andFlash等技术领域; 同吋也适用于所有的基于 NandFlash的驱动设备, 例如 FSU (Field Supervision Unit, 区域智能监控单元) 设备, 基于 NandFlash驱动设备的 视频监控设备等, 都可以适用于本发明专利。  [0185] The remote upgrade solution based on the NandFlash driving device provided by the present invention can be applied to the power environment monitoring fields such as a telecommunication room, an I DC room, a railway, a power, etc., and relates to a technical field such as a u-boot, a kernel, a file system, and a N and Flash. The same applies to all NandFlash-based drive devices, such as FSU (Field Supervision Unit) devices, NandFlash-driven device-based video surveillance devices, etc., which can be applied to the present invention.
[0186] 以上的是本发明的优选实施方式, 应当指出对于本技术领域的普通人员来说, 在不脱离本发明的原理前提下还可以作出若干改进和润饰, 这些改进和润饰也 在本发明的保护范围内。 The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and refinements without departing from the principles of the present invention. These improvements and refinements are also in the present invention. Within the scope of protection.
工业实用性  Industrial applicability
[0187] 本发明实施例提供的一种基于 NandFlash驱动设备的远程升级方案, 通过采用 转换操作状态, 在基于 NandFlash驱动设备的应用程序中使操作从用户态进入内 核态, 在内核中操作 NandFlash结构、 内核句柄和内核相关硬件数据结构; 并在 内核态操作状态下, 利用本发明的远程擦除工具擦除内核中 NandFlash逻辑坏块 和经修改优化远程烧写工具远程写入 NandFlash数据的技术方案, 从而达到远程 升级 NandFlash驱动设备的目的。 这样, 可以让维护人员不用下站处理设备, 通 过在远端联网的环境下, 利用***提供的升级包, 运行升级脚本, 即可实现远 程在线升级, 操作简单, 节省人力, 节约运行成本; 同吋, 还提供稳定的使用 内核备份功能, 从而使得当一个内核数据损坏后, 可以迅速地从另一个内核备 份空间进行启动, 极大地减少故障率, 解决现场常常出现由于内核损坏而导致 启动不了的故障问题。  [0187] A remote upgrade scheme based on the NandFlash driving device provided by the embodiment of the present invention, by using a conversion operation state, the operation is changed from the user state to the kernel state in the application based on the NandFlash driving device, and the NandFlash structure is operated in the kernel. Kernel handle and kernel-related hardware data structure; and in the kernel state operation state, the remote wiping tool of the present invention is used to erase the NandFlash logic bad block in the kernel and the modified optimal remote burning tool to remotely write NandFlash data. In order to achieve the purpose of remotely upgrading the NandFlash driver device. In this way, the maintenance personnel can use the upgrade processing package provided by the system to run the upgrade script in the remote networked environment, and the remote online upgrade can be realized, the operation is simple, the manpower is saved, and the running cost is saved;吋, also provides a stable use of the kernel backup function, so that when a kernel data is corrupted, it can be quickly booted from another kernel backup space, greatly reducing the failure rate, and solving the scene often fails to start due to kernel damage. Failure problem.

Claims

权利要求书 Claim
一种基于 NandFlash驱动设备的远程升级方法, 所述方法包括: 转换操作状态, 使操作从用户态进入内核态; A remote upgrade method based on a NandFlash driving device, the method comprising: converting an operation state, and causing an operation to enter a kernel state from a user state;
在内核态操作状态下, 远程升级 NandFlash驱动设备。 In the kernel mode operation state, remotely upgrade the NandFlash driver device.
根据权利要求 1所述的方法, 其中, 在内核态操作状态下, 远程升级 NandFlash驱动设备, 包括: The method according to claim 1, wherein, in the kernel mode operation state, the NandFlash driver device is upgraded remotely, including:
远程操作擦除工具擦除 NandFlash驱动设备中的数据; Remote operation erase tool to erase data in NandFlash drive device;
远程操作烧写工具写入 NandFlash数据; Remote operation programming tool writes NandFlash data;
获取现场运行配置信息, 远程保存到 NandFlash的指定空间; 读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配 置 息。 Obtain the on-site running configuration information, and save it to the specified space of NandFlash remotely. Read the live running configuration information saved in the specified space of NandFlash, and restore the live running configuration information.
根据权利要求 2所述的方法, 其中: The method of claim 2 wherein:
该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内 核中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指 定起始位置和结束位置的 NandFlash分区; The erase tool is used to remotely erase data in the NandFlash driver device, including erasing selected NandFlash partitions and/or NandFlash logic bad blocks in the kernel, and erasing the NandFlash partitions specifying the start and end positions as needed;
该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot、 内核、 远 程烧写工具的校验码一致。 This programming tool is used to remotely write NandFlash data and to make the verification codes of u-boot, kernel, and remote programming tools consistent.
根据权利要求 2或 3所述的方法, 其中, 远程操作擦除工具擦除 NandFl ash驱动设备中的数据, 包括: The method according to claim 2 or 3, wherein the remote operation erasing tool erases data in the NandFlash driving device, including:
找到内核中标记坏块信息的 NandFlash坏块表 BBT; Find the NandFlash bad block table BBT that marks the bad block information in the kernel;
在内核态操作状态下, 远程操作擦除工具清空 BBT中的表信息, 以及 擦除内核的 NandFlash的逻辑坏块。 In the kernel mode operation state, the remote operation erase tool clears the table information in the BBT and erases the logical bad blocks of the kernel's NandFlash.
根据权利要求 2或 3所述的方法, 其中, 远程操作烧写工具写入 NandFl ash数据, 包括: The method according to claim 2 or 3, wherein the remote operation programming tool writes the NandFl ash data, including:
下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中 根据权利要求 2所述的方法, 其中, 该指定空间是指 NandFlash驱动设 备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据保 存在 NandFlash驱动设备的 u-boot分区中尚未被使用的空间。 Downloading the remote programming tool, the kernel and the file system to the NandFlash driving device; remotely burning the kernel and the file system to the NandFlash driving device using the remote programming tool according to claim 2, wherein the designated space is NandFlash Drive setting The unused space in the u-boot partition is saved in the space of the U-boot partition of the NandFlash driver device that has not been used.
根据权利要求 2或 6所述的方法, 其中, 读取 NandFlash指定空间保存 的现场运行配置信息, 恢复现场运行配置信息, 包括: The method according to claim 2 or 6, wherein the field running configuration information saved in the specified space of the NandFlash is read, and the configuration information of the field operation is restored, including:
NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场 运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandF lash驱动设备的现场运行配置信息;  After the NandFlash driver device is started, the related field running configuration information saved in the specified space of the NandFlash is read, written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandF lash driving device is restored;
清空 NandFlash指定空间保存的现场运行配置信息。 Clear the field running configuration information saved in the specified space of NandFlash.
根据权利要求 5所述的方法, 其中, 下载远程擦除工具和远程烧写工 具采用以下的存储方式: 在 NandFlash驱动设备没有多余空间使用 Nan dFlash介质存储文件吋, 将内存映射成保存文件的介质。 The method according to claim 5, wherein the downloading the remote erasing tool and the remote burning tool adopt the following storage methods: when the NandFlash driving device has no extra space to store the file using the Nan dFlash medium, the memory is mapped to the medium for saving the file. .
根据权利要求 8所述的方法, 其中, 使用以内存作为文件存储介质的 t mpfs虚拟文件***来存储文件, 将所有的升级文件放置在该虚拟文件 ***中。 The method according to claim 8, wherein the file is stored using the t mpfs virtual file system using the memory as a file storage medium, and all the upgrade files are placed in the virtual file system.
一种基于 NandFlash驱动设备的远程升级装置, 该装置包括: 转换模 块, 升级模块; 其中: A remote upgrade device based on a NandFlash driving device, the device comprising: a conversion module, an upgrade module; wherein:
该转换模块, 用于转换操作状态, 使操作从用户态进入内核态; 该升级模块, 用于在内核态操作状态下, 远程升级 NandFlash驱动设 备。 The conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state; the upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel state operation state.
根据权利要求 10所述的装置, 其中, 该升级模块包括擦除模块, 烧写 模块, 恢复模块, 其中: The device according to claim 10, wherein the upgrading module comprises an erasing module, a programming module, and a recovery module, wherein:
擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据 烧写模块, 用于远程操作烧写工具写入 NandFlash数据, 以及获取现 场运行配置信息, 远程保存到 NandFlash的指定空间; The erasing module is used for remotely operating the erasing tool to erase the data burning module in the NandFlash driving device, for remotely operating the programming tool to write NandFlash data, and obtaining the on-site running configuration information, and saving to the designated space of the NandFlash remotely;
恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配置信息。 The recovery module is configured to read the on-site running configuration information saved in the specified space of the NandFlash, and restore the on-site running configuration information.
根据权利要求 11所述的装置, 其中: 该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内 核中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指 定起始位置和结束位置的 NandFlash分区; The apparatus of claim 11 wherein: The erasing tool is used for remotely erasing data in the NandFlash driving device, including erasing selected NandFlash partitions and/or NandFlash logical bad blocks in the kernel, and erasing the NandFlash partitions of the specified starting position and ending position as needed;
该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot、 内核、 远 程烧写工具的校验码一致。 This programming tool is used to remotely write NandFlash data and to make the verification codes of u-boot, kernel, and remote programming tools consistent.
根据权利要求 1域 12所述的装置, 其中, 擦除模块, 用于远程操作擦 除工具擦除 NandFlash驱动设备中的数据, 具体用于: The device according to claim 12, wherein the erasing module is configured to remotely erase the data in the NandFlash driving device, specifically for:
找到内核中标记坏块信息的 NandFlash坏块表 BBT; Find the NandFlash bad block table BBT that marks the bad block information in the kernel;
在内核态操作状态下, 远程操作擦除工具清空 BBT中表信息, 以及擦 除内核的 NandFlash的逻辑坏块。 In the kernel mode operation state, the remote operation erase tool clears the BBT table information and erases the kernel's NandFlash logic bad block.
根据权利要求 11或 12所述的装置, 其中, 烧写模块, 用于远程通过特 定的远程烧写工具写入 NandFlash数据, 以及获取现场运行配置信息 , 远程保存到 NandFlash的指定空间, 具体用于: The device according to claim 11 or 12, wherein the programming module is configured to remotely write NandFlash data through a specific remote programming tool, and obtain on-site running configuration information, and save the data to a specified space of the NandFlash, specifically for :
下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中 根据权利要求 11所述的装置, 其中, 该指定空间是指 NandFlash驱动 设备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据 保存在 NandFlash驱动设备的 u-boot分区中尚未被使用的空间。 Downloading the remote programming tool, the kernel and the file system to the NandFlash driving device; remotely burning the kernel and the file system to the NandFlash driving device using the remote programming tool according to claim 11, wherein the designated space is NandFlash The space in the u-boot partition of the drive device has not been used, and the field running configuration information data is saved in the unused space of the U-boot partition of the NandFlash drive device.
根据权利要求 11或 15所述的装置, 其中, 恢复模块, 用于读取 NandFl ash指定空间保存的现场运行配置信息, 恢复现场运行配置信息, 具 体用于: The device according to claim 11 or 15, wherein the recovery module is configured to read the field running configuration information saved in the NandFl ash designated space, and restore the field running configuration information, specifically for:
NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场 运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandF lash驱动设备的现场运行配置信息;  After the NandFlash driver device is started, the related field running configuration information saved in the specified space of the NandFlash is read, written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandF lash driving device is restored;
清空 NandFlash指定空间保存的现场运行配置信息。 Clear the field running configuration information saved in the specified space of NandFlash.
根据权利要求 14所述的装置, 其中, 下载远程擦除工具和远程烧写工 具采用以下的存储方式: 在 NandFlash驱动设备没有多余空间使用 Nan dFlash介质存储文件吋, 将内存映射成保存文件的介质。 The device according to claim 14, wherein the downloading the remote erasing tool and the remote burning tool adopt the following storage methods: using no space in the NandFlash driving device without using excess space The dFlash media stores files, which map memory to the medium on which the files are saved.
根据权利要求 17所述的装置, 其中, 使用以内存作为文件存储介质的 tmpfs虚拟文件***来存储文件, 将所有的升级文件放置在该虚拟文 件***中。 The apparatus according to claim 17, wherein the file is stored using a tmpfs virtual file system using a memory as a file storage medium, and all the upgrade files are placed in the virtual file system.
一种基于 NandFlash驱动设备的远程升级***, 该***包括: 升级装 置, NandFlash驱动设备; 其中, 该升级装置, 用于转换操作状态, 使操作从用户态进入内核态, 并在内核态操作状态下, 远程升级 Nan dFlash驱动设备。 A remote upgrade system based on a NandFlash drive device, the system includes: an upgrade device, a NandFlash drive device, wherein the upgrade device is configured to convert an operation state, and the operation enters a kernel state from a user state, and is in a kernel state operation state. , remotely upgrade the Nan dFlash drive device.
根据权利要求 19所述的***, 其中, 该升级装置包括: 转换模块, 升 级模块; The system according to claim 19, wherein the upgrading device comprises: a conversion module, an upgrade module;
该转换模块, 用于转换操作状态, 使操作从用户态进入内核态; 该升级模块, 用于在内核态操作状态下, 远程升级 NandFlash驱动设 备。 The conversion module is configured to convert an operation state, and the operation enters a kernel state from a user state; the upgrade module is configured to remotely upgrade the NandFlash driving device in a kernel state operation state.
根据权利要求 20所述的***, 其中, 该升级模块包括擦除模块, 烧写 模块, 恢复模块, 其中: The system according to claim 20, wherein the upgrading module comprises an erasing module, a programming module, and a recovery module, wherein:
擦除模块, 用于远程操作擦除工具擦除 NandFlash驱动设备中的数据 烧写模块, 用于远程操作烧写工具写入 NandFlash数据, 以及获取现 场运行配置信息, 远程保存到 NandFlash的指定空间; The erasing module is used for remotely operating the erasing tool to erase the data burning module in the NandFlash driving device, for remotely operating the programming tool to write NandFlash data, and obtaining the on-site running configuration information, and saving to the designated space of the NandFlash remotely;
恢复模块, 用于读取 NandFlash指定空间保存的现场运行配置信息, 恢复现场运行配置信息。 The recovery module is configured to read the on-site running configuration information saved in the specified space of the NandFlash, and restore the on-site running configuration information.
根据权利要求 21所述的***, 其中: The system of claim 21 wherein:
该擦除工具用于远程擦除 NandFlash驱动设备中的数据, 包括擦除内 核中选定的 NandFlash分区和 /或 NandFlash逻辑坏块, 根据需要擦除指 定起始位置和结束位置的 NandFlash分区; The erase tool is used to remotely erase data in the NandFlash driver device, including erasing selected NandFlash partitions and/or NandFlash logic bad blocks in the kernel, and erasing the NandFlash partitions specifying the start and end positions as needed;
该烧写工具用于远程写入 NandFlash数据, 以及使得 u-boot、 内核、 远 程烧写工具的校验码一致。 This programming tool is used to remotely write NandFlash data and to make the verification codes of u-boot, kernel, and remote programming tools consistent.
根据权利要求 21或 22所述的***, 其中, 擦除模块, 用于远程操作擦 除工具擦除 NandFlash驱动设备中的数据, 具体用于: The system according to claim 21 or 22, wherein the erasing module is used for remote operation wiping In addition to tools to erase data in the NandFlash driver device, specifically for:
找到内核中标记坏块信息的 NandFlash坏块表 BBT; Find the NandFlash bad block table BBT that marks the bad block information in the kernel;
在内核态操作状态下, 远程操作擦除工具清空 BBT中表信息, 以及擦 除内核的 NandFlash的逻辑坏块。 In the kernel mode operation state, the remote operation erase tool clears the BBT table information and erases the kernel's NandFlash logic bad block.
根据权利要求 21或 22所述的***, 其中, 烧写模块, 用于远程通过特 定的远程烧写工具写入 NandFlash数据, 以及获取现场运行配置信息 , 远程保存到 NandFlash的指定空间, 具体用于: The system according to claim 21 or 22, wherein the programming module is configured to remotely write NandFlash data through a specific remote programming tool, and obtain on-site running configuration information, and remotely save the specified space to the NandFlash, specifically for :
下载远程烧写工具、 内核和文件***到 NandFlash驱动设备上; 使用远程烧写工具远程烧写内核与文件***到 NandFlash驱动设备中 根据权利要求 21所述的***, 其中, 该指定空间是指 NandFlash驱动 设备的 u-boot分区中尚未被使用的空间, 将该现场运行配置信息数据 保存在 NandFlash驱动设备的 u-boot分区中尚未被使用的空间。 Downloading the remote programming tool, the kernel and the file system to the NandFlash driving device; remotely burning the kernel and the file system to the NandFlash driving device using the remote programming tool according to claim 21, wherein the designated space is NandFlash The space in the u-boot partition of the drive device has not been used, and the field running configuration information data is saved in the unused space of the U-boot partition of the NandFlash drive device.
根据权利要求 21或 25所述的***, 其中, 恢复模块, 用于读取 NandFl ash指定空间保存的现场运行配置信息, 恢复现场运行配置信息, 具 体用于: The system according to claim 21 or 25, wherein the recovery module is configured to read the field running configuration information saved by the NandFl ash specified space, and restore the field running configuration information, specifically for:
NandFlash驱动设备启动后, 读取 NandFlash指定空间保存的相关现场 运行配置信息, 写入到 NandFlash驱动设备的配置文件中, 恢复 NandF lash驱动设备的现场运行配置信息;  After the NandFlash driver device is started, the related field running configuration information saved in the specified space of the NandFlash is read, written into the configuration file of the NandFlash driving device, and the field running configuration information of the NandF lash driving device is restored;
清空 NandFlash指定空间保存的现场运行配置信息。 Clear the field running configuration information saved in the specified space of NandFlash.
根据权利要求 24所述的***, 其中, 该***还包括内存装置, 该内存 装置用于存储升级装置的升级文件, 升级装置中的升级文件, 远程擦 除工具以及远程烧写工具下载采用以下的存储方式: 在 NandFlash驱 动设备没有多余空间使用 NandFlash介质存储文件吋, 将内存映射成 保存文件的介质。 The system according to claim 24, wherein the system further comprises a memory device for storing an upgrade file of the upgrade device, an upgrade file in the upgrade device, a remote wipe tool, and a remote burning tool downloading using the following Storage mode: The NandFlash drive device has no extra space to use NandFlash media to store files, and the memory is mapped to the medium on which the files are saved.
根据权利要求 27所述的***, 其中, 具体是使用以内存作为文件存储 介质的 tmpfs虚拟文件***来存储文件, 将所有的升级文件放置在该 虚拟文件***中。 The system according to claim 27, wherein the tmpfs virtual file system using the memory as a file storage medium is used to store the files, and all the upgrade files are placed in the virtual file system.
PCT/CN2016/095866 2016-08-18 2016-08-18 Device remote upgrade method, apparatus and system WO2018032460A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/095866 WO2018032460A1 (en) 2016-08-18 2016-08-18 Device remote upgrade method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/095866 WO2018032460A1 (en) 2016-08-18 2016-08-18 Device remote upgrade method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2018032460A1 true WO2018032460A1 (en) 2018-02-22

Family

ID=61197247

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095866 WO2018032460A1 (en) 2016-08-18 2016-08-18 Device remote upgrade method, apparatus and system

Country Status (1)

Country Link
WO (1) WO2018032460A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722420A (en) * 2011-10-25 2012-10-10 中国电力科学研究院 Self-diagnosis terminal, detection method and remote maintenance system
US20130111454A1 (en) * 2010-06-17 2013-05-02 Fujitsu Limited Technique for updating program being executed
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104182256A (en) * 2014-08-21 2014-12-03 四川九成信息技术有限公司 Embedded equipment program updating method
CN104765626A (en) * 2014-01-08 2015-07-08 深圳中电长城信息安全***有限公司 Firmware program writing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130111454A1 (en) * 2010-06-17 2013-05-02 Fujitsu Limited Technique for updating program being executed
CN102722420A (en) * 2011-10-25 2012-10-10 中国电力科学研究院 Self-diagnosis terminal, detection method and remote maintenance system
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104765626A (en) * 2014-01-08 2015-07-08 深圳中电长城信息安全***有限公司 Firmware program writing method and device
CN104182256A (en) * 2014-08-21 2014-12-03 四川九成信息技术有限公司 Embedded equipment program updating method

Similar Documents

Publication Publication Date Title
CN101557583B (en) Remote-updating and version-switching method of repeater equipment embedded software
US7065608B2 (en) Apparatus for recording data and method for writing data to flash memory
CN109189445B (en) Method for upgrading program of equipment of Internet of things
US20110004871A1 (en) Embedded electronic device and firmware updating method thereof
CN104461611A (en) Method for refreshing node BIOS (basic input/output system) of RACK (RACK operating system) in batches
TW202016731A (en) Firmware updating method for fpga
CN103530150A (en) Remote updating method for Linux operating system
JP2003316595A (en) Installation method, file updating method, its program and computer system
CN101344868A (en) Data backup and acquiring method and device
CN101957765A (en) Method, system and equipment for updating equipment firmware
JPH113224A (en) Program updating method for portable information terminal equipment
JPH10283167A (en) Device internal setting information backup device, method and storage medium storing device internal setting information backup control program
JP4586469B2 (en) MEMORY CONTROL DEVICE, MEMORY CONTROL METHOD, PROGRAM
JP2004213201A (en) Version upgrading method
TWI493341B (en) Memory storage device and repairing method thereof
WO2018032460A1 (en) Device remote upgrade method, apparatus and system
CN103731301A (en) Dual backup achieving method of remote network system
CN110888656A (en) Multifunctional programming device and programming method
JP2001249855A (en) Method for rewriting data of nonvolatile memory and subscriber circuit
JP4430931B2 (en) Image forming apparatus and firmware update method thereof
WO2012062132A1 (en) Self-programming method and device for file system based on nand flash memory
CN111007989A (en) Storage and use method of missile-borne FLASH chip bad block information
KR20010038169A (en) An alteration method of booting program
KR100643286B1 (en) Removable storage and recovering method for file system using removable sotrages
KR100966999B1 (en) Apparatus and method for updating flash memory

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: 16913217

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: 16913217

Country of ref document: EP

Kind code of ref document: A1