[go: up one dir, main page]

CN100461704C - Data Synchronization Method - Google Patents

Data Synchronization Method Download PDF

Info

Publication number
CN100461704C
CN100461704C CNB2006101572408A CN200610157240A CN100461704C CN 100461704 C CN100461704 C CN 100461704C CN B2006101572408 A CNB2006101572408 A CN B2006101572408A CN 200610157240 A CN200610157240 A CN 200610157240A CN 100461704 C CN100461704 C CN 100461704C
Authority
CN
China
Prior art keywords
data block
data
conversion function
software
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2006101572408A
Other languages
Chinese (zh)
Other versions
CN1976301A (en
Inventor
程林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006101572408A priority Critical patent/CN100461704C/en
Publication of CN1976301A publication Critical patent/CN1976301A/en
Application granted granted Critical
Publication of CN100461704C publication Critical patent/CN100461704C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种数据同步的方法,用于不中断升级过程中动态数据的同步,主要包括如下步骤:A、在新版本软件中设置与旧版本软件中相同的动态数据块编号;B、建立新版本软件与旧版本软件同步数据块内容转换的函数,并将动态数据从未升级设备同步到已升级设备时调用该转换函数,完成动态数据的同步。通过本发明所提供的方法,解决了新旧版本软件中数据块标识一致性的问题,并保证了新版本软件能够识别同步过来的数据块的内容,实现动态数据在不同的软件版本间的同步问题,从而实现了升级过程不中断业务的功能,满足了运营商的迫切需求。升级不中断业务功能的应用将会极大提高运营商的服务质量和运营可靠性。

Figure 200610157240

The invention discloses a method for synchronizing data, which is used for synchronizing dynamic data in an upgrade process without interruption, mainly comprising the following steps: A. setting the same dynamic data block number in the new version software as that in the old version software; B. Establish a new version software and old version software synchronization data block content conversion function, and call the conversion function when the dynamic data is synchronized from the non-upgraded device to the upgraded device to complete the synchronization of the dynamic data. Through the method provided by the present invention, the problem of the consistency of data block identification in the new and old versions of software is solved, and the new version of the software is guaranteed to be able to identify the content of the synchronized data blocks, so as to realize the synchronization of dynamic data between different software versions , thereby realizing the function of not interrupting the service during the upgrade process, and meeting the urgent needs of the operators. Upgrading applications that do not interrupt service functions will greatly improve operators' service quality and operational reliability.

Figure 200610157240

Description

数据同步的方法 Data Synchronization Method

技术领域 technical field

本发明涉及通信领域,特别涉及不中断升级过程中数据同步的方法。The invention relates to the communication field, in particular to a method for data synchronization in an uninterrupted upgrading process.

背景技术 Background technique

目前在通信领域中软件的升级普遍存在,升级过程中容易造成业务中断,在电信业务可靠性要求越来越高的今天,升级不中断业务成为非常迫切的需求。现有的设备升级主要过程如下:Currently, software upgrades are common in the communications field, and service interruptions are likely to occur during the upgrade process. Today, with increasingly high reliability requirements for telecommunication services, it is very urgent to upgrade without interrupting services. The main process of upgrading existing equipment is as follows:

(11)升级前主备板都正常运行,运行的都是旧版本;(11) Before the upgrade, both the main and standby boards were running normally, and all were running the old version;

(12)主板和备板都加载新的程序和配置数据;(12) Both the main board and the standby board are loaded with new programs and configuration data;

(13)复位两块主控板让新的程序生效。(13) Reset the two main control boards to make the new program take effect.

可以看出,在升级过程中两块主控板都经过了复位,业务中断不可避免。It can be seen that the two main control boards have been reset during the upgrade process, and service interruption is inevitable.

由于现有的技术局限,暂时还做不到主控板不复位而将新的程序软件替换旧的程序软件运行,所以软件升级主控板复位不可避免。现在普遍的做法是利用主备倒换的功能来实现升级业务不中断的功能,步骤如下:Due to the limitations of the existing technology, it is not possible to replace the old program software with the new program software without resetting the main control board for the time being, so the reset of the main control board is inevitable for software upgrades. The common practice now is to use the active/standby switchover function to realize the uninterrupted service upgrade function. The steps are as follows:

(21)升级前主备板都正常运行,运行的都是旧版本;(21) Before the upgrade, the main and standby boards were running normally, and all were running the old version;

(22)备板升级到新的版本;(22) The standby board is upgraded to a new version;

(23)主板将数据同步到备板;(23) The main board synchronizes the data to the standby board;

(24)数据同步完毕主备倒换,新的主板(原来的备板)开始使用新的版本程序控制业务的运行;(24) After the data synchronization is completed, the master-standby switchover is completed, and the new main board (the original standby board) starts to use the new version program to control the operation of the business;

(25)新的备板(原来的主板)升级到新的版本。(25) The new backup board (the original main board) is upgraded to a new version.

在上面的操作过程中,第(23)步是关键,因为只有主板的数据完全同步到备板,主备才能进行倒换,才能保证倒换后业务不发生任何的中断。由于此时主备版本不同,主板同步到备板的数据,备板不能保证完全识别和理解。所以不同版本的数据同步是解决升级不中断业务的关键。In the above operation process, step (23) is the key, because only when the data of the main board is completely synchronized to the standby board, can the active and standby switchover be performed, so as to ensure that the business will not be interrupted after the switchover. Since the active and standby versions are different at this time, the data on the main board is synchronized to the standby board, and the standby board cannot guarantee complete recognition and understanding. Therefore, the data synchronization of different versions is the key to solve the upgrade without interrupting the business.

主备同步的数据可分为两类,一类是用户的配置数据,另一类是动态运行数据。配置数据可以通过先以文件的形式导出然后使用外部工具升级到新版本再加载到备板的方式进行同步,但是动态数据是和系统的动态运行状态相关,不能采用此种方式,动态数据的同步只能是在主备板运行的过程中通过消息传递的方式同步过来。The data synchronized by master and backup can be divided into two types, one is user configuration data, and the other is dynamic operation data. Configuration data can be synchronized by first exporting it in the form of a file, then using an external tool to upgrade to a new version, and then loading it to the standby board. However, dynamic data is related to the dynamic operating status of the system, and this method cannot be used. Synchronization of dynamic data It can only be synchronized through message transmission during the operation of the master and slave boards.

升级不中断业务的场景下动态数据的同步面临一个难点:数据同步时主备版本不一致,主板同步过去的数据备板按照新版本的数据定义规则来理解会存在差异。如何正确识别旧版本同步过来的数据以及如何将同步过来的数据转换成新版本理解的数据是目前存在的一个问题。The synchronization of dynamic data in the scenario where the upgrade does not interrupt the business faces a difficulty: the master and backup versions are inconsistent during data synchronization, and there will be differences in understanding the data that has been synchronized by the main board and the backup board according to the data definition rules of the new version. How to correctly identify the data synchronized from the old version and how to convert the synchronized data into data understood by the new version is a current problem.

正是由于上述问题的存在,动态运行数据在升级过程中其实是丢失的,无法保证升级不中断业务。要实现升级不中断业务,关键的技术是解决动态数据的同步问题。It is precisely because of the above-mentioned problems that the dynamic operation data is actually lost during the upgrade process, and there is no guarantee that the upgrade will not interrupt the business. To realize the upgrade without interrupting the business, the key technology is to solve the synchronization problem of dynamic data.

现有的主备板动态数据同步方案的应用场景不是升级场景,而是正常的备板起保护作用的场景,此时主板和备板运行的都是完全相同的软件,在该软件中将主备板上的动态数据按照功能划分为一个个的同步数据块,每个同步数据块都包含若干描述某一相同功能的动态数据,各个同步数据块的大小和内容都可能各不相同,每个同步数据块都有两级索引进行标识,一是模块标识,二是模块内的同步块序号,模块标识表明该同步块属于哪个模块,同步块序号标识该同步块在该模块内的编号,模块号+同步块序号唯一标识一个同步数据块。由于主备软件完全一致,所以在主备板上模块号数目和定义以及同步块序号的数目和定义都是绝对一致的,主板将一个同步块发送到备板只要携带模块号+同步块序号即可,备板接收到该同步数据块,根据模块号+同步块序号就能唯一识别该同步块,备板将接收到的同步块数据覆盖自己的相应块即可。如图1所示。The application scenario of the existing dynamic data synchronization solution for the active and standby boards is not an upgrade scenario, but a scenario where the normal standby board plays a protective role. At this time, the main board and the The dynamic data on the standby board is divided into synchronous data blocks according to their functions. Each synchronous data block contains several dynamic data describing the same function. The size and content of each synchronous data block may be different. The synchronization data block has two levels of indexes to identify, one is the module identification, and the other is the synchronization block number in the module. The module identification indicates which module the synchronization block belongs to, and the synchronization block number identifies the number of the synchronization block in the module. number + sync block sequence number uniquely identifies a sync data block. Since the master and backup software are completely consistent, the number and definition of the module number and the number and definition of the synchronization block serial number on the master and slave boards are absolutely consistent. The main board only needs to carry the module number + synchronization block serial number to send a synchronization block to the standby board. Yes, the standby board can uniquely identify the synchronization block according to the module number + synchronization block serial number after receiving the synchronization data block, and the backup board simply overwrites its own corresponding block with the received synchronization block data. As shown in Figure 1.

正常运行的过程中,如果主板的动态数据发生变化,主板会将该变化的动态数据所在的同步数据块发送给备板,备板识别该同步数据块后将其内容覆盖自己的相应块,从而达到备板同步主板的动态数据的目的。当主板发生故障时,由于备板的软件、配置数据和动态数据都是和主板完全一致,所以主备倒换不会中断业务。During normal operation, if the dynamic data of the main board changes, the main board will send the synchronization data block where the changed dynamic data is located to the backup board, and the backup board will identify the synchronization data block and overwrite its corresponding block, thus To achieve the purpose of synchronizing the dynamic data of the main board with the standby board. When the main board fails, since the software, configuration data, and dynamic data of the standby board are completely consistent with the main board, active/standby switchover will not interrupt services.

该同步方案可行的前提要求主板和备板的同步块的标识以及相同标识的同步块的内容完全一致,这只能在同一个软件版本中才能实现。所以该方案只解决了主备软件完全一致的情况下动态数据同步的问题。在升级场景下,由于备板软件已经先行升级到了新的软件,新的软件中动态块数目和内容与旧的软件相比都可能有修改,此时采用该同步方案无法正确的识别该同步块,并且识别后内容也不能采用覆盖的方式,因为新旧版本软件中块的内容可能不一致,所以该方案在升级场景下无法正确的将动态数据同步到备板。The premise that this synchronization solution is feasible requires that the identification of the synchronization block of the main board and the backup board and the content of the synchronization block with the same identification are completely consistent, which can only be realized in the same software version. Therefore, this solution only solves the problem of dynamic data synchronization when the master and backup software are completely consistent. In the upgrade scenario, since the standby board software has been upgraded to the new software first, the number and content of dynamic blocks in the new software may be modified compared with the old software. At this time, the synchronization scheme cannot correctly identify the synchronization block. , and the content after identification cannot be overwritten, because the content of blocks in the old and new versions of the software may be inconsistent, so this solution cannot correctly synchronize dynamic data to the standby board in the upgrade scenario.

发明内容 Contents of the invention

本发明的实施例提供了一种数据同步的方法,以解决升级过程中业务中断的问题。The embodiment of the present invention provides a data synchronization method to solve the problem of service interruption during the upgrade process.

本发明的实施例提供了一种不中断业务升级过程中数据的同步方法,包括:Embodiments of the present invention provide a method for synchronizing data in an uninterrupted service upgrade process, including:

A、在新版本软件中设置与旧版本软件中相同的数据块编号;A. Set the same data block number in the new version software as in the old version software;

B、建立新版本软件与旧版本软件数据块内容转换的转换函数,上述转换函数是针对数据块编号对应的数据块从旧版本升级到新版本的;并在数据从未升级设备同步到已升级设备时,调用上述数据的数据块编号所对应的转换函数。B. Establish a conversion function for converting the data block content between the new version software and the old version software. The above conversion function is to upgrade the data block corresponding to the data block number from the old version to the new version; and when the data is synchronized from the non-upgraded device to the upgraded device device, call the conversion function corresponding to the data block number of the above data.

本发明的实施例通过在新版本软件中设置与旧软件版本中相同的数据块编号,解决了新旧版本软件中数据块标识一致性的问题,并通过在新版本软件中建立数据块内容转换的函数,保证了新版本软件能够识别同步过来的数据块的内容,实现数据在不同的软件版本间的同步问题,从而实现了升级过程不中断业务的功能,满足了运营商的迫切需求。升级不中断业务功能的应用将会极大提高运营商的服务质量和运营可靠性。Embodiments of the present invention solve the problem of data block identification consistency in the old and new version software by setting the same data block number in the new version software as in the old software version, and by establishing the data block content conversion in the new version software The function ensures that the new version of the software can identify the content of the synchronized data block, and realizes the synchronization of data between different software versions, so as to realize the function of not interrupting the service during the upgrade process and meet the urgent needs of operators. Upgrading applications that do not interrupt service functions will greatly improve operators' service quality and operational reliability.

附图说明 Description of drawings

图1为现有技术中动态数据同步方法的示意图。FIG. 1 is a schematic diagram of a dynamic data synchronization method in the prior art.

图2为本发明实施例的数据同步方法第一实施例流程示意图。FIG. 2 is a schematic flowchart of a first embodiment of a data synchronization method according to an embodiment of the present invention.

图3为本发明实施例的第一实施例关于设置新版本软件与旧版本软件数据块标识一致性示意图。Fig. 3 is a schematic diagram of setting the consistency of data block identifiers between the new version software and the old version software according to the first embodiment of the present invention.

图4为本发明实施例的第一实施例关于数据同步转换函数实现过程示意图。FIG. 4 is a schematic diagram of the implementation process of the data synchronization conversion function in the first embodiment of the embodiment of the present invention.

图5为本发明实施例的数据同步方法第二实施例流程示意图。FIG. 5 is a schematic flowchart of a second embodiment of a data synchronization method according to an embodiment of the present invention.

图6为本发明实施例的第二实施例关于设置新版本软件与旧版本软件数据块标识一致性示意图。Fig. 6 is a schematic diagram of setting the consistency of data block identifiers between the new version software and the old version software according to the second embodiment of the embodiment of the present invention.

图7为本发明实施例的第二实施例关于数据同步转换函数实现过程示意图。FIG. 7 is a schematic diagram of the implementation process of the data synchronization conversion function in the second embodiment of the embodiment of the present invention.

图8为本发明实施例的关于转换函数指针链表结构示意图。FIG. 8 is a schematic diagram of the structure of the linked list of conversion function pointers according to the embodiment of the present invention.

具体实施方式 Detailed ways

为了使本发明的目的、技术方案和优点更加清楚明白,以下将举实施例并参照附图,对本发明方案进行进一步详细的说明。In order to make the object, technical solution and advantages of the present invention more clear, the following will further describe the solution of the present invention in detail with examples and with reference to the accompanying drawings.

参考图2,该图为本发明实施例的不中断升级过程中数据同步方法的第一实施例流程图,其主要过程如下:Referring to Fig. 2, this figure is a flow chart of the first embodiment of the data synchronization method in the uninterrupted upgrade process of the embodiment of the present invention, and its main process is as follows:

步骤201:在新版本软件中设置与旧版本软件中相同的动态数据块编号;Step 201: setting the same dynamic data block number in the new version software as in the old version software;

在新版本软件中设置与旧版本软件中相同的动态数据块编号,即保证新版本软件中同一数据块的标识与旧版本软件中的标识相同,在此基础上,如果新增数据块,其标识只能采用新增的编号,以不影响旧版本中数据块的编号。参考图3,软件V1.0中模块M有N个同步数据块,则在新版本软件V2.0中模块M中块1对应V1.0中模块M中的块1,V2.0中块N对应V1.0中的块N,如果在V2.0的模块M中增加一新的同步数据块,则其编号为N+1。如果出现块标识需要减少的情况,只要在块编号上保留这些不再使用的编号,功能上去掉减少的块的功能即可。Set the same dynamic data block number in the new version of the software as in the old version of the software, that is, to ensure that the same data block in the new version of the software has the same identification as the old version of the software. On this basis, if a new data block is added, its The identification can only use the newly added number, so as not to affect the numbering of the data block in the old version. Referring to Figure 3, module M in software V1.0 has N synchronization data blocks, then in the new version of software V2.0, block 1 in module M corresponds to block 1 in module M in V1.0, and block N in V2.0 Corresponding to block N in V1.0, if a new synchronization data block is added in module M of V2.0, its number is N+1. If there is a situation that the block identification needs to be reduced, as long as these no longer used numbers are reserved on the block number, the function of the reduced block can be removed functionally.

步骤202:建立新版本软件与旧版本软件动态数据块内容转换的函数,并将动态数据从未升级设备同步到已升级设备时调用该转换函数。Step 202: Establish a function for converting dynamic data block content between the new version software and the old version software, and call the conversion function when the dynamic data is synchronized from the non-upgraded device to the upgraded device.

具体实现如下:The specific implementation is as follows:

参考图4,该图为本发明实施例一关于数据同步转换函数实现过程示意图,转换函数实现的是从V1.0到V2.0的转换。其中,V1.0中模块M包含N个数据块,V2.0中模块M包含N个数据块,V2.0中块1的内容发生了变化,块1的标识为:模块M+块1需要用转换函数对其内容进行转换。该转换函数将块1的内容格式变换到V2.0定义的块1的内容格式,以保证V2.0软件的应用程序能够理解,实现模块M的动态同步块1从V1.0到V2.0的同步。Referring to FIG. 4 , this figure is a schematic diagram of an implementation process of a data synchronization conversion function according to Embodiment 1 of the present invention. The conversion function realizes the conversion from V1.0 to V2.0. Among them, the module M in V1.0 contains N data blocks, the module M in V2.0 contains N data blocks, the content of block 1 in V2.0 has changed, and the identification of block 1 is: module M + block 1 needs to use The conversion function converts its content. This conversion function transforms the content format of block 1 to the content format of block 1 defined by V2.0, so as to ensure that the application program of V2.0 software can understand it, and realize the dynamic synchronization of block 1 of module M from V1.0 to V2.0 synchronization.

该转换函数由V2.0的软件开发人员具体编写和挂接,该转换函数只适用于模块M中的块1的转换,且只适用在V1.0到V2.0之间的转换,即任何一个转换函数都是针对一个特定块从特定版本升级到特定版本的。转换函数的入口参数为块1的结构内容,函数内部经过转换出口参数携带V2.0定义的块1的结构内容。函数原型可以定义为:This conversion function is specifically written and linked by the software developers of V2.0. This conversion function is only applicable to the conversion of block 1 in module M, and only applicable to the conversion between V1.0 and V2.0, that is, any A conversion function is all about upgrading from a specific version to a specific version for a specific block. The entry parameter of the conversion function is the structure content of block 1, and the exit parameter of the function carries the structure content of block 1 defined by V2.0 after conversion. A function prototype can be defined as:

intModule-M-Block-1-Convert-From-V1.0-To-V2.0(V1.0块1结构*pBlock1,V2.0块1结构*pBlock2)intModule-M-Block-1-Convert-From-V1.0-To-V2.0 (V1.0 block 1 structure *pBlock1, V2.0 block 1 structure *pBlock2)

参数说明:pBlock1指针指向转换前的同步数据块,pBlock2指针指向转换后的同步数据块。Parameter description: The pointer of pBlock1 points to the sync data block before conversion, and the pointer of pBlock2 points to the sync data block after conversion.

新版本新增一个同步块的转换函数,那么新申请一个数据结构挂接到该同步块的指针链表中。参考图8,该图为本发明关于转换函数指针链表结构示意图。同步块的指针链表采用排序的方式,这样便于备板接收到同步数据块后从前到后按顺序执行转换函数。The new version adds a conversion function of a synchronization block, and then applies for a new data structure to be linked to the pointer list of the synchronization block. Refer to FIG. 8 , which is a schematic diagram of the structure of the conversion function pointer linked list in the present invention. The pointer linked list of the synchronization block is sorted, so that the backup board can execute the conversion function in order from front to back after receiving the synchronization data block.

由于升级前的版本是不确定的,在新的版本上为每个内容有变化的同步块挂接一个从升级前的版本到新版本的转换函数,转换时采用相邻版本逐一转换的方式实现,每个版本只需要考虑和上一个相邻旧版本的数据块转换问题。Since the version before the upgrade is uncertain, a conversion function from the version before the upgrade to the new version is attached to each synchronization block with changed content on the new version, and the conversion is realized by converting adjacent versions one by one , each version only needs to consider the data block conversion problem with the previous adjacent old version.

版本逐一升级的方法为:所有的软件版本按照软件版本发布顺序排序,例如V1.0->V2.0->V3.0->V4.0->V5.0->V6.0,从一个旧版本升级到一个新版本不是一步到位,而是采用按照版本顺序逐级升级上来,转换函数也不是直接调用一个从旧版本到新版本的转换函数,而是按照顺序调用该同步块在这两个升级版本中间的所有转换函数。例如:块X从V2.0同步到V6.0后,在V6.0的软件中不是直接调用块X的从V2.0到V6.0的转换函数,而是先调用块X从V2.0到V3.0的转换函数,将转换得到的同步块内容再经过块X从V3.0到V4.0的转换函数转换......直到最后调用块X从V5.0到V6.0的转换函数得到V6.0能够理解的块内容。如果调用过程中某相邻两个版本没有挂接转换函数(如果相邻两个版本间块X内容没有变化,这两个版本就没有挂接转换函数)则直接跳过继续调用下一个转换函数。The method of upgrading versions one by one is: all software versions are sorted according to the release order of software versions, for example, V1.0->V2.0->V3.0->V4.0->V5.0->V6.0, starting from one Upgrading from an old version to a new version is not done in one step, but is upgraded step by step according to the order of versions. The conversion function does not directly call a conversion function from the old version to the new version, but calls the synchronization block in order. All conversion functions between upgrade versions. For example: after block X is synchronized from V2.0 to V6.0, the V6.0 software does not directly call the conversion function of block X from V2.0 to V6.0, but first calls block X from V2.0 To the conversion function of V3.0, the content of the converted synchronization block is converted through the conversion function of block X from V3.0 to V4.0... until the last call of block X from V5.0 to V6.0 The conversion function to get the block content that V6.0 can understand. If there is no conversion function attached to two adjacent versions during the calling process (if there is no change in the content of block X between two adjacent versions, the two versions do not have a conversion function attached), skip directly and continue to call the next conversion function .

动态数据块同步过程中,备板接收到主板同步过来的数据块,根据携带的模块号+同步块号找到备板上对应的唯一的同步块,从而找到该同步块挂接的转换函数链表,根据主板的版本号(旧版本号)确定转换函数链表第一个被转换的函数,然后按照顺序从该函数开始逐一执行链表上的转换函数直至末尾,最后一个转换函数转换完毕就可以得到新软件版本上该同步块内容,新软件能够正确的理解此同步块,将该内容发送给应用模块使用。During the dynamic data block synchronization process, the standby board receives the data block synchronized from the main board, finds the unique synchronization block corresponding to the backup board according to the carried module number + synchronization block number, and thus finds the conversion function linked list attached to the synchronization block. Determine the first converted function in the conversion function linked list according to the version number (old version number) of the motherboard, and then execute the conversion functions on the linked list one by one from this function to the end in order, and the new software can be obtained after the conversion of the last conversion function is completed. The new software can correctly understand the content of the synchronization block on the version, and send the content to the application module for use.

如果新版本软件中与旧版本软件对应的数据块的内容没有发生变化,由于新版本软件能够识别该块的内容,所以,对该没变化的数据块内容可以不设置转换函数;也可以针对该数据块设置转换函数,只是该转换函数不进行任何转换,其实现方式如上所述,同样能够实现数据同步的目的。If the content of the data block corresponding to the old version software in the new version software does not change, because the new version software can recognize the content of the block, so the conversion function can not be set for the unchanged data block content; The conversion function is set for the data block, but the conversion function does not perform any conversion, and its implementation method is as described above, which can also achieve the purpose of data synchronization.

参考图5,该图为本发明实施例的不中断升级过程中数据同步方法的第二实施例流程图,其主要过程如下:Referring to FIG. 5, this figure is a flow chart of the second embodiment of the data synchronization method in the uninterrupted upgrade process of the embodiment of the present invention, and its main process is as follows:

步骤501:在新版本软件中设置与旧版本软件中相同的动态数据块编号,即保证新版本软件中同一数据块的标识与旧版本软件中的标识相同,在此基础上,如果新增数据块,其标识只能采用新增的编号,以不影响旧版本中数据块的编号。参考图6,软件V1.0中模块M有N个同步数据块,则在新版本软件V2.0中模块M中块1对应V1.0中模块M中的块1,V2.0中块N对应V1.0中的块N,如果在V2.0的模块M中增加一新的同步数据块,其编号为N+1。如果出现块标识需要减少的情况,只要在块编号上保留这些不再使用的编号,功能上去掉减少的块的功能即可。Step 501: Set the same dynamic data block number in the new version software as in the old version software, that is, ensure that the identification of the same data block in the new version software is the same as the identification in the old version software. On this basis, if the new data block, its identification can only use the newly added number, so as not to affect the number of the data block in the old version. Referring to Figure 6, module M in software V1.0 has N synchronous data blocks, then block 1 in module M in the new version of software V2.0 corresponds to block 1 in module M in V1.0, and block N in V2.0 Corresponding to block N in V1.0, if a new synchronization data block is added in module M of V2.0, its number is N+1. If there is a situation that the block identification needs to be reduced, as long as these no longer used numbers are reserved on the block number, the function of the reduced block can be removed functionally.

步骤502:建立新版本软件与旧版本软件动态数据块内容转换的函数,并将动态数据从未升级设备同步到已升级设备时调用该转换函数。Step 502: Establish a function for converting dynamic data block content between the new version software and the old version software, and call the conversion function when the dynamic data is synchronized from the non-upgraded device to the upgraded device.

具体实现如下:The specific implementation is as follows:

参考图7,该图为本发明实施例二关于数据同步转换函数实现过程示意图,转换函数实现的是从V1.0到V4.0的转换。其中,V1.0中模块M包含N个数据块,V4.0中模块M包含N个数据块,V4.0中块1的内容发生了变化,块1的标识为:模块M+块1,需要用转换函数对其内容进行转换。Referring to FIG. 7 , this figure is a schematic diagram of the implementation process of the data synchronization conversion function in Embodiment 2 of the present invention. The conversion function realizes the conversion from V1.0 to V4.0. Among them, the module M in V1.0 contains N data blocks, the module M in V4.0 contains N data blocks, the content of block 1 in V4.0 has changed, and the identification of block 1 is: module M+ block 1, which needs Transform its contents with a transform function.

当模块M中的块1从V1.0同步到V4.0后,如果块1的内容发生了变化,则V4.0的软件须有一个转换函数,由该转换函数将块1的内容格式变换到V4.0定义的块1的内容格式,以保证V4.0软件的应用程序能够理解,实现模块M的动态同步块1从V1.0到V4.0的同步。After block 1 in module M is synchronized from V1.0 to V4.0, if the content of block 1 changes, the software of V4.0 must have a conversion function, and the conversion function will change the content format of block 1 To the content format of block 1 defined by V4.0, to ensure that the application program of V4.0 software can understand, and realize the synchronization of dynamic synchronization block 1 of module M from V1.0 to V4.0.

该转换函数由V4.0的软件开发人员具体编写和挂接,该转换函数只适用于模块M中的块1的转换,且只适用在V1.0到V4.0之间的转换,即任何一个转换函数都是针对一个特定块从特定版本升级到特定版本的。转换函数的入口参数为块1的结构内容,函数内部经过转换出口参数携带V4.0定义的块1的结构内容。函数原型可以定义为:This conversion function is specifically written and linked by the software developers of V4.0. This conversion function is only applicable to the conversion of block 1 in module M, and only applicable to the conversion between V1.0 and V4.0, that is, any A conversion function is all about upgrading from a specific version to a specific version for a specific block. The entry parameter of the conversion function is the structure content of block 1, and the exit parameter of the function carries the structure content of block 1 defined in V4.0 after conversion. A function prototype can be defined as:

intModule-M-Block-1-Convert-From-V1.0-To-V4.0(V1.0块1结构*pBlock1,V4.0块1结构*pBlock4)intModule-M-Block-1-Convert-From-V1.0-To-V4.0 (V1.0 block 1 structure *pBlock1, V4.0 block 1 structure *pBlock4)

参数说明:pBlock1指针指向转换前的同步数据块,pBlock4指针指向转换后的同步数据块。Parameter description: The pointer of pBlock1 points to the sync data block before conversion, and the pointer of pBlock4 points to the sync data block after conversion.

新版本新增一个同步块的转换函数,那么新申请一个数据结构挂接到该同步块的指针链表中。参考图8,该图为本发明关于转换函数指针链表结构示意图。同步块的指针链表采用排序的方式,这样便于备板接收到同步数据块后从前到后按顺序执行转换函数。The new version adds a conversion function of a synchronization block, and then applies for a new data structure to be linked to the pointer list of the synchronization block. Refer to FIG. 8 , which is a schematic diagram of the structure of the conversion function pointer linked list in the present invention. The pointer linked list of the synchronization block is sorted, so that the backup board can execute the conversion function in order from front to back after receiving the synchronization data block.

本实施例是在新的版本上为每个内容有变化的同步块挂接一个从升级前的版本到新版本的转换函数,由于升级前的版本是不确定的,实际转换时不是采用相邻版本逐一转换,而是以以前所有的旧版本为参考,每个同步块对应每个以前的旧版本都挂接一个转换函数,数据同步时备板对接收到的数据不需要相邻版本逐一调用转换函数,而是调用唯一的从旧版本到新版本的转换函数。此方案提高了数据同步的效率,但是新版本开发时需要考虑和所有以前的旧版本相比同步数据块的变化情况。In this embodiment, a conversion function from the pre-upgrade version to the new version is mounted on the new version for each synchronization block whose content has changed. Since the version before the upgrade is uncertain, the actual conversion does not use adjacent Versions are converted one by one, but all previous old versions are used as a reference. Each synchronization block corresponds to each previous old version. A conversion function is attached. When data is synchronized, the standby board does not need to call adjacent versions one by one for the received data. transition function, instead calling the only transition function from the old version to the new version. This solution improves the efficiency of data synchronization, but when developing a new version, it is necessary to consider the changes in the synchronization data block compared with all previous versions.

动态数据块同步过程中,备板接收到主板同步过来的数据块,根据携带的模块号+同步块号找到备板上对应的唯一的同步块,从而找到该同步块挂接的转换函数链表,根据主板的版本号(旧版本号)确定转换函数链表,找到旧版本到新版本直接转换的函数,就可以得到新软件版本上该同步块内容,新软件能够正确的理解此同步块,将该内容发送给应用模块使用。During the dynamic data block synchronization process, the standby board receives the data block synchronized from the main board, finds the unique synchronization block corresponding to the backup board according to the carried module number + synchronization block number, and thus finds the conversion function linked list attached to the synchronization block. Determine the conversion function linked list according to the version number (old version number) of the motherboard, find the function directly converted from the old version to the new version, and then you can get the content of the synchronization block on the new software version. The new software can correctly understand this synchronization block, and use the The content is sent to the application module for use.

本发明的实施例通过在新版本软件中设置与旧软件版本中相同的数据块编号,解决了新旧版本软件中数据块标识一致性的问题,并通过在新版本软件中建立数据块内容转换的函数,保证了新版本软件能够识别同步过来的数据块的内容,实现数据在不同的软件版本间的同步问题,从而实现了升级过程不中断业务的功能,满足了运营商的迫切需求。升级不中断业务功能的应用将会极大提高运营商的服务质量和运营可靠性。Embodiments of the present invention solve the problem of data block identification consistency in the old and new version software by setting the same data block number in the new version software as in the old software version, and by establishing the data block content conversion in the new version software The function ensures that the new version of the software can identify the content of the synchronized data block, and realizes the synchronization of data between different software versions, so as to realize the function of not interrupting the service during the upgrade process and meet the urgent needs of operators. Upgrading applications that do not interrupt service functions will greatly improve operators' service quality and operational reliability.

如果新版本软件中与旧版本软件对应的数据块的内容没有发生变化,由于新版本软件能够识别该块的内容,所以,对该没变化的数据块内容可以不设置转换函数;也可以针对该数据块设置转换函数,只是该转换函数不进行任何转换,其实现方式如上所述,同样能够实现数据同步的目的。If the content of the data block corresponding to the old version software in the new version software does not change, because the new version software can recognize the content of the block, so the conversion function can not be set for the unchanged data block content; The conversion function is set for the data block, but the conversion function does not perform any conversion, and its implementation method is as described above, which can also achieve the purpose of data synchronization.

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

Claims (9)

1.一种数据同步的方法,用于不中断业务升级过程中数据的同步,其特征在于:1. A method for data synchronization, used for uninterrupted data synchronization in the service upgrade process, characterized in that: A、在新版本软件中设置与旧版本软件中相同的数据块编号;A. Set the same data block number in the new version software as in the old version software; B、建立新版本软件与旧版本软件数据块内容转换的转换函数,所述转换函数是针对数据块编号对应的数据块从旧版本升级到新版本的;并在数据从未升级设备同步到已升级设备时,调用所述数据的数据块编号所对应的转换函数。B. Establish a conversion function for the conversion of new version software and old version software data block content, the conversion function is to upgrade the data block corresponding to the data block number from the old version to the new version; and when the data is synchronized from the non-upgraded device to the existing When upgrading the device, call the conversion function corresponding to the data block number of the data. 2.根据权利要求1所述的方法,其特征在于,所述步骤A进一步包括:在新版本软件中增加新的数据块时,保留已有的数据块编号,新增的编号在已有编号的基础之上增设。2. The method according to claim 1, characterized in that, said step A further comprises: when adding a new data block in the new version software, retaining the existing data block numbering, and adding the new numbering to the existing numbering Added on the basis of . 3.根据权利要求1所述的方法,其特征在于,所述步骤B进一步包括:所述调用的转换函数实现新版本软件与旧版本软件中同一数据块内容的转换。3 . The method according to claim 1 , wherein the step B further comprises: converting the content of the same data block in the new version software and the old version software through the called conversion function. 4 . 4.根据权利要求3所述的方法,其特征在于,所述步骤B进一步包括:所述调用的转换函数对数据块内容的转换针对的是一个单个数据块。4. The method according to claim 3, characterized in that, the step B further comprises: converting the content of the data block by the called conversion function is aimed at a single data block. 5.根据权利要求1所述的方法,其特这在于,所述步骤B进一步包括:所述调用的转换函数对数据块内容的转换针对的是内容有变化的数据块。5. The method according to claim 1, wherein the step B further comprises: converting the content of the data block by the called conversion function is aimed at the data block whose content has changed. 6.根据权利要求1或5所述的方法,其特征在于,所述步骤B进一步包括:所述调用的转换函数对数据块内容的转换是根据软件版本顺序逐级转换。6. The method according to claim 1 or 5, characterized in that the step B further comprises: converting the data block content by the called conversion function step by step according to the order of software versions. 7.根据权利要求1或5所述的方法,其特征在于,所述步骤B进一步包括:所述调用的转换函数对数据块内容的转换是从旧版本软件直接转换到新版本软件。7. The method according to claim 1 or 5, characterized in that the step B further comprises: the conversion of the data block content by the called conversion function is directly converted from the old version software to the new version software. 8.根据权利要求1或5所述的方法,其特征在于,所述步骤B进一步包括:设置转换函数时,将所述转换函数挂接到该转换函数所转换的数据块的指针链表中。8. The method according to claim 1 or 5, wherein the step B further comprises: when setting the conversion function, attaching the conversion function to a linked list of pointers to the data blocks converted by the conversion function. 9.根据权利要求1或5所述的方法,其特征在于,所述步骤B进一步包括:9. The method according to claim 1 or 5, wherein said step B further comprises: 所述转换函数进行转换时,该转换函数的入口参数为旧版本软件所转换数据块的结构内容,出口参数中携带有新版本软件定义的所转换数据块的结构内容。When the conversion function performs conversion, the entry parameter of the conversion function is the structure content of the converted data block of the old version software, and the exit parameter carries the structure content of the converted data block defined by the new version software.
CNB2006101572408A 2006-12-02 2006-12-02 Data Synchronization Method Active CN100461704C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101572408A CN100461704C (en) 2006-12-02 2006-12-02 Data Synchronization Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101572408A CN100461704C (en) 2006-12-02 2006-12-02 Data Synchronization Method

Publications (2)

Publication Number Publication Date
CN1976301A CN1976301A (en) 2007-06-06
CN100461704C true CN100461704C (en) 2009-02-11

Family

ID=38126109

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101572408A Active CN100461704C (en) 2006-12-02 2006-12-02 Data Synchronization Method

Country Status (1)

Country Link
CN (1) CN100461704C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101256607B (en) * 2008-03-10 2011-08-10 北京深思洛克软件技术股份有限公司 Method for remote updating and controlling use of software protection apparatus
EP2398292B2 (en) 2009-03-11 2017-07-26 Huawei Technologies Co., Ltd. Coexistence method and device of multiple operating entity systems
CN102681863A (en) * 2011-03-15 2012-09-19 新奥特(北京)视频技术有限公司 Method for automatically upgrading data based on command mode
EP2854028A4 (en) 2013-07-31 2015-06-24 Huawei Tech Co Ltd Associated plugin management method, device and system
CN106649814A (en) * 2016-12-29 2017-05-10 国网江苏省电力公司南京供电公司 Method for consistency checking of distribution automation cross-domain database
CN108769260B (en) * 2018-06-29 2020-10-16 苏州浪潮智能科技有限公司 Event processing method and device in cluster upgrading process
CN110321620B (en) * 2019-06-26 2023-07-21 浙江杭加泽通建筑节能新材料有限公司 Design construction method of assembled house building

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6341291B1 (en) * 1998-09-28 2002-01-22 Bentley Systems, Inc. System for collaborative engineering using component and file-oriented tools
WO2002077862A1 (en) * 2001-03-27 2002-10-03 British Telecommunications Public Limited Company File synchronisation
US20030177408A1 (en) * 2001-04-06 2003-09-18 Patientkeeper, Inc. Synchronizing data between disparate schemas using composite version
US6671701B1 (en) * 2000-06-05 2003-12-30 Bentley Systems, Incorporated System and method to maintain real-time synchronization of data in different formats
CN1801087A (en) * 2004-12-31 2006-07-12 英业达股份有限公司 Data and application synchronous update system and method
CN1851657A (en) * 2005-07-21 2006-10-25 上海华为技术有限公司 Dual-machine back-up realizing method and system
CN1866252A (en) * 2006-02-20 2006-11-22 华为技术有限公司 Method and system for transformation between different version configuration data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6341291B1 (en) * 1998-09-28 2002-01-22 Bentley Systems, Inc. System for collaborative engineering using component and file-oriented tools
US6671701B1 (en) * 2000-06-05 2003-12-30 Bentley Systems, Incorporated System and method to maintain real-time synchronization of data in different formats
WO2002077862A1 (en) * 2001-03-27 2002-10-03 British Telecommunications Public Limited Company File synchronisation
US20030177408A1 (en) * 2001-04-06 2003-09-18 Patientkeeper, Inc. Synchronizing data between disparate schemas using composite version
CN1801087A (en) * 2004-12-31 2006-07-12 英业达股份有限公司 Data and application synchronous update system and method
CN1851657A (en) * 2005-07-21 2006-10-25 上海华为技术有限公司 Dual-machine back-up realizing method and system
CN1866252A (en) * 2006-02-20 2006-11-22 华为技术有限公司 Method and system for transformation between different version configuration data

Also Published As

Publication number Publication date
CN1976301A (en) 2007-06-06

Similar Documents

Publication Publication Date Title
CN100461704C (en) Data Synchronization Method
CN105141453A (en) Control method capable of not interrupting service in upgrading process of system and system thereof
CN101399701A (en) In-service software upgrade utilizing metadata-driven state translation
CN103220342B (en) A kind of method of mobile terminal device group remote synchronization more new procedures
CN103544303A (en) Data synchronization method, system and device
CN102724356A (en) Information synchronization method and device of access device
CN102866925B (en) Communication method and system for middleware and user interface
CN102065413A (en) Database updating method and system, and base station self-starting method and system
CN112363845A (en) Data synchronization method of system integration middling station and integration middling station system
CN101673205B (en) Interface board upgrading method and system
CN107018189A (en) Migrate application data and receive the method and device of application data
CN109787789B (en) Compatibility management method, device and equipment for software upgrading and storage medium
CN104731650A (en) Acquisition method and device for system interface call information
CN100465886C (en) A device for establishing an extensible document model and a method for managing the document model
CN1260983C (en) A method of disaster recovery for home location register (HLR) with zero-time service take-over
WO2011143851A1 (en) Database server operation control system, method and equipment
CN101626431A (en) Processing method and processing system capable of adapting to communication mode
CN103259639A (en) Clock synchronization method of stacking equipment and stacking equipment
CN103888283A (en) SCTP communication method and device
WO2024140019A1 (en) Method and apparatus for upgrading 5g terminal from nsa to sa, and computer device and storage medium
CN114168359B (en) Method and device for processing resource data, electronic equipment and storage medium
CN112702728A (en) User configuration file downloading method, management method, device, smart card and medium
CN102591688B (en) Electrocardiograph plug-in access method and system
CN108768828B (en) Synchronization method for adjusting local address book and mapping WeChat enterprise number address book
CN113296898A (en) Asynchronous task processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant