WO2017071646A1 - Method and apparatus for delivering device partition information - Google Patents

Method and apparatus for delivering device partition information Download PDF

Info

Publication number
WO2017071646A1
WO2017071646A1 PCT/CN2016/103787 CN2016103787W WO2017071646A1 WO 2017071646 A1 WO2017071646 A1 WO 2017071646A1 CN 2016103787 W CN2016103787 W CN 2016103787W WO 2017071646 A1 WO2017071646 A1 WO 2017071646A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
upgrade
description information
upgraded
file
Prior art date
Application number
PCT/CN2016/103787
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 中兴通讯股份有限公司
Publication of WO2017071646A1 publication Critical patent/WO2017071646A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present invention relates to the field of computers, and in particular, to a device partition information transmission method and apparatus.
  • flash (Flash Memory) devices such as nand (flash storage device) and nor (flash storage device) are often used in storage design.
  • flash storage device In order to facilitate the management of stored data by the system, it is necessary to The requirement is to spatially divide the storage device.
  • the system To achieve partition partitioning, the system needs to determine the number, size and other auxiliary information of the partition in advance. How to obtain this information is usually a simple way to maintain a static array of structures in the program module, each structure element corresponding to The partitioning information of a partition is finally generated by the driver to create each corresponding partition based on the fixed partition information. This way of statically obtaining partition information has certain limitations in complex embedded applications.
  • the embodiment of the invention provides a device partition information transmission method and device, so as to at least solve the problem that the program development phase is inefficient due to complicated adjustment of the partition information and the maintenance of the later program version is not convenient.
  • a device partition information delivery method including:
  • description information of the to-be-upgraded partition in the system is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition.
  • Index, size, and position offset information is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition.
  • the upgrade file is composed of a file header and each upgrade partition, and description information of the upgrade partition in the upgrade file is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and each upgrade The location of the partition in the upgrade file is offset; the content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to the application partition to be upgraded in the system.
  • the file header of the file is parsed, and the position of the upgrade partition data in the file header of the upgrade file is offset in the upgrade file;
  • the method further includes:
  • the upgrade data of the upgraded partition in the upgrade file is stored according to the description of the corresponding upgraded partition in the system.
  • the method further includes:
  • the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition;
  • the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the component partition in the system, it is used by the system to run.
  • a partition information transmission apparatus is further provided, and the partition information transmission apparatus includes:
  • the obtaining module is configured to read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file;
  • a determining module configured to determine whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system
  • a first update module configured to: when the determining module determines that the description information of the upgraded partition in the upgrade file is different from the description information of the corresponding upgraded partition in the system, updating a description of the corresponding upgraded partition in the system information;
  • the second update module is configured to update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
  • description information of the to-be-upgraded partition in the system is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition.
  • Index, size, and position offset information is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition.
  • the upgrade file is composed of a file header and each upgrade partition, and the upgrade in the upgrade file
  • the description information of the partition is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and the position offset of each upgrade partition in the upgrade file; the content of each upgrade partition is composed of components.
  • the header plus the upgrade data is composed; each upgrade partition corresponds to the application partition to be upgraded in the system.
  • the obtaining module includes:
  • the first obtaining unit is configured to parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file;
  • a second obtaining unit configured to obtain, according to a position offset of the upgrade partition data in the file header of the upgrade file, the upgrade partition data in the upgrade file;
  • a third obtaining unit configured to obtain, according to the component header of the upgraded partition data, description information of the upgraded partition.
  • the partition information delivery device further includes:
  • the first upgrade module is configured to store the upgrade partition in the upgrade file according to the description information of the corresponding upgrade partition in the system, if the description of the upgrade partition in the upgrade file is consistent with the description of the corresponding upgrade partition in the system. Upgrade data.
  • the partition information transmission device further includes:
  • the initialization module is configured to perform data matching and verification on the data in the component partition; if the verification is successful, initialize the corresponding partition in the system according to the updated description information of the corresponding partition in the component partition If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the system component partition, for system operation.
  • a storage medium is also provided.
  • the storage medium Set to store the program code used to perform the following steps:
  • the embodiment of the present invention reads the description information of the upgraded partition in the system from the component partition of the system, and obtains the description information of the upgrade partition in the upgrade file; and determines the description information of the upgrade partition in the upgrade file and the system. Whether the description information of the corresponding to-be-upgraded partition is consistent; if not, updating the description information of the corresponding to-be-upgraded partition in the system; and updating the component partition according to the updated description information of the corresponding partition in the system Description information of the corresponding partition within. Therefore, the problem that the program development phase is inefficient due to the complicated adjustment of the partition information and the maintenance of the later program version is not convenient is solved.
  • FIG. 1 is a schematic flowchart of a first embodiment of a method for transmitting device partition information according to the present invention
  • FIG. 2 is a schematic flowchart of a second embodiment of a method for transmitting device partition information according to the present invention
  • FIG. 3 is a schematic flowchart of a third embodiment of a method for transmitting device partition information according to the present invention.
  • FIG. 4 is a schematic flowchart of a fourth embodiment of a method for transmitting device partition information according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a first embodiment of a device partition information transmission apparatus according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a second embodiment of a device partition information transmission apparatus according to the present invention.
  • FIG. 7 is a schematic diagram of functional modules of a third embodiment of a device partition information transmission apparatus according to the present invention.
  • FIG. 8 is a schematic diagram of functional modules of a fourth embodiment of a device partition information transmission apparatus according to the present invention.
  • the main solution of the embodiment of the present invention is: reading description information of the partition to be upgraded in the system from the component partition of the system, and obtaining description information of the upgrade partition in the upgrade file; determining a description of the upgrade partition in the upgrade file Whether the information is consistent with the description information of the corresponding to-be-upgraded partition in the system; if not, the description information of the corresponding partition to be upgraded in the system is updated; according to the updated description information of the corresponding partition in the system, Update the description information of the corresponding partition in the component partition.
  • the embodiment of the invention provides a solution, which can divide the system component partition, unify the system upgrade file format, unify the description information and unify the system partition information, and solve the inefficiency and late stage of the program development phase caused by the complicated adjustment of the partition information. Program version maintenance Inconvenient question.
  • a first embodiment of the present invention provides a device partition information transmission method, including:
  • Step S10 Read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file.
  • a component partition is added on the basis of satisfying the partition division of the system application, and the partition is designed to be an appropriate size according to the system application requirement, and is used to store the partition description information list.
  • the partition description information is designed into a data structure of a specific format, and each structure describes other auxiliary information such as the index, size, and position offset of the corresponding partition.
  • the device upgrade file is designed as a combination of a file data header and each upgrade partition.
  • the data header is mainly used to describe the number of upgrade partitions and the position offset of each partition in the upgrade file.
  • each upgrade partition is designed as the format of the component header plus the upgrade data, and the component header is the description information of the partition to be upgraded.
  • the system flash is partitioned according to system requirements, and each partition stores specific data, wherein a certain space is reserved as a component partition at a fixed position of the flash, and the partition is used to store description information of each partition in the system, and each partition is used to store description information of each partition in the system.
  • a partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
  • step S20 it is determined whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding partition to be upgraded in the system, and if not, proceed to step S30;
  • the upgrade partition data is first found from the upgrade file header data, the partition description information is extracted from the component header of the data, and the upgrade content is stored according to the information, and the partition description information is determined whether the partition description information is currently used. The change has taken place.
  • Step S30 updating description information of the corresponding partition to be upgraded in the system.
  • the description of the upgraded partition of the upgrade file is inconsistent with the description of the corresponding upgraded partition in the system, the description of the corresponding upgraded partition in the system is changed, and the description of the upgraded partition in the upgrade file is required.
  • the description of the partition to be upgraded in the system is modified.
  • the upgraded data in the upgrade file is stored in the corresponding upgraded partition in the system according to the updated description information.
  • the description information records the index, size, and position offset information of the corresponding partition.
  • step S40 the description information of the corresponding partition in the component partition is updated according to the updated description information of the corresponding partition in the system.
  • the updated partition description information is stored in the component partition in the system to complete the update of the component partition.
  • the updated description information is used to complete the storage of the partition content in the flash, the total number of upgrade partitions is reduced.
  • the updated partition description information in the memory is stored in the component partition, that is, the partition information is dynamically transferred from the external version file to the system storage module.
  • the description information of the upgraded partition in the upgrade file is obtained by reading the description information of the partition to be upgraded in the system from the component partition of the system; and the description information of the upgrade partition in the upgrade file is determined. Whether the description information of the corresponding partition to be upgraded in the system is consistent; if not, updating the description information of the corresponding partition to be upgraded in the system; and updating the description according to the updated description information of the corresponding partition in the system Description of the corresponding partition within the component partition.
  • a second embodiment of the present invention provides a method for transmitting device partition information. Based on the embodiment shown in FIG. 1 , in the process of performing step S10, the method includes:
  • Step S11 Parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
  • the file header of the upgrade file is first parsed, and the upgrade data of the upgrade partition in the file header of the upgrade file is offset in the upgrade file, and then the file header is followed.
  • the system's upgrade data is upgraded by the location offset in the upgrade file.
  • the upgrade file is composed of a file header and each upgrade partition, a file header in the upgrade file describes the number of the upgrade partitions, and each upgrade partition is in the upgrade file. Position offset
  • Step S12 Obtain the upgrade partition data in the upgrade file according to the position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
  • the file header of the upgrade file can uniformly record and manage the entire device upgrade file.
  • the upgrade partition data of each upgrade file is separated, and the file header can record the upgrade of each upgrade file.
  • the upgrade data of each upgrade partition is recorded in each upgrade partition of the upgrade file.
  • the device is upgraded, it is convenient to distinguish the upgrade file location of each partition to be upgraded, and the upgrade data of the partition to be upgraded in the system can be quickly performed. Find.
  • Step S13 Obtain description information of the upgraded partition according to the component header of the upgraded partition data.
  • each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to an application partition to be upgraded in the system.
  • Each partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
  • the unified description of the partition description information is performed by the unified format of the upgrade file.
  • a third embodiment of the present invention provides a device partition information transmission.
  • the method based on the embodiment shown in FIG. 1 above, after the step S20, further includes:
  • Step S50 If the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the upgrade data of the upgraded partition in the upgrade file is stored according to the description information of the corresponding upgraded partition in the system.
  • the description of the upgraded partition of the upgrade file is consistent with the description of the corresponding upgraded partition in the system, and the description information of the corresponding upgraded partition in the system is not changed, and only the description information of the partition to be upgraded in the system is required.
  • the description information of the partition records the index, size, and position offset information of the corresponding partition.
  • the description information of each partition in the system can be unified, so that the effect of improving the accuracy of the description information of other partitions when upgrading one partition is achieved.
  • a fourth embodiment of the present invention provides a device partition information transmission method. After the step S40, the method further includes:
  • Step S60 Perform data matching and verification on the data in the component partition; if the verification is successful, initialize the corresponding partition in the system according to the updated description information of the corresponding partition in the component partition; If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the system according to the format of the description information in the component partition. Internal component partition for system operation.
  • the partition information list is read from the component partition to initialize the device. If the acquisition fails, it is considered to be the first power-on use of the system, and the default in memory is used.
  • the partition description information is used to complete the system initialization to ensure the normal completion of the first operation of the device.
  • the first power-on of the system indicates that there is no other usage record and other description information before the system is powered on.
  • the system initialization is required according to the system default partition description information.
  • the system reads the contents of the partition information from the component partition.
  • the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition.
  • the default partition description information is generated according to the format of the description information of the component partition, and the description information is stored in the component partition for use by the system.
  • the system is adapted to the design of the present invention by initializing the system.
  • the system can be successfully completed for the first time, which solves the problem that the device cannot be used normally due to the update of the upgrade file.
  • a first embodiment of the present invention provides a device partition information transmission apparatus, including: a first obtaining module 100, a determining module 200, a first updating module 300, and a second updating module, where:
  • the obtaining module 100 is configured to read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file.
  • a component partition is added on the basis of satisfying the system application partition division, and the partition is designed to be an appropriate size according to the system application requirements, and is used to store a partition description information list. Design the partition description information into a data structure of a specific format, each structure describing the pair Other auxiliary information such as the index, size, and position offset of the partition.
  • the device upgrade file is designed as a combination of a file data header and each upgrade partition.
  • the data header is mainly used to describe the number of upgrade partitions and the position offset of each partition in the upgrade file.
  • the content of each upgrade partition is designed as the format of the component header plus the upgrade data, and the component header is the description information of the partition to be upgraded.
  • the system flash is partitioned according to system requirements, and each partition stores specific data, wherein a certain space is reserved as a component partition at a fixed position of the flash, and the partition is used to store description information of each partition in the system, and each partition is used to store description information of each partition in the system.
  • a partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
  • the determining module 200 is configured to determine whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system.
  • the upgrade partition data is first found from the upgrade file header data, the partition description information is extracted from the component header of the data, and the upgrade content is stored according to the information, and the partition description information is determined whether the partition description information is currently used. The change has taken place.
  • the first update module 300 is configured to update the corresponding in the system when the determining module 200 determines that the description information of the upgraded partition in the upgrade file is different from the description information of the corresponding to-be-upgraded partition in the system. Description of the partition to be upgraded.
  • the description of the upgraded partition of the upgrade file is inconsistent with the description of the corresponding upgraded partition in the system, the description of the corresponding upgraded partition in the system is changed, and the description of the upgraded partition in the upgrade file is required.
  • the description of the partition to be upgraded in the system is modified.
  • the upgraded data in the upgrade file is stored in the corresponding upgraded partition in the system according to the updated description information.
  • the description information records the index, size, and positional deviation of the corresponding partition. Move information.
  • the second update module 400 is configured to update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
  • the updated partition description information is stored in the component partition in the system to complete the update of the component partition.
  • the obtaining module 100 parses the version upgrade file header, and obtains the number of partitions to be upgraded and the location of the partition data to be upgraded in the file.
  • the obtaining module 100 sequentially acquires data of the partition to be upgraded, and extracts partition description information from the data header.
  • the determining module 200 determines whether the partition description information is consistent with the same partition description information currently used by the system. If they match, update them.
  • the first update module 400 modifies the partition description information in the memory according to the difference.
  • the updated description information is used to complete the storage of the partition content in the flash, the total number of upgrade partitions is reduced.
  • the second update module 300 stores the updated partition description information in the memory into the component partition, that is, the partition information is dynamically transferred from the external version file to the system storage module.
  • system reset, initialization module 700 begins to use the new partition information to initialize the system.
  • the acquisition module 100 reads the system from the component partition of the system.
  • the description information of the upgraded partition is obtained, and the description information of the upgraded partition in the upgrade file is obtained.
  • the determining module 200 determines whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system; If the update module 300 is inconsistent, the description information of the corresponding partition to be upgraded in the system is updated; the second update module 400 updates the corresponding component partition according to the updated description information of the corresponding partition in the system. Description of the partition. The problem of inefficiency in the program development phase and inconvenient maintenance of the later program version due to the complicated adjustment of the partition information is solved.
  • the acquisition module 100 includes:
  • the first obtaining unit 110 is configured to parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
  • the file header of the upgrade file is first parsed, and the upgrade data of the upgrade partition in the file header of the upgrade file is offset in the upgrade file, and then the file header is followed.
  • the system's upgrade data is upgraded by the location offset in the upgrade file.
  • the upgrade file is composed of a file header and each upgrade partition, and a file header in the upgrade file describes the number of the upgrade partitions and a position offset of each upgrade partition in the upgrade file.
  • the second obtaining unit 120 is configured to obtain the upgrade partition data in the upgrade file according to the position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
  • the file header of the upgrade file can uniformly record and manage the entire device upgrade file.
  • the upgrade partition data of each upgrade file is separated, and the file header can record the upgrade of each upgrade file.
  • the upgrade data of each upgrade partition is recorded in each upgrade partition of the upgrade file.
  • the third obtaining unit 130 is configured to obtain description information of the upgraded partition according to the component header of the upgraded partition data.
  • each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to an application partition to be upgraded in the system.
  • Each partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
  • the unified description of the partition description information is performed by the unified format of the upgrade file.
  • a third embodiment of the present invention provides a device partition information transmission apparatus.
  • the partition information transmission apparatus includes:
  • the first upgrade module 500 is configured to: if the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the upgrade file is upgraded according to the description information of the corresponding upgraded partition in the system. Upgrade data for the partition.
  • the description of the upgraded partition of the upgrade file is consistent with the description of the corresponding upgraded partition in the system, and the description information of the corresponding upgraded partition in the system is not changed, and only the description information of the partition to be upgraded in the system is required.
  • the description information of the partition records the index, size, and position offset information of the corresponding partition.
  • the description information of each partition in the system can be unified, so that the effect of improving the accuracy of the description information of other partitions when upgrading one partition is achieved.
  • a fourth embodiment of the present invention provides a device partition information transmission apparatus.
  • the partition information transmission apparatus according to the embodiment shown in FIG. 5 includes:
  • the initialization module 600 is configured to perform data matching and verification on data in the component partition.
  • the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition;
  • the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the component partition in the system, it is used by the system to run.
  • the partition information list is read from the component partition to initialize the device. If the acquisition fails, it is considered to be the first power-on use of the system, and the default in memory is used.
  • the partition description information is used to complete the system initialization to ensure the normal completion of the first operation of the device.
  • the first power-on of the system indicates that there is no other usage record and other description information before the system is powered on.
  • the system initialization is required according to the system default partition description information.
  • the system reads the contents of the partition information from the component partition.
  • the initialization module 600 performs legality verification such as data matching and verification on the component partition content.
  • the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition.
  • the initialization module 600 generates the corresponding partition description information according to the format of the description information of the component partition, and stores the description information in the component partition for use by the system.
  • the system is initialized by the initialization module 600 to adapt the system to the design of the embodiment of the present invention.
  • the system can be successfully completed for the first time, which solves the problem that the device cannot be used normally due to the update of the upgrade file.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the device partition information transmission method and apparatus have the following beneficial effects: reading the description information of the partition to be upgraded in the system from the component partition of the system, and obtaining the upgrade in the upgrade file.
  • the description information of the partition to be upgraded; the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system; if not, the description information of the corresponding upgraded partition in the system is updated.
  • updating according to the updated description information of the corresponding partition in the system, the description information of the corresponding partition in the component partition. Therefore, the problem that the program development phase is inefficient due to the complicated adjustment of the partition information and the maintenance of the later program version is not convenient is solved.

Abstract

Disclosed are a method and apparatus for delivering device partition information. The method comprises: reading, from a component partition of a system, description information about a partition to be upgraded in the system, and acquiring description information about an upgraded partition in an upgrade file; judging whether the description information about the upgraded partition in the upgrade file is consistent with the description information about a corresponding partition to be upgraded in the system; if not, then updating the description information about the corresponding partition to be upgraded in the system; and updating the description information about the corresponding partition in the component partition according to the updated description information about the corresponding partition in the system. Also disclosed is an apparatus for delivering device partition information. The embodiments of the present invention solve the problems of low program development efficiency and inconvenience in later program version maintenance due to the complexity in device partition information adjustment.

Description

设备分区信息传递方法及装置Device partition information transmission method and device 技术领域Technical field
本发明涉及计算机领域,尤其涉及一种设备分区信息传递方法及装置。The present invention relates to the field of computers, and in particular, to a device partition information transmission method and apparatus.
背景技术Background technique
嵌入式产品开发应用中,在存储设计上经常会用到nand(闪存存储设备)、nor(闪存存储设备)等flash(Flash Memory,Flash存储器)设备,为了方便系统对存储数据的管理,需要根据需求对存储设备进行空间上的划分。而实现分区的划分需要系统事先确定好分区的数量、大小以及其他辅助信息,如何获得这些信息,通常一种简单的办法是在程序模块中维护一个静态的结构体数组,每个结构体元素对应了一个分区的相关划分信息,最后由驱动程序来根据这些固定的分区信息来创建各个相应的分区。这种静态获取分区信息的方式在复杂的嵌入式应用中会有一定的局限性,特别是在系统有多个模块都需要使用分区信息的情况下,一次分区信息的调整,就需要手动去修改多个关联的模块代码,以保证分区信息的一致性,这就导致了在程序开发阶段的效率低下以及后期程序版本维护不便利。In embedded product development applications, flash (Flash Memory) devices such as nand (flash storage device) and nor (flash storage device) are often used in storage design. In order to facilitate the management of stored data by the system, it is necessary to The requirement is to spatially divide the storage device. To achieve partition partitioning, the system needs to determine the number, size and other auxiliary information of the partition in advance. How to obtain this information is usually a simple way to maintain a static array of structures in the program module, each structure element corresponding to The partitioning information of a partition is finally generated by the driver to create each corresponding partition based on the fixed partition information. This way of statically obtaining partition information has certain limitations in complex embedded applications. Especially in the case where there are multiple modules in the system that need to use partition information, the adjustment of the partition information needs to be manually modified. Multiple associated module code to ensure the consistency of the partition information, which leads to inefficiency in the program development phase and inconvenient maintenance of the later program version.
上述内容仅用于辅助理解本发明实施例的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist in understanding the technical solutions of the embodiments of the present invention, and does not represent that the above is prior art.
发明内容Summary of the invention
本发明实施例提供了一种设备分区信息传递方法及装置,以至少解决由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。The embodiment of the invention provides a device partition information transmission method and device, so as to at least solve the problem that the program development phase is inefficient due to complicated adjustment of the partition information and the maintenance of the later program version is not convenient.
根据本发明的一个实施例,提供了一种设备分区信息传递方法,包括:According to an embodiment of the present invention, a device partition information delivery method is provided, including:
从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息; Read the description of the partition to be upgraded in the system from the component partition of the system, and obtain the description information of the upgrade partition in the upgrade file;
判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;Determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
若不一致,则更新所述系统内对应的待升级分区的描述信息;If not, update the description information of the corresponding to-be-upgraded partition in the system;
按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。Updating the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
可选地,所述系统内待升级分区的描述信息存储于所述组件分区中,所述描述信息为设定格式的数据结构,所述数据结构由结构体组成,所述结构体描述对应分区的索引、大小以及位置偏移信息:Optionally, description information of the to-be-upgraded partition in the system is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition. Index, size, and position offset information:
所述升级文件由文件头与各个升级分区组成,所述升级文件中的升级分区的描述信息存储于所述升级文件的文件头中,文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中的位置偏移;每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The upgrade file is composed of a file header and each upgrade partition, and description information of the upgrade partition in the upgrade file is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and each upgrade The location of the partition in the upgrade file is offset; the content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to the application partition to be upgraded in the system.
可件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移;The file header of the file is parsed, and the position of the upgrade partition data in the file header of the upgrade file is offset in the upgrade file;
根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据;Obtaining upgrade partition data in the upgrade file according to a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file;
根据所述升级分区数据的组件头,获取升级分区的描述信息。Obtaining description information of the upgrade partition according to the component header of the upgrade partition data.
可选地,所述判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致的步骤之后,还包括:Optionally, after the step of determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the method further includes:
若升级文件中的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。 If the description of the upgraded partition in the upgrade file is the same as the description of the corresponding upgraded partition in the system, the upgrade data of the upgraded partition in the upgrade file is stored according to the description of the corresponding upgraded partition in the system.
可选地,所述按照更新后的所述系统内对应的各个分区的描述信息,更新所述组件分区内对应的各个应用分区的描述信息的步骤之后,还包括:Optionally, after the step of updating the description information of the corresponding application partitions in the component partition according to the description information of the corresponding partitions in the updated system, the method further includes:
对所述组件分区内的数据进行数据匹配及校验;Perform data matching and verification on data in the component partition;
若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;If the verification is successful, the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition;
若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the component partition in the system, it is used by the system to run.
根据本发明的另一实施例,还提供了一种分区信息传递装置,所述分区信息传递装置包括:According to another embodiment of the present invention, a partition information transmission apparatus is further provided, and the partition information transmission apparatus includes:
获取模块,设置为从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;The obtaining module is configured to read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file;
判断模块,设置为判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;a determining module, configured to determine whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
第一更新模块,设置为在判断模块判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息不一致时,更新所述系统内对应的待升级分区的描述信息;a first update module, configured to: when the determining module determines that the description information of the upgraded partition in the upgrade file is different from the description information of the corresponding upgraded partition in the system, updating a description of the corresponding upgraded partition in the system information;
第二更新模块,设置为按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。The second update module is configured to update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
可选地,所述系统内待升级分区的描述信息存储于所述组件分区中,所述描述信息为设定格式的数据结构,所述数据结构由结构体组成,所述结构体描述对应分区的索引、大小以及位置偏移信息:Optionally, description information of the to-be-upgraded partition in the system is stored in the component partition, the description information is a data structure in a format, and the data structure is composed of a structure, and the structure describes a corresponding partition. Index, size, and position offset information:
所述升级文件由文件头与各个升级分区组成,所述升级文件中的升级 分区的描述信息存储于所述升级文件的文件头中,文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中的位置偏移;每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The upgrade file is composed of a file header and each upgrade partition, and the upgrade in the upgrade file The description information of the partition is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and the position offset of each upgrade partition in the upgrade file; the content of each upgrade partition is composed of components. The header plus the upgrade data is composed; each upgrade partition corresponds to the application partition to be upgraded in the system.
可选地,所述获取模块包括:Optionally, the obtaining module includes:
第一获取单元,设置为对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移;The first obtaining unit is configured to parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file;
第二获取单元,设置为根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据;a second obtaining unit, configured to obtain, according to a position offset of the upgrade partition data in the file header of the upgrade file, the upgrade partition data in the upgrade file;
第三获取单元,设置为根据所述升级分区数据的组件头,获取升级分区的描述信息。And a third obtaining unit, configured to obtain, according to the component header of the upgraded partition data, description information of the upgraded partition.
可选地,所述分区信息传递装置还包括:Optionally, the partition information delivery device further includes:
第一升级模块,设置为若升级文件中的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。The first upgrade module is configured to store the upgrade partition in the upgrade file according to the description information of the corresponding upgrade partition in the system, if the description of the upgrade partition in the upgrade file is consistent with the description of the corresponding upgrade partition in the system. Upgrade data.
可选地,所述分区信息传递装置,还包括:Optionally, the partition information transmission device further includes:
初始化模块,设置为对所述组件分区内的数据进行数据匹配及校验;若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。The initialization module is configured to perform data matching and verification on the data in the component partition; if the verification is successful, initialize the corresponding partition in the system according to the updated description information of the corresponding partition in the component partition If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the system component partition, for system operation.
根据本发明的又一个实施例,还提供了一种存储介质。该存储介质设 置为存储用于执行以下步骤的程序代码:According to still another embodiment of the present invention, a storage medium is also provided. The storage medium Set to store the program code used to perform the following steps:
从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;Read the description of the partition to be upgraded in the system from the component partition of the system, and obtain the description information of the upgrade partition in the upgrade file;
判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;Determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
若不一致,则更新所述系统内对应的待升级分区的描述信息;If not, update the description information of the corresponding to-be-upgraded partition in the system;
按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。Updating the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
本发明实施例通过从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;若不一致,则更新所述系统内对应的待升级分区的描述信息;按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。从而解决了由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。The embodiment of the present invention reads the description information of the upgraded partition in the system from the component partition of the system, and obtains the description information of the upgrade partition in the upgrade file; and determines the description information of the upgrade partition in the upgrade file and the system. Whether the description information of the corresponding to-be-upgraded partition is consistent; if not, updating the description information of the corresponding to-be-upgraded partition in the system; and updating the component partition according to the updated description information of the corresponding partition in the system Description information of the corresponding partition within. Therefore, the problem that the program development phase is inefficient due to the complicated adjustment of the partition information and the maintenance of the later program version is not convenient is solved.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1为本发明设备分区信息传递方法第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of a method for transmitting device partition information according to the present invention;
图2为本发明设备分区信息传递方法第二实施例的流程示意图;2 is a schematic flowchart of a second embodiment of a method for transmitting device partition information according to the present invention;
图3为本发明设备分区信息传递方法第三实施例的流程示意图;3 is a schematic flowchart of a third embodiment of a method for transmitting device partition information according to the present invention;
图4为本发明设备分区信息传递方法第四实施例的流程示意图;4 is a schematic flowchart of a fourth embodiment of a method for transmitting device partition information according to the present invention;
图5为本发明设备分区信息传递装置第一实施例的功能模块示意图;5 is a schematic diagram of functional modules of a first embodiment of a device partition information transmission apparatus according to the present invention;
图6为本发明设备分区信息传递装置第二实施例的功能模块示意图; 6 is a schematic diagram of functional modules of a second embodiment of a device partition information transmission apparatus according to the present invention;
图7为本发明设备分区信息传递装置第三实施例的功能模块示意图;7 is a schematic diagram of functional modules of a third embodiment of a device partition information transmission apparatus according to the present invention;
图8为本发明设备分区信息传递装置第四实施例的功能模块示意图;8 is a schematic diagram of functional modules of a fourth embodiment of a device partition information transmission apparatus according to the present invention;
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例的主要解决方案是:从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;若不一致,则更新所述系统内对应的待升级分区的描述信息;按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。The main solution of the embodiment of the present invention is: reading description information of the partition to be upgraded in the system from the component partition of the system, and obtaining description information of the upgrade partition in the upgrade file; determining a description of the upgrade partition in the upgrade file Whether the information is consistent with the description information of the corresponding to-be-upgraded partition in the system; if not, the description information of the corresponding partition to be upgraded in the system is updated; according to the updated description information of the corresponding partition in the system, Update the description information of the corresponding partition in the component partition.
由于相关技术中在实际复杂的嵌入式应用中,使用分区信息的情况下,依次分区信息的调整,就必须动手修改多个关联的模块代码,以保证分区信息的一致性,导致了在程序开发阶段的效率低下以及后期程序版本维护的不便利。In the related art, in the actual complex embedded application, in the case of using partition information, in order to adjust the partition information in turn, it is necessary to manually modify a plurality of associated module codes to ensure the consistency of the partition information, resulting in program development. The inefficiency of the phase and the inconvenience of maintaining the later version of the program.
本发明实施例提供了一种解决方案,能够划分系统组件分区,统一系统升级文件格式,统一描述信息以及统一系统的分区信息,解决了由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护 不便利的问题。The embodiment of the invention provides a solution, which can divide the system component partition, unify the system upgrade file format, unify the description information and unify the system partition information, and solve the inefficiency and late stage of the program development phase caused by the complicated adjustment of the partition information. Program version maintenance Inconvenient question.
参照图1,本发明第一实施例提供一种设备分区信息传递方法,包括:Referring to FIG. 1, a first embodiment of the present invention provides a device partition information transmission method, including:
步骤S10,从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息。Step S10: Read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file.
在本实施例方案中,在满足系统应用分区划分的基础上添加一个组件分区,该分区会根据系统应用需求设计为合适的大小,并用来存储分区描述信息列表。In the solution of the embodiment, a component partition is added on the basis of satisfying the partition division of the system application, and the partition is designed to be an appropriate size according to the system application requirement, and is used to store the partition description information list.
将分区描述信息设计为特定格式的数据结构,每个结构体描述了对应分区的索引、大小以及位置偏移等其他辅助信息。The partition description information is designed into a data structure of a specific format, and each structure describes other auxiliary information such as the index, size, and position offset of the corresponding partition.
将设备升级文件设计为文件数据头与各个升级分区的组合形式,数据头主要用来说明本次升级分区的个数,以及每个分区在本次升级文件中的位置偏移。The device upgrade file is designed as a combination of a file data header and each upgrade partition. The data header is mainly used to describe the number of upgrade partitions and the position offset of each partition in the upgrade file.
将每个升级分区内容设计为组件头加升级数据的格式,组件头即为本次待升级分区的描述信息。The content of each upgrade partition is designed as the format of the component header plus the upgrade data, and the component header is the description information of the partition to be upgraded.
其中,根据系统需求,对系统flash进行分区划分,每个分区存储特定的数据,其中在flash的固定位置处留出一定空间作为组件分区,该分区用来存储系统中各分区的描述信息,每一个分区描述信息对应了一个结构体数据,对分区的属性进行了相关描述,包括分区名称、大小、所处的位置偏移以及其他辅助信息。The system flash is partitioned according to system requirements, and each partition stores specific data, wherein a certain space is reserved as a component partition at a fixed position of the flash, and the partition is used to store description information of each partition in the system, and each partition is used to store description information of each partition in the system. A partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
步骤S20,判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致,若不一致,则进入步骤S30;In step S20, it is determined whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding partition to be upgraded in the system, and if not, proceed to step S30;
其中,在程序版本升级操作中,先从升级文件头数据中找到升级分区数据,从数据的组件头中提取分区描述信息,并按照该信息来存放升级内容,同时判断分区描述信息是否与当前使用的发生了变化。 In the program version upgrade operation, the upgrade partition data is first found from the upgrade file header data, the partition description information is extracted from the component header of the data, and the upgrade content is stored according to the information, and the partition description information is determined whether the partition description information is currently used. The change has taken place.
步骤S30,更新所述系统内对应的待升级分区的描述信息。Step S30, updating description information of the corresponding partition to be upgraded in the system.
其中,升级文件的升级分区的描述信息与系统内对应的待升级分区的描述信息不一致,则证明系统内对应的待升级分区的描述信息发生改变,需要按照升级文件内的升级分区的描述信息对系统内待升级分区的描述信息进行修改。If the description of the upgraded partition of the upgrade file is inconsistent with the description of the corresponding upgraded partition in the system, the description of the corresponding upgraded partition in the system is changed, and the description of the upgraded partition in the upgrade file is required. The description of the partition to be upgraded in the system is modified.
其中,更新系统内对应的待升级分区的描述信息后,按照更新后的所述描述信息向所述系统内对应的待升级分区存放升级文件中的升级数据。After the description information of the corresponding upgraded partition in the system is updated, the upgraded data in the upgrade file is stored in the corresponding upgraded partition in the system according to the updated description information.
需要说明的是,描述信息记录的是对应分区的索引、大小以及位置偏移信息。It should be noted that the description information records the index, size, and position offset information of the corresponding partition.
步骤S40,按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。In step S40, the description information of the corresponding partition in the component partition is updated according to the updated description information of the corresponding partition in the system.
完成每个分区的描述信息的更新后,将更新过的分区描述信息存储到系统中的组件分区内,完成组件分区的更新。After completing the update of the description information of each partition, the updated partition description information is stored in the component partition in the system to complete the update of the component partition.
具体实施时,以系统升级过程为例,具体步骤如下:For specific implementation, take the system upgrade process as an example. The specific steps are as follows:
1,启动版本升级操作。1, start the version upgrade operation.
2,对版本升级文件头进行解析,获得本次升级的分区数以及待升级分区数据在文件中的位置。2. Parse the version upgrade file header to obtain the number of partitions to be upgraded and the location of the partition data to be upgraded in the file.
3,依次获取待升级分区的数据,并从数据头中提取分区描述信息。3. Obtain the data of the partition to be upgraded in turn, and extract the partition description information from the data header.
4,判断该分区描述信息与系统当前使用的同一分区描述信息是否一致。若一致,则进行更新。4. Determine whether the partition description information is consistent with the same partition description information currently used by the system. If they match, update them.
5,根据差异对内存中的分区描述信息进行修改。 5. Modify the partition description information in the memory according to the difference.
6,用更新过的描述信息完成该分区内容的在flash中的存储,升级分区总数自减。6, the updated description information is used to complete the storage of the partition content in the flash, the total number of upgrade partitions is reduced.
7,判断待升级分区数是否大于0,若是,则升级下一个分区。7. Determine whether the number of partitions to be upgraded is greater than 0. If yes, upgrade the next partition.
8,待所有分区升级完成后,将更新后的内存中的分区描述信息存储到组件分区中,即完成了分区信息从外部版本文件动态传递到系统存储模块。8. After all the partitions are upgraded, the updated partition description information in the memory is stored in the component partition, that is, the partition information is dynamically transferred from the external version file to the system storage module.
9,系统复位,开始使用新的分区信息去初始化系统。9, the system reset, start using the new partition information to initialize the system.
在本实施例中,通过从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;若不一致,则更新所述系统内对应的待升级分区的描述信息;按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。解决了由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。In this embodiment, the description information of the upgraded partition in the upgrade file is obtained by reading the description information of the partition to be upgraded in the system from the component partition of the system; and the description information of the upgrade partition in the upgrade file is determined. Whether the description information of the corresponding partition to be upgraded in the system is consistent; if not, updating the description information of the corresponding partition to be upgraded in the system; and updating the description according to the updated description information of the corresponding partition in the system Description of the corresponding partition within the component partition. The problem of inefficiency in the program development phase and inconvenient maintenance of the later program version due to the complicated adjustment of the partition information is solved.
进一步地,参照图2,本发明第二实施例提供一种设备分区信息传递方法,基于上述图1所示的实施例,在执行步骤S10过程中,包括:Further, referring to FIG. 2, a second embodiment of the present invention provides a method for transmitting device partition information. Based on the embodiment shown in FIG. 1 , in the process of performing step S10, the method includes:
步骤S11、对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移。Step S11: Parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
其中,在系统升级过程中,读取升级文件时,首先对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区的升级数据在升级文件中的位置偏移,然后按照文件头中记录的升级数据在升级文件中的位置偏移对系统进行升级。In the system upgrade process, when the upgrade file is read, the file header of the upgrade file is first parsed, and the upgrade data of the upgrade partition in the file header of the upgrade file is offset in the upgrade file, and then the file header is followed. The system's upgrade data is upgraded by the location offset in the upgrade file.
其中,所述升级文件由文件头与各个升级分区组成,所述升级文件中的文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中 的位置偏移;The upgrade file is composed of a file header and each upgrade partition, a file header in the upgrade file describes the number of the upgrade partitions, and each upgrade partition is in the upgrade file. Position offset
步骤S12、根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据。Step S12: Obtain the upgrade partition data in the upgrade file according to the position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
其中,升级文件的文件头可以对整个设备升级文件进行统一的记录和管理,在设备升级文件中,每一个升级文件的升级分区的数据都是分开的,文件头可以记录每一个升级文件的升级分区的升级数据的位置,升级分区的总数,方便系统升级时对升级文件的升级分区的统一管理与调用。The file header of the upgrade file can uniformly record and manage the entire device upgrade file. In the device upgrade file, the upgrade partition data of each upgrade file is separated, and the file header can record the upgrade of each upgrade file. The location of the upgrade data of the partition, the total number of upgraded partitions, and the unified management and call of the upgrade partition of the upgrade file during the system upgrade.
其中,升级文件的各个升级分区中记录着各个升级分区的升级数据,当设备升级的过程中,方便区分各个待升级分区的升级文件的位置,可以对系统内的待升级分区的升级数据进行快速查找。The upgrade data of each upgrade partition is recorded in each upgrade partition of the upgrade file. When the device is upgraded, it is convenient to distinguish the upgrade file location of each partition to be upgraded, and the upgrade data of the partition to be upgraded in the system can be quickly performed. Find.
步骤S13、根据所述升级分区数据的组件头,获取升级分区的描述信息。Step S13: Obtain description information of the upgraded partition according to the component header of the upgraded partition data.
其中,每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to an application partition to be upgraded in the system.
其中,每一个分区描述信息对应了一个结构体数据,对分区的属性进行了相关描述,包括分区名称、大小、所处的位置偏移以及其他辅助信息。将这些数据统一记录,管理可以起到对待升级分区的快速升级,同时可以快速的找到升级数据在待升级分区的位置。Each partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information. By recording these data in a unified manner, management can quickly upgrade the partitions to be upgraded, and at the same time, it can quickly find the location of the upgrade data in the partition to be upgraded.
在本实施例中,通过对升级文件的统一格式,分区描述信息的统一管理。解决了由于分区描述信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。In this embodiment, the unified description of the partition description information is performed by the unified format of the upgrade file. The problem that the program development stage is inefficient due to the complicated adjustment of the partition description information and the maintenance of the later program version is not convenient is solved.
进一步地,参照图3,本发明第三实施例提供一种设备分区信息传递 方法,基于上述图1所示的实施例,在上述步骤S20之后,还包括:Further, referring to FIG. 3, a third embodiment of the present invention provides a device partition information transmission. The method, based on the embodiment shown in FIG. 1 above, after the step S20, further includes:
步骤S50、若升级文件中的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。Step S50: If the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the upgrade data of the upgraded partition in the upgrade file is stored according to the description information of the corresponding upgraded partition in the system.
其中,升级文件的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则证明系统内对应的待升级分区的描述信息没有发生改变,只需要按照系统内待升级分区的描述信息进行升级数据的存放。The description of the upgraded partition of the upgrade file is consistent with the description of the corresponding upgraded partition in the system, and the description information of the corresponding upgraded partition in the system is not changed, and only the description information of the partition to be upgraded in the system is required. Store the upgrade data.
需要说明的是,分区的描述信息记录的是对应分区的索引、大小以及位置偏移信息。It should be noted that the description information of the partition records the index, size, and position offset information of the corresponding partition.
在本实施例中,通过更新系统内待升级分区的描述信息,可以统一系统内各分区的描述信息,从而达到对一个分区进行升级时,不会影响其他分区的描述信息的准确性的效果。In this embodiment, by updating the description information of the partition to be upgraded in the system, the description information of each partition in the system can be unified, so that the effect of improving the accuracy of the description information of other partitions when upgrading one partition is achieved.
进一步地,参照图4,本发明第四实施例提供一种设备分区信息传递方法,基于上述图1所示的实施例,在上述步骤S40之后,还包括:Further, referring to FIG. 4, a fourth embodiment of the present invention provides a device partition information transmission method. After the step S40, the method further includes:
步骤S60、对所述组件分区内的数据进行数据匹配及校验;若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。Step S60: Perform data matching and verification on the data in the component partition; if the verification is successful, initialize the corresponding partition in the system according to the updated description information of the corresponding partition in the component partition; If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the system according to the format of the description information in the component partition. Internal component partition for system operation.
其中,为配合本发明的设计,系统更新后,从组件分区读取分区信息列表来对设备进行初始化,如获取失败,则认为是该系统的第一次上电使用,则使用内存中默认的分区描述信息来完成系统初始化,以保证设备的第一次运行的正常完成。 In order to cooperate with the design of the present invention, after the system is updated, the partition information list is read from the component partition to initialize the device. If the acquisition fails, it is considered to be the first power-on use of the system, and the default in memory is used. The partition description information is used to complete the system initialization to ensure the normal completion of the first operation of the device.
需要说明的是,系统第一次上电使用是说明,系统上电使用之前没有其他使用记录和其他描述信息,需要按照系统默认的分区描述信息来完成系统初始化。It should be noted that the first power-on of the system indicates that there is no other usage record and other description information before the system is powered on. The system initialization is required according to the system default partition description information.
具体实施时,以系统升级过程为例,具体步骤如下:For specific implementation, take the system upgrade process as an example. The specific steps are as follows:
1,系统上电。1, the system is powered on.
2,系统从组件分区读取分区信息的内容。2. The system reads the contents of the partition information from the component partition.
3,对组件分区内容进行数据匹配及校验等合法性验证,。3. Perform legality verification such as data matching and verification on the component partition content.
4,若验证正确,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化。4. If the verification is correct, the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition.
5,若验证失败,则使用系统默认的静态分区表的描述信息来初始化系统。5. If the verification fails, the system's default static partition table description information is used to initialize the system.
6,将默认分区描述信息按照组件分区的描述信息的格式生成对应的分区描述信息,并将该描述信息存储到组件分区内,供系统运行使用。6. The default partition description information is generated according to the format of the description information of the component partition, and the description information is stored in the component partition for use by the system.
在本实施例中,通过对系统进行初始化,使系统适应本发明的设计。可以让系统第一次运行正常完成,解决了由于升级文件的更新导致的设备无法正常使用的问题。In the present embodiment, the system is adapted to the design of the present invention by initializing the system. The system can be successfully completed for the first time, which solves the problem that the device cannot be used normally due to the update of the upgrade file.
参照图5,本发明第一实施例提供一种设备分区信息传递装置,包括:第一获取模块100、判断模块200、第一更新模块300、第二更新模块,其中:Referring to FIG. 5, a first embodiment of the present invention provides a device partition information transmission apparatus, including: a first obtaining module 100, a determining module 200, a first updating module 300, and a second updating module, where:
获取模块100,设置为从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息。The obtaining module 100 is configured to read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file.
需要说明的是,在满足系统应用分区划分的基础上添加一个组件分区,该分区会根据系统应用需求设计为合适的大小,并用来存储分区描述信息列表。将分区描述信息设计为特定格式的数据结构,每个结构体描述了对 应分区的索引、大小以及位置偏移等其他辅助信息。将设备升级文件设计为文件数据头与各个升级分区的组合形式,数据头主要用来说明本次升级分区的个数,以及每个分区在本次升级文件中的位置偏移。将每个升级分区内容设计为组件头加升级数据的格式,组件头即为本次待升级分区的描述信息。It should be noted that a component partition is added on the basis of satisfying the system application partition division, and the partition is designed to be an appropriate size according to the system application requirements, and is used to store a partition description information list. Design the partition description information into a data structure of a specific format, each structure describing the pair Other auxiliary information such as the index, size, and position offset of the partition. The device upgrade file is designed as a combination of a file data header and each upgrade partition. The data header is mainly used to describe the number of upgrade partitions and the position offset of each partition in the upgrade file. The content of each upgrade partition is designed as the format of the component header plus the upgrade data, and the component header is the description information of the partition to be upgraded.
其中,根据系统需求,对系统flash进行分区划分,每个分区存储特定的数据,其中在flash的固定位置处留出一定空间作为组件分区,该分区用来存储系统中各分区的描述信息,每一个分区描述信息对应了一个结构体数据,对分区的属性进行了相关描述,包括分区名称、大小、所处的位置偏移以及其他辅助信息。The system flash is partitioned according to system requirements, and each partition stores specific data, wherein a certain space is reserved as a component partition at a fixed position of the flash, and the partition is used to store description information of each partition in the system, and each partition is used to store description information of each partition in the system. A partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information.
判断模块200,设置为判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致。The determining module 200 is configured to determine whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system.
其中,在程序版本升级操作中,先从升级文件头数据中找到升级分区数据,从数据的组件头中提取分区描述信息,并按照该信息来存放升级内容,同时判断分区描述信息是否与当前使用的发生了变化。In the program version upgrade operation, the upgrade partition data is first found from the upgrade file header data, the partition description information is extracted from the component header of the data, and the upgrade content is stored according to the information, and the partition description information is determined whether the partition description information is currently used. The change has taken place.
第一更新模块300,设置为若不一致,则在判断模块200判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息不一致时,更新所述系统内对应的待升级分区的描述信息。The first update module 300 is configured to update the corresponding in the system when the determining module 200 determines that the description information of the upgraded partition in the upgrade file is different from the description information of the corresponding to-be-upgraded partition in the system. Description of the partition to be upgraded.
其中,升级文件的升级分区的描述信息与系统内对应的待升级分区的描述信息不一致,则证明系统内对应的待升级分区的描述信息发生改变,需要按照升级文件内的升级分区的描述信息对系统内待升级分区的描述信息进行修改。If the description of the upgraded partition of the upgrade file is inconsistent with the description of the corresponding upgraded partition in the system, the description of the corresponding upgraded partition in the system is changed, and the description of the upgraded partition in the upgrade file is required. The description of the partition to be upgraded in the system is modified.
其中,更新系统内对应的待升级分区的描述信息后,按照更新后的所述描述信息向所述系统内对应的待升级分区存放升级文件中的升级数据。After the description information of the corresponding upgraded partition in the system is updated, the upgraded data in the upgrade file is stored in the corresponding upgraded partition in the system according to the updated description information.
需要说明的是,描述信息记录的是对应分区的索引、大小以及位置偏 移信息。It should be noted that the description information records the index, size, and positional deviation of the corresponding partition. Move information.
第二更新模块400,设置为按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。The second update module 400 is configured to update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
完成每个分区的描述信息的更新后,将更新过的分区描述信息存储到系统中的组件分区内,完成组件分区的更新。After completing the update of the description information of each partition, the updated partition description information is stored in the component partition in the system to complete the update of the component partition.
具体实施时,以系统升级过程为例,具体步骤如下:For specific implementation, take the system upgrade process as an example. The specific steps are as follows:
1,启动版本升级操作。1, start the version upgrade operation.
2,获取模块100对版本升级文件头进行解析,获得本次升级的分区数以及待升级分区数据在文件中的位置。2. The obtaining module 100 parses the version upgrade file header, and obtains the number of partitions to be upgraded and the location of the partition data to be upgraded in the file.
3,获取模块100依次获取待升级分区的数据,并从数据头中提取分区描述信息。3. The obtaining module 100 sequentially acquires data of the partition to be upgraded, and extracts partition description information from the data header.
4,判断模块200判断该分区描述信息与系统当前使用的同一分区描述信息是否一致。若一致,则进行更新。4. The determining module 200 determines whether the partition description information is consistent with the same partition description information currently used by the system. If they match, update them.
5,第一更新模块400根据差异对内存中的分区描述信息进行修改。5. The first update module 400 modifies the partition description information in the memory according to the difference.
6,用更新过的描述信息完成该分区内容的在flash中的存储,升级分区总数自减。6, the updated description information is used to complete the storage of the partition content in the flash, the total number of upgrade partitions is reduced.
7,判断待升级分区数是否大于0,若是,则升级下一个分区。7. Determine whether the number of partitions to be upgraded is greater than 0. If yes, upgrade the next partition.
8,待所有分区升级完成后,第二更新模块300将更新后的内存中的分区描述信息存储到组件分区中,即完成了分区信息从外部版本文件动态传递到系统存储模块。After the upgrade of all the partitions is completed, the second update module 300 stores the updated partition description information in the memory into the component partition, that is, the partition information is dynamically transferred from the external version file to the system storage module.
9,系统复位,初始化模块700开始使用新的分区信息去初始化系统。9, system reset, initialization module 700 begins to use the new partition information to initialize the system.
在本实施例中,通过获取模块100从系统的组件分区中读取系统内待 升级分区的描述信息,并获取升级文件中的升级分区的描述信息;判断模块200判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;第一更新模300块若不一致,则更新所述系统内对应的待升级分区的描述信息;第二更新模块400按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。解决了由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。In this embodiment, the acquisition module 100 reads the system from the component partition of the system. The description information of the upgraded partition is obtained, and the description information of the upgraded partition in the upgrade file is obtained. The determining module 200 determines whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system; If the update module 300 is inconsistent, the description information of the corresponding partition to be upgraded in the system is updated; the second update module 400 updates the corresponding component partition according to the updated description information of the corresponding partition in the system. Description of the partition. The problem of inefficiency in the program development phase and inconvenient maintenance of the later program version due to the complicated adjustment of the partition information is solved.
进一步地,参照图6,本发明第二实施例提供一种设备分区信息传递装置,基于上述图5所示的实施例,所述获取模块100包括:Further, referring to FIG. 6, the second embodiment of the present invention provides a device partition information transmission apparatus. The acquisition module 100 includes:
第一获取单元110,设置为对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移。The first obtaining unit 110 is configured to parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
其中,在系统升级过程中,读取升级文件时,首先对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区的升级数据在升级文件中的位置偏移,然后按照文件头中记录的升级数据在升级文件中的位置偏移对系统进行升级。In the system upgrade process, when the upgrade file is read, the file header of the upgrade file is first parsed, and the upgrade data of the upgrade partition in the file header of the upgrade file is offset in the upgrade file, and then the file header is followed. The system's upgrade data is upgraded by the location offset in the upgrade file.
其中,所述升级文件由文件头与各个升级分区组成,所述升级文件中的文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中的位置偏移;The upgrade file is composed of a file header and each upgrade partition, and a file header in the upgrade file describes the number of the upgrade partitions and a position offset of each upgrade partition in the upgrade file.
第二获取单元120,设置为根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据。The second obtaining unit 120 is configured to obtain the upgrade partition data in the upgrade file according to the position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file.
其中,升级文件的文件头可以对整个设备升级文件进行统一的记录和管理,在设备升级文件中,每一个升级文件的升级分区的数据都是分开的,文件头可以记录每一个升级文件的升级分区的升级数据的位置,升级分区的总数,方便系统升级时对升级文件的升级分区的统一管理与调用。The file header of the upgrade file can uniformly record and manage the entire device upgrade file. In the device upgrade file, the upgrade partition data of each upgrade file is separated, and the file header can record the upgrade of each upgrade file. The location of the upgrade data of the partition, the total number of upgraded partitions, and the unified management and call of the upgrade partition of the upgrade file during the system upgrade.
其中,升级文件的各个升级分区中记录着各个升级分区的升级数据, 当设备升级的过程中,方便区分各个待升级分区的升级文件的位置,可以对系统内的待升级分区的升级数据进行快速查找。The upgrade data of each upgrade partition is recorded in each upgrade partition of the upgrade file. When the device is upgraded, you can quickly find the upgrade file of the partition to be upgraded. You can quickly find the upgrade data of the partition to be upgraded in the system.
第三获取单元130,设置为根据所述升级分区数据的组件头,获取升级分区的描述信息。The third obtaining unit 130 is configured to obtain description information of the upgraded partition according to the component header of the upgraded partition data.
其中,每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to an application partition to be upgraded in the system.
其中,每一个分区描述信息对应了一个结构体数据,对分区的属性进行了相关描述,包括分区名称、大小、所处的位置偏移以及其他辅助信息。将这些数据统一记录,管理可以起到对待升级分区的快速升级,同时可以快速的找到升级数据在待升级分区的位置。Each partition description information corresponds to a structure data, and the attributes of the partition are described, including the partition name, size, location offset, and other auxiliary information. By recording these data in a unified manner, management can quickly upgrade the partitions to be upgraded, and at the same time, it can quickly find the location of the upgrade data in the partition to be upgraded.
在本实施例中,通过对升级文件的统一格式,分区描述信息的统一管理。解决了由于分区描述信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。In this embodiment, the unified description of the partition description information is performed by the unified format of the upgrade file. The problem that the program development stage is inefficient due to the complicated adjustment of the partition description information and the maintenance of the later program version is not convenient is solved.
进一步地,参照图7,本发明第三实施例提供一种设备分区信息传递装置,基于上述图5所示的实施例,所述分区信息传递装置包括:Further, referring to FIG. 7, a third embodiment of the present invention provides a device partition information transmission apparatus. According to the embodiment shown in FIG. 5, the partition information transmission apparatus includes:
第一升级模块500,设置为若升级文件中的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。The first upgrade module 500 is configured to: if the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the upgrade file is upgraded according to the description information of the corresponding upgraded partition in the system. Upgrade data for the partition.
其中,升级文件的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则证明系统内对应的待升级分区的描述信息没有发生改变,只需要按照系统内待升级分区的描述信息进行升级数据的存放。The description of the upgraded partition of the upgrade file is consistent with the description of the corresponding upgraded partition in the system, and the description information of the corresponding upgraded partition in the system is not changed, and only the description information of the partition to be upgraded in the system is required. Store the upgrade data.
需要说明的是,分区的描述信息记录的是对应分区的索引、大小以及位置偏移信息。 It should be noted that the description information of the partition records the index, size, and position offset information of the corresponding partition.
在本实施例中,通过更新系统内待升级分区的描述信息,可以统一系统内各分区的描述信息,从而达到对一个分区进行升级时,不会影响其他分区的描述信息的准确性的效果。In this embodiment, by updating the description information of the partition to be upgraded in the system, the description information of each partition in the system can be unified, so that the effect of improving the accuracy of the description information of other partitions when upgrading one partition is achieved.
进一步地,参照图8,本发明第四实施例提供一种设备分区信息传递装置,基于上述图5所示的实施例,所述分区信息传递装置,包括:Further, referring to FIG. 8, a fourth embodiment of the present invention provides a device partition information transmission apparatus. The partition information transmission apparatus according to the embodiment shown in FIG. 5 includes:
初始化模块600,设置为对所述组件分区内的数据进行数据匹配及校验;The initialization module 600 is configured to perform data matching and verification on data in the component partition.
若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;If the verification is successful, the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition;
若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the component partition in the system, it is used by the system to run.
其中,为配合本发明的设计,系统更新后,从组件分区读取分区信息列表来对设备进行初始化,如获取失败,则认为是该系统的第一次上电使用,则使用内存中默认的分区描述信息来完成系统初始化,以保证设备的第一次运行的正常完成。In order to cooperate with the design of the present invention, after the system is updated, the partition information list is read from the component partition to initialize the device. If the acquisition fails, it is considered to be the first power-on use of the system, and the default in memory is used. The partition description information is used to complete the system initialization to ensure the normal completion of the first operation of the device.
需要说明的是,系统第一次上电使用是说明,系统上电使用之前没有其他使用记录和其他描述信息,需要按照系统默认的分区描述信息来完成系统初始化。It should be noted that the first power-on of the system indicates that there is no other usage record and other description information before the system is powered on. The system initialization is required according to the system default partition description information.
具体实施时,以系统升级过程为例,具体步骤如下:For specific implementation, take the system upgrade process as an example. The specific steps are as follows:
1,系统上电。1, the system is powered on.
2,系统从组件分区读取分区信息的内容。2. The system reads the contents of the partition information from the component partition.
3,初始化模块600对组件分区内容进行数据匹配及校验等合法性验证,。 3. The initialization module 600 performs legality verification such as data matching and verification on the component partition content.
4,若验证正确,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化。4. If the verification is correct, the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition.
5,若验证失败,则使用系统默认的静态分区表的描述信息来初始化系统。5. If the verification fails, the system's default static partition table description information is used to initialize the system.
6,初始化模块600将默认分区描述信息按照组件分区的描述信息的格式生成对应的分区描述信息,并将该描述信息存储到组件分区内,供系统运行使用。The initialization module 600 generates the corresponding partition description information according to the format of the description information of the component partition, and stores the description information in the component partition for use by the system.
在本实施例中,通过初始化模块600对系统进行初始化,使系统适应本发明实施例的设计。可以让系统第一次运行正常完成,解决了由于升级文件的更新导致的设备无法正常使用的问题。In the present embodiment, the system is initialized by the initialization module 600 to adapt the system to the design of the embodiment of the present invention. The system can be successfully completed for the first time, which solves the problem that the device cannot be used normally due to the update of the upgrade file.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S10,从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;S10, reading description information of the to-be-upgraded partition in the system from the component partition of the system, and obtaining description information of the upgrade partition in the upgrade file;
S20,判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;S20, determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
S30,若不一致,则更新所述系统内对应的待升级分区的描述信息;S30, if not, updating the description information of the corresponding to-be-upgraded partition in the system;
S40,按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。S40. Update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。 For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.
工业实用性Industrial applicability
如上所述,本发明实施例提供的一种设备分区信息传递方法及装置,具有以下有益效果:通过从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;若不一致,则更新所述系统内对应的待升级分区的描述信息;按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。从而解决了由于分区信息调整复杂而导致的程序开发阶段效率低下以及后期程序版本维护不便利的问题。 As described above, the device partition information transmission method and apparatus provided by the embodiments of the present invention have the following beneficial effects: reading the description information of the partition to be upgraded in the system from the component partition of the system, and obtaining the upgrade in the upgrade file. The description information of the partition to be upgraded; the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system; if not, the description information of the corresponding upgraded partition in the system is updated. And updating, according to the updated description information of the corresponding partition in the system, the description information of the corresponding partition in the component partition. Therefore, the problem that the program development phase is inefficient due to the complicated adjustment of the partition information and the maintenance of the later program version is not convenient is solved.

Claims (11)

  1. 一种设备分区信息传递方法,包括:A device partition information transmission method includes:
    从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;Read the description of the partition to be upgraded in the system from the component partition of the system, and obtain the description information of the upgrade partition in the upgrade file;
    判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;Determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
    若不一致,则更新所述系统内对应的待升级分区的描述信息;If not, update the description information of the corresponding to-be-upgraded partition in the system;
    按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。Updating the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
  2. 如权利要求1所述的设备分区信息传递方法,其中,所述系统内待升级分区的描述信息存储于所述组件分区中,所述描述信息为设定格式的数据结构,所述数据结构由结构体组成,所述结构体描述对应分区的索引、大小以及位置偏移信息:The device partition information transmission method according to claim 1, wherein the description information of the partition to be upgraded in the system is stored in the component partition, and the description information is a data structure in a format, and the data structure is A structure consisting of the index, size, and position offset information of the corresponding partition:
    所述升级文件由文件头与各个升级分区组成,所述升级文件中的升级分区的描述信息存储于所述升级文件的文件头中,文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中的位置偏移;每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The upgrade file is composed of a file header and each upgrade partition, and description information of the upgrade partition in the upgrade file is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and each upgrade The location of the partition in the upgrade file is offset; the content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to the application partition to be upgraded in the system.
  3. 如权利要求2所述的设备分区信息传递方法,其中,所述获取升级文件中的升级分区的描述信息的步骤包括:对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移;The device partition information transmission method according to claim 2, wherein the step of obtaining the description information of the upgrade partition in the upgrade file comprises: parsing the file header of the upgrade file, and obtaining an upgrade partition in the file header of the upgrade file. The position of the data in the upgrade file is offset;
    根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据;Obtaining upgrade partition data in the upgrade file according to a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file;
    根据所述升级分区数据的组件头,获取升级分区的描述信息。 Obtaining description information of the upgrade partition according to the component header of the upgrade partition data.
  4. 如权利要求1所述的设备分区信息传递方法,其中,所述判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致的步骤之后,还包括:The device partition information transmission method according to claim 1, wherein after the step of determining whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system, the method further includes :
    若升级文件中的升级分区的描述信息与系统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。If the description of the upgraded partition in the upgrade file is the same as the description of the corresponding upgraded partition in the system, the upgrade data of the upgraded partition in the upgrade file is stored according to the description of the corresponding upgraded partition in the system.
  5. 如权利要求1-4任一项所述的设备分区信息传递方法,其中,所述按照更新后的所述系统内对应的各个分区的描述信息,更新所述组件分区内对应的各个应用分区的描述信息的步骤之后,还包括:The device partition information transmission method according to any one of claims 1 to 4, wherein the updating of the corresponding application partitions in the component partition according to the description information of the corresponding respective partitions in the updated system After the steps to describe the information, it also includes:
    对所述组件分区内的数据进行数据匹配及校验;Perform data matching and verification on data in the component partition;
    若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;If the verification is successful, the corresponding partition in the system is initialized according to the description information of the corresponding partition in the updated component partition;
    若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the component partition in the system, it is used by the system to run.
  6. 一种设备分区信息传递装置,包括:A device partition information transmission device includes:
    获取模块,设置为从系统的组件分区中读取系统内待升级分区的描述信息,并获取升级文件中的升级分区的描述信息;The obtaining module is configured to read description information of the to-be-upgraded partition in the system from the component partition of the system, and obtain description information of the upgrade partition in the upgrade file;
    判断模块,设置为判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息是否一致;a determining module, configured to determine whether the description information of the upgraded partition in the upgrade file is consistent with the description information of the corresponding upgraded partition in the system;
    第一更新模块,设置为在判断模块判断所述升级文件中的升级分区的描述信息与所述系统内对应的待升级分区的描述信息不一致时, 更新所述系统内对应的待升级分区的描述信息;a first update module, configured to: when the determining module determines that the description information of the upgraded partition in the upgrade file is inconsistent with the description information of the corresponding upgraded partition in the system, Updating description information of the corresponding partition to be upgraded in the system;
    第二更新模块,设置为按照更新后的所述系统内对应的分区的描述信息,更新所述组件分区内对应的分区的描述信息。The second update module is configured to update the description information of the corresponding partition in the component partition according to the updated description information of the corresponding partition in the system.
  7. 如权利要求6所述的设备分区信息传递装置,其中,所述系统内待升级分区的描述信息存储于所述组件分区中,所述描述信息为设定格式的数据结构,所述数据结构由结构体组成,所述结构体描述对应分区的索引、大小以及位置偏移信息:The device partition information transmission device according to claim 6, wherein the description information of the partition to be upgraded in the system is stored in the component partition, and the description information is a data structure of a format, and the data structure is A structure consisting of the index, size, and position offset information of the corresponding partition:
    所述升级文件由文件头与各个升级分区组成,所述升级文件中的升级分区的描述信息存储于所述升级文件的文件头中,文件头描述所述升级分区的个数,以及每个升级分区在所述升级文件中的位置偏移;每个升级分区的内容由组件头加升级数据组成;每个升级分区与所述系统内待升级应用分区对应。The upgrade file is composed of a file header and each upgrade partition, and description information of the upgrade partition in the upgrade file is stored in a file header of the upgrade file, the file header describes the number of the upgrade partitions, and each upgrade The location of the partition in the upgrade file is offset; the content of each upgrade partition is composed of component header plus upgrade data; each upgrade partition corresponds to the application partition to be upgraded in the system.
  8. 如权利要求6所述的设备分区信息传递装置,其中,所述获取模块包括:The device partition information delivery device of claim 6, wherein the obtaining module comprises:
    第一获取单元,设置为对升级文件的文件头进行解析,获取升级文件的文件头中的升级分区数据在升级文件中的位置偏移;The first obtaining unit is configured to parse the file header of the upgrade file, and obtain a position offset of the upgrade partition data in the file header of the upgrade file in the upgrade file;
    第二获取单元,设置为根据所述升级文件的文件头中的升级分区数据在升级文件中的位置偏移,获取升级文件中的升级分区数据;a second obtaining unit, configured to obtain, according to a position offset of the upgrade partition data in the file header of the upgrade file, the upgrade partition data in the upgrade file;
    第三获取单元,设置为根据所述升级分区数据的组件头,获取升级分区的描述信息。And a third obtaining unit, configured to obtain, according to the component header of the upgraded partition data, description information of the upgraded partition.
  9. 如权利要求6所述的设备分区信息传递装置,其中,所述分区信息传递装置还包括:The device partition information delivery device of claim 6, wherein the partition information delivery device further comprises:
    第一升级模块,设置为若升级文件中的升级分区的描述信息与系 统内对应的待升级分区的描述信息一致,则按照所述系统内对应的待升级分区的描述信息存放升级文件中升级分区的升级数据。The first upgrade module is set to the description and information of the upgrade partition in the upgrade file. If the description information of the corresponding upgraded partition is the same, the upgrade data of the upgraded partition in the upgrade file is stored according to the description information of the corresponding upgraded partition in the system.
  10. 如权利要求6-9任一项所述的设备分区信息传递装置,其中,所述分区信息传递装置还包括:The device partition information transmitting apparatus according to any one of claims 6 to 9, wherein the partition information transmitting apparatus further comprises:
    初始化模块,设置为对所述组件分区内的数据进行数据匹配及校验;若校验成功,则根据所述更新后的所述组件分区内对应的分区的描述信息对系统内对应分区进行初始化;若校验失败,则使用系统默认的静态分区表的描述信息来初始化所述系统内对应分区,将所述系统默认的静态分区表的描述信息按照组件分区内的描述信息的格式存储到所述系统内组件分区中,供系统运行使用。The initialization module is configured to perform data matching and verification on the data in the component partition; if the verification is successful, initialize the corresponding partition in the system according to the updated description information of the corresponding partition in the component partition If the verification fails, the description information of the system default static partition table is used to initialize the corresponding partition in the system, and the description information of the default static partition table of the system is stored in the format of the description information in the component partition. In the system component partition, for system operation.
  11. 一种计算机存储介质,设置为存储用于执行如权利要求1-5任一项所述的设备分区信息传递方法的计算机程序。 A computer storage medium arranged to store a computer program for performing the device partition information transfer method according to any one of claims 1-5.
PCT/CN2016/103787 2015-10-28 2016-10-28 Method and apparatus for delivering device partition information WO2017071646A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510715848.7A CN106648441A (en) 2015-10-28 2015-10-28 Method and device for transferring equipment partition information
CN201510715848.7 2015-10-28

Publications (1)

Publication Number Publication Date
WO2017071646A1 true WO2017071646A1 (en) 2017-05-04

Family

ID=58631329

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/103787 WO2017071646A1 (en) 2015-10-28 2016-10-28 Method and apparatus for delivering device partition information

Country Status (2)

Country Link
CN (1) CN106648441A (en)
WO (1) WO2017071646A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109960523B (en) * 2017-12-22 2023-07-21 浙江宇视科技有限公司 Firmware upgrading method and device for embedded equipment
CN112752154A (en) * 2019-10-29 2021-05-04 青岛海尔多媒体有限公司 Software upgrading method and device and smart television
CN112052031B (en) * 2020-08-26 2023-03-14 烽火通信科技股份有限公司 Method and device for automatically matching and upgrading CPLD (complex programmable logic device) by service board card

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7017004B1 (en) * 2002-03-29 2006-03-21 Microsoft Corporation System and method for updating contents of a flash ROM
CN101520734A (en) * 2008-12-17 2009-09-02 康佳集团股份有限公司 Method for upgrading data in flash memory, network TV and interactive set-top box thereof
CN102945179A (en) * 2012-11-28 2013-02-27 青岛海信宽带多媒体技术有限公司 Software upgrading method and device based on memory technology device (MTD) partition

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7017004B1 (en) * 2002-03-29 2006-03-21 Microsoft Corporation System and method for updating contents of a flash ROM
CN101520734A (en) * 2008-12-17 2009-09-02 康佳集团股份有限公司 Method for upgrading data in flash memory, network TV and interactive set-top box thereof
CN102945179A (en) * 2012-11-28 2013-02-27 青岛海信宽带多媒体技术有限公司 Software upgrading method and device based on memory technology device (MTD) partition

Also Published As

Publication number Publication date
CN106648441A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN108399256B (en) Heterogeneous database content synchronization method and device and middleware
JP6755954B2 (en) Interface data presentation method and equipment
US9507604B2 (en) Boot method and boot system
US8495351B2 (en) Preparing and preserving a system configuration during a hot upgrade
US20130054531A1 (en) Database cloning
US20110041124A1 (en) Version Management System
US8601464B2 (en) Memory online update system and method
US20180150302A1 (en) Method for Extracting BIOS Attributes for BIOS Management and System Therefor
WO2017071646A1 (en) Method and apparatus for delivering device partition information
KR101674975B1 (en) System upgrade method, apparatus, device, program, and recording medium
WO2017045491A1 (en) Method and system for upgrading sqlite3 embedded database
CN106020837A (en) Method and system for loading set top box drive
CN104182257A (en) Application software installation method and device
US20170115980A1 (en) Computerized system and method for patching an application by separating executables and working data using different images
CN110209420A (en) A kind of method and device updating bootstrap loader
CN104598237B (en) A kind of method and apparatus that user interface is generated under upgrade mode
US9588884B2 (en) Systems and methods for in-place reorganization of device storage
US20060129520A1 (en) System and method for automatically updating a program in a computer
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
US20130232287A1 (en) Method of obtaining instruction for triggering function
CN104090780A (en) Automatic configuration method and cloud compiling system
CN112000646A (en) Database initialization method and device, electronic equipment and storage medium
US20160239285A1 (en) Systems and methods for download and installation of drivers for unmanaged information handling resources
CN109343886A (en) A kind of method, apparatus and equipment of upgrading BIOS
US11620136B2 (en) Space snapshots

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

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

Country of ref document: EP

Kind code of ref document: A1