WO2021073395A1 - Yang模型的管理方法、装置、系统、设备及存储介质 - Google Patents

Yang模型的管理方法、装置、系统、设备及存储介质 Download PDF

Info

Publication number
WO2021073395A1
WO2021073395A1 PCT/CN2020/117539 CN2020117539W WO2021073395A1 WO 2021073395 A1 WO2021073395 A1 WO 2021073395A1 CN 2020117539 W CN2020117539 W CN 2020117539W WO 2021073395 A1 WO2021073395 A1 WO 2021073395A1
Authority
WO
WIPO (PCT)
Prior art keywords
yang
package
target
instruction
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2020/117539
Other languages
English (en)
French (fr)
Inventor
王子韬
吴钦
吴波
郑光迎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP20877237.6A priority Critical patent/EP4027588B1/en
Publication of WO2021073395A1 publication Critical patent/WO2021073395A1/zh
Priority to US17/722,822 priority patent/US20220239547A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/024Standardisation; Integration using relational databases for representation of network management data, e.g. managing via structured query language [SQL]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0266Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using meta-data, objects or commands for formatting management information, e.g. using eXtensible markup language [XML]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/20Network management software packages

Definitions

  • This application relates to the field of communication technology, and in particular to a YANG model management method, device, system, equipment and storage medium.
  • the network configuration protocol (NETCONF) emerged as a programmable protocol for the configuration and management of network devices.
  • NETCONF network configuration protocol
  • the YANG modeling language is widely used.
  • YANG is a language defined by the Internet Engineering Task Force (IETF) standards organization to model and describe network configuration management data to support the complete description of data between the NETCONF client and server.
  • the YANG model is used to describe Describe the configuration data, status data, remote procedure call (RPC) and notification (Notification) of the interaction between the NETCONF client and server. Therefore, how to manage the YANG model is an urgent problem to be solved in the process of network equipment management.
  • the embodiments of the application provide a YANG model management method, device, system, equipment, and storage medium to solve the problems provided by related technologies.
  • the technical solutions are as follows:
  • a method for managing a YANG model includes: a first network device determines a target YANG packet in a second network device, and the target YANG packet includes at least two service-related YANG modules (models) ; The first network device generates a processing instruction for the target YANG packet, the processing instruction includes the identification of the target YANG packet, and then the first network device sends the processing instruction to the second network device, where the identification of the target YANG packet is used To identify the target YANG package, and the identifier of the target YANG package includes the name of the target YANG package, or the identifier of the target YANG package includes the name and version information of the YANG package.
  • YANG packets can be distinguished for refined read-write management, which can reduce errors and improve management efficiency.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read the target YANG package corresponding to the identifier of the target YANG package One or more YANG models of at least two business-related YANG models;
  • the first network device After sending the processing instruction to the second network device, the first network device also receives one or more YANG models and corresponding structures of the at least two service-related YANG models in the target YANG packet.
  • the processing instruction further includes a second instruction, the second instruction includes an identifier of the target YANG package, and the second instruction is used to instruct to load the target YANG corresponding to the identifier of the target YANG package. package.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package at the loading location.
  • the second instruction also carries a script file of the command line interface CLI, and the script file is used to convert the YANG model in the target YANG package into a CLI script.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of a target YANG package, and the third instruction is used to instruct to query a YANG package that has a dependency relationship with the target YANG package;
  • the method further includes: receiving the first YANG packet list on which the target YANG packet depends or the second YANG packet list on which the target YANG packet depends.
  • the first network device receives the first YANG packet list that the target YANG packet depends on, or the first network device receives the second YANG packet list that depends on the target YANG packet, or the first network device receives the target YANG packet list.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes the identifier of the target YANG package, and the fourth instruction is used to instruct to delete the target YANG package corresponding to the identifier of the target YANG package and The second YANG package that depends on the target YANG package.
  • a method for managing a YANG model includes: a second network device receives a processing instruction for a target YANG packet sent by a first network device, the target YANG packet including at least two service-related YANG models ,
  • the processing instruction includes the identifier of the target YANG package used to identify the target YANG package, the identifier of the target YANG package includes the name of the target YANG package, or the identifier of the target YANG package includes the name and version information of the target YANG package ;
  • the second network device processes the target YANG packet corresponding to the identifier of the target YANG packet according to the processing instruction.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read the target YANG package corresponding to the identifier of the target YANG package One or more of the at least two business-related YANG models;
  • the second network device When processing the target YANG packet corresponding to the identifier of the target YANG packet according to the processing instruction, the second network device reads one or more YANG models corresponding to the identifier of the target YANG packet according to the first instruction, and Corresponding structure; afterwards, sending the one or more YANG models and corresponding structures to the first network device.
  • the processing instruction further includes a second instruction, the second instruction includes the identifier of the target YANG package, and the second instruction is used to instruct to load the corresponding to the identifier of the target YANG package.
  • Target YANG package includes the identifier of the target YANG package, and the second instruction is used to instruct to load the corresponding to the identifier of the target YANG package.
  • the processing the target YANG package corresponding to the identifier of the target YANG package according to the processing instruction includes: loading the target YANG package corresponding to the identifier of the target YANG package according to the second instruction.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load a target YANG package corresponding to the identifier of the target YANG package at the loading location;
  • the loading the target YANG package corresponding to the identifier of the target YANG package according to the second instruction includes: loading the target YANG package corresponding to the identifier of the target YANG package at the loading position according to the second instruction.
  • the second instruction also carries a CLI script file, and the script file is used to convert the YANG model in the target YANG package into a CLI script;
  • the processing of the target YANG package corresponding to the identifier of the target YANG package further includes: converting the YANG model in the target YANG package into a CLI script according to the CLI script file.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct the query to have a dependency relationship with the target YANG package.
  • the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct the query to have a dependency relationship with the target YANG package.
  • the processing of the target YANG package corresponding to the identifier of the target YANG package according to the processing instruction further includes: querying the first YANG package list on which the target YANG package depends or dependent on the target YANG package according to the third instruction.
  • the second YANG package list of the target YANG package; and the first YANG package list on which the target YANG package depends or the second YANG package list on which the target YANG package depends or the second YANG package list that depends on the target YANG package is sent to the first network device.
  • the second network device querying the first YANG package list that the target YANG package depends on or the second YANG package list that depends on the target YANG package according to the third instruction includes querying the first YANG package that the target YANG package depends on.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes the identifier of the target YANG package, and the fourth instruction is used to instruct to delete the identifier corresponding to the target YANG package.
  • the processing the target YANG package corresponding to the identifier of the target YANG package according to the processing instruction further includes: deleting the target YANG package corresponding to the identifier of the target YANG package according to the fourth instruction and relying on the The third YANG package of the target YANG package.
  • a YANG model management apparatus is provided, the apparatus is applied to a first network device, and the apparatus includes:
  • the determining module is used to determine a target YANG packet in the second network device, where the target YANG packet includes at least two service-related YANG models;
  • the generating module is used to generate a processing instruction for the target YANG packet, the processing instruction includes the identifier of the target YANG packet, the identifier of the target YANG packet is used to identify the target YANG packet, and the target YANG packet
  • the identifier includes the name of the target YANG package, or the name and version information of the target YANG package;
  • the sending module is configured to send the processing instruction to the second network device.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read the data corresponding to the identifier of the target YANG package.
  • the device further includes: a receiving module for receiving the one or more YANG models and the structure corresponding to the one or more YANG models.
  • the processing instruction further includes a second instruction, the second instruction includes an identifier of the target YANG package, and the second instruction is used to instruct to load the target YANG corresponding to the identifier of the target YANG package. package.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package at the loading location.
  • the second instruction also carries a CLI script file, and the script file is used to convert the YANG model in the target YANG package into a CLI script.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct to query a YANG package that has a dependency relationship with the target YANG package ;
  • the device further includes: a receiving module for receiving a first YANG package list on which the target YANG package depends or a second YANG package list on which the target YANG package depends.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes an identifier of the target YANG package, and the fourth instruction is used to instruct to delete the target corresponding to the identifier of the target YANG package.
  • the YANG package and the third YANG package that depends on the target YANG package.
  • a YANG model management apparatus is provided, the apparatus is used in a second network device, and the apparatus includes:
  • the receiving module is configured to receive a processing instruction for a target YANG packet sent by the first network device, the target YANG packet includes at least two service-related YANG models, and the processing instruction includes an identifier of the target YANG packet, and the YANG packet
  • the identifier of is used to identify the target YANG package, and the identifier of the target YANG package includes the name of the target YANG package, or the name and version information of the target YANG package;
  • the processing module is configured to process the target YANG packet corresponding to the identifier of the target YANG packet according to the processing instruction.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read the data corresponding to the identifier of the target YANG package.
  • the processing module is further configured to read one or more YANG models and corresponding structures of the at least two service-related YANG models corresponding to the identifier of the target YANG packet according to the first instruction;
  • the device also includes:
  • the sending module is configured to send the one or more YANG models and corresponding structures to the first network device.
  • the processing instruction further includes a second instruction, the second instruction includes the identifier of the target YANG package, and the second instruction is used to instruct to load the corresponding to the identifier of the target YANG package.
  • Target YANG package includes the identifier of the target YANG package, and the second instruction is used to instruct to load the corresponding to the identifier of the target YANG package.
  • the processing module is further configured to load the target YANG package corresponding to the identifier of the target YANG package according to the second instruction.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load a target YANG package corresponding to the identifier of the target YANG package at the loading location;
  • the processing module is configured to load the target YANG package corresponding to the identifier of the target YANG package at the loading position according to the second instruction.
  • the second instruction also carries a CLI script file, and the script file is used to convert the YANG model in the target YANG package into a CLI script;
  • the processing module is further configured to convert the YANG model in the target YANG package into a CLI script according to the CLI script file.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct to query a YANG package that has a dependency relationship with the target YANG package ;
  • the processing module is further configured to query the first YANG package list on which the target YANG package depends or the second YANG package list on which the target YANG package depends, according to the third instruction;
  • the apparatus further includes: a sending module, configured to send a first YANG packet list on which the target YANG packet depends or a second YANG packet list on which the target YANG packet depends, to the first network device.
  • a sending module configured to send a first YANG packet list on which the target YANG packet depends or a second YANG packet list on which the target YANG packet depends, to the first network device.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes an identifier of the target YANG package, and the fourth instruction is used to instruct to delete the target corresponding to the identifier of the target YANG package.
  • the fourth instruction includes an identifier of the target YANG package, and the fourth instruction is used to instruct to delete the target corresponding to the identifier of the target YANG package.
  • the processing module is further configured to delete the target YANG package corresponding to the identifier of the target YANG package and the third YANG package dependent on the target YANG package according to the fourth instruction.
  • a first network device is also provided, where the first network device is configured to execute the method described in any one of the foregoing first aspects.
  • a second network device is also provided, and the second network device is configured to perform any of the methods described in the second aspect.
  • a network device comprising: a memory and a processor, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the first The method of any one of the aspect or the second aspect.
  • a computer-readable storage medium wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement any one of the above-mentioned first or second aspects. method.
  • a YANG model management system which includes a first network device and a second network device; the first network device executes any of the methods provided in the first aspect, and the second network device The network device executes any one of the methods provided in the above second aspect.
  • Another communication device which includes a transceiver, a memory, and a processor.
  • the transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals And when the processor executes the instructions stored in the memory, the processor is caused to execute the method in any one of the foregoing possible implementation manners.
  • processors there are one or more processors, and one or more memories.
  • the memory may be integrated with the processor, or the memory and the processor may be provided separately.
  • the memory can be a non-transitory (non-transitory) memory, such as a read only memory (ROM), which can be integrated with the processor on the same chip, or can be set in different On the chip, the embodiment of the present application does not limit the type of the memory and the setting mode of the memory and the processor.
  • ROM read only memory
  • a computer program (product) is provided, the computer program (product) includes: computer program code, when the computer program code is executed by a computer, the computer executes the methods in the above aspects.
  • a chip including a processor, configured to call and execute instructions stored in the memory from a memory, so that a communication device installed with the chip executes the methods in the foregoing aspects.
  • Another chip including: an input interface, an output interface, a processor, and a memory.
  • the input interface, output interface, the processor, and the memory are connected through an internal connection path, and the processor is used to execute all When the code in the memory is executed, the processor is used to execute the methods in the foregoing aspects.
  • Fig. 1 is a schematic diagram of the structure of a YANG model management system provided by an embodiment of the application;
  • Figure 2 is a schematic diagram of a YANG packet in a network device provided by an embodiment of the application
  • Fig. 3 is a flowchart of a YANG model management method provided by an embodiment of the application.
  • FIG. 4 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 5 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • Fig. 6 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 7 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 9 is an interactive schematic diagram of the management process of the YANG model provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of the structure of a YANG package provided by an embodiment of this application.
  • FIG. 11 is a schematic diagram of the structure of the management system of the YANG model provided by an embodiment of the application.
  • FIG. 12 is a schematic diagram of the structure of a YANG model management system provided by an embodiment of the application.
  • FIG. 13 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 14 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 15 is a schematic structural diagram of a processing instruction provided by an embodiment of the application.
  • FIG. 16 is a schematic diagram of the structure of a YANG package provided by an embodiment of this application.
  • FIG. 17 is a schematic diagram of the management interaction process of the YANG model provided by an embodiment of the application.
  • FIG. 18 is a schematic diagram of the management interaction process of the YANG model provided by an embodiment of the application.
  • FIG. 19 is a schematic structural diagram of a YANG model management device provided by an embodiment of the application.
  • FIG. 20 is a schematic structural diagram of a YANG model management device provided by an embodiment of the application.
  • FIG. 21 is a schematic structural diagram of a YANG model management device provided by an embodiment of this application.
  • FIG. 22 is a schematic structural diagram of a YANG model management device provided by an embodiment of the application.
  • FIG. 23 is a schematic structural diagram of a network device provided by an embodiment of this application.
  • NETCONF is a network management protocol based on extensible markup language (XML). It provides a programmable method for configuring and managing network devices. Through the NETCONF protocol, parameters can be set and obtained. Value, get statistics, etc.
  • the NETCONF message uses XML format and has filtering capabilities, and each data item has a fixed element name and location, different devices of the same manufacturer have the same access method and result presentation method, and devices of different manufacturers also The same effect can be obtained by mapping XML. With the assistance of such network management software, using the NETCONF function will make the configuration management of network equipment easier and more efficient.
  • RESTCONF representational state transfer configuration
  • NETCONF the representational state transfer configuration
  • RESTCONF can be used to access data defined in YANG and use data storage defined in NETCONF based on HTTP bearers.
  • RRC Requirement For Comments
  • RESTCONF implements a simplified version of the restful-style NETCONF protocol.
  • PUT/POST/DELETE/GET based on hypertext transfer protocol (HTTP) is used to edit and query data defined by the YANG model, and POST operations are also used to execute The RPC method defined by the YANG model.
  • HTTP hypertext transfer protocol
  • the YANG model can be managed through both NETCONF and RESTCONF.
  • RFC 6022 stipulates that NETCONF uses ⁇ get-schema> operation to read the schema of a single model (module) or reads /netconf-state/schemas to obtain all schema lists through ⁇ get> operation.
  • RESTCONF reads the schema URL of the module through the YANG library, and then reads a single module schema resource through the GET method according to the uniform resource location (URL).
  • network equipment is managed by multiple network management equipment, such as network management equipment responsible for deployment and installation, network management equipment responsible for business configuration, network management equipment responsible for troubleshooting, etc.
  • the network management device can be a NETCONF/RESTCONF controller or a NETCONF/RESTCONF client.
  • the managed network devices can be related devices in the network, such as routers, switches, gateways, firewalls and other devices, and can also be servers or server-side devices.
  • Device 1, Device 2, and Device 3 are managed by Controller 1 and Controller 2, respectively.
  • Controller 1 is a network management device responsible for deployment and installation
  • controller 2 is a network management device responsible for service configuration and fault handling
  • device 1, device 2 and device 3 are managed by controller 1 and controller 2, respectively.
  • the software package in Figure 1 is only an example, and other software packages may also be included on the device.
  • the software package on the device can also be as shown in Figure 2.
  • NETCONF/RESTCONF controller or NETCONF/RESTCONF client used for remote management of network equipment, including equipment software installation, upgrade, and model packages corresponding to the functions supported by the software package, dynamic loading and unloading of models .
  • the operation defined by NETCONF or RESTCONF is the processing of all models or a single model of the specified data set (datastore), and the processing of the package data set is lacking.
  • the network management controller can only call the get-schema operation to read the YANG model schema (structure) supported in the device, and then use manual or machine to sequentially determine the business dependencies, classify and assemble, etc., which is error-prone, inefficient and error-prone .
  • the embodiment of this application provides a YANG model management method.
  • the method takes the network management device as the first network device and the managed device as the second network device as an example. Based on the package granularity, the device supports the model Set management, allowing network devices to perform fine-grained operations on related package model sets, and support different network management systems to update or delete device model sets.
  • the method includes the following processes:
  • the first network device determines a target YANG packet in the second network device, where the target YANG packet includes at least two service-related YANG models.
  • the YANG model may be packaged based on the service dimension, so as to divide YANG models of the same service dimension into one YANG package.
  • a YANG package includes at least two business-related YANG models.
  • the service-related YANG model in the second network device may be subdivided into multiple function packets.
  • the basic package includes a model set of basic functions that a certain service needs to rely on. Among them, the basic package is the YANG package that is dependent on other packages, and the feature package is the YANG package that depends on the basic package.
  • the first network device can read the YANG model information and the YANG packet information on the second network device.
  • the first network device obtains a processing instruction for the target YANG packet, and sends the processing instruction to the second network device.
  • the first network device can manage any YANG packet.
  • the processing instruction includes the identifier of the target YANG packet.
  • the identifier of the target YANG package includes the name of the target YANG package, or the name and version information of the target YANG package.
  • Type 1 The first instruction, the first instruction includes the identifier of the target YANG package, and the first instruction is used to instruct to read at least two service-related YANG models in the target YANG package corresponding to the identifier of the target YANG package One or more YANG models.
  • the first network device can read the target YANG packet in the second network device for query.
  • the first instruction may be implemented through get-package-schema, so that the first network device can read the package deployed in the second network device and the schema information in a certain package according to the package dimension.
  • the first network device sends the first RPC including the get-package-schema to the second network device, and the get-package-schema carries the identifier of the target YANG package.
  • the identifier of the target YANG package may be the name of the target YANG package, and may also include version information.
  • the version information may consist of numbers that serve as an identifier. Different versions of YANG packages have different version information.
  • the first RPC may be as shown in (1) or (2) in FIG. 4.
  • Type 2 The second instruction, the second instruction includes the identifier of the target YANG package, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package.
  • the first network device can load the target YANG packet to the second network device.
  • the second instruction can use bind-package-schema-to-datastore to realize that the first network device loads the target YANG package into the datastore of the second network device according to the package dimensions.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package at the loading location.
  • the first network device sends a second RPC including bind-package-schema-to-datastore to the second network device, where the bind-package-schema-to-datastore carries the loading location (such as datastore information); The identifier of the package to be loaded (such as package name); the package version to be loaded and other information.
  • the second RPC may be as shown in FIG. 5.
  • the second instruction also carries a command-line interface (command-line interface, CLI) script file.
  • the CLI script file is used to convert the YANG model in the target YANG package into a CLI script.
  • the YANG model in the target YANG package can be converted into a CLI script accordingly.
  • Type 3 The third instruction, the third instruction includes the identifier of the target YANG package, and the third instruction is used to instruct to query the YANG package that has a dependency on the target YANG package corresponding to the identifier of the target YANG package.
  • the first network device can query the YANG packets that have a dependency relationship with the target YANG packet in the second network device.
  • the YANG package that has a dependency relationship with the target YANG package includes the first YANG package that the target YANG model data package depends on, and the second YANG package that depends on the target YANG package.
  • the third instruction can be implemented through get-package-dependency, so that the first network device can query the datastore of the second network device for a certain package and all the second YANG packages that depend on the package and the target YANG model data package depends on The first YANG package.
  • the number of the first YANG packet and the second YANG packet may be one or more, which is not limited in the embodiment of the present application.
  • the first network device sends a third RPC including get-package-dependency to the second network device, where the get-package-dependency carries the read location (such as datastore information); the package identifier (such as package name) ; Information such as package version.
  • the third RPC may be as shown in FIG. 6.
  • Type 4 The fourth instruction, the fourth instruction includes the identification of the target YANG package, and the fourth instruction is used to instruct the deletion of the target YANG package corresponding to the identification of the target YANG package and the third YANG package that depends on the target YANG package.
  • the first network device can control the deletion of the target YANG packet on the second network device.
  • the fourth instruction can be implemented through delete-package-schema, so that the first network device controls the second network device to delete the target YANG package on the second network device and the third YANG package that depends on the target YANG package.
  • the first network device sends a fourth RPC including delete-package-schema to the second network device, where the delete-package-schema carries the read location (such as datastore information); the package identifier (such as package name) ; Information such as package version.
  • the fourth RPC may be as shown in FIG. 7.
  • the second network device receives a processing instruction for the target YANG packet sent by the first network device.
  • the second network device can receive processing instructions for the target YNAG packet sent by the first network device through the network. For example, if the first network device can send one or more processing instructions from Type 1 to Type 4 above, then the second network device Receive the corresponding processing instructions.
  • the second network device processes the target YANG packet according to the processing instruction.
  • the second network device processes the target YANG packet according to the processing instructions, including but not limited to one or more of the following processing methods:
  • Processing method 1 For the processing instruction including the first instruction of type one above, processing the target YANG packet according to the processing instruction includes: reading at least two business-related YANG models in the target YANG packet according to the first instruction One or more YANG models and corresponding structures in the target YANG packet; and one or more YANG models and corresponding structures in the at least two service-related YANG models in the target YANG packet are sent to the first network device.
  • the second network device sends the target overall schema information contained in the package to the first network device.
  • the second network device sends the target module schema list information contained in the package to the first network device.
  • the first network device after the first network device sends the processing instruction to the second network device, it further includes: one or more YANG models among at least two service-related YANG models in the target YANG packet and corresponding structures.
  • Processing method 2 For the processing instruction including the second instruction of the above type 2, processing the target YANG packet according to the processing instruction includes: loading the target YANG packet corresponding to the identifier of the target YANG packet according to the second instruction.
  • the second instruction further includes the loading location
  • the second instruction carries the loading location of the target YANG package and the identification of the target YANG package, therefore, the second network device loads the data at the loading location according to the second instruction.
  • the identifier of the target YANG package corresponds to the target YANG package.
  • the second instruction also carries a CLI script file; correspondingly, the second network device processes the target YANG packet according to the processing instruction, and further includes: according to the script file, the YANG model in the target YANG packet Converted to CLI script.
  • Processing method 3 For the processing instruction including the third instruction of the above type three, processing the target YANG package according to the processing instruction, including: querying the first YANG package list and/or dependencies on which the target YANG package depends according to the third instruction The second YANG package list of the target YANG package; the first YANG package list on which the target YANG package depends and/or the second YANG package list on which the target YANG package depends and/or the second YANG package list that depends on the target YANG package are sent to the first network device.
  • the list of all packages on which the target YANG packet depends on the target YANG packet sent by the second network device to the first network device includes the following information:
  • the package identifier of the first YANG package (such as package name); the package version; the schema information contained in the package, etc.
  • the second YANG package list that depends on the target YANG package includes the following information:
  • the package identifier of the second YANG package (such as package name); the package version; the schema information contained in the package, etc.
  • the method further includes: receiving the first YANG packet list on which the target YANG packet depends and/or the second YANG packet list on which the target YANG packet depends.
  • Processing method 4 For the processing instruction including the fourth instruction of the above type four, the target YANG package is processed according to the processing instruction, including: deleting the target YANG package corresponding to the identifier of the target YANG package and the dependent target YANG package according to the fourth instruction The second YANG package.
  • the fourth command can also carry the reading position information of the target YANG packet, that is, the fourth command carries the reading position information of the target YANG packet and the identifier of the target YANG packet. Therefore, the second network device can delete it accordingly.
  • Target YANG package since the second network device can obtain the dependency of the target YANG model, after deleting the target YANG package, the second YANG package that depends on the target YNAG model data package can also be deleted.
  • the embodiment of the present application does not limit the specific processing methods.
  • the NETCONF monitoring model can also be extended.
  • the target YANG package can be loaded for the NETCONF monitoring model to achieve the NETCONF monitoring model. Expand.
  • the foregoing case of loading the target YANG package may be loading a YANG package that is not installed on the second network device, or it may be an existing YANG package on the second network device.
  • the method provided by the embodiments of the present application based on the extended new operation instructions, allows reading package schema, reading package dependencies, loading datastore package schema, deleting datastore package schema, and updating
  • the NETCONF state model schema is extended. Therefore, the method provided in this application can distinguish YANG packets to perform refined read-write management, which can reduce errors and improve management efficiency.
  • the first network device including controller 1 and controller 2
  • the second network device as device 3.
  • the software package included on device 3 includes basic function package and L3VPN function package, and the controller queries device 3
  • the controller queries device 3
  • load the newly written target YANG package into the device 3 as an example to illustrate the management method of the YANG model.
  • the method includes the following processes:
  • the controller 1 delivers the first basic function package and related one or more YANG package schemas to the device 3.
  • the basic function package can be IETF-device-pkg, xxx-device-pkg, openconfig-device-pkg, and ietf YANG can be specified when the controller 1 installs the software. It can also be that when device 3 installs the software, if it is not specified, a certain YANG package is selected by default, and the certain YANG package selected by default may be a manufacturer's private YANG package.
  • Device 3 verifies the basic function package and the package schema. If there are multiple package schemas, select the default or specified YANG package schema. Device 3 writes the corresponding YANG package schema into the device datastore, and updates the status of the YANG package.
  • the controller 2 reads the package information and model information on the device 3.
  • the controller 2 reads the schema corresponding to the YANG package through get-package-schema.
  • the name of the YANG package is xxx-device-pkg, version 3.1.2, revision-date 2017-3-2.
  • controller 2 manages the three devices from device 1 to device 3. Controller 2 can read the schema corresponding to the YANG package on device 3.
  • Device 3 returns YANG packet information and packet-related schema information to controller 2.
  • the controller 2 compares the difference between the service feature schema and the YANG package on the device 3, and determines the feature package that needs to be loaded.
  • the controller 2 compares the difference between the service feature schema and the YANG packet on the device 3, it determines that the feature package to be loaded is L3VPN, that is, the controller 2 confirms that the device 3 needs to update the feature package.
  • the controller 2 requests the controller 1 to load the feature package, such as requesting to load the L3VPN feature package to install.
  • the controller 1 verifies whether the request complies with the service policy, and if it is passed, delivers the second feature package and one or more YANG package schemas related to the feature package. If there are more than one, mark the default package.
  • the second feature package delivered by controller 1 to device 3 is L3VPN yang package, such as L3VPN feature package and YANG package schema, there may be one or more YANG package, such as IETF-L3VPN-pkg, or xxx -L3VPN-pkg two kinds.
  • Device 3 loads and analyzes the model in the YANG package of the specified version, and rolls back if it is wrong.
  • Device 3 loads and verifies the L3VPN function package and L3VPN Yang package, and selects the default IETF-L3VPN-pkg. If it passes, and update the YANG package status. If an error occurs, roll back, for example, reload the analysis.
  • a device can install one software package, and the software package contains software with different functions, and this function corresponds to a YANG package. Therefore, after this step 908, device 3 adds two YANG packages, as shown in FIG. 12.
  • the controller 1 updates the management of the device 3.
  • controller 1 informs controller 2 that the response feature package has been installed.
  • the controller 2 reads information about the YANG packet in the device 3.
  • the controller 2 reads the schema corresponding to the YANG package through the processing instruction get-package-schema, and saves it.
  • the processing instructions are shown in Figure 13.
  • the controller 2 analyzes the service characteristics and judges that the current IETF-L3VPN-pkg needs to switch the current device datastore model to use xxx-L3VPN-pkg. Send RPC to device 3 to update the datastore model.
  • controller 2 changes the YANG package schema of device 3 through ⁇ create-package-schema>.
  • the controller 2 can query the updated status of the datastore and package.
  • the updated status of the datastore may be as shown in FIG. 14, and the updated status of the package may be as shown in FIG. 15.
  • controller 2 can also issue the L3VPN feature configuration through xxx-L3VPN-pkg, as shown in Figure 16.
  • the method provided by the embodiments of this application allows reading package schema and loading datastore package schema based on extended new operation instructions. Since YANG packages can be distinguished, refined management can be performed, errors can be reduced, and management can be improved. effectiveness.
  • the first network device is still used as the controller, including controller 1 and controller 2, and the second network device is device 3.
  • the software package included on device 3 includes the basic function package and the feature package L3VPN package.
  • the controller queries the device 3 For the information of the existing YNAG model data package, query the target YANG package and update the target YNAG model data package as an example to explain the management method of the YANG model. Referring to Figure 17, the method includes the following processes:
  • the controller 1 reads the dependency information of the L3VPN package of the current Datastore of the device 3 through the get-package-dependency operation. 1702, Device 3 returns the dependency of the yang package.
  • device 3 is the router in FIG. 2 as an example.
  • the device includes L3VPN multicast packets, L3VPN packets, MPLS packets, and Device packets.
  • the Device packet can be a YANG packet of protocols such as L2 protocol and L3 protocol.
  • L3VPN multicast depends on the L3VPN package and the device package, and the L3VPN package depends on the device package. Then L3VPN relies on the device package and is relied on by L3VPN multicast. In addition, it also includes version dependencies.
  • the controller 1 determines the upgrade strategy according to the version information of the current L3VPN package and the dependency relationship, and returns the L3VPN package dependency information to the device 3.
  • the upgrade strategy includes: if the new L3VPN package is compatible with the current device package version, and whether the L3VPN multicast package is compatible with the new L3VPN package version. If they are compatible, the L3VPN package and its schema upgrade will be issued. If the new L3VPN package is not compatible with the previous device package version, or the L3VPN multicast package version is not compatible with the new L3VPN package, you need to deliver the L3VPN package and device package, or the L3VPN multicast package and its YANG package schema upgrade.
  • controller 1 also needs to save the current configuration data of the L3VPN and device or other services. It is used to restore data after YANG package upgrade or software corresponding process upgrade.
  • Device 3 loads and parses the L3VPN yang packet. Terminate the original L3VPN component process and start the new L3VPN component process. In addition, if other dependent packages or dependent packages are also downloaded, the device 3 needs to restart the process corresponding to the relevant package. Among them, other dependent packages refer to other YANG packages that depend on the L3VPN yang package, and dependent packages refer to the YANG packages that the L3VPN yang package depends on.
  • the method provided in the embodiment of the present application also supports the update and upgrade management of the YANG package. For example, refer to the following steps.
  • the controller 1 sends the configuration data to the device 3 through copy-config, so that the device 3 restores the configuration data.
  • the device 3 restores the L3VPN configuration data. If there are other packages associated, you also need to reply to the configuration data related to other packages.
  • the controller 2 reads the yang package schema of the new L3VPN package, and issues a new L3VPN service configuration.
  • the first network device is still used as the controller, including controller 1 and controller 2, and the second network device is device 3.
  • the software package included on device 3 includes the basic function package and the feature package L3VPN package, and the controller loads the device 3 For the YNAG model data package, delete the target YANG package as an example to explain the management method of the YANG model. Referring to Figure 18, the method includes the following processes:
  • the controller 1 sends package installation information to the device 3 one or more times through bind-package-schema or software installation.
  • controller 1 installs multiple package schemas on device 3 multiple times, such as multiple versions of L3VPN, multiple versions of device, or multiple versions of L3VPN.
  • Device 3 verifies and installs the YANG package, and generates the YANG package status.
  • the controller 2 requests the controller 1 to delete the L3VPN and associated service functions.
  • the device 3 no longer supports the L3VPN service, and the controller 2 requests the controller 1 to delete the L3VPN and related service components, which triggers the deletion operation provided in this embodiment.
  • the controller 1 reads the dependency information between the YANG packages in the device 3 through the get-package-dependency operation.
  • the controller 1 reads the dependency of the L3VPN package of the current Datastore in the device 3 through the get-package-dependency operation.
  • Device 3 returns the dependency relationship of the yang package, and the dependency relationship includes all packages that depend on the package and the packages that the package depends on.
  • L3VPN multicast depends on the L3VPN package and the device package, and the L3VPN package depends on the device package.
  • L3VPN relies on the device package, but is relied on by L3VPN multicast. Then the device 3 returns the information of the L3VPN package and the device package.
  • the controller 1 queries whether the package that depends on the package can be deleted, and if it can, executes the next step 1807.
  • the controller 1 determines the deletion strategy through the version information of the current L3VPN package and the dependency relationship.
  • the deletion strategy includes: If all versions of L3VPN packages and dependent L3VPN multicast packages need to be deleted.
  • Device 3 deletes the L3VPN packet and the current L3VPN multicast packet. If there is an error, go back, for example, perform the delete operation again.
  • device 3 deletes configuration data corresponding to all L3VPN packets. Stop the processes corresponding to L3VPN and L3VPN multicast.
  • Device 3 returns an RPC response, that is, the operation result, to controller 1.
  • Controller 1 returns to controller 2 a successful response that the service component has been deleted.
  • the method provided by the embodiment of the present application reads the dependency of the package, loads the package schema of the datastore, and deletes the package schema of the datastore based on the extended new operation instructions. Therefore, it is possible to distinguish YANG packages for refined management. It can reduce errors and improve management efficiency.
  • the embodiment of the present application provides a YANG model management device, which is applied to a first network device and is used to perform the functions performed by the first network device in FIG. 3 above.
  • the device includes:
  • the determining module 1901 is used to execute step 301 in FIG. 3. That is, it is used to determine the target YANG packet in the second network device, and the target YANG packet includes at least two service-related YANG models.
  • the generating module 1902 is used to generate processing instructions for the target YANG package.
  • the processing instructions include the identification of the target YANG package.
  • the identification of the target YANG package is used to identify the target YANG package.
  • the identification of the target YANG package includes the name of the target YANG package, or the target YANG. The name and version information of the package.
  • the sending module 1903 is configured to send a processing instruction to the second network device.
  • the above-mentioned generating module 1902 and sending module 1903 are used to execute step 302 in FIG. 3.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read at least two business related services in the target YANG package corresponding to the identifier of the target YANG package.
  • One or more YANG models in the YANG model are included in the processing instruction.
  • the device referring to Figure 20, the device also includes:
  • the receiving module 1904 is configured to receive one or more YANG models and structures corresponding to the one or more YANG models.
  • the processing instruction further includes a second instruction, the second instruction includes an identifier of the target YANG package, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package.
  • the second instruction further includes a loading location, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package at the loading location.
  • the second instruction also carries a script file of the command line interface CLI, and the script file is used to convert the YANG model in the target YANG package into a CLI script.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct to query YANG packages that have a dependency on the target YANG package corresponding to the identifier of the target YANG package;
  • the device also includes:
  • the receiving module 1904 is configured to receive the first YANG package list on which the target YANG package depends or the second YANG package list on which the target YANG package depends.
  • the above-mentioned receiving module 1904 is used to perform the receiving steps involved in the first network device under step 304 in FIG. 3.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes the identification of the target YANG package, and the fourth instruction is used to instruct the deletion of the target YANG package corresponding to the identification of the target YANG package and the third instruction that depends on the target YANG package.
  • the fourth instruction includes the identification of the target YANG package
  • the fourth instruction is used to instruct the deletion of the target YANG package corresponding to the identification of the target YANG package and the third instruction that depends on the target YANG package.
  • An embodiment of the present application provides a YANG model management device, which is used in a second network device, and the second network device is used to perform the functions performed by the second network device in FIG. 3 above.
  • the device includes:
  • the receiving module 2101 is configured to perform step 303 in FIG. 3 above, that is, to receive a processing instruction for a target YANG packet sent by the first network device.
  • the target YANG packet includes at least two service-related YANG models, and the processing instruction includes the target YANG.
  • the identifier of the package is used to identify the target YANG package.
  • the identifier of the target YANG package includes the name of the target YANG package, or the name and version information of the target YANG package.
  • the processing module 2102 is configured to execute step 304 in FIG. 3, that is, to process the target YANG packet corresponding to the identifier of the target YANG packet according to the processing instruction.
  • the processing instruction includes a first instruction, the first instruction includes an identifier of the target YANG package, and the first instruction is used to instruct to read at least two business related services in the target YANG package corresponding to the identifier of the target YANG package.
  • One or more YANG models in the YANG model are included in the processing instruction.
  • the processing module 2102 is further configured to read one or more YANG models and corresponding structures of the at least two service-related YANG models corresponding to the identifier of the target YANG packet according to the first instruction;
  • the device also includes:
  • the sending module 2103 is configured to send one or more YANG models and corresponding structures to the first network device.
  • the processing instruction further includes a second instruction, the second instruction includes an identifier of the target YANG package, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package.
  • the processing module 2102 is further configured to load the target YANG package corresponding to the identifier of the target YANG package according to the second instruction.
  • the second instruction also includes a loading location, and the second instruction is used to instruct to load the target YANG package corresponding to the identifier of the target YANG package at the loading location.
  • the processing module 2102 is configured to load the target YANG package corresponding to the identifier of the target YANG package at the loading position according to the second instruction.
  • the second instruction also carries a CLI script file, and the script file is used to convert the YANG model in the target YANG package into a CLI script;
  • the processing module 2102 is further configured to convert the YANG model in the target YANG package into a CLI script according to the CLI script file.
  • the processing instruction further includes a third instruction, the third instruction includes an identifier of the target YANG package, and the third instruction is used to instruct to query YANG packages that have a dependency on the target YANG package corresponding to the identifier of the target YANG package.
  • the processing module 2102 is further configured to query the first YANG package list on which the target YANG package depends and/or the second YANG package list on which the target YANG package depends, according to the third instruction.
  • the device also includes:
  • the sending module 2103 is configured to send to the first network device a first YANG packet list on which the target YANG packet depends and/or a second YANG packet list on which the target YANG packet depends.
  • the processing instruction further includes a fourth instruction, the fourth instruction includes the identification of the target YANG package, and the fourth instruction is used to instruct the deletion of the target YANG package corresponding to the identification of the target YANG package and the third instruction that depends on the target YANG package. Two YANG packages.
  • the processing module 2102 is further configured to delete the target YANG package corresponding to the identifier of the target YANG package and the third YANG package dependent on the target YANG package according to the fourth instruction.
  • the foregoing sending module 2103 is used to execute the sending steps involved in the second network device in step 304 in FIG. 3.
  • an embodiment of the present application also provides a network device 1000.
  • the network device 1000 shown in FIG. 23 is configured to perform operations involved in the foregoing network device management method.
  • the network device 1000 includes a memory 1001, a processor 1002, and an interface 1003, and the memory 1001, the processor 1002, and the interface 1003 are connected by a bus 1004.
  • At least one instruction is stored in the memory 1001, and at least one instruction is loaded and executed by the processor 1002 to implement any one of the above-mentioned YANG model management methods.
  • the interface 1003 is used to communicate with other devices in the network.
  • the interface 1003 may be implemented in a wireless or wired manner.
  • the interface 1003 may be a network card.
  • the network device 1000 can communicate with the server through the interface 1003.
  • the processor 1002 may be used to execute the functions of the determining module 1901 and the generating module 1902 shown in FIG. 19 and FIG. And the functions of the sending module 1903 and the receiving module 1904 shown in FIG. 20.
  • the processor 1002 can be used to perform the functions of the processing module 2102 shown in FIGS. 21 and 22, and the interface 1003 is used to implement the receiving module shown in FIGS. 21 and 22. 2101 and the function of the sending module 2103.
  • FIG. 23 only shows a simplified design of the network device 1000.
  • a network device can include any number of interfaces, processors or memories.
  • the above-mentioned processor may be a central processing unit (CPU), other general-purpose processors, digital signal processing (DSP), application specific integrated circuit (ASIC), Field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or any conventional processor. It is worth noting that the processor may be a processor that supports an advanced reduced instruction set machine (advanced RISC machines, ARM) architecture.
  • the foregoing memory may include a read-only memory and a random access memory, and provide instructions and data to the processor.
  • the memory may also include non-volatile random access memory.
  • the memory can also store device type information.
  • the memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory, wherein the non-volatile memory can be a read-only memory (read-only memory, ROM) , Programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting illustration, many forms of RAM are available.
  • static random access memory static random access memory
  • dynamic random access memory dynamic random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate synchronous dynamic random access Memory double data date SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • serial link DRAM SLDRAM
  • direct memory bus random access memory direct rambus RAM
  • a YANG model management system is also provided.
  • the system includes a first network device and a second network device.
  • the first network device is used to perform the functions performed by the first network device in the above-mentioned YANG model management method, and the second network device The network device is used to execute the function performed by the second network device in the above-mentioned YANG model management method.
  • a computer-readable storage medium is also provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement any one of the above-mentioned YANG model management methods.
  • This application provides a computer program.
  • the computer program When the computer program is executed by a computer, it can cause a processor or computer to execute various operations and/or processes corresponding to the foregoing method embodiments.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk).

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了YANG模型的管理方法、装置、系统、设备及存储介质。该方法包括:第一网络设备确定第二网络设备中目标YANG包,所述目标YANG包包括至少两个业务相关的YANG模型。所述第一网络设备生成针对所述目标YANG包的处理指令,并向第二网络设备发送所述处理指令。所述处理指令包括所述目标YANG包的标识,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息。本申请基于扩展的新的操作指令,能够针对YANG包进行区分处理,以进行精细化读写管理,能够减少错误,提高管理效率。

Description

YANG模型的管理方法、装置、系统、设备及存储介质
本申请要求于2019年10月18日提交的申请号为201910994980.4、发明名称为“管理网络设备的方法、设备和系统”的中国专利申请的优先权,以及于2019年11月01日提交中国国家知识产权局、申请号为201911061600.8、申请名称为“YANG模型的管理方法、装置、系统、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别涉及一种YANG模型的管理方法、装置、系统、设备及存储介质。
背景技术
随着网络规模逐渐变得庞大而且复杂,网络设备越来越多。为了能够对网络设备进行管理,网络配置协议(network configuration protocol,NETCONF)作为一种可编程的、对网络设备进行配置和管理的协议应运而生。此外,为了解决配置和管理实践中遇到的问题和不足,YANG建模语言被广泛应用起来。
YANG是互联网工程任务组(internet engineering task force,IETF)标准组织定义的一种将网络配置管理数据模型化描述的语言,以支持NETCONF客户端和服务端之间数据的完整描述,通过YANG模型来描述NETCONF客户端和服务端之间交互的配置数据、状态数据、远程过程调用(remote procedure call,RPC)和通知(Notification)。因此,如何对YANG模型进行管理,是网络设备管理过程中亟待解决的问题。
发明内容
本申请实施例提供了一种YANG模型的管理方法、装置、系统、设备及存储介质,以解决相关技术提供的问题,技术方案如下:
第一方面,提供了一种YANG模型的管理方法,所述方法包括:第一网络设备确定第二网络设备中的目标YANG包,该目标YANG包包括至少两个业务相关的YANG modules(模型);第一网络设备生成针对该目标YANG包的处理指令,该处理指令包括目标YANG包的标识,之后,第一网络设备将该处理指令发送给第二网络设备,其中,目标YANG包的标识用于标识该目标YANG包,且该目标YANG包的标识包括目标YANG包的名称,或者,该目标YANG包的标识包括该YANG包的名称及版本信息。
基于扩展的新的操作指令,能够针对YANG包进行区分,以进行精细化读写管理,能够减少错误,提高管理效率。
在示例性实施例中,所述处理指令包括第一指令,该第一指令包括所述目标YANG 包的标识,该第一指令用于指示读取与目标YANG包的标识对应的目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型;
第一网络设备向第二网络设备发送处理指令之后,还接收目标YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构。
在示例性实施例中,所述处理指令还包括第二指令,该第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与该目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载该目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还携带命令行接口CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,所述处理指令还包括第三指令,所述第三指令包括目标YANG包的标识,该第三指令用于指示查询与目标YANG包具有依赖关系的YANG包;
第一网络设备向第二网络设备发送所述处理指令之后,还包括:接收所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
例如,第一网络设备接收目标YANG包所依赖的第一YANG包列表,或者,第一网络设备接收依赖该目标YANG包的第二YANG包列表,或者,该第一网络设备接收目标YANG包所依赖的第一YANG包列表和依赖该目标YANG包的第二YANG包列表。
在示例性实施例中,所述处理指令还包括第四指令,该第四指令包括所述目标YANG包的标识,该第四指令用于指示删除与目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第二YANG包。
第二方面,提供一种YANG模型的管理方法,所述方法包括:第二网络设备接收第一网络设备发送的针对目标YANG包的处理指令,该目标YANG包包括至少两个业务相关的YANG模型,该处理指令包括用于标识目标YANG包的目标YANG包的标识,该目标YANG包的标识包括所述目标YANG包的名称,或者,该目标YANG包的标识包括目标YANG包的名称及版本信息;之后,第二网络设备根据该处理指令对与目标YANG包的标识对应的目标YANG包进行处理。
在示例性实施例中,所述处理指令包括第一指令,该第一指令包括所述目标YANG包的标识,该第一指令用于指示读取与目标YANG包的标识对应的目标YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
第二网络设备在根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理时,根据该第一指令读取与目标YANG包的标识对应的一个或多个YANG模型以及对应的结构;之后,向所述第一网络设备发送该一个或多个YANG模型以及对应的结构。
在示例性实施例中,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所述目标YANG包的标识对应的目标YANG包;
所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,包括:根据所述第二指令加载与所述目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与该目标YANG包的标识对应的目标YANG包;
所述根据所述第二指令加载与目标YANG包的标识对应的目标YANG包,包括:根据所述第二指令在所述加载位置加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还携带CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本;所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,还包括:根据所述CLI的脚本文件将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与所述目标YANG包具有依赖关系的YANG包;
所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,还包括:根据所述第三指令查询所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表;向所述第一网络设备发送所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
其中,第二网络设备根据第三指令查询所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表包括查询所述目标YANG包所依赖的第一YANG包列表和依赖所述目标YANG包的第二YANG包列表中的一个或组合。
在示例性实施例中,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包;
所述根据所述处理指令对所述目标YANG包的标识对应的目标YANG包进行处理,还包括:根据所述第四指令删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
第三方面,提供了一种YANG模型的管理装置,所述装置应用于第一网络设备,所述装置包括:
确定模块用于确定第二网络设备中目标YANG包,所述目标YANG包包括至少两个业务相关的YANG模型;
生成模块用于生成针对所述目标YANG包的处理指令,所述处理指令包括所述目标YANG包的标识,所述目标YANG包的标识用于标识所述目标YANG包,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息;
发送模块用于向所述第二网络设备发送所述处理指令。
在示例性实施例中,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的目标YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
该装置,还包括:接收模块用于接收所述一个或多个YANG模型以及与一个或多个YANG模型对应的结构。
在示例性实施例中,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还携带CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与目标YANG包具有依赖关系的YANG包;
所述装置,还包括:接收模块用于接收所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
在示例性实施例中,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
第四方面,提供了一种YANG模型的管理装置,所述装置用于第二网络设备,所述装置包括:
接收模块用于接收第一网络设备发送的针对目标YANG包的处理指令,所述目标YANG包包括至少两个业务相关的YANG模型,所述处理指令包括所述目标YANG包的标识,该YANG包的标识用于标识所述目标YANG包,目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息;
处理模块用于根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理。
在示例性实施例中,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的目标 YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
所述处理模块还用于根据所述第一指令读取与所述目标YANG包的标识对应的所述至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构;
所述装置还包括:
发送模块用于向所述第一网络设备发送所述一个或多个YANG模型以及对应的结构。
在示例性实施例中,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所述目标YANG包的标识对应的目标YANG包;
所述处理模块还用于根据所述第二指令加载与所述目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包;
所述处理模块用于根据所述第二指令在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包。
在示例性实施例中,所述第二指令还携带CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本;
所述处理模块还用于根据所述CLI的脚本文件将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与目标YANG包具有依赖关系的YANG包;
所述处理模块还用于根据所述第三指令查询所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表;
所述装置,还包括:发送模块,用于向所述第一网络设备发送所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
在示例性实施例中,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包;
所述处理模块还用于根据所述第四指令删除所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
第五方面,还提供了一种第一网络设备,所述第一网络设备用于执行上述第一方面任一所述的方法。
第六方面,还提供了一种第二网络设备,所述第二网络设备用于执行上述第二方 面任一所述的方法。
第七方面,还提供一种网络设备,所述设备包括:存储器及处理器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行,以实现上述第一方面或第二方面任一所述的方法。
第八方面,还提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如上第一方面或第二方面任一所述的方法。
第九方面,还提供了一种YANG模型的管理系统,该系统包括第一网络设备和第二网络设备;第一网络设备执行上述第一方面提供的任一所述的方法,所述第二网络设备执行上述第二方面提供的任一所述的方法。
提供了另一种通信装置,该装置包括:收发器、存储器和处理器。其中,该收发器、该存储器和该处理器通过内部连接通路互相通信,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制收发器接收信号,并控制收发器发送信号,并且当该处理器执行该存储器存储的指令时,使得该处理器执行上述任一种可能的实施方式中的方法。
作为一种示例性实施例,所述处理器为一个或多个,所述存储器为一个或多个。
作为一种示例性实施例,所述存储器可以与所述处理器集成在一起,或者所述存储器与处理器分离设置。
在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。
提供了一种计算机程序(产品),所述计算机程序(产品)包括:计算机程序代码,当所述计算机程序代码被计算机运行时,使得所述计算机执行上述各方面中的方法。
提供了一种芯片,包括处理器,用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的通信设备执行上述各方面中的方法。
提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中的代码,当所述代码被执行时,所述处理器用于执行上述各方面中的方法。
附图说明
图1为本申请实施例提供的YANG模型的管理系统结构示意图;
图2为本申请实施例提供的网络设备内的YANG包示意图;
图3为本申请实施例提供的YANG模型的管理方法流程图;
图4为本申请实施例提供的处理指令的结构示意图;
图5为本申请实施例提供的处理指令的结构示意图;
图6为本申请实施例提供的处理指令的结构示意图;
图7为本申请实施例提供的处理指令的结构示意图;
图8为本申请实施例提供的处理指令的结构示意图;
图9为本申请实施例提供的YANG模型的管理过程的交互示意图;
图10为本申请实施例提供的YANG包的结构示意图;
图11为本申请实施例提供的YANG模型的管理系统结构示意图;
图12为本申请实施例提供的YANG模型的管理系统结构示意图;
图13为本申请实施例提供的处理指令的结构示意图;
图14为本申请实施例提供的处理指令的结构示意图;
图15为本申请实施例提供的处理指令的结构示意图;
图16为本申请实施例提供的YANG包的结构示意图;
图17为本申请实施例提供的YANG模型的管理交互过程示意图;
图18为本申请实施例提供的YANG模型的管理交互过程示意图;
图19为本申请实施例提供的YANG模型的管理装置的结构示意图;
图20为本申请实施例提供的YANG模型的管理装置的结构示意图;
图21为本申请实施例提供的YANG模型的管理装置的结构示意图;
图22为本申请实施例提供的YANG模型的管理装置的结构示意图;
图23为本申请实施例提供的网络设备的结构示意图。
具体实施方式
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
随着网络规模逐渐变得庞大而且复杂,网络设备越来越多。为了能够对网络设备进行管理,NETCONF应运而生。NETCONF是一种基于可扩展标记语言(extensible markup language,XML)的网络管理协议,它提供了一种可编程的、对网络设备进行配置和管理的方法,通过该NETCONF协议能够设置参数、获取参数值、获取统计信息等。
由于NETCONF报文使用XML格式,具有过滤能力,而且每一个数据项都有一个固定的元素名称和位置,使得同一厂商的不同设备具有相同的访问方式和结果呈现方式,不同厂商之间的设备也可以经过映射XML得到相同的效果。在这样的网管软件的协助下,使用NETCONF功能会使网络设备的配置管理工作,变得更简单更高效。
除NETCONF之外,表现层状态转换协议(representational state transfer configuration,RESTCONF)作为一种RESTful协议,基于HTTP承载可用于访问YANG中定义的数据,以及使用NETCONF中定义的数据存储。其中关于YANG的定义和描述可以参考征求意见稿(Requirement For Comments,RFC)6020和RFC7950的相关描述。RESTCONF实现了restful风格的简化版NETCONF协议,例如,基于超文本传输协议(hypertext transfer protocol,HTTP)的PUT/POST/DELETE/GET用来编辑、查询YANG模型定义的数据,POST操作还用来执行YANG模型定义的RPC方法。
也就是说,通过NETCONF和RESTCONF均可以对YANG模型进行管理。例如, RFC 6022中规定NETCONF使用<get-schema>operation来读取单个模型(module)的schema或者通过<get>operation读取/netconf-state/schemas获得全部schema list。又例如,在RFC 8040中,RESTCONF通过YANG library读取module的schema URL,之后根据统一资源定位符(uniform resource location,URL),通过GET method读取单个module schema resource。
无论是通过NETCONF对YANG模型进行管理,还是通过RESTCONF对YANG模型进行管理,由于网络设备可能会被多个网络管理设备进行管理,如何对网络设备上的YANG模型进行管理,是提高网络设备管理效率的关键。
例如,以如图1所示的网络系统为例,网络设备被多个网络管理设备进行管理,如负责部署安装的网络管理设备,负责业务配置的网络管理设备,负责故障处理的网络管理设备等,该网络管理设备可以为NETCONF/RESTCONF控制器或NETCONF/RESTCONF客户端。被管理的网络设备可以是网络中的相关的设备,例如路由器,交换机,网关,防火墙等设备,还可以是服务器或服务端设备。例如,图1中,设备1、设备2和设备3分别被控制器1和控制器2管理。控制器1是负责部署安装的网络管理设备,控制器2是负责业务配置和故障处理的网络管理设备,设备1、设备2和设备3分别被控制器1和控制器2管理。设备1上有多个软件包对应的YANG package,如IETF-device-pkg-2019-01-10@1.1.0、IETF-L3VPN-pkg-2019-08-01@1.0.0和Xxx-L3VPN-pkg-2017-01-10@5.1.0。图1中的软件包仅为举例说明,设备上还可以包括其他软件包。例如,设备上的软件包还可如图2所示。
其中,NETCONF/RESTCONF控制器或NETCONF/RESTCONF客户端:用于对网络设备进行远程管理,包括设备的软件安装,升级,以及软件包支持的功能所对应的模型包,模型的动态加载和去加载。NETCONF/RESTCONF设备(device)或NETCONF/RESTCONF服务器(server):执行客户端调用的协议操作,服务器可以向客户端返回操作的结果。
然而,网络设备在对YANG包(package)进行生命周期管理时,NETCONF或RESTCONF定义的操作是对指定数据集(datastore)的全部模型或单个模型的处理,缺少对Package数据集的处理。此外,网管控制器只能调用get-schema操作读取设备内支持的YANG模型schema(结构),之后通过人工或机器依次判断业务依赖关系,进行分类、组装等工作,容易出错效率低下且容易出错。
对此,本申请实施例提供了一种YANG模型的管理方法,该方法以网络管理设备为第一网络设备,被管理的设备为第二网络设备为例,基于package粒度,对设备所支持模型集进行管理,允许网络设备对相关package模型集进行细粒度的操作,并支持不同网管系统对设备模型集进行更新或删除操作。参见图3,该方法包括如下几个过程:
301,第一网络设备确定第二网络设备中的目标YANG包,目标YANG包包括至少两个业务相关的YANG模型。
在本申请实施例中,第二网络设备中已安装有多种YANG模型,为了便于管理,可基于业务维度对YANG模型进行包划分,以将相同业务维度的YANG模型划分到一个YANG包中。也就是说,一个YANG包中包括至少两个业务相关的YANG模型。关于对YANG包的划分方式,本申请实施例不进行限定。示例性地,可以将第二网络设备中业务相关的YANG模型细分为多个功能小包。例如,将第二网络设备中的YANG包划分之后,基础包中包括某业务需依赖的基本功能的模型集合。其中,基础包是被 其他包所依赖的YANG包,特性包是依赖该基础包的YANG包。
无论以哪种方式对第二网络设备中的YANG包进行划分,第一网络设备可以读取第二网络设备上的YANG模型信息及YANG包信息。
302,第一网络设备获取针对目标YANG包的处理指令,向第二网络设备发送处理指令。
由于第二网络设备上包括多种YANG包,第一网络设备可以对任意YANG包进行管理,为了能够明确是对哪个YANG包进行处理,该处理指令包括目标YANG包的标识。示例性地,该目标YANG包的标识包括目标YANG包的名称,或者该目标YANG包的名称及版本信息。此外,在本申请实施例中,处理方式也可以有多种,因而第一网络设备确定目标YANG包后,获取针对目标YANG包的处理指令,包括但不限于如下一种或多种类型的指令:
类型一:第一指令,该第一指令包括目标YANG包的标识,该第一指令用于指示读取与目标YANG包的标识对应的目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型。
针对类型一的第一指令,第一网络设备可对第二网络设备中的目标YANG包进行读取,以进行查询。例如,第一指令可通过get-package-schema实现,从而实现第一网络设备按照包的维度读取第二网络设备内部署的yang package和某一package内的schema信息。
示例性地,第一网络设备向第二网络设备发送包括get-package-schema的第一RPC,该get-package-schema中携带目标YANG包的标识。
其中,目标YANG包的标识可以是目标YANG包的名称(name),还可以包括版本信息,版本信息可以由起到标识作用的数字组成,不同版本的YANG包的版本信息不同。例如,该第一RPC可如图4中的(1)或者(2)所示。
类型二:第二指令,第二指令包括目标YANG包的标识,该第二指令用于指示加载与目标YANG包的标识对应的目标YANG包。
针对类型二的第二指令,第一网络设备可对第二网络设备加载目标YANG包。例如,第二指令可通过bind-package-schema-to-datastore,实现第一网络设备按照包的维度向第二网络设备的datastore中加载目标YANG包。
在示例性实施例中,该第二指令还包括加载位置,则第二指令用于指示在加载位置加载与该目标YANG包的标识对应的目标YANG包。
示例性地,第一网络设备向第二网络设备发送包括bind-package-schema-to-datastore的第二RPC,该bind-package-schema-to-datastore中携带加载的位置(如datastore信息);需要加载的package标识(如package name);需要加载的package版本等信息。例如,该第二RPC可如图5所示。
在示例性实施例中,该第二指令还携带命令行接口(command-line interface,CLI)的脚本文件。该CLI的脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本,对于支持netconf yang接口的设备,可以据此将所述目标YANG包中的YANG 模型转换为CLI脚本。
类型三:第三指令,第三指令包括目标YANG包的标识,第三指令用于指示查询与目标YANG包的标识对应的目标YANG包具有依赖关系的YANG包。
针对类型三的第三指令,第一网络设备可对第二网络设备中与目标YANG包具有依赖关系的YANG包进行查询。其中,与目标YANG包具有依赖关系的YANG包包括目标YANG模型数据包依赖的第一YANG包,以及依赖目标YANG包的第二YANG包。例如,第三指令可通过get-package-dependency实现,从而实现第一网络设备查询第二网络设备的Datastore某一包及所有依赖于该包的第二YANG包以及该目标YANG模型数据包所依赖的第一YANG包。
需要说明的是,第一YANG包和第二YANG包的数量可以为一个或多个,本申请实施例对此不进行限定。
示例性地,第一网络设备向第二网络设备发送包括get-package-dependency的第三RPC,该get-package-dependency中携带读取的位置(如datastore信息);package标识(如package name);package版本等信息。例如,该第三RPC可如图6所示。
类型四:第四指令,第四指令包括目标YANG包的标识,第四指令用于指示删除与目标YANG包的标识对应的目标YANG包及依赖目标YANG包的第三YANG包。
针对类型四的第四指令,第一网络设备可控制对第二网络设备上的目标YANG包进行删除。例如,第四指令可通过delete-package-schema实现,从而实现第一网络设备控制第二网络设备删除第二网络设备上的目标YANG包以及依赖该目标YANG包的第三YANG包。
示例性地,第一网络设备向第二网络设备发送包括delete-package-schema的第四RPC,该delete-package-schema中携带读取的位置(如datastore信息);package标识(如package name);package版本等信息。例如,该第四RPC可如图7所示。
303,第二网络设备接收第一网络设备发送的针对目标YANG包的处理指令。
第二网络设备可通过网络接收第一网络设备发送的针对目标YNAG包的处理指令,例如,第一网络设备可发送上述类型一至类型四中的一种或多种处理指令,则第二网络设备接收对应的处理指令。
304,第二网络设备根据处理指令对目标YANG包进行处理。
由于处理指令包括但不限于上述类型一至类型四中的一种或多种指令,因此,第二网络设备根据处理指令对目标YANG包进行处理,包括但不限于如下一种或多种处理方式:
处理方式一:针对处理指令包括上述类型一的第一指令的方式,根据处理指令对目标YANG包进行处理,包括:根据第一指令读取目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构;向第一网络设备发送目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构。
该处理方式一中,例如,如图4中的(1)所示的指令,第二网络设备向第一网络设备发送目标该package内包含的整体schema信息。或者,例如,如图4中的(2)所示,第二网络设备向第一网络设备发送目标该package内包含的module schema列表信息。
相应的,第一网络设备向第二网络设备发送处理指令之后,还包括:目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构。
处理方式二:针对处理指令包括上述类型二的第二指令的方式,根据处理指令对目标YANG包进行处理,包括:根据第二指令加载与目标YANG包的标识对应的目标YANG包。
由于在示例性实施例中,第二指令还包括加载位置,由于第二指令中携带目标YANG包的加载位置、目标YANG包的标识,因此,第二网络设备根据第二指令在加载位置加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,第二指令还携带CLI的脚本文件;相应的,第二网络设备根据处理指令对目标YANG包进行处理,还包括:根据脚本文件将所述目标YANG包中的YANG模型转换为CLI脚本。
处理方式三:针对处理指令包括上述类型三的第三指令的方式,根据处理指令对目标YANG包进行处理,包括:根据第三指令查询目标YANG包所依赖的第一YANG包列表和/或依赖目标YANG包的第二YANG包列表;向第一网络设备发送目标YANG包所依赖的第一YANG包列表和/或依赖目标YANG包的第二YANG包列表。
示例性地,第二网络设备向第一网络设备发送的目标YANG包所依赖的所有包列表,即第一YANG包列表包括如下信息:
第一YANG包的package标识(如package name);package版本;该package内包含的schema信息等。
依赖目标YANG包的第二YANG包列表,包括如下信息:
第二YANG包的package标识(如package name);package版本;该package内包含的schema信息等。
相应的,第一网络设备向第二网络设备发送处理指令之后,还包括:接收目标YANG包所依赖的第一YANG包列表和/或依赖所述目标YANG包的第二YANG包列表。
处理方式四:针对处理指令包括上述类型四的第四指令的方式,根据处理指令对目标YANG包进行处理,包括:根据第四指令删除目标YANG包的标识对应的目标YANG包及依赖目标YANG包的第二YANG包。
此外,第四指令中还可以携带目标YANG包的读取位置信息,也即第四指令中携带目标YANG包的读取位置信息、目标YANG包的标识,因此,第二网络设备可以据此删除目标YANG包。且由于第二网络设备能够获取到目标YANG模型的依赖关系,因而删除目标YANG包之后,还可删除依赖目标YNAG模型数据包的第二YANG包。
需要说明的是,除上述几种处理指令以及对应的处理方式外,针对YANG包的处 理方式还可以有其他方式,本申请实施例不对具体的处理方式进行限定。例如,针对加载目标YANG包的情况,除了图5所示的情况外,还可以针对NETCONF monitoring模型进行扩展,如图8所示,可针对NETCONF monitoring模型加载目标YANG包,以实现对NETCONF monitoring模型进行扩展。
此外,上述加载目标YANG包的情况,可以是加载第二网络设备上未安装的YANG包,也可以是第二网络设备上已有的YANG包。
综上所述,本申请实施例提供的方法,基于扩展的新的操作指令,允许读取package的schema、读取package的依赖关系、加载datastore的package schema、删除datastore的package schema,还可更新NETCONF状态模型schema扩展,因此,本申请提供的方法能够针对YANG包进行区分,以进行精细化读写管理,能够减少错误,提高管理效率。
接下来,以上述几种处理指令的应用过程为例,对YANG模型的管理方法进行说明。
首先,以第一网络设备为控制器,包括控制器1和控制器2,第二网络设备为设备3,设备3上包括的软件包包括基础功能包及L3VPN功能包,控制器查询设备3内已有的YANG包的信息,将需要新写入的目标YANG包加载进设备3为例,对YANG模型的管理方法进行说明。参见图9,该方法包括如下几个过程:
901,控制器1向设备3下发第一个基础功能包及相关一个或多个YANG package schema。
例如,该基础功能包可以是IETF-device-pkg,xxx-device-pkg,openconfig-device-pkg,可以在控制器1在安装软件时,指定选择ietf YANG。也可以是设备3在安装软件时,如果没有指定,则默认选某个YANG包,该默认选的某个YANG包可以是厂商私有YANG包。
902,设备3验证该基础功能包及YANG package schema。如果有多个package schema,则选择缺省或者指定的YANG package schema。设备3将对应的YANG package schema写入设备datastore,并更新YANG package的状态。
903,控制器2读取设备3上的package信息及模型信息。
例如,控制器2通过get-package-schema读取该YANG package对应的schema。示例性地,以图10所示的YANG package为例,该YANG package的名称为xxx-device-pkg,version 3.1.2,revision-date 2017-3-2。
如图11所示,控制器2管理设备1至设备3这三个设备,控制器2可以读取设备3上的YANG package对应的schema。
904,设备3向控制器2返回YANG包信息及包相关的schema信息。
905,控制器2对比业务特性schema与设备3上的YANG包差异,确定需要加载的特性包。
例如,控制器2比对业务特性schema与设备3上的YANG包差异之后,确定需 要加载的特性包为L3VPN,即控制器2确认设备3需更新该特性包。
906,控制器2向控制器1请求加载特性包,如请求加载L3VPN特性包安装。
907,控制器1验证请求是否符合业务策略,如果通过,下发第二特性包及该特性包相关的一个或多个YANG包schema。如果是多个,标注默认包。
例如,控制器1向设备3下发的第二特性包为L3VPN yang package,例如下发L3VPN功能包及YANG package schema,该YANG package可能有一个或多个,例如IETF-L3VPN-pkg,或者xxx-L3VPN-pkg两种。
908,设备3加载解析指定版本YANG包下的模型,如错误,回退。
例如,设备3加载并验证L3VPN功能包及L3VPN yang package,并选择缺省IETF-L3VPN-pkg。如果通过,并更新YANG package状态。如果错误,回退,例如重新加载解析。
由于通常一个设备可以安装一个软件包,而该软件包里面有不同功能的软件,该功能对应YANG package,因此,经过该步骤908之后,设备3新增2个YANG包,如图12所示。
909,设备3向控制器1返回RPC响应。
910,控制器1更新该设备3的纳管。
911,控制器1通知控制器2,响应特性包已安装。
912,控制器2读取设备3中有关的YANG包的信息。
例如,控制器2通过处理指令get-package-schema读取该YANG package对应的schema,并保存。处理指令如图13所示。
913,控制器2分析业务特性,判断当前IETF-L3VPN-pkg需要切换当前设备datastore的模型采用xxx-L3VPN-pkg。向设备3下发RPC更新datastore的模型。
例如,控制器2通过<create-package-schema>更改设备3的YANG包schema。
914,设备3返回RPC reply OK。
由此,控制器2可以查询到datastore和package的更新的状态。例如,datastore的更新的状态可如图14所示,package的更新的状态可如图15所示。
此外,控制器2还可以通过xxx-L3VPN-pkg下发L3VPN特性配置,如图16所示。
本申请实施例提供的方法,基于扩展的新的操作指令,允许读取package的schema和加载datastore的package schema,由于能够针对YANG包进行区分,因而可以进行精细化管理,能够减少错误,提高管理效率。
仍以第一网络设备为控制器,包括控制器1和控制器2,第二网络设备为设备3,设备3上包括的软件包包括基础功能包及特性包L3VPN包,控制器查询设备3内已有的YNAG模型数据包的信息,查询目标YANG包,更新目标YNAG模型数据包为例, 对YANG模型的管理方法进行说明。参见图17,该方法包括如下几个过程:
1701,控制器1通过get-package-dependency操作读取设备3当前Datastore的L3VPN包的依赖关系信息。1702,设备3返回yang package的依赖关系。
例如,设备3为图2中的路由器为例,该设备包括L3VPN组播包、L3VPN包、MPLS包及Device包,Device包可以是L2协议和L3协议等协议的YANG包。其中,L3VPN组播依赖L3VPN包和device包,L3VPN包依赖于device包。那么L3VPN依赖device包,而被L3VPN组播依赖。此外,还包括版本的依赖关系。
1703,控制器1通过当前L3VPN包的版本信息以及依赖关系,确定升级的策略,向设备3返回L3VPN包依赖信息。
例如,升级的策略包括:如果新L3VPN包可以兼容当前device包版本,以及L3VPN组播包是否可以兼容新的L3VPN包版本。如果兼容,则下发L3VPN包及其YANG package schema升级。如果新L3VPN包与前device包版本不兼容,或者L3VPN组播包版本与新的L3VPN包不兼容,需下发L3VPN包及device包,或者L3VPN组播包及其YANG package schema升级。
此外,控制器1还需要保存当前L3VPN及device或者其他业务的配置数据。从而用于YANG package升级或者软件对应的进程升级后恢复数据。
1704,设备3加载,解析L3VPN yang包。终止原L3VPN的组件进程,启动新的L3VPN的组件进程。另外,如果其他依赖包或被依赖包也下载,则设备3需要重启相关包对应的进程。其中,其他依赖包是指依赖该L3VPN yang包的其他YANG包,被依赖包是指该L3VPN yang包所依赖的YANG包。
针对查询目标YANG包之后,本申请实施例提供的方法还支持YANG包的更新升级管理,例如参见如下步骤。
1705,设备3向控制器1备份配置数据。
1706,控制器1通过copy-config向设备3发送配置数据,使得设备3恢复配置数据。
示例性地,如果新的L3VPN进程加载成功,则设备3恢复L3VPN配置数据。如果有关联其他包,还需要回复其他包相关的配置数据。
1707,控制器2读取新的L3VPN包的yang package schema,下发L3VPN新的业务配置。
仍以第一网络设备为控制器,包括控制器1和控制器2,第二网络设备为设备3,设备3上包括的软件包包括基础功能包及特性包L3VPN包,控制器向设备3加载YNAG模型数据包,删除目标YANG包为例,对YANG模型的管理方法进行说明。参见图18,该方法包括如下几个过程:
1801,控制器1通过bind-package-schema或者软件安装的方式向设备3一次或多次下发包安装信息。
例如,控制器1多次在设备3上安装多个YANG package schema,例如L3VPN多个版本,device多个版本,或者L3VPN多个版本。
1802,设备3验证并安装YANG包,生成YANG包状态。
1803,控制器2请求控制器1删除L3VPN及关联业务功能。
由于管理更新,例如该设备3不再支持L3VPN业务,控制器2请求控制器1删除L3VPN及其相关业务组件,则触发本实施例提供的删除操作。
1804,控制器1通过get-package-dependency操作读取设备3中有关YANG包间的依赖信息。
例如,控制器1通过get-package-dependency操作读取设备3中当前Datastore的L3VPN包 的依赖关系。
1805,设备3返回yang package的依赖关系,该依赖关系包括所有依赖该包的包及该包所依赖的包。
例如,L3VPN组播依赖L3VPN包和device包,L3VPN包依赖于device包。也就是说,L3VPN依赖device包,而被L3VPN组播依赖。则设备3返回L3VPN包和device包的信息。
1806,控制器1查询依赖于该包的包是否可以删除,如果可以,则执行下一步1807的操作。
例如,控制器1通过当前L3VPN包的版本信息以及依赖关系,确定删除的策略。该删除的策略包括:如果L3VPN包所有版本及被依赖的L3VPN组播包需要删除。
1807,如果设备3中依赖于要删除的包的包可以被删除,则通过<delete-package-schema>向设备下发指令,删除该包及所有依赖于该包的包。
1808,设备3删除L3VPN包及当前L3VPN组播包。如果错误,则回退,例如重新执行删除操作。
例如,设备3删除所有L3VPN包对应的配置数据。停止L3VPN及L3VPN组播对应的进程。
1809,设备3向控制器1返回RPC响应,即操作结果。
例如,如果没有发现该包,则报错。如果成功删除,则返回成功响应。
1810,控制器1向控制器2返回业务组件已删除的成功响应。
本申请实施例提供的方法,基于扩展的新的操作指令,读取package的依赖关系、加载datastore的package schema、删除datastore的package schema,因此,能够针对YANG包进行区分,以进行精细化管理,能够减少错误,提高管理效率。
本申请实施例提供了一种YANG模型的管理装置,该装置应用于第一网络设备,用于执行上述图3中第一网络设备所执行的功能。参见图19,该装置包括:
确定模块1901用于执行图3中的301步骤。即用于确定第二网络设备中的目标YANG包,目标YANG包包括至少两个业务相关的YANG模型。
生成模块1902用于生成针对目标YANG包的处理指令,处理指令包括目标YANG包的标识,目标YANG包的标识用于标识目标YANG包,目标YANG包的标识包括目标YANG包的名称,或者目标YANG包的名称及版本信息。
发送模块1903用于向第二网络设备发送处理指令。
上述生成模块1902和发送模块1903用于执行图3中的302步骤。
在示例性实施例中,处理指令包括第一指令,第一指令包括目标YANG包的标识,第一指令用于指示读取与目标YANG包的标识对应的目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型。
装置,参见图20,该装置还包括:
接收模块1904用于接收一个或多个YANG模型以及与一个或多个YANG模型对应的结构。
在示例性实施例中,处理指令还包括第二指令,第二指令包括目标YANG包的标 识,第二指令用于指示加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,第二指令还包括加载位置,第二指令用于指示在加载位置加载与目标YANG包的标识对应的目标YANG包。
在示例性实施例中,第二指令还携带命令行接口CLI的脚本文件,脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,处理指令还包括第三指令,第三指令包括目标YANG包的标识,第三指令用于指示查询与目标YANG包的标识对应的目标YANG包具有依赖关系的YANG包;
参见图20,该装置,还包括:
接收模块1904用于接收目标YANG包所依赖的第一YANG包列表或依赖目标YANG包的第二YANG包列表。
上述接收模块1904用于执行图3中步骤304下面第一网络设备所涉及的接收步骤。
在示例性实施例中,处理指令还包括第四指令,第四指令包括目标YANG包的标识,第四指令用于指示删除与目标YANG包的标识对应的目标YANG包及依赖目标YANG包的第三YANG包。
本申请实施例提供了一种YANG模型的管理装置,该装置用于第二网络设备,该第二网络设备用于执行上述图3中第二网络设备所执行的功能。参见图21,该装置包括:
接收模块2101用于执行上述图3中的步骤303,即用于接收第一网络设备发送的针对目标YANG包的处理指令,目标YANG包包括至少两个业务相关的YANG模型,处理指令包括目标YANG包的标识,目标YANG包的标识用于标识目标YANG包,目标YANG包的标识包括目标YANG包的名称,或者目标YANG包的名称及版本信息。
处理模块2102用于执行上述图3中的步骤304,即用于根据处理指令对与目标YANG包的标识对应的目标YANG包进行处理。
在示例性实施例中,处理指令包括第一指令,第一指令包括目标YANG包的标识,第一指令用于指示读取与目标YANG包的标识对应的目标YANG包中的至少两个业务相关的YANG模型中的一个或多个YANG模型。
处理模块2102还用于根据第一指令读取与目标YANG包的标识对应的至少两个业务相关的YANG模型中的一个或多个YANG模型以及对应的结构;
参见图22,该装置还包括:
发送模块2103用于向第一网络设备发送一个或多个YANG模型以及对应的结构。
在示例性实施例中,处理指令还包括第二指令,第二指令包括目标YANG包的标识,第二指令用于指示加载与目标YANG包的标识对应的目标YANG包。
处理模块2102还用于根据第二指令加载与目标YANG包的标识对应的目标YANG包。
第二指令还包括加载位置,第二指令用于指示在加载位置加载与目标YANG包的标识对应的目标YANG包。
处理模块2102用于根据第二指令在加载位置加载目标YANG包的标识对应的目标YANG包。
在示例性实施例中,第二指令还携带CLI的脚本文件,脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本;
处理模块2102还用于根据CLI的脚本文件将所述目标YANG包中的YANG模型转换为CLI脚本。
在示例性实施例中,处理指令还包括第三指令,第三指令包括目标YANG包的标识,第三指令用于指示查询与目标YANG包的标识对应的目标YANG包具有依赖关系的YANG包。
处理模块2102还用于根据第三指令查询目标YANG包所依赖的第一YANG包列表和/或依赖目标YANG包的第二YANG包列表。
参见图22,该装置,还包括:
发送模块2103用于向第一网络设备发送目标YANG包所依赖的第一YANG包列表和/或依赖目标YANG包的第二YANG包列表。
在示例性实施例中,处理指令还包括第四指令,第四指令包括目标YANG包的标识,第四指令用于指示删除与目标YANG包的标识对应的目标YANG包及依赖目标YANG包的第二YANG包。
处理模块2102还用于根据第四指令删除与目标YANG包的标识对应的目标YANG包及依赖目标YANG包的第三YANG包。
上述发送模块2103用于执行图3中步骤304中第二网络设备所涉及的发送步骤。
应理解的是,上述图19至图22提供的装置在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
参见图23,本申请实施例还提供一种网络设备1000,图23所示的网络设备1000用于执行上述网络设备管理方法所涉及的操作。该网络设备1000包括:存储器1001、处理器1002及接口1003,存储器1001、处理器1002及接口1003之间通过总线1004连接。
其中,存储器1001中存储有至少一条指令,至少一条指令由处理器1002加载并执行,以实现上述任一所述的YANG模型管理方法。
接口1003用于与网络中的其他设备进行通信,该接口1003可以通过无线或有线的方式实现,示例性地,该接口1003可以是网卡。例如,网络设备1000可通过该接口1003与服务器进行通信。
示例性地,当网络设备1000为第一网络设备时,该处理器1002可用于执行上述图19和图20所示的确定模块1901、生成模块1902的功能,该接口1003用于实现上述图19和图20所示的发送模块1903和接收模块1904的功能。当网络设备1000为第二网络设备时,该处理器1002可用于执行上述图21和图22所示的处理模块2102的功能,该接口1003用于实现上述图21和图22所示的接收模块2101和发送模块2103的功能。
应理解的是,图23仅仅示出了网络设备1000的简化设计。在实际应用中,网络设备可以包含任意数量的接口,处理器或者存储器。此外,上述处理器可以是中央处理器(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(advanced RISC machines,ARM)架构的处理器。
进一步地,在一种可选的实施例中,上述存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。
该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者,其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用。例如,静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic random access memory,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
还提供了一种YANG模型管理系统,该系统包括第一网络设备和第二网络设备,其中,第一网络设备用于执行上述YANG模型管理方法中的第一网络设备所执行的功能,第二网络设备用于执行上述YANG模型管理方法中的第二网络设备所执行的功能。
还提供了一种计算机可读存储介质,存储介质中存储有至少一条指令,指令由处理器加载并执行以实现如上任一所述的YANG模型管理方法。
本申请提供了一种计算机程序,当计算机程序被计算机执行时,可以使得处理器 或计算机执行上述方法实施例中对应的各个操作和/或流程。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
以上所述仅为本申请的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (33)

  1. 一种YANG模型的管理方法,其特征在于,所述方法包括:
    第一网络设备确定第二网络设备中的目标YANG包,所述目标YANG包包括至少两个业务相关的YANG模型;
    所述第一网络设备生成针对所述目标YANG包的处理指令,并向所述第二网络设备发送所述处理指令,所述处理指令包括所述目标YANG包的标识,所述目标YANG包的标识用于标识所述目标YANG包,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息。
  2. 根据权利要求1所述的方法,其特征在于,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
    在向所述第二网络设备发送所述处理指令之后,该方法还包括:
    接收所述一个或多个YANG模型以及与所述一个或多个YANG模型对应的结构。
  3. 根据权利要求1或2所述的方法,其特征在于,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所述目标YANG包的标识对应的目标YANG包。
  4. 根据权利要求3所述的方法,其特征在于,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包。
  5. 根据权利要求3或4所述的方法,其特征在于,所述第二指令还携带命令行接口CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与所述目标YANG包具有依赖关系的YANG包;
    在向所述第二网络设备发送所述处理指令之后,该方法还包括:
    接收所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
  8. 一种YANG模型的管理方法,其特征在于,所述方法包括:
    第二网络设备接收第一网络设备发送的针对目标YANG包的处理指令,所述目标 YANG包包括至少两个业务相关的YANG模型,所述处理指令包括所述目标YANG包的标识,所述YANG包的标识用于标识所述目标YANG包,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息;
    所述第二网络设备根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理。
  9. 根据权利要求8所述的方法,其特征在于,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的目标YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
    所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,包括:
    根据所述第一指令读取与所述目标YANG包的标识对应的所述至少两个业务相关的YANG模型中的一个或多个YANG模型以及与所述一个或多个YANG模型对应的结构;
    向所述第一网络设备发送所述一个或多个YANG模型以及对应的结构。
  10. 根据权利要求8或9所述的方法,其特征在于,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所述目标YANG包的标识对应的目标YANG包;
    所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,包括:
    根据所述第二指令加载与所述目标YANG包的标识对应的目标YANG包。
  11. 根据权利要求10所述的方法,其特征在于,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包;
    所述根据所述第二指令加载与所述目标YANG包的标识对应的目标YANG包,包括:
    根据所述第二指令在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包。
  12. 根据权利要求10或11所述的方法,其特征在于,所述第二指令还携带命令行接口CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本;
    所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,还包括:
    根据所述CLI的脚本文件将目标YANG包中的YANG模型转换为CLI脚本。
  13. 根据权利要求8-12任一所述的方法,其特征在于,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与所述目标YANG包的标识对应的目标YANG包具有依赖关系的YANG包;
    所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,还包括:
    根据所述第三指令查询所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表;
    向所述第一网络设备发送所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
  14. 根据权利要求8-12任一所述的方法,其特征在于,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包;
    所述根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理,还包括:
    根据所述第四指令删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
  15. 一种YANG模型的管理装置,其特征在于,所述装置应用于第一网络设备,所述装置包括:
    确定模块,用于确定第二网络设备中的目标YANG包,所述目标YANG包包括至少两个业务相关的YANG模型;
    生成模块,用于生成针对所述目标YANG包的处理指令,所述处理指令包括所述目标YANG包的标识,所述目标YANG包的标识用于标识所述目标YANG包,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息;
    发送模块,用于向所述第二网络设备发送所述处理指令。
  16. 根据权利要求13所述的装置,其特征在于,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
    所述装置,还包括:
    接收模块,用于接收所述一个或多个YANG模型以及与所述一个或多个YANG模型对应的结构。
  17. 根据权利要求15或16所述的装置,其特征在于,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所 述目标YANG包的标识对应的目标YANG包。
  18. 根据权利要求17所述的装置,其特征在于,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包。
  19. 根据权利要求17或18所述的装置,其特征在于,所述第二指令还携带命令行接口CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本。
  20. 根据权利要求15-19任一所述的装置,其特征在于,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与所述目标YANG包具有依赖关系的YANG包;
    所述装置,还包括:
    接收模块,用于接收所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
  21. 根据权利要求15-20任一所述的装置,其特征在于,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
  22. 一种YANG模型的管理装置,其特征在于,所述装置用于第二网络设备,所述装置包括:
    接收模块,用于接收第一网络设备发送的针对目标YANG包的处理指令,所述目标YANG包包括至少两个业务相关的YANG模型,所述处理指令包括所述目标YANG包的标识,所述目标YANG包的标识用于标识所述目标YANG包,所述目标YANG包的标识包括所述目标YANG包的名称,或者所述目标YANG包的名称及版本信息;
    处理模块,用于根据所述处理指令对与所述目标YANG包的标识对应的目标YANG包进行处理。
  23. 根据权利要求19所述的装置,其特征在于,所述处理指令包括第一指令,所述第一指令包括所述目标YANG包的标识,所述第一指令用于指示读取与所述目标YANG包的标识对应的目标YANG包中的所述至少两个业务相关的YANG模型中的一个或多个YANG模型;
    所述处理模块,还用于根据所述第一指令读取与所述目标YANG包的标识对应的所述至少两个业务相关的YANG模型中的一个或多个YANG模型以及与所述一个或多个YANG模型对应的结构;
    所述装置还包括:
    发送模块,用于向所述第一网络设备发送所述一个或多个YANG模型以及对应的结构。
  24. 根据权利要求22或23所述的装置,其特征在于,所述处理指令还包括第二指令,所述第二指令包括所述目标YANG包的标识,所述第二指令用于指示加载与所述目标YANG包的标识对应的目标YANG包;
    所述处理模块,还用于根据所述第二指令加载与所述目标YANG包的标识对应的目标YANG包。
  25. 根据权利要求24所述的装置,其特征在于,所述第二指令还包括加载位置,所述第二指令用于指示在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包;
    所述处理模块,用于根据所述第二指令在所述加载位置加载与所述目标YANG包的标识对应的目标YANG包。
  26. 根据权利要求24或25所述的装置,其特征在于,所述第二指令还携带命令行接口CLI的脚本文件,所述脚本文件用于将所述目标YANG包中的YANG模型转换为CLI脚本;
    所述处理模块,还用于根据所述CLI的脚本文件将所述目标YANG包中的YANG模型转换为CLI脚本。
  27. 根据权利要求22-26任一所述的装置,其特征在于,所述处理指令还包括第三指令,所述第三指令包括所述目标YANG包的标识,所述第三指令用于指示查询与所述目标YANG包的标识对应的目标YANG包具有依赖关系的YANG包;
    所述处理模块,还用于根据所述第三指令查询所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表;
    所述装置,还包括:
    发送模块,用于向所述第一网络设备发送所述目标YANG包所依赖的第一YANG包列表或依赖所述目标YANG包的第二YANG包列表。
  28. 根据权利要求22-27任一所述的装置,其特征在于,所述处理指令还包括第四指令,所述第四指令包括所述目标YANG包的标识,所述第四指令用于指示删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包;
    所述处理模块,还用于根据所述第四指令删除与所述目标YANG包的标识对应的目标YANG包及依赖所述目标YANG包的第三YANG包。
  29. 一种第一网络设备,其特征在于,所述第一网络设备用于执行所述权利要求1-7任一所述的方法。
  30. 一种第二网络设备,其特征在于,所述第二网络设备用于执行权利要求8-14任一所述的方法。
  31. 一种YANG模型的管理系统,其特征在于,所述系统包括第一网络设备和第二网络设备;
    所述第一网络设备执行权利要求1-7任一所述的方法,所述第二网络设备执行权利要求8-14任一所述的方法。
  32. 一种网络设备,其特征在于,所述网络设备包括:
    存储器及处理器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行,以实现权利要求1-14中任一所述的方法。
  33. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1-14中任一所述的方法。
PCT/CN2020/117539 2019-10-18 2020-09-24 Yang模型的管理方法、装置、系统、设备及存储介质 Ceased WO2021073395A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20877237.6A EP4027588B1 (en) 2019-10-18 2020-09-24 Yang model management method, apparatus and system, device, and storage medium
US17/722,822 US20220239547A1 (en) 2019-10-18 2022-04-18 Yang Module Management Method, Apparatus, and System, Device, and Storage Medium

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201910994980 2019-10-18
CN201910994980.4 2019-10-18
CN201911061600.8A CN112688794A (zh) 2019-10-18 2019-11-01 Yang模型的管理方法、装置、系统、设备及存储介质
CN201911061600.8 2019-11-01

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/722,822 Continuation US20220239547A1 (en) 2019-10-18 2022-04-18 Yang Module Management Method, Apparatus, and System, Device, and Storage Medium

Publications (1)

Publication Number Publication Date
WO2021073395A1 true WO2021073395A1 (zh) 2021-04-22

Family

ID=75445331

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117539 Ceased WO2021073395A1 (zh) 2019-10-18 2020-09-24 Yang模型的管理方法、装置、系统、设备及存储介质

Country Status (4)

Country Link
US (1) US20220239547A1 (zh)
EP (1) EP4027588B1 (zh)
CN (1) CN112688794A (zh)
WO (1) WO2021073395A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4354802A4 (en) * 2021-07-06 2024-09-25 Huawei Technologies Co., Ltd. INTERROGATION METHOD, APPARATUS AND DEVICE

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344746A (zh) * 2021-05-13 2022-11-15 中移(上海)信息通信科技有限公司 一种信息转换方法、装置和设备
CN113300888B (zh) * 2021-05-21 2022-07-22 刘超 一种yang模型浏览器及客户端设备
CN114968360B (zh) * 2022-06-02 2026-02-03 杭州东方通信软件技术有限公司 一种基于api控制器的指令下发方法
CN115065594B (zh) * 2022-06-08 2024-03-26 亚信科技(中国)有限公司 数据配置方法、装置、设备、可读存储介质及程序产品
CN117376122A (zh) * 2022-06-30 2024-01-09 中兴通讯股份有限公司 网络配置方法、装置以及存储介质、电子装置
CN116827744B (zh) * 2023-06-28 2026-03-20 北京格林威尔科技发展有限公司 支持不同yang模型的管控方法和装置
US20250106093A1 (en) * 2023-09-26 2025-03-27 Juniper Networks, Inc. Disabling link for length of time
CN118449926A (zh) * 2024-05-14 2024-08-06 新华三技术有限公司 通知方法及装置
US12587440B2 (en) * 2024-08-08 2026-03-24 Cisco Technology, Inc. Stateful management of network device configurations

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106612196A (zh) * 2015-10-23 2017-05-03 华为技术有限公司 获取资源的方法及装置
CN107302443A (zh) * 2016-04-15 2017-10-27 华为技术有限公司 基于网络配置协议的设备配置方法及装置
CN108234174A (zh) * 2016-12-21 2018-06-29 华为技术有限公司 虚拟网络功能的管理方法和装置
US20190190779A1 (en) * 2016-08-24 2019-06-20 Huawei Technologies Co., Ltd. Method and apparatus for restoring network device to factory defaults, and network device
CN109951315A (zh) * 2019-02-14 2019-06-28 烽火通信科技股份有限公司 一种实现yang模型到内部模型映射的方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9715380B2 (en) * 2015-05-26 2017-07-25 Cisco Technology, Inc. Techniques for enabling dynamic update of device data models
CN110855459B (zh) * 2018-08-20 2021-07-09 华为技术有限公司 网络配置方法、装置及系统
CN110971438A (zh) * 2018-09-30 2020-04-07 华为技术有限公司 配置数据的方法及装置
CN112583630B (zh) * 2019-09-29 2022-07-12 华为技术有限公司 设备管理方法、装置、系统、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106612196A (zh) * 2015-10-23 2017-05-03 华为技术有限公司 获取资源的方法及装置
CN107302443A (zh) * 2016-04-15 2017-10-27 华为技术有限公司 基于网络配置协议的设备配置方法及装置
US20190190779A1 (en) * 2016-08-24 2019-06-20 Huawei Technologies Co., Ltd. Method and apparatus for restoring network device to factory defaults, and network device
CN108234174A (zh) * 2016-12-21 2018-06-29 华为技术有限公司 虚拟网络功能的管理方法和装置
CN109951315A (zh) * 2019-02-14 2019-06-28 烽火通信科技股份有限公司 一种实现yang模型到内部模型映射的方法及系统

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BRAVALHERI ANDERSON: "Overview of South-Bound Interfaces for Software-Defined Optical Networks", 2018 20TH INTERNATIONAL CONFERENCE ON TRANSPARENT OPTICAL NETWORKS (ICTON), IEEE, 1 July 2018 (2018-07-01), pages 1 - 5, XP033409245, DOI: 10.1109/ICTON.2018.8473494 *
See also references of EP4027588A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4354802A4 (en) * 2021-07-06 2024-09-25 Huawei Technologies Co., Ltd. INTERROGATION METHOD, APPARATUS AND DEVICE

Also Published As

Publication number Publication date
EP4027588A4 (en) 2022-11-09
EP4027588A1 (en) 2022-07-13
CN112688794A (zh) 2021-04-20
US20220239547A1 (en) 2022-07-28
EP4027588B1 (en) 2026-04-01

Similar Documents

Publication Publication Date Title
WO2021073395A1 (zh) Yang模型的管理方法、装置、系统、设备及存储介质
US9331953B2 (en) Device management method, middleware, and machine-to-machine communications platform, device, and system
US9195480B2 (en) Associated plug-in management method, device and system
CN102546760B (zh) 设备管理的方法和终端、装置、系统
US11140031B2 (en) Intent aware contextual device configuration backup and restore
US20090144434A1 (en) Method For Device Capability Negotiation, Method, System And Device For Synchronization
CN112583630B (zh) 设备管理方法、装置、系统、设备及存储介质
CN102006333A (zh) 安装软件组件的方法、系统及装置
US12261741B2 (en) Server to support client data models from heterogeneous data sources
JP2007525870A (ja) 装置管理システム内における管理ノードの指定
CN114095348B (zh) 网络能力开放系统及业务编排方法
CN113079029B (zh) 配置信息订阅方法及装置
CN115567388A (zh) 网络切片配置自动更新方法、系统、装置及存储介质
CN101170442B (zh) 软件在线升级方法及系统
US20250200110A1 (en) Intent graph model generation using difference information
CN111061723A (zh) 工作流实现方法及装置
CN113438095B (zh) 配置数据的管理方法、装置、设备及存储介质
CN114443214A (zh) 一种云边kubernetes的纳管方法及系统
CN118282847A (zh) 配置回退点的控制方法、装置、电子设备以及存储介质
CN118132094A (zh) 应用部署方法、系统、计算机设备、存储介质及程序产品
WO2026051696A1 (zh) 选择子网服务的方法、网元及存储介质
CN119960766A (zh) 面向多租户的部署方法、装置、设备、介质及程序产品
CN116436972A (zh) 报文头处理及管理方法、装置、存储介质及系统
CN114765579A (zh) 一种数据传输方法、装置、相关设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20877237

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020877237

Country of ref document: EP

Effective date: 20220407

WWG Wipo information: grant in national office

Ref document number: 2020877237

Country of ref document: EP