[go: up one dir, main page]

CN112087318A - A network management method, server, client and system - Google Patents

A network management method, server, client and system Download PDF

Info

Publication number
CN112087318A
CN112087318A CN202010803704.8A CN202010803704A CN112087318A CN 112087318 A CN112087318 A CN 112087318A CN 202010803704 A CN202010803704 A CN 202010803704A CN 112087318 A CN112087318 A CN 112087318A
Authority
CN
China
Prior art keywords
server
client
data
netconf
friend
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.)
Granted
Application number
CN202010803704.8A
Other languages
Chinese (zh)
Other versions
CN112087318B (en
Inventor
冯冲
朱永飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010803704.8A priority Critical patent/CN112087318B/en
Publication of CN112087318A publication Critical patent/CN112087318A/en
Application granted granted Critical
Publication of CN112087318B publication Critical patent/CN112087318B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a network management method, a server, a client and a system. According to the method, the server and the client are enabled to ignore the unidentified content in the NETCONF message respectively, so that the server and the client can communicate based on the principle of non-strict matching, the server and the client can also communicate smoothly when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

Description

一种网络管理方法、服务器、客户端及系统A network management method, server, client and system

技术领域technical field

本发明涉及通信领域,具体涉及一种网络管理方法、服务器、客户端及系统。The invention relates to the field of communications, in particular to a network management method, server, client and system.

背景技术Background technique

NETCONF(Network Configuration Protocal,网络配置协议)是一种基于XML(ExtensibleMarkup Language,可扩展标记语言)的网络管理协议,它提供了一种对网络设备进行配置和管理的方法。该协议允许设备提供一系列完整、规范化的编程接口,应用程序或用户可以通过该接口对网络设备配置参数、获取参数值或查询参数值等。NETCONF (Network Configuration Protocol, Network Configuration Protocol) is a network management protocol based on XML (Extensible Markup Language, Extensible Markup Language), which provides a method for configuring and managing network devices. This protocol allows devices to provide a series of complete and standardized programming interfaces, through which applications or users can configure parameters, obtain parameter values, or query parameter values for network devices.

在基于NETCONF的网络管理过程中,网管设备(客户端)和目标网络设备(服务器)需要版本一致才能使通信顺利进行,而在实际情况中,经常会出现网管设备或目标网络设备升级的情况。通常情况下,由于网管设备管理的网络设备众多,因此无法做到网管设备与网络设备同时升级。例如,网管设备升级后,某些网络设备没有进行升级,从而导致网管设备和目标网络设备的版本不一致,使得网管设备和目标网络设备之间的通信无法正常进行。又例如,网管设备升级后,在整个网络中的所有网络设备完成升级前,使得网管设备和还未升级的网络设备之间的通信无法正常进行。In the process of network management based on NETCONF, the version of the network management device (client) and the target network device (server) need to be the same for smooth communication. Usually, because the network management device manages a large number of network devices, it is impossible to upgrade the network management device and the network device at the same time. For example, after the network management device is upgraded, some network devices are not upgraded, so that the versions of the network management device and the target network device are inconsistent, and the communication between the network management device and the target network device cannot be performed normally. For another example, after the network management device is upgraded, before all the network devices in the entire network are upgraded, the communication between the network management device and the network devices that have not been upgraded cannot be performed normally.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种网络管理方法、服务器、客户端及系统,以期可以在客户端和服务器的管理模块版本不一致的情况下实现正常通信。The embodiments of the present invention provide a network management method, server, client and system, so as to realize normal communication under the condition that the management module versions of the client and the server are inconsistent.

第一方面,本发明实施例提供一种网络管理方法,包括:In a first aspect, an embodiment of the present invention provides a network management method, including:

服务器经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文,其中,该第一Hello报文携带有第一友元friendly-element标识,该第一友元friendly-element标识用于指示服务器具有第一友元能力,其中,第一友元能力用于表示所述服务器能够对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;服务器再经由所述SSH连接接收来自客户端的第二Hello报文,该第二Hello报文携带有第二友元friendly-element标识,该第二友元friendly-element标识用于指示客户端具有第二友元能力,该第二友元能力用于表示客户端能够对接收到的来自服务器的NETCONF回应报文中不能识别的字段进行忽略处理;最后服务器再根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定服务器与客户端之间的友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。The server sends a first Hello packet to the client through the SSH connection between the client and the server, wherein the first Hello packet carries the first friend friendly-element identifier, and the first friend friendly-element identifier is used To indicate that the server has the first friend capability, wherein the first friend capability is used to indicate that the server can ignore the unrecognized fields in the NETCONF request message received from the client; The SSH connection receives the second Hello packet from the client, the second Hello packet carries the second friend friendly-element identifier, and the second friend friendly-element identifier is used to indicate that the client has the second friend capability. , the second friend capability is used to indicate that the client can ignore the unidentifiable fields in the NETCONF response message received from the server; finally, the server is based on the first friend friendly-element identifier and the described The second friendly-element identifier identifies the friendly-element relationship between the server and the client. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

在一个可能的设计中,在服务器根据第一友元friendly-element标识和第二友元friendly-element标识确定服务器与客户端之间的友元关系后,上述方法还包括:In a possible design, after the server determines the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier, the above method further includes:

服务器接收客户端发送的NETCONF请求报文,其中,该NETCONF请求报文中包括edit-config请求、基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值;然后服务器基于服务器数据模型确定该待配置数据节点是否能够被识别,当该待配置数据节点能够被识别时,服务器利用该待配置数值对该待配置数据节点进行数据配置,当该待配置数据节点不能够被识别时,服务器忽略该待配置数据节点;最后服务器向客户端返回NETCONF回应报文,其中,该NETCONF回应报文包括数据配置是否成功的指示。通过此种基于友元连接的不严格匹配的通信方式,可以解决客户端与服务器的版本不匹配的问题,也即客户端数据模型与服务器数据模型不一致时,也能顺利进行数据配置而不会报错,使得基于NETCONF协议的edit-config操作能够顺利进行,提高网络管理效率。The server receives the NETCONF request message sent by the client, wherein the NETCONF request message includes the edit-config request, the data node to be configured based on the client data model, and the to-be-configured value of the data node to be configured; then the server based on the server data The model determines whether the to-be-configured data node can be identified. When the to-be-configured data node can be identified, the server uses the to-be-configured value to perform data configuration on the to-be-configured data node. When the to-be-configured data node cannot be identified , the server ignores the data node to be configured; finally, the server returns a NETCONF response message to the client, wherein the NETCONF response message includes an indication of whether the data configuration is successful. This non-strict matching communication method based on friend connection can solve the problem that the versions of the client and the server do not match, that is, when the client data model is inconsistent with the server data model, the data configuration can be carried out smoothly without Error reporting enables the edit-config operation based on the NETCONF protocol to proceed smoothly and improves network management efficiency.

在一个可能的设计中,在服务器根据第一友元friendly-element标识和第二友元friendly-element标识确定服务器与客户端之间的友元关系后,上述方法还包括:In a possible design, after the server determines the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier, the above method further includes:

服务器接收客户端发送的NETCONF请求报文,该NETCONF请求报文包括get或get-config请求、以及基于客户端数据模型的数据过滤条件,该数据过滤条件包括选择数据节点;服务器基于服务器数据模型确定该选择数据节点是否能够被识别,当该选择数据节点能够被识别时,服务器从预设服务器数据中获取与该选择数据节点对应的选择数据节点数值以得到获取结果数据,当该选择数据节点不能够被识别时,服务器忽略该选择数据节点;最后服务器向客户端发送NETCONF回应报文,其中,该NETCONF回应报文包括所述获取结果数据。通过建立客户端与服务器之间的友元连接,从而可以在客户端与服务器版本不一致,也即客户端数据模型与服务器数据模型不一致时,也能顺利使get或get-config操作顺利进行而不会报错,提高网络管理效率。The server receives the NETCONF request message sent by the client, the NETCONF request message includes a get or get-config request, and data filtering conditions based on the client data model, the data filtering conditions include selecting data nodes; the server determines based on the server data model. Whether the selection data node can be identified, when the selection data node can be identified, the server obtains the value of the selection data node corresponding to the selection data node from the preset server data to obtain the acquisition result data, when the selection data node is not When it can be identified, the server ignores the selected data node; finally, the server sends a NETCONF response message to the client, wherein the NETCONF response message includes the acquisition result data. By establishing a friend connection between the client and the server, the get or get-config operation can be performed smoothly even when the client and server versions are inconsistent, that is, when the client data model is inconsistent with the server data model. Errors will be reported to improve network management efficiency.

在一个可能的设计中,在服务器根据第一友元friendly-element标识和第二友元friendly-element标识确定服务器与客户端之间的友元关系后,上述方法还包括:In a possible design, after the server determines the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier, the above method further includes:

服务器接收客户端发送的NETCONF请求报文,该NETCONF请求报文中包括copy-config请求、与该copy-config请求对应的数据源标识、与该copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,并且上述第一友元能力还用于表示服务器能够对数据源标识所指示的数据源中不能识别的字段进行忽略处理;服务器基于服务器数据模型确定待拷贝数据节点是否能够被识别,当该待拷贝数据节点能够被识别时,服务器拷贝该数据源中的待拷贝数据节点的数值至目标数据集标识所指示的目标数据集中,当该待拷贝数据节点不能够被识别时,服务器忽略所述数据源中所述待拷贝数据节点的数值;最后服务器向客户端发送NETCONF回应报文,其中,该NETCONF回应报文包括数据拷贝是否成功的指示。通过基于友元连接对客户端发送的数据源标识所指示的数据源执行不严格匹配的通信方式,可以解决数据源数据模型与服务器数据模型不匹配的问题,也即客户端数据模型与服务器数据模型不相同时也能顺利进行数据拷贝而不会报错,使得基于NETCONF协议的copy-config操作能够顺利进行,提高网络管理效率。The server receives the NETCONF request message sent by the client. The NETCONF request message includes the copy-config request, the data source identifier corresponding to the copy-config request, the target data set identifier corresponding to the copy-config request, and the data based on the copy-config request. The data node to be copied of the source data model, and the above-mentioned first friend capability is also used to indicate that the server can ignore the unrecognized fields in the data source indicated by the data source identifier; the server determines the data node to be copied based on the server data model. Whether it can be identified, when the data node to be copied can be identified, the server copies the value of the data node to be copied in the data source to the target data set indicated by the target data set identifier, when the data node to be copied cannot be copied. During identification, the server ignores the value of the data node to be copied in the data source; finally, the server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether data copying is successful. By performing a communication method that does not strictly match the data source indicated by the data source identifier sent by the client based on the friend connection, the problem that the data model of the data source does not match the data model of the server can be solved, that is, the data model of the client and the data of the server can be solved. Even when the models are different, data can be copied without error, which enables the copy-config operation based on the NETCONF protocol to be carried out smoothly and improves the efficiency of network management.

在一个可能的设计中,上述方法还包括:In a possible design, the above method also includes:

若服务器检测到客户端数据模型或服务器数据模型发生改变,则服务器判断客户端数据模型与服务器数据模型是否一致;当客户端数据模型与服务器数据模型一致时,服务器关闭第一友元能力,从而使得服务器不具备对接收到的来自客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the server detects that the client data model or the server data model has changed, the server determines whether the client data model is consistent with the server data model; when the client data model is consistent with the server data model, the server closes the first friend capability, thereby The server does not have the ability to ignore the unrecognized fields in the received NETCONF request message from the client.

在一个可能的设计中,上述方法还包括:In a possible design, the above method also includes:

若客户端数据模型与服务器数据模型一致,则服务器经由SSH连接向客户端发送指示客户端关闭所述第二友元能力的指示消息,以使客户端不具备对接收到的来自服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。从而使得网络管理过程中对客户端与服务器之间的友元关系的灵活控制,保证通信安全。If the client data model is consistent with the server data model, the server sends an instruction message to the client via the SSH connection instructing the client to disable the second friend capability, so that the client does not have the ability to respond to the NETCONF received from the server. The ability to ignore unrecognized fields in a packet. This enables flexible control of the friend relationship between the client and the server in the process of network management and ensures communication security.

第二方面,本发明实施例提供一种网络管理方法,包括:In a second aspect, an embodiment of the present invention provides a network management method, including:

客户端经由客户端与服务器之间的SSH连接接收服务器发送的第一Hello报文,该第一Hello报文中携带有第一友元friendly-element标识,该第一友元friendly-element标识用于指示服务器具有第一友元能力,该第一友元能力用于表示服务器对接收到的来自客户端的NETCONF请求报文中不能识别的字段进行忽略处理;客户端经由所述SSH连接向服务器发送第二Hello报文,该第二Hello报文携带有第二友元friendly-element标识,其中,第二友元friendly-element标识用于指示客户端具有第二友元能力,该第二友元能力用于表示客户端对接收到的来自服务器的NETCONF回应报文中不能识别的字段进行忽略处理;最后客户端根据第一友元friendly-element标识和第二友元friendly-element标识确定客户端与服务器之间的友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。The client receives the first Hello packet sent by the server through the SSH connection between the client and the server. The first Hello packet carries the first friend friendly-element identifier, and the first friend friendly-element identifier uses In order to indicate that the server has the first friend capability, the first friend capability is used to indicate that the server ignores the unrecognized fields in the received NETCONF request message from the client; the client sends to the server via the SSH connection The second Hello packet, the second Hello packet carries the second friend friendly-element identifier, where the second friend friendly-element identifier is used to indicate that the client has the second friend capability, and the second friend friendly element The capability is used to indicate that the client ignores the unrecognized fields in the NETCONF response message received from the server; finally, the client determines the client according to the first friend friendly-element identifier and the second friend friendly-element identifier. Friendship with the server. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

在一个可能的设计中,在客户端根据第一友元friendly-element标识和第二友元friendly-element标识确定客户端与服务器之间的友元关系后,上述方法还包括:In a possible design, after the client determines the friend relationship between the client and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier, the above method further includes:

客户端接收服务器返回的NETCONF回应报文,该NETCONF回应报文包括服务器根据get或get-config请求得到的获取结果数据,其中,该获取结果数据的数据模型为服务器数据模型;客户端基于客户端数据模型确定获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,然后客户端保存该获取结果数据中能够被识别的数据节点的数值,并忽略该获取结果数据中所述不能够被识别的数据节点的数值。从而在客户端与服务器版本不一致时,接收到来自服务器的获取结果数据时,也能顺利保存而不会报错,提高网络管理效率。The client receives the NETCONF response message returned by the server, and the NETCONF response message includes the acquisition result data obtained by the server according to the get or get-config request, wherein the data model of the acquired result data is the server data model; the client is based on the client The data model determines the data nodes that can be identified and the data nodes that cannot be identified in the acquisition result data, and then the client saves the values of the data nodes that can be identified in the acquisition result data, and ignores the unidentified data nodes in the acquisition result data. The value of the data node that can be identified. Therefore, when the version of the client and the server are inconsistent, the obtained result data from the server can also be saved smoothly without reporting an error, thereby improving the efficiency of network management.

在一个可能的设计中,上述方法还包括:In a possible design, the above method also includes:

若客户端检测到客户端数据模型或服务器数据模型发生改变,则判断客户端数据模型与服务器数据模型是否一致;若客户端数据模型与服务器数据模型一致,则客户端关闭第二友元能力,以使客户端不具备对接收到的来自服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client detects that the client data model or the server data model has changed, it determines whether the client data model is consistent with the server data model; if the client data model is consistent with the server data model, the client closes the second friend capability, So that the client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server.

在一个可能的设计中,上述方法还包括:In a possible design, the above method also includes:

若客户端数据模型与服务器数据模型一致,则客户端经由SSH连接向服务器发送指示服务器关闭所述第一友元能力的指示消息,以使服务器不具备对接收到的来自客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。从而使得网络管理过程中对客户端与服务器之间的友元关系的灵活控制,保证通信安全。If the client data model is consistent with the server data model, the client sends an instruction message to the server via the SSH connection to instruct the server to disable the first friend capability, so that the server does not have the ability to respond to the received NETCONF request message from the client The ability to ignore unrecognized fields in . This enables flexible control of the friend relationship between the client and the server in the process of network management and ensures communication security.

第三方面,本发明实施例还提供一种服务器,包含用于执行本发明实施例第一方面中的方法的单元。In a third aspect, an embodiment of the present invention further provides a server, including a unit for executing the method in the first aspect of the embodiment of the present invention.

第四方面,本发明实施例还提供一种客户端,包含用于执行本发明实施例第二方面中的方法的单元。In a fourth aspect, an embodiment of the present invention further provides a client, including a unit for executing the method in the second aspect of the embodiment of the present invention.

第五方面,本发明实施例还提供一种服务器,该服务器中包括处理器,处理器被配置为支持该服务器执行第一方面提供的一种网络管理方法中相应的功能。该服务器还可以包括存储器,存储器用于与处理器耦合,其保存该服务器必要的程序指令和数据。该服务器还可以包括通信接口,用于该服务器与其他设备或通信网络通信。In a fifth aspect, an embodiment of the present invention further provides a server, where the server includes a processor, and the processor is configured to support the server to perform corresponding functions in the network management method provided in the first aspect. The server may also include memory, coupled to the processor, which holds program instructions and data necessary for the server. The server may also include a communication interface for the server to communicate with other devices or communication networks.

第六方面,本发明实施例还提供一种客户端,该客户端中包括处理器,处理器被配置为支持该客户端执行第二方面提供的一种网络管理方法中相应的功能。该客户端还可以包括存储器,存储器用于与处理器耦合,其保存该客户端必要的程序指令和数据。该客户端还可以包括通信接口,用于该客户端与其他设备或通信网络通信。In a sixth aspect, an embodiment of the present invention further provides a client, where the client includes a processor, and the processor is configured to support the client to perform corresponding functions in the network management method provided in the second aspect. The client may also include memory, coupled to the processor, that holds program instructions and data necessary for the client. The client may also include a communication interface for the client to communicate with other devices or communication networks.

第七方面,本发明实施例提供一种计算机存储介质,用于储存为上述第五方面提供的服务器所用的计算机软件指令,其包含用于执行上述方面所设计的程序。In a seventh aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the server provided in the fifth aspect, including a program for executing the above aspect.

第八方面,本发明实施例提供一种计算机存储介质,用于储存为上述第六方面提供的客户端所用的计算机软件指令,其包含用于执行上述方面所设计的程序。In an eighth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the client provided in the sixth aspect, including the program designed for executing the above aspect.

本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the invention will be more clearly understood from the description of the following embodiments.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1-a是本发明实施例提供的一种网络管理系统结构图;1-a is a structural diagram of a network management system provided by an embodiment of the present invention;

图1-b是本发明实施例提供的一种网络管理方法的一种实施例流程示意图;FIG. 1-b is a schematic flowchart of an embodiment of a network management method provided by an embodiment of the present invention;

图1-c为本发明实施例提供的一种客户端数据模型和服务器数据模型示意图;1-c is a schematic diagram of a client data model and a server data model provided by an embodiment of the present invention;

图1-d为本发明实施例提供的一种edit-config操作流程示意图;FIG. 1-d is a schematic diagram of an edit-config operation flow according to an embodiment of the present invention;

图1-e为本发明实施例提供的一种get或get-config操作的第一实施例流程示意图;1-e is a schematic flowchart of a first embodiment of a get or get-config operation provided by an embodiment of the present invention;

图1-f为本发明实施例提供的一种get或get-config操作的第二实施例流程示意图;1-f is a schematic flowchart of a second embodiment of a get or get-config operation provided by an embodiment of the present invention;

图1-g为本发明实施例提供的一种get或get-config操作的第三实施例流程示意图;1-g is a schematic flowchart of a third embodiment of a get or get-config operation provided by an embodiment of the present invention;

图1-h为本发明实施例提供的一种get或get-config操作的第四实施例流程示意图;1-h is a schematic flowchart of a fourth embodiment of a get or get-config operation provided by an embodiment of the present invention;

图2为本发明实施例提供的一种网络管理方法的另一种实施例流程示意图;FIG. 2 is a schematic flowchart of another embodiment of a network management method according to an embodiment of the present invention;

图3为本发明实施例提供的一种网络管理方法的再一种实施例流程示意图;FIG. 3 is a schematic flowchart of still another embodiment of a network management method according to an embodiment of the present invention;

图4是本发明实施例提供的一种服务器的第一实施例的结构示意图;4 is a schematic structural diagram of a first embodiment of a server provided by an embodiment of the present invention;

图5是本发明实施例提供的一种服务器的第二实施例的结构示意图;5 is a schematic structural diagram of a second embodiment of a server provided by an embodiment of the present invention;

图6是本发明实施例提供的一种服务器的第三实施例的结构示意图;6 is a schematic structural diagram of a third embodiment of a server provided by an embodiment of the present invention;

图7是本发明实施例提供的一种客户端的第一实施例的结构示意图;FIG. 7 is a schematic structural diagram of a first embodiment of a client according to an embodiment of the present invention;

图8是本发明实施例提供的一种客户端的第二实施例的结构示意图;FIG. 8 is a schematic structural diagram of a second embodiment of a client according to an embodiment of the present invention;

图9是本发明实施例提供的一种客户端的第三实施例的结构示意图。FIG. 9 is a schematic structural diagram of a third embodiment of a client according to an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例提供了一种网络管理方法、服务器、客户端及系统,以期可以在客户端和服务器的管理模块版本不一致的情况下实现正常通信。The embodiments of the present invention provide a network management method, server, client and system, so as to realize normal communication under the condition that the management module versions of the client and the server are inconsistent.

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而非用于描述特定顺序。此外,术语“包括”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second" and "third" in the description and claims of the present invention and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

以下,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。Hereinafter, some terms in the present application will be explained so as to facilitate the understanding of those skilled in the art.

(1)、网络管理,是指通过监测、控制、记录电信网络资源的性能和使用情况,以使网络有效运行的技术手段,在网络管理中,使用的最基本的网络管理协议是简单网络管理协议(Simple Network Management Protocol,简称SNMP)。(1) Network management refers to the technical means to enable the network to operate effectively by monitoring, controlling and recording the performance and usage of telecommunication network resources. In network management, the most basic network management protocol used is simple network management. Protocol (Simple Network Management Protocol, SNMP for short).

(2)、网络配置协议(Network Configuration Protocol,简称NETCONF),是指在网络管理中使用的、全新的基于可扩展标记语言(Extensible Markup Language,简称XML)的网络配置协议,NETCONF全面地定义了九种基础操作,功能主要包括取值操作、配置操作、锁操作和会话操作,在本发明实施例中,主要针对的是在客户端和服务器之间需要进行数据交换的几个操作:edit-config操作、get或get-config操作、以及copy-config操作。(2) Network Configuration Protocol (NETCONF for short) refers to a new network configuration protocol based on Extensible Markup Language (XML) used in network management. NETCONF comprehensively defines There are nine basic operations, and the functions mainly include value operation, configuration operation, lock operation and session operation. In this embodiment of the present invention, it mainly targets several operations that require data exchange between the client and the server: edit- config operations, get or get-config operations, and copy-config operations.

(3)、友元,是指在本发明实施例中为NETCONF协议新增一种能力,该能力表示协议双方(客户端和服务器)可以协商为友元,协商为友元的双方认可不严格的模型匹配,即对不能识别的字段采取忽略而不是报错的方式,这样网管(客户端)在下发报文时不需要再检查版本匹配关系,可以根据自身支持的能力下发报文,而设备在接收报文时,对于不能识别的字段可以忽略。网管对于收到的回应报文也是基于同样的处理原则,即不能识别的字段忽略。这样网管侧和设备侧都可以独立地按照自身的能力去下发和接收报文,不需要再进行复杂的版本比较及其相关的处理。(3) Friend means that a new capability is added to the NETCONF protocol in the embodiment of the present invention. This capability indicates that both parties (client and server) of the protocol can negotiate to become friends, and the two parties who negotiate to become friends are not strictly recognized. In this way, the network management (client) does not need to check the version matching relationship when sending packets, and can send packets according to its own supported capabilities, while the device When receiving a message, the unrecognized fields can be ignored. The network management is also based on the same processing principle for the received response packets, that is, the unrecognized fields are ignored. In this way, both the network management side and the device side can independently deliver and receive packets according to their own capabilities, and do not need to perform complex version comparison and related processing.

在本发明实施例中,具体地,可以通过在NETCONF协议双方的hello报文中增加友元(friendly-element)标识为客户端和服务器增加友元能力。In the embodiment of the present invention, specifically, friend capability can be added to the client and the server by adding a friendly-element identifier in the hello message of both parties of the NETCONF protocol.

(4)、数据模型,是指客户端或服务器所使用的一种数据格式,数据模型由各个节点组成,从而当客户端或服务器发送特定数据时,该特定数据的格式即可直接使用该数据模型的格式。在本发明实施例中,客户端数据模型是指客户端所使用的数据模型,服务器数据模型是指服务器所使用的数据模型。(4) Data model refers to a data format used by the client or server. The data model consists of various nodes, so that when the client or server sends specific data, the format of the specific data can directly use the data. The format of the model. In this embodiment of the present invention, the client data model refers to the data model used by the client, and the server data model refers to the data model used by the server.

(5)、“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。(5) "Multiple" refers to two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.

下面结合附图对本申请的实施例进行描述。The embodiments of the present application will be described below with reference to the accompanying drawings.

首先参见图1-a,图1-a是本发明实施例提供的一种网络管理系统结构图,本发明实施例所提供的网络管理方法均基于该网络管理系统实现,在图1-a所示的网络管理系统结构图中,包括客户端和服务器,其中,客户端也即网管设备,是指在网络管理中用于安装网络管理实体,从而为不同的网络管理协议和操作提供用户界面,以用于接收网络管理员用户的业务操作,并将用户的业务操作转换为各个网络管理协议和操作所对应的业务操作下发到对应的目标网络设备,也即服务器。在本发明实施例中,该客户端的形式包括但不限于各种形式的用户设备(User Equipment,简称UE),终端(terminal),终端设备(TerminalEquipment)等等;服务器,也即目标网络设备,是指用于接收来自于NETCONF协议网络管理实体和其它非NETCONF协议网络管理实体的网络代理的业务操作,例如,若网络管理员用户在客户端界面执行配置操作,则服务器接收到该操作内容后对服务器的相应数据进行配置。在本发明实施例中,该服务器的形式包括但不限于NETCONF服务器、集线器、路由器和交换机等。在本发明实施例的网络管理方法执行过程中,由客户端基于NETCONF协议向服务器发送包括操作请求的NETCONF请求,然后服务器对该NETCONF请求进行处理并返回处理结果给客户端。Referring first to FIG. 1-a, FIG. 1-a is a structural diagram of a network management system provided by an embodiment of the present invention. The network management methods provided by the embodiment of the present invention are all implemented based on the network management system. The structure diagram of the network management system shown in the figure includes a client and a server. The client, also known as the network management device, refers to the installation of network management entities in network management to provide user interfaces for different network management protocols and operations. It is used to receive the business operation of the network administrator user, and convert the user's business operation into the business operation corresponding to each network management protocol and operation and send it to the corresponding target network device, that is, the server. In this embodiment of the present invention, the form of the client includes but is not limited to various forms of user equipment (User Equipment, UE for short), terminal (terminal), terminal equipment (TerminalEquipment), etc.; the server, that is, the target network device, Refers to the business operation used to receive network agents from NETCONF protocol network management entities and other non-NETCONF protocol network management entities. For example, if a network administrator user performs a configuration operation on the client interface, the server receives the operation content Configure the corresponding data of the server. In this embodiment of the present invention, the form of the server includes, but is not limited to, a NETCONF server, a hub, a router, a switch, and the like. During the execution of the network management method of the embodiment of the present invention, the client sends a NETCONF request including an operation request to the server based on the NETCONF protocol, and the server processes the NETCONF request and returns the processing result to the client.

参见图1-b,图1-b是本发明实施例提供的一种网络管理方法的一种实施例流程示意图。如图1-b所示,本发明实施例提供的网络管理方法的一种实施例可以包括以下步骤:Referring to FIG. 1-b, FIG. 1-b is a schematic flowchart of an embodiment of a network management method provided by an embodiment of the present invention. As shown in FIG. 1-b, an embodiment of the network management method provided by the embodiment of the present invention may include the following steps:

S101、服务器接收所述客户端发送的NETCONF请求报文,所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理。S101. The server receives the NETCONF request message sent by the client, and the server ignores the unrecognized content in the NETCONF request message sent by the client.

在本发明实施例中,客户端可以通过NETCONF请求报文向服务器发送edit-config操作请求、get或get-config操作请求、以及copy-config操作请求。In this embodiment of the present invention, the client may send an edit-config operation request, a get or get-config operation request, and a copy-config operation request to the server through a NETCONF request message.

示例一Example 1

所述NETCONF请求报文中包括edit-config请求、基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值;The NETCONF request message includes an edit-config request, a to-be-configured data node based on the client data model, and a to-be-configured value of the to-be-configured data node;

所述服务器基于服务器数据模型确定所述待配置数据节点是否能够被识别,当所述待配置数据节点能够被识别时,所述服务器利用所述待配置数值对所述待配置数据节点进行数据配置,当所述待配置数据节点不能够被识别时,所述服务器忽略所述待配置数据节点;The server determines whether the to-be-configured data node can be identified based on the server data model, and when the to-be-configured data node can be identified, the server uses the to-be-configured value to perform data configuration on the to-be-configured data node , when the data node to be configured cannot be identified, the server ignores the data node to be configured;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括数据配置是否成功的指示。The server sends the NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data configuration is successful.

在本发明实施例中,edit-config请求可以为数据配置请求,也即客户端通过向服务器发送edit-config请求操作来使服务器对相应数据进行配置。In this embodiment of the present invention, the edit-config request may be a data configuration request, that is, the client makes the server configure the corresponding data by sending an edit-config request operation to the server.

其中,待配置数据节点可以为客户端数据模型中的某一个或几个数据节点,也可以为客户端数据模型中的所有数据节点,待配置数据节点的待配置数值可以是基于客户端数据模型发送给服务器,也可以是以其它形式包含在NETCONF请求报文中。The data node to be configured may be one or several data nodes in the client data model, or may be all data nodes in the client data model, and the value to be configured of the data node to be configured may be based on the client data model Sent to the server, or included in the NETCONF request message in other forms.

需要说明,在本发明实施例中,当客户端需要对某个数据进行配置时,则向服务器发送NETCONF请求报文,该NETCONF请求报文中包括edit-config请求,待配置的数据节点(由于该NETCONF请求报文是由客户端所发送,所以该待配置的数据节点为基于客户端数据模型的数据节点),与待配置数据节点相对应的待配置数值,从而服务器在接收到该NETCONF请求报文后,将基于友元连接对该NETCONF请求报文执行不严格匹配,也即服务器将查找待配置数据节点是否存在于服务器数据模型中,若查找到待配置数据节点存在于服务器数据模型中,也即服务器可识别该待配置数据节点,从而服务器将利用与该待配置数据节点相应的待配置数值对该待配置数据节点进行数据配置;若服务器未在服务器数据模型中查找到该待配置数据节点,从而服务器将忽略该待配置数据节点。It should be noted that, in this embodiment of the present invention, when the client needs to configure certain data, it sends a NETCONF request message to the server, where the NETCONF request message includes an edit-config request, the data node to be configured (due to the The NETCONF request message is sent by the client, so the data node to be configured is a data node based on the client data model), and the value to be configured corresponding to the data node to be configured, so the server receives the NETCONF request After the message, it will perform loose matching on the NETCONF request message based on the friend connection, that is, the server will check whether the data node to be configured exists in the server data model, and if it finds that the data node to be configured exists in the server data model , that is, the server can identify the data node to be configured, so that the server will use the value to be configured corresponding to the data node to be configured to perform data configuration on the data node to be configured; if the server does not find the data node to be configured in the server data model. data node, so the server will ignore the data node to be configured.

更进一步的,在本发明的一些可能的实施方式中,待配置数据节点为多个,其中部分为服务器可识别的数据节点,部分为服务器不可识别的数据节点,则服务器将基于服务器数据模型查找并确定待配置数据节点中可识别的数据节点以及不可识别的数据节点,具体确定方式同上实施例,然后服务器再对待配置数据节点中可识别的数据节点利用该待配置数据节点的待配置数值进行数据配置,并且同时服务器将忽略该待配置数据节点中不能识别的待配置数据节点,也即不对待配置数据节点中不能识别的待配置数据节点进行数据配置。Further, in some possible implementations of the present invention, there are multiple data nodes to be configured, some of which are data nodes identifiable by the server, and some are data nodes that are not identifiable by the server, then the server will search based on the server data model. And determine identifiable data nodes and unidentifiable data nodes in the data nodes to be configured, the specific determination method is the same as the above embodiment, and then the server uses the to-be-configured data nodes to configure the data nodes to be configured. data configuration, and at the same time, the server will ignore the unrecognized to-be-configured data nodes in the to-be-configured data nodes, that is, do not perform data configuration on the unrecognized to-be-configured data nodes in the to-be-configured data nodes.

更进一步地,当服务器仅对服务器能够识别的待配置数据节点进行数据配置后,若数据配置成功,则向客户端返回数据配置成功的指示,若数据配置不成功,则向客户端返回数据配置不成功的指示。Further, after the server only performs data configuration on the data nodes to be configured that the server can identify, if the data configuration is successful, it returns an indication of successful data configuration to the client, and if the data configuration is unsuccessful, returns the data configuration to the client. Unsuccessful instructions.

举例说明,在本发明的一些可能的实施方式中,若客户端数据模型model包括数据节点new、数据节点id和数据节点name,而服务器数据模型model包括数据节点type、数据节点id和数据节点name,具体可参见图1-c,图1-c为本发明实施例提供的一种客户端数据模型和服务器数据模型示意图。For example, in some possible implementations of the present invention, if the client data model model includes data node new, data node id and data node name, and the server data model model includes data node type, data node id and data node name 1-c, and FIG. 1-c is a schematic diagram of a client data model and a server data model provided by an embodiment of the present invention.

若客户端基于客户端数据模型请求配置数据节点new的数值为1以及数据节点name的数值为double,此时服务器将基于服务器数据模型确定能够识别的数据节点为name,从而服务器将忽略不能识别的数据节点new,仅配置能够识别的数据节点name=double,并通过NETCONF回应报文返回配置成功的处理结果给客户端。可参见图1-d,图1-d为本发明实施例提供的一种edit-config操作流程示意图;If the client requests to configure the value of the data node new as 1 and the value of the data node name as double based on the client data model, the server will determine the name of the data node that can be recognized based on the server data model, so the server will ignore the unrecognized data node. For the data node new, only the identifiable data node name=double is configured, and a NETCONF response message is used to return the successfully configured processing result to the client. Referring to FIG. 1-d, FIG. 1-d is a schematic diagram of an edit-config operation flow according to an embodiment of the present invention;

若客户端请求对A中所有数据进行配置,此时服务器将忽略不能识别的节点new,再基于服务器数据模型对能够识别的节点id和name进行数据配置。If the client requests to configure all the data in A, the server will ignore the unrecognized node new, and then configure the data based on the server data model for the identifiable node id and name.

可以理解,通过此种基于友元连接的不严格匹配的通信方式,可以解决客户端与服务器的版本不匹配的问题,也即客户端数据模型与服务器数据模型不一致时,也能顺利进行数据配置而不会报错,使得基于NETCONF协议的edit-config操作能够顺利进行,提高网络管理效率。It can be understood that this kind of communication method based on friend connection that does not strictly match can solve the problem that the versions of the client and the server do not match, that is, when the client data model is inconsistent with the server data model, the data configuration can also be carried out smoothly. No error is reported, so that the edit-config operation based on the NETCONF protocol can be carried out smoothly, and the network management efficiency can be improved.

示例二Example 2

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文包括get或get-config请求、以及基于客户端数据模型的数据过滤条件,所述数据过滤条件包括选择数据节点;The server receives a NETCONF request message sent by the client, where the NETCONF request message includes a get or get-config request and a data filtering condition based on the client data model, where the data filtering condition includes selecting a data node;

所述服务器基于服务器数据模型确定所述选择数据节点是否能够被识别,当所述选择数据节点能够被识别时,所述服务器从预设服务器数据中获取与所述选择数据节点对应的选择数据节点数值以得到获取结果数据,当所述选择数据节点不能够被识别时,所述服务器忽略所述选择数据节点;The server determines whether the selected data node can be identified based on the server data model, and when the selected data node can be identified, the server obtains the selected data node corresponding to the selected data node from preset server data value to obtain the acquisition result data, when the selection data node cannot be identified, the server ignores the selection data node;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括所述获取结果数据。The server sends the NETCONF response message to the client, where the NETCONF response message includes the acquisition result data.

在本发明实施例中,get或get-config请求可以表示客户端请求从服务器获取数据或查询数据,其中,get用于在不对数据类型进行限制时客户端从服务器中获取或查询数据,而get-config用于在客户端从服务器中获取或查询配置数据。In this embodiment of the present invention, the get or get-config request may indicate that the client requests to obtain data from the server or query data, wherein get is used for the client to obtain or query data from the server when the data type is not restricted, and get -config is used on the client to get or query configuration data from the server.

其中,预设服务器数据是指存在于服务器中,当服务器利用get或get-config从服务器中获取数据时的数据获取源,显然地,该预设服务器数据是基于服务器数据模型的。优选地,该预设服务器数据为当前服务器所运行的线程中正在操作的数据。The preset server data refers to the data acquisition source that exists in the server and when the server acquires data from the server by using get or get-config. Obviously, the preset server data is based on the server data model. Preferably, the preset server data is data that is currently being operated in a thread running on the current server.

其中,数据过滤条件是指为get或get-config获取数据时所设立的待获取数据需要满足的条件,也即服务器基于该数据过滤条件从服务器中获取相应数据,该数据过滤条件包括选择数据节点,选择数据节点用于指定服务器获取数据时的数据节点。The data filtering condition refers to the condition that the data to be acquired needs to be satisfied when acquiring data for get or get-config, that is, the server acquires the corresponding data from the server based on the data filtering condition, and the data filtering condition includes selecting a data node , select the data node to specify the data node when the server obtains data.

需要说明,当客户端需要从服务器中获取数据时,则向服务器发送NETCONF请求报文,该NETCONF请求报文中get或get-config请求以及数据过滤条件,数据过滤条件中包括选择数据节点,从而当服务器接收到该NETCONF请求报文后,将基于友元连接对该数据过滤条件执行不严格匹配过滤,也即服务器将基于服务器数据模型查找该选择数据节点是否存在于服务器数据模型中,当该选择数据节点存在于服务器数据模型中时,则表示该选择数据节点能够被服务器识别,此时服务器将从预设服务器数据中获取与该选择数据节点对应的选择数据节点数值得到获取结果数据,当该选择数据节点不存在于服务器数据模型中,此时表示服务器无法识别该选择数据节点,从而服务器将忽略该选择数据节点。It should be noted that when the client needs to obtain data from the server, it sends a NETCONF request message to the server. In the NETCONF request message, the get or get-config request and data filtering conditions include selecting data nodes, thereby When the server receives the NETCONF request message, it will perform loose matching filtering on the data filter condition based on the friend connection, that is, the server will check whether the selected data node exists in the server data model based on the server data model. When the selected data node exists in the server data model, it means that the selected data node can be recognized by the server. At this time, the server will obtain the selected data node value corresponding to the selected data node from the preset server data to obtain the obtained result data. The selection data node does not exist in the server data model, which means that the server cannot recognize the selection data node, so the server will ignore the selection data node.

更进一步地,数据过滤条件还包括内容匹配数据节点以及与该内容匹配数据节点对应的匹配数值,该内容匹配数据节点用于服务器基于服务器数据模型从预设服务器数据中获取包括该内容匹配数据节点并且该内容匹配数据节点数值等于该匹配数值的预设服务器数据。Further, the data filtering condition also includes a content matching data node and a matching value corresponding to the content matching data node, and the content matching data node is used by the server to obtain the content matching data node from the preset server data based on the server data model. And the content matching data node value is equal to the preset server data of the matching value.

在本发明实施例中,在客户端与服务器之间建立友元连接后,将不管服务器是否能够识别该内容匹配数据节点,服务器都将会利用该内容匹配数据节点进行数据过滤来得到获取结果数据,因为如果服务器忽略不能识别的内容匹配数据节点后,也即相当于服务器将该部分数据限制条件丢弃,使得获取结果数据出错。In this embodiment of the present invention, after a friend connection is established between the client and the server, regardless of whether the server can identify the content matching data node, the server will use the content matching data node to perform data filtering to obtain acquisition result data , because if the server ignores the unrecognized content that matches the data node, it is equivalent to discarding the part of the data restriction condition by the server, resulting in an error in obtaining the result data.

可选地,在本发明的一些可能的实施方式中,数据过滤条件可以只包括选择数据节点,也可以只包括内容匹配数据节点,还可以同时包括选择数据节点和内容匹配数据节点,而服务器在利用数据过滤条件从预设服务器数据中获取数据时基于的获取规则为:对于包括内容匹配数据节点数值的内容匹配数据节点,服务器将利用所有的内容匹配数据节点以及内容匹配数据节点数值进行匹配过滤得到获取结果数据,而对于选择数据节点,服务器将基于服务器数据模型确定出来能够识别的选择数据节点和不能够识别的选择数据节点,对于不能够识别的选择数据节点,服务器将忽略该部分选择数据节点,不利用该部分选择数据节点获取数据,只保留能够识别的选择数据节点作为过滤条件,从而服务器利用该能够识别的选择数据节点从预设服务器数据中获取该选择数据节点的数值得到获取结果数据。Optionally, in some possible embodiments of the present invention, the data filtering conditions may only include selected data nodes, may only include content matching data nodes, or may include both selected data nodes and content matching data nodes, and the server is in the The acquisition rules based on the acquisition of data from the preset server data by using the data filtering conditions are: for content matching data nodes including content matching data node values, the server will use all content matching data nodes and content matching data node values to perform matching filtering The obtained result data is obtained, and for the selection data node, the server will determine the recognizable selection data node and the unrecognized selection data node based on the server data model. For the unrecognized selection data node, the server will ignore this part of the selection data node, do not use this part of the selected data node to obtain data, and only retain the identifiable selected data node as a filter condition, so that the server uses the identifiable selected data node to obtain the value of the selected data node from the preset server data to obtain the result. data.

在本发明实施例中,该获取结果数据可以为包括服务器数据模型中所有节点数值的数据,也可以为只包括服务器数据模型中部分节点数值的数据。In this embodiment of the present invention, the acquisition result data may be data including all node values in the server data model, or may be data including only some node values in the server data model.

示例三Example three

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括copy-config请求、与所述copy-config请求对应的数据源标识、与所述copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,所述第一友元能力还用于表示所述服务器对所述数据源标识所指示的数据源中不能识别的字段进行忽略处理;The server receives the NETCONF request message sent by the client, where the NETCONF request message includes a copy-config request, a data source identifier corresponding to the copy-config request, and a data source identifier corresponding to the copy-config request. The target data set identifier and the data node to be copied based on the data source data model, the first friend capability is also used to indicate that the server ignores the unrecognized fields in the data source indicated by the data source identifier;

所述服务器基于服务器数据模型确定所述待拷贝数据节点是否能够被识别,当所述待拷贝数据节点能够被识别时,所述服务器拷贝所述数据源标识所指示的数据源中所述待拷贝数据节点的数值至所述目标数据集标识所指示的目标数据集中,当所述待拷贝数据节点不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点的数值;The server determines whether the data node to be copied can be identified based on the server data model, and when the data node to be copied can be identified, the server copies the data to be copied in the data source indicated by the data source identifier. The value of the data node is included in the target data set indicated by the target data set identifier, and when the data node to be copied cannot be identified, the server ignores the value of the data node to be copied in the data source;

所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据拷贝是否成功的指示。The server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether data copying is successful.

其中,该数据源标识所指示的数据可以为存在于服务器中的数据,也可以为其它位置的数据,例如若该数据源标识为统一资源定位符(Uniform Resoure Locator,简称URL),则该数据源为该URL所指向的数据,该目标数据集可以为服务器的running数据集。The data indicated by the data source identifier may be data existing in the server or data in other locations. For example, if the data source identifier is a uniform resource locator (Uniform Resoure Locator, URL for short), the data The source is the data pointed to by the URL, and the target data set can be the server's running data set.

其中,待拷贝数据节点可以为数据源数据模型中的一个或几个数据节点,也可以为数据源数据模型中的所有数据节点。The data node to be copied may be one or several data nodes in the data source data model, or may be all data nodes in the data source data model.

需要说明,在本发明实施例中,当客户端请求从某个数据源拷贝数据时,则客户端向服务器发送NETCONF请求报文,该NETCONF请求报文中包括copy-config请求、与该copy-config请求对应的数据源标识、与该copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,从而服务器在接收到该NETCONF请求报文后,将基于友元连接对该NETCONF请求报文执行不严格匹配,也即服务器将查找待拷贝数据节点是否存在于服务器数据模型中,若查找到待拷贝数据节点存在于服务器数据模型中,也即服务器可识别该待拷贝数据节点,从而服务器将从数据源标识所指示的数据源中拷贝该待拷贝数据节点对应的数值至目标数据集标识所指示的目标数据集中,若服务器未在服务器数据模型中查找到该待拷贝数据节点,从而服务器将忽略该待拷贝数据节点。It should be noted that, in this embodiment of the present invention, when the client requests to copy data from a certain data source, the client sends a NETCONF request message to the server, where the NETCONF request message includes a copy-config request, and the copy-config request message. The identifier of the data source corresponding to the config request, the identifier of the target dataset corresponding to the copy-config request, and the data node to be copied based on the data source data model, so that after receiving the NETCONF request message, the server will The NETCONF request message is not strictly matched, that is, the server will find out whether the data node to be copied exists in the server data model. If it finds that the data node to be copied exists in the server data model, that is, the server can identify the data to be copied. node, so that the server will copy the value corresponding to the data node to be copied from the data source indicated by the data source identifier to the target dataset indicated by the target dataset identifier. If the server does not find the data to be copied in the server data model node, so the server will ignore the data node to be copied.

更进一步的,在本发明的一些可能的实施方式中,待拷贝数据节点为多个,其中部分为服务器可识别的数据节点,部分为服务器不可识别的数据节点,则服务器将基于服务器数据模型查找并确定待拷贝数据节点中可识别的数据节点以及不可识别的数据节点,具体确定方式同上实施例,然后服务器再拷贝数据源中该待拷贝数据节点中可识别的数据节点的数值至目标数据集中,同时服务器将忽略该待拷贝数据节点中不可识别的数据节点。当数据拷贝成功后,服务器将返回拷贝成功的指示给客户端,当数据拷贝不成功时,服务器将返回数据拷贝不成功的指示给客户端。Further, in some possible implementations of the present invention, there are multiple data nodes to be copied, some of which are data nodes identifiable by the server, and some are data nodes that are not identifiable by the server, then the server will search based on the server data model. And determine the identifiable data nodes and unidentifiable data nodes in the data nodes to be copied, the specific determination method is the same as the above embodiment, and then the server copies the data nodes in the data source to be copied. , and the server will ignore the unidentifiable data nodes in the data nodes to be copied. When the data copy is successful, the server will return a copy success indication to the client, and when the data copy is unsuccessful, the server will return an unsuccessful data copy indication to the client.

举例说明,在本发明的一些可能的实施方式中,若数据源数据模型model包括数据节点new、数据节点id和数据节点name,而服务器数据模型model包括数据节点type、数据节点id和数据节点name,若待拷贝数据节点为new和id,由于服务器基于服务器数据模型仅能识别数据节点id,从而服务器将拷贝url所指示的数据源中数据节点new的数值至目标数据集中,忽略数据源中数据节点new的值,最终返回拷贝成功的指示给客户端;For example, in some possible implementations of the present invention, if the data source data model model includes data node new, data node id and data node name, and the server data model model includes data node type, data node id and data node name , if the data node to be copied is new and id, since the server can only identify the data node id based on the server data model, the server will copy the value of the data node new in the data source indicated by the url to the target data set, ignoring the data in the data source The value of node new, and finally return the copy success indication to the client;

若客户端请求对数据源中所有数据进行拷贝,此时服务器将忽略不能识别的节点new的数值,并拷贝服务器能够识别的节点id和name的数值至目标数据集中。If the client requests to copy all the data in the data source, the server will ignore the value of the node new that cannot be recognized, and copy the value of the node id and name that the server can recognize to the target data set.

可以理解,通过基于友元连接对客户端发送的数据源标识所指示的数据源执行不严格匹配的通信方式,可以解决数据源数据模型与服务器数据模型不匹配的问题,也即客户端数据模型与服务器数据模型不相同时也能顺利进行数据拷贝而不会报错,使得基于NETCONF协议的copy-config操作能够顺利进行,提高网络管理效率。It can be understood that by performing a communication method that does not strictly match the data source indicated by the data source identifier sent by the client based on the friend connection, the problem that the data source data model does not match the server data model can be solved, that is, the client data model. When the data model is different from that of the server, the data can be copied smoothly without error reporting, so that the copy-config operation based on the NETCONF protocol can be carried out smoothly, and the network management efficiency can be improved.

S102、所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括根据所述NETCONF请求报文进行处理的处理结果。S102. The server sends a NETCONF response message to the client, where the NETCONF response message includes a processing result of processing according to the NETCONF request message.

S103、所述客户端接收所述服务器发送的所述NETCONF回应报文,所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理。S103. The client receives the NETCONF response message sent by the server, and the client ignores the unrecognized content in the NETCONF response message sent by the server.

作为一种示例,例如所述客户端接收所述服务器返回的NETCONF回应报文,所述NETCONF回应报文包括所述服务器根据get或get-config请求得到的获取结果数据,其中,所述获取结果数据的数据模型为所述服务器数据模型;As an example, for example, the client receives a NETCONF response message returned by the server, where the NETCONF response message includes acquisition result data obtained by the server according to a get or get-config request, wherein the acquisition result The data model of the data is the server data model;

所述客户端基于所述客户端数据模型确定所述获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值,并忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The client determines identifiable data nodes and unidentifiable data nodes in the acquisition result data based on the client data model, and the client stores the identifiable data nodes in the acquisition result data. The value of the data node, and the value of the data node that cannot be identified in the acquisition result data is ignored.

需要说明,客户端在接收到服务器返回的获取结果数据后,客户端将基于客户端数据模型确定基于服务器数据模型的获取结果数据中的各数据节点是否存在于客户端数据模型中,对于存在于客户端数据模型的数据节点,则表示客户端能够识别,此时客户端将基于客户端数据模型保存获取结果数据中该数据节点的值,而对于不存在于客户端数据模型的数据节点,则表示客户端不能够识别,此时忽略该数据节点。It should be noted that after the client receives the acquisition result data returned by the server, the client will determine, based on the client data model, whether each data node in the acquisition result data based on the server data model exists in the client data model. The data node of the client data model means that the client can recognize it. At this time, the client will save the value of the data node in the obtained result data based on the client data model. For data nodes that do not exist in the client data model, then Indicates that the client does not recognize the data node and ignores the data node at this time.

举例说明,在本发明的一些可能的实施方式中,依然参考图1-c所示的客户端数据模型和服务器数据模型示意图,若客户端数据模型model包括数据节点new、数据节点id和数据节点name,而服务器数据模型model包括数据节点type、数据节点id和数据节点name,当客户端基于客户端数据模型请求获取数据节点new和数据节点name的数值,此时数据节点new和数据节点name相当于过滤条件中的选择数据节点,此时服务器将基于服务器数据模型确定选择数据节点中能够识别的选择数据节点name以及new为不能够识别的选择数据节点,从而服务器将从预设服务器数据中(例如为modelA,modelA中数据节点name的数值为double),获取数据节点name的数值,得到double,该数值即为获取结果数据,然后服务器将该获取结果数据通过NETCONF回应报文返回给客户端,客户端在接收到数据节点name的数值double后,由于name存在于客户端数据模型中,即客户端能够识别该获取结果数据,客户端将保存数据节点name的数值double,可参见图1-e,图1-e为本发明实施例提供的一种get或get-config操作的第一实施例流程示意图。For example, in some possible implementations of the present invention, still referring to the schematic diagrams of the client data model and the server data model shown in FIG. 1-c, if the client data model model includes data node new, data node id and data node name, and the server data model model includes data node type, data node id and data node name. When the client requests to obtain the values of data node new and data node name based on the client data model, the data node new and data node name are equivalent at this time. In the selection data node in the filter conditions, the server will determine the name of the selection data node that can be identified in the selection data node and new based on the server data model. For example, modelA, the value of the data node name in modelA is double), get the value of the data node name, get double, this value is the obtained result data, and then the server returns the obtained result data to the client through the NETCONF response message, After the client receives the value double of the data node name, since the name exists in the client data model, that is, the client can identify the obtained result data, the client will save the value double of the data node name, as shown in Figure 1-e 1-e is a schematic flowchart of a first embodiment of a get or get-config operation provided by an embodiment of the present invention.

在另一个实施例中,若客户端请求获取预设服务器数据中数据节点id=1且数据节点new=2的所有数据,此时相当于设置数据节点id和数据节点name为内容匹配数据节点,而由于服务器数据模型中不存在数据节点new,所以在利用new=2这一过滤条件进行数据过滤时,将在预设服务器数据中搜索不到任何满足new=2的预设服务器数据,最终返回空数据给客户端,但是服务器在利用过滤条件过滤时,并不能基于客户端与服务器之间的友元连接忽略new=2这一过滤条件,若忽略了,则相当于删除了该过滤条件,此时相当于只获取了预设服务器数据中id=1的数据为获取结果数据,而该结果显示与期望获得的结果是不一样,可参见图1-f,图1-f为本发明实施例提供的一种get或get-config操作的第二实施例流程示意图。In another embodiment, if the client requests to obtain all the data of data node id=1 and data node new=2 in the preset server data, it is equivalent to setting the data node id and data node name as content matching data nodes, Since there is no data node new in the server data model, when using the filter condition of new=2 for data filtering, the preset server data will not be able to be searched for any preset server data that satisfies new=2, and finally returned Empty data is given to the client, but when the server uses the filter condition to filter, it cannot ignore the filter condition of new=2 based on the friend connection between the client and the server. If it is ignored, it is equivalent to deleting the filter condition. At this time, it is equivalent to only obtain the data with id=1 in the preset server data, which is the obtained result data, and the result display is different from the expected result. Please refer to Figure 1-f. Figure 1-f is the implementation of the present invention A schematic flowchart of the second embodiment of a get or get-config operation provided by the example.

在另一个实施例中,若客户端请求获取预设服务器数据中数据节点id=1的数据中数据节点new的数值,此时相当于设置数据过滤条件时,id为内容匹配数据节点,new为选择数据节点,服务器在接收到该获取请求时,首先过滤预设服务器数据中数据节点id=1的数据,例如此时得到两个数据modelA和modelB,而当再利用选择数据节点new进行过滤时,由于服务器数据模型中不存在数据节点new,所以将不从modelA和modelB中获取任何数据,最终返回空数据给客户端,可参见图1-g,图1-g为本发明实施例提供的一种get或get-config操作的第三实施例流程示意图。In another embodiment, if the client requests to obtain the value of the data node new in the data of the data node id=1 in the preset server data, this is equivalent to setting the data filter condition, id is the content matching data node, and new is Select the data node, when the server receives the acquisition request, it first filters the data with the data node id=1 in the preset server data, for example, two data modelA and modelB are obtained at this time, and when the selected data node new is used for filtering , since there is no data node new in the server data model, it will not obtain any data from modelA and modelB, and finally return empty data to the client, see Figure 1-g, Figure 1-g is provided by the embodiment of the present invention A schematic flowchart of a third embodiment of a get or get-config operation.

在又一个实施例中,若客户端设置数据过滤条件为仅包括内容匹配节点id=1,也即请求获取预设服务器数据中数据节点id=1的所有数据,例如此时得到数据modelA为获取结果数据,服务器将modelA(modelA为基于服务器数据模型的,各个数据节点值分别为type=1,id=1,name=1)返回给客户端,客户端在接收到该数据后,将基于客户端数据模型确定其中可识别的数据节点id和name,并保存数据节点id的数值1,以及数据节点name的数值为2,对于不能识别的数据节点type则忽略,可参见图1-h,图1-h为本发明实施例提供的一种get或get-config操作的第四实施例流程示意图。In yet another embodiment, if the client sets the data filtering condition to include only the content matching node id=1, that is, it requests to obtain all the data of the data node id=1 in the preset server data, for example, the data modelA obtained at this time is the acquisition For the result data, the server returns modelA (modelA is based on the server data model, and the values of each data node are type=1, id=1, name=1) to the client. After the client receives the data, it will be based on the client The terminal data model determines the identifiable data node id and name, and saves the data node id value of 1 and the data node name value of 2. For the unrecognized data node type, it is ignored. See Figure 1-h, Figure 1. 1-h is a schematic flowchart of a fourth embodiment of a get or get-config operation provided by an embodiment of the present invention.

可以理解,在客户端与服务器之间建立友元连接后,服务器对于基于NETCONF协议的get或get-config操作过滤条件的处理过程中,如果是内容匹配数据节点,全部作为过滤条件进行过滤,对于选择数据节点则忽略不能识别的选择节点,通过此种方式解决客户端与服务器版本不匹配的问题并使得获取结果数据正确,最终得到获取结果数据返回给客户端后,客户端对于获取结果数据的解析保存过程中,也执行不严格匹配,对于不能够识别的数据节点进行忽略,只保存客户端能够识别的数据节点,通过此种方式解决客户端与服务器版本不匹配的问题。从而可以在客户端与服务器版本不一致,也即客户端数据模型与服务器数据模型不一致时,也能顺利使get或get-config操作顺利进行而不会报错,提高网络管理效率。It can be understood that after a friend connection is established between the client and the server, in the process of the server processing the filter conditions of the get or get-config operation based on the NETCONF protocol, if the content matches the data node, all of them are filtered as filter conditions. Selecting data nodes ignores unrecognized selection nodes. In this way, the problem that the client and server versions do not match is solved, and the obtained result data is correct. After the obtained result data is finally returned to the client, the client has no effect on the obtained result data. In the process of parsing and saving, loose matching is also performed. Data nodes that cannot be recognized are ignored, and only data nodes that can be recognized by the client are saved. In this way, the problem that the client and server versions do not match is solved. Therefore, even when the client and server versions are inconsistent, that is, when the client data model is inconsistent with the server data model, the get or get-config operation can be smoothly performed without an error being reported, and the network management efficiency can be improved.

可选地,在本发明的一些可能的实施方式中,在执行S101之前,所述方法还包括:Optionally, in some possible embodiments of the present invention, before executing S101, the method further includes:

S101’、服务器经由客户端与所述服务器之间的SSH连接向客户端发送第一Hello报文。S101', the server sends a first Hello packet to the client via the SSH connection between the client and the server.

其中,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理。Wherein, the first Hello packet carries a first friend friendly-element identifier, and the first friend friendly-element identifier is used to indicate that the server has a first friend capability, and the first friend capability It is used to indicate that the server ignores the unrecognized fields in the NETCONF request message received from the client.

同时,在服务器经由SSH连接向客户端发送第一Hello报文后,客户端经由所述客户端与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理。At the same time, after the server sends the first Hello message to the client via the SSH connection, the client receives the first Hello message sent by the server via the SSH connection between the client and the server. The document carries the first friend friendly-element identifier, which is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has a The unrecognized fields in the received NETCONF request message from the client are ignored.

在本发明实施例中,客户端可以通过NETCONF请求报文向服务器发送edit-config操作请求、get或get-config操作请求、以及copy-config操作请求。In this embodiment of the present invention, the client may send an edit-config operation request, a get or get-config operation request, and a copy-config operation request to the server through a NETCONF request message.

其中,SSH连接,也即Secure Shell连接,是指客户端与服务器之间的一个物理通信连接,从而基于该SSH连接客户端与服务器之间能够发送Hello报文以建立会话连接。The SSH connection, that is, the Secure Shell connection, refers to a physical communication connection between the client and the server, so that based on the SSH connection, the client and the server can send Hello packets to establish a session connection.

S102’、所述客户端经由所述SSH连接向服务器发送第二Hello报文。S102', the client sends a second Hello packet to the server via the SSH connection.

其中,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理。The second Hello packet carries a second friend friendly-element identifier, and the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend The capability is used to indicate that the client ignores the unrecognized fields in the NETCONF response message received from the server.

同时,在客户端经由SSH连接发送第二Hello报文,所述服务器经由所述SSH连接接收来自客户端的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理。At the same time, the client sends a second Hello packet via the SSH connection, the server receives a second Hello packet from the client via the SSH connection, and the second Hello packet carries the second friend friendly-element identifier , the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client responds to the NETCONF received from the server Unrecognized fields in the packet are ignored.

其中,NETCONF回应报文是指服务器对客户端发送过来的NETCONF请求报文进行处理后所返回的数据报文。The NETCONF response message refers to a data message returned by the server after processing the NETCONF request message sent by the client.

更进一步地,服务器向客户端发送的数据报文除了NETCONF回应报文外,还可以为NETCONF notification报文,是指由服务器主动向客户端发送的数据报文。Further, in addition to the NETCONF response message, the data message sent by the server to the client may also be a NETCONF notification message, which refers to a data message actively sent by the server to the client.

S103’、所述服务器根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系。S103', the server determines the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier.

相应地,所述客户端根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系。Correspondingly, the client determines the friend relationship between the client and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier.

可以理解,通过上述方式确定客户端与服务器之间的友元关系后,也即表示客户端与服务器可以基于友元能力进行通信,从而客户端与服务器在通信的过程中可以执行不严格匹配的处理方式也不会报错。It can be understood that after the friend relationship between the client and the server is determined in the above manner, it means that the client and the server can communicate based on the friend capability, so that the client and the server can perform a non-strict match during the communication process. The processing method will not report an error.

需要说明,在本发明实施例中,不严格匹配是指通信双方对对方所发送的数据报文中不能够识别的字段进行忽略处理,也即服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理,客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理,而不会导致报错,从而可以在客户端与服务器端的版本不一致时双方的通信能够顺利进行。It should be noted that in this embodiment of the present invention, loose matching means that both parties in the communication ignore the unidentifiable fields in the data message sent by the other party, that is, the server responds to the NETCONF request message received from the client. The unrecognized fields in the text are ignored, and the client ignores the unrecognized fields in the NETCONF response message received from the server, without causing an error, so that the versions of the client and the server can be inconsistent. The communication between the two parties can be carried out smoothly.

更进一步地,当服务器和客户端为同一版本时,也即服务器和客户端的数据模型相同,此时基于服务器和客户端之间的友元连接进行通信的情况下,服务器和客户端在通信时也将基于模型进行严格的匹配,与未建立友元连接时的通信方式相同,故该友元连接的建立在服务器和客户端的版本相同时不会影响彼此的正常通信。Further, when the server and the client are of the same version, that is, the data model of the server and the client is the same, and in the case of communication based on the friend connection between the server and the client, when the server and the client communicate Strict matching will also be carried out based on the model, which is the same as the communication method when the friend connection is not established, so the establishment of the friend connection will not affect the normal communication of each other when the server and client versions are the same.

可以看出,本实施例的方案中,服务器经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;客户端在同时也向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;从而在服务器接收到客户端发送的第二Hello报文,以及客户端接收到服务器端发送的第一Hello报文后,服务器端和客户端之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that in the solution of this embodiment, the server sends a first Hello packet to the client through the SSH connection between the client and the server, and the first Hello packet carries the first friend friendly-element identifier, The first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server is in the received NETCONF request message from the client. Unrecognized fields are ignored; the client also sends a second Hello packet to the server at the same time, and the second Hello packet carries the second friend friendly-element identifier, and the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores the unrecognized field in the NETCONF response message received from the server; Therefore, after the server receives the second Hello packet sent by the client, and the client receives the first Hello packet sent by the server, the relationship between the server and the client is based on the first friend friendly-element identifier and the second Hello packet. The friendly-element logo establishes a friendly-element relationship. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

可选地,在本发明的一些可能的实施方式中,所述方法还包括:Optionally, in some possible embodiments of the present invention, the method further includes:

若所述服务器检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;If the server detects that the client data model or the server data model has changed, it determines whether the client data model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则所述服务器关闭所述第一友元能力,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the data model of the client is consistent with the data model of the server, the server disables the first friend capability, so that the server does not have the ability to fail in the NETCONF request message received from the client. The ability for recognized fields to be ignored.

可选地,在本发明的一些可能的实施方式中,所述方法还包括:Optionally, in some possible embodiments of the present invention, the method further includes:

若所述客户端数据模型与所述服务器数据模型一致,则所述服务器经由所述SSH连接向所述客户端发送指示所述客户端关闭所述第二友元能力的指示消息,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the server sends an instruction message to the client via the SSH connection, instructing the client to disable the second friend capability, so that all The client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server.

可选地,在本发明的一些可能的实施方式中,所述方法还包括:Optionally, in some possible embodiments of the present invention, the method further includes:

所述方法还包括:The method also includes:

若所述客户端检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;If the client detects that the client data model or the server data model has changed, then determine whether the client data model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端关闭所述第二友元能力,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client disables the second friend capability, so that the client does not have the NETCONF response message received from the server The ability to ignore unrecognized fields in .

可选地,在本发明的一些可能的实施方式中,所述方法还包括:Optionally, in some possible embodiments of the present invention, the method further includes:

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端经由所述SSH连接向所述服务器发送指示所述服务器关闭所述第一友元能力的指示消息,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client sends an instruction message to the server via the SSH connection to instruct the server to disable the first friend capability, so that the The server does not have the ability to ignore the unrecognized fields in the received NETCONF request message from the client.

具体地,可通过在客户端和服务器之间重新发送携带有friendly-element-off标识的Hello报文来关闭以及同时指示对端关闭友元能力。Specifically, by resending a Hello packet carrying the friendly-element-off identifier between the client and the server, the function can be disabled and the opposite end can be instructed to disable the friend capability at the same time.

需要说明,为了使客户端与服务器之间的通信更为安全严格,可以在客户端与服务器版本一致时关闭双方的友元连接,而当客户端版本或服务器版本升级时,将导致客户端数据模型或服务器数据模型发生变化,所以可通过在客户端数据模型或服务器数据模型发生变化时,客户端或服务器检测客户端数据模型与服务器数据模型是否一致,并在客户端数据数据模型与服务器数据模型一致时,关闭双方的友元能力,以使客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力,和服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。It should be noted that in order to make the communication between the client and the server more secure and strict, the friend connection of both parties can be closed when the versions of the client and the server are the same, and when the client version or the server version is upgraded, the client data will be The model or server data model changes, so when the client data model or the server data model changes, the client or server can detect whether the client data model is consistent with the server data model, and check whether the client data model and the server data model are consistent. When the models are consistent, the friend capabilities of both parties are turned off, so that the client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server, and the server does not have the ability to The capability of ignoring unrecognized fields in the client's NETCONF request message.

可以理解,在客户端与服务器建立友元连接时,再在客户端与服务器数据模型升级到一致后关闭双方的友元能力,从而使客户端和服务器之间再次基于严格的模型匹配进行通信,保证通信安全,使得网络管理更为灵活。It can be understood that when the client and the server establish a friend connection, the friend capabilities of both parties are closed after the data models of the client and the server are upgraded to the same level, so that the communication between the client and the server is based on strict model matching again. Ensure communication security and make network management more flexible.

为了便于更好地理解和实施本发明实施例的上述方案,下面将举例几个具体的应用场景进行说明。In order to facilitate better understanding and implementation of the above solutions in the embodiments of the present invention, several specific application scenarios will be used for description below.

参见图2,图2为本发明实施例提供的一种网络管理方法的第二实施例流程示意图。如图2所示,本发明实施例提供的网络管理方法的第二实施例可以包括以下步骤:Referring to FIG. 2, FIG. 2 is a schematic flowchart of a second embodiment of a network management method according to an embodiment of the present invention. As shown in FIG. 2 , the second embodiment of the network management method provided by the embodiment of the present invention may include the following steps:

S201、服务器经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文。S201. The server sends a first Hello packet to the client via the SSH connection between the client and the server.

其中,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理。Wherein, the first Hello packet carries a first friend friendly-element identifier, and the first friend friendly-element identifier is used to indicate that the server has a first friend capability, and the first friend capability It is used to indicate that the server ignores the unrecognized fields in the NETCONF request message received from the client.

同时,在服务器经由SSH连接向客户端发送第一Hello报文后,客户端经由客户端与服务器之间的SSH连接接收所述服务器发送的第一Hello报文。Meanwhile, after the server sends the first Hello message to the client via the SSH connection, the client receives the first Hello message sent by the server via the SSH connection between the client and the server.

S202、客户端经由SSH连接向服务器发送第二Hello报文。S202, the client sends a second Hello packet to the server via the SSH connection.

其中,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理。The second Hello packet carries a second friend friendly-element identifier, and the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend The capability is used to indicate that the client ignores the unrecognized fields in the NETCONF response message received from the server.

同时,在客户端经由SSH连接发送第二Hello报文,服务器经由SSH连接接收来自客户端的第二Hello报文。Meanwhile, the client sends the second Hello packet via the SSH connection, and the server receives the second Hello packet from the client via the SSH connection.

具体地,在本发明实施例中,客户端和服务器可以通过以下代码来发送携带有friendly-element的Hello报文。Specifically, in this embodiment of the present invention, the client and the server can send a Hello packet carrying friendly-element through the following codes.

服务器hello报文:Server hello message:

Figure BDA0002628326940000141
Figure BDA0002628326940000141

客户端hello报文:Client hello message:

Figure BDA0002628326940000142
Figure BDA0002628326940000142

S203、服务器根据第一友元friendly-element标识和第二友元friendly-element标识确定服务器与客户端之间的友元关系。S203. The server determines the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier.

相应地,客户端根据第一友元friendly-element标识和第二友元friendly-element标识确定客户端与服务器之间的友元关系。Correspondingly, the client determines the friend relationship between the client and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier.

S204、客户端向服务器发送NETCONF请求报文,该NETCONF请求报文中包括get或get-config请求。S204. The client sends a NETCONF request message to the server, where the NETCONF request message includes a get or get-config request.

此外,该NETCONF请求报文中还包括基于客户端数据模型的数据过滤条件,所述数据过滤条件包括选择数据节点。In addition, the NETCONF request message also includes data filtering conditions based on the client data model, and the data filtering conditions include selecting data nodes.

在客户端向服务器发送NETCONF请求报文后,服务器接收客户端发送的NETCONF请求报文。After the client sends the NETCONF request message to the server, the server receives the NETCONF request message sent by the client.

具体地,可以通过以下代码来实现。Specifically, it can be implemented by the following code.

在本发明一种实施例中,假设服务器的数据模型如下:In an embodiment of the present invention, it is assumed that the data model of the server is as follows:

Figure BDA0002628326940000151
Figure BDA0002628326940000151

而客户端的数据模型如下:The client data model is as follows:

Figure BDA0002628326940000152
Figure BDA0002628326940000152

可以看出,服务器是较新的版本,比客户端多一个叶子节点id。It can be seen that the server is a newer version and has one more leaf node id than the client.

在本发明一种实施例中,客户端下发请求报文的代码如下:In an embodiment of the present invention, the code for the client to send the request message is as follows:

Figure BDA0002628326940000153
Figure BDA0002628326940000153

Figure BDA0002628326940000161
Figure BDA0002628326940000161

在本发明另一种实施例中,假设客户端的数据模型如下:In another embodiment of the present invention, it is assumed that the data model of the client is as follows:

Figure BDA0002628326940000162
Figure BDA0002628326940000162

而服务器的数据模型如下:The data model of the server is as follows:

Figure BDA0002628326940000163
Figure BDA0002628326940000163

可以看出,客户端是较新的版本,比服务器多2个叶子节点id和new。It can be seen that the client is a newer version, with 2 more leaf nodes id and new than the server.

在本发明另一种实施例中,客户端下发请求报文的代码如下:In another embodiment of the present invention, the code for the client to send the request message is as follows:

Figure BDA0002628326940000164
Figure BDA0002628326940000164

Figure BDA0002628326940000171
Figure BDA0002628326940000171

S205、服务器根据该get或get-config请求从预设服务器数据中获取数据以得到获取结果数据。S205, the server obtains data from the preset server data according to the get or get-config request to obtain the obtained result data.

所述服务器基于服务器数据模型确定所述选择数据节点是否能够被识别,当所述选择数据节点能够被识别时,所述服务器从预设服务器数据中获取与所述选择数据节点对应的选择数据节点数值以得到获取结果数据,当所述选择数据节点不能够被识别时,所述服务器忽略所述选择数据节点。The server determines whether the selected data node can be identified based on the server data model, and when the selected data node can be identified, the server obtains the selected data node corresponding to the selected data node from preset server data value to obtain the acquisition result data, when the selected data node cannot be identified, the server ignores the selected data node.

S206、服务器向客户端发送NETCONF回应报文,该NETCONF回应报文包括获取结果数据。S206, the server sends a NETCONF response message to the client, where the NETCONF response message includes the acquisition result data.

在服务器向客户端发送NETCONF回应报文后,客户端接收服务器发送的NETCONF回应报文,该NETCONF回应报文包括获取结果数据。After the server sends the NETCONF response message to the client, the client receives the NETCONF response message sent by the server, and the NETCONF response message includes the acquisition result data.

在本发明一种实施例中,服务器返回NETCONF回应报文可以通过如下代码实现:In an embodiment of the present invention, the server returning a NETCONF response message can be implemented by the following code:

Figure BDA0002628326940000172
Figure BDA0002628326940000172

在本发明另一种实施例中,服务器返回NETCONF回应报文可以通过如下代码实现:In another embodiment of the present invention, the server returning a NETCONF response message can be implemented by the following code:

Figure BDA0002628326940000173
Figure BDA0002628326940000173

Figure BDA0002628326940000181
Figure BDA0002628326940000181

服务器在利用内容匹配节点id进行匹配时,由于服务器数据模型中不存在数据节点id,所以返回空数据。When the server uses the content matching node id for matching, since the data node id does not exist in the server data model, it returns empty data.

S207、客户端基于客户端数据模型保存该获取结果数据。S207, the client saves the acquisition result data based on the client data model.

所述客户端基于所述客户端数据模型确定所述获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值,并忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The client determines identifiable data nodes and unidentifiable data nodes in the acquisition result data based on the client data model, and the client stores the identifiable data nodes in the acquisition result data. The value of the data node, and the value of the data node that cannot be identified in the acquisition result data is ignored.

基于上述代码解析,客户端在接收到服务器的返回的获取结果数据后,将基于客户端数据模型忽略不能识别的节点id,保存name=a以及other=foo。Based on the above code analysis, after receiving the acquisition result data returned by the server, the client ignores the unrecognized node id based on the client data model, and saves name=a and other=foo.

需要说明,本发明实施例提供的一种网络管理方法的第二实施例与本发明实施例提供的一种网络管理方法的第一实施例中相同的步骤和描述在此不再赘述。It should be noted that the steps and descriptions in the second embodiment of the network management method provided by the embodiments of the present invention are the same as those in the first embodiment of the network management method provided by the embodiments of the present invention, and are not repeated here.

可以看出,本实施例的方案中,在客户端与服务器之间建立友元连接后,服务器和客户端之间的get或get-config操作即可基于该友元连接进行,使得客户端和服务器数据模型不一致时通信能顺利进行,提高网络管理效率。It can be seen that, in the solution of this embodiment, after a friend connection is established between the client and the server, the get or get-config operation between the server and the client can be performed based on the friend connection, so that the client and When the server data model is inconsistent, the communication can be carried out smoothly, and the network management efficiency can be improved.

下面对NETCONF操作协议中的edit-config操作请求和copy-config操作请求进行具体实现说明,可参见图3,图3为本发明实施例提供的一种网络管理方法的第三实施例流程示意图,该实施例为基于客户端与服务器之间确定友元关系后所实施的,也即在步骤S103后,还可以包括步骤:The following describes the specific implementation of the edit-config operation request and the copy-config operation request in the NETCONF operation protocol. Referring to FIG. 3, FIG. 3 is a schematic flowchart of a third embodiment of a network management method provided by an embodiment of the present invention. , this embodiment is implemented based on the determination of the friend relationship between the client and the server, that is, after step S103, it may further include steps:

S301、客户端向服务器发送NETCONF请求报文,该NETCONF请求报文中包括数据操作请求。S301. The client sends a NETCONF request message to the server, where the NETCONF request message includes a data operation request.

此外,当该NETCONF请求报文中包括edit-config请求时,该NETCONF请求报文中还包括基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值。In addition, when the NETCONF request message includes an edit-config request, the NETCONF request message also includes the data node to be configured based on the client data model and the to-be-configured value of the data node to be configured.

在本发明的另一些可能的实施方式中,当该NETCONF请求报文中包括copy-config请求时,该与NETCONF请求报文还包括所述copy-config请求对应的数据源标识、与所述copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点。In some other possible embodiments of the present invention, when the NETCONF request message includes a copy-config request, the NETCONF request message further includes a data source identifier corresponding to the copy-config request, a data source identifier corresponding to the copy-config request, and the copy-config request. -config requests the corresponding target dataset identifier and the data node to be copied based on the data source data model.

在客户端向服务器发送NETCONF请求报文后,服务器接收客户端发送的NETCONF请求报文。After the client sends the NETCONF request message to the server, the server receives the NETCONF request message sent by the client.

具体地,在本发明一些可能的实施方式中,可以通过以下代码来实现edit-config操作请求。Specifically, in some possible implementations of the present invention, the edit-config operation request can be implemented by the following code.

具体地,假设客户端的数据模型如下:Specifically, it is assumed that the data model of the client is as follows:

Figure BDA0002628326940000182
Figure BDA0002628326940000182

Figure BDA0002628326940000191
Figure BDA0002628326940000191

服务器的数据模型如下:The data model of the server is as follows:

Figure BDA0002628326940000192
Figure BDA0002628326940000192

可以看出,客户端是较新的版本,比服务器多一个叶子节点idIt can be seen that the client is a newer version with one more leaf node id than the server

客户端向服务器下发NETCONF请求报文可以通过下述代码实现:The client can send the NETCONF request message to the server through the following code:

Figure BDA0002628326940000193
Figure BDA0002628326940000193

S302、服务器对数据操作请求进行处理。S302, the server processes the data operation request.

可选地,当服务器edit-config请求进行处理时,所述服务器基于服务器数据模型确定所述待配置数据节点是否能够被识别,当所述待配置数据节点能够被识别时,所述服务器利用所述待配置数值对所述待配置数据节点进行数据配置,当所述待配置数据节点不能够被识别时,所述服务器忽略所述待配置数据节点;Optionally, when the server edit-config request is processed, the server determines whether the data node to be configured can be identified based on the server data model, and when the data node to be configured can be identified, the server uses the The to-be-configured value performs data configuration on the to-be-configured data node, and when the to-be-configured data node cannot be identified, the server ignores the to-be-configured data node;

可选地,当服务器copy-config请求进行处理时,所述服务器基于服务器数据模型确定所述待拷贝数据节点是否能够被识别,当所述待拷贝数据节点能够被识别时,所述服务器拷贝所述数据源标识所指示的数据源中所述待拷贝数据节点的数值至所述目标数据集标识所指示的目标数据集中,当所述待拷贝数据节点不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点的数值。Optionally, when the server copy-config request is processed, the server determines whether the data node to be copied can be identified based on the server data model, and when the data node to be copied can be identified, the server copies all data nodes. The value of the data node to be copied in the data source indicated by the data source identifier is added to the target data set indicated by the target data set identifier. When the data node to be copied cannot be identified, the server ignores the value of the data node to be copied. The value of the data node to be copied in the data source.

具体地,服务器在接收到步骤S302中代码的配置请求后,由于客户端和服务器为友元关系,所以执行不严格匹配,服务器将基于服务器数据模型忽略不认识的数据节点id,仅配置能够识别的数据节点name和other。Specifically, after the server receives the configuration request of the code in step S302, since the client and the server are in a friend relationship, the matching is not strictly performed. The data node name and other.

S303、服务器向客户端发送数据操作处理是否成功的指示。S303. The server sends an indication to the client whether the data operation processing is successful.

可选地,当数据操作请求为edit-config请求时,服务器向客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据配置是否成功的指示。Optionally, when the data operation request is an edit-config request, the server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data configuration is successful.

可选地,当数据操作请求为copy-config请求时,服务器向客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据拷贝是否成功的指示。Optionally, when the data operation request is a copy-config request, the server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data copy is successful.

在服务器向客户端发送数据操作处理是否成功的指示后,客户端将接收到服务器发送的数据操作是否成功的指示。After the server sends an indication of whether the data operation processing is successful to the client, the client will receive the indication of whether the data operation is successful sent by the server.

针对步骤S301的配置请求,服务器在执行配置操作后,基于友元连接配置成功,不报错,返回配置成功的NETCONF回应报文,具体代码实现可如下:In response to the configuration request in step S301, after the server performs the configuration operation, based on the successful configuration of the friend connection, no error is reported, and a NETCONF response message with successful configuration is returned. The specific code implementation can be as follows:

Figure BDA0002628326940000201
Figure BDA0002628326940000201

需要说明,本发明实施例提供的一种网络管理方法的第二实施例与本发明实施例提供的一种网络管理方法的第一实施例中相同的步骤和描述在此不再赘述。It should be noted that the steps and descriptions in the second embodiment of the network management method provided by the embodiments of the present invention are the same as those in the first embodiment of the network management method provided by the embodiments of the present invention, and are not repeated here.

可以看出,本实施例的方案中,在客户端与服务器之间建立友元连接后,服务器和客户端之间的edit-config或copy-config操作即可基于该友元连接进行,使得客户端和服务器数据模型不一致时通信能顺利进行,提高网络管理效率。It can be seen that in the solution of this embodiment, after a friend connection is established between the client and the server, the edit-config or copy-config operation between the server and the client can be performed based on the friend connection, so that the client When the data model of the client and server is inconsistent, the communication can be carried out smoothly, and the efficiency of network management can be improved.

本发明实施例还提供一种服务器,该服务器包括:The embodiment of the present invention also provides a server, the server includes:

接收单元,用于所述服务器接收客户端发送的网络配置协议NETCONF请求报文;a receiving unit, used for the server to receive the network configuration protocol NETCONF request message sent by the client;

处理单元,用于所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理;A processing unit, used for the server to ignore the unrecognized content in the NETCONF request message sent by the client;

发送单元,用于所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括根据所述NETCONF请求报文进行处理的处理结果。A sending unit, used for the server to send a NETCONF response message to the client, where the NETCONF response message includes a processing result of processing according to the NETCONF request message.

可以理解,通过上述方式客户端与服务器在通信的过程中可以执行不严格匹配的处理方式也不会报错,从而提高网络执行效率和管理效率。It can be understood that in the above manner, the client and the server can perform a processing method that does not strictly match during the communication process, and no error will be reported, thereby improving the network execution efficiency and management efficiency.

需要说明,在本发明实施例中,不严格匹配是指通信双方对对方所发送的数据报文中不能够识别的字段进行忽略处理,也即服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理,客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理,而不会导致报错,从而可以在客户端与服务器端的版本不一致时双方的通信能够顺利进行。It should be noted that in this embodiment of the present invention, loose matching means that both parties in the communication ignore the unidentifiable fields in the data message sent by the other party, that is, the server responds to the NETCONF request message received from the client. The unrecognized fields in the text are ignored, and the client ignores the unrecognized fields in the NETCONF response message received from the server, without causing an error, so that the versions of the client and the server can be inconsistent. The communication between the two parties can be carried out smoothly.

更进一步地,当服务器和客户端为同一版本时,也即服务器和客户端的数据模型相同,此时基于服务器和客户端之间的友元连接进行通信的情况下,服务器和客户端在通信时也将基于模型进行严格的匹配,与未建立友元连接时的通信方式相同,故该友元连接的建立在服务器和客户端的版本相同时不会影响彼此的正常通信。Further, when the server and the client are of the same version, that is, the data model of the server and the client is the same, and in the case of communication based on the friend connection between the server and the client, when the server and the client communicate Strict matching will also be carried out based on the model, which is the same as the communication method when the friend connection is not established, so the establishment of the friend connection will not affect the normal communication of each other when the server and client versions are the same.

图4是本发明实施例提供的一种服务器的另一实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,如图4所示,本发明实施例提供的一种服务器400可以包括:FIG. 4 is a schematic structural diagram of another embodiment of a server provided by an embodiment of the present invention, which is used to implement the network management method disclosed by the embodiment of the present invention. Wherein, as shown in FIG. 4 , a server 400 provided by an embodiment of the present invention may include:

发送单元410、接收单元420和确定单元430。A sending unit 410 , a receiving unit 420 and a determining unit 430 .

其中,发送单元410,用于所述服务器经由客户端与所述服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;The sending unit 410 is used for the server to send a first Hello packet to the client via the SSH connection between the client and the server, where the first Hello packet carries the first friend friendly-element identifier , the first friend friendly-element identifier is used to indicate that the server has a first friend capability, and the first friend capability is used to indicate that the server has received a NETCONF request message from the client The unrecognized fields in the field are ignored;

其中,SSH连接,也即Secure Shell连接,是指客户端与服务器之间的一个物理通信连接,从而基于该SSH连接客户端与服务器之间能够发送Hello报文以建立会话连接。The SSH connection, that is, the Secure Shell connection, refers to a physical communication connection between the client and the server, so that based on the SSH connection, the client and the server can send Hello packets to establish a session connection.

接收单元420,用于所述服务器经由所述SSH连接接收来自客户端的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;A receiving unit 420, configured for the server to receive a second Hello packet from the client via the SSH connection, where the second Hello packet carries a second friend friendly-element identifier, the second friend friendly-element The element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores the unrecognized fields in the NETCONF response message received from the server. deal with;

更进一步地,服务器向客户端发送的数据报文除了NETCONF回应报文外,还可以为NETCONF notification报文,是指由服务器主动向客户端发送的数据报文。Further, in addition to the NETCONF response message, the data message sent by the server to the client may also be a NETCONF notification message, which refers to a data message actively sent by the server to the client.

确定单元430,用于所述服务器根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系。The determining unit 430 is used for the server to determine the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier.

可以看出,本实施例的方案中,服务器400经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器400具有第一友元能力,所述第一友元能力用于表示所述服务器400对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;服务器400再经由客户端与服务器400之间的SSH连接接收客户端发送的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器400的NETCONF回应报文中不能识别的字段进行忽略处理;服务器端400和客户端之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that in the solution of this embodiment, the server 400 sends a first Hello packet to the client via the SSH connection between the client and the server, where the first Hello packet carries the first friendly-element identifier , the first friend friendly-element identifier is used to indicate that the server 400 has the first friend capability, and the first friend capability is used to indicate that the server 400 receives the NETCONF request from the client The unrecognized fields in the message are ignored; the server 400 receives the second Hello message sent by the client via the SSH connection between the client and the server 400, and the second Hello message carries the second friend friendly -element identifier, the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client has The unrecognized fields in the NETCONF response packet of 400 are ignored; the server 400 and the client establish a friend relationship according to the first friend friendly-element identifier and the second friend friendly-element identifier. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

在本实施例中,服务器400是以单元的形式来呈现。这里的“单元”可以指特定应用集成电路(application-specific integrated circuit,ASIC),执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。In this embodiment, the server 400 is presented in the form of a unit. A "unit" herein may refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that may provide the above-described functions .

可以理解的是,本实施例的服务器400的各功能单元的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It can be understood that the functions of each functional unit of the server 400 in this embodiment can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can refer to the relevant descriptions of the above method embodiments, which will not be repeated here.

参见图5,图5是本发明实施例提供的一种服务器的再一实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,图5所示的服务器是由图4所示的服务器进行优化得到的。图5所示的服务器除了包括图4所示的服务器的单元外,还有以下扩展:Referring to FIG. 5, FIG. 5 is a schematic structural diagram of still another embodiment of a server provided by an embodiment of the present invention, which is used to implement the network management method disclosed by the embodiment of the present invention. The server shown in FIG. 5 is obtained by optimizing the server shown in FIG. 4 . The server shown in Figure 5 has the following extensions in addition to the elements of the server shown in Figure 4:

所述接收单元520,还用于所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括edit-config请求、基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值;The receiving unit 520 is further configured for the server to receive a NETCONF request message sent by the client, where the NETCONF request message includes an edit-config request, a data node to be configured based on the client data model, and a to-be-configured data node. The to-be-configured value of the data node;

所述服务器500还包括:The server 500 further includes:

处理单元540,用于所述服务器基于服务器数据模型确定所述待配置数据节点是否能够被识别,当所述待配置数据节点能够被识别时,所述服务器利用所述待配置数值对所述待配置数据节点进行数据配置,当所述待配置数据节点不能够被识别时,所述服务器忽略所述待配置数据节点;The processing unit 540 is used for the server to determine whether the data node to be configured can be identified based on the server data model, and when the data node to be configured can be identified, the server uses the value to be configured for the data node to be configured. configuring data nodes to perform data configuration, and when the data nodes to be configured cannot be identified, the server ignores the data nodes to be configured;

所述发送单元510,还用于所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括数据配置是否成功的指示。The sending unit 510 is further configured for the server to send the NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data configuration is successful.

在本发明实施例中,edit-config请求可以为数据配置请求,也即客户端通过向服务器发送edit-config请求操作来使服务器对相应数据进行配置。In this embodiment of the present invention, the edit-config request may be a data configuration request, that is, the client makes the server configure the corresponding data by sending an edit-config request operation to the server.

其中,待配置数据节点可以为客户端数据模型中的某一个或几个数据节点,也可以为客户端数据模型中的所有数据节点,待配置数据节点的待配置数值可以是基于客户端数据模型发送给服务器,也可以是以其它形式包含在NETCONF请求报文中。The data node to be configured may be one or several data nodes in the client data model, or may be all data nodes in the client data model, and the value to be configured of the data node to be configured may be based on the client data model Sent to the server, or included in the NETCONF request message in other forms.

可选地,在本发明的一些可能的实施方式中,所述接收单元520还用于:Optionally, in some possible implementations of the present invention, the receiving unit 520 is further configured to:

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文包括get或get-config请求、以及基于客户端数据模型的数据过滤条件,所述数据过滤条件包括选择数据节点;The server receives a NETCONF request message sent by the client, where the NETCONF request message includes a get or get-config request and a data filtering condition based on the client data model, where the data filtering condition includes selecting a data node;

所述处理单元540还用于:The processing unit 540 is also used for:

所述服务器基于服务器数据模型确定所述选择数据节点是否能够被识别,当所述选择数据节点能够被识别时,所述服务器从预设服务器数据中获取与所述选择数据节点对应的选择数据节点数值以得到获取结果数据,当所述选择数据节点不能够被识别时,所述服务器忽略所述选择数据节点;The server determines whether the selected data node can be identified based on the server data model, and when the selected data node can be identified, the server obtains the selected data node corresponding to the selected data node from preset server data value to obtain the acquisition result data, when the selection data node cannot be identified, the server ignores the selection data node;

所述发送单元510,还用于所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括所述获取结果数据。The sending unit 510 is further configured for the server to send the NETCONF response message to the client, where the NETCONF response message includes the acquisition result data.

在本发明实施例中,get或get-config请求可以表示客户端请求从服务器获取数据或查询数据,其中,get用于在不对数据类型进行限制时客户端从服务器中获取或查询数据,而get-config用于在客户端从服务器中获取或查询配置数据。In this embodiment of the present invention, the get or get-config request may indicate that the client requests to obtain data from the server or query data, wherein get is used for the client to obtain or query data from the server when the data type is not restricted, and get -config is used on the client to get or query configuration data from the server.

其中,预设服务器数据是指存在于服务器中,当服务器利用get或get-config从服务器中获取数据时的数据获取源,显然地,该预设服务器数据是基于服务器数据模型的。优选地,该预设服务器数据为当前服务器所运行的线程中正在操作的数据。The preset server data refers to the data acquisition source that exists in the server and when the server acquires data from the server by using get or get-config. Obviously, the preset server data is based on the server data model. Preferably, the preset server data is data that is currently being operated in a thread running on the current server.

其中,数据过滤条件是指为get或get-config获取数据时所设立的待获取数据需要满足的条件,也即服务器基于该数据过滤条件从服务器中获取相应数据,该数据过滤条件包括选择数据节点,选择数据节点用于指定服务器获取数据时的数据节点。The data filtering condition refers to the condition that the data to be acquired needs to be satisfied when acquiring data for get or get-config, that is, the server acquires the corresponding data from the server based on the data filtering condition, and the data filtering condition includes selecting a data node , select the data node to specify the data node when the server obtains data.

更进一步地,数据过滤条件还包括内容匹配数据节点以及与该内容匹配数据节点对应的匹配数值,该内容匹配数据节点用于服务器基于服务器数据模型从预设服务器数据中获取包括该内容匹配数据节点并且该内容匹配数据节点数值等于该匹配数值的预设服务器数据。Further, the data filtering condition also includes a content matching data node and a matching value corresponding to the content matching data node, and the content matching data node is used by the server to obtain the content matching data node from the preset server data based on the server data model. And the content matching data node value is equal to the preset server data of the matching value.

可选地,在本发明的一些可能的实施方式中,数据过滤条件可以只包括选择数据节点,也可以只包括内容匹配数据节点,还可以同时包括选择数据节点和内容匹配数据节点。Optionally, in some possible implementations of the present invention, the data filtering conditions may include only selection data nodes, only content matching data nodes, or both selection data nodes and content matching data nodes.

在本发明实施例中,该获取结果数据可以为包括服务器数据模型中所有节点数值的数据,也可以为只包括服务器数据模型中部分节点数值的数据。In this embodiment of the present invention, the acquisition result data may be data including all node values in the server data model, or may be data including only some node values in the server data model.

可选地,在本发明的一些可能的实施方式中,所述接收单元520还用于:Optionally, in some possible implementations of the present invention, the receiving unit 520 is further configured to:

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括copy-config请求、与所述copy-config请求对应的数据源标识、与所述copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,所述第一友元能力还用于表示所述服务器对所述数据源标识所指示的数据源中不能识别的字段进行忽略处理;The server receives the NETCONF request message sent by the client, where the NETCONF request message includes a copy-config request, a data source identifier corresponding to the copy-config request, and a data source identifier corresponding to the copy-config request. The target data set identifier and the data node to be copied based on the data source data model, the first friend capability is also used to indicate that the server ignores the unrecognized fields in the data source indicated by the data source identifier;

所述处理单元540还用于:The processing unit 540 is also used for:

所述服务器基于服务器数据模型确定所述待拷贝数据节点是否能够被识别,当所述待拷贝数据节点能够被识别时,所述服务器拷贝所述数据源标识所指示的数据源中所述待拷贝数据节点的数值至所述目标数据集标识所指示的目标数据集中,当所述待拷贝数据节点不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点的数值;The server determines whether the data node to be copied can be identified based on the server data model, and when the data node to be copied can be identified, the server copies the data to be copied in the data source indicated by the data source identifier. The value of the data node is included in the target data set indicated by the target data set identifier, and when the data node to be copied cannot be identified, the server ignores the value of the data node to be copied in the data source;

所述发送单元510,还用于所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据拷贝是否成功的指示。The sending unit 510 is further configured for the server to send a NETCONF response message to the client, where the NETCONF response message includes an indication of whether data copying is successful.

其中,该数据源标识所指示的数据可以为存在于服务器中的数据,也可以为其它位置的数据,例如若该数据源标识为统一资源定位符(Uniform Resoure Locator,简称URL),则该数据源为该URL所指向的数据,该目标数据集可以为服务器的running数据集。The data indicated by the data source identifier may be data existing in the server or data in other locations. For example, if the data source identifier is a uniform resource locator (Uniform Resoure Locator, URL for short), the data The source is the data pointed to by the URL, and the target data set can be the server's running data set.

其中,待拷贝数据节点可以为数据源数据模型中的一个或几个数据节点,也可以为数据源数据模型中的所有数据节点。The data node to be copied may be one or several data nodes in the data source data model, or may be all data nodes in the data source data model.

可选地,在本发明的一些可能的实施方式中,所述服务器500还包括:Optionally, in some possible implementations of the present invention, the server 500 further includes:

判断单元550,用于若所述服务器检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;A judgment unit 550, configured to judge whether the client data model is consistent with the server data model if the server detects that the client data model or the server data model has changed;

所述处理单元540,还用于若所述客户端数据模型与所述服务器数据模型一致,则所述服务器关闭所述第一友元能力,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。The processing unit 540 is further configured to disable the first friend capability of the server if the client data model is consistent with the server data model, so that the server does not have the ability to respond to the received data from the server. Describes the capability of ignoring unrecognized fields in the client's NETCONF request message.

可选地,在本发明的一些可能的实施方式中,所述发送单元510还用于:Optionally, in some possible implementations of the present invention, the sending unit 510 is further configured to:

若所述客户端数据模型与所述服务器数据模型一致,则所述服务器经由所述SSH连接向所述客户端发送指示所述客户端关闭所述第二友元能力的指示消息,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the server sends an instruction message to the client via the SSH connection, instructing the client to disable the second friend capability, so that all The client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server.

具体地,可通过在客户端和服务器之间重新发送携带有friendly-element-off标识的Hello报文来关闭以及同时指示对端关闭友元能力。Specifically, by resending a Hello packet carrying the friendly-element-off identifier between the client and the server, the function can be disabled and the opposite end can be instructed to disable the friend capability at the same time.

需要说明,为了使客户端与服务器之间的通信更为安全严格,可以在客户端与服务器版本一致时关闭双方的友元连接,而当客户端版本或服务器版本升级时,将导致客户端数据模型或服务器数据模型发生变化,所以可通过在客户端数据模型或服务器数据模型发生变化时,客户端或服务器检测客户端数据模型与服务器数据模型是否一致,并在客户端数据数据模型与服务器数据模型一致时,关闭双方的友元能力,以使客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力,和服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。It should be noted that in order to make the communication between the client and the server more secure and strict, the friend connection of both parties can be closed when the versions of the client and the server are the same, and when the client version or the server version is upgraded, the client data will be The model or server data model changes, so when the client data model or the server data model changes, the client or server can detect whether the client data model is consistent with the server data model, and check whether the client data model and the server data model are consistent. When the models are consistent, the friend capabilities of both parties are turned off, so that the client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server, and the server does not have the ability to The capability of ignoring unrecognized fields in the client's NETCONF request message.

可以理解,在客户端与服务器建立友元连接时,再在客户端与服务器数据模型升级到一致后关闭双方的友元能力,从而使客户端和服务器之间再次基于严格的模型匹配进行通信,保证通信安全,使得网络管理更为灵活。It can be understood that when the client and the server establish a friend connection, the friend capabilities of both parties are closed after the data models of the client and the server are upgraded to the same level, so that the communication between the client and the server is based on strict model matching again. Ensure communication security and make network management more flexible.

可以看出,本实施例的方案中,在服务器与客户端建立友元连接后,从而服务器与客户端之间即可基于该友元连接执行不严格匹配的数据通信,使得客户端和服务器数据模型不一致时通信能顺利进行,提高网络管理效率。It can be seen that in the solution of this embodiment, after the server and the client establish a friend connection, the server and the client can perform data communication that is not strictly matched based on the friend connection, so that the client and server data When the models are inconsistent, the communication can be carried out smoothly and the network management efficiency can be improved.

在本实施例中,服务器500是以单元的形式来呈现。这里的“单元”可以指特定应用集成电路(application-specific integrated circuit,ASIC),执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。In this embodiment, the server 500 is presented in the form of a unit. A "unit" herein may refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that may provide the above-described functions .

可以理解的是,本实施例的服务器500的各功能单元的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It can be understood that the functions of each functional unit of the server 500 in this embodiment can be specifically implemented according to the methods in the foregoing method embodiments, and the specific implementation process can refer to the relevant descriptions of the foregoing method embodiments, which will not be repeated here.

参见图6,图6是本发明实施例提供的一种服务器的另一实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,该服务器600可以包括:至少一个总线601、与总线601相连的至少一个处理器602以及与总线601相连的至少一个存储器603。Referring to FIG. 6, FIG. 6 is a schematic structural diagram of another embodiment of a server provided by an embodiment of the present invention, which is used to implement the network management method disclosed by the embodiment of the present invention. The server 600 may include: at least one bus 601 , at least one processor 602 connected to the bus 601 , and at least one memory 603 connected to the bus 601 .

其中,处理器602通过总线601,调用存储器中存储的代码以用于服务器经由客户端与所述服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;所述服务器经由所述SSH连接接收来自客户端的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;所述服务器根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系。The processor 602 calls the code stored in the memory through the bus 601 for the server to send a first Hello packet to the client via the SSH connection between the client and the server, and the first Hello packet carries the The first friend friendly-element identifier, the first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has a The unrecognized fields in the NETCONF request message of the client are ignored; the server receives the second Hello message from the client via the SSH connection, and the second Hello message carries the second friend friendly- element identifier, the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client responds to the received information from the server. The unrecognized fields in the NETCONF response message are ignored; the server determines the relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier. Friendship.

可选地,在本发明一些可能的实施方式中,所述处理器602在执行根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述处理器602还用于所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括edit-config请求、基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值;Optionally, in some possible implementations of the present invention, the processor 602 is executing the process of determining the relationship between the server and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier. After the friend relationship between clients, the processor 602 is further configured to receive, by the server, a NETCONF request message sent by the client, where the NETCONF request message includes an edit-config request, based on client data The data node to be configured of the model and the value to be configured of the data node to be configured;

所述服务器基于服务器数据模型确定所述待配置数据节点是否能够被识别,当所述待配置数据节点能够被识别时,所述服务器利用所述待配置数值对所述待配置数据节点进行数据配置,当所述待配置数据节点不能够被识别时,所述服务器忽略所述待配置数据节点;The server determines whether the to-be-configured data node can be identified based on the server data model, and when the to-be-configured data node can be identified, the server uses the to-be-configured value to perform data configuration on the to-be-configured data node , when the data node to be configured cannot be identified, the server ignores the data node to be configured;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括数据配置是否成功的指示。The server sends the NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data configuration is successful.

可选地,在本发明一些可能的实施方式中,所述处理器602在执行根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述处理器602还用于所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文包括get或get-config请求、以及基于客户端数据模型的数据过滤条件,所述数据过滤条件包括选择数据节点;Optionally, in some possible implementations of the present invention, the processor 602 is executing the process of determining the relationship between the server and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier. After the friend relationship between clients, the processor 602 is further configured to receive, by the server, a NETCONF request message sent by the client, where the NETCONF request message includes a get or get-config request, and a client-based Data filtering conditions of the terminal data model, the data filtering conditions include selecting data nodes;

所述服务器基于服务器数据模型确定所述选择数据节点是否能够被识别,当所述选择数据节点能够被识别时,所述服务器从预设服务器数据中获取与所述选择数据节点对应的选择数据节点数值以得到获取结果数据,当所述选择数据节点不能够被识别时,所述服务器忽略所述选择数据节点;The server determines whether the selected data node can be identified based on the server data model, and when the selected data node can be identified, the server obtains the selected data node corresponding to the selected data node from preset server data value to obtain the acquisition result data, when the selection data node cannot be identified, the server ignores the selection data node;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括所述获取结果数据。The server sends the NETCONF response message to the client, where the NETCONF response message includes the acquisition result data.

可选地,在本发明一些可能的实施方式中,所述处理器602在执行根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述处理器602还用于所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括copy-config请求、与所述copy-config请求对应的数据源标识、与所述copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,所述第一友元能力还用于表示所述服务器对所述数据源标识所指示的数据源中不能识别的字段进行忽略处理;Optionally, in some possible implementations of the present invention, the processor 602 is executing the process of determining the relationship between the server and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier. After the friend relationship between the clients, the processor 602 is further configured to receive, by the server, a NETCONF request message sent by the client, where the NETCONF request message includes a copy-config request, and the copy - The data source identifier corresponding to the config request, the target dataset identifier corresponding to the copy-config request, and the data node to be copied based on the data source data model, the first friend capability is also used to indicate that the server has The unrecognized fields in the data source indicated by the data source identifier are ignored;

所述服务器基于服务器数据模型确定所述待拷贝数据节点是否能够被识别,当所述待拷贝数据节点能够被识别时,所述服务器拷贝所述数据源中所述待拷贝数据节点的数值至所述目标数据集标识所指示的目标数据集中,当所述待拷贝数据节点不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点的数值;The server determines whether the data node to be copied can be identified based on the server data model, and when the data node to be copied can be identified, the server copies the value of the data node to be copied in the data source to the In the target data set indicated by the target data set identifier, when the data node to be copied cannot be identified, the server ignores the value of the data node to be copied in the data source;

所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据拷贝是否成功的指示。The server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether data copying is successful.

可选地,在本发明一些可能的实施方式中,所述处理器602还用于若所述服务器检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;Optionally, in some possible implementations of the present invention, the processor 602 is further configured to determine the client data model if the server detects that the client data model or the server data model has changed Whether the model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则所述服务器关闭所述第一友元能力,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the data model of the client is consistent with the data model of the server, the server disables the first friend capability, so that the server does not have the ability to fail in the NETCONF request message received from the client. The ability for recognized fields to be ignored.

可选地,在本发明一些可能的实施方式中,所述处理器602还用于若所述客户端数据模型与所述服务器数据模型一致,则所述服务器经由所述SSH连接向所述客户端发送指示所述客户端关闭所述第二友元能力的指示消息,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。Optionally, in some possible embodiments of the present invention, the processor 602 is further configured to, if the client data model is consistent with the server data model, send the server to the client via the SSH connection The client sends an instruction message instructing the client to close the second friend capability, so that the client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server. .

可以看出,本实施例的方案中,服务器600经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器600具有第一友元能力,所述第一友元能力用于表示所述服务器600对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;服务器600再经由客户端与服务器600之间的SSH连接接收客户端发送的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器600的NETCONF回应报文中不能识别的字段进行忽略处理;服务器端600和客户端之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that, in the solution of this embodiment, the server 600 sends a first Hello packet to the client via the SSH connection between the client and the server, where the first Hello packet carries the first friendly-element identifier , the first friend friendly-element identifier is used to indicate that the server 600 has a first friend capability, and the first friend capability is used to indicate that the server 600 receives a NETCONF request from the client The unrecognized fields in the message are ignored; the server 600 receives the second Hello message sent by the client via the SSH connection between the client and the server 600, and the second Hello message carries the second friend friendly -element identifier, the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client has The unrecognized fields in the NETCONF response message of 600 are ignored; the server 600 and the client establish a friend relationship according to the first friend friendly-element identifier and the second friend friendly-element identifier. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

本发明实施例还提供一种客户端,该客户端包括:The embodiment of the present invention also provides a client, the client includes:

发送单元,客户端向服务器发送NETCONF请求报文;The sending unit, the client sends a NETCONF request message to the server;

接收单元,所述客户端接收所述服务器发送的NETCONF回应报文,所述NETCONF回应报文包括根据所述NETCONF请求报文进行处理的处理结果;a receiving unit, where the client receives a NETCONF response message sent by the server, where the NETCONF response message includes a processing result processed according to the NETCONF request message;

处理单元,所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理。A processing unit, wherein the client ignores the unrecognized content in the NETCONF response message sent by the server.

图7是本发明实施例提供的一种客户端的另一实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,如图7所示,本发明实施例提供的一种客户端700可以包括:FIG. 7 is a schematic structural diagram of another embodiment of a client according to an embodiment of the present invention, which is used to implement the network management method disclosed in the embodiment of the present invention. Wherein, as shown in FIG. 7 , a client 700 provided by an embodiment of the present invention may include:

接收单元710、发送单元720和确定单元730。A receiving unit 710 , a sending unit 720 and a determining unit 730 .

其中,接收单元710,用于所述客户端经由所述客户端与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;The receiving unit 710 is used for the client to receive the first Hello packet sent by the server via the SSH connection between the client and the server, where the first Hello packet carries the first friend friendly -element identifier, the first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has received the NETCONF from the client The unrecognized fields in the request message are ignored;

发送单元720,用于所述客户端经由所述SSH连接向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;A sending unit 720, configured for the client to send a second Hello packet to the server via the SSH connection, where the second Hello packet carries a second friend friendly-element identifier, the second friend friendly-element The element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores the unrecognized fields in the NETCONF response message received from the server. deal with;

确定单元730,用于所述客户端根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系。The determining unit 730 is used for the client to determine the friend relationship between the client and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier.

可以理解,通过上述方式确定客户端与服务器之间的友元关系后,也即表示客户端与服务器可以基于友元能力进行通信,从而客户端与服务器在通信的过程中可以执行不严格匹配的处理方式也不会报错。It can be understood that after the friend relationship between the client and the server is determined in the above manner, it means that the client and the server can communicate based on the friend capability, so that the client and the server can perform a non-strict match during the communication process. The processing method will not report an error.

需要说明,在本发明实施例中,不严格匹配是指通信双方对对方所发送的数据报文中不能够识别的字段进行忽略处理,也即服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理,客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理,而不会导致报错,从而可以在客户端与服务器端的版本不一致时双方的通信能够顺利进行。It should be noted that in this embodiment of the present invention, loose matching means that both parties in the communication ignore the unidentifiable fields in the data message sent by the other party, that is, the server responds to the NETCONF request message received from the client. The unrecognized fields in the text are ignored, and the client ignores the unrecognized fields in the NETCONF response message received from the server, without causing an error, so that the versions of the client and the server can be inconsistent. The communication between the two parties can be carried out smoothly.

更进一步地,当服务器和客户端为同一版本时,也即服务器和客户端的数据模型相同,此时基于服务器和客户端之间的友元连接进行通信的情况下,服务器和客户端在通信时也将基于模型进行严格的匹配,与未建立友元连接时的通信方式相同,故该友元连接的建立在服务器和客户端的版本相同时不会影响彼此的正常通信。Further, when the server and the client are of the same version, that is, the data model of the server and the client is the same, and in the case of communication based on the friend connection between the server and the client, when the server and the client communicate Strict matching will also be carried out based on the model, which is the same as the communication method when the friend connection is not established, so the establishment of the friend connection will not affect the normal communication of each other when the server and client versions are the same.

可以看出,本实施例的方案中,客户端700经由所述客户端700与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端客户端700的NETCONF请求报文中不能识别的字段进行忽略处理;客户端客户端700再经由所述SSH连接向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端客户端700具有第二友元能力,所述第二友元能力用于表示所述客户端客户端700对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;服务器端和客户端客户端700之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that, in the solution of this embodiment, the client 700 receives the first Hello packet sent by the server via the SSH connection between the client 700 and the server, and the first Hello packet carries the first Hello packet. friend friendly-element identifier, the first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has The unrecognized fields in the NETCONF request message of the client client 700 are ignored; the client client 700 sends a second Hello message to the server via the SSH connection, and the second Hello message carries the second Hello message. friend friendly-element identifier, the second friend friendly-element identifier is used to indicate that the client client 700 has a second friend capability, and the second friend capability is used to indicate that the client client 700 ignores the unrecognized fields in the received NETCONF response message from the server; between the server and the client client 700, according to the first friend friendly-element identifier and the second friend friendly-element Identifies the establishment of a friend relationship. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

在本实施例中,客户端700是以单元的形式来呈现。这里的“单元”可以指特定应用集成电路(application-specific integrated circuit,ASIC),执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。In this embodiment, the client 700 is presented in the form of a unit. A "unit" herein may refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that may provide the above-described functions .

可以理解的是,本实施例的客户端700的各功能单元的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It can be understood that the functions of each functional unit of the client 700 in this embodiment can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can refer to the relevant descriptions of the above method embodiments, which will not be repeated here.

参见图8,图8是本发明实施例提供的一种客户端的第二实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,图8所示的客户端是由图7所示的客户端进行优化得到的。图8所示的客户端除了包括图7所示的客户端的单元外,还有以下扩展:Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a second embodiment of a client according to an embodiment of the present invention, which is used to implement the network management method disclosed in the embodiment of the present invention. The client shown in FIG. 8 is obtained by optimizing the client shown in FIG. 7 . In addition to the elements of the client shown in Figure 7, the client shown in Figure 8 has the following extensions:

所述接收单元810,还用于所述客户端接收所述服务器返回的NETCONF回应报文,所述NETCONF回应报文包括所述服务器根据get或get-config请求得到的获取结果数据,其中,所述获取结果数据的数据模型为所述服务器数据模型;The receiving unit 810 is further configured for the client to receive a NETCONF response message returned by the server, where the NETCONF response message includes acquisition result data obtained by the server according to the get or get-config request, wherein the The data model of the obtained result data is the server data model;

所述客户端800还包括:The client 800 further includes:

处理单元840,用于所述客户端基于所述客户端数据模型确定所述获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值,并忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The processing unit 840 is configured for the client to determine, based on the client data model, identifiable data nodes and unidentifiable data nodes in the acquisition result data, and the client saves the data in the acquisition result data. The numerical value of the data node that can be identified, and the numerical value of the data node that cannot be identified in the acquisition result data is ignored.

可选地,在本发明的一些可能的实施方式中,所述客户端800还包括:Optionally, in some possible implementations of the present invention, the client 800 further includes:

判断单元850,用于若所述客户端检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;A judgment unit 850, configured to judge whether the client data model is consistent with the server data model if the client detects that the client data model or the server data model has changed;

所述处理单元840,还用于若所述客户端数据模型与所述服务器数据模型一致,则所述客户端关闭所述第二友元能力,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。The processing unit 840 is further configured to disable the second friend capability of the client if the data model of the client is consistent with the data model of the server, so that the client does not have the ability to respond to the received data. The ability to ignore unrecognized fields in the NETCONF response message from the server.

可选地,在本发明的一些可能的实施方式中,所述发送单元820还用于:Optionally, in some possible implementations of the present invention, the sending unit 820 is further configured to:

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端经由所述SSH连接向所述服务器发送指示所述服务器关闭所述第一友元能力的指示消息,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client sends an instruction message to the server via the SSH connection to instruct the server to disable the first friend capability, so that the The server does not have the ability to ignore the unrecognized fields in the received NETCONF request message from the client.

具体地,可通过在客户端和服务器之间重新发送携带有friendly-element-off标识的Hello报文来关闭以及指示对端关闭友元能力。Specifically, by resending a Hello packet carrying the friendly-element-off identifier between the client and the server, it is possible to disable and instruct the opposite end to disable the friend capability.

需要说明,为了使客户端与服务器之间的通信更为安全严格,可以在客户端与服务器版本一致时关闭双方的友元连接,而当客户端版本或服务器版本升级时,将导致客户端数据模型或服务器数据模型发生变化,所以可通过在客户端数据模型或服务器数据模型发生变化时,客户端或服务器检测客户端数据模型与服务器数据模型是否一致,并在客户端数据数据模型与服务器数据模型一致时,关闭双方的友元能力,以使客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力,和服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。It should be noted that in order to make the communication between the client and the server more secure and strict, the friend connection of both parties can be closed when the versions of the client and the server are the same, and when the client version or the server version is upgraded, the client data will be The model or server data model changes, so when the client data model or the server data model changes, the client or server can detect whether the client data model is consistent with the server data model, and check whether the client data model and the server data model are consistent. When the models are consistent, the friend capabilities of both parties are turned off, so that the client does not have the ability to ignore the unrecognized fields in the NETCONF response message received from the server, and the server does not have the ability to The capability of ignoring unrecognized fields in the client's NETCONF request message.

可以理解,在客户端与服务器建立友元连接时,再在客户端与服务器数据模型升级到一致后关闭双方的友元能力,从而使客户端和服务器之间再次基于严格的模型匹配进行通信,保证通信安全,使得网络管理更为灵活。It can be understood that when the client and the server establish a friend connection, the friend capabilities of both parties are closed after the data models of the client and the server are upgraded to the same level, so that the communication between the client and the server is based on strict model matching again. Ensure communication security and make network management more flexible.

可以看出,本实施例的方案中,在服务器与客户端建立友元连接后,从而服务器与客户端之间即可基于该友元连接执行不严格匹配的数据通信,使得客户端和服务器数据模型不一致时通信能顺利进行,提高网络管理效率。It can be seen that in the solution of this embodiment, after the server and the client establish a friend connection, the server and the client can perform data communication that is not strictly matched based on the friend connection, so that the client and server data When the models are inconsistent, the communication can be carried out smoothly and the network management efficiency can be improved.

在本实施例中,客户端800是以单元的形式来呈现。这里的“单元”可以指特定应用集成电路(application-specific integrated circuit,ASIC),执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。In this embodiment, the client 800 is presented in the form of a unit. A "unit" herein may refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that may provide the above-described functions .

可以理解的是,本实施例的客户端800的各功能单元的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It can be understood that the functions of the functional units of the client 800 in this embodiment may be specifically implemented according to the methods in the foregoing method embodiments, and the specific implementation process may refer to the relevant descriptions of the foregoing method embodiments, which will not be repeated here.

参见图9,图9是本发明实施例提供的一种客户端的第三实施例的结构示意图,用于实现本发明实施例公开的网络管理方法。其中,该客户端900可以包括:至少一个总线901、与总线901相连的至少一个处理器902以及与总线901相连的至少一个存储器903。Referring to FIG. 9, FIG. 9 is a schematic structural diagram of a third embodiment of a client according to an embodiment of the present invention, which is used to implement the network management method disclosed in the embodiment of the present invention. The client 900 may include: at least one bus 901 , at least one processor 902 connected to the bus 901 , and at least one memory 903 connected to the bus 901 .

其中,处理器902通过总线901,调用存储器中存储的代码以用于客户端经由所述客户端与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;所述客户端经由所述SSH连接向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;所述客户端根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系。The processor 902 calls the code stored in the memory through the bus 901 for the client to receive the first Hello message sent by the server via the SSH connection between the client and the server, and the first Hello message The document carries the first friend friendly-element identifier, which is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has a The unrecognized fields in the NETCONF request message received from the client are ignored; the client sends a second Hello message to the server via the SSH connection, and the second Hello message carries the second friend Element friendly-element identifier, the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client The unrecognized fields in the NETCONF response message of the server are ignored; the client determines the relationship between the client and the Friendship between servers.

可选地,在本发明一些可能的实施方式中,所述处理器902在执行根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系后,所述处理器902还用于:Optionally, in some possible implementations of the present invention, the processor 902 is executing the process of determining the relationship between the client and the user according to the first friend friendly-element identifier and the second friend friendly-element identifier. After the friend relationship between the servers is established, the processor 902 is further configured to:

所述客户端接收所述服务器返回的NETCONF回应报文,所述NETCONF回应报文包括所述服务器根据get或get-config请求得到的获取结果数据,其中,所述获取结果数据的数据模型为所述服务器数据模型;The client receives the NETCONF response message returned by the server, and the NETCONF response message includes the acquisition result data obtained by the server according to the get or get-config request, wherein the data model of the acquisition result data is the Describe the server data model;

所述客户端基于所述客户端数据模型确定所述获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值,并忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The client determines identifiable data nodes and unidentifiable data nodes in the acquisition result data based on the client data model, and the client stores the identifiable data nodes in the acquisition result data. The value of the data node, and the value of the data node that cannot be identified in the acquisition result data is ignored.

可选地,在本发明一些可能的实施方式中,所述处理器902还用于:Optionally, in some possible implementations of the present invention, the processor 902 is further configured to:

若所述客户端检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;If the client detects that the client data model or the server data model has changed, then determine whether the client data model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端关闭所述第二友元能力,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client disables the second friend capability, so that the client does not have the NETCONF response message received from the server The ability to ignore unrecognized fields in .

可选地,在本发明一些可能的实施方式中,所述处理器902还用于:Optionally, in some possible implementations of the present invention, the processor 902 is further configured to:

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端经由所述SSH连接向所述服务器发送指示所述服务器关闭所述第一友元能力的指示消息,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client sends an instruction message to the server via the SSH connection to instruct the server to disable the first friend capability, so that the The server does not have the ability to ignore the unrecognized fields in the received NETCONF request message from the client.

可以看出,本实施例的方案中,客户端900经由所述客户端900与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端900的NETCONF请求报文中不能识别的字段进行忽略处理;客户端900再经由所述SSH连接向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端900具有第二友元能力,所述第二友元能力用于表示所述客户端900对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;服务器端和客户端900之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that, in the solution of this embodiment, the client 900 receives the first Hello packet sent by the server through the SSH connection between the client 900 and the server, and the first Hello packet carries the first Hello packet. friend friendly-element identifier, the first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server has The unrecognized fields in the NETCONF request message of the client 900 are ignored; the client 900 sends a second Hello message to the server via the SSH connection, and the second Hello message carries the second friend friendly- element identifier, the second friend friendly-element identifier is used to indicate that the client 900 has a second friend capability, and the second friend capability is used to indicate that the client 900 responds to the received data from the Unrecognized fields in the server's NETCONF response message are ignored; a friend relationship is established between the server and the client 900 according to the first friend friendly-element identifier and the second friend friendly-element identifier. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

本发明实施例还提供一种网络管理系统,包括服务器和客户端,可参见图1-a所示的网络管理系统结构示意图。An embodiment of the present invention further provides a network management system, including a server and a client, and reference may be made to the schematic structural diagram of the network management system shown in FIG. 1-a.

其中,服务器110用于经由客户端与所述服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;The server 110 is configured to send a first Hello packet to the client via the SSH connection between the client and the server, where the first Hello packet carries a first friendly-element identifier, the first Hello packet The friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server does not recognize the fields in the NETCONF request message received from the client. ignore processing;

服务器110还用于经由所述SSH连接接收来自客户端的第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;The server 110 is further configured to receive a second Hello packet from the client via the SSH connection, where the second Hello packet carries a second friend friendly-element identifier, and the second friend friendly-element identifier is used for Indicates that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores unrecognized fields in the NETCONF response message received from the server;

服务器110还用于根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系。The server 110 is further configured to determine the friend relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier.

可选地,在本发明的一些可能的实施方式中,在所述服务器110根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述服务器110还用于:Optionally, in some possible implementations of the present invention, the server 110 determines the relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier After the friend relationship between the terminals is established, the server 110 is also used for:

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括edit-config请求、基于客户端数据模型的待配置数据节点以及待配置数据节点的待配置数值;The server receives a NETCONF request message sent by the client, where the NETCONF request message includes an edit-config request, a data node to be configured based on the client data model, and a to-be-configured value of the data node to be configured;

所述服务器基于服务器数据模型确定所述待配置数据节点是否能够被识别,当所述待配置数据节点能够被识别时,所述服务器利用所述待配置数值对所述待配置数据节点进行数据配置,当所述待配置数据节点不能够被识别时,所述服务器忽略所述待配置数据节点;The server determines whether the to-be-configured data node can be identified based on the server data model, and when the to-be-configured data node can be identified, the server uses the to-be-configured value to perform data configuration on the to-be-configured data node , when the data node to be configured cannot be identified, the server ignores the data node to be configured;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括数据配置是否成功的指示。The server sends the NETCONF response message to the client, where the NETCONF response message includes an indication of whether the data configuration is successful.

可选地,在本发明的一些可能的实施方式中,在所述服务器110根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述服务器110还用于:Optionally, in some possible implementations of the present invention, the server 110 determines the relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier After the friend relationship between the terminals is established, the server 110 is also used for:

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文包括get或get-config请求、以及基于客户端数据模型的数据过滤条件,所述数据过滤条件包括选择数据节点;The server receives a NETCONF request message sent by the client, where the NETCONF request message includes a get or get-config request and a data filtering condition based on the client data model, where the data filtering condition includes selecting a data node;

所述服务器基于服务器数据模型确定所述选择数据节点是否能够被识别,当所述选择数据节点能够被识别时,所述服务器从预设服务器数据中获取与所述选择数据节点对应的选择数据节点数值以得到获取结果数据,当所述选择数据节点不能够被识别时,所述服务器忽略所述选择数据节点;The server determines whether the selected data node can be identified based on the server data model, and when the selected data node can be identified, the server obtains the selected data node corresponding to the selected data node from preset server data value to obtain the acquisition result data, when the selection data node cannot be identified, the server ignores the selection data node;

所述服务器向所述客户端发送所述NETCONF回应报文,所述NETCONF回应报文包括所述获取结果数据。The server sends the NETCONF response message to the client, where the NETCONF response message includes the acquisition result data.

可选地,在本发明的一些可能的实施方式中,在所述服务器110根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述服务器与所述客户端之间的友元关系后,所述服务器110还用于:Optionally, in some possible implementations of the present invention, the server 110 determines the relationship between the server and the client according to the first friend friendly-element identifier and the second friend friendly-element identifier After the friend relationship between the terminals is established, the server 110 is also used for:

所述服务器接收所述客户端发送的NETCONF请求报文,所述NETCONF请求报文中包括copy-config请求、与所述copy-config请求对应的数据源标识、与所述copy-config请求对应的目标数据集标识以及基于数据源数据模型的待拷贝数据节点,所述第一友元能力还用于表示所述服务器对所述数据源标识所指示的数据源中不能识别的字段进行忽略处理;The server receives the NETCONF request message sent by the client, where the NETCONF request message includes a copy-config request, a data source identifier corresponding to the copy-config request, and a data source identifier corresponding to the copy-config request. The target data set identifier and the data node to be copied based on the data source data model, the first friend capability is also used to indicate that the server ignores the unrecognized fields in the data source indicated by the data source identifier;

所述服务器基于服务器数据模型确定所述待拷贝数据节点是否能够被识别,当所述待拷贝数据节点能够被识别时,所述服务器拷贝所述数据源中所述待拷贝数据节点的数值至所述目标数据集标识所指示的目标数据集中,当所述待拷贝数据节点不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点的数值;The server determines whether the data node to be copied can be identified based on the server data model, and when the data node to be copied can be identified, the server copies the value of the data node to be copied in the data source to the In the target data set indicated by the target data set identifier, when the data node to be copied cannot be identified, the server ignores the value of the data node to be copied in the data source;

所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括数据拷贝是否成功的指示。The server sends a NETCONF response message to the client, where the NETCONF response message includes an indication of whether data copying is successful.

可选地,在本发明的一些可能的实施方式中,所述服务器110还用于:Optionally, in some possible implementations of the present invention, the server 110 is further configured to:

若所述服务器检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;If the server detects that the client data model or the server data model has changed, it determines whether the client data model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则关闭所述第一友元能力,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, disable the first friend capability, so that the server does not have fields that cannot be recognized in the NETCONF request message received from the client The ability to do ignore processing.

可选地,在本发明的一些可能的实施方式中,所述服务器110还用于:Optionally, in some possible implementations of the present invention, the server 110 is further configured to:

若所述客户端数据模型与所述服务器数据模型一致,则指示所述客户端关闭所述第二友元能力,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, instructing the client to disable the second friend capability, so that the client does not have the ability to respond to the NETCONF response received from the server. The ability to ignore fields that are not recognized in the text.

客户端120用于经由所述客户端与服务器之间的SSH连接接收所述服务器发送的第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;The client 120 is configured to receive the first Hello packet sent by the server via the SSH connection between the client and the server, where the first Hello packet carries a first friendly-element identifier, and the first Hello packet carries a first friendly-element identifier. A friend friendly-element identifier is used to indicate that the server has a first friend capability, and the first friend capability is used to indicate that the server cannot recognize the NETCONF request message received from the client. fields are ignored;

客户端120还用于经由所述SSH连接向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;The client 120 is further configured to send a second Hello packet to the server via the SSH connection, where the second Hello packet carries a second friend friendly-element identifier, and the second friend friendly-element identifier is used for Indicates that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores unrecognized fields in the NETCONF response message received from the server;

客户端120还用于根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系。The client 120 is further configured to determine the friend relationship between the client and the server according to the first friend friendly-element identifier and the second friend friendly-element identifier.

可选地,在本发明的一些可能的实施方式中,在所述客户端110根据所述第一友元friendly-element标识和所述第二友元friendly-element标识确定所述客户端与所述服务器之间的友元关系后,所述客户端120还用于:Optionally, in some possible implementations of the present invention, the client 110 determines the relationship between the client and the user according to the first friend friendly-element identifier and the second friend friendly-element identifier. After the friend relationship between the servers is established, the client 120 is also used to:

所述客户端接收所述服务器返回的NETCONF回应报文,所述NETCONF回应报文包括所述服务器根据get或get-config请求得到的获取结果数据,其中,所述获取结果数据的数据模型为所述服务器数据模型;The client receives the NETCONF response message returned by the server, and the NETCONF response message includes the acquisition result data obtained by the server according to the get or get-config request, wherein the data model of the acquisition result data is the Describe the server data model;

所述客户端基于所述客户端数据模型确定所述获取结果数据中能够被识别的数据节点以及不能够被识别的数据节点,所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值,并忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The client determines identifiable data nodes and unidentifiable data nodes in the acquisition result data based on the client data model, and the client stores the identifiable data nodes in the acquisition result data. The value of the data node, and the value of the data node that cannot be identified in the acquisition result data is ignored.

可选地,在本发明的一些可能的实施方式中,所述客户端120还用于:Optionally, in some possible implementations of the present invention, the client 120 is further configured to:

若所述客户端检测到所述客户端数据模型或所述服务器数据模型发生改变,则判断所述客户端数据模型与所述服务器数据模型是否一致;If the client detects that the client data model or the server data model has changed, then determine whether the client data model is consistent with the server data model;

若所述客户端数据模型与所述服务器数据模型一致,则所述客户端关闭所述第二友元能力,以使所述客户端不具备对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the client disables the second friend capability, so that the client does not have the NETCONF response message received from the server The ability to ignore unrecognized fields in .

可选地,在本发明的一些可能的实施方式中,所述客户端120还用于:Optionally, in some possible implementations of the present invention, the client 120 is further configured to:

若所述客户端数据模型与所述服务器数据模型一致,则指示所述服务器关闭所述第一友元能力,以使所述服务器不具备对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理的能力。If the client data model is consistent with the server data model, the server is instructed to disable the first friend capability, so that the server does not have the ability to register in the NETCONF request message received from the client The ability to ignore unrecognized fields.

可以看出,本实施例的方案中,服务器经由客户端与服务器之间的SSH连接向客户端发送第一Hello报文,所述第一Hello报文携带有第一友元friendly-element标识,所述第一友元friendly-element标识用于指示所述服务器具有第一友元能力,所述第一友元能力用于表示所述服务器对接收到的来自所述客户端的NETCONF请求报文中不能识别的字段进行忽略处理;客户端在同时也向服务器发送第二Hello报文,所述第二Hello报文携带有第二友元friendly-element标识,所述第二友元friendly-element标识用于指示所述客户端具有第二友元能力,所述第二友元能力用于表示所述客户端对接收到的来自所述服务器的NETCONF回应报文中不能识别的字段进行忽略处理;从而在服务器接收到客户端发送的第二Hello报文,以及客户端接收到服务器端发送的第一Hello报文后,服务器端和客户端之间根据第一友元friendly-element标识和第二友元friendly-element标识建立友元关系。通过在服务器和客户端之间的Hello报文中携带友元friendly-element标识来建立服务器和客户端之间的友元关系,使得服务器与客户端之间能基于不严格匹配的原则进行通信,从而在服务器和客户端的版本不一致时也能顺利进行通信,提高网络管理效率。It can be seen that in the solution of this embodiment, the server sends a first Hello packet to the client through the SSH connection between the client and the server, and the first Hello packet carries the first friend friendly-element identifier, The first friend friendly-element identifier is used to indicate that the server has the first friend capability, and the first friend capability is used to indicate that the server is in the received NETCONF request message from the client. Unrecognized fields are ignored; the client also sends a second Hello packet to the server at the same time, and the second Hello packet carries the second friend friendly-element identifier, and the second friend friendly-element identifier is used to indicate that the client has a second friend capability, and the second friend capability is used to indicate that the client ignores the unrecognized field in the NETCONF response message received from the server; Therefore, after the server receives the second Hello packet sent by the client, and the client receives the first Hello packet sent by the server, the relationship between the server and the client is based on the first friend friendly-element identifier and the second Hello packet. The friendly-element logo establishes a friendly-element relationship. The friendly element relationship between the server and the client is established by carrying the friendly-element identifier in the Hello message between the server and the client, so that the server and the client can communicate based on the principle of non-strict matching. Therefore, communication can be performed smoothly even when the versions of the server and the client are inconsistent, and the network management efficiency is improved.

本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的任何网络管理方法的部分或全部步骤。Embodiments of the present invention further provide a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program includes part or all of the steps of any network management method described in the above method embodiments.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和单元并不一定是本发明所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. As in accordance with the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and units involved are not necessarily required by the present invention.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明的各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .

以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (16)

1.一种网络管理方法,其特征在于,所述方法包括:1. A network management method, characterized in that the method comprises: 服务器接收客户端发送的网络配置协议NETCONF请求报文;The server receives the network configuration protocol NETCONF request message sent by the client; 所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理;The server ignores the unidentifiable content in the NETCONF request message sent by the client; 所述服务器向所述客户端发送NETCONF回应报文,所述NETCONF回应报文包括根据所述NETCONF请求报文进行处理的处理结果。The server sends a NETCONF response message to the client, where the NETCONF response message includes a processing result of processing according to the NETCONF request message. 2.根据权利要求1所述的方法,其特征在于,在所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理之前,所述方法包括:2. The method according to claim 1, wherein, before the server ignores the unrecognized content in the NETCONF request message sent by the client, the method comprises: 所述服务器向所述客户端发送第一Hello报文,所述第一Hello报文用于表示所述服务器对所述NETCONF请求报文中不能识别的内容进行忽略处理。The server sends a first Hello packet to the client, where the first Hello packet is used to indicate that the server ignores the unrecognized content in the NETCONF request packet. 3.根据权利要求1或2所述的方法,其特征在于,所述NETCONF请求报文中包括edit-config请求和基于客户端数据模型的待配置数据节点,所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理,包括:3. The method according to claim 1 or 2, wherein the NETCONF request message includes an edit-config request and a data node to be configured based on a client data model, and the server sends to the client The unrecognized content in the NETCONF request message is ignored, including: 所述服务器根据所述待配置数据节点不能够被识别,忽略所述待配置数据节点。The server ignores the data node to be configured according to the fact that the data node to be configured cannot be identified. 4.根据权利要求1或2所述的方法,其特征在于,所述NETCONF请求报文中包括get或get-config请求,所述NETCONF请求报文中还包括基于客户端数据模型的选择数据节点,所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理,包括:4. The method according to claim 1 or 2, wherein the NETCONF request message includes a get or get-config request, and the NETCONF request message also includes a selection data node based on the client data model , the server ignores the unrecognized content in the NETCONF request message sent by the client, including: 当所述选择数据节点中的一个或多个不能够被识别时,所述服务器忽略所述选择数据节点中的一个或多个。When one or more of the selected data nodes cannot be identified, the server ignores one or more of the selected data nodes. 5.根据权利要求1或2所述的方法,其特征在于,所述NETCONF请求报文中包括copy-config请求、数据源标识和基于数据源数据模型的待拷贝数据节点,所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理,包括:5. The method according to claim 1 or 2, wherein the NETCONF request message includes a copy-config request, a data source identifier and a data node to be copied based on a data source data model, and the server has a The unrecognized content in the NETCONF request message sent by the client is ignored, including: 当所述待拷贝数据节点中的一个或多个不能够被识别时,所述服务器忽略所述数据源中所述待拷贝数据节点中的一个或多个的数值。When one or more of the data nodes to be copied cannot be identified, the server ignores the value of one or more of the data nodes to be copied in the data source. 6.根据权利要求1-5任一项所述的方法,其特征在于,在所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理之前,所述方法包括:6. The method according to any one of claims 1-5, characterized in that, before the server ignores the unrecognized content in the NETCONF request message sent by the client, the method include: 所述服务器接收所述客户端发送的第二Hello报文;receiving, by the server, the second Hello message sent by the client; 所述服务器根据所述第二Hello报文确定所述客户端对从服务器接收的来所述NETCONF回应报文中不能识别的内容进行忽略处理。The server determines, according to the second Hello message, that the client ignores the unrecognized content in the NETCONF response message received from the server. 7.根据权利要求1至6任一项所述的方法,其特征在于,在所述服务器向所述客户端发送NETCONF回应报文之后,所述方法还包括:7. The method according to any one of claims 1 to 6, wherein after the server sends a NETCONF response message to the client, the method further comprises: 根据所述客户端数据模型与所述服务器数据模型一致,所述服务器关闭使所述服务器对所述客户端发送的所述NETCONF请求报文中不能识别的内容进行忽略处理的能力。According to the data model of the client being consistent with the data model of the server, the server disables the ability to cause the server to ignore the unrecognized content in the NETCONF request message sent by the client. 8.一种网络管理方法,其特征在于,所述方法包括:8. A network management method, wherein the method comprises: 客户端向服务器发送NETCONF请求报文;The client sends a NETCONF request message to the server; 所述客户端接收所述服务器发送的NETCONF回应报文,所述NETCONF回应报文包括根据所述NETCONF请求报文进行处理的处理结果;The client receives the NETCONF response message sent by the server, and the NETCONF response message includes a processing result processed according to the NETCONF request message; 所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理。The client ignores the unrecognized content in the NETCONF response message sent by the server. 9.根据权利要求8所述的方法,其特征在于,在所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理之前,所述方法包括:9. The method according to claim 8, characterized in that, before the client ignores the unrecognized content in the NETCONF response message sent by the server, the method comprises: 所述客户端向所述服务器发送第二Hello报文,所述第二Hello报文用于表示所述客户端对所述NETCONF回应报文中不能识别的内容进行忽略处理。The client sends a second Hello packet to the server, where the second Hello packet is used to indicate that the client ignores the unrecognized content in the NETCONF response packet. 10.根据权利要求8或9所述的方法,其特征在于,所述NETCONF回应报文包括所述服务器根据get或get-config请求得到的获取结果数据,所述方法还包括:10. The method according to claim 8 or 9, wherein the NETCONF response message includes acquisition result data obtained by the server according to a get or get-config request, and the method further comprises: 所述客户端基于所述客户端数据模型确定所述获取结果数据中不能够被识别的数据节点,忽略所述获取结果数据中所述不能够被识别的数据节点的数值。The client determines, based on the client data model, the data nodes that cannot be identified in the acquisition result data, and ignores the values of the unidentifiable data nodes in the acquisition result data. 11.根据权利要求10所述方法,其特征在于,所述方法包括:11. The method of claim 10, wherein the method comprises: 所述客户端基于所述客户端数据模型确定所述能够被识别的数据节点;The client determines the identifiable data node based on the client data model; 所述客户端保存所述获取结果数据中所述能够被识别的数据节点的数值。The client saves the value of the identifiable data node in the acquisition result data. 12.根据权利要求8-11任一项所述的方法,其特征在于,在所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理之前,所述方法包括:12. The method according to any one of claims 8-11, wherein, before the client ignores the unrecognized content in the NETCONF response message sent by the server, the method include: 所述客户端接收所述服务器发送的第一Hello报文,所述第一Hello报文用于表示所述服务器对所述NETCONF请求报文中不能识别的内容进行忽略处理。The client receives the first Hello packet sent by the server, where the first Hello packet is used to indicate that the server ignores the unrecognized content in the NETCONF request packet. 13.根据权利要求8-12任一项所述的方法,其特征在于,在所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理之后,所述方法包括:13. The method according to any one of claims 8-12, wherein after the client performs ignoring processing on unrecognized content in the NETCONF response message sent by the server, the method include: 所述客户端接收所述服务器发送的指示信息,所述指示信息用于指示所述客户端关闭使所述客户端对所述服务器发送的所述NETCONF回应报文中不能识别的内容进行忽略处理的能力。The client receives the instruction information sent by the server, where the instruction information is used to instruct the client to close and cause the client to ignore the unrecognized content in the NETCONF response message sent by the server. Ability. 14.一种服务器,所述服务器包括处理器和存储器,所述处理器用于调用所述存储器中存储的计算机程序,以使得所述服务器执行权利要求1-7所述的方法。14. A server comprising a processor and a memory, the processor for invoking a computer program stored in the memory to cause the server to perform the method of claims 1-7. 15.一种客户端,所述客户端包括处理器和存储器,所述处理器用于调用所述存储器中存储的计算机程序,以使得所述客户端执行权利要求8-13所述的方法。15. A client, the client comprising a processor and a memory, the processor for invoking a computer program stored in the memory to cause the client to perform the method of claims 8-13. 16.一种网络管理系统,其特征在于,所述系统包括:16. A network management system, wherein the system comprises: 服务器和客户端,server and client, 所述服务器为权利要求14所述的服务器,所述客户端为权利要求15所述的客户端。The server is the server of claim 14 , and the client is the client of claim 15 .
CN202010803704.8A 2016-04-25 2016-04-25 Network management method, server, client and system Active CN112087318B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010803704.8A CN112087318B (en) 2016-04-25 2016-04-25 Network management method, server, client and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010803704.8A CN112087318B (en) 2016-04-25 2016-04-25 Network management method, server, client and system
CN201610259857.4A CN107306202B (en) 2016-04-25 2016-04-25 A network management method, server, client and system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610259857.4A Division CN107306202B (en) 2016-04-25 2016-04-25 A network management method, server, client and system

Publications (2)

Publication Number Publication Date
CN112087318A true CN112087318A (en) 2020-12-15
CN112087318B CN112087318B (en) 2024-02-02

Family

ID=60150964

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010803704.8A Active CN112087318B (en) 2016-04-25 2016-04-25 Network management method, server, client and system
CN201610259857.4A Active CN107306202B (en) 2016-04-25 2016-04-25 A network management method, server, client and system

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201610259857.4A Active CN107306202B (en) 2016-04-25 2016-04-25 A network management method, server, client and system

Country Status (1)

Country Link
CN (2) CN112087318B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217845B (en) * 2019-07-09 2022-01-18 华为技术有限公司 Data transmission method based on Netconf protocol and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020042721A1 (en) * 2000-10-05 2002-04-11 Alcatel Network management client
CN101964726A (en) * 2010-09-21 2011-02-02 电子科技大学 SNMP-based reliable data transmission method
CN101997721A (en) * 2010-11-15 2011-03-30 中兴通讯股份有限公司 System, method and corresponding device for managing telecommunication network
CN105281940A (en) * 2014-07-18 2016-01-27 中兴通讯股份有限公司 Method, device and system of HELLO message interaction on the basis of NETCONF (The Network Configuration Protocol)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100588916B1 (en) * 2004-02-11 2006-06-09 주식회사 대우일렉트로닉스 Home appliance remote control device using simple network management protocol
CN105357244A (en) * 2014-08-22 2016-02-24 中兴通讯股份有限公司 Method for operating network logic entity, client and proxy server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020042721A1 (en) * 2000-10-05 2002-04-11 Alcatel Network management client
CN101964726A (en) * 2010-09-21 2011-02-02 电子科技大学 SNMP-based reliable data transmission method
CN101997721A (en) * 2010-11-15 2011-03-30 中兴通讯股份有限公司 System, method and corresponding device for managing telecommunication network
CN105281940A (en) * 2014-07-18 2016-01-27 中兴通讯股份有限公司 Method, device and system of HELLO message interaction on the basis of NETCONF (The Network Configuration Protocol)

Also Published As

Publication number Publication date
CN112087318B (en) 2024-02-02
CN107306202B (en) 2020-09-04
CN107306202A (en) 2017-10-31

Similar Documents

Publication Publication Date Title
US20220109743A1 (en) Framework for iot protocol identification and management
US12375369B2 (en) Service enabler function
CN111258627B (en) Interface document generation method and device
US10417061B2 (en) Operating method of routing device, routing device, and terminal device
WO2016119631A1 (en) Method for accessing cloud service and access device
US10942785B2 (en) Integration of software applications with infrastructure
US20170280410A1 (en) Method, device and system for implementing information self-registration, and computer storage medium
CN111246406A (en) Short message sending method, system, storage medium and terminal equipment
US20210274020A1 (en) Communication method, client device, and server device
CN110324423A (en) A kind of service registration discovery method, system, equipment and medium
CN112423322B (en) Model information sending method, device, storage medium and electronic device
CN111371897B (en) Reverse connection method, device and storage medium based on networking system
CN104753746B (en) The method and control server of a kind of access device
CN108111496B (en) Method, device and system for exposing http service for dubbo distributed application
CN107306202B (en) A network management method, server, client and system
CN115987773A (en) Method, device and system for equipment management
CN115001974A (en) Cluster system consistency detection method, device, system, equipment and storage medium
EP2421291A1 (en) Terminal for device management and method for initiating management session thereof
EP4412310A1 (en) System and method for processing message, and network apparatus
CN102594611B (en) Trap session chain table updating method for webmaster agent
CN113259468B (en) Network equipment configuration method and device
CN106341252A (en) Resource management method and device and control terminal
CN115733745A (en) Method and device for generating flexible Ethernet service transmission configuration
CN102904743A (en) Electronic device and method for processing multiple device management server addresses
CN110943975A (en) Service registration method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant