Yang module incremental synchronization method and device

CN122994320APending Publication Date: 2026-10-27NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611048845.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]但是采用以上方式进行YANG模块同步,会在每次同步过程中传输所有YANG模块的元数据,数据传输效率低下,且进行YANG模块对比需要消耗大量的计算资源,使得整体的同步延迟高

Benefits of technology

[0093]本申请实施例提供的方案中,网络设备中构建了历史链,其中记录了网络设备中YANG模块集合中每次更新的YANG模块,因此网络设备向网络管理设备发送历史链之后,网络管理设备能够根据历史链确定从网络管理设备所存储的目标版本的YANG模块集合到最新版本的YANG模块集合发生更新的目标YANG模块。因此网络管理设备和网络设备之间仅需要传输记录发生变化的YANG模块的历史链,而无需全量获取最新版本的YANG模块集合的元数据,从而降低YANG模块同步时需要传输的数据量,提高YANG模块同步的数据传输效率,节省计算资源,降低同步延迟。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994320A_ABST
    Figure CN122994320A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of YANG module incremental synchronization method and device, it is related to network technical field, it is applied to network equipment, the above-mentioned method includes: according to the update of the stored YANG module set, construct history chain, the node in history chain sequentially corresponds different YANG module set arranged according to version order, except the node corresponding initial version, other nodes record the YANG module set of the corresponding version and compared with the last version YANG module that update occurs;YANG module synchronization request sent by network management equipment is received;Send history chain to network management equipment;Receive incremental request, and send target YANG module to network management equipment according to incremental request.The scheme provided by the embodiment of the application can improve the data transmission efficiency of YANG module synchronization, save computing resources, reduce synchronization delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technology, and in particular to a YANG module incremental synchronization method and apparatus. Background Technology

[0002] With the rapid development of Software Defined Networking (SDN) and network automation technologies, network management devices need to grasp the capability models of network devices (such as switches and routers) in real time. Yet Another Next Generation (YANG) data modeling language has been widely used in the configuration and status management of network devices. The Internet Engineering Task Force (IETF) defined the YANG Library mechanism in Request For Comments 7895 (RFC 7895) and Request For Comments 8525 (RFC 8525) to allow network management devices that call the Network Configuration Protocol (NETCONF) to discover the YANG modules supported by the network device. Typical network devices maintain a large number of YANG model files; for example, entry-level devices maintain 200-500 YANG modules, while mid-to-high-end devices maintain 500-1000 or more.

[0003] To manage network devices, network management devices need to obtain all YANG modules maintained in the network devices. RFC7895 specifies a complete YANG module discovery mechanism. Whenever the set of YANG modules in a network device changes, the network management device needs to retrieve the metadata of all YANG modules from the network device. The network management module compares the currently stored YANG modules with the newly retrieved YANG modules based on the metadata to determine the YANG modules that have changed. Then, it sends a retrieval request to the network device for the changed YANG modules to update its own stored YANG module set, thereby keeping the YANG modules maintained in both devices synchronized.

[0004] However, using the above method to synchronize YANG modules will transmit the metadata of all YANG modules during each synchronization process, resulting in low data transmission efficiency. Furthermore, comparing YANG modules requires a large amount of computing resources, leading to high overall synchronization latency. Summary of the Invention

[0005] The purpose of this application is to provide a method and apparatus for incremental synchronization of YANG modules, so as to improve the data transmission efficiency of YANG module synchronization, save computing resources, and reduce synchronization latency. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide another incremental synchronization method for YANG modules in a next-generation data modeling language, applied to network devices, the method comprising:

[0007] Based on the update status of the stored YANG module set, a historical chain is constructed, wherein the nodes in the historical chain correspond sequentially to different YANG module sets arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0008] Receive a YANG module synchronization request sent by a network management device, wherein the YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version;

[0009] The historical chain is sent to the network management device so that the network management device can determine the target YANG module based on the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0010] The incremental request is received, and the target YANG module is sent to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

[0011] In one embodiment of this application, constructing the historical chain based on the update status of the stored YANG module set includes:

[0012] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0013] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0014] In one embodiment of this application, the nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to the node. Other nodes, except for the nodes corresponding to the initial version, also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0015] Secondly, embodiments of this application provide another incremental synchronization method for YANG modules in the next-generation data modeling language, applied to network management devices, the method comprising:

[0016] Determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device;

[0017] If not, then send a YANG module synchronization request to the network management device;

[0018] The network device receives a historical chain in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0019] Based on the historical chain, the target YANG module is determined, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version;

[0020] Send an incremental request to the network device to obtain the target YANG module;

[0021] The target YANG module is received in response to the incremental request from the network device, and the stored YANG module set is updated based on the target YANG module.

[0022] In one embodiment of this application, the method further includes:

[0023] If the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, a full synchronization request is sent to the network device so that the network device can return the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0024] The required YANG module is determined based on the aforementioned metadata;

[0025] For the YANG module that needs to be acquired, an acquisition request is sent to the network device so that the network device can respond with the YANG module targeted by the acquisition request;

[0026] Update its own stored set of YANG modules based on the received YANG modules.

[0027] In one embodiment of this application, determining whether the set of YANG modules of the target version currently stored in the network management device is the same version as the set of YANG modules of the latest version currently stored in the network device includes:

[0028] Receive the version identifier of the latest version of the YANG module set currently stored by the network device;

[0029] Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version;

[0030] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version;

[0031] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

[0032] Thirdly, embodiments of this application provide a network device, the network device comprising:

[0033] processor;

[0034] transceiver;

[0035] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps:

[0036] Based on the update status of the stored YANG module set, a historical chain is constructed, wherein the nodes in the historical chain correspond sequentially to different YANG module sets arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0037] Receive a YANG module synchronization request sent by a network management device, wherein the YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version;

[0038] The historical chain is sent to the network management device so that the network management device can determine the target YANG module based on the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0039] The incremental request is received, and the target YANG module is sent to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

[0040] In one embodiment of this application, the step of constructing a historical chain based on the update status of the stored YANG module set specifically includes:

[0041] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0042] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0043] In one embodiment of this application, the nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to the node. Other nodes, except for the nodes corresponding to the initial version, also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0044] Fourthly, embodiments of this application provide a network management device, the network management device comprising:

[0045] processor;

[0046] transceiver;

[0047] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps:

[0048] Determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device;

[0049] If not, then send a YANG module synchronization request to the network management device;

[0050] The network device receives a historical chain in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0051] Based on the historical chain, the target YANG module is determined, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version;

[0052] Send an incremental request to the network device to obtain the target YANG module;

[0053] The target YANG module is received in response to the incremental request from the network device, and the stored YANG module set is updated based on the target YANG module.

[0054] In one embodiment of this application, the machine-executable instructions further cause the processor to perform the following steps:

[0055] If the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, a full synchronization request is sent to the network device so that the network device can return the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0056] The required YANG module is determined based on the aforementioned metadata;

[0057] For the YANG module that needs to be acquired, an acquisition request is sent to the network device so that the network device can respond with the YANG module targeted by the acquisition request;

[0058] Update its own stored set of YANG modules based on the received YANG modules.

[0059] In one embodiment of this application, determining whether the target version of the YANG module set currently stored in the network management device is the same version as the latest version of the YANG module set currently stored in the network device specifically includes:

[0060] Receive the version identifier of the latest version of the YANG module set currently stored by the network device;

[0061] Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version;

[0062] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version;

[0063] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

[0064] Fifthly, embodiments of this application provide another incremental synchronization device for the YANG module of the next-generation data modeling language, applied to network devices, the device comprising:

[0065] The history chain construction module is used to construct a history chain based on the update status of the stored YANG module set. The nodes in the history chain correspond sequentially to different YANG module sets arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0066] A synchronization request receiving module is used to receive a YANG module synchronization request sent by a network management device. The YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version.

[0067] The historical chain sending module is used to send the historical chain to the network management device, so that the network management device can determine the target YANG module according to the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0068] An incremental request receiving module is used to receive the incremental request and send the target YANG module to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

[0069] In one embodiment of this application, the history chain construction module is specifically used for:

[0070] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0071] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0072] In one embodiment of this application, the nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to the node. Other nodes, except for the nodes corresponding to the initial version, also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0073] Sixthly, embodiments of this application provide another incremental synchronization device for the YANG module of the next-generation data modeling language, applied to a network management device, the device comprising:

[0074] The version determination module is used to determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device.

[0075] A synchronization request sending module is used to send a YANG module synchronization request to the network management device if the condition is not met.

[0076] The historical link receiving module is used to receive the historical chain sent by the network device in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0077] The target module determination module is used to determine the target YANG module based on the historical chain, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version;

[0078] An incremental request sending module is used to send an incremental request to the network device to obtain the target YANG module;

[0079] The first set update module is used to receive the target YANG module in response to the incremental request from the network device, and update the stored YANG module set based on the target YANG module.

[0080] In one embodiment of this application, the apparatus further includes:

[0081] The full request sending module is used to send a full synchronization request to the network device if the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, so that the network device can feed back the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0082] The module acquisition module is used to determine the YANG module to be acquired based on the metadata.

[0083] The request sending module is used to send a request to the network device for the YANG module that needs to be acquired, so that the network device can respond with the YANG module for which the request is made.

[0084] The second set update module is used to update its own stored set of YANG modules based on the received YANG modules.

[0085] In one embodiment of this application, the version determination module is specifically used for:

[0086] Receive the version identifier of the latest version of the YANG module set currently stored by the network device;

[0087] Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version;

[0088] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version;

[0089] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

[0090] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in either the first or second aspect.

[0091] Eighthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods described in either the first or second aspect.

[0092] Beneficial effects of the embodiments in this application:

[0093] In the solution provided in this application embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0094] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0095] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0096] Figure 1 This is a schematic diagram of the synchronization process of a YANG module in the prior art;

[0097] Figure 2 A flowchart illustrating an incremental synchronization method for a YANG module applied to a network device, provided in an embodiment of this application;

[0098] Figure 3 This application provides a schematic diagram of a historical chain construction process.

[0099] Figure 4 A flowchart illustrating an incremental synchronization method for a YANG module applied to a network management device, provided in an embodiment of this application;

[0100] Figure 5 A schematic diagram of a full update process for the YANG module provided in this application embodiment;

[0101] Figure 6A schematic diagram illustrating the process of synchronizing the YANG module in a network management device, as provided in an embodiment of this application;

[0102] Figure 7 This application provides a schematic diagram of a version determination process.

[0103] Figure 8 A schematic diagram of the structure of a YANG module incremental synchronization system provided in this application embodiment;

[0104] Figure 9 This application provides a schematic diagram of the interaction process between a network management device and a network device.

[0105] Figure 10 This application provides a schematic diagram of the structure of a network device according to an embodiment of the present application.

[0106] Figure 11 This is a schematic diagram of the structure of a network management device provided in an embodiment of this application;

[0107] Figure 12 A schematic diagram of the structure of an incremental synchronization device for a YANG module applied to a network device, provided in an embodiment of this application;

[0108] Figure 13 This is a schematic diagram of the structure of an incremental synchronization device for a YANG module applied to a network management device, provided in an embodiment of this application. Detailed Implementation

[0109] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0110] See Figure 1 This illustrates the synchronization process of the YANG module between network management devices and network devices in related technologies.

[0111] S101: The network management device establishes a NETCONF session with the network device and sends hello messages to each other;

[0112] The hello message mentioned above carries the YANG-library capability identifier, enabling both parties to determine the RFC standards supported by each other.

[0113] S102: The network device sends the version identifier of the YANG module set and the version identifier of the accompanying content to the network management device;

[0114] The version identifier of the aforementioned YANG module set is module-set-id, which is the version identifier of the latest version of the YANG module set stored in the current network device. The accompanying content version identifier is content-id. According to the RFC standard, whenever the YANG modules in the YANG module set in the network device change, the version identifier of the YANG module set and the accompanying content version identifier will necessarily change.

[0115] S103: If the network management device determines that the version identifier of the received YANG module set and the version identifier of the accompanying content are different from the identifier of the YANG module set cached locally, it will send a full synchronization request to the network device.

[0116] If the version identifier of the received YANG module set and its accompanying content version identifier are different from the identifier of the locally cached YANG module set, it indicates that the YANG module set stored in the network management device is not the latest version and needs to be updated.

[0117] S104: The network device sends metadata of the complete YANG module set to the network management device;

[0118] The aforementioned metadata includes a list of YANG modules in the YANG module collection, including module name, version, import dependencies, features, submodules, namespaces, etc.

[0119] S105: The network management device compares the difference between its own cached YANG module set and the received YANG module set based on metadata;

[0120] S106: The network management device identifies the YANG modules that have changed one by one and sends a request to the network device to obtain the YANG modules that have changed.

[0121] S107: The network device sends the YANG module back to the network management device based on the received acquisition request to complete the synchronization.

[0122] RFC7895 defines a complete YANG module synchronization mechanism, the core design of which includes:

[0123] The YANG module structure can include: a unique version identifier for the YANG module set, which must be updated whenever any part of the YANG module set changes; and a list of corresponding YANG modules, which can appear once or multiple times in the YANG module set, with each entry corresponding to one YANG module.

[0124] The list can define the list name, revision time, unique namespace, feature field indicating the features currently enabled by the network device, deviation extension module information, compliance type of the YANG module on the device, and sub-modules in the YANG module.

[0125] The deviation extension module information is used to ensure compatibility with proprietary extensions from different vendors. Its child nodes define the proprietary extension module name and the proprietary extension module revision.

[0126] A submodule can define the submodule's name and version.

[0127] Network devices generate a module-set-id as a unique version identifier, representing the current set of YANG modules in the network device. The module-set-id must be changed only when the set of YANG modules changes. Network management devices can cache the complete list of YANG modules and retrieve it only when the module-set-id changes. When a YANG module changes, the network device proactively pushes a YANG module list change notification (yang-library-change), which includes the updated module-set-id.

[0128] exist Figure 1 Based on the illustrated process, assuming the network device stores 500 YANG modules, after a certain in-service software upgrade (ISSU), three YANG modules (less than 1% of the total YANG modules) change. The changed YANG modules include a revised version of the interface management module (ifmgr), an addition of enumeration values ​​to the type definition (ifmgr-types), and the addition of sensor support to the management module (device). In this case, according to... Figure 1 The synchronization mechanism shown requires the network management device to obtain a complete list of all 500 YANG modules (containing metadata for each module) after detecting a change in the module-set-id of a network device. This list is then compared with the YANG modules stored locally on the network management device to identify the three changed YANG modules, and the updated three YANG modules are retrieved one by one. However, this process has the following main problems:

[0129] 1. Low data transmission efficiency.

[0130] Even if only one YANG module changes, a complete list of YANG modules, containing metadata for all YANG modules, must be transmitted, resulting in wasted network bandwidth between the network management device and network devices. In large-scale module scenarios (more than 500 YANG modules), the data volume for a single synchronization can reach hundreds of KB. For wide area networks or low-bandwidth links, the data transmission overhead is significant.

[0131] 2. Waste of computing resources.

[0132] The CPU resources of the network management device are consumed in parsing invalid data. Specifically, the CPU must parse the complete list of YANG modules, requiring it to iterate through all YANG modules for comparison and calculation. When comparing the received complete list of YANG modules with the YANG modules stored locally on the network management device, the CPU must compare a large amount of data where there are no discrepancies. When the network management device needs to manage a large number of network devices, the cumulative overhead is significant.

[0133] 3. High synchronization delay.

[0134] Increased synchronization latency between network management devices and network devices impacts service activation and fault recovery speed. The processes described above waste significant network bandwidth and CPU resources, leading to prolonged transmission, parsing, and comparison of the complete YANG module list. This results in increased synchronization latency between network management devices and network devices. Furthermore, it affects the speed of service reconstruction after network management device fault recovery, with the problem becoming more severe in high-frequency change scenarios (such as continuous integration or continuous deployment).

[0135] 4. Equipment capacity synchronization is slow.

[0136] In high-availability switching scenarios, it may be impossible for network management devices to complete device capability synchronization for an extended period of time after restarting.

[0137] 5. Historical changes are not supported.

[0138] Under current regulations, network devices only provide the current set of YANG modules, with no historical records. If the network management device misses multiple change notifications for network devices, it cannot trace intermediate changes. Furthermore, during synchronization, only the full list of YANG modules can be retrieved again; resuming interrupted data transfers is not possible.

[0139] To address the above issues, this application provides an incremental synchronization method for the YANG module.

[0140] See Figure 2 This application provides an incremental synchronization method for YANG modules, applied to network devices. The method includes steps S201-S204.

[0141] S201: Construct a historical chain based on the update status of the stored YANG module set;

[0142] In this historical chain, the nodes correspond to different sets of YANG modules arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version set that have been updated compared to the previous version.

[0143] S202: Receive the YANG module synchronization request sent by the network management device;

[0144] The aforementioned YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version.

[0145] S203: Send the aforementioned historical chain to the aforementioned network management device, so that the aforementioned network management device can determine the target YANG module based on the aforementioned historical chain, and send an incremental request to the aforementioned network device to obtain the target YANG module;

[0146] Among them, the target YANG module mentioned above refers to the YANG module that has been updated, which is recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0147] S204: Receive the above-mentioned incremental request, and send the above-mentioned target YANG module to the above-mentioned network management device according to the above-mentioned incremental request, so that the above-mentioned network management device updates the stored YANG module set based on the above-mentioned target YANG module.

[0148] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0149] Furthermore, compared with related technologies, the specific advantages of the embodiments of this application include:

[0150] 1. High data transmission efficiency: Since only the historical chain needs to be transmitted, and there is no need to transmit the complete metadata of the YANG module, the data transmission efficiency is high.

[0151] 2. Saves computing resources: Since the historical chain directly records the information of the updated YANG modules, the network management device can directly read and determine the target YANG module without having to compare and parse it itself, thus saving computing resources.

[0152] 3. Low synchronization latency: Due to improved data transmission efficiency and lower computational resource consumption, the synchronization latency between network management devices and network devices can be reduced.

[0153] 4. Device capability synchronization is timely. Due to the low synchronization latency, device capability synchronization can be completed in a short time after the network management device is restarted.

[0154] 5. Supports change history backtracking. By reading the history chain, the YANG module that was updated each time can be determined, thus enabling history backtracking.

[0155] 6. Implement fine-grained subscription: Since the historical chain records the changes of the YANG module in each update in detail, the detailed information of each update can be determined based on the historical chain, thus enabling fine-grained subscription.

[0156] In one possible embodiment, the network device described above can be a router or a switch.

[0157] In the aforementioned historical chain, the earlier the node, the newer the version of the YANG module set. Each node records the version identifier of the corresponding YANG module set and the timestamp of when the YANG module set was generated. Except for the node corresponding to the initial version, other nodes record the identifier (which can be a name or number) of the YANG modules in the corresponding version's YANG module set that have been updated compared to the previous version, the timestamp of when the YANG module was updated, and the update type (including modification, addition, and deletion; due to the standard requirement that YANG modules have high adaptability, YANG modules are rarely deleted to adapt to various historical versions). The node corresponding to the initial version does not record updated YANG modules, indicating that the corresponding YANG module set is brand new. Optionally, the node can also record the compliance type of the updated YANG modules, including native implementation type (i.e., there are business logic or data nodes corresponding to this YANG module in the network device) and import type (i.e., this YANG module is only imported as a dependency, and the network device does not implement this YANG module, but only references its definition).

[0158] The data structure of a history chain can include the definition of the YANG library (e.g., the standard YANG library), the unique XML namespace of the YANG module, the YANG libraries that the history chain depends on, and the types of the YANG libraries that this history chain depends on.

[0159] The top-level container of the history chain can define whether the history chain is read-only operation state data, which belongs to the device runtime state. If it is read-only operation state data, the history chain cannot be modified through edit-config, but can only be retrieved.

[0160] The primary key of the historical chain is module-set-id, which represents a single change record in the historical chain. Nodes are sorted according to the timestamps generated by the YANG module set, with the most recent node at the top.

[0161] The leaf node module-set-id is of string data type and is the module set identifier value corresponding to this version of the YANG module set.

[0162] The leaf node `module-set-generate-timestamp` is a timestamp representing the generation time of the YANG module set. It defines whether this item is required. In this embodiment, the timestamp is required. The timestamp is the time when the current YANG module set was generated and is used to sort the records in the entire change history chain.

[0163] The optional history chain can define containers called `changed-modules`, which have an existence flag `presence` indicating that the container is optional and only exists if the current YANG module set has incremental differences compared to the previous version. If the container does not exist, the current YANG module set is the initial version. The container stores the YANG modules in the current version that have been updated compared to the previous version.

[0164] The primary key of the sublist in the container is the leaf node name and the leaf node revision. The sublist records the YANG modules that have been updated in the current version of the YANG module set compared to the previous version.

[0165] The leaf node `name` in the sublist can be defined as `yang:yang-identifier`, conforming to the YANG identifier specification and representing the name of the updated YANG module. The leaf node `revision` is a union type, containing both the normal `yanglib:revision-identifier` type and an empty string type, specifically describing the update date of the updated YANG module. The leaf node `conformance-type` is an enumeration type, where a value of `implement` indicates that the device natively implements the YANG module (with corresponding business logic and data nodes), and a value of `import` indicates that it is only imported as a dependency; the device does not implement the module itself, only referencing its definition. `conformance-type` is an optional value representing the module's conformance type. The leaf node `change-type` is an enumeration type, where a value of `added` indicates that the YANG module was added this time, a value of `removed` indicates that the YANG module was removed this time, and a value of `modified` indicates that the YANG module was modified this time. `change-type` is an optional value representing the change type of this module.

[0166] The historical chain's data tree structure includes a top-level container `module-set-change-lists`, and lower-level nodes within `module-set-change-lists`. Each node contains `module-set-id`, `module-set-generate-timestamp`, and `changed-modules`, with `module` nodes within `changed-modules`. [name revision] contains name, revision, conformance-type, and change-type.

[0167] In one example, the historical chain update process is as follows:

[0168] The initial state (first time online or reset) contains only one node, which records the version identifier and timestamp of the YANG module set in the initial state. The changed-modules is ABSENT, indicating that all modules are in the initial state.

[0169] First change (ISSU upgrade): A new node is added to the head of the historical chain, which records the version identifier and timestamp of the YANG module set after the first change. The changed-modules section records the name, update date and change type of the YANG module that was updated for the first time.

[0170] Second change (patch update): A new node is added to the head of the history chain, which records the version identifier and timestamp of the YANG module set after the second change. Among them, changed-modules records the name, update date and change type of the YANG module that was updated for the second time.

[0171] In one possible embodiment, when a YANG module in the YANG module set of a network device is updated, causing the version of the YANG module set to be updated, the device will proactively push the updated version identifier of the YANG module set to the network management device. Upon receiving the push, if the network management device determines that the version identifier of its stored YANG module set is different from the version identifier of the latest updated YANG module set of the network device, it determines that the YANG module set stored in the network management device is not the latest version. In this case, it can send a YANG module synchronization request to the network device, and upon receiving the YANG module synchronization request, the network device will send a historical chain to the network management device.

[0172] Since each node in the historical chain records the YANG modules that were updated each time, if the network management device determines that its stored YANG module set is not the latest version, it can determine, based on the historical chain, the YANG modules that changed during each update from its stored version to the latest version, while other YANG modules remained unchanged. Therefore, the network management device can determine the target YANG modules that have changed based on the historical chain and send an incremental request to the network device. For example, taking the aforementioned example, if the version of the YANG module set stored in the network device is v3 and the version of the YANG module set stored in the network management device is v1, then the network management device can determine, based on the historical chain, that the target YANG modules to be obtained are the ifmgr module, device module, telemetry module, and gRPC module.

[0173] The incremental request mentioned above carries the identifier of the target YANG module.

[0174] After receiving the target YANG module, the network management device determines the update type of the target YANG module based on the records in the historical chain. For target YANG modules with an update type of "new", the network management device adds it to the stored YANG module set. For target YANG modules with an update type of "modified", the network management device updates the YANG module in the stored YANG module set to the latest acquired target YANG module. For target YANG modules with an update type of "deleted", the network management device directly deletes them from its own stored YANG module set.

[0175] See Figure 3In one embodiment of this application, step S201 can be implemented through steps S301-S302.

[0176] S301: If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0177] S302: If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0178] As can be seen from the above, in this embodiment of the application, different methods are used to construct nodes for the nodes corresponding to the initial version YANG module set and the nodes corresponding to the non-initial version YANG module set. Whenever a new node is constructed, the node is added to the head of the historical chain, so that the nodes in the historical chain are connected in sequence according to the order of version updates, forming a sequential connection of nodes in the historical chain.

[0179] In one embodiment of this application, the nodes in the aforementioned historical chain record the version identifier and generation time of the YANG module set corresponding to that node. In addition to the nodes corresponding to the initial version, the other nodes also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0180] As can be seen from the above, each node in the historical chain in this embodiment records the version identifier and generation time of the YANG module set. This allows the network management device to determine the version difference between its stored YANG module set and the latest version of the YANG module set after receiving the historical chain, and to trace back the update time of each version. Furthermore, it can determine the update type of the updated YANG module, thereby adaptively synchronizing the YANG modules in its stored YANG module set.

[0181] Corresponding to the aforementioned incremental synchronization method for YANG modules applied to network devices, this application also provides an incremental synchronization method for YANG modules applied to network management devices.

[0182] See Figure 4 The incremental synchronization method for the YANG module applied to network management devices includes the following steps S401-S406.

[0183] S401: Determine whether the target version of the YANG module set currently stored in the above network management device is the same version as the latest version of the YANG module set currently stored in the network device;

[0184] S402: If not, send a YANG module synchronization request to the aforementioned network management device;

[0185] S403: Receive the historical chain sent by the network device in response to the synchronization request of the YANG module;

[0186] The aforementioned historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the aforementioned historical chain correspond sequentially to different YANG module sets. The YANG module sets are arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0187] S404: Based on the above historical chain, determine the target YANG module;

[0188] Among them, the target YANG module mentioned above refers to the YANG module that has been updated, which is recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0189] S405: Send an incremental request to the aforementioned network device to obtain the aforementioned target YANG module;

[0190] S406: Receive the target YANG module in response to the incremental request from the network device, and update the stored YANG module set based on the target YANG module.

[0191] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0192] See Figure 5 The incremental synchronization method for the YANG module applied to network management devices also includes the following steps S501-S504.

[0193] S501: If the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, a full synchronization request is sent to the network device so that the network device can feed back the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0194] S502: Determine the YANG module that needs to be obtained based on the above metadata;

[0195] S503: For the YANG module that needs to be acquired, send an acquisition request to the network device so that the network device can respond with the YANG module for which the acquisition request is requested.

[0196] S504: Update the set of YANG modules stored in the system based on the received YANG modules.

[0197] As seen above, if the network management device does not store the YANG module, it indicates that the device is either going online for the first time or has been offline for a long time and then coming back online. Since the YANG module is not stored, it is necessary to obtain the full set of YANG modules. In this case, a full YANG module retrieval can be performed directly. Alternatively, if the network management device has not been online for a long time, the version of its recorded YANG module set may be too old. The historical chain may not contain nodes corresponding to this version of the YANG module set, making it impossible to determine the target YANG module based on the historical chain. In this case, a full update can be used to ensure the normal synchronization of the YANG module set.

[0198] In one embodiment of this application, if the network management device does not currently store YANG modules, then all YANG modules need to be obtained. If the network management device stores YANG modules, but the historical chain does not contain nodes corresponding to the target version's YANG module set, then the parsing and comparison method in related technologies can be used to determine the difference between the target version's YANG module set and the latest version's YANG module set in the network device based on metadata. The YANG modules with the difference are taken as the YANG modules to be obtained. For specific parsing and comparison methods, please refer to related technologies, which will not be elaborated in this embodiment.

[0199] See Figure 6 This is a schematic diagram illustrating the process of network management device synchronizing YANG module in an embodiment of this application.

[0200] S601: The network management device is in its initial state, with no local cached YANG module, and is connecting to the network device for the first time.

[0201] S602: Perform full synchronization.

[0202] Specifically, obtain a complete list of YANG modules from the network device, establish a local cache, and record the module-set-id.

[0203] S603: Check whether the module-set-id of the network device is consistent with the module-set-id cached locally.

[0204] If they match, proceed directly to step S606; if they do not match, proceed to step S604.

[0205] S604: Perform incremental synchronization.

[0206] Specifically, the historical chain is obtained, the position of the local module-set-id in the historical chain is determined, the incremental difference (i.e. the target YANG module) is calculated, the target YANG module is obtained, and the local cache is updated.

[0207] S605: If the local module-set-id cannot be found in the historical chain, a full synchronization will be performed.

[0208] S606: Synchronization complete.

[0209] See Figure 7 In one embodiment of this application, step S401 is achieved through steps S701-S704.

[0210] S701: Receives the version identifier of the latest version of the YANG module set currently stored by the network device;

[0211] S702: Determine whether the received version identifier is the same as the version identifier of the YANG module set of the target version currently stored in the above network management device;

[0212] If they are the same, proceed to step S703; if they are different, proceed to step S704.

[0213] S703: Determine that the latest version of the YANG module set is the same version as the target version of the YANG module set mentioned above;

[0214] S704: It has been determined that the latest version of the YANG module set is not the same version as the target version of the YANG module set mentioned above.

[0215] As can be seen from the above, in this embodiment, the network device actively pushes the version identifier of its latest version of the YANG module set, enabling the network management device to quickly determine, based on the received push, that the latest version of the YANG module set is the same as the target version of the YANG module set stored in the network management device, thereby initiating YANG module synchronization. This makes YANG module synchronization between the network device and the network management device more timely and efficient.

[0216] The following example illustrates the entire process of incremental synchronization in this application:

[0217] Scenario 1: Initial Version (First Launch)

[0218] Scenario 1 is the first time a network device is put into service, in which the stored YANG module set is the initial version; the version identifier of the YANG module set is the identifier of the initial version, which contains complete YANG modules, and the history chain contains only one node. Since there are no earlier versions, there are no changed-modules in this node, and the timestamp contained therein indicates the generation time of the initial version of the YANG module set.

[0219] Scenario 2: ISSU after upgrade (first change)

[0220] Scenario 2 involves an ISSU upgrade based on the initial version. The updated YANG module set is identified by the second version identifier and contains 850 modules. A new node is added to the history chain, located at the head of the chain. This new node carries "changed-modules," listing the four YANG modules that were updated after the first change: three are modified (change type) and one is newly added (change type). The timestamp indicates the update time of the first change. The tail of the history chain retains the node corresponding to the initial version of the YANG module set.

[0221] Scenario 3: After the patch update (second change)

[0222] Scenario 3 is obtained by patching and updating based on Scenario 2. The version number of the updated YANG module set is the identifier of the third version. A new node is added to the first position of the history chain. The new node carries the changed-modules record, which records the YANG modules that were modified in the second change. The nodes in the history chain correspond to the patched and updated third version YANG module set, the ISSU updated second version YANG module set, and the initial version YANG module set in chronological order.

[0223] When obtaining the change history chain, the network management device can send a YANG module synchronization request to the network device. The YANG module synchronization request can be a Remote Procedure Call (RPC) message.

[0224] See Figure 8 The present application provides an incremental synchronization system for YANG modules, which includes a network device 801 and a network management device 802.

[0225] The aforementioned network device 801 is used to construct a historical chain based on the update status of the stored YANG module set. The nodes in the historical chain sequentially correspond to different YANG module sets, and the YANG module sets are arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0226] The network management device 802 is used to determine whether the target version of the YANG module set currently stored in the network management device 802 is the same version as the latest version of the YANG module set currently stored in the network device 801; if not, a YANG module synchronization request is sent to the network management device 802.

[0227] The aforementioned network device 801 is also used to receive the YANG module synchronization request sent by the network management device 802 and send the aforementioned historical chain to the network management device 802;

[0228] The network management device 802 is further configured to determine the target YANG module based on the historical chain and send an incremental request to the network device 801 to obtain the target YANG module, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0229] The network device 801 is also used to receive the incremental request and send the target YANG module to the network management device 802 according to the incremental request.

[0230] The aforementioned network management device 802 is further configured to receive the target YANG module fed back by the network device 801 in response to the aforementioned incremental request, and update the stored YANG module set based on the target YANG module.

[0231] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0232] In one embodiment of this application, the network device 801 is specifically used for:

[0233] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0234] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the aforementioned historical chain.

[0235] As can be seen from the above, in this embodiment of the application, different methods are used to construct nodes for the nodes corresponding to the initial version YANG module set and the nodes corresponding to the non-initial version YANG module set. Whenever a new node is constructed, the node is added to the head of the historical chain, so that the nodes in the historical chain are connected in sequence according to the order of version updates, forming a sequential connection of nodes in the historical chain.

[0236] In one embodiment of this application, the nodes in the aforementioned historical chain record the version identifier and generation time of the YANG module set corresponding to that node. In addition to the nodes corresponding to the initial version, the other nodes also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is either modification or addition.

[0237] As can be seen from the above, each node in the historical chain in this embodiment records the version identifier and generation time of the YANG module set. This allows the network management device to determine the version difference between its stored YANG module set and the latest version of the YANG module set after receiving the historical chain, and to trace back the update time of each version. Furthermore, it can determine the update type of the updated YANG module, thereby adaptively synchronizing the YANG modules in its stored YANG module set.

[0238] In one embodiment of this application, the network management device 802 is further configured to send a full synchronization request to the network device 801 if the network management device 802 currently does not store a YANG module or the historical chain does not contain a node with a set of YANG modules corresponding to the target version.

[0239] The aforementioned network device 801 is also used to receive the aforementioned full synchronization request and to feed back the metadata of all YANG modules in the currently stored latest version of the YANG module set to the aforementioned network management device 802.

[0240] The aforementioned network management device 802 is also used to determine the YANG module that needs to be acquired based on the aforementioned metadata; and to send an acquisition request to the network device 801 for the YANG module that needs to be acquired.

[0241] The aforementioned network device 801 is also used to send feedback to the aforementioned network management device 802 regarding the YANG module targeted by the aforementioned acquisition request;

[0242] The aforementioned network management device 802 is also used to update its own stored set of YANG modules based on the received YANG modules.

[0243] As seen above, if the network management device does not store the YANG module, it indicates that the device is either going online for the first time or has been offline for a long time and then coming back online. Since the YANG module is not stored, it is necessary to obtain the full set of YANG modules. In this case, a full YANG module retrieval can be performed directly. Alternatively, if the network management device has not been online for a long time, the version of its recorded YANG module set may be too old. The historical chain may not contain nodes corresponding to this version of the YANG module set, making it impossible to determine the target YANG module based on the historical chain. In this case, a full update can be used to ensure the normal synchronization of the YANG module set.

[0244] In one embodiment of this application, the network device 801 is further configured to:

[0245] Push the version identifier of the latest version of the YANG module set currently stored;

[0246] The aforementioned network management device 802 is specifically used for:

[0247] Determine whether the received version identifier is the same as the version identifier of the target version of the YANG module set currently stored in the network management device 802;

[0248] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set mentioned above are determined to be the same version;

[0249] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set mentioned above.

[0250] As can be seen from the above, in this embodiment, the network device actively pushes the version identifier of its latest version of the YANG module set, enabling the network management device to quickly determine, based on the received push, that the latest version of the YANG module set is the same as the target version of the YANG module set stored in the network management device, thereby initiating YANG module synchronization. This makes YANG module synchronization between the network device and the network management device more timely and efficient.

[0251] See Figure 9 This illustrates the interaction process between the network management device and the network device.

[0252] S901: Network management devices establish NETCONF sessions with network devices to exchange hello capabilities;

[0253] During this process, the network device returns the yang-library capability to the network management device, which includes the version identifier of the YANG module set in the network device.

[0254] S902: The network management device checks the version identifier of the target version of the YANG module set in the local cache;

[0255] S903: If the version identifier of the local target version is inconsistent with the received version identifier, the network management device requests the historical chain from the network device.

[0256] S904: Network devices feed back historical data to network management devices;

[0257] S905: The network management device locates the node corresponding to the target version in the historical chain and determines the target YANG module;

[0258] S906: The network management device requests the target YANG module from the network device;

[0259] S907: Network devices feed back the target YANG module to network management devices;

[0260] S908: The network management device updates the local cache based on the target YANG module, and incremental synchronization is completed.

[0261] See Figure 10 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. The network device includes:

[0262] Processor 1001;

[0263] Transceiver 1004;

[0264] A machine-readable storage medium 1002 stores machine-executable instructions that can be executed by the processor 1001, the machine-executable instructions causing the processor 1001 to perform the following steps:

[0265] Based on the update status of the stored YANG module set, a historical chain is constructed, wherein the nodes in the historical chain correspond sequentially to different YANG module sets arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0266] Receive a YANG module synchronization request sent by a network management device, wherein the YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version;

[0267] The historical chain is sent to the network management device so that the network management device can determine the target YANG module based on the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0268] The incremental request is received, and the target YANG module is sent to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

[0269] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0270] like Figure 10As shown, the AP may also include a communication bus 1003. The processor 1001, machine-readable storage medium 1002, and transceiver 1004 communicate with each other via the communication bus 1003. The communication bus 1003 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1003 can be divided into an address bus, a data bus, a control bus, etc.

[0271] The transceiver 1004 can be a wireless communication module, which interacts with other devices under the control of the processor 1001.

[0272] The machine-readable storage medium 1002 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium 1002 may also be at least one storage device located remotely from the aforementioned processor.

[0273] The processor 1001 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0274] In one embodiment of this application, the step of constructing a historical chain based on the update status of the stored YANG module set specifically includes:

[0275] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0276] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0277] As can be seen from the above, in this embodiment of the application, different methods are used to construct nodes for the nodes corresponding to the initial version YANG module set and the nodes corresponding to the non-initial version YANG module set. Whenever a new node is constructed, the node is added to the head of the historical chain, so that the nodes in the historical chain are connected in sequence according to the order of version updates, forming a sequential connection of nodes in the historical chain.

[0278] In one embodiment of this application, the nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to the node. Other nodes, except for the nodes corresponding to the initial version, also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0279] As can be seen from the above, each node in the historical chain in this embodiment records the version identifier and generation time of the YANG module set. This allows the network management device to determine the version difference between its stored YANG module set and the latest version of the YANG module set after receiving the historical chain, and to trace back the update time of each version. Furthermore, it can determine the update type of the updated YANG module, thereby adaptively synchronizing the YANG modules in its stored YANG module set.

[0280] See Figure 11 This is a schematic diagram of the structure of a network management device provided in an embodiment of this application. The network management device includes:

[0281] Processor 1101;

[0282] Transceiver 1104;

[0283] A machine-readable storage medium 1102 stores machine-executable instructions that can be executed by the processor 1101, the machine-executable instructions causing the processor 1101 to perform the following steps:

[0284] Determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device;

[0285] If not, then send a YANG module synchronization request to the network management device;

[0286] The network device receives a historical chain in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0287] Based on the historical chain, the target YANG module is determined, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version;

[0288] Send an incremental request to the network device to obtain the target YANG module;

[0289] The target YANG module is received in response to the incremental request from the network device, and the stored YANG module set is updated based on the target YANG module.

[0290] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0291] like Figure 11 As shown, the AP may also include a communication bus 1103. The processor 1101, machine-readable storage medium 1102, and transceiver 1104 communicate with each other via the communication bus 1103. The communication bus 1103 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1103 can be divided into an address bus, a data bus, a control bus, etc.

[0292] The transceiver 1104 can be a wireless communication module, which interacts with other devices under the control of the processor 1101.

[0293] Machine-readable storage medium 1102 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, machine-readable storage medium 1102 may also be at least one storage device located remotely from the aforementioned processor.

[0294] The processor 1101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0295] In one embodiment of this application, the machine-executable instructions further cause the processor 1101 to perform the following steps:

[0296] If the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, a full synchronization request is sent to the network device so that the network device can return the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0297] The required YANG module is determined based on the aforementioned metadata;

[0298] For the YANG module that needs to be acquired, an acquisition request is sent to the network device so that the network device can respond with the YANG module targeted by the acquisition request;

[0299] Update its own stored set of YANG modules based on the received YANG modules.

[0300] As seen above, if the network management device does not store the YANG module, it indicates that the device is either going online for the first time or has been offline for a long time and then coming back online. Since the YANG module is not stored, it is necessary to obtain the full set of YANG modules. In this case, a full YANG module retrieval can be performed directly. Alternatively, if the network management device has not been online for a long time, the version of its recorded YANG module set may be too old. The historical chain may not contain nodes corresponding to this version of the YANG module set, making it impossible to determine the target YANG module based on the historical chain. In this case, a full update can be used to ensure the normal synchronization of the YANG module set.

[0301] In one embodiment of this application, determining whether the target version of the YANG module set currently stored in the network management device is the same version as the latest version of the YANG module set currently stored in the network device specifically includes:

[0302] Receive the version identifier of the latest version of the YANG module set currently stored by the network device;

[0303] Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version;

[0304] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version;

[0305] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

[0306] As can be seen from the above, in this embodiment, the network device actively pushes the version identifier of its latest version of the YANG module set, enabling the network management device to quickly determine, based on the received push, that the latest version of the YANG module set is the same as the target version of the YANG module set stored in the network management device, thereby initiating YANG module synchronization. This makes YANG module synchronization between the network device and the network management device more timely and efficient.

[0307] See Figure 12 This is a schematic diagram of the structure of a YANG module incremental synchronization device provided in an embodiment of this application, applied to a network device. The device includes:

[0308] The history chain construction module 1201 is used to construct a history chain based on the update status of the stored YANG module set. The nodes in the history chain correspond sequentially to different YANG module sets arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0309] Synchronization request receiving module 1202 is used to receive YANG module synchronization requests sent by network management device. The YANG module synchronization request is sent by network management device when it determines that the target version of the YANG module set stored by network management device is not the latest version.

[0310] The historical chain sending module 1203 is used to send the historical chain to the network management device, so that the network management device can determine the target YANG module according to the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version.

[0311] The incremental request receiving module 1204 is used to receive the incremental request and send the target YANG module to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

[0312] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0313] In one embodiment of this application, the history chain construction module 1201 is specifically used for:

[0314] If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set;

[0315] If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

[0316] As can be seen from the above, in this embodiment of the application, different methods are used to construct nodes for the nodes corresponding to the initial version YANG module set and the nodes corresponding to the non-initial version YANG module set. Whenever a new node is constructed, the node is added to the head of the historical chain, so that the nodes in the historical chain are connected in sequence according to the order of version updates, forming a sequential connection of nodes in the historical chain.

[0317] In one embodiment of this application, the nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to the node. Other nodes, except for the nodes corresponding to the initial version, also record the module identifier and update type of the YANG module in the corresponding version's YANG module set that has been updated compared to the previous version. The update type is modification, addition, or deletion.

[0318] As can be seen from the above, each node in the historical chain in this embodiment records the version identifier and generation time of the YANG module set. This allows the network management device to determine the version difference between its stored YANG module set and the latest version of the YANG module set after receiving the historical chain, and to trace back the update time of each version. Furthermore, it can determine the update type of the updated YANG module, thereby adaptively synchronizing the YANG modules in its stored YANG module set.

[0319] See Figure 13 This application provides an incremental synchronization device for a YANG module, applied to a network management device. The device includes:

[0320] Version determination module 1301 is used to determine whether the target version of the YANG module set currently stored in the network management device is the same version as the latest version of the YANG module set currently stored in the network device;

[0321] Synchronization request sending module 1302 is used to send a YANG module synchronization request to the network management device if not;

[0322] The historical link receiving module 1303 is used to receive the historical chain sent by the network device in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version.

[0323] The target module determination module 1304 is used to determine the target YANG module according to the historical chain, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version;

[0324] The incremental request sending module 1305 is used to send an incremental request to the network device to obtain the target YANG module;

[0325] The first set update module 1306 is used to receive the target YANG module fed back by the network device in response to the incremental request, and update the stored YANG module set based on the target YANG module.

[0326] As can be seen from the above, in this embodiment, a historical chain is constructed in the network device, which records the YANG modules updated each time in the YANG module set of the network device. Therefore, after the network device sends the historical chain to the network management device, the network management device can determine the target YANG module that has been updated from the target version of the YANG module set stored in the network management device to the latest version of the YANG module set based on the historical chain. Therefore, the network management device and the network device only need to transmit the historical chain recording the YANG modules that have changed, without needing to obtain the metadata of the latest version of the YANG module set in its entirety. This reduces the amount of data that needs to be transmitted during YANG module synchronization, improves the data transmission efficiency of YANG module synchronization, saves computing resources, and reduces synchronization latency.

[0327] In one embodiment of this application, the apparatus further includes:

[0328] The full request sending module is used to send a full synchronization request to the network device if the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, so that the network device can feed back the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device.

[0329] The module acquisition module is used to determine the YANG module to be acquired based on the metadata.

[0330] The request sending module is used to send a request to the network device for the YANG module that needs to be acquired, so that the network device can respond with the YANG module for which the request is made.

[0331] The second set update module is used to update its own stored set of YANG modules based on the received YANG modules.

[0332] As seen above, if the network management device does not store the YANG module, it indicates that the device is either going online for the first time or has been offline for a long time and then coming back online. Since the YANG module is not stored, it is necessary to obtain the full set of YANG modules. In this case, a full YANG module retrieval can be performed directly. Alternatively, if the network management device has not been online for a long time, the version of its recorded YANG module set may be too old. The historical chain may not contain nodes corresponding to this version of the YANG module set, making it impossible to determine the target YANG module based on the historical chain. In this case, a full update can be used to ensure the normal synchronization of the YANG module set.

[0333] In one embodiment of this application, the version determination module 1301 is specifically used for:

[0334] Receive the version identifier of the latest version of the YANG module set currently stored by the network device;

[0335] Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version;

[0336] If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version;

[0337] If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

[0338] As can be seen from the above, in this embodiment, the network device actively pushes the version identifier of its latest version of the YANG module set, enabling the network management device to quickly determine, based on the received push, that the latest version of the YANG module set is the same as the target version of the YANG module set stored in the network management device, thereby initiating YANG module synchronization. This makes YANG module synchronization between the network device and the network management device more timely and efficient.

[0339] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described incremental synchronization methods for YANG modules applied to network devices or network management devices.

[0340] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the YANG module incremental synchronization methods applied to network devices or network management devices in the above embodiments.

[0341] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0342] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0343] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, embodiments of methods, systems, network devices, network management devices, apparatuses, computer-readable storage media, and computer program products applied to network management devices are basically similar to the method embodiments, and therefore described relatively simply; relevant parts can be referred to the descriptions of the method embodiments.

[0344] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. An incremental synchronization method for YANG modules in a next-generation data modeling language, characterized in that: Applied to network devices, the method includes: Based on the update status of the stored YANG module set, a historical chain is constructed, wherein the nodes in the historical chain correspond sequentially to different YANG module sets arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. Receive a YANG module synchronization request sent by a network management device, wherein the YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version; The historical chain is sent to the network management device so that the network management device can determine the target YANG module based on the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version. The incremental request is received, and the target YANG module is sent to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

2. The method according to claim 1, characterized in that, The step of constructing a historical chain based on the update status of the stored YANG module set includes: If the currently stored YANG module set is the initial version, construct the node in the historical chain corresponding to the initial version of the YANG module set; If the currently stored set of YANG modules is not the initial version, construct a node corresponding to the currently stored version of the YANG module, and link the newly constructed node to the head of the historical chain.

3. The method according to claim 1 or 2, characterized in that, The nodes in the historical chain record the version identifier and generation time of the YANG module set corresponding to that node. In addition to the nodes corresponding to the initial version, the other nodes also record the module identifier and update type of the YANG module that has been updated compared to the previous version in the YANG module set of the corresponding version. The update type is modification, addition or deletion.

4. An incremental synchronization method for YANG modules in another next-generation data modeling language, characterized in that: Applied to network management devices, the method includes: Determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device; If not, then send a YANG module synchronization request to the network management device; The network device receives a historical chain in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. Based on the historical chain, the target YANG module is determined, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version; Send an incremental request to the network device to obtain the target YANG module; The target YANG module is received in response to the incremental request from the network device, and the stored YANG module set is updated based on the target YANG module.

5. The method according to claim 4, characterized in that, The method further includes: If the network management device does not currently store YANG modules or the historical chain does not contain nodes of the YANG module set corresponding to the target version, a full synchronization request is sent to the network device so that the network device can return the metadata of all YANG modules in the latest version of the YANG module set currently stored to the network management device. The required YANG module is determined based on the aforementioned metadata; For the YANG module that needs to be acquired, an acquisition request is sent to the network device so that the network device can respond with the YANG module targeted by the acquisition request; Update its own stored set of YANG modules based on the received YANG modules.

6. The method according to claim 4 or 5, characterized in that, The step of determining whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device includes: Receive the version identifier of the latest version of the YANG module set currently stored by the network device; Determine whether the received version identifier is the same as the version identifier of the YANG module set currently stored in the network management device for the target version; If they are the same, then the latest version of the YANG module set and the target version of the YANG module set are determined to be the same version; If they are different, then the latest version of the YANG module set is determined to be different from the target version of the YANG module set.

7. A network device, characterized in that, The network device includes: processor; transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps: Based on the update status of the stored YANG module set, a historical chain is constructed, wherein the nodes in the historical chain correspond sequentially to different YANG module sets arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. Receive a YANG module synchronization request sent by a network management device, wherein the YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version; The historical chain is sent to the network management device so that the network management device can determine the target YANG module based on the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version. The incremental request is received, and the target YANG module is sent to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

8. A network management device, characterized in that, The network management device includes: processor; transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps: Determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device; If not, then send a YANG module synchronization request to the network management device; The network device receives a historical chain in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the node corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. Based on the historical chain, the target YANG module is determined, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version; Send an incremental request to the network device to obtain the target YANG module; The target YANG module is received in response to the incremental request from the network device, and the stored YANG module set is updated based on the target YANG module.

9. An incremental synchronization device for YANG modules in another next-generation data modeling language, characterized in that, Applied to network devices, the device includes: The history chain construction module is used to construct a history chain based on the update status of the stored YANG module set. The nodes in the history chain correspond sequentially to different YANG module sets arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. A synchronization request receiving module is used to receive a YANG module synchronization request sent by a network management device. The YANG module synchronization request is sent by the network management device when it determines that the target version of the YANG module set stored by the network management device is not the latest version. The historical chain sending module is used to send the historical chain to the network management device, so that the network management device can determine the target YANG module according to the historical chain and send an incremental request to the network device to obtain the target YANG module. The target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version. An incremental request receiving module is used to receive the incremental request and send the target YANG module to the network management device according to the incremental request, so that the network management device updates the stored YANG module set based on the target YANG module.

10. An incremental synchronization device for YANG modules in another next-generation data modeling language, characterized in that, Applied to network management devices, the apparatus includes: The version determination module is used to determine whether the target version of the YANG module set currently stored in the network management device is the same as the latest version of the YANG module set currently stored in the network device. A synchronization request sending module is used to send a YANG module synchronization request to the network management device if the condition is not met. The historical link receiving module is used to receive the historical chain sent by the network device in response to the YANG module synchronization request. The historical chain is constructed by the network device based on the update status of the stored YANG module set. The nodes in the historical chain correspond to different YANG module sets in sequence. The YANG module sets are arranged in version order. Except for the nodes corresponding to the initial version, the other nodes record the YANG modules in the corresponding version of the YANG module set that have been updated compared to the previous version. The target module determination module is used to determine the target YANG module based on the historical chain, wherein the target YANG module is: the YANG module that has been updated recorded in the historical chain from the node corresponding to the target version to the node corresponding to the latest version; An incremental request sending module is used to send an incremental request to the network device to obtain the target YANG module; The first set update module is used to receive the target YANG module in response to the incremental request from the network device, and update the stored YANG module set based on the target YANG module.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-3 or 4-6.