CN112217656B - Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system - Google Patents
Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system Download PDFInfo
- Publication number
- CN112217656B CN112217656B CN201910625186.2A CN201910625186A CN112217656B CN 112217656 B CN112217656 B CN 112217656B CN 201910625186 A CN201910625186 A CN 201910625186A CN 112217656 B CN112217656 B CN 112217656B
- Authority
- CN
- China
- Prior art keywords
- configuration
- tree
- configuration information
- configurations
- information
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种SD‑WAN系统中的网络设备的配置信息同步方法和装置。该方法包括:获取配置数据库中存储的网络设备的配置信息,得到第一配置信息,其中配置信息包括若干配置,每个配置包括若干配置项;将第一配置信息按照配置间的引用关系生成第一配置树;获取网络设备的配置文件中的配置信息,得到第二配置信息;将第二配置信息按照配置间的引用关系生成第二配置树;通过比对第一配置树和第二配置树的所有节点,得到差异配置信息;以及将差异配置信息下发至网络设备。通过本发明,能够实现差异配置的同步。
The present invention provides a method and device for synchronizing configuration information of network equipment in an SD-WAN system. The method includes: acquiring configuration information of a network device stored in a configuration database, and obtaining first configuration information, wherein the configuration information includes several configurations, and each configuration includes several configuration items; and generating the first configuration information according to the reference relationship between the configurations. a configuration tree; obtain the configuration information in the configuration file of the network device to obtain the second configuration information; generate the second configuration tree from the second configuration information according to the reference relationship between the configurations; compare the first configuration tree and the second configuration tree by comparing the first configuration tree and the second configuration tree All nodes in the system, obtain the differential configuration information; and deliver the differential configuration information to the network device. Through the present invention, synchronization of differential configurations can be achieved.
Description
技术领域technical field
本发明涉及数据处理技术领域,尤其涉及一种SD-WAN系统中的网络设备的配置信息同步方法和装置。The present invention relates to the technical field of data processing, and in particular, to a method and device for synchronizing configuration information of network equipment in an SD-WAN system.
背景技术Background technique
软件定义的广域网(SD-WAN)是将SD-WAN技术应用到广域网场景中所形成的一种服务,这种服务用于连接广阔地理范围的企业网络、数据中心、互联网应用及云服务。SD-WAN可以将网络设备控制面与数据面分离开来,使得控制面作为上层独立的应用运行,并与下层数据平面通过标准化接口协议进行通信,从而实现对网络流量的灵活控制,并且为网络架构和上层应用的创新提供了一个良好的平台。Software-defined wide area network (SD-WAN) is a service formed by applying SD-WAN technology to a wide area network scenario, which is used to connect enterprise networks, data centers, Internet applications and cloud services across a wide geographic range. SD-WAN can separate the control plane from the data plane of network devices, so that the control plane operates as an independent application of the upper layer, and communicates with the lower layer data plane through standardized interface protocols, so as to realize flexible control of network traffic and provide network The innovation of architecture and upper-layer application provides a good platform.
在SD-WAN系统运行过程中,需要由管控平台对整个广域网中多个网络设备进行集中管控。在对各个网络设备的集中管控过程中,需要频繁进行配置信息下发/同步的操作。而当SD-WAN系统中某个网络设备的业务进行变动后,都需要在极短的时间内将变动后的业务配置信息推送到网络设备上,使业务能正常运行。During the operation of the SD-WAN system, the management and control platform needs to centrally manage and control multiple network devices in the entire WAN. In the process of centralized management and control of each network device, it is necessary to frequently perform configuration information delivery/synchronization operations. When the service of a network device in the SD-WAN system changes, it is necessary to push the changed service configuration information to the network device within a very short period of time, so that the service can run normally.
现有技术中,SD-WAN系统中某个网络设备的业务进行变动后,管控平台通常会将该网络设备整体的配置信息重新下发至网络设备进行配置,耗时较长,影响业务的正常进行。In the prior art, after the business of a certain network device in the SD-WAN system is changed, the management and control platform usually re-deliveries the overall configuration information of the network device to the network device for configuration, which takes a long time and affects the normal operation of the business. conduct.
因此,提供一种SD-WAN系统中的网络设备的配置信息同步方法和装置,以实现SD-WAN系统中网络设备配置的差异下发,减少网络设备的业务进行变动后网络设备的配置时间,减小耗时,降低对业务的影响,是本领域亟需解决的技术问题。Therefore, a method and device for synchronizing configuration information of network equipment in an SD-WAN system are provided, so as to realize the different delivery of network equipment configurations in the SD-WAN system, and reduce the configuration time of network equipment after the business of network equipment is changed, Reducing time-consuming and reducing the impact on business is a technical problem that needs to be solved urgently in this field.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种SD-WAN系统中的网络设备的配置信息同步方法、装置、计算机设备和计算机可读存储介质,用于解决现有技术中存在的上述技术问题。The purpose of the present invention is to provide a configuration information synchronization method, apparatus, computer equipment and computer-readable storage medium of a network device in an SD-WAN system, so as to solve the above-mentioned technical problems existing in the prior art.
一方面,为实现上述目的,本发明提供了一种SD-WAN系统中的网络设备的配置信息同步方法。On the one hand, in order to achieve the above object, the present invention provides a method for synchronizing configuration information of a network device in an SD-WAN system.
SD-WAN系统包括管控平台和网络设备,SD-WAN系统中的网络设备的配置信息同步方法包括:获取配置数据库中存储的网络设备的配置信息,得到第一配置信息,其中配置信息包括若干配置,每个配置包括若干配置项;将第一配置信息按照配置间的引用关系生成第一配置树,其中,所述第一配置树的每个节点对应所述第一配置信息中的一个所述配置;获取网络设备的配置文件中的配置信息,得到第二配置信息;将第二配置信息按照配置间的引用关系生成第二配置树,其中,所述第二配置树的每个节点对应所述第二配置信息中的一个所述配置;通过比对第一配置树和第二配置树的所有节点,得到差异配置信息,其中,差异配置信息包括若干差异配置;以及将差异配置信息下发至网络设备。The SD-WAN system includes a management and control platform and a network device. The method for synchronizing configuration information of the network device in the SD-WAN system includes: acquiring the configuration information of the network device stored in the configuration database, and obtaining the first configuration information, wherein the configuration information includes several configurations , each configuration includes several configuration items; a first configuration tree is generated from the first configuration information according to the reference relationship between configurations, wherein each node of the first configuration tree corresponds to one of the first configuration information. configuration; obtain the configuration information in the configuration file of the network device, and obtain the second configuration information; generate the second configuration tree according to the reference relationship between the configurations according to the second configuration information, wherein each node of the second configuration tree corresponds to the One of the configurations in the second configuration information; by comparing all nodes of the first configuration tree and the second configuration tree, the difference configuration information is obtained, wherein the difference configuration information includes several difference configurations; and the difference configuration information is issued to the network device.
进一步地,在将差异配置信息下发至网络设备之后,该方法还包括:接收网络设备反馈的针对每个差异配置的配置执行结果;当配置执行结果为执行失败时,将失败的差异配置记入失败记录,并展示失败原因;当所述配置执行结果为执行成功时,将成功的所述差异配置更新至所述配置文件。Further, after delivering the differential configuration information to the network device, the method further includes: receiving a configuration execution result for each differential configuration fed back by the network device; when the configuration execution result is an execution failure, recording the failed differential configuration as a result. The failure record is entered, and the failure reason is displayed; when the configuration execution result is successful, the successful differential configuration is updated to the configuration file.
进一步地,在将差异配置信息下发至网络设备之前,该方法还包括:将失败记录中的差异配置写入差异配置信息,清空失败记录。Further, before delivering the difference configuration information to the network device, the method further includes: writing the difference configuration in the failure record into the difference configuration information, and clearing the failure record.
进一步地,差异配置包括新增配置、修改配置和删除配置,通过比对第一配置树和第二配置树的所有节点,得到差异配置信息的步骤包括:将第一配置树所有的第一层叶子节点组成第一集合,将第二配置树的所有的第一层叶子节点组成第二集合;循环第一集合中的所有配置,根据第一集合中第一配置的配置标识判断第二集合中是否存在第一配置,如果第二集合中不存在第一配置,则第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置为新增配置,如果第二集合中存在第一配置,将第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置组成第三集合,将第一配置和第二配置树中第一配置所在节点的所有分支节点对应的配置组成第四集合;循环第二集合的中所有配置,根据第二集合的第二配置的配置标识判断第一集合中是否存在第二配置,如果第一集合中不存在第二配置,则第二配置和第二配置树中第二配置所在节点的所有分支节点对应的配置为删除配置;循环第三集合中的所有配置,根据第三集合中第三配置的配置标识判断第四集合中是否存在第三配置,如果第四集合中不存在第三配置,则第三配置为新增配置,如果第四集合中存在第三配置,将第三集合中的第三配置和第四集合中的第三配置的每个配置项进行比对,若存在任意一个或多个配置项不同,则第三配置为修改配置;循环第四集合的中所有配置,根据第四集合的第四配置的配置标识判断第三集合中是否存在第四配置,如果第三集合中不存在第四配置,则第四配置为删除配置。Further, the differential configuration includes adding a configuration, modifying a configuration and deleting a configuration, and by comparing all nodes of the first configuration tree and the second configuration tree, the step of obtaining the differential configuration information includes: The leaf nodes form the first set, and all the first-layer leaf nodes of the second configuration tree form the second set; all configurations in the first set are circulated, and the second set is determined according to the configuration identifier of the first configuration in the first set. Whether there is a first configuration, if the first configuration does not exist in the second set, the first configuration and the configurations corresponding to all branch nodes of the node where the first configuration is located in the first configuration tree are newly added configurations, if there is a first configuration in the second set For the first configuration, the first configuration and the configurations corresponding to all the branch nodes of the node where the first configuration is located in the first configuration tree are formed into a third set, and the first configuration and the second configuration tree are all branch nodes of the node where the first configuration is located. The corresponding configuration forms a fourth set; all configurations in the second set are circulated, and it is judged whether there is a second configuration in the first set according to the configuration identifier of the second configuration in the second set, if the second configuration does not exist in the first set, Then the configuration corresponding to the second configuration and all branch nodes of the node where the second configuration is located in the second configuration tree is the deletion configuration; all configurations in the third set are circulated, and the fourth set is determined according to the configuration identifier of the third configuration in the third set Whether there is a third configuration in the fourth set, if the third configuration does not exist in the fourth set, the third configuration is a newly added configuration, if there is a third configuration in the fourth set, the third configuration in the third set and the fourth set Compare each configuration item of the third configuration in the Determines whether the fourth configuration exists in the third set, and if the fourth configuration does not exist in the third set, the fourth configuration is to delete the configuration.
进一步地,控制网络设备按照新增配置、修改配置和删除配置的顺序执行配置。Further, the network device is controlled to perform configuration in the order of adding configuration, modifying configuration and deleting configuration.
进一步地,控制网络设备按照新增配置、修改配置和删除配置的顺序执行配置的步骤包括:按照新增配置、修改配置和删除配置的先后顺序,对差异配置信息中的差异配置进行排序。Further, the step of controlling the network device to perform configuration in the order of newly added configuration, modified configuration and deleted configuration includes: sorting the differential configurations in the differential configuration information in the order of newly added configuration, modified configuration and deleted configuration.
进一步地,配置用于对网络设备的业务属性进行限定,配置信息为json文件,配置为json数据,将配置信息按照配置间的引用关系生成配置树的步骤包括:将json文件对应的json schema文件映射为类结构,类结构能够标识网络设备的各业务属性之间的引用关系和业务属性的值;解析json数据,根据所述类结构将json数据映射为数据实例;将配置信息对应的各个数据实例转换为配置树,其中,配置信息为第一配置信息时,配置树为第一配置树,配置信息为第二配置信息时,配置树为第二配置树。Further, the configuration is used to limit the service attributes of the network device, the configuration information is a json file, and the configuration is json data, and the steps of generating the configuration tree from the configuration information according to the reference relationship between the configurations include: converting the json schema file corresponding to the json file Map to a class structure, which can identify the reference relationship between various service attributes of the network device and the value of the service attribute; parse the json data, map the json data to a data instance according to the class structure; map each data corresponding to the configuration information The instance is converted into a configuration tree, wherein when the configuration information is the first configuration information, the configuration tree is the first configuration tree, and when the configuration information is the second configuration information, the configuration tree is the second configuration tree.
另一方面,为实现上述目的,本发明提供了一种SD-WAN系统中的网络设备的配置信息同步装置。On the other hand, in order to achieve the above object, the present invention provides an apparatus for synchronizing configuration information of a network device in an SD-WAN system.
SD-WAN系统包括管控平台和网络设备,网络设备的配置信息同步装置设置于管控平台,该装置包括:第一获取模块,用于获取配置数据库中存储的网络设备的配置信息,得到第一配置信息,其中配置信息包括若干配置,每个配置包括若干配置项;第一生成模块,用于将第一配置信息按照配置间的引用关系生成第一配置树,其中,所述第一配置树的每个节点对应所述第一配置信息中的一个所述配置;第二获取模块,用于获取网络设备的配置文件中的配置信息,得到第二配置信息;第二生成模块,用于将第二配置信息按照配置间的引用关系生成第二配置树,其中,所述第二配置树的每个节点对应所述第二配置信息中的一个所述配置;处理模块,用于通过比对第一配置树和第二配置树的所有节点,得到差异配置信息,其中,差异配置信息包括若干差异配置;以及发送模块,用于将差异配置信息下发至网络设备。The SD-WAN system includes a management and control platform and a network device. The configuration information synchronization device of the network device is set on the management and control platform. The device includes: a first acquisition module for acquiring the configuration information of the network device stored in the configuration database to obtain the first configuration. information, wherein the configuration information includes several configurations, and each configuration includes several configuration items; the first generation module is configured to generate a first configuration tree from the first configuration information according to the reference relationship between the configurations, wherein the first configuration tree is Each node corresponds to one of the configurations in the first configuration information; the second acquisition module is used to acquire the configuration information in the configuration file of the network device to obtain the second configuration information; the second generation module is used to The second configuration information generates a second configuration tree according to the reference relationship between the configurations, wherein each node of the second configuration tree corresponds to one of the configurations in the second configuration information; the processing module is configured to compare the first configuration All nodes of the first configuration tree and the second configuration tree obtain differential configuration information, wherein the differential configuration information includes several differential configurations; and a sending module is configured to deliver the differential configuration information to the network device.
为实现上述目的,本发明还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,该处理器执行计算机程序时实现上述方法的步骤。In order to achieve the above object, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implements the steps of the above method when the processor executes the computer program.
为实现上述目的,本发明还提供计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述方法的步骤。To achieve the above object, the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the above method.
本发明提供的SD-WAN系统中的网络设备的配置信息同步方法和装置,运营或管理人员在管控平台对网络设备进行配置时,将配置信息写入配置数据库,然后根据配置数据库中的配置信息对网络设备进行配置,并将网络设备配置成功的配置记入配置文件,当网络设备的业务配置发生变化时,管控平台响应配置操作更新配置数据库中的配置信息后,将发生变化的部分,也即差异配置信息同步至网络设备,具体地,将配置数据库中的配置信息和当前配置文件中的配置信息分别映射为配置树,然后通过比对两颗配置树的节点得到差异配置信息,进而下发至网络设备,一方面,该同步方法实现了差异配置下发,能够减少管控平台至网络设备同步的数据量,且网络设备只需对差异部分进行配置即可,减少网络设备的业务进行变动后的配置时间,减小耗时,降低对业务的影响;另一方面,对配置信息的复杂程度没有限定,可支持任意简单或复杂的网络设备的配置进行处理。According to the method and device for synchronizing configuration information of network equipment in the SD-WAN system provided by the present invention, when the operation or management personnel configures the network equipment on the management and control platform, the configuration information is written into the configuration database, and then according to the configuration information in the configuration database Configure the network device, and record the successful configuration of the network device into the configuration file. When the service configuration of the network device changes, after the management and control platform updates the configuration information in the configuration database in response to the configuration operation, the changed part will also be changed. That is, the difference configuration information is synchronized to the network device. Specifically, the configuration information in the configuration database and the configuration information in the current configuration file are respectively mapped to the configuration tree, and then the difference configuration information is obtained by comparing the nodes of the two configuration trees, and then the following On the one hand, the synchronization method realizes the distribution of different configurations, which can reduce the amount of data synchronized from the management and control platform to the network equipment, and the network equipment only needs to configure the difference parts, reducing the business changes of the network equipment. On the other hand, there is no limit to the complexity of the configuration information, and any simple or complex network device configuration can be supported for processing.
附图说明Description of drawings
图1为本发明实施例一提供的SD-WAN系统中的网络设备的配置信息同步方法流程图;1 is a flowchart of a method for synchronizing configuration information of a network device in an SD-WAN system according to
图2为本发明实施例中配置树的示意图;2 is a schematic diagram of a configuration tree in an embodiment of the present invention;
图3为本发明实施例二提供的SD-WAN系统中的网络设备的配置信息同步方法和装置的框图;3 is a block diagram of a method and apparatus for synchronizing configuration information of a network device in an SD-WAN system according to
图4为本发明实施例三提供的SD-WAN系统中的网络设备的配置信息同步方法的流程图;4 is a flowchart of a method for synchronizing configuration information of a network device in an SD-WAN system according to Embodiment 3 of the present invention;
图5为本发明实施例四提供的SD-WAN系统中的网络设备的配置信息同步方法的流程图;5 is a flowchart of a method for synchronizing configuration information of a network device in an SD-WAN system according to Embodiment 4 of the present invention;
图6为本发明实施例提供的moc类的结构示意图;6 is a schematic structural diagram of a moc class provided by an embodiment of the present invention;
图7为本发明实施例提供的moc容器类结构示意图;FIG. 7 is a schematic structural diagram of a moc container class provided by an embodiment of the present invention;
图8为本发明实施例提供的moi数据实例的结构示意图;8 is a schematic structural diagram of a moi data instance provided by an embodiment of the present invention;
图9为本发明实施例提供的生成配置树的示意图;9 is a schematic diagram of generating a configuration tree according to an embodiment of the present invention;
图10为本发明实施例五提供的SD-WAN系统中的网络设备的配置信息同步装置的框图;10 is a block diagram of an apparatus for synchronizing configuration information of a network device in an SD-WAN system according to Embodiment 5 of the present invention;
图11为本发明实施例六提供的计算机设备的硬件结构图。FIG. 11 is a hardware structural diagram of a computer device according to Embodiment 6 of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明提供了一种SD-WAN系统中的网络设备的配置信息同步方法、装置、计算机设备和计算机可读存储介质。在该SD-WAN系统中,SD-WAN系统包括管控平台和网络设备,管控平台将配置信息下发至网络设备,对网络设备进行配置,其中配置信息包括若干配置,每个配置包括若干配置项。运营或管理人员在管控平台对网络设备进行配置时,将配置信息写入配置数据库,然后根据配置数据库中的配置信息对网络设备进行配置,并将网络设备配置成功的配置记入配置文件,当某网络设备的业务配置发生变化时,配置数据库中该网络设备的配置信息被修改,此时,管控平台获取配置数据库中已经发生变化的配置信息,得到第一配置信息,并将第一配置信息按照配置间的引用关系生成第一配置树,获取当前网络设备的配置文件中的配置信息,得到第二配置信息,将第二配置信息按照配置间的引用关系生成第二配置树;然后通过比对第一配置树和第二配置树的所有节点,得到差异配置信息,最后将差异配置信息下发至网络设备。通过本发明,当网络设备的业务配置发生变化时,分别根据配置数据库和配置文件中的配置信息构建配置树,将两颗配置树进行比对而得到差异配置信息,最终只需要将差异配置信息下发至网络设备即可,减少管控平台至网络设备同步的数据量,且网络设备只需对差异部分进行配置即可,减少网络设备的业务进行变动后的配置时间,减小耗时,降低对业务的影响。The present invention provides a configuration information synchronization method, apparatus, computer equipment and computer-readable storage medium of network equipment in an SD-WAN system. In this SD-WAN system, the SD-WAN system includes a management and control platform and a network device. The management and control platform sends configuration information to the network device and configures the network device. The configuration information includes several configurations, and each configuration includes several configuration items. . When the operation or management personnel configure the network device on the management and control platform, the configuration information is written into the configuration database, and then the network device is configured according to the configuration information in the configuration database, and the successful configuration of the network device is recorded in the configuration file. When the service configuration of a certain network device changes, the configuration information of the network device in the configuration database is modified. At this time, the management and control platform obtains the changed configuration information in the configuration database, obtains the first configuration information, and uses the first configuration information. Generate the first configuration tree according to the reference relationship between the configurations, obtain the configuration information in the configuration file of the current network device, obtain the second configuration information, and generate the second configuration tree according to the reference relationship between the configurations according to the second configuration information; For all the nodes of the first configuration tree and the second configuration tree, the difference configuration information is obtained, and finally the difference configuration information is delivered to the network device. Through the present invention, when the service configuration of the network device changes, the configuration tree is constructed according to the configuration information in the configuration database and the configuration file, respectively, and the difference configuration information is obtained by comparing the two configuration trees, and finally only the difference configuration information is needed. It can be sent to the network device, which reduces the amount of data synchronized between the management and control platform and the network device, and the network device only needs to configure the difference part, which reduces the configuration time after the service of the network device is changed, reduces the time consumption, and reduces the Impact on business.
关于本发明提供的SD-WAN系统中的网络设备的配置信息同步方法、装置、计算机设备和计算机可读存储介质的具体实施例,将在下文中详细描述。The specific embodiments of the method, apparatus, computer device, and computer-readable storage medium for synchronizing configuration information of network devices in the SD-WAN system provided by the present invention will be described in detail below.
实施例一Example 1
本发明实施例一提供了一种SD-WAN系统中的网络设备的配置信息同步方法,SD-WAN系统包括管控平台和若干网络设备,管控平台向网络设备同步配置信息,通过该方法,能够在网络设备的业务配置发生变化时,仅将发生变化的差异配置同步至网络设备,具体地,图1为本发明实施例一提供的SD-WAN系统中的网络设备的配置信息同步方法流程图,如图1所示,该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法包括如下的步骤S101至步骤S106。
步骤S101:获取配置数据库中存储的网络设备的配置信息,得到第一配置信息。Step S101: Acquire the configuration information of the network device stored in the configuration database to obtain the first configuration information.
管控平台包括后端和提供用户交互界面的前端,用户可在交互界面上对SD-WAN系统中的网络设备的组网关系和业务等方面进行配置,后端根据用户的输入生成配置信息修改配置数据库中的配置信息,然后将配置信息同步至网络设备,同时在管控平台一侧存储完成配置的配置信息,也即配置文件,其中,配置信息包括若干配置,每个配置包括若干配置项。当用户需要对网络设备的业务配置等进行更改时,也可在交互界面上进行修改操作,后端根据用户输入的内容修改配置数据库中的配置信息。The management and control platform includes a back-end and a front-end that provides a user interactive interface. Users can configure the networking relationship and business of the network devices in the SD-WAN system on the interactive interface. The back-end generates configuration information and modifies the configuration according to the user's input. The configuration information in the database is then synchronized to the network device. At the same time, the configured configuration information, that is, the configuration file, is stored on the management and control platform side. The configuration information includes several configurations, and each configuration includes several configuration items. When the user needs to modify the service configuration of the network device, etc., the modification operation can also be performed on the interactive interface, and the back end modifies the configuration information in the configuration database according to the content input by the user.
可选地,配置信息为json文件,json文件包括json数据,其中,每个配置为一个json数据,每个配置项为json数据中的一个参数。Optionally, the configuration information is a json file, and the json file includes json data, wherein each configuration is a piece of json data, and each configuration item is a parameter in the json data.
在该步骤中,管控平台获取本地侧存储的该网络设备的配置信息,将获取到的配置信息定义为第一配置信息。In this step, the management and control platform acquires the configuration information of the network device stored on the local side, and defines the acquired configuration information as the first configuration information.
步骤S102:将第一配置信息按照配置间的引用关系生成第一配置树。Step S102: Generate a first configuration tree from the first configuration information according to the reference relationship between the configurations.
配置信息包括多个配置,在形成配置树之后,每个配置对应配置树中的一个节点,也即节点与配置一一对应,配置之间存在的引用关系限定配置树中节点的位置和相关关系。例如,配置信息包括安全策略配置、地址组配置和地址配置,在配置树中分别对应一个节点,同时,基于安全策略配置引用地址组配置,地址组配置引用地址配置的关系,安全策略配置对应的节点引用地址组配置对应的节点,地址组配置对应的节点引用地址配置的节点。The configuration information includes multiple configurations. After the configuration tree is formed, each configuration corresponds to a node in the configuration tree, that is, the node corresponds to the configuration one-to-one. The reference relationship between the configurations defines the location and correlation of the nodes in the configuration tree. . For example, the configuration information includes security policy configuration, address group configuration, and address configuration, each of which corresponds to a node in the configuration tree. At the same time, the address group configuration is referenced based on the security policy configuration, the address group configuration refers to the relationship of the address configuration, and the security policy configuration corresponds to The node refers to the node corresponding to the address group configuration, and the node corresponding to the address group configuration refers to the node configured for the address.
图2为本发明实施例中配置树的示意图,如图2所示,以配置树为第一配置树为例,配置树的根节点Dev为配置树的树根,各个叶子节点的父节点,标识网络设备的业务策略的集合,也即配置信息,将某一台网络设备的全部业务配置抽象为一颗配置树之后,该配置树下所有的配置都属于该网络设备。配置树包括14个叶子节点,其中,共有3个第一层叶子节点,每个第一层叶子节点对应一种业务策略类型,不同的第一层叶子节点可以对应同一种业务策略类型,其中,如图2所示,第一层叶子节点Policy-1对应网络设备的一种安全策略,网络设备的安全策略可以包括多种,相应地,第一层叶子节点还可以包括Policy-2,Policy-3等;请继续参考图2,第一层叶子节点PBR-1为路由策略,其作用在于对内部地址外出访问互联网或其他网络时,进行外出线路选择,例如其应用环境为:在网络设备实现多链路接入应用并有负载分配需求时,对内部网络IP地址的外出访问互联网时按照指定方式的外出链路选择,网络设备的路由策略可以包括多种,相应地,第一层叶子节点还可以包括PBR-2,PBR-3等;请继续参考图2,第一层叶子节点SNAT-1为源NAT策略,其作用在于局域网内终端设备在访问一个外网地址时,将源地址转换成网络设备上的地址,然后通过网络设备去访问外网,在请求回复的时候,网络设备能够确定该访问所对应的局域网内的终端设备,使得局域网内的终端设备的地址不会暴露至外网,网络设备的源NAT策略可以包括多种,相应地,第一层叶子节点还可以包括SNAT-2,SNAT-3等。2 is a schematic diagram of a configuration tree in an embodiment of the present invention. As shown in FIG. 2, taking the configuration tree as the first configuration tree as an example, the root node Dev of the configuration tree is the root of the configuration tree, and the parent node of each leaf node, A set of service policies that identify a network device, that is, configuration information. After all service configurations of a certain network device are abstracted into a configuration tree, all configurations in the configuration tree belong to the network device. The configuration tree includes 14 leaf nodes, of which there are 3 first-layer leaf nodes, each first-layer leaf node corresponds to a service policy type, and different first-layer leaf nodes can correspond to the same service policy type, among which, As shown in Figure 2, the first-layer leaf node Policy-1 corresponds to a security policy of a network device, and the network device's security policy may include multiple types. Correspondingly, the first-layer leaf node may also include Policy-2, Policy- 3, etc.; please continue to refer to Figure 2, the first layer leaf node PBR-1 is a routing policy, and its function is to select the outgoing line when the internal address goes out to access the Internet or other networks, for example, its application environment is: When a multi-link access application has a load distribution requirement, the outgoing link is selected according to a specified method when the internal network IP address goes out to access the Internet. The routing strategy of the network device can include multiple types. Correspondingly, the first-layer leaf node It can also include PBR-2, PBR-3, etc.; please continue to refer to Figure 2, the first-layer leaf node SNAT-1 is a source NAT policy, and its function is to translate the source address when the terminal device in the local area network accesses an external network address. Then the network device can access the external network through the network device. When requesting a reply, the network device can determine the terminal device in the local area network corresponding to the access, so that the address of the terminal device in the local area network will not be exposed to the outside world. The source NAT policy of the network device may include multiple types. Correspondingly, the first-layer leaf node may also include SNAT-2, SNAT-3, and so on.
如图2所示,第一层叶子节点Policy-1引用叶子节点URL-PE-1,叶子节点URL-PE-1为URL安全配置文件,叶子节点ADDr-grp-1为安全策略中的地址组,叶子节点ADDr-1为地址组中的地址,叶子节点APP-1为安全策略和路由策略中的应用,叶子节点TUN-Inf-tun-1为路由策略中的隧道接口、叶子节点User-1为路由策略中的服务用户、叶子节点IPSec-1为路由策略中的隧道、叶子节点IKE-1为IKE网关、叶子节点IPSec-Prop-1为IPSec提议、叶子节点Inf-ge1为隧道的物理口、叶子节点IKE-Prop-1为IKE提议。As shown in Figure 2, the first-layer leaf node Policy-1 refers to the leaf node URL-PE-1, the leaf node URL-PE-1 is the URL security configuration file, and the leaf node ADDr-grp-1 is the address group in the security policy , the leaf node ADDr-1 is the address in the address group, the leaf node APP-1 is the application in the security policy and routing policy, the leaf node TUN-Inf-tun-1 is the tunnel interface in the routing policy, and the leaf node User-1 is the service user in the routing policy, the leaf node IPSec-1 is the tunnel in the routing policy, the leaf node IKE-1 is the IKE gateway, the leaf node IPSec-Prop-1 is the IPSec proposal, and the leaf node Inf-ge1 is the physical port of the tunnel , the leaf node IKE-Prop-1 is an IKE proposal.
步骤S103:获取网络设备的配置文件中的配置信息,得到第二配置信息。Step S103: Obtain the configuration information in the configuration file of the network device to obtain the second configuration information.
管控平台读取本地存储的网络设备的配置文件中的配置信息,该处定义为第二配置信息,该配置信息与配置数据库中的配置信息可以采用相同的数据结构,例如配置文件中所包括的配置与配置数据库中的配置为采用相同的jsonschema文件约束定义的json数据。The management and control platform reads the configuration information in the configuration file of the network device stored locally, which is defined as the second configuration information. The configuration information and the configuration information in the configuration database can use the same data structure, for example, the configuration file includes The configuration is configured with the json data defined in the configuration database using the same jsonschema file constraints.
步骤S104:将第二配置信息按照配置间的引用关系生成第二配置树。Step S104: Generate a second configuration tree from the second configuration information according to the reference relationship between the configurations.
关于第二配置树可参考附图2及上文的相关描述,该处不再赘述。For the second configuration tree, reference may be made to FIG. 2 and the above related descriptions, which will not be repeated here.
步骤S105:通过比对第一配置树和第二配置树的所有节点,得到差异配置信息。Step S105: Obtain differential configuration information by comparing all nodes of the first configuration tree and the second configuration tree.
可选地,从配置树的根节点、第一层叶子节点、第二层叶子节点…直到最后一层叶子节点进行比对,得到差异配置信息。Optionally, the comparison is performed from the root node of the configuration tree, the leaf nodes of the first layer, the leaf nodes of the second layer... to the leaf nodes of the last layer, and the difference configuration information is obtained.
其中,差异配置信息包括若干差异配置,差异配置包括删除配置、新增配置和修改配置,具体地,删除配置为网络设备侧需要删除的配置,新增配置为网络设备侧需要新增的配置,修改配置为网络设备侧需要修改部分配置项、增加部分配置项或删除部分配置项的配置。The differential configuration information includes several differential configurations, and the differential configuration includes deletion configuration, new configuration, and modified configuration. Specifically, the deletion configuration is the configuration that needs to be deleted on the network device side, and the newly added configuration is the configuration that needs to be added on the network device side. To modify the configuration, you need to modify some configuration items, add some configuration items, or delete some configuration items on the network device side.
步骤S106:将差异配置信息下发至网络设备。Step S106: Deliver the differential configuration information to the network device.
采用该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法,运营或管理人员在管控平台对网络设备进行配置时,将配置信息写入配置数据库,然后根据配置数据库中的配置信息对网络设备进行配置,并将网络设备配置成功的配置记入配置文件,当网络设备的业务配置发生变化时,管控平台响应配置操作更新配置数据库中的配置信息后,将发生变化的部分,也即差异配置信息同步至网络设备,具体地,将配置数据库中的配置信息和当前配置文件中的配置信息分别映射为配置树,然后通过比对两颗配置树的节点得到差异配置信息,进而下发至网络设备,一方面,该同步方法实现了差异配置下发,能够减少管控平台至网络设备同步的数据量,且网络设备只需对差异部分进行配置即可,减少网络设备的业务进行变动后的配置时间,减小耗时,降低对业务的影响;另一方面,在传统的SDN体系中,一般是由交换机或者路由器来充当网络设备进行组网,所有的数据都以“流”为单位进行处理,在该类型的网络设备中,流表的生成、维护、下发都由SDN控制器来实现,每一张流表都有详细的流表项,每一个流表项中都有相应参数,基于OpenFlow协议下发配置信息,而基于OpenFlow协议的方法只能下发流表中支持的配置项。在SD-WAN系统中,网络设备中的支持的策略、对象、隧道组网、qos等功能越来越复杂,基于OpenFlow协议下发配置信息的方法已经无法适应复杂化配置的网络设备,也即无法通过OpenFlow协议进行下发,而该实施例提供的同步方法,对配置信息的复杂程度没有限定,可对任意简单或复杂的网络设备的配置进行处理。Using the method for synchronizing configuration information of network devices in the SD-WAN system provided by this embodiment, when the operation or management personnel configures the network devices on the management and control platform, the configuration information is written into the configuration database, and then the configuration information in the configuration database is used according to the configuration information in the configuration database. Configure the network device, and record the successful configuration of the network device into the configuration file. When the service configuration of the network device changes, after the management and control platform updates the configuration information in the configuration database in response to the configuration operation, the changed part will also be changed. That is, the difference configuration information is synchronized to the network device. Specifically, the configuration information in the configuration database and the configuration information in the current configuration file are respectively mapped to the configuration tree, and then the difference configuration information is obtained by comparing the nodes of the two configuration trees, and then the following On the one hand, the synchronization method realizes the distribution of different configurations, which can reduce the amount of data synchronized from the management and control platform to the network equipment, and the network equipment only needs to configure the difference parts, reducing the business changes of the network equipment. On the other hand, in the traditional SDN system, switches or routers are generally used as network devices for networking, and all data is based on "flow". In this type of network equipment, the generation, maintenance, and distribution of flow tables are all implemented by the SDN controller. Each flow table has detailed flow entries, and each flow entry has corresponding parameters. , the configuration information is delivered based on the OpenFlow protocol, while the method based on the OpenFlow protocol can only deliver the configuration items supported in the flow table. In the SD-WAN system, the supported policies, objects, tunnel networking, qos and other functions in network devices are becoming more and more complex, and the method of delivering configuration information based on the OpenFlow protocol has been unable to adapt to network devices with complex configurations, that is, It cannot be delivered through the OpenFlow protocol, and the synchronization method provided in this embodiment has no limit to the complexity of the configuration information, and can process the configuration of any simple or complex network device.
实施例二
在上述实施例一的基础上,本发明实施例二提供了一种优选的SD-WAN系统中的网络设备的配置信息同步方法,相同的技术特征在该实施例中仅做简要描述,详细可参考上述实施例一。具体地,图3为本发明实施例二提供的SD-WAN系统中的网络设备的配置信息同步方法的流程图,如图3所示,该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法包括如下的步骤S201至步骤S209。On the basis of the above-mentioned first embodiment, the second embodiment of the present invention provides a preferred method for synchronizing configuration information of network devices in an SD-WAN system. The same technical features are only briefly described in this embodiment, and details can be Refer to
步骤S201:获取配置数据库中存储的网络设备的配置信息,得到第一配置信息。Step S201: Acquire the configuration information of the network device stored in the configuration database to obtain the first configuration information.
其中,配置信息包括若干配置,每个配置包括若干配置项。The configuration information includes several configurations, and each configuration includes several configuration items.
步骤S202:将第一配置信息按照配置间的引用关系生成第一配置树。Step S202: Generate a first configuration tree from the first configuration information according to the reference relationship between the configurations.
其中,第一配置树的每个节点对应第一配置信息中的一个配置。Wherein, each node of the first configuration tree corresponds to a configuration in the first configuration information.
步骤S203:获取网络设备的配置文件中的配置信息,得到第二配置信息。Step S203: Acquire the configuration information in the configuration file of the network device to obtain the second configuration information.
步骤S204:将第二配置信息按照配置间的引用关系生成第二配置树。Step S204: Generate a second configuration tree from the second configuration information according to the reference relationship between the configurations.
其中,第二配置树的每个节点对应第二配置信息中的一个配置。Wherein, each node of the second configuration tree corresponds to a configuration in the second configuration information.
步骤S205:通过比对第一配置树和第二配置树的所有节点,得到差异配置信息。Step S205: Obtain difference configuration information by comparing all nodes of the first configuration tree and the second configuration tree.
其中,差异配置信息包括若干差异配置。The differential configuration information includes several differential configurations.
步骤S206:将失败记录中的差异配置写入差异配置信息,清空失败记录。Step S206: Write the difference configuration in the failure record into the difference configuration information, and clear the failure record.
管控平台侧设置对应网络设备的失败记录,用于记录执行失败的差异配置,在比对配置树得到差异配置信息后,同时获取失败记录中的差异配置,写入差异配置信息后一并下发至网络设备。The failure record of the corresponding network device is set on the management and control platform side, which is used to record the difference configuration that fails to execute. After comparing the configuration tree to obtain the difference configuration information, the difference configuration in the failure record is obtained at the same time, and the difference configuration information is written and delivered together. to the network device.
步骤S207:将差异配置信息下发至网络设备。Step S207: Deliver the differential configuration information to the network device.
网络设备接收到差异配置信息后,按照差异配置信息中的每个差异配置分别进行配置处理,并将针对每个差异配置的配置执行结果反馈至管控设备。After receiving the differential configuration information, the network device performs configuration processing according to each differential configuration in the differential configuration information, and feeds back the configuration execution result for each differential configuration to the management and control device.
步骤S208:接收网络设备反馈的针对每个差异配置的配置执行结果。Step S208: Receive a configuration execution result for each differential configuration fed back by the network device.
步骤S209:当配置执行结果为执行失败时,将失败的差异配置记入失败记录,并展示失败原因,当配置执行结果为执行成功时,将成功的差异配置更新至配置文件。Step S209 : when the configuration execution result is that the execution fails, record the failed differential configuration in the failure record, and display the failure reason, and when the configuration execution result is that the execution is successful, update the successful differential configuration to the configuration file.
其中,将执行失败的差异配置记入失败记录,在下一次向网络设备下发配置信息时,将失败记录中的差异配置再次下发;将执行成功的差异配置记入配置文件,保证当前配置文件中的配置与网络设备实际的配置一致。Among them, the difference configuration that fails to be executed is recorded in the failure record, and when the configuration information is delivered to the network device next time, the difference configuration in the failure record is issued again; the difference configuration that is successfully executed is recorded in the configuration file to ensure the current configuration file. The configuration in is consistent with the actual configuration of the network device.
采用该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法,针对网络设备执行失败的差异配置,设置失败记录,每次下发差异配置信息前,先将失败记录中上一次执行失败的差异配置写入差异配置信息,实现再次下发,每次下发差异配置信息后,将执行失败的差异配置写入失败记录,以供再次下发,从而保证了配置信息的完整下发;将执行成功的差异配置记入配置文件,保证当前配置文件中的配置与网络设备实际的配置一致,从而当网络设备的配置每次需要更改时,均能够通过比对配置数据库中的配置信息和配置文件中的配置信息实现差异化配置的下发。By adopting the method for synchronizing configuration information of network devices in the SD-WAN system provided by this embodiment, a failure record is set for the differential configuration that fails to be performed by the network device. The failed differential configuration is written into the differential configuration information to implement re-delivery. After each differential configuration information is delivered, the failed differential configuration is written into the failure record for re-delivery, thus ensuring the complete delivery of the configuration information. ; Record the successfully executed differential configuration into the configuration file to ensure that the configuration in the current configuration file is consistent with the actual configuration of the network device, so that each time the configuration of the network device needs to be changed, the configuration information in the configuration database can be compared and the configuration information in the configuration file to deliver differentiated configurations.
实施例三Embodiment 3
在上述实施例一的基础上,本发明实施例三提供了一种优选的SD-WAN系统中的网络设备的配置信息同步方法,相同的技术特征在该实施例中仅做简要描述,详细可参考上述实施例一。具体地,图4为本发明实施例三提供的SD-WAN系统中的网络设备的配置信息同步方法的流程图,如图4所示,该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法包括如下的步骤S301至步骤S311。On the basis of the above-mentioned first embodiment, the third embodiment of the present invention provides a preferred method for synchronizing configuration information of network devices in an SD-WAN system. The same technical features are only briefly described in this embodiment. Refer to
步骤S301:获取配置数据库中存储的网络设备的配置信息,得到第一配置信息。Step S301: Acquire the configuration information of the network device stored in the configuration database to obtain the first configuration information.
其中,配置信息包括若干配置,每个配置包括若干配置项。The configuration information includes several configurations, and each configuration includes several configuration items.
步骤S302:将第一配置信息按照配置间的引用关系生成第一配置树。Step S302: Generate a first configuration tree from the first configuration information according to the reference relationship between the configurations.
其中,第一配置树的每个节点对应第一配置信息中的一个配置。Wherein, each node of the first configuration tree corresponds to a configuration in the first configuration information.
步骤S303:获取网络设备的配置文件中的配置信息,得到第二配置信息。Step S303: Acquire the configuration information in the configuration file of the network device to obtain the second configuration information.
步骤S304:将第二配置信息按照配置间的引用关系生成第二配置树。Step S304: Generate a second configuration tree from the second configuration information according to the reference relationship between the configurations.
其中,第二配置树的每个节点对应第二配置信息中的一个配置。Wherein, each node of the second configuration tree corresponds to a configuration in the second configuration information.
配置用于对网络设备的业务属性进行限定,且配置信息为json文件,json文件包括json数据,配置为json数据,json数据根据json schema文件约束和定义。对于步骤S302和步骤S303,在将配置信息按照配置间的引用关系生成配置树时,可具体执行如下的步骤:The configuration is used to limit the service attributes of the network device, and the configuration information is a json file. The json file includes json data, and the configuration is json data. The json data is constrained and defined according to the json schema file. For steps S302 and S303, when generating a configuration tree from the configuration information according to the reference relationship between the configurations, the following steps may be specifically performed:
步骤S31:将配置信息的json schema文件映射为类结构,类结构能够标识网络设备的各属性之间的引用关系和属性的值应遵守的规则。Step S31: Map the json schema file of the configuration information into a class structure, and the class structure can identify the reference relationship between the attributes of the network device and the rules that the attribute values should abide by.
预设类结构,该类结构就是json schema文件的payhon表示。可选地,配置数据库中的配置和配置文件中的配置为采用提前定义好的、相同的jsonschema文件约束和定义的json数据,该json schema文件存储于管控平台,当管控平台中对应下发配置信息至网络设备的控制器启动时,将该json schema文件映射为相应的类结构,存储在缓存中。The default class structure, which is the payhon representation of the json schema file. Optionally, the configuration in the configuration database and the configuration in the configuration file use the json data defined in advance and the same jsonschema file constraints and definitions, the json schema file is stored in the management and control platform, and the corresponding configuration is issued in the management and control platform. When the controller of the information to the network device starts, the json schema file is mapped to the corresponding class structure and stored in the cache.
可选地,在一种实施例中,将类结构定义为moc类,moc类中,基类包括的参数和方法如下:Optionally, in an embodiment, the class structure is defined as a moc class. In the moc class, the parameters and methods included in the base class are as follows:
name:moc的名称,也即就是所描述的对象类型。name: The name of the moc, which is the type of object being described.
primary_key:标识对应json数据中该字段为主键,唯一标识一个对象。primary_key: identifies the field in the corresponding json data as the primary key, uniquely identifying an object.
attributes:moc的第一层属性描述,是一个复杂属性。Attributes: The first-level attribute description of moc, which is a complex attribute.
attr_name_stack:moc属性名称集合。attr_name_stack: moc attribute name collection.
attr_name_for_reference_moc:moc属性引用集合。attr_name_for_reference_moc: moc attribute reference collection.
get_primary_key():获得moc中记录的primary_key字段。get_primary_key(): Get the primary_key field recorded in the moc.
build_attr_name_stack():获取moc中attr_name_stack的函数。build_attr_name_stack(): The function to get attr_name_stack in moc.
子类包括的方法如下:The subclass includes the following methods:
dict:all_mocs:key为moc name,value为对应moc的字典。dict:all_mocs: The key is the moc name, and the value is the dictionary corresponding to the moc.
func:__init_:调用parse_one_file函数依次将schemas解析为moc,存放在all_mocs字典中。func:__init_: Call the parse_one_file function to parse the schemas into moc in turn, and store them in the all_mocs dictionary.
func:parse_one_file:1、获取schema描述的对象类型,设置moc的名称和primary_key;2、调用parse_items函数解析schema中的各个属性;3、根据解析结果,设置moc中的attributes字典。func:parse_one_file: 1. Get the object type described by the schema, and set the moc name and primary_key; 2. Call the parse_items function to parse each attribute in the schema; 3. Set the attributes dictionary in the moc according to the parsing result.
func:parse_items:1、根据该层属性的类型,判别属性为简单属性还是复杂属性,目前array和object类型为复杂属性,其它的为简单属性;2、对简单属性,设置简单属性的各种标识、checkRule,并设置引用的moc类型;3、对于复杂属性,递归调用函数,直至所有属性为简单属性。func:parse_items: 1. According to the type of the attribute of this layer, determine whether the attribute is a simple attribute or a complex attribute. At present, the array and object types are complex attributes, and the others are simple attributes; 2. For simple attributes, set various identifiers of simple attributes , checkRule, and set the referenced moc type; 3. For complex attributes, recursively call the function until all attributes are simple attributes.
func:parse_constraints:1、解析简单属性的约束条件组合,挑出当前支持的约束检查项,用来初始化简单属性的checkRule类,例如通过stringCheck类,支持字符串长度和模式的检查。func:parse_constraints: 1. Parse the constraint combination of simple attributes, pick out the currently supported constraint check items, and use it to initialize the checkRule class of simple attributes. For example, through the stringCheck class, it supports the checking of string length and mode.
步骤S32:解析json数据,根据moc将json数据映射为数据实例。Step S32: Parse the json data, and map the json data to a data instance according to the moc.
可选地,按照预定义的数据格式形成的数据实例moi的结构如下:Optionally, the structure of the data instance moi formed according to the predefined data format is as follows:
type:数据实例所属的对象类型,由json数据获得,可据此确定缓存中对应的moc。type: The object type to which the data instance belongs, obtained from json data, and the corresponding moc in the cache can be determined accordingly.
primary_key:由moc找到数据中哪个字段是ne_id:配置集ID或设备ID。primary_key: which field in the data is found by moc ne_id: configuration set ID or device ID.
attach_type:标识是策略集或配置集的公用对象,或者是远端某台设备上的对象。attach_type: The identifier is a public object of a policy set or configuration set, or an object on a remote device.
parent_moi:引用该对象的父对象的数据实例,只对应于一对一引用的情况。parent_moi: The data instance of the parent object that refers to the object, only corresponds to the case of one-to-one reference.
children_moi:该对象所有所引用对象的数据实例形成的字典,字典的key为children_moi的类型,value为该父对象引用的所有该类型的children_moi组成的字典,该字典的key为每个children_moi的主键的值,value为对应的单个children_moi。children_moi: a dictionary formed by the data instances of all the objects referenced by the object, the key of the dictionary is the type of children_moi, and the value is a dictionary composed of all the children_moi of this type referenced by the parent object, and the key of the dictionary is the primary key of each children_moi value, value is the corresponding single children_moi.
children_attributes:json数据的python表示,相当于对json数据调用了json.loads方法。children_attributes: The python representation of json data, which is equivalent to calling the json.loads method on the json data.
其中,一个moi即为一个类型配置对象的一个数据实例,解析json数据得到。Among them, a moi is a data instance of a type configuration object, obtained by parsing json data.
步骤S33:将配置信息对应的各个moi,根据moi中的引用关系将所有的moi转换为配置树。Step S33: Convert each moi corresponding to the configuration information into a configuration tree according to the reference relationship in the moi.
其中,配置信息对应的各个数据实例为离散的moi,所有离散的moi根据moi中的引用关系组成一个颗moi树,生成的树形结构也即配置树,它包含一个配置信息所需要的所有对象资源的moi,并且能清晰的表明它们之间的层次关系。Among them, each data instance corresponding to the configuration information is a discrete moi, and all the discrete moi form a moi tree according to the reference relationship in the moi. The generated tree structure is also a configuration tree, which contains all the objects required by a configuration information. Moi of resources, and can clearly indicate the hierarchical relationship between them.
步骤S305:将第一配置树所有的第一层叶子节点组成第一集合,将第二配置树的所有的第一层叶子节点组成第二集合。Step S305: Compose all the first-level leaf nodes of the first configuration tree into a first set, and combine all the first-level leaf nodes of the second configuration tree into a second set.
步骤S306:循环第一集合中的所有配置,根据第一集合中第一配置的配置标识判断第二集合中是否存在第一配置,如果第二集合中不存在第一配置,则第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置为新增配置,如果第二集合中存在第一配置,将第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置组成第三集合,将第一配置和第二配置树中第一配置所在节点的所有分支节点对应的配置组成第四集合;Step S306: Circulate all configurations in the first set, and determine whether the first configuration exists in the second set according to the configuration identifier of the first configuration in the first set. If the first configuration does not exist in the second set, the first configuration and the The configurations corresponding to all branch nodes of the node where the first configuration is located in the first configuration tree are newly added configurations. If the first configuration exists in the second set, the first configuration and all branches of the node where the first configuration is located in the first configuration tree are combined. The configurations corresponding to the nodes form a third set, and the configurations corresponding to all branch nodes of the nodes where the first configuration is located in the first configuration and the second configuration tree form a fourth set;
步骤S307:循环第二集合的中所有配置,根据第二集合的第二配置的配置标识判断第一集合中是否存在第二配置,如果第一集合中不存在第二配置,则第二配置和第二配置树中第二配置所在节点的所有分支节点对应的配置为删除配置;Step S307: Circulate all configurations in the second set, and determine whether there is a second configuration in the first set according to the configuration identifier of the second configuration in the second set. If the second configuration does not exist in the first set, the second configuration and The configuration corresponding to all branch nodes of the node where the second configuration is located in the second configuration tree is the deletion configuration;
步骤S308:循环第三集合中的所有配置,根据第三集合中第三配置的配置标识判断第四集合中是否存在第三配置,如果第四集合中不存在第三配置,则第三配置为新增配置,如果第四集合中存在第三配置,将第三集合中的第三配置和第四集合中的第三配置的每个配置项进行比对,若存在任意一个或多个配置项不同,则第三配置为修改配置;Step S308: Circulate all configurations in the third set, and determine whether there is a third configuration in the fourth set according to the configuration identifier of the third configuration in the third set. If the third configuration does not exist in the fourth set, the third configuration is: Add a new configuration. If there is a third configuration in the fourth set, compare the third configuration in the third set with each configuration item of the third configuration in the fourth set. If there are any one or more configuration items If different, the third configuration is to modify the configuration;
步骤S309:循环第四集合的中所有配置,根据第四集合的第四配置的配置标识判断第三集合中是否存在第四配置,如果第三集合中不存在第四配置,则第四配置为删除配置。Step S309: Circulate all configurations in the fourth set, and determine whether there is a fourth configuration in the third set according to the configuration identifier of the fourth configuration in the fourth set. If the fourth configuration does not exist in the third set, the fourth configuration is: Delete configuration.
步骤S310:利用新增配置、修改配置和删除配置形成差异配置信息,按照新增配置、修改配置和删除配置的先后顺序,对差异配置信息中的配置进行排序。Step S310 : Use newly added configuration, modified configuration and deleted configuration to form differential configuration information, and sort the configurations in the differential configuration information according to the sequence of newly added configuration, modified configuration and deleted configuration.
步骤S311:将差异配置信息下发至网络设备。Step S311: Deliver the differential configuration information to the network device.
采用该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法,在管控平台中提前对网络设备的所有业务配置根据json schemas进行约束定义,保证每种类型配置的正确性;管控平台应用程序启动时会根据提前定义的jsonschemas生成相应的moc,存储在缓存中;当管控平台中网络设备的业务配置发生变更时,先分别获取配置数据库和管控平台本地存储的此网络设备的配置文件中的配置信息,根据moc中定义的配置关系生成moi,再将各个moi组成一棵配置相互依赖的配置树,再针对每一类配置,也即从第一层叶子节点开始,进行专门比较,最后得到差异配置组成的差异配置信息,保证在网络设备支持高级功能之后,也能准确的比对出配置差异,并将此配置差异同步到网络设备。可选地,在将差异配置信息中的每类配置根据moi转换成网络设备可识别的json格式,将所有的差异配置存放到一份差异配置文件中,最后通过配置下发通道将差异配置文件下发给网络设备。By adopting the method for synchronizing configuration information of network devices in the SD-WAN system provided by this embodiment, all business configurations of network devices are constrained and defined in advance in the management and control platform according to json schemas to ensure the correctness of each type of configuration; the management and control platform When the application starts, the corresponding moc will be generated according to the pre-defined jsonschemas and stored in the cache; when the business configuration of the network device in the management and control platform changes, the configuration database and the configuration file of the network device stored locally on the management and control platform will be obtained respectively. According to the configuration information in the moc, the moi is generated according to the configuration relationship defined in the moc, and then each moi is formed into a configuration tree whose configuration depends on each other. Finally, the difference configuration information composed of the difference configuration is obtained, which ensures that after the network device supports the advanced function, the configuration difference can be accurately compared and the configuration difference is synchronized to the network device. Optionally, convert each type of configuration in the differential configuration information into a json format recognizable by the network device according to the moi, store all the differential configurations in a differential configuration file, and finally send the differential configuration file through the configuration delivery channel. Delivered to network devices.
实施例四Embodiment 4
本发明实施例四提供了一种SD-WAN系统,该SD-WAN系统包括管控平台和网络设备,在该实施例中,以网络设备为防火墙为例,描述SD-WAN系统中网络设备的配置信息同步的方法,相关技术特征也可参考上述任一实施例,需要说明的是,本发明中的网络设备并不局限于防火墙,还可以为其他通信设备。通过该方法,管控平台对网络设备进行集中管控过程中,每次进行配置下发时根据配置数据库和管控平台本地配置文件中的两份业务配置分别生成不同的配置树,并对两棵配置树进行配置比对,生成增量的网络设备差异配置信息,达到只对增量配置进行同步的目的。具体地,图5为本发明实施例四提供的SD-WAN系统中的网络设备的配置信息同步方法的流程图,如图5所示,该实施例提供的SD-WAN系统中的网络设备的配置信息同步方法包括如下的步骤S401至步骤S414。The fourth embodiment of the present invention provides an SD-WAN system. The SD-WAN system includes a management and control platform and a network device. In this embodiment, the network device is a firewall as an example to describe the configuration of the network device in the SD-WAN system. For the information synchronization method and related technical features, reference may also be made to any of the above-mentioned embodiments. It should be noted that the network device in the present invention is not limited to a firewall, but may also be other communication devices. Through this method, in the process of centralized management and control of network devices by the management and control platform, different configuration trees are generated according to the two business configurations in the configuration database and the local configuration file of the management and control platform each time the configuration is issued, and the two configuration trees are generated. Perform configuration comparison to generate incremental network device difference configuration information, so as to achieve the purpose of only synchronizing the incremental configuration. Specifically, FIG. 5 is a flowchart of a method for synchronizing configuration information of a network device in an SD-WAN system according to Embodiment 4 of the present invention. As shown in FIG. 5 , the network device in the SD-WAN system provided by this embodiment has a The configuration information synchronization method includes the following steps S401 to S414.
步骤S401:管控平台根据设备id和user_id取出配置数据库中此网络设备的配置信息。Step S401: The management and control platform retrieves the configuration information of the network device in the configuration database according to the device id and user_id.
SD-WAN系统中设置存储网络设备配置信息的数据库,也即配置数据库,通过网络设备的设备id和user_id(用户id)可在配置数据库中查找到该网络设备的配置信息。In the SD-WAN system, a database for storing the configuration information of network devices is set, that is, the configuration database. Through the device id and user_id (user id) of the network device, the configuration information of the network device can be found in the configuration database.
步骤S402:管控平台根据配置信息生成db_moi_tree。Step S402: The management and control platform generates a db_moi_tree according to the configuration information.
配置信息包括多个配置,每个配置对应一个json数据,配置信息所对应的jsonschema文件被转化为moc类,图6为本发明实施例提供的moc类的结构示意图,图7为本发明实施例提供的moc容器类结构示意图,如图6和图7所示,每个网络设备的配置信息的jsonschema文件对应一个moc,一个moc就是某类型对象的jsonschema的python结构表示,它表明了某类型对象的属性之间的关系和属性的值应该遵守的规约,解析json schema的全部内容,放到moc容器类中供使用。The configuration information includes multiple configurations, each configuration corresponds to a json data, and the jsonschema file corresponding to the configuration information is converted into a moc class. FIG. 6 is a schematic structural diagram of a moc class provided by an embodiment of the present invention, and FIG. 7 is an embodiment of the present invention. The provided moc container class structure diagram, as shown in Figure 6 and Figure 7, the jsonschema file of the configuration information of each network device corresponds to a moc, and a moc is the python structure representation of the jsonschema of a certain type of object, which indicates a certain type of object The relationship between the attributes and the stipulation that the value of the attribute should abide by, parse the entire content of the json schema, and put it into the moc container class for use.
将每个配置生成moi数据实例,图8为本发明实施例提供的moi数据实例的结构示意图,如图8所示,一个moi就是某个类型配置对象的一个数据实例,根据配置的实际数据解析而成,图9为本发明实施例提供的生成配置树的示意图,如图9所示,所有离散的moi数据实例根据json schema中定义的引用关系组成一棵moi tree,生成类似树形的结构,它包含一个配置集所需要的所有对象资源的moi,并且能清晰的表明他们之间的层次关系。A moi data instance is generated for each configuration, and FIG. 8 is a schematic structural diagram of a moi data instance provided by an embodiment of the present invention. As shown in FIG. 8 , a moi is a data instance of a configuration object of a certain type, and is parsed according to the actual data of the configuration 9 is a schematic diagram of generating a configuration tree provided by an embodiment of the present invention. As shown in FIG. 9, all discrete moi data instances form a moi tree according to the reference relationship defined in the json schema to generate a tree-like structure , which contains the moi of all object resources required by a configuration set, and can clearly indicate the hierarchical relationship between them.
步骤S403:管控平台从本地存储的设备配置文件中取出设备配置信息。Step S403: The management and control platform retrieves the device configuration information from the locally stored device configuration file.
步骤S404:管控平台根据配置信息生成dev_moi_tree。Step S404: The management and control platform generates a dev_moi_tree according to the configuration information.
步骤S405:管控平台基于db_moi_tree和dev_moi_tree生成配置差异信息,包括新增、修改、删除等。Step S405: The management and control platform generates configuration difference information based on db_moi_tree and dev_moi_tree, including adding, modifying, deleting, and the like.
步骤S406:管控平台对生成的差异信息中的差异配置进行排序,新增配置为先,修改配置为次,删除配置再次。Step S406 : The management and control platform sorts the difference configurations in the generated difference information, adding a configuration first, modifying a configuration second, and deleting a configuration again.
moi类型集合中所有节点比对完成后,会生成一份差异配置信息,由于差异配置信息各差异配置之间存在引用关系,网络设备在顺序执行差异配置时,如果删除了被引用的差异配置则会执行失败,添加或修改时如果引用了没有添加的差异配置也会报错,通过对差异配置信息中的差异配置进行排序能够解决上述问题,具体地,由于配置树本身是根据moc中的引用关系生成的,因此在进行排序时不需要关心不同类型配置的前后顺序问题,因此排序的规则可以定义为添加类配置排在最先、修改类配置排在次位,删除类配置排在最后。After the comparison of all nodes in the moi type set is completed, a differential configuration information will be generated. Since there is a reference relationship between the differential configurations in the differential configuration information, when the network device performs the differential configuration in sequence, if the referenced differential configuration is deleted, the referenced differential configuration will be deleted. It will fail to execute, and an error will be reported if the difference configuration that has not been added is referenced when adding or modifying. The above problem can be solved by sorting the difference configuration in the difference configuration information. Specifically, because the configuration tree itself is based on the reference relationship in the moc Therefore, when sorting, you do not need to care about the order of different types of configurations. Therefore, the sorting rules can be defined as adding class configuration first, modifying class configuration second, and deleting class configuration last.
步骤S407:管控平台将差异配置信息转换为防火墙识别的配置结构,如json、xml等。Step S407: The management and control platform converts the differential configuration information into a configuration structure recognized by the firewall, such as json, xml, and the like.
步骤S408:管控平台将差异配置信息写进差异配置文件,并给防火墙发送获取差异配置文件命令。Step S408: The management and control platform writes the differential configuration information into the differential configuration file, and sends a command to obtain the differential configuration file to the firewall.
步骤S409:防火墙收到获取差异配置文件命令后,主动从管控平台获取差异配置文件。Step S409: After receiving the command to obtain the differential configuration file, the firewall actively obtains the differential configuration file from the management and control platform.
步骤S410:防火墙循环执行差异配置文件中每一条差异配置,并将执行结果返回给管控平台。Step S410: The firewall executes each differential configuration in the differential configuration file in a loop, and returns the execution result to the management and control platform.
步骤S411:管控平台循环接收设备配置执行结果,根据返回信息确定是哪条配置的执行结果。Step S411: The management and control platform cyclically receives the device configuration execution result, and determines which configuration execution result is according to the returned information.
步骤S412:管控平台判断执行结果是否正确。Step S412: The management and control platform determines whether the execution result is correct.
步骤S413:如果执行成功,管控平台将本条差异配置更新到配置文件中,保证配置文件中的配置和网络设备侧的真实配置一致。Step S413: If the execution is successful, the management and control platform updates the differential configuration of this article to the configuration file to ensure that the configuration in the configuration file is consistent with the real configuration on the network device side.
步骤S414:如果执行失败,管控平台记录失败信息,并给将配置执行失败原因展示给用户。Step S414: If the execution fails, the management and control platform records the failure information, and displays the reason for the configuration execution failure to the user.
采用该实施例提供的SD-WAN系统,支持云计算的骨干网SD-WAN系统中提供了网络设备,网络设备支持零配置上线,即无需网络管理人员再对单个网络设备进行相关网络配置,全部交由管控平台来对网络设备的配置进行集中管理设置;管控平台对网络设备的配置会进行集中管控,通过本发明,实现了网络设备增量同步配置概念,在每次需要对网络设备进行配置同步时,只针对本次添加、删除或者修改的配置进行下发,其他配置无需下发,每次下发完成后统计配置下发结果,将下发正确的配置同步到配置文件中,记录部分配置下发失败原因,并于下次配置同步时继续下发到网络设备。在实现增量下发时,根据配置数据库和管控平台本地的配置文件中的两份业务配置分别生成不同的配置树,并对两棵配置树进行配置比对,生成增量的网络设备差异配置信息,达到只对增量配置进行同步的目的。With the SD-WAN system provided in this embodiment, network equipment is provided in the SD-WAN system of the backbone network supporting cloud computing, and the network equipment supports zero-configuration online, that is, network administrators do not need to perform relevant network configuration on a single network equipment, all The configuration of the network equipment is handed over to the management and control platform for centralized management and settings; the management and control platform will centrally manage and control the configuration of the network equipment. Through the present invention, the concept of incremental synchronization configuration of the network equipment is realized, and the network equipment needs to be configured every time When synchronizing, only the configuration added, deleted or modified this time will be distributed, and other configurations do not need to be distributed. After each distribution is completed, the configuration distribution results will be counted, and the correct configuration will be synchronized to the configuration file, and the record part will be recorded. Indicates the reason for the failure to deliver the configuration, and continues to deliver it to the network device the next time the configuration is synchronized. When implementing incremental delivery, different configuration trees are generated according to the two service configurations in the configuration database and the local configuration file of the management and control platform, and the configuration of the two configuration trees is compared to generate incremental network device differential configurations. information to achieve the purpose of synchronizing only the incremental configuration.
实施例五Embodiment 5
对应于上述实施例一,本发明实施例五提供了一种SD-WAN系统中的网络设备的配置信息同步装置,图10为本发明实施例五提供的SD-WAN系统中的网络设备的配置信息同步装置的框图,如图10所示,该装置包括:第一获取模块501、第一生成模块502、第二获取模块503、第二生成模块504、第一处理模块505和发送模块506。Corresponding to
其中,第一获取模块501用于获取配置数据库中存储的网络设备的配置信息,得到第一配置信息,其中配置信息包括若干配置,每个配置包括若干配置项;第一生成模块502用于将第一配置信息按照配置间的引用关系生成第一配置树,其中,第一配置树的每个节点对应第一配置信息中的一个配置;第二获取模块503用于获取网络设备的配置文件中的配置信息,得到第二配置信息;第二生成模块504用于将第二配置信息按照配置间的引用关系生成第二配置树,其中,第二配置树的每个节点对应第二配置信息中的一个配置;第一处理模块505用于通过比对第一配置树和第二配置树的所有节点,得到差异配置信息,其中,差异配置信息包括若干差异配置;发送模块506用于将差异配置信息下发至网络设备。Wherein, the first obtaining module 501 is used for obtaining the configuration information of the network device stored in the configuration database to obtain the first configuration information, wherein the configuration information includes several configurations, and each configuration includes several configuration items; the first generating module 502 is used for converting The first configuration information generates a first configuration tree according to the reference relationship between the configurations, wherein each node of the first configuration tree corresponds to a configuration in the first configuration information; the second obtaining module 503 is used to obtain the configuration file of the network device. The second configuration information is obtained, and the second configuration information is obtained; the second generation module 504 is configured to generate the second configuration tree according to the reference relationship between the configurations according to the second configuration information, wherein each node of the second configuration tree corresponds to the second configuration information in the second configuration information. a configuration; the first processing module 505 is used to obtain difference configuration information by comparing all nodes of the first configuration tree and the second configuration tree, wherein the difference configuration information includes several difference configurations; the sending module 506 is used to send the difference configuration The information is sent to the network device.
可选地,在一种实施例中,SD-WAN系统中的网络设备的配置信息同步装置还包括接收模块和第二处理模块,其中,接收模块用于在将差异配置信息下发至网络设备之后,接收网络设备反馈的针对每个差异配置的配置执行结果;第二处理模块用于当配置执行结果为执行失败时,将失败的差异配置记入失败记录,并展示失败原因,当配置执行结果为执行成功时,将成功的差异配置更新至所述配置文件。Optionally, in an embodiment, the apparatus for synchronizing configuration information of the network device in the SD-WAN system further includes a receiving module and a second processing module, wherein the receiving module is used to deliver the difference configuration information to the network device. Afterwards, receive the configuration execution result for each differential configuration fed back by the network device; the second processing module is configured to record the failed differential configuration in the failure record when the configuration execution result is an execution failure, and display the failure reason, when the configuration is executed When the result is that the execution is successful, the successful differential configuration is updated to the configuration file.
可选地,在一种实施例中,SD-WAN系统中的网络设备的配置信息同步装置还包括第三处理模块,第三处理模块用于在将差异配置信息下发至网络设备之前,将失败记录中的差异配置写入差异配置信息,清空失败记录。Optionally, in an embodiment, the apparatus for synchronizing the configuration information of the network device in the SD-WAN system further includes a third processing module, and the third processing module is configured to, before delivering the difference configuration information to the network device, The differential configuration in the failure record is written to the differential configuration information, and the failure record is cleared.
可选地,在一种实施例中,差异配置包括新增配置、修改配置和删除配置,第一处理模块具体执行以下步骤:Optionally, in an embodiment, the differential configuration includes adding a configuration, modifying a configuration, and deleting a configuration, and the first processing module specifically performs the following steps:
将第一配置树所有的第一层叶子节点组成第一集合,将第二配置树的所有的第一层叶子节点组成第二集合;循环第一集合中的所有配置,根据第一集合中第一配置的配置标识判断第二集合中是否存在第一配置,如果第二集合中不存在第一配置,则第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置为新增配置,如果第二集合中存在第一配置,将第一配置和第一配置树中第一配置所在节点的所有分支节点对应的配置组成第三集合,将第一配置和第二配置树中第一配置所在节点的所有分支节点对应的配置组成第四集合;循环第二集合的中所有配置,根据第二集合的第二配置的配置标识判断第一集合中是否存在第二配置,如果第一集合中不存在第二配置,则第二配置和第二配置树中第二配置所在节点的所有分支节点对应的配置为删除配置;循环第三集合中的所有配置,根据第三集合中第三配置的配置标识判断第四集合中是否存在第三配置,如果第四集合中不存在第三配置,则第三配置为新增配置,如果第四集合中存在第三配置,将第三集合中的第三配置和第四集合中的第三配置的每个配置项进行比对,若存在任意一个或多个配置项不同,则第三配置为修改配置;循环第四集合的中所有配置,根据第四集合的第四配置的配置标识判断第三集合中是否存在第四配置,如果第三集合中不存在第四配置,则第四配置为删除配置。All the first-level leaf nodes of the first configuration tree are composed of the first set, and all the first-level leaf nodes of the second configuration tree are composed of the second set; all configurations in the first set are circulated, according to the first set of The configuration identifier of a configuration determines whether the first configuration exists in the second set. If the first configuration does not exist in the second set, the first configuration corresponds to the configuration of all branch nodes of the node where the first configuration is located in the first configuration tree as Add a new configuration. If there is a first configuration in the second set, combine the first configuration and the configurations corresponding to all branch nodes of the node where the first configuration is located in the first configuration tree to form a third set, and combine the first configuration and the second configuration tree The configurations corresponding to all branch nodes of the node where the first configuration is located form a fourth set; all configurations in the second set are circulated, and whether there is a second configuration in the first set is determined according to the configuration identifier of the second configuration in the second set, if If the second configuration does not exist in the first set, then the second configuration and the configuration corresponding to all branch nodes of the node where the second configuration is located in the second configuration tree is the deletion configuration; The configuration identifier of the third configuration determines whether the third configuration exists in the fourth set. If the third configuration does not exist in the fourth set, the third configuration is a newly added configuration. If the third configuration exists in the fourth set, the third configuration is added. The third configuration in the set is compared with each configuration item of the third configuration in the fourth set. If any one or more configuration items are different, the third configuration is the modified configuration; configuration, according to the configuration identifier of the fourth configuration in the fourth set to determine whether the fourth configuration exists in the third set, if the fourth configuration does not exist in the third set, the fourth configuration is to delete the configuration.
可选地,在一种实施例中,SD-WAN系统中的网络设备的配置信息同步装置还包括控制模块,用于控制网络设备按照新增配置、修改配置和删除配置的顺序执行配置。Optionally, in an embodiment, the apparatus for synchronizing configuration information of a network device in the SD-WAN system further includes a control module configured to control the network device to perform configuration in the order of adding configuration, modifying configuration, and deleting configuration.
可选地,在一种实施例中,控制模块通过按照新增配置、修改配置和删除配置的先后顺序,对差异配置信息中的配置进行排序,实现控制网络设备按照新增配置、修改配置和删除配置的顺序执行配置。Optionally, in an embodiment, the control module sorts the configurations in the differential configuration information according to the order of newly added configuration, modified configuration and deleted configuration, so as to control the network device according to the newly added configuration, modified configuration and deleted configuration. The configuration is executed in the order in which the configuration is deleted.
可选地,在一种实施例中,配置用于对网络设备的业务属性进行限定,配置信息为json文件,json文件包括json数据,配置为json数据,第一生成模块和第二生成模块分别具体执行如下的步骤:Optionally, in an embodiment, the configuration is used to define service attributes of the network device, the configuration information is a json file, the json file includes json data, and the configuration is json data, the first generation module and the second generation module are respectively The specific steps are as follows:
将json文件对应的json schema文件映射为类结构,类结构能够标识网络设备的各业务属性之间的引用关系和业务属性的值;解析json数据,根据类结构将json数据映射为数据实例;将配置信息对应的各个数据实例转换为配置树,其中,配置信息为第一配置信息时,配置树为第一配置树,配置信息为第二配置信息时,配置树为第二配置树。Map the json schema file corresponding to the json file into a class structure, which can identify the reference relationship between various service attributes of the network device and the value of the service attribute; parse the json data, and map the json data into data instances according to the class structure; Each data instance corresponding to the configuration information is converted into a configuration tree, wherein when the configuration information is the first configuration information, the configuration tree is the first configuration tree, and when the configuration information is the second configuration information, the configuration tree is the second configuration tree.
实施例六Embodiment 6
本实施例五还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图11所示,本实施例的计算机设备01至少包括但不限于:可通过系统总线相互通信连接的存储器011、处理器012,如图11所示。需要指出的是,图11仅示出了具有组件存储器011和处理器012的计算机设备01,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。The fifth embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a cabinet server that can execute programs (including independent servers, or a server cluster composed of multiple servers), etc. As shown in FIG. 11 , the computer device 01 in this embodiment at least includes but is not limited to: a memory 011 and a processor 012 that can be communicatively connected to each other through a system bus, as shown in FIG. 11 . It should be pointed out that FIG. 11 only shows the computer device 01 having the component memory 011 and the processor 012, but it should be understood that it is not required to implement all the shown components, and more or less may be implemented instead. components.
本实施例中,存储器011(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器011可以是计算机设备01的内部存储单元,例如该计算机设备01的硬盘或内存。在另一些实施例中,存储器011也可以是计算机设备01的外部存储设备,例如该计算机设备01上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器011还可以既包括计算机设备01的内部存储单元也包括其外部存储设备。本实施例中,存储器011通常用于存储安装于计算机设备01的操作系统和各类应用软件,例如实施例四的SD-WAN系统中的网络设备的配置信息同步装置的程序代码等。此外,存储器011还可以用于暂时地存储已经输出或者将要输出的各类数据。In this embodiment, the memory 011 (that is, a readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the memory 011 may be an internal storage unit of the computer device 01 , such as a hard disk or a memory of the computer device 01 . In other embodiments, the memory 011 may also be an external storage device of the computer device 01, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Of course, the memory 011 may also include both the internal storage unit of the computer device 01 and its external storage device. In this embodiment, the memory 011 is generally used to store the operating system and various application software installed in the computer device 01, such as the program code of the configuration information synchronization apparatus of the network device in the SD-WAN system of the fourth embodiment. In addition, the memory 011 can also be used to temporarily store various types of data that have been output or will be output.
处理器012在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器012通常用于控制计算机设备01的总体操作。本实施例中,处理器012用于运行存储器011中存储的程序代码或者处理数据,例如SD-WAN系统中的网络设备的配置信息同步方法等。The processor 012 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 012 is typically used to control the overall operation of the computer device 01 . In this embodiment, the processor 012 is configured to run program codes or process data stored in the memory 011, such as a method for synchronizing configuration information of network devices in the SD-WAN system.
实施例七Embodiment 7
本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于存储SD-WAN系统中的网络设备的配置信息同步装置,被处理器执行时实现实施例一的SD-WAN系统中的网络设备的配置信息同步方法。This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Read-only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc., on which computer programs are stored, When the program is executed by the processor, the corresponding function is realized. The computer-readable storage medium of this embodiment is used to store the configuration information synchronization device of the network device in the SD-WAN system, and when executed by the processor, implements the configuration information synchronization method of the network device in the SD-WAN system of the first embodiment.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910625186.2A CN112217656B (en) | 2019-07-11 | 2019-07-11 | Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910625186.2A CN112217656B (en) | 2019-07-11 | 2019-07-11 | Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112217656A CN112217656A (en) | 2021-01-12 |
CN112217656B true CN112217656B (en) | 2022-08-16 |
Family
ID=74048204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910625186.2A Active CN112217656B (en) | 2019-07-11 | 2019-07-11 | Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112217656B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010230B (en) * | 2021-03-26 | 2024-02-09 | 广州市百果园网络科技有限公司 | Configuration information processing method, device, equipment and storage medium |
CN113542022B (en) * | 2021-07-06 | 2024-07-26 | 深圳市联洲国际技术有限公司 | Networking management method and device of networking system, terminal equipment and storage medium |
CN113535262B (en) * | 2021-07-07 | 2024-03-26 | 曙光信息产业(北京)有限公司 | Proxy node start control method, device, equipment and storage medium |
CN113783734A (en) * | 2021-09-22 | 2021-12-10 | 杭州安恒信息技术股份有限公司 | Configuration data synchronization method, storage medium and related equipment |
CN114245349B (en) * | 2021-12-17 | 2024-12-24 | 中国电信股份有限公司 | A service activation method, device, equipment, and computer-readable storage medium |
CN114490889A (en) * | 2022-01-25 | 2022-05-13 | 成都鼎桥通信技术有限公司 | Configuration information processing method, device, equipment, medium and program product |
CN114500272B (en) * | 2022-02-17 | 2024-01-05 | 中国工商银行股份有限公司 | Configuration information acquisition processing method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102364894B (en) * | 2011-10-21 | 2017-04-12 | 中兴通讯股份有限公司 | Issuing method for configuration data file and network management equipment |
US10116521B2 (en) * | 2015-10-15 | 2018-10-30 | Citrix Systems, Inc. | Systems and methods for determining network configurations using historical real-time network metrics data |
CN109918109B (en) * | 2019-03-12 | 2022-07-19 | 赛特斯信息科技股份有限公司 | System and method for realizing software version smooth upgrading function aiming at SD-WAN system |
-
2019
- 2019-07-11 CN CN201910625186.2A patent/CN112217656B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112217656A (en) | 2021-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112217656B (en) | Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system | |
US10191736B2 (en) | Systems and methods for tracking configuration file changes | |
EP1746767B1 (en) | A method for configuration management to the customer premises equipment and the system thereof | |
US20170163502A1 (en) | Classifier based graph rendering for visualization of a telecommunications network topology | |
EP2178033A1 (en) | Populating a multi-relational enterprise social network with disparate source data | |
US20130144996A1 (en) | Interfacing between a command line interface-based application program and a remote network device | |
CN110324169A (en) | A kind of method and apparatus of interface management | |
CN105117938A (en) | E-commerce framework request data analysis method based on model view controller | |
US10541961B2 (en) | System and method for automating actions in distributed computing | |
JP2006146927A (en) | SNMP-based network management apparatus and method | |
CN110738038A (en) | Contract text generation method, device, equipment and computer readable storage medium | |
CN106257868A (en) | Configuration data push method and device | |
CN111381820A (en) | Method and device for automatically generating API based on GUI | |
CN101170436B (en) | A method for managing template in network management system | |
US20170235785A1 (en) | Systems and Methods for Robust, Incremental Data Ingest of Communications Networks Topology | |
CN101268450A (en) | Generic framework for deploying EMS provisioning services | |
CN110502560A (en) | A kind of method and server of Database Connection Parameters encapsulation | |
CN104022896A (en) | Configuration management method and device and network equipment | |
WO2017141209A1 (en) | Service information model for managing a telecommunications network | |
CN115168365B (en) | Data storage method and device, electronic equipment and storage medium | |
CN117240825A (en) | An address database construction method, device, equipment and medium applied to CDN | |
CN114780432B (en) | Interface testing method, device, equipment and storage medium | |
CN111988179B (en) | A YANG model management system, method and storage medium | |
US11388056B2 (en) | Information management system and information management method | |
CN115603923A (en) | Access Control List (ACL) policy management method, device and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088 Applicant after: QAX Technology Group Inc. Applicant after: Qianxin Wangshen information technology (Beijing) Co.,Ltd. Address before: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088 Applicant before: QAX Technology Group Inc. Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |