

技术领域technical field
本发明涉及操作与维护技术,尤其涉及实现配置事务的方法及设备。The invention relates to operation and maintenance technology, in particular to a method and equipment for realizing configuration affairs.
背景技术Background technique
为了简化通讯设备的运行维护复杂度,并同时支持不同的应用场景和业务发放,通讯设备的数据配置都要求能够支持配置事务机制。配置事务是客户端发起的一系列配置操作的集合,该集合包括了为设备配置的数据,完成配置事务后,便可将完成的配置事务应用到通讯设备生效。一个配置事务由一条以上操作命令组成,每条操作命令包括对配置对象的增(Create)、删(Delete)或改(Set)。运行数据库中保存当前通讯设备生效的配置事务的数据,一个配置事务内包含一个以上的数据库表。In order to simplify the operation and maintenance complexity of communication equipment, and support different application scenarios and service provisioning at the same time, the data configuration of communication equipment is required to support the configuration transaction mechanism. The configuration transaction is a collection of a series of configuration operations initiated by the client. This collection includes the data configured for the device. After the configuration transaction is completed, the completed configuration transaction can be applied to the communication device to take effect. A configuration transaction consists of more than one operation command, and each operation command includes Add (Create), Delete (Delete) or Change (Set) to the configuration object. The running database saves the data of configuration transactions in effect for the current communication device, and one configuration transaction contains more than one database table.
配置事务具有以下特点:配置事务包括的所有操作命令要么全部执行成功,要么全部不执行,例如,在执行配置事务的操作命令的过程中,如果某一条操作命令执行失败,则该配置事务的执行全部失败,配置事务的这种特性称为原子性;执行配置事务时,并行的各个配置事务是相互隔离的,一个配置事务内的操作及操作的数据不被其他配置事务感知,不受其他配置事务的影响,配置事务的这种特性称为独立性。The configuration transaction has the following characteristics: all the operation commands included in the configuration transaction are either executed successfully or not executed at all. For example, in the process of executing the operation commands of the configuration transaction, if an operation command fails to All failures, this feature of configuration transactions is called atomicity; when executing configuration transactions, the parallel configuration transactions are isolated from each other, and the operations and operation data in one configuration transaction are not perceived by other configuration transactions, and are not affected by other configuration transactions. This property of configuration transactions is called independence.
参见图1,为现有技术中实现配置事务的设备结构示意图,该设备包括配置(CFG,Configuration)模块、运行数据库和缓存数据结构。CFG模块用于接收客户端输入的配置事务的操作命令,控制运行数据库逐条执行操作命令,所述操作命令为增/删/改(Create/Delete/Set)配置事务的数据库表中的数据。配置事务的所有操作命令执行完毕后,CFG模块控制运行数据库将完成的配置事务提交给应用设备,CFG模块控制应用设备在通讯设备上应用配置事务。Referring to FIG. 1 , it is a schematic structural diagram of a device for implementing configuration transactions in the prior art. The device includes a configuration (CFG, Configuration) module, a running database and a cache data structure. The CFG module is used to receive the operation command of the configuration transaction input by the client, and control the operation database to execute the operation command one by one. The operation command is to add/delete/modify (Create/Delete/Set) the data in the database table of the configuration transaction. After all the operation commands of the configuration transaction are executed, the CFG module controls the running database to submit the completed configuration transaction to the application device, and the CFG module controls the application device to apply the configuration transaction on the communication device.
在通讯设备中实现配置事务还通常采用基于逆操作的补偿事务机制。操作命令包括CREATE、SET和DELETE3种,下面对这3种操作命令的逆操作进行举例说明。A compensating transaction mechanism based on inverse operations is also usually used to implement configuration transactions in communication devices. Operation commands include CREATE, SET, and DELETE. The reverse operations of these three operation commands are illustrated below with examples.
1.CREATE的逆操作1. The reverse operation of CREATE
以A对象的CREATE为例,假设A对象创建的属性值为a1、a2,表示为[A,CREATE,a1,a2]。Take the CREATE of object A as an example, assuming that the attribute values created by object A are a1 and a2, expressed as [A, CREATE, a1, a2].
则CREATE的逆操作为删除A对象创建的属性值a1、a2,恢复到A对象的原始状态,表示为[A,DELETE]。Then the inverse operation of CREATE is to delete the attribute values a1 and a2 created by the A object, and restore the original state of the A object, expressed as [A, DELETE].
2.SET的逆操作2. The reverse operation of SET
以A对象的SET为例,假设A对象的原始属性值为:a1、a2,将其修改为新的属性值,a3、a4,表示为:[A,SET,a3,a4]。Taking the SET of object A as an example, assuming that the original attribute values of object A are: a1, a2, modify them to new attribute values, a3, a4, expressed as: [A, SET, a3, a4].
则SET的逆操作为将A对象的属性值a3、a4,恢复到A对象的原始属性值,a1、a2,表示为:[A,SET,a1,a2]。Then the inverse operation of SET is to restore the attribute values a3 and a4 of object A to the original attribute values of object A, a1 and a2, expressed as: [A, SET, a1, a2].
3.DELETE的逆操作3. The reverse operation of DELETE
以A对象的DELETE为例,假设A对象删除之前的属性值为a1,a2,将其删除,表示为:[A,DELETE]。Take the DELETE of object A as an example, assuming that the attribute values of object A before deletion are a1, a2, delete them, expressed as: [A, DELETE].
则DELETE的逆操作为创建A对象的属性值a1,a2,以恢复到A对象的原始状态,表示为[A,CREATE,a1,a2]。Then the inverse operation of DELETE is to create the attribute values a1, a2 of the A object to restore the original state of the A object, expressed as [A, CREATE, a1, a2].
具体地,基于逆操作的补偿事务机制包括:CFG模块控制运行数据库从配置事务的第一条操作命令开始执行,如果某一条操作命令执行失败,则需要将该配置事务的所有操作命令都进行回退操作,使运行数据库的配置事务恢复到之前的原有状态,所述回退操作也就是逆操作。Specifically, the compensation transaction mechanism based on inverse operations includes: the CFG module controls the running database to execute from the first operation command of the configuration transaction. If a certain operation command fails to execute, all operation commands of the configuration transaction need to be returned to The rollback operation restores the configuration transaction of the running database to the previous original state, and the rollback operation is also the reverse operation.
所述基于逆操作的补偿事务机制的实现过程为:CFG模块控制运行数据库逐条执行操作命令的同时,还控制缓存数据结构保存相应的操作命令以及逆操作列表,所述逆操作列表中包括了各条操作命令执行前运行数据库中保存的数据和执行后运行数据库中保存的数据之间的对应关系。进行回退操作时,根据逆操作列表中保存的对应关系,CFG模块控制运行数据库倒序逐条执行与缓存数据结构中保存的操作命令相逆的操作,将运行数据库中的数据恢复到原有状态。所述倒序,也就是从缓存数据结构保存的逆操作列表中最后一条的数据对应关系指向第一条数据对应关系的顺序。CFG模块控制运行数据库将配置事务提交给应用设备后,将控制缓存数据结构删除保存的逆操作列表以及相应的操作命令。The implementation process of the compensation transaction mechanism based on inverse operations is: while the CFG module controls the operation database to execute the operation commands one by one, it also controls the cache data structure to save the corresponding operation commands and the inverse operation list, and the inverse operation list includes each The corresponding relationship between the data saved in the running database before execution of the operation command and the data saved in the running database after execution. When the rollback operation is performed, according to the corresponding relationship stored in the reverse operation list, the CFG module controls the running database to execute the reverse operations of the operation commands stored in the cache data structure one by one in reverse order, and restore the data in the running database to its original state. The reverse order is the order in which the last data correspondence in the inverse operation list stored in the cache data structure points to the first data correspondence. After the CFG module controls the operation database to submit the configuration transaction to the application device, it will control the cache data structure to delete the saved reverse operation list and corresponding operation commands.
下面举例对回退操作进行说明。The following example describes the rollback operation.
假设配置事务为cmd1,包括以下的操作命令:Suppose the configuration transaction is cmd1, including the following operation commands:
1.A对象创建属性值a1、a2,该操作命令表示为[A,CREATE,a1,a2]。1. Object A creates attribute values a1 and a2, and the operation command is expressed as [A, CREATE, a1, a2].
CFG模块控制运行数据库执行上述操作命令时,在运行数据库中A对象创建属性值a1、a2,同时,CFG模块控制逆操作列表中保存操作命令、原始数据以及执行操作命令后的数据之间的对应关系,所述操作命令为CREATE,所述原始数据为空,所述执行操作命令后的数据为a1,a2。相应地,其逆操作表示为:[A,DELETE]。When the CFG module controls the operation database to execute the above operation commands, the A object creates attribute values a1 and a2 in the operation database. At the same time, the CFG module controls the correspondence between the operation commands, original data and the data after the operation commands are saved in the inverse operation list. relationship, the operation command is CREATE, the original data is empty, and the data after the execution of the operation command is a1, a2. Correspondingly, its inverse operation is expressed as: [A, DELETE].
2.B对象将原始的属性值修改为b1、b2,B对象原始的属性值为b3、b4,该操作命令表示为:[B,SET,b1,b2]。2. The original attribute values of object B are changed to b1 and b2, and the original attribute values of object B are b3 and b4. The operation command is expressed as: [B, SET, b1, b2].
CFG模块控制运行数据库执行上述操作命令时,在运行数据库中B对象将原始的属性值b3、b4修改为b1、b2,同时,CFG模块控制逆操作列表中保存操作命令、原始数据以及执行操作命令后的数据之间的对应关系,所述操作命令为SET,所述原始数据为b3、b4,所述执行操作命令后的数据为b1、b2。相应地,其逆操作表示为:[B,SET,b3,b4]。When the CFG module controls the running database to execute the above operation commands, the B object in the running database changes the original attribute values b3 and b4 to b1 and b2, and at the same time, the CFG module controls the inverse operation list to save the operation commands, original data and execute the operation commands The corresponding relationship between the data after execution, the operation command is SET, the original data are b3, b4, and the data after the operation command is executed are b1, b2. Correspondingly, its inverse operation is expressed as: [B, SET, b3, b4].
3.C对象将原始的属性值删除,C对象原始的属性值为c1、c2,该操作命令表示为:[C,DELETE]。3. The C object deletes the original attribute value, the original attribute value of the C object is c1, c2, and the operation command is expressed as: [C, DELETE].
CFG模块控制运行数据库执行上述操作命令时,在运行数据库中C对象将原始的属性值为c1、c2删除,同时CFG模块控制逆操作列表中保存操作命令、原始数据以及执行操作命令后的数据之间的对应关系,所述操作命令为SET,所述原始数据为c1、c2,所述执行操作命令后的数据为空。相应地,其逆操作表示为:[C,CREATE,c1,c2]。When the CFG module controls the running database to execute the above operation commands, the C object in the running database deletes the original attribute values c1 and c2, and at the same time, the CFG module controls the inverse operation list to save the operation command, the original data and the data after the operation command is executed. The corresponding relationship among them, the operation command is SET, the original data are c1, c2, and the data after the execution of the operation command is empty. Correspondingly, its inverse operation is expressed as: [C, CREATE, c1, c2].
即,该配置事务包括下述3条操作命令:That is, the configuration transaction includes the following three operation commands:
1.[A,CREATE,a1,a2],其逆操作为:[A,DELETE]。1. [A, CREATE, a1, a2], its inverse operation is: [A, DELETE].
2.[B,SET,b1,b2],其逆操作为:[B,SET,b3,b4]。2. [B, SET, b1, b2], its inverse operation is: [B, SET, b3, b4].
3.[C,DELETE],其逆操作为:[C,CREATE,c1,c2]。3. [C, DELETE], its inverse operation is: [C, CREATE, c1, c2].
在逐条执行上述操作命令的过程中,若某条操作执行失败,则根据缓存数据结构中保存的逆操作列表,CFG模块控制运行数据库倒序逐条执行与缓存数据结构中保存的操作命令相逆的操作,将运行数据库中的数据恢复到原有状态。In the process of executing the above operation commands one by one, if a certain operation fails to execute, according to the inverse operation list stored in the cache data structure, the CFG module controls the running database to execute the reverse operations of the operation commands stored in the cache data structure one by one in reverse order , to restore the data in the running database to its original state.
假设执行第一条操作命令[A,CREATE,a1,a2]失败,则无需执行逆操作。Assuming that the execution of the first operation command [A, CREATE, a1, a2] fails, there is no need to perform the inverse operation.
假设执行第二条操作命令[B,SET,b1,b2]失败,则CFG模块控制运行数据库执行第一条操作命令的逆操作,也就是:[A,DELETE],在运行数据库中A对象将创建的属性值a1、a2删除,运行数据库中的数据恢复到原有状态。Assuming that the execution of the second operation command [B, SET, b1, b2] fails, the CFG module controls the running database to perform the reverse operation of the first operation command, that is: [A, DELETE], and the A object in the running database will be The created attribute values a1 and a2 are deleted, and the data in the running database is restored to its original state.
假设执行第三条操作命令[C,DELETE]失败,则CFG模块控制运行数据库先执行第二条操作命令的逆操作,也就是:[B,SET,b3,b4],在运行数据库中B对象将原始的属性值b1、b2修改为原始属性值b3、b4;然后再执行第一条操作命令的逆操作,也就是:[A,DELETE],在运行数据库中A对象将创建的属性值a1、a2删除,运行数据库中的数据恢复到原有状态。Assuming that the execution of the third operation command [C, DELETE] fails, the CFG module controls the running database to perform the inverse operation of the second operation command first, that is: [B, SET, b3, b4], the B object in the running database Modify the original attribute values b1 and b2 to the original attribute values b3 and b4; then execute the inverse operation of the first operation command, that is: [A, DELETE], the attribute value a1 that object A will create in the running database , a2 is deleted, and the data in the operating database is restored to its original state.
现有的配置事务补偿机制只能倒序逐条执行逆操作,以还原运行数据库的原有状态,执行逆操作的时间与执行操作命令的时间相等,这导致了回退速度慢,在很多应用环境下无法满足快速回退的要求。而且,逐条执行逆操作的回退过程中,如果某条逆操作执行失败,将导致回退失败,运行数据库不能恢复到原有状态。The existing configuration transaction compensation mechanism can only perform reverse operations one by one in reverse order to restore the original state of the running database. The time to perform reverse operations is equal to the time to execute operation commands, which leads to slow rollback. In many application environments Unable to satisfy fast fallback requirement. Moreover, in the rollback process of performing reverse operations one by one, if a reverse operation fails, the rollback will fail, and the running database cannot be restored to its original state.
发明内容Contents of the invention
本发明实施例提供一种实现配置事务的方法,该方法能够实现快速回退。An embodiment of the present invention provides a method for implementing a configuration transaction, and the method can implement fast rollback.
本发明实施例提供一种实现配置事务的设备,该设备能够实现快速回退。An embodiment of the present invention provides a device for implementing a configuration transaction, and the device can implement fast rollback.
一种实现配置事务的方法,该方法包括:A method of implementing a configuration transaction, the method comprising:
创建候选数据库;Create candidate databases;
控制候选数据库逐条执行配置事务的操作命令,如果操作命令执行失败,则删除候选数据库;如果成功执行配置事务的所有操作命令,则控制候选数据库用完成的配置事务更新运行数据库中的配置事务。Control the candidate database to execute the operation commands of the configuration transaction one by one, if the execution of the operation command fails, delete the candidate database; if successfully execute all the operation commands of the configuration transaction, then control the candidate database to update the configuration transaction in the running database with the completed configuration transaction.
一种实现配置事务的设备,该设备包括配置模块、候选数据库和运行数据库;A device for implementing configuration transactions, the device includes a configuration module, a candidate database and a running database;
所述配置模块,用于创建候选数据库,控制候选数据库逐条执行配置事务的操作命令,如果操作命令执行失败,则删除所述候选数据库,如果成功执行配置事务的所有操作命令,则控制候选数据库用完成的配置事务更新运行数据库中的配置事务;The configuration module is used to create a candidate database, control the candidate database to execute the operation commands of the configuration transaction one by one, if the execution of the operation command fails, then delete the candidate database, and if successfully execute all the operation commands of the configuration transaction, then control the candidate database to use The completed configuration transaction updates the running configuration transaction in the database;
所述候选数据库,用于在配置模块的控制下逐条执行配置模块发送的配置事务的操作命令,在配置模块的控制下将完成的配置事务发送给运行数据库;The candidate database is used to execute the operation commands of the configuration transaction sent by the configuration module one by one under the control of the configuration module, and send the completed configuration transaction to the running database under the control of the configuration module;
所述运行数据库,用于在配置模块的控制下接收候选数据库发送的完成的配置事务,更新自身保存的配置事务。The running database is used to receive the completed configuration transaction sent by the candidate database under the control of the configuration module, and update the configuration transaction saved by itself.
从上述方案可以看出,本发明实施例控制候选数据库逐条执行配置事务的操作命令,如果操作命令执行失败,则删除候选数据库;如果成功执行配置事务的所有操作命令,则控制候选数据库用完成的配置事务更新运行数据库中的配置事务。这样,执行操作命令的过程和回退过程中运行数据库没有发生变化,进行回退时无需像现有技术那样在运行数据库中倒序地逐条执行逆操作,直接删除候选数据库即可,从而,很大地提高了配置事务的回退速度。As can be seen from the above scheme, the embodiment of the present invention controls the candidate database to execute the operation commands of the configuration transaction one by one. If the execution of the operation command fails, the candidate database is deleted; Configuration transaction updates run configuration transactions in the database. In this way, there is no change in the running database during the process of executing the operation command and the rollback process. When rolling back, it is not necessary to perform reverse operations one by one in the running database in reverse order as in the prior art, and just delete the candidate database directly, thus greatly Improved rollback speed for configuration transactions.
附图说明Description of drawings
图1为现有技术中实现配置事务的设备结构示意图;FIG. 1 is a schematic diagram of a device structure for implementing configuration transactions in the prior art;
图2为本发明实施例实现配置事务的设备结构示意图;FIG. 2 is a schematic diagram of a device structure for implementing a configuration transaction according to an embodiment of the present invention;
图3为本发明实施例实现配置事务的方法流程图实例。FIG. 3 is an example flowchart of a method for implementing a configuration transaction in an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,下面结合实施例和附图,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the embodiments and accompanying drawings.
参见图2,为本发明实施例实现配置事务的设备结构示意图,该设备包括CFG模块、候选数据库和运行数据库。Referring to FIG. 2 , it is a schematic structural diagram of a device implementing a configuration transaction according to an embodiment of the present invention, and the device includes a CFG module, a candidate database and a running database.
所述CFG模块,用于创建候选数据库,控制候选数据库逐条执行配置事务的操作命令,如果操作命令执行失败,则删除所述候选数据库,如果成功执行配置事务的所有操作命令,则控制候选数据库用完成的配置事务更新运行数据库中的配置事务。The CFG module is used to create a candidate database, and control the candidate database to execute the operation commands of the configuration transaction one by one. If the execution of the operation command fails, then delete the candidate database. If all the operation commands of the configuration transaction are successfully executed, then control the candidate database to use A completed configuration transaction updates the running configuration transaction in the database.
所述候选数据库,用于在CFG模块的控制下逐条执行CFG模块发送的配置事务的操作命令,在CFG模块的控制下将完成的配置事务发送给运行数据库。The candidate database is used to execute the configuration transaction operation commands sent by the CFG module one by one under the control of the CFG module, and send the completed configuration transaction to the running database under the control of the CFG module.
所述运行数据库,用于在CFG模块的控制下接收候选数据库发送的完成的配置事务,更新自身保存的配置事务。The running database is used to receive the completed configuration transaction sent by the candidate database under the control of the CFG module, and update the configuration transaction saved by itself.
所述CFG模块可以包括更新模块,用于控制候选数据库用完成的配置事务替换运行数据库保存的配置事务;或者,用于控制候选数据库根据完成的配置事务,更新运行数据库的配置事务中与候选数据库的配置事务中不同的数据。The CFG module may include an update module, which is used to control the candidate database to replace the configuration transaction saved by the running database with the completed configuration transaction; or, to control the candidate database to update the configuration transaction of the running database and the candidate database according to the completed configuration transaction. Different data in the configuration transaction.
本发明实施例实现配置事务的方法包括:创建候选数据库;控制候选数据库逐条执行配置事务的操作命令,如果操作命令执行失败,则删除候选数据库;如果成功执行配置事务的所有操作命令,则控制候选数据库用完成的配置事务更新运行数据库中的配置事务。The method for realizing the configuration transaction in the embodiment of the present invention includes: creating a candidate database; controlling the candidate database to execute the operation commands of the configuration transaction one by one, if the execution of the operation command fails, then deleting the candidate database; The database updates the configuration transaction in the running database with the completed configuration transaction.
下面依据图2的设备结构,通过图3对本发明实施例配置事务的方法进行说明。参见图3,为本发明实施例实现配置事务的方法流程图实例,该方法包括以下步骤:The following describes the method for configuring a transaction according to the embodiment of the present invention through FIG. 3 according to the device structure in FIG. 2 . Referring to Fig. 3, it is an example of a flow chart of a method for implementing a configuration transaction in an embodiment of the present invention, and the method includes the following steps:
步骤301,CFG模块接收客户端输入的启动配置事务命令,创建数据库实例,这里,将所述数据库实例称为候选数据库。In
如果不同的客户端同时向CFG模块输入了启动同一个配置事务的命令,则CFG模块为不同的客户端分别创建候选数据库。If different clients input commands to start the same configuration transaction to the CFG module at the same time, the CFG module creates candidate databases for different clients respectively.
运行数据库中保存了配置事务的完整数据,每个配置事务包括一个以上的数据库表。例如某个配置事务为给基站配置数据,相应地,运行数据库中保存的配置事务包括关于硬件设备的多个数据库表,以及关于小区参数的多个数据库表等。其中各个关于小区参数的数据库表是执行配置事务时客户端经常访问的数据库表。The complete data of the configuration transaction is saved in the running database, and each configuration transaction includes more than one database table. For example, a certain configuration transaction is to configure data for the base station. Correspondingly, the configuration transaction stored in the running database includes multiple database tables about hardware devices, multiple database tables about cell parameters, and the like. Each of the database tables about cell parameters is a database table frequently accessed by the client when executing configuration transactions.
运行数据库中保存的配置事务为通讯设备当前应用的数据。当客户端需要对通讯设备进行维护,也就是需要对当前应用的数据进行更新时,则向CFG模块输入启动配置事务的命令。The configuration transaction saved in the running database is the current application data of the communication device. When the client needs to maintain the communication equipment, that is, needs to update the data of the current application, it inputs a command to start the configuration transaction to the CFG module.
对于运行数据库中保存的配置事务的数据量较少的情况,本步骤所述启动配置事务命令中携带指定的配置事务的信息,本步骤所述创建候选数据库包括:将运行数据库中的所述指定的配置事务拷贝到候选数据库中。For the case where the data volume of the configuration transaction saved in the running database is small, the command to start the configuration transaction described in this step carries the information of the specified configuration transaction, and the creation of the candidate database described in this step includes: The configuration transaction is copied to the candidate database.
对于运行数据库中保存的配置事务的数据量较大的情况,可以采取上述将运行数据库中的配置事务拷贝到候选数据库中的方案;也可以在本步骤所述启动配置事务命令中携带指定配置事务的数据库表类型的信息,则本步骤所述创建候选数据库包括:将运行数据库中的与所述指定配置事务的数据库表类型对应的数据库表拷贝到候选数据库中。采用后一种方案时,在步骤301之前,该方法包括:CFG模块根据客户端访问运行数据库中配置事务的数据库表的规则,对配置事务中的数据库表进行分类,将客户端访问的属于同一类型的数据库表分为一类。以给基站配置数据的配置事务为例,运行数据库中保存的配置事务包括关于硬件设备的多个数据库表,以及关于小区参数的多个数据库表等。其中,关于硬件设备的多个数据库表分为一类,关于小区参数的多个数据库表分为一类,CFG模块建立分类表,分类表中包含了不同类型与数据库表之间的对应关系。For the situation where the data volume of the configuration transaction saved in the running database is large, the above-mentioned scheme of copying the configuration transaction in the running database to the candidate database can be adopted; the specified configuration transaction can also be carried in the start configuration transaction command described in this step In this step, creating the candidate database includes: copying the database table in the running database corresponding to the database table type of the specified configuration transaction to the candidate database. When the latter solution is adopted, before
这样,运行数据库中保存的配置事务的数据量较大时,不必将运行数据库中的配置事务包含的所有数据库表都拷贝到候选数据库中,节省了候选数据库的占用空间,并且,减少了复制的数据量。In this way, when the data volume of the configuration transaction saved in the running database is large, it is not necessary to copy all the database tables contained in the configuration transaction in the running database to the candidate database, which saves the occupied space of the candidate database and reduces the duplication time. The amount of data.
步骤302,CFG模块接收客户端输入的配置事务的操作命令,控制候选数据库逐条执行操作命令,如果某条操作命令执行失败,则执行步骤303;如果成功执行配置事务的所有操作命令,则执行步骤304。
本步骤还包括:CFG模块在候选数据库中每执行一条操作命令后,都会将执行结果反馈给客户端,该执行结果包括执行成功和执行失败。客户端根据执行结果向CFG模块输入操作命令、回退命令或提交命令:如果执行结果为执行失败,客户端可以向CFG模块输入回退命令,以回退配置事务;如果执行结果为执行成功,客户端可以继续向CFG模块输入操作命令,如果所述执行成功的执行结果是在客户端向CFG模块输入配置事务的所有操作命令之后获知的,客户端向CFG模块输入提交命令。This step also includes: after the CFG module executes an operation command in the candidate database, it will feed back the execution result to the client, and the execution result includes execution success and execution failure. The client enters an operation command, a rollback command or a submit command to the CFG module according to the execution result: if the execution result is execution failure, the client can input a rollback command to the CFG module to roll back the configuration transaction; if the execution result is execution success, The client can continue to input operation commands to the CFG module. If the successful execution result is known after the client inputs all operation commands of the configuration transaction to the CFG module, the client inputs a submit command to the CFG module.
步骤303,CFG模块删除候选数据库。
CFG模块控制候选数据库逐条执行配置事务的操作命令的过程中,如果某一条操作命令执行失败,需要回退配置事务,CFG模块接收到客户端输入的退回命令后,直接删除该候选数据库即可。这样,执行操作命令的过程和执行的回退过程中运行数据库都没有发生变化,进行回退时无需像现有技术那样在运行数据库中倒序地逐条执行逆操作,从而,很大地提高了配置事务的回退速度。When the CFG module controls the candidate database to execute the operation commands of the configuration transaction one by one, if a certain operation command fails to execute, the configuration transaction needs to be rolled back. After the CFG module receives the return command input by the client, it can directly delete the candidate database. In this way, there is no change in the running database during the process of executing the operation command and the rollback process of the execution, and there is no need to perform reverse operations one by one in the running database in reverse order as in the prior art when performing rollback, thereby greatly improving the configuration transaction the rollback speed.
下面举例对本步骤进行说明,假设配置事务包括3条操作命令:The following example illustrates this step, assuming that the configuration transaction includes 3 operation commands:
1.[A,CREATE,a1,a2]。1. [A, CREATE, a1, a2].
2.[B,SET,b1,b2]。2. [B, SET, b1, b2].
3.[C,DELETE]。3. [C, DELETE].
CFG模块控制候选数据库逐条执行上述操作命令,若执行到第3条操作命令时,执行失败,则CFG模块接收到客户端输入的回退命令,删除该候选数据库。The CFG module controls the candidate database to execute the above operation commands one by one. If the execution fails when the third operation command is executed, the CFG module receives the rollback command input by the client and deletes the candidate database.
步骤304,CFG模块控制候选数据库用完成的配置事务更新运行数据库中的配置事务。In
配置事务的所有操作命令逐条执行完之后,CFG模块接收客户端输入的提交命令后,控制候选数据库用完成的配置事务更新运行数据库中的配置事务。After all the operation commands of the configuration transaction are executed one by one, the CFG module controls the candidate database to update the configuration transaction in the running database with the completed configuration transaction after receiving the submission command input by the client.
所述控制候选数据库用完成的配置事务更新运行数据库中的配置事务的方法有多种,包括:控制候选数据库用候选数据库中完成的配置事务替换运行数据库中的配置事务;或者,控制候选数据库根据完成的配置事务,更新运行数据库保存的配置事务中与候选数据库的配置事务中不同的数据,也就是,只将运行数据库中与候选数据库中不同的数据替换为候选数据库中相应的数据。There are multiple methods for controlling the candidate database to update the configuration transaction in the running database with the completed configuration transaction, including: controlling the candidate database to replace the configuration transaction in the running database with the configuration transaction completed in the candidate database; or, controlling the candidate database according to The completed configuration transaction updates the data in the configuration transaction stored in the running database that is different from the configuration transaction in the candidate database, that is, only replaces the data in the running database that is different from the candidate database with the corresponding data in the candidate database.
如果步骤301中两个以上(包括两个)客户端同时向CFG模块输入了启动同一个配置事务的命令,CFG模块为各个客户端分别创建候选数据库,则CFG模块控制各个候选数据库执行完成配置事务的操作命令之后,各个候选数据库中包含了各自完成的配置事务。相应地,本步骤所述控制候选数据库用完成的配置事务更新运行数据库中的配置事务为:控制各个候选数据库用完成的配置事务按照一定的顺序更新运行数据库中的配置事务,所述顺序可根据需要确定。If in
现有技术中,如果两个以上(包括两个)客户端同时向CFG模块输入了启动同一个配置事务的命令,CFG模块在运行数据库中同时执行由不同客户端输入的相同操作命令时,将出现回退失败的问题。例如,运行数据库中A对象原始的属性值为a1,客户端1向CFG模块输入了将a1修改为a2操作命令,客户端2向CFG模块输入了将a1修改为a3的操作命令,假设CFG模块在运行数据库中同时执行将a1修改为a2的操作和执行将a1修改为a3的操作之后,运行数据库中执行的结果为将a1修改为a2;此时客户端2将获知操作命令执行失败,CFG模块控制运行数据库执行回退操作,第一条回退操作命令为将a3修改为a1,而运行数据库当前的值为a2,这将导致回退操作无法执行。现有技术中由于并发的配置事务之间将相互影响,不能保证并发配置事务的独立性,无法成功执行回退操作。In the prior art, if more than two (including two) clients input the command to start the same configuration transaction to the CFG module at the same time, when the CFG module simultaneously executes the same operation command input by different clients in the running database, it will There is a problem of rollback failure. For example, the original attribute value of object A in the running database is a1, client 1 inputs the operation command of changing a1 to a2 to the CFG module, and client 2 inputs the operation command of changing a1 to a3 to the CFG module, assuming that the CFG module After executing the operation of modifying a1 to a2 and the operation of modifying a1 to a3 in the running database at the same time, the result of the execution in the running database is to change a1 to a2; at this time, client 2 will know that the execution of the operation command failed, CFG The module controls the running database to execute the rollback operation. The first rollback operation command is to modify a3 to a1, and the current value of the running database is a2, which will cause the rollback operation to fail. In the prior art, since the concurrent configuration transactions will affect each other, the independence of the concurrent configuration transactions cannot be guaranteed, and the rollback operation cannot be successfully performed.
而本发明实施例方案中由于各个候选数据库之间相互独立,且CFG模块控制候选数据库执行配置事务的各条操作命令时与运行数据库没有关系,对于两个以上(包括两个)客户端同时向CFG模块输入了启动同一个配置事务的命令的情况,采取将各个候选数据库中完成的配置按照一定的顺序更新运行数据库中的配置事务,从而,解决了现有技术中无法执行并发配置事务的问题,保证了并发配置事务的独立性。并且,由于执行操作命令的过程和回退过程中运行数据库没有发生变化,执行回退操作时直接删除候选数据库即可,对于两个以上(包括两个)客户端同时向CFG模块输入了启动同一个配置事务的命令的情况,也能保证回退操作的成功执行。And in the scheme of the embodiment of the present invention, since each candidate database is independent of each other, and the CFG module controls the candidate database to execute each operation command of the configuration transaction, it has nothing to do with the running database, for more than two (comprising two) clients, send When the CFG module inputs the command to start the same configuration transaction, it adopts the configuration completed in each candidate database to update the configuration transaction in the running database in a certain order, thereby solving the problem that the concurrent configuration transaction cannot be executed in the prior art , which ensures the independence of concurrent configuration transactions. Moreover, since the running database does not change during the process of executing the operation command and the rollback process, it is sufficient to delete the candidate database directly when performing the rollback operation. For more than two (including two) In the case of a command that configures a transaction, the successful execution of the rollback operation is also guaranteed.
本发明实施例实现配置事务的方案,控制候选数据库逐条执行配置事务的操作命令,如果某条操作命令执行失败,则删除候选数据库,这样,进行回退时无需像现有技术那样在运行数据库中倒序地逐条执行逆操作,从而,实现了配置事务的快速回退。并且,对于两个以上(包括两个)客户端同时向CFG模块输入了启动同一个配置事务的命令情况,采取将各个候选数据库中完成的配置按照一定的顺序更新运行数据库中的配置事务,从而,保证了并发配置事务的独立性。The embodiment of the present invention implements the configuration transaction scheme, controls the candidate database to execute the operation commands of the configuration transaction one by one, and if a certain operation command fails to execute, then deletes the candidate database, so that it is not necessary to perform rollback in the running database as in the prior art Reverse operations are performed one by one in reverse order, thereby realizing fast rollback of configuration transactions. And, for the situation that two or more (including two) clients input the command to start the same configuration transaction to the CFG module at the same time, take the configuration completed in each candidate database to update the configuration transaction in the running database in a certain order, so that , which ensures the independence of concurrent configuration transactions.
以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. Protection scope, within the spirit and principles of the present invention, any modification, equivalent replacement, improvement, etc., shall be included in the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2007101947901ACN100535863C (en) | 2007-12-06 | 2007-12-06 | Method and apparatus for realizing configuring affair |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2007101947901ACN100535863C (en) | 2007-12-06 | 2007-12-06 | Method and apparatus for realizing configuring affair |
| Publication Number | Publication Date |
|---|---|
| CN101178665Atrue CN101178665A (en) | 2008-05-14 |
| CN100535863C CN100535863C (en) | 2009-09-02 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2007101947901AActiveCN100535863C (en) | 2007-12-06 | 2007-12-06 | Method and apparatus for realizing configuring affair |
| Country | Link |
|---|---|
| CN (1) | CN100535863C (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102111293A (en)* | 2010-12-23 | 2011-06-29 | 华为技术有限公司 | Configuration event processing method and device |
| CN102193984A (en)* | 2011-03-25 | 2011-09-21 | 北京世纪互联工程技术服务有限公司 | Control method for modifying data in non-online transaction of graphic database |
| CN102857357A (en)* | 2011-06-29 | 2013-01-02 | 中兴通讯股份有限公司 | Method and device for implementing network management configuration |
| CN105591807A (en)* | 2015-10-10 | 2016-05-18 | 杭州华三通信技术有限公司 | Interface configuration migration method and device |
| CN105703941A (en)* | 2015-12-31 | 2016-06-22 | 山石网科通信技术有限公司 | Method and device for processing configuration transaction |
| WO2017219775A1 (en)* | 2016-06-22 | 2017-12-28 | 中兴通讯股份有限公司 | Configuration state rollback method and device, and computer storage medium |
| CN107741936A (en)* | 2016-09-06 | 2018-02-27 | 腾讯科技(深圳)有限公司 | The update method and device of a kind of data relationship |
| CN112948406A (en)* | 2021-03-01 | 2021-06-11 | 烽火通信科技股份有限公司 | Method, system and device for storing and synchronizing configuration change data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102111293B (en)* | 2010-12-23 | 2013-10-02 | 华为技术有限公司 | Configuration event processing method and device |
| CN102111293A (en)* | 2010-12-23 | 2011-06-29 | 华为技术有限公司 | Configuration event processing method and device |
| CN102193984A (en)* | 2011-03-25 | 2011-09-21 | 北京世纪互联工程技术服务有限公司 | Control method for modifying data in non-online transaction of graphic database |
| CN102193984B (en) | 2011-03-25 | 2012-12-05 | 北京世纪互联宽带数据中心有限公司 | Control method for modifying data in non-online transaction of graphic database |
| CN102857357A (en)* | 2011-06-29 | 2013-01-02 | 中兴通讯股份有限公司 | Method and device for implementing network management configuration |
| CN102857357B (en)* | 2011-06-29 | 2017-04-26 | 中兴通讯股份有限公司 | Method and device for implementing network management configuration |
| CN105591807B (en)* | 2015-10-10 | 2019-05-07 | 新华三技术有限公司 | A kind of interface configuration emigration method and equipment |
| CN105591807A (en)* | 2015-10-10 | 2016-05-18 | 杭州华三通信技术有限公司 | Interface configuration migration method and device |
| CN105703941A (en)* | 2015-12-31 | 2016-06-22 | 山石网科通信技术有限公司 | Method and device for processing configuration transaction |
| CN105703941B (en)* | 2015-12-31 | 2019-11-05 | 山石网科通信技术股份有限公司 | The processing method and processing device of configuration transaction |
| WO2017219775A1 (en)* | 2016-06-22 | 2017-12-28 | 中兴通讯股份有限公司 | Configuration state rollback method and device, and computer storage medium |
| CN107741936A (en)* | 2016-09-06 | 2018-02-27 | 腾讯科技(深圳)有限公司 | The update method and device of a kind of data relationship |
| CN107741936B (en)* | 2016-09-06 | 2020-12-01 | 腾讯科技(深圳)有限公司 | Data relationship updating method and device |
| CN112948406A (en)* | 2021-03-01 | 2021-06-11 | 烽火通信科技股份有限公司 | Method, system and device for storing and synchronizing configuration change data |
| CN112948406B (en)* | 2021-03-01 | 2023-06-13 | 烽火通信科技股份有限公司 | Method, system and device for storing and synchronizing configuration change data |
| Publication number | Publication date |
|---|---|
| CN100535863C (en) | 2009-09-02 |
| Publication | Publication Date | Title |
|---|---|---|
| CN100535863C (en) | Method and apparatus for realizing configuring affair | |
| US9031910B2 (en) | System and method for maintaining a cluster setup | |
| CN108628874B (en) | Method and device for migrating data, electronic equipment and readable storage medium | |
| JP7329518B2 (en) | System and method for database management using append-only storage devices | |
| US11023448B2 (en) | Data scrubbing method and apparatus, and computer readable storage medium | |
| CN102265277B (en) | Method and apparatus for operating a data storage system | |
| US20060047926A1 (en) | Managing multiple snapshot copies of data | |
| CN104407933B (en) | A kind of backup method and device of data | |
| US20140019495A1 (en) | Processing a file system operation in a distributed file system | |
| US10909091B1 (en) | On-demand data schema modifications | |
| US11561937B2 (en) | Multitenant application server using a union file system | |
| US10642817B2 (en) | Index table update method, and device | |
| CN111708764A (en) | A kind of control method and device for database change version | |
| CN112905613B (en) | A bidirectional data synchronization method and device for heterogeneous databases | |
| CN101179437A (en) | A method and device for realizing batch configuration pre-activation | |
| CN111240891A (en) | Data recovery method and device based on data consistency among multiple tables of database | |
| JP4419884B2 (en) | Data replication apparatus, method, program, and storage system | |
| CN110297867A (en) | Data-base cluster operation method and system based on domestic CPU and distributed container cluster | |
| CN111352936A (en) | Method and storage medium for ES index reconstruction | |
| CN110968569B (en) | Database management method, database management device, and storage medium | |
| CN112685438B (en) | Data processing system, method, device and storage medium | |
| CN117056305A (en) | Construction method, model, database system and medium of multisource isomorphic database | |
| CN116594669A (en) | Version management method | |
| CN110321322A (en) | Data re-establishing method, device, equipment and computer readable storage medium | |
| CN1996875A (en) | A method and device for realization of the configuration transaction and commissioning mechanism |
| 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 |