CN1908934A - Online updating control method and device of embedded database - Google Patents

Online updating control method and device of embedded database Download PDF

Info

Publication number
CN1908934A
CN1908934A CN 200610103833 CN200610103833A CN1908934A CN 1908934 A CN1908934 A CN 1908934A CN 200610103833 CN200610103833 CN 200610103833 CN 200610103833 A CN200610103833 A CN 200610103833A CN 1908934 A CN1908934 A CN 1908934A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
database
embedded
new
control
upgrade
Prior art date
Application number
CN 200610103833
Other languages
Chinese (zh)
Other versions
CN100487701C (en )
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

Links

Abstract

The on-line upgrade control method for embedded database comprises: applying new memory area to generate upgraded database, and switching the current area address recorded in kernel base site into the new one. This invention can keep service continuality by on-line upgrade.

Description

一种嵌入式数据库的在线升级控制方法和装置 Online upgrade method and apparatus for controlling an embedded database

技术领域 FIELD

本发明涉及嵌入式数据库,尤其涉及一种嵌入式数据库的在线升级控制方法和装置。 The present invention relates to an embedded database, particularly to online upgrade method and apparatus for controlling an embedded database.

背景技术 Background technique

嵌入式数据库作为一种与具体应用紧密结合,高效紧凑的数据库系统,在通信领域得到广泛应用。 As an embedded database specific application closely integrated, compact and efficient database system, widely used in the communications field. 由于嵌入式数据库系统的针对性极强,与具体应用的捆绑相当紧密,具有“定制”的特点,因此,一旦其服务的上层应用系统发生更改,嵌入式数据库系统中支撑上层应用系统的相应部分也需要随之改变。 Due to the highly specific embedded database system, bundled with specific application very close, with a "custom" features, so once its parent application service changes, the embedded database system to support the upper portion of the corresponding application system also it needs to change.

作为典型的嵌入式数据库系统实现,其原理是在申请一块内存并以特定方式进行规划,用于管理上层应用系统所需数据的存取。 As a typical embedded database system implementation, the principle is applying for a block of memory and planning in a particular way, access to data needed for upper management applications. 可见,上层应用系统对数据的需求直接影响到这块内存的具体规划。 Visible, the upper application system requirements for data directly affect the memory of this specific plan. 这种规划一般是在嵌入式数据库系统设计中就已经决定,嵌入式数据库系统运行过程中不会发生变化。 Such planning is usually already decided in the embedded database system design, the process does not change the embedded database system is running.

因为嵌入式数据库的升级涉及到嵌入式数据库结构的更改,目前,只能采用整个嵌入式数据库系统替换的方式进行嵌入式数据库的升级。 Because the upgrade involves changing the embedded database embedded database structure, at present, we can only use the embedded database system alternative ways to upgrade an embedded database. 通过卸载旧的嵌入式数据库系统,替换新的嵌入式数据库系统的升级方式不可避免的会导致系统运行的中断。 By uninstalling the old embedded database system, replace upgrade new embedded database system will inevitably lead to interrupt system operation. 对于服务持续性要求极高的通信行业,其影响是非常大的。 For very high service continuity requirements of the telecommunications industry, the impact is very large.

发明内容 SUMMARY

本发明提供一种嵌入式数据库的在线升级控制方法和装置,用以解决现有技术中存在不能在线升级嵌入式数据库的问题。 The present invention provides an embedded database online update control method and apparatus for solving the problem can not be upgraded online database embedded in the prior art.

为了解决上述技术问题,本发明提供了一种嵌入式数据库的在线升级控制方法,包括以下步骤: To solve the above technical problem, the present invention provides a method of controlling an embedded online update database, comprising the steps of:

申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库;将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址。 Requesting a new memory area, and generates the embedded database upgrade in the new memory area; the address of the base address of the embedded database kernel memory area currently recorded is switched to the address of the new memory area.

进一步地,上述方法还可具有以下特点:将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址之后,释放升级前的嵌入式数据库的内存区域。 Furthermore, the above method may have the following feature: the address of the kernel base address embedded database records the current memory area after switching to the new address of the memory area, the memory area release embedded database before the upgrade.

进一步地,上述方法还可具有以下特点:申请新的内存区域之前,先通过热补丁方式将所述嵌入式数据库的升级信息提供给上层应用系统。 Furthermore, the above method may have the following feature: before requesting a new memory area, first by way of the heat patch embedded database upgrade information is provided to the upper layer applications.

进一步地,上述方法还可具有以下特点:通过热补丁方式将所述嵌入式数据库的升级信息提供给上层应用系统时,还通过热补丁方式将所述嵌入式数据库支撑的新版本数据处理方式提供给上层应用系统;将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址之后,上层应用系统开始使用所述新版本数据处理方式。 Furthermore, the above method may have the following feature: by way of the hot patch embedded database upgrade information is provided to the upper application system, further by way of the new hotfix version data processing mode to provide support embedded database to an upper layer application; after the embedded database kernel address base address of the current record of the memory area is switched to the new address of the memory area, the upper application system begins using a new version of the data processing.

进一步地,上述方法还可具有以下特点:将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址时,中止当前所述嵌入式数据库的所有操作访问。 Furthermore, the above method may have the following feature: when the address of the switching core embedded database record base address of the current address of the memory area for the new memory area, suspend all current operational access the embedded database .

进一步地,上述方法还可具有以下特点:预先为所述嵌入式数据库定义内核基址,记录所述嵌入式数据库当前内存区域的地址,使对所述嵌入式数据库的操作访问指向所述嵌入式数据库的当前内存区域。 Furthermore, the above method may have the following feature: the embedded database is pre-defined kernel base address, the embedded database of the current recording address of the memory area, the operator of the access point to the embedded database embedded current memory area of ​​the database.

进一步地,上述方法还可具有以下特点:所述在所述新的内存区域中生成升级后的嵌入式数据库包括:初始化所述新的内存区域,将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 Furthermore, the above method may have the following feature: the generating upgraded embedded database included in the new memory area: initializing the new memory area, the pre-upgrade data embedded database to synchronize after the upgrade the embedded database.

进一步地,上述方法还可具有以下特点:所述方法中,如果在所述申请新的内存区域或者所述在所述新的内存区域中生成升级后的嵌入式数据库的处理流程中发生异常,则终止后续处理,并释放所述新的内存区域。 Furthermore, the above method may have the following feature: the method, the abnormal flow of processing in the embedded database if the new application or the memory area to generate the new upgrade after the memory area, subsequent processing is terminated, and releasing the new memory area.

进一步地,上述方法还可具有以下特点:在所述嵌入式数据库内存区域的起始位置设置系统管理段,记录所述嵌入式数据库中各数据库表格的内存区域的地址相对于所述嵌入式数据库的内存区域的地址的偏移量信息,使对于所述数据库表格的操作访问根据所述内核基址记录的所述嵌入式数据库当前内存区域的地址和所述偏移量信息指向所述数据库表格。 Furthermore, the above method may have the following feature: In the starting position for the system management memory segment of the area of ​​the embedded database, the embedded database recording the address of each memory area in the embedded database of the database table with respect to offset information address memory area, so that access to the database tables to the operating point of the database table according to the address of the kernel base address embedded database records the current memory area and said offset information .

进一步地,上述方法还可具有以下特点:所述申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库包括:根据所述升级后的嵌入式数据库的结构申请新的内存区域,初始化所述偏移量信息和所述所述数据库表格,并将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 Furthermore, the above method may have the following feature: the new application area of ​​memory, and generates upgraded embedded database included in the new memory area: The structure of the new application after the embedded database upgrade memory area, and initializing the offset information of the database tables, and the pre-upgrade data in the embedded database synchronized to an embedded database after the upgrade.

进一步地,上述方法还可具有以下特点:申请新的内存区域之前,先通过热补丁方式将所述嵌入式数据库的结构、系统管理段初始值以及数据库表格初始值提供给上层应用系统。 Furthermore, the above method may have the following feature: before requesting a new memory area, first by way of the heat patch configuration, system management section of the initial value and the initial value of database tables embedded database is provided to the upper layer applications.

本发明还提供了一种嵌入式数据库的在线升级控制装置,包括处理模块和切换模块,其中:所述处理模块,申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库;所述切换模块,在所述处理模块生成升级后的嵌入式数据库之后,将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址。 The present invention further provides a control device of an embedded online update database, includes a processing module and a switching module, wherein: the processing module, requesting a new memory area, and generates a new memory area of ​​the embedded upgraded database; the switching module, after the processing module generates upgrade the embedded database, the address of the base address of the embedded database kernel memory area currently recorded is switched to the address of the new memory area.

进一步地,上述装置还可具有以下特点:所述装置还包括第一释放控制模块,用于在所述切换模块完成切换之后,释放升级前的嵌入式数据库的内存区域。 Further, the device may also have the following feature: said release means further comprises a first control module for the switching module after the handover is completed, release the memory area of ​​the embedded database before the upgrade.

进一步地,上述装置还可具有以下特点:所述装置还包括与所述处理模块连接的第一存储单元,用于保存所述嵌入式数据库的升级信息。 Further, the device may also have the following feature: said processing means further comprising a first memory cell block connected to the upgrade information stored in the embedded database.

进一步地,上述装置还可具有以下特点:所述装置还包括与所述切换模块连接的第二存储单元,用于保存为所述嵌入式数据库定义的内核基址。 Further, the device may also have the following feature: said apparatus further comprises a second storage unit with the switching module is connected, the embedded database for storing said base address defined in the kernel.

进一步地,上述装置还可具有以下特点:所述处理模块包括:升级处理单元,申请新的内存区域,并初始化所述新的内存区域;同步单元,在所述升级处理单元初始化所述新的内存区域后,将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 Further, the device may also have the following feature: the processing module comprises: a processing unit to upgrade request a new memory area, and initializing the new memory area; synchronization unit, the upgrading processing unit initializing the new after the memory area, the pre-upgrade data embedded database synchronized to an embedded database after the upgrade.

进一步地,上述装置还可具有以下特点:所述装置还包括第二释放控制模块,其中:如果所述升级处理单元或者同步单元在其处理流程中发生异常,则终止后续处理,并通知所述第二释放控制模块;所述第二释放控制模块根据所述通知释放所述新的内存区域。 Further, the device may also have the following feature: said second means further comprises a release control module, wherein: if the update processing unit or a synchronizing unit that abnormality occurs in the process flow, subsequent processing is terminated, and notifies the the second release control module; the second release control module of the new memory area is released according to the notification.

本发明有益效果如下:采用本发明技术方案,申请新的内存区域,并在该新的内存区域中生成升级后的嵌入式数据库;将内核基址记录的该嵌入式数据库当前内存区域的地址切换为该新的内存区域的地址。 Advantageous effects of the present invention are as follows: The technical solution of the present invention, apply for a new memory area, and generates the embedded database upgrade in the new memory area; the address of the kernel base address embedded database records switching current memory region the new address for the memory area. 由于在本发明技术方案中,申请新的内存区域,在该新的内存区域中生成升级后的嵌入式数据库以及将内核基址记录的该嵌入式数据库当前内存区域的地址切换为该新的内存区域的地址都可以在系统运行过程中完成,因此在本发明中,嵌入式数据库可以实现在线升级,不需要中断系统的运行,解决了系统运行过程中无法更改嵌入式数据库结构的弊端。 Since the technical solution of the present invention, apply for a new memory area, generating the upgraded embedded database embedded database kernel and the base address of the current record in the memory area of ​​a new memory area for the new memory address switch address area can be done while the system is running, and therefore in the present invention, an embedded database upgrade can be achieved online, without interrupting the operation of the system, to solve the system is running an embedded database can not change the structure of the state. 而通过将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中,进一步保证了服务的持续性。 The embedded database by the data before the upgrade is synchronized to an embedded database after the upgrade, to further ensure the continuity of services.

附图说明 BRIEF DESCRIPTION

图1为本发明实施例中嵌入式数据库的示意图;图2为本发明实施例中嵌入式数据库中系统管理段的示意图;图3为本发明实施例中嵌入式数据库的在线升级控制流程图;图4为本发明实施例中嵌入式数据库的在线升级控制装置框图。 FIG 1 is a schematic embodiment of the present invention, the embedded database embodiment; FIG. 2 is a schematic diagram of the embedded database management system in the embodiment of the present invention, segments; FIG. 3 embedded database online upgrade embodiment of the present invention is a control flowchart of the embodiment; FIG 4 a block diagram of a control apparatus in the embodiment the embedded database online upgrade embodiment of the invention.

具体实施方式 detailed description

本发明的核心思想是,申请新的内存区域,并在该新的内存区域中生成升级后的嵌入式数据库;将内核基址记录的该嵌入式数据库当前内存区域的地址切换为该新的内存区域的地址。 The core idea of ​​the present invention is to apply for a new memory area, and generates the embedded database upgrade in the new memory area; the address of the embedded database kernel memory base address of the current record for the new area of ​​memory switch address area.

下面结合附图和实施例对本发明作进一步地说明。 The present invention is further explained below in conjunction with the accompanying drawings and embodiments.

嵌入式数据库本身不是完整的数据库系统,它需要与具体地上层应用系统绑定来实现对于嵌入式数据库的各种操作访问。 Embedded database itself is not a complete database system, it needs to specifically bind the upper application system to achieve a variety of operational access to the embedded database. 嵌入式数据库的典型实现是申请一块内存区域并对该内存区域进行管理。 Typical applications for embedded database is a memory area and the memory management area. 在本实施例中,对嵌入式数据库的具体管理方式是定义一个上层应用系统的全局变量:内核基址,用于记录该块内存的起始地址,使对该嵌入式数据库的操作访问指向该块内存,其他对数据库内存区域的操作访问均在此基址上进行地址偏移实现。 In the present embodiment, particularly of the embedded database management is to define an upper application system global variables: core base address, the start address of the block of memory for recording the operation of the access points to the embedded database memory block, other operations of the memory area access to the database for address offset are implemented on this base address. 该地址偏移由在嵌入式数据库起始位置设置的系统管理段记录的各数据库表格所在内存区域的起始地址相对于该嵌入式数据库所在内存区域的起始地址的偏移量信息实现。 The address offset from the starting address of each database table located in the memory region management section embedded database system starting position for recording the offset information with respect to the starting address of the memory area where the embedded database implemented. 即对于该嵌入式数据库的操作访问会根据内核基址指向该嵌入式数据库所在内存区域的起始地址,而对于该嵌入式数据库中数据库表格的操作访问,会根据内核基址记录的该嵌入式数据库所在内存区域的起始地址和系统管理段记录的该数据库表格的偏移量信息指向数据库表格所在内存区域的起始地址。 I.e., the operation for accessing the embedded database will point to the starting address of the memory area where the embedded database based core base address, and for the embedded database of the database table access operation, based on the embedded core base address recorded offset information table start address of the database management system and database records where the segments of the memory area where the table points to the start address of the memory area of ​​the database.

本实施例中的嵌入式数据库如图1所示,包括系统管理段以及若干数据库表格,其中,系统管理段被设置在嵌入式数据库内存区域的起始位置,其中按固定格式记录了各数据库表格所在内存区域的起始地址相对于该嵌入式数据库所在内存区域的起始地址的偏移量信息,如图1所示,当与该嵌入式数据库绑定的上层应用系统需要操作访问表1中的数据时,根据该嵌入式数据库所在内存区域的起始地址和表1的起始地址偏移量x就能够得到表1所在内存区域的起始地址,对表1进行操作访问。 In the present embodiment embedded database embodiment 1, the management system comprising a plurality of segments, and database tables, wherein the system management section is arranged at the start position of the embedded database memory area, wherein the fixed format of each database table record start address memory area where an offset from the start address memory area where an embedded database, shown in Figure 1, when bound to the embedded database access upper-layer applications need to operate in table 1 when the data shift amount x depending on the starting address of the embedded database resides and the start address of the memory area shown in table 1 can be obtained where the starting address of a memory area, an operating table access. 同理,当与该嵌入式数据库绑定的上层应用系统需要操作访问表2中的数据时,根据该嵌入式数据库所在内存区域的起始地址和表2的起始地址偏移量y就能够得到表2所在内存区域的起始地址,对表2进行操作访问。 Similarly, when bound with the upper layer embedded database applications need to manipulate data in the access table 2, according to the start address of the database where the embedded memory region and the start address offset of Table 2 can be y table 2 where the starting address of the memory area access table 2 is operated.

在本实施例中,系统管理段如图2所示,按照固定的格式记录了嵌入式数据库中数据库表格的信息,系统管理段分别用4字节区域保存表格数量,各个表格的起始地址偏移量、记录数目和记录长度等。 In the present embodiment, the system management section shown in Figure 2, in a fixed format of information recorded in the embedded database of the database table, respectively, the system management section area storage table number 4 bytes, the start address of each table bias shift amount, the number of records and record length. 在本实施例中,系统管理段中所记录的信息的初始值被封装在一个函数DbInitFunc中,根据输入的该嵌入式数据库的起始地址进行内存定位,并对系统管理段里的各个信息进行集体赋值,即函数DbInitFunc依次对系统管理段的'表格数目n'以及各个表格的信息:'表1起始地址偏移量'、'表1记录数目'、'表1记录长度'直到'表n起始地址偏移量'、'表n记录数目'、'表n记录长度'进行赋值。 In the present embodiment, the initial value of the information recorded in the system management segments are encapsulated in a function DbInitFunc, the positioning performed according to the memory address of the start input embedded database, and the system management information sections in the respective group assignment, i.e. sequentially function DbInitFunc 'table number n' of each information table and segment management system: "table 1 starting at offset ',' table record number 1 ',' table 1 record length 'up' table starting at offset n ',' table record number n ',' table record length n 'assignment. 一般情况下该函数仅在系统初始化允许被调用一次。 Generally only allows the function is called once at system initialization.

在上层应用系统对本实施例中的嵌入式数据库进行操作访问时,根据内核基址找到该嵌入式数据库所在内存区域的起始地址,并根据系统管理段中记录的数据库表格的起始地址偏移量信息得到所要操作访问的数据库表格所在内存区域的起始地址,对该数据库表格进行操作访问。 When the upper application system is operating according to the present embodiment, access to the embedded database, to find the starting address of the memory area where the embedded database kernel according to base address and the offset according to the start address of the database table in the system management section records the amount of information to get the starting address database table where the memory area to be accessed by the operation, the operation access to the database tables.

在本实施例的嵌入式数据库中,可以只包括一个数据库表格,在这种情况下,不需要系统管理段记录数据库表格的起始地址偏移量信息,而直接通过内核基址对嵌入式数据库进行操作访问。 In the present embodiment, the embedded database, the database table may include only one, in this case, the system does not require database table records management section start address offset information, and the base address of the kernel directly embedded database operated access.

本实施例中嵌入式数据库的在线升级控制方法如图3所示,包括以下步骤:步骤S101,通过热补丁的方式将上层应用系统新版本的数据处理方式以及支撑该新版本数据处理方式的嵌入式数据库的升级信息提供给上层应用系统;采用热补丁的方式,可以在系统运行过程中,将上层应用系统新版本的数据处理方式以及支撑该新版本数据处理方式的嵌入式数据库的升级信息提供给上层应用系统。 Online upgrade control method embodiment according to the present embodiment embedded database shown in Figure 3, comprising the following steps: step S101, the patch by thermal way a new version of an upper layer application supporting the data processing and handling of the new version of the data embedded upgrade information database is provided to an upper layer application; hot patch manner, during system operation, the new version of the data processing system, the upper layer application supporting upgrade information and the new version of the embedded database data processing provided to the upper application system. 并且,使得上层应用系统能够区分旧版本的数据处理方式和新版本的数据处理方式,可以采用旧版本的数据处理方式或者新版本的数据处理方式处理数据。 And, that the upper layer application data processing system to distinguish between the new version and the old version of data processing, data processing of the old version or a new version of the data processing may be employed to process data. 同样,上层应用系统也能够获知升级前的嵌入式数据库的信息和升级后的嵌入式数据库的信息。 Similarly, the upper application system can also obtain information embedded database information and upgrade the embedded database before the upgrade.

在本实施例中,通过重新编译并通过热补丁的方式替换函数DbInitFunc,在替换后的函数DbInitFunc中体现上层应用系统新版本的数据处理方式以及支撑该新版本数据处理方式的嵌入式数据库的升级信息,从而将上层应用系统新版本的数据处理方式以及支撑该新版本数据处理方式的嵌入式数据库的升级信息提供给上层应用系统。 In the present embodiment, upgrade, and replace function DbInitFunc by heat patch recompile manner, reflect the new version of the upper-layer application data processing mode after replacement DbInitFunc a function in the support and the new version of the data processing mode of the embedded database information to the new version of the upper layer application data processing system and support the new version of the data processing embedded database upgrade information is provided to the upper application system. 嵌入式数据库的升级信息包括上层应用系统期望的升级后的嵌入式数据库的数据库结构、系统管理段初始值以及各个数据库表格初始值等。 Upgrade information embedded database system includes an upper layer application database structure desired upgraded embedded database, the system management section and each of the database tables initial value initial value. 该升级后嵌入式数据库的结构应该包括系统管理段和数据库表格,其中系统管理段被设置在该升级后嵌入式数据库的起始位置。 After the upgrade configuration embedded database management system should include database tables and sections, wherein the system management section is provided at the start position in the embedded database of the upgrade.

步骤S102,根据该嵌入式数据库的升级信息中升级后嵌入式数据库的结构申请一块新的内存区域;步骤S103,根据该嵌入式数据库的升级信息初始化该新的内存区域中升级后嵌入式数据库的结构决定的系统管理段,将各个数据库表格的起始地址偏移量信息写入系统管理段;步骤S104,根据该升级信息中预定义的配置,初始化该新的内存区域中升级后嵌入式数据库的结构决定的各个数据库表格;在本实施例中,根据该新的内存区域的起始地址和各个数据库表格的起始地址偏移量信息找到各个数据库表格。 Step S102, after the upgrade information in accordance with the structure embedded database upgrade request a new memory area of ​​the embedded database; step S103, the upgrade information in accordance with the initialization of the embedded database after the new memory area of ​​the embedded database upgrade configuration management system determines segment start address offset of each database table information into the system management section; step S104, the memory area after the new upgrade the embedded database upgrade information based on the predefined configuration, initialization, the structure of each database table determined; in the present embodiment, offset information according to the start address of the new memory area and the start address of each of the database table to find the respective database tables.

步骤S105,将升级前的嵌入式数据库中的数据同步到升级后的嵌入式数据库中,以保证服务的连续性;由于在本实施例中是通过热补丁的方式替换函数DbInitFunc,上层应用系统能够获知升级前的嵌入式数据库的信息和升级后的嵌入式数据库的信息,因此,在本步骤中,对比该升级前的嵌入式数据库的信息和升级后的嵌入式数据库的信息,可以获知升级后的嵌入式数据库相对于升级前的嵌入式数据库在结构上的变化。 Step S105, the pre-upgrade data embedded database synchronized to an embedded database upgraded in order to ensure continuity of service; Since the present embodiment is replaced by a function of the heat patch DbInitFunc embodiment, the upper application system can after the embedded database information and the information embedded database upgrade before upgrading known, therefore, in this step, the information embedded database information and the embedded database upgrade before upgrading the comparison, the upgrade may be learned embedded database with respect to the change in embedded database before the upgrade in structure.

在具体实现中,升级前的嵌入式数据库和升级后的嵌入式数据库之间的数据库结构往往仅是部分不同,对数据库结构未作变动的部分,将升级前的嵌入式数据库中的数据搬迁到升级后的嵌入式数据库的相应位置;对数据库结构变动的部分,则将升级前的嵌入式数据库中的数据适配到升级后的嵌入式数据库中。 In a specific implementation, the database structure between the embedded database upgrade before upgrading the embedded database is often only partially different from the structure of the database portions were not changed, the data will be relocated in the embedded database of the pre-upgrade respective positions embedded database upgraded; structural changes on the part of the database, the data before the embedded database are upgraded in the embedded database is adapted to the upgraded. 但在具体实现中也存在两者数据库结构完全不同的情况,在这种情况下,将升级前的嵌入式数据库中的数据适配到升级后的嵌入式数据库中。 But there are two completely different structure of the database where the particular implementation, in which case, the adaptive data in the embedded database before the upgrade to the upgraded embedded database.

在本发明的一个实例中,升级前的嵌入式数据库中存在一个管理VIP用户信息的表格,记录VIP用户的人名、身份证号。 In one embodiment of the invention, the embedded database exists in a pre-upgrade VIP user information management table, recorded VIP user name, ID number. 在升级后的嵌入式数据库中,该管理VIP用户信息的表格需要增加一项'入网时间',用于记录VIP用户的入网时间,则该表格的结构发生了变动。 In the upgraded embedded database, the management of user information VIP table need to add a 'net time' for Network VIP user record time, the structure of the table has been varied. 对于新增加的'入网时间'信息,可以保持其初始值,待后续再加以调整;而对于升级前的嵌入式数据库中已有的用户信息,即VIP用户的人名、身份证号则需要搬迁到升级后的嵌入式数据库中。 For the newly added 'network time' information can maintain its initial value, to be coupled with the subsequent adjustment; for embedded database before upgrade existing user information, i.e., VIP user name, ID number is required to relocate embedded database after the upgrade.

步骤S106,将内核基址记录的该嵌入式数据库当前内存区域的地址切换为该新的内存区域的起始地址,使对于该嵌入式数据库的操作访问指向该新的内存区域的起始地址;切换内核基址时,要中止当前该嵌入式数据库的所有操作访问。 The embedded database address step S106, the current recording address of the kernel base handover for the new memory area of ​​the memory area starting address, the starting address for the operator to access the embedded database of links to the new memory area; when switching the kernel base address, to suspend all access to the current embedded database. 在本实施例中,上述切换内核基址是通过一个函数来实现。 In the present embodiment, the base address of the switching kernel is implemented by a function. 在要进行内核基址切换时,调用该函数,一旦进入该函数,系统调度上锁不允许任务切换,中止当前该嵌入式数据库的所有操作访问,然后将新的嵌入式数据库所在内存区域的起始地址赋值给该内核基址,系统调度解锁,从而完成内核基址的切换。 When the kernel base address to be switched, the function is called once entered the function, the system does not allow scheduling locked task switching, suspend all current operations accessing the embedded database, and then from the new embedded database where the memory area start address assigned to the base address of the kernel, the system operator to unlock, thereby completing the switching core base address.

步骤S107,切换内核基址成功后,上层应用系统使用新版本的数据处理方式,并释放升级前的嵌入式数据库的内存区域。 Step S107, after switching the kernel base address successfully, the upper application system using the new version of the data processing, and release the memory area of ​​the embedded database before the upgrade.

在本实施例中,上层应用系统在根据替换后的函数DbInitFunc获知新版本的数据处理方式后,仍然使用旧版本的数据处理方式处理数据,直到切换内核基址成功后,为上层应用系统提供数据的嵌入式数据库变成了升级后的嵌入式数据库,相应的,上层应用系统开始使用新版本的数据处理方式。 In the present embodiment, the upper application system after acquiring the new version of data processing based on a function DbInitFunc the alternative, still using the old version of data processing processing data until the handover core base address successfully, to provide data for the upper layer application system embedded database becomes upgraded embedded database, the corresponding upper application system start using the new version of the data processing.

在本步骤的具体实现中,需要一个全局标记,标识内核基址是否已经切换完成。 In a specific implementation of this step, the need for a global tag identifying whether handover has been completed core base address. 当内核基址的切换完成之后,设置该全局标记,而上层应用系统则判断该全局标记是否被设置来决定是否使用新版本的数据处理方式。 When switching is completed core base address, set the global tag, and an upper layer application system is judged that the global flag is set to determine whether to use the new version of the data processing.

在上述实例中,上层应用系统的新版本的数据处理方式中,应该包括对于该管理VIP用户信息的表格新增了一项'入网时间'的数据处理,但在切换内核基址成功之前,上层应用系统实际读取到的数据仍然由升级前的嵌入式数据库提供,并不包括'入网时间'的记录,因此,在切换内核基址成功之前,使用旧版本的数据处理方式,在切换内核基址成功之后,使用新版本的数据处理方式。 In the above example, the new version of the upper layer application data processing system, it should include a table for managing the user information VIP a new 'network time' processing of data, but before the kernel base address successful handover, the upper layer actually read application data provided by the embedded database system is still before the upgrade does not include recording 'net time' and, therefore, before switching the kernel base address successfully using the old version of the data processing, switching core base after a successful site, with the new version of the data processing.

在上述流程中,从步骤S102至S105,在具体实施中可能出现异常,当步骤S102至S105中的任何一个环节出现异常时,终止后续处理,释放该新的内存区域。 In the above flow from step S102 to S105, abnormality may occur in the particular embodiment, when an abnormality in any step of steps S102 to S105 occurs, terminates the subsequent processing, the release of the new memory area.

如图4所示,本实施例中嵌入式数据库的在线升级控制装置包括第一存储单元10、第二存储单元20、处理模块30和切换模块40,其中:第一存储单元10,保存嵌入式数据库的升级信息;第二存储单元20,保存为嵌入式数据库定义的内核基址;处理模块30,根据第一存储单元10中保存的嵌入式数据库的升级信息为需要升级的嵌入式数据库申请新的内存区域,并在该新的内存区域中生成升级后的嵌入式数据库,再在生成升级后的嵌入式数据库之后通知切换模块40;该处理模块30包括升级处理单元31和同步单元32,其中:升级处理单元31,申请新的内存区域,并初始化该新的内存区域;同步单元32,在升级处理单元31初始化该新的内存区域后,将升级前的嵌入式数据库中的数据同步到升级后的嵌入式数据库中,再通知切换模块40。 Online update control apparatus, the embedded database of the present embodiment shown in FIG 4 comprises a first embodiment of the storage unit 10, a second storage unit 20, the processing module 30 and the switching module 40, wherein: the first storage unit 10, an embedded stored upgrade information database; a second storage unit 20, save for the embedded database kernel defined base address; processing module 30, a new request for the embedded database needs to be upgraded according to the upgrade information stored in the first storage unit 10 of the embedded database memory area, and generates the new memory area upgraded embedded database, and then notifies the switching module 40 to generate the embedded database after update; upgrade the processing module 30 comprises a processing unit 31 and synchronization unit 32, wherein : upgrading processing unit 31, requesting a new memory area, and initialize the new memory area; synchronization unit 32, 31, after the initialization of the new region memory upgrade processing unit, the pre-upgrade data in the embedded database synchronized to upgrade after the embedded database, and then notifies the switching module 40.

切换模块40,根据处理模块30的通知将第二存储单元20保存的嵌入式数据库的内核基址切换为该新的内存区域的地址。 The switching module 40. The processing module 30 notifies the base address of the core stored in the second storage unit 20 embedded database switching address for the new memory area.

本实施例中的控制装置还可以包括与切换模块40连接的第一释放控制模块50,切换模块40在完成切换之后通知第一释放控制模块50,第一释放控制模块50释放升级前的嵌入式数据库的内存区域。 The control device in the embodiment of the present embodiment may further include a first release control module 40 connected to the switching module 50, switching module 40 informs the first control module 50 is released after the completion of the handover, the first release control module 50 embedded before release upgrade memory area of ​​the database.

本实施例中的控制装置还可以包括第二释放控制模块60,如果升级处理单元31或者同步单元32在其处理流程中发生异常,则终止后续处理,并通知第二释放控制模块60;第二释放控制模块60根据该通知释放该新的内存区域。 The control device in the embodiment of the present embodiment may further include a second release control module 60, if the update processing unit 31 or an abnormality occurs in the synchronization unit 32 of its process flow, subsequent processing is terminated, and notifies the second release control module 60; a second release control module 60 releases the memory area in accordance with the new notification. 该第二释放控制模块60可以位于处理模块30之内,也可以位于处理模块30之外,只要能获知升级处理单元31或者同步单元32是否发生异常即可。 The second release control module 60 may be located within the processing module 30, may also be located outside the processing module 30, as long as the update processing unit 31 or the known synchronizing unit 32 is abnormal can occur. 如图4所示,本实施例中的第二释放控制模块60位于处理模块30之外。 4, the second release control module 60 of the present embodiment is located outside the processing module 30 embodiment.

可见,在本实施例中,嵌入式数据库在在线升级过程中采用双数据操作区的升级方式,解决了系统运行过程中无法更改嵌入式数据库结构的弊端,使得涉及到嵌入式数据库结构更改的升级可以通过在线补丁的方式进行,不需要中断系统运行,保证了服务的持续性。 Seen, in this embodiment, the embedded database using double data upgrade operation area in an online upgrade process, the solution can not be changed during system operation embedded database structure drawbacks, such upgrading involves changing the embedded database structure It can be carried out by way of a patch online, without interrupting system operation, to ensure the continuity of services.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。 Obviously, those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. 这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 Thus, if these modifications and variations of the present invention fall within the claims of the invention and the scope of equivalents thereof, the present invention intends to include these modifications and variations.

Claims (17)

  1. 1.一种嵌入式数据库的在线升级控制方法,其特征在于,包括以下步骤:申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库;将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址。 A method of controlling the online upgrade of an embedded database, characterized by comprising the steps of: applying a new memory area, and generates an embedded database upgraded in the new memory area; kernel base address recorded address of the embedded database of the current memory area is switched to the address of the new memory area.
  2. 2.如权利要求1所述的方法,其特征在于,将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址之后,释放升级前的嵌入式数据库的内存区域。 After 2. The method according to claim 1, wherein said address switching core embedded database record base address of the current address of the memory area for the new memory area, before releasing the embedded database upgrade memory area.
  3. 3.如权利要求1所述的方法,其特征在于,申请新的内存区域之前,先通过热补丁方式将所述嵌入式数据库的升级信息提供给上层应用系统。 The method according to claim 1, characterized in that, before the new memory area of ​​application and by way of the heat patch embedded database upgrade information is provided to the upper layer applications.
  4. 4.如权利要求3所述的方法,其特征在于,通过热补丁方式将所述嵌入式数据库的升级信息提供给上层应用系统时,还通过热补丁方式将所述嵌入式数据库支撑的新版本数据处理方式提供给上层应用系统;将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址之后,上层应用系统开始使用所述新版本数据处理方式。 4. The method according to claim 3, characterized in that, by way of the heat patch embedded database upgrade information is provided to the upper application system, further by way of the new hotfix embedded database version supported data processing system is provided to an upper layer application; after the address of the kernel base address embedded database recording the current memory address region to switch to a new memory area of ​​the upper layer application system started with the new version of data processing.
  5. 5.如权利要求1所述的方法,其特征在于,将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址时,中止当前所述嵌入式数据库的所有操作访问。 5. The method according to claim 1, wherein said address switching core embedded database record base address of the current address of the memory area for the new memory area, the embedded database abort the current All access operations.
  6. 6.如权利要求1所述的方法,其特征在于,预先为所述嵌入式数据库定义内核基址,记录所述嵌入式数据库当前内存区域的地址,使对所述嵌入式数据库的操作访问指向所述嵌入式数据库的当前内存区域。 6. The method according to claim 1, wherein the embedded database is defined in advance for the core base address, the embedded database of the current recording address of the memory area, the operator access to the embedded database point the current memory area embedded database.
  7. 7.如权利要求1所述的方法,其特征在于,所述在所述新的内存区域中生成升级后的嵌入式数据库包括:初始化所述新的内存区域,将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 7. The method according to claim 1, wherein the generating the upgraded embedded database included in the new memory area: initializing the new memory area, the embedded database before upgrade data synchronization to the embedded database of the upgrade.
  8. 8.如权利要求1或7所述的方法,其特征在于,所述方法中,如果在所述申请新的内存区域或者所述在所述新的内存区域中生成升级后的嵌入式数据库的处理流程中发生异常,则终止后续处理,并释放所述新的内存区域。 8. The method according to claim 17, wherein the method, if the application in new generation memory area of ​​the embedded database or upgraded in the new memory area an abnormality occurs in the process flow, subsequent processing is terminated, and releasing the new memory area.
  9. 9.如权利要求1所述的方法,其特征在于,在所述嵌入式数据库内存区域的起始位置设置系统管理段,记录所述嵌入式数据库中各数据库表格的内存区域的地址相对于所述嵌入式数据库的内存区域的地址的偏移量信息,使对于所述数据库表格的操作访问根据所述内核基址记录的所述嵌入式数据库当前内存区域的地址和所述偏移量信息指向所述数据库表格。 9. The method according to claim 1, wherein, in the starting position for the embedded database system management memory segment area, the recording address of each memory area in the embedded database of the database table with respect to offset information address area of ​​said memory embedded database, the operator with access to the database table according to the address pointing information and the offset amount of the core of the embedded database record base address of the current memory area the database table.
  10. 10.如权利要求9所述的方法,其特征在于,所述申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库包括:根据所述升级后的嵌入式数据库的结构申请新的内存区域,初始化所述偏移量信息和所述所述数据库表格,并将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 10. The method according to claim 9, wherein said application of new memory area, and generates upgraded embedded database included in the new memory area: the embedded database after the upgrade in accordance with apply for a new structure of the memory area, and initializing the offset information of the database tables, and the pre-upgrade data in the embedded database synchronized to an embedded database after the upgrade.
  11. 11.如权利要求9或10所述的方法,其特征在于,申请新的内存区域之前,先通过热补丁方式将所述嵌入式数据库的结构、系统管理段初始值以及数据库表格初始值提供给上层应用系统。 11. The method of claim 9 or claim 10, characterized in that, before the new memory area of ​​application and by way of the heat patch embedded database configuration, system management section of the initial value and the initial value to the database tables the upper application system.
  12. 12.一种嵌入式数据库的在线升级控制装置,其特征在于,包括处理模块和切换模块,其中:所述处理模块,申请新的内存区域,并在所述新的内存区域中生成升级后的嵌入式数据库;所述切换模块,在所述处理模块生成升级后的嵌入式数据库之后,将内核基址记录的所述嵌入式数据库当前内存区域的地址切换为所述新的内存区域的地址。 A database embedded online update control apparatus, characterized in that it comprises a processing module and a switching module, wherein: the processing module, requesting a new memory area, and generates the upgraded in the new memory area embedded database; the switching module, after the processing module generates upgrade the embedded database, the address of the base address of the embedded database kernel memory area currently recorded is switched to the address of the new memory area.
  13. 13.如权利要求12所述的装置,其特征在于,所述装置还包括第一释放控制模块,用于在所述切换模块完成切换之后,释放升级前的嵌入式数据库的内存区域。 13. The apparatus of claim 12, wherein said release means further comprises a first control module for the switching module after the handover is completed, release the memory area of ​​the embedded database before the upgrade.
  14. 14.如权利要求12所述的装置,其特征在于,所述装置还包括与所述处理模块连接的第一存储单元,用于保存所述嵌入式数据库的升级信息。 14. The apparatus of claim 12, wherein said apparatus further comprises a first storage unit connected to the processing module, configured to save the upgrade information embedded database.
  15. 15.如权利要求12所述的装置,其特征在于,所述装置还包括与所述切换模块连接的第二存储单元,用于保存为所述嵌入式数据库定义的内核基址。 15. The apparatus of claim 12, wherein said apparatus further comprises a second storage unit connected to the switching module, configured to store a base address to the embedded kernel database definition.
  16. 16.如权利要求12所述的装置,其特征在于,所述处理模块包括:升级处理单元,申请新的内存区域,并初始化所述新的内存区域;同步单元,在所述升级处理单元初始化所述新的内存区域后,将升级前的嵌入式数据库中的数据同步到所述升级后的嵌入式数据库中。 16. The apparatus of claim 12, wherein the processing module comprises: a processing unit to upgrade request a new memory area, and initializing the new memory area; synchronization unit, the processing unit initializes the upgrade after the new memory area, the pre-upgrade data embedded database synchronized to an embedded database after the upgrade.
  17. 17.如权利要求16所述的装置,其特征在于,所述装置还包括第二释放控制模块,其中:如果所述升级处理单元或者同步单元在其处理流程中发生异常,则终止后续处理,并通知所述第二释放控制模块;所述第二释放控制模块根据所述通知释放所述新的内存区域。 17. The apparatus according to claim 16, wherein said release means further comprises a second control module, wherein: if the update processing unit or a synchronizing unit that abnormality occurs in the process flow, subsequent processing is terminated, and notify the second release control module; the second release control module of the new memory area is released according to the notification.
CN 200610103833 2006-08-02 2006-08-02 Online updating control method and device of embedded database CN100487701C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610103833 CN100487701C (en) 2006-08-02 2006-08-02 Online updating control method and device of embedded database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610103833 CN100487701C (en) 2006-08-02 2006-08-02 Online updating control method and device of embedded database

Publications (2)

Publication Number Publication Date
CN1908934A true true CN1908934A (en) 2007-02-07
CN100487701C CN100487701C (en) 2009-05-13

Family

ID=37700045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610103833 CN100487701C (en) 2006-08-02 2006-08-02 Online updating control method and device of embedded database

Country Status (1)

Country Link
CN (1) CN100487701C (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541987A (en) * 2010-10-20 2012-07-04 微软公司 Online database availability during upgrade
CN102779191A (en) * 2012-07-03 2012-11-14 互动在线(北京)科技有限公司 Achievement system and achievement method for my structured query language (My SQL) database smooth upgrading
CN102103613B (en) 2009-12-22 2013-06-12 中兴通讯股份有限公司 Distributed database upgrade method, upgrade processing device and upgrade control device
CN103530420A (en) * 2013-10-30 2014-01-22 北京奇虎科技有限公司 Data file dynamic update method and device
US9015177B2 (en) 2010-10-20 2015-04-21 Microsoft Technology Licensing, Llc Dynamically splitting multi-tenant databases
CN104572185A (en) * 2014-12-25 2015-04-29 武汉烽火富华电气有限责任公司 Embedded system, and upgrading method and upgrading equipment thereof
US9075661B2 (en) 2010-10-20 2015-07-07 Microsoft Technology Licensing, Llc Placing objects on hosts using hard and soft constraints
US9721030B2 (en) 2010-12-09 2017-08-01 Microsoft Technology Licensing, Llc Codeless sharing of spreadsheet objects

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1315043C (en) 2004-06-24 2007-05-09 华为技术有限公司 Compatibility upgrading method of embedded program
CN100388678C (en) 2004-11-29 2008-05-14 中兴通讯股份有限公司 Automatic obtaining method for telecommunication trausmission systen unit soft and hard ware version

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103613B (en) 2009-12-22 2013-06-12 中兴通讯股份有限公司 Distributed database upgrade method, upgrade processing device and upgrade control device
CN102541987A (en) * 2010-10-20 2012-07-04 微软公司 Online database availability during upgrade
US9075661B2 (en) 2010-10-20 2015-07-07 Microsoft Technology Licensing, Llc Placing objects on hosts using hard and soft constraints
US9015177B2 (en) 2010-10-20 2015-04-21 Microsoft Technology Licensing, Llc Dynamically splitting multi-tenant databases
US9043370B2 (en) 2010-10-20 2015-05-26 Microsoft Technology Licensing, Llc Online database availability during upgrade
US9721030B2 (en) 2010-12-09 2017-08-01 Microsoft Technology Licensing, Llc Codeless sharing of spreadsheet objects
CN102779191A (en) * 2012-07-03 2012-11-14 互动在线(北京)科技有限公司 Achievement system and achievement method for my structured query language (My SQL) database smooth upgrading
CN102779191B (en) * 2012-07-03 2015-09-02 互动在线(北京)科技有限公司 One kind MySQL database system and to achieve smooth upgrade implementation method
CN103530420A (en) * 2013-10-30 2014-01-22 北京奇虎科技有限公司 Data file dynamic update method and device
CN103530420B (en) * 2013-10-30 2017-07-04 北京奇虎科技有限公司 Method and apparatus for dynamically updating data file
CN104572185A (en) * 2014-12-25 2015-04-29 武汉烽火富华电气有限责任公司 Embedded system, and upgrading method and upgrading equipment thereof
CN104572185B (en) * 2014-12-25 2018-03-27 武汉烽火富华电气有限责任公司 Embedded system upgrade and upgrade equipment

Also Published As

Publication number Publication date Type
CN100487701C (en) 2009-05-13 grant

Similar Documents

Publication Publication Date Title
US20040168165A1 (en) Update system employing reference software to reduce number of update packages
US20040093597A1 (en) Firmware update system for facilitating firmware update in mobile handset related applications
US5649112A (en) Method and apparatus for modifying microcode in a distributed nodal network while the network continues operation
US6070012A (en) Method and apparatus for upgrading software subsystems without interrupting service
US6009500A (en) Replacement of erroneous firmware in a redundant non-volatile memory system
US20030070162A1 (en) Information processor having multi OS and its OS update method
US7085822B1 (en) Managing pervasive devices
US6397385B1 (en) Method and apparatus for in service software upgrade for expandable telecommunications system
US20040098427A1 (en) Device memory management during electronic file updating
US6401201B2 (en) Arrangements offering firmware support for different input/output (I/O) types
US20060015697A1 (en) Computer system and method for migrating from one storage system to another
US20030167375A1 (en) Storage system and method of configuring the storage system
US20080196019A1 (en) Method and Apparatus for Generating an Update Package
CN101004681A (en) Method for implementing long jumping dynamic patch in embedded system
CN101140536A (en) Snapshot system supporting cascades snapshot and snapshot processing method thereof
JP2003323352A (en) Memory device
CN101593157A (en) Bad block management (BBM) method and device for Nand Flash
CN1584822A (en) Method for upgrated computer fixing ware programm
US6912632B2 (en) Storage system, storage system control method, and storage medium having program recorded thereon
US7284109B1 (en) Partition creation
US20110246978A1 (en) Application portability and transfer of device management for mobile devices
CN1859191A (en) Method for realizing software edition upgrading
CN1936844A (en) Method and system for updating software
CN1932778A (en) Method for conducting virtual space management to NAND FLASH memory
CN101222367A (en) Method and network guard system used for cluster network element updating version file

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted