File synchronization method and related equipment
By managing description file synchronization between devices and network devices in the Telemetry system, the problem of description file incompatibility is solved, the reliability and efficiency of data decoding are achieved, and the adaptation complexity and resource consumption are reduced.
Patent Information
- Application Number
- CN202310198536.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-02-23
AI Technical Summary
In the Telemetry system, the binary encoding description files between network devices and management devices are incompatible, causing data decoding to fail and increasing adaptation complexity and resource consumption.
Send compatible description files to network devices through the management device to ensure that a unified description file is used during data transmission. The network device generates compatible description files and performs difference negotiation and difference discovery before data transmission to reduce resource consumption and adaptation complexity. Spend.
It improves the probability of the data receiver successfully decoding the data, reduces the adaptation workload of the network administrator, and improves the adaptation efficiency and resource utilization of the description file.
Smart Images

Figure CN118540332A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a file synchronization method and related equipment. Background Art
[0002] Telemetry is a new generation of network monitoring technology that collects data from network devices remotely and at high speed. The sampled data collected by network devices in the Telemetry system is encoded and reported to the network management device.
[0003] The sampled data reported by the network device is defined by the YANG model organization. The sampled data is output through the organization, and the names of each field and its namespace are also fully output. A large amount of content in the sampled data is the repeated field names and their namespaces defined by the model. When the sampled data is encoded using text encoding methods such as extensible markup language (XML) and JS object notation (JSON), the amount of encoded data is relatively large. In order to reduce the size of the encoded sampled data, binary encoding methods such as Google protocol buffers (GPB, or protobuf for short) and concise binary object representation (CBOR) are usually used to encode the sampled data. The binary encoding method describes the data structure through a description file, and uses field numbers instead of field names in the description file to reduce the size of the encoded data. The network device binary encodes the sampled data and transmits it to the network management device.
[0004] After receiving the encoded data, the network management device needs to decode the data. If the binary encoding description files used by both parties are incompatible, the network management device will not be able to decode the data. Summary of the invention
[0005] The present application provides a file synchronization method and related equipment to reduce the complexity of description file adaptation when the description files of the communicating parties are inconsistent, and to increase the probability that the data receiving party can successfully decode the data from the data sending party.
[0006] The first aspect provides a file synchronization method. The method includes: a management device sends a first description file of the management device to a network device; the management device receives a second description file returned by the network device, the second description file being part of the first description file that is compatible with the YANG model of the network device; if the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file. The part of the first description file that is compatible with the YANG model of the network device is, for example, a field name or node that exists in both the first description file and the YANG model. Thus, the second description file obtained by the network device based on the first description file of the management device is not only compatible with its own YANG model, but also compatible with the description file of the management device, without the need to perform complex adaptation on the description files of each network device, and without the need to manually develop adaptation logic, and the adaptation efficiency of the description file is improved under the premise of ensuring the synchronization of the description files of the network device and the management device.
[0007] In one possible implementation, before the management device sends the first description file of the management device to the network device, the following steps are included: the management device receives a third description file from the network device; the management device checks whether the third description file is compatible with the first description file; when the third description file is incompatible with the first description file, the management device executes the step of sending the first description file of the management device to the network device. The incompatibility between the third description file and the first description file includes, for example, that the third description file is a subset of the first description file, or that the same field name exists but the corresponding field encodings in the third description file and the first description file are different. In one scenario, the network device can initiate a description file synchronization process to the management device, and after determining that the first description file and the third description file are incompatible, the management device sends the first description file to the network device, so that the network device can generate the second description file only when the description files are incompatible, thereby reducing the consumption of network device resources.
[0008] In one possible implementation, before the management device receives the second description file returned by the network device, the following steps are included: the management device receives a test result from the network device, the test result indicates that the third description file is incompatible with the first description file; the management device sends a difference negotiation request to the network device, the difference negotiation request instructs the network device to generate the second description file based on the first description file. In another scenario, the management device can initiate a description file synchronization process to the network device, and after determining that the first description file and the third description file are incompatible, the management device sends a difference negotiation request to the network device to instruct the network device to generate the second description file based on the first description file, so that the network device can generate the second description file only when the description files are incompatible, thereby reducing the consumption of network device resources.
[0009] In a possible implementation, before the management device sends the first description file of the management device to the network device, the steps include: the management device sends a difference discovery request to the network device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, the difference discovery request instructs the network device to compare the description file information with the information of the description file of the network device to see if it is consistent; the management device receives the comparison result returned by the network device, the comparison result includes the name of the description file with inconsistent hash values, the name of the description file with inconsistent hash values includes the name of the first description file; the management device executes the step of sending the first description file of the management device to the network device. First, the description files are compared to see if they are consistent through the description file information. Since the data volume of the description file information is relatively small compared to the data volume of the description file, the description file information can reduce the occupancy of bandwidth resources during transmission, and can also reduce the amount of calculation when the network device compares whether the description files are consistent, thereby reducing the consumption of network device resources.
[0010] The second aspect provides a file synchronization method. The method includes: a network device receives a first description file of a management device sent by a management device; the network device obtains a second description file based on the first description file, and the second description file is a portion of the first description file that is compatible with the YANG model of the network device; the network device sends the second description file to the management device, so that when the management device determines that the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
[0011] In a possible implementation, before the network device receives the first description file of the management device sent by the management device, the method includes: the network device sends a third description file of the network device to the management device, so that the management device sends the first description file to the network device when the third description file is incompatible with the first description file.
[0012] In a possible implementation, before the network device obtains the second description file based on the first description file, the steps include: the network device checks whether the first description file is compatible with the third description file and obtains a check result; the network device sends the check result to the management device, so that the management device sends a difference negotiation request to the network device when the check result indicates that the third description file is incompatible with the first description file; the network device receives the negotiation difference request and executes the step of obtaining the second description file based on the first description file.
[0013] In a possible implementation, the network device stores the inspection result, so that when the management device sends a difference discovery request to the network device, the network device returns the stored inspection result to the management device. The network device stores the inspection result, so that it is not necessary to compare the compatibility of the description files every time it connects to the management device, which can reduce the consumption of network device resources.
[0014] In one possible implementation, before a network device receives a first description file of a management device sent by a management device, the process includes: the network device receives a difference discovery request from the management device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, the difference discovery request instructs the network device to compare the description file information with the information of the description file of the network device for consistency; the network device compares the description file information with the information of the description file of the network device for consistency to obtain a comparison result, the comparison result includes the name of the description file with inconsistent hash values, the name of the description file with inconsistent hash values includes the name of the first description file; the network device sends the comparison result to the management device, so that the management device sends the description file with inconsistent hash values to the network device according to the comparison result.
[0015] The third aspect provides a file synchronization method. The method includes: a network device receives a target description file; if the target description file is compatible with the YANG model of the network device, the network device encodes the data reported to the management device based on the target description file. The data reported to the management device is obtained by encoding the data organized by the YANG model based on the second description file.
[0016] A fourth aspect provides a management device. The device includes a transceiver module and a processing module. The transceiver module is used to send a first description file of the management device to the network device. The transceiver module is used to receive a second description file returned by the network device, and the second description file is part of the first description file that is compatible with the YANG model of the network device. The processing module is used to decode the data reported by the network device based on the second description file when the second description file meets the conditions, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
[0017] In a possible implementation, the transceiver module is used to receive the third description file from the network device. The processing module is used to check whether the third description file is compatible with the first description file. The transceiver module is used to send the first description file of the management device to the network device when the third description file is incompatible with the first description file.
[0018] In a possible implementation, the transceiver module is used to receive a test result from the network device, the test result indicating that the third description file is incompatible with the first description file. The transceiver module is used to send a difference negotiation request to the network device, the difference negotiation request instructing the network device to generate a second description file based on the first description file.
[0019] In a possible implementation, a transceiver module is used to send a difference discovery request to a network device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with the information of the description file of the network device. The transceiver module is used to receive a comparison result returned by the network device, the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file. The transceiver module is specifically used to send the first description file to the network device when the name of the description file with inconsistent hash values includes the name of the first description file.
[0020] A fifth aspect provides a network device. The device includes a transceiver module and a processing module. The transceiver module is used to receive a first description file of a management device sent by the management device. The processing module is used to obtain a second description file based on the first description file, and the second description file is a portion of the first description file that is compatible with the YANG model of the network device. The transceiver module is used to send the second description file to the management device, so that when the management device determines that the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
[0021] In a possible implementation, the transceiver module is used to send a third description file of the network device to the management device, so that the management device sends the first description file to the network device when the third description file is incompatible with the first description file.
[0022] In a possible implementation, the processing module is used to check whether the first description file is compatible with the third description file and obtain a check result. The transceiver module is used to send the check result to the management device, so that the management device sends a difference negotiation request to the network device when the check result indicates that the third description file is incompatible with the first description file. The transceiver module is used to receive the negotiation difference request and execute the step of obtaining the second description file according to the first description file.
[0023] In a possible implementation, the network device further includes a storage module. The storage module is used to store the inspection result, so that when the management device sends a difference discovery request to the network device, the network device returns the stored inspection result to the management device.
[0024] In a possible implementation, a transceiver module is used to receive a difference discovery request from a management device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare the description file information with the information of the description file of the network device to see if they are consistent. The processing module is used to compare the description file information with the information of the description file of the network device to see if they are consistent, so as to obtain a comparison result, the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file. The transceiver module is used to send the comparison result to the management device, so that the management device sends the description file with inconsistent hash values to the network device according to the comparison result.
[0025] A sixth aspect provides a network device. The device includes a transceiver module and a processing module. The transceiver module is used to receive a target description file. The processing module is used to encode data reported to a management device based on the target description file when the target description file is compatible with the YANG model of the network device. The data reported to the management device is obtained by encoding the data organized by the YANG model based on the second description file.
[0026] A seventh aspect provides an electronic device. The electronic device includes a processor and a memory, wherein the processor is coupled to the memory, and the processor is configured to execute the file synchronization method in the first aspect or any possible implementation of the first aspect, or the file synchronization method in the second aspect or any possible implementation of the second aspect, or the file synchronization method in the third aspect based on instructions stored in the memory.
[0027] In an eighth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes instructions, and when the electronic device-readable storage medium is run on a computer, the electronic device executes the file synchronization method in the first aspect or any possible implementation of the first aspect, or the file synchronization method in the second aspect or any possible implementation of the second aspect, or the file synchronization method in the third aspect.
[0028] The ninth aspect provides a computer program product, including a program, which, when running on a processor, executes the file synchronization method in the first aspect or any possible implementation of the first aspect, or the file synchronization method in the second aspect or any possible implementation of the second aspect, or the file synchronization method in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the structure of a communication system provided for this application;
[0030] Figure 2 A flowchart of a description file synchronization method provided by this application;
[0031] Figure 3 A flowchart of another description file synchronization method provided by the present application;
[0032] Figure 4 A flowchart of another description file synchronization method provided by the present application;
[0033] Figure 5 A schematic diagram of the structure of a management device provided for this application;
[0034] Figure 6 A schematic diagram of the structure of a network device provided for this application;
[0035] Figure 7 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0036] The present application provides a file synchronization method and related equipment to reduce the complexity of description file adaptation when the description files of the communicating parties are inconsistent, and to increase the probability that the data receiving party can successfully decode the data from the data sending party.
[0037] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0038] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0040] In the present application, the word “multiple” in “plurality”, “multiple items”, etc. indicates that the number is greater than or equal to 2.
[0041] The following are explanations of the relevant terms appearing in this application:
[0042] Telemetry is a network monitoring technology that collects data remotely and at high speed from devices. Network devices periodically and actively send sampled data collected by network devices to management devices through "push mode", providing more real-time, faster, and more accurate network monitoring functions.
[0043] For the Telemetry network device side: Telemetry = raw data + data model + encoding format + transmission protocol. Specifically, Telemetry organizes raw data according to the YANG model, encodes it using binary encoding formats such as GPB or CBOR, and transmits the binary-encoded sampled data to the management device through transmission protocols such as Google Remote Procedure Call Protocol (gRPC) or User Datagram Protocol (UDP), making it more efficient for the management device to obtain sampled data.
[0044] The raw data sampled by Telemetry can come from the forwarding plane, control plane, and management plane of the network device, such as interface traffic statistics, CPU or memory data, and other information of the network device.
[0045] YANG is a data modeling language that uses a unified syntax and is standardized across manufacturers. In addition, it can clearly define business objects, attributes, and data types, making parsing simple. The YANG model defines a hierarchical structure of data and can be used to model configuration data, status data, remote procedure calls, and notifications used by network configuration management protocols. Network configuration management protocols include, for example, the Network Configuration Protocol (NETCONF) or the Representational State Transfer Configuration Protocol RESTCONF.
[0046] The binary encoding description file, hereinafter referred to as the description file, is a file that describes the data structure and can be generated according to the YANG model. The description file uses field numbers instead of field names in the YANG model, that is, the description file includes the mapping relationship between the field names and field numbers of the YANG model, as well as the hierarchical structure of the YANG model. The network device encodes the sampled data to be sent according to the data file to obtain the encoded sampled data. The field names in the encoded sampled data are replaced with field numbers, which can save the amount of data occupied by the field names and reduce the bandwidth occupied by the sampled data during transmission. When decoding, the management device needs to use a description file compatible with the network device to decode the encoded sampled data in order to accurately decode the encoded sampled data. If the description files of the management device and the network device are incompatible, the sampled data from the network device cannot be decoded.
[0047] When transmitting data between network devices and management devices, data transmitted in binary encoding formats such as GPB encoding format or CBOR encoding format has a higher information load capacity than data in other encoding formats (JSON or XML), ensuring the data throughput of Telemetry services while reducing CPU usage and bandwidth.
[0048] GPB is a language-independent, platform-independent, and highly extensible serialized structured data format for communication protocols and data storage. It provides a flexible, efficient, and automatic mechanism for serializing structured data. GPB is binary-encoded, with good performance and high efficiency. The GPB description file has the extension ".proto". In the GPB description file, each node in the YANG model is numbered, and the number is unique on each layer of nodes. For example, the field number of the field name "interfaces" defined in the ifm.proto file is 1 (1 byte), which can save 8 bytes.
[0049] CBOR is a binary data exchange format that provides good compression, strong scalability, and does not require version negotiation. The extension of the CBOR description file is ".sid". The CBOR description file numbers each node in the YANG model, and the number is unique within the file. For example, the field number of the field name " / ifm / interfaces" defined in the ifm.sid file is 3003 (2 bytes), which can save 7 bytes.
[0050] The gRPC protocol is a high-performance, general-purpose RPC open source software framework released by Google based on the HTTP2 protocol. Both parties in communication conduct secondary development based on this framework, so that both parties in communication can focus on the business without paying attention to the underlying communication implemented by the gRPC software framework. Telemetry reports the data encapsulated in the encoded format to the collector through the gRPC protocol for reception and storage.
[0051] For the YANG model files defined by standard organizations such as the Internet Engineering Task Force (IETF) and the OpenConfig Working Group, each network device manufacturer implements them according to the standards, that is, the YANG models of each manufacturer are compatible. However, there is no standard for the corresponding binary-coded description files, and the description files released by each manufacturer are not the same. For example, the same field name has different numbers in the description files of different manufacturers.
[0052] The network devices in the network may come from multiple different manufacturers. The management device receives the sampled data sent by network devices of different manufacturers and models in the network through Telemetry. To reduce the network bandwidth, different manufacturers and different models use GPB or CBOR to encode and transmit sampled data. Since network devices of different manufacturers / models use different description files, network administrators need to adapt the description files of network devices of different manufacturers / models. When there are many types of network devices in the network, network administrators need to develop a large amount of adaptation logic for different network devices. The adaptation process is slow and complex to implement.
[0053] In order to solve the above problems, the present application provides the following embodiments, whereby the network device can quickly and effectively complete the synchronization of description files between network devices, and can effectively reduce the workload of network administrators in adaptation.
[0054] In one possible implementation, the network administrator can uniformly specify description files (target description files) for different network devices, and send the target description files (can be sent through a file transfer protocol or through a management device) to each network device, instructing the network device to replace the description file in use with the target description file. After the network device performs a compatibility and legality check on the target description file, if it determines that the target description file is compatible with its own YANG model, it replaces the description file in use with the target description file. When the network device subsequently reports sampled data to the management device, it uses the target description file to encode the sampled data and transmits it to the management device. The management device also uses the target description file to decode the sampled data reported by the network device.
[0055] The target description file may be a binary code description file generated based on a YANG model. The target description file may also be a file obtained by obtaining a binary code description file from a network device or a network device support website and modifying the file as needed (for example, cutting or adding to the obtained description file).
[0056] By uniformly replacing the description files of different network devices with the target description file, the workload of adapting the description files of different network devices can be reduced and the adaptation efficiency can be improved.
[0057] In another possible implementation, the network device and the management device can negotiate the description file. For description files with differences, the network device generates a new description file based on the description file of the management device, so that the description file between the network device and the management device can be automatically adapted, improving the efficiency of description file adaptation. There is no need for network administrators to adapt description files of network devices of multiple manufacturers and multiple versions, effectively reducing the workload of network administrators in adapting description files.
[0058] like Figure 1 As shown, Figure 1 A schematic diagram of the structure of a communication system provided in this application. The communication system includes a management device and at least one network device. It can be understood that Figure 1 The number of network devices in the figure is for illustration only. The number of network devices in actual scenarios may be more or less, and is not limited here.
[0059] The management device and the network device can be connected by wire or wirelessly. The management device can be a server, a smart phone, a computer or other device. The management device is used to receive and decode the sampled data reported by each network device. The network device can be a router, a switch or a firewall or other device. The network device collects data according to the subscription requirements of the management device to obtain the sampled data, and encodes the sampled data into a binary sequence and pushes it to the management device. The sampled data includes, for example, the status information of the network device, and / or network performance information such as network congestion, packet loss, delay or jitter.
[0060] In this embodiment, the management device is used to send a first description file of the management device to the network device. The network device is used to modify the first description file according to the first description file and its own YANG model to obtain a second description file, and send the second description file to the management device. The management device is also used to check whether the second description file meets the conditions. If it meets the conditions, the second description file is subsequently used to decode the sampled data reported by the network device. The sampled data reported by the network device is also obtained by encoding the second description file; if it does not meet the conditions, the connection with the network device is disconnected.
[0061] Therefore, the second description file obtained by the network device based on the first description file of the management device is not only compatible with its own YANG model, but also compatible with the description file of the management device. There is no need for complex adaptation of the description files of each network device, nor is there any need to manually develop the adaptation logic. Under the premise of ensuring the synchronization of the description files of the network device and the management device, the adaptation efficiency of the description files is improved.
[0062] based on Figure 1 The present application provides the following method embodiments. Figure 2 As shown, Figure 2 A flowchart of a description file synchronization method provided by the present application. The network device in this embodiment is Figure 1 Any device that needs to synchronize description files with the network device. This embodiment includes the following steps:
[0063] S201: The management device establishes a communication connection with the network device.
[0064] The management device and the network device can establish a communication connection through protocols such as Remote Procedure Call Protocol (RPC), gRPC, Hypertext Transfer Protocol (HTTP), and UDP. The communication connection between the management device and the network device can be initiated by the management device to the network device, or by the network device to the management device, and there is no restriction here.
[0065] S202: The management device sends a first description file of the management device to the network device.
[0066] After the communication connection is established, the management device sends the first description file of the management device to the network device through the communication connection, so that the network device can generate the second description file according to the first description file.
[0067] S203: The network device obtains a second description file according to the first description file, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device.
[0068] After receiving the first description file sent by the management device, the network device generates a second description file according to the first description file and its own YANG model.
[0069] Specifically, the network device may cut out the part in the first description file that is incompatible with its own YANG model, and use the part in the first description file that is compatible with its own YANG model as the second description file. The part in the first description file that is incompatible with the YANG model of the network device includes, for example, field names or nodes that exist in the first description file but do not exist in the YANG model. The part in the first description file that is compatible with the YANG model of the network device includes, for example, field names or nodes that exist in both the first description file and the YANG model.
[0070] The second description file is derived from the first description file, so that the second description file is compatible with the description file of the management device and the YANG model of the network device. The network device can accurately encode the sampled data based on the second description file, and the management device can also accurately decode the encoded sampled data based on the second description file.
[0071] Optionally, before obtaining the second description file based on the first description file, the network device may also check whether the first description file is compatible with its own third description file. If not, the second description file is obtained based on the first description file. If they are compatible, the management device may be notified that the first description file and the third description file are compatible, and there is no need to generate and transmit the second description file to the management device. The compatibility of the first description file and the third description file means that the first description file is completely consistent with the third description file, or the first description file is a subset of the third description file. When the first description file is a subset of the third description file, it means that the fields required by the management device are all present in the third description file, and the management device can decode the required fields in the data encoded based on the third description file. Therefore, in this case, the first description file and the third description file can be considered compatible.
[0072] The network device checks whether the first description file and the third description file are compatible, for example, based on the data organization hierarchical relationship and fields of the first description file and the third description file, to check whether the first description file is a subset of the third description file, or to check whether the first description file and the third description file are completely consistent. Specifically, the hierarchical structure of the first description file and the third description file of the management device each generates two trees, and traverses the two trees to compare and analyze whether the branches and nodes (container nodes, list nodes or leaf nodes) on the tree exist, and when the same branches and nodes exist, the field numbers corresponding to the field names are consistent. If the two trees are completely consistent, it is considered that the first description file and the third description file are consistent, and the two are compatible. If some branches or nodes exist in the tree corresponding to the third description file, but not in the tree corresponding to the first description file, and the branches and nodes in the tree corresponding to the first description file have the same branches and nodes in the third description file, it is considered that the first description file is a subset of the third description file, and the two are compatible. If some branches or nodes exist in the tree corresponding to the first description file, but not in the tree corresponding to the third description file, it is considered that the first description file and the third description file are incompatible. If there is an identical field name and the field numbers mapped in the first description file and the third description file are inconsistent, it is considered that the first description file and the third description file are incompatible.
[0073] Optionally, the first description file and the third description file may be determined to be consistent by calculating the hash values of the first description file and the third description file, and then comparing the hash values of the two to determine whether they are consistent. If the hash values of the two are consistent, it can be considered that the first description file and the third description file are consistent. If the hash values of the two are inconsistent, it can be further determined whether the first description file is a subset of the third description file.
[0074] S204: The network device sends a second description file to the management device.
[0075] Since the second description file is obtained by the network device cutting the first description file, some fields may be cut off, resulting in the possibility of missing necessary fields. Therefore, after the network device obtains the second description file, the management device needs to further check the second description file. Therefore, after obtaining the second description file, the network device sends the second description file to the management device for the management device to check.
[0076] S205: The management device checks whether the second description file meets the conditions.
[0077] After receiving the second description file, the management device checks whether the second description file meets the conditions and obtains the check result. If the second description file meets the conditions, S206 and S207 are executed. If the second description file does not meet the conditions, because the management device cannot obtain the required information from the data reported by the network device based on the second description file, S209 is executed.
[0078] Specifically, the management device checks whether the second description file includes all the fields in the necessary field set. If all the fields in the necessary field set exist in the second description file, the second description file can be considered to meet the conditions. If there are fields in the necessary field set that do not exist in the second description file, the second description file can be considered to be ineligible. The necessary field set includes, for example, general fields and / or business fields. General fields include, for example, sampling paths or timestamps. Business fields include, for example, interface status or interface traffic. For example, the necessary field set includes sampling path and timestamp fields. If the second description file includes the sampling path field and the timestamp field, the second description file is considered to meet the conditions; if the second description file does not include at least one of the sampling path field and the timestamp field, the second description file is considered to be ineligible. Among them, the fields in the necessary field set are necessary fields for subsequent analysis of the sampled data reported by the network device.
[0079] S206: The management device configures the description file used for decoding the sample data pushed by the network device as a second description file.
[0080] Therefore, when the network device subsequently pushes sampled data encoded using the second description file, the management device can successfully decode the sampled data pushed by the network device using the second description file.
[0081] S207: The management device sends the inspection result to the network device.
[0082] The management device sends the inspection result to the network device to notify the configuration of the description file used to encode the sampled data as the second description file, and the description file synchronization is completed between the management device and the network device. Therefore, when the network device subsequently sends the sampled data to the management device, the sampled data organized by the YANG model of the network device is encoded based on the second description file, and then the encoded sampled data is sent to the management device.
[0083] It should be noted that there is no order of precedence for S206 and S207. The two can be executed simultaneously, or S206 can be executed first and then S207, or S207 can be executed first and then S206. There is no limitation here.
[0084] In another possible implementation, after determining that the second description file meets the condition, the management device may not send the inspection result to the network device. For example, after the network device sends the second description file to the management device, the network device waits for a preset time, and the connection between the management device and the network device is not disconnected by the management device, and the management device does not notify the network device to disconnect, then the network device may consider that the second description file meets the requirements of the management device, and S208 may be executed.
[0085] S208: The network device configures the description file used to encode the sampled data as a second description file.
[0086] Therefore, the network device encodes the sampled data based on the second description file, and the management device decodes the encoded sampled data reported by the network device based on the second description file.
[0087] Since the second description file is a description file that is confirmed through negotiation between the management device and the network device and is compatible with both parties, the management device can accurately decode the sampled data reported by the network device based on the second description file and can obtain the information it needs therefrom.
[0088] S209: Disconnect the communication connection between the management device and the network device.
[0089] If the second description file does not meet the conditions, the management device cannot correctly decode the sampled data reported by the network device using the second description file, or cannot obtain the required information therefrom. Therefore, after determining that the second description file does not meet the conditions, the management device can directly disconnect the communication connection with the network device. The management device can also notify the network device that the second description file does not meet the conditions after determining that the second description file does not meet the conditions, and the management device or the network device disconnects the communication connection between the management device and the network device.
[0090] In this embodiment, the network device generates a second description file based on the first description file of the management device, and the management device further confirms whether the second description file meets the requirements, which can ensure that the second description file can meet the requirements of the network device and the management device at the same time. In addition, the network device and the management device negotiate and adapt the description file by themselves, which can improve the adaptation efficiency while ensuring the accuracy of the adaptation.
[0091] Figure 2The description file synchronization method may also include a variety of specific implementation methods. The description file synchronization process may include a description file difference negotiation process, that is, a process in which the network device obtains the second description file based on the first description file, and the management device checks the second description file. The description file synchronization process may also include a description file difference discovery process, that is, first determining that there are differences in the description files used by the network device and the management device, so that only the description files with differences can be negotiated and synchronized in the subsequent difference negotiation process.
[0092] In one possible implementation, it can be assumed by default that there are differences in the description files between the management device and the network device, and the difference negotiation of the description files is directly performed without going through the difference discovery process, which can improve the synchronization efficiency of the description files. Specifically, the management device can send a difference negotiation request to the network device, and the difference negotiation request carries the first description file of the management device. In response to the difference negotiation request, the network device generates a second description file based on the first description file and its own YANG model, and sends the second description file to the management device. After the management device confirms that the second description file meets its own requirements, it notifies the network device that the second description file can be used to encode the sampled data, and the management device subsequently uses the second description file to decode the sampled data of the network device.
[0093] In a possible implementation, difference discovery of description files may be performed first, and then difference negotiation may be performed on description files with differences. The first description file may be sent by the management device to the network device during the difference discovery phase, or may be sent by the management device to the network device during the difference negotiation phase. The difference discovery process may be initiated by the network device, or may be initiated by the management device.
[0094] The following describes various possible implementations of first discovering differences in description files and then negotiating differences in description files with differences.
[0095] like Figure 3 As shown, Figure 3 A flowchart of another description file synchronization method provided by the present application. In this embodiment, the network device initiates a communication connection with the management device, and the network device sends a difference discovery request to the management device. Specifically, this embodiment includes the following steps:
[0096] S301: The management device establishes a communication connection with the network device.
[0097] The network device establishes a communication connection with the management device through protocols such as RPC, gRPC, HTTP, and UDP. After the connection is established, the management device subscribes to the sampling data of the sampling path from the network device. The sampling path is a sampling object, which corresponds to a node in the YANG model. The sampling path is, for example, CPU status, interface traffic, latency, packet loss, or memory resources. If the sampling path is specified to use binary encoding, the sampling path corresponds to a description file for encoding the sampling data collected by the sampling path. Different sampling paths can correspond to the same description file or different description files. For example, the description files used by the sampling paths huawei-ifm:ifm / interfaces / interface and huawei-ifm:ifm / interfaces / interface / mib-statistic are the same, such as the huawei-ifm.proto file; and they use different description files from huawei-debug:debug / cpu-infos / cpu-infos.
[0098] After successfully establishing the communication connection, the network device may initiate a difference discovery process to the management device before sending the sampled data to the management device.
[0099] S302: The network device sends a difference discovery request to the management device, where the difference discovery request carries a third description file of the network device, or a hash value of the third description file.
[0100] The third description file is the description file corresponding to the sampling path subscribed by the management device. Before the network pushes the sampled data to the management device, it needs to synchronize the description file with the management device so that the two can use the same description file to encode and decode the sampled data, thereby ensuring that the sampled data pushed by the network device can be successfully decoded.
[0101] In a possible implementation, the difference discovery request carries a third description file of the network device. The difference discovery request is used to instruct the management device to check whether the third description file is compatible with the first description file of the management device. The first description file is a description file corresponding to the sampling path subscribed by the management device. That is, the first description file and the third description file are description files corresponding to the same sampling path in the management device and the network device, respectively, and the two may be the same or different, and need to be checked.
[0102] In another possible implementation, the difference discovery request carries a hash value of the third description file of the network device, thereby reducing the occupation of bandwidth resources by the difference discovery request.
[0103] S303: The management device checks whether the third description file is compatible with the first description file of the management device.
[0104] The method for checking whether the third description file is compatible with the first description file can be found in the relevant description of S203, which will not be described again here.
[0105] S304: If the third description file is incompatible with the first description file, the management device sends a difference negotiation request to the network device, where the difference negotiation request carries the first description file of the management device.
[0106] The difference negotiation request is used to instruct the network device to obtain the second description file according to the first description file.
[0107] S305: The network device obtains a second description file according to the first description file, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device.
[0108] For the network device obtaining the second description file according to the first description file, reference may be made to the relevant contents of S203, which will not be described in detail here.
[0109] S306: The network device sends a second description file to the management device.
[0110] S307: The management device checks whether the second description file meets the conditions.
[0111] If the second description file meets the condition, S308 and S309 are executed. If the second description file does not meet the condition, because the management device cannot obtain required information from the data reported by the network device based on the second description file, S311 is executed.
[0112] S308: The management device configures the description file used for decoding the sample data pushed by the network device as a second description file.
[0113] This step is similar to S206, so it will not be repeated here.
[0114] S309: The management device sends the inspection result to the network device.
[0115] This step is similar to S207, so it will not be repeated here.
[0116] S310: The network device configures the description file used to encode the sample data as a second description file.
[0117] This step is similar to S208, so it will not be repeated here.
[0118] S311: Disconnect the communication connection between the management device and the network device.
[0119] This step is similar to S209, so it will not be repeated here.
[0120] In this embodiment, before the network device pushes the sampled data to the management device, it initiates a difference discovery request for the description file corresponding to the subscribed sampling path to the management device, so that when the first description file and the third description file are incompatible, the management device and the network device can use the same description file for encoding and decoding for the sampled data of the same sampling path through difference negotiation. The difference discovery and difference negotiation of the description files between the network device and the management device can automatically and quickly synchronize the description files.
[0121] like Figure 4 As shown, Figure 4 A flowchart of another description file synchronization method provided by the present application is provided. In this embodiment, the management device initiates a communication connection with the network device, and the management device sends a difference discovery request to the network device.
[0122] S401: The management device establishes a communication connection with the network device.
[0123] The management device establishes a communication connection with the network device through protocols such as RPC, gRPC, HTTP, UDP, etc. After the communication connection is successfully established, the management device can initiate a difference discovery process to the network device before subscribing to the sampling data of the sampling path from the network device.
[0124] S402: The management device sends a difference discovery request to the network device, where the difference discovery request carries a hash value of the first description file of the management device.
[0125] The first description file is a description file corresponding to the sampling path to be subscribed by the management device. The difference discovery request is used to instruct the network device to verify whether the first description file is consistent with the third description file used by the network device for the sampling path. That is, the first description file and the third description file are description files corresponding to the same sampling path in the management device and the network device, respectively. The two may be the same or different and need to be verified.
[0126] The difference discovery request carries the hash value of the first description file of the management device, thereby reducing the occupation of bandwidth resources by the difference discovery request.
[0127] S403: The network device compares the third description file with the first description file of the management device according to the hash value of the first description file to see whether they are consistent.
[0128] The network device can obtain the hash values of the third description file and the first description file respectively, and determine whether the third description file is consistent with the first description file by comparing the hash values of the two. If the hash values of the third description file and the first description file are the same, the third description file is considered to be consistent with the first description file, and no further difference negotiation process is required. If the hash values of the third description file and the first description file are different, the third description file is considered to be inconsistent with the first description file, and further compatibility check and difference negotiation of the first description file and the third description file are required.
[0129] S404: If the third description file is inconsistent with the first description file, the network device sends a comparison result indicating that the third description file is inconsistent with the first description file to the management device.
[0130] S405: The management device sends a first description file to the network device.
[0131] S406: The network device checks whether the first description file is compatible with the third description file.
[0132] When the network device verifies that the first description file is incompatible with the third description file, a verification result indicating that the first description file is incompatible with the third description file is sent to the management device. When the network device verifies that the first description file is compatible with the third description file, a verification result indicating that the first description file is compatible with the third description file is sent to the management device. Then, there is no need to perform a difference negotiation process for the description file between the subsequent network device and the management device.
[0133] The method for checking whether the third description file is compatible with the first description file can be found in the relevant description of S203, which will not be described again here.
[0134] S407: The network device sends a test result indicating that the first description file is incompatible with the third description file to the management device.
[0135] S408: The management device sends a difference negotiation request to the network device, where the difference negotiation request instructs the network device to generate a second description file according to the first description file.
[0136] After receiving the verification result sent by the network device indicating that the first description file is incompatible with the third description file, the management device sends a difference negotiation request to the network device instructing the generation of the second description file according to the first description file.
[0137] S409: The network device obtains a second description file according to the first description file, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device.
[0138] For the network device obtaining the second description file according to the first description file, reference may be made to the relevant contents of S203, which will not be described in detail here.
[0139] S410: The network device sends a second description file to the management device.
[0140] S411: The management device checks whether the second description file meets the conditions.
[0141] If the second description file meets the condition, S412 and S413 are executed. If the second description file does not meet the condition, because the management device cannot obtain required information from the data reported by the network device based on the second description file, S415 is executed.
[0142] S412: The management device configures the description file used for decoding the sampled data pushed by the network device as a second description file.
[0143] This step is similar to S206, so it will not be repeated here.
[0144] S413: The management device sends the inspection result to the network device.
[0145] This step is similar to S207, so it will not be repeated here.
[0146] S414: The network device configures the description file used to encode the sampled data as a second description file.
[0147] This step is similar to S208, so it will not be repeated here.
[0148] S415: Disconnect the communication connection between the management device and the network device.
[0149] This step is similar to S209, so it will not be repeated here.
[0150] S402-S406 can reduce the bandwidth occupied by the description file transmission in the network. Of course, S402-S406 are optional steps. In a possible implementation, the difference discovery request sent by the management device to the network device can directly carry the first description file, and the network device performs a compatibility check based on the first description file. Alternatively, the management device can directly send a difference negotiation request to the network device without executing the difference discovery process, and the network device directly obtains the second description file based on the first description file.
[0151] In this embodiment, before the management device subscribes to the sampling data of the sampling path from the network device, it initiates a difference discovery request for the description file of the sampling path to the network device, so that when the first description file and the third description file are incompatible, the management device and the network device can use the same description file for encoding and decoding for the sampling data of the same sampling path through difference negotiation. The difference discovery and difference negotiation of description files between the network device and the management device can automatically and quickly synchronize the description files.
[0152] When the management device subscribes to the sampling data of multiple sampling paths of the network device, the management device and the network device can perform difference discovery and difference negotiation on the description files corresponding to the subscribed multiple sampling paths. For example, the management device can send a difference discovery request to the network device, and the difference discovery request carries a description file information list including multiple description file information. By using a description file information list with a smaller data volume to filter inconsistent description files, the network device can subsequently send only the description files that are inconsistent between the network device and the management device to the network device, which can reduce the occupation of bandwidth resources during the difference discovery and difference negotiation process.
[0153] The description file information list includes the name of each description file, the cyclic redundancy check code (cyclic redundancy check, CRC) check value or hash value of the file content, etc. Of course, the description file information list can also include information such as the size corresponding to the description file. The network device uses the same description file name as a key to compare the file size, CRC check value or hash value of the file content with the same description file name, and then returns the comparison result to the management device. The management device receives the comparison result returned by the network device, and the comparison result includes the name of the inconsistent description file (at least one of the file size, CRC check value of the file content and the hash value is inconsistent). The management device sends the inconsistent description file (for example, including the first description file) to the network device, and the network device checks whether the description file from the management device and its own description file with the same file name are compatible. After obtaining the inspection result, the inspection result is returned to the management device. For incompatible description files, operations similar to S405-S411 are performed, which will not be repeated here. Thereby, the management device and the network device can complete the difference discovery and difference negotiation of multiple description files in batches, and improve the efficiency of description file synchronization.
[0154] The communication connection between the network device and the management device may be disconnected and reconnected. In order to avoid the need to re-perform the difference discovery and / or difference negotiation process after each successful connection between the network device and the management device, the network device / management device can cache the previous inspection results (difference discovery results) and / or difference negotiation results, thereby improving the synchronization efficiency of the description file. For example, in the case where the management device initiates a communication connection with the network device, before subscribing to the sampling data of a certain sampling path from the network device, the management device can first query whether it has previously negotiated with the network device on the description file corresponding to the sampling path. If there is a relevant difference negotiation result, such as a second description file corresponding to the sampling path, the second description file is sent to the network device, instructing the network device to use the second description file to encode the sampling data of the corresponding sampling path, thereby eliminating the need for multiple interactions for difference discovery and difference negotiation, thereby improving the synchronization efficiency of the description file and the occupancy of bandwidth resources.
[0155] For another example, when the network device initiates a communication connection with the management device, the network device may negotiate with the management device on the description file corresponding to the sampling path before locally querying. If there is a relevant difference in negotiation results, such as the second description file corresponding to the sampling path, the second description file is sent to the management device, and the network device sets the description file used to encode the sampling data of the sampling path to the second description file, and the management device sets the description file used to decode the sampling data of the sampling path to the second description file. Or after the management device confirms that the second description file meets the conditions, the management device sets the description file used to decode the sampling data of the sampling path to the second description file, and notifies the network device to set the description file used to encode the sampling data of the sampling path to the second description file, thereby reducing the number of interactions between the network device and the management device and improving the synchronization efficiency of the description files.
[0156] For example, when the network device receives a difference discovery request sent by the management device and carries the first description file or the description file information corresponding to the first description file (the name, size, hash value or CRC value of the description file, etc.), the network device queries the local cache to find the difference discovery result of the first description file, and the network device can obtain the corresponding compatibility test result from the cache and send the test result to the management device. The network device does not need to perform the compatibility test between the first description file and the third description file again. When the network device receives a difference negotiation request from the management device, if the network device caches the difference negotiation result of the first description file, such as the second description file obtained based on the first description file, and the second description file meets the conditions of the management device, the network device does not need to generate the second description file based on the first description file sent by the management device, but obtains the cached second description file and sends it to the management device. Thereby, the workload of the network device can be reduced, the occupation of the computing resources of the network device can be reduced, and the efficiency of description file synchronization can be improved.
[0157] Based on the same technical concept, the present application also provides the following embodiments. Figure 5 As shown, Figure 5 A schematic diagram of the structure of a management device provided by the present application. In this embodiment, the management device 500 includes a transceiver module 501 and a processing module 502 .
[0158] The transceiver module 501 is used to send a first description file of the management device to the network device. The transceiver module 501 is used to receive a second description file returned by the network device, where the second description file is part of the first description file that is compatible with the YANG model of the network device. The processing module 502 is used to decode the data reported by the network device based on the second description file when the second description file meets the conditions, where the data reported by the network device is encoded based on the second description file.
[0159] In a possible implementation, the transceiver module 501 is used to receive the third description file from the network device. The processing module 502 is used to check whether the third description file is compatible with the first description file. The transceiver module 501 is used to send the first description file of the management device to the network device when the third description file is incompatible with the first description file.
[0160] In a possible implementation, the transceiver module 501 is used to receive a test result from the network device, the test result indicating that the third description file is incompatible with the first description file. The transceiver module 501 is used to send a difference negotiation request to the network device, the difference negotiation request instructing the network device to generate a second description file based on the first description file.
[0161] In a possible implementation, the transceiver module 501 is used to send a difference discovery request to a network device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with the information of the description file of the network device. The transceiver module 501 is used to receive a comparison result returned by the network device, the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file. The transceiver module 501 is specifically used to send the first description file to the network device when the name of the description file with inconsistent hash values includes the name of the first description file.
[0162] like Figure 6 As shown, the present application also provides a network device. The network device 600 includes a transceiver module 601 and a processing module 602. The transceiver module 601 is used to receive a first description file of the management device sent by the management device. The processing module 602 is used to obtain a second description file based on the first description file, and the second description file is a portion of the first description file that is compatible with the YANG model of the network device. The transceiver module 601 is used to send the second description file to the management device, so that when the management device determines that the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is encoded based on the second description file.
[0163] In a possible implementation, the transceiver module 601 is configured to send a third description file of the network device to the management device, so that the management device sends the first description file to the network device when the third description file is incompatible with the first description file.
[0164] In a possible implementation, the processing module 602 is used to check whether the first description file is compatible with the third description file and obtain a check result. The transceiver module 601 is used to send the check result to the management device, so that the management device sends a difference negotiation request to the network device when the check result indicates that the third description file is incompatible with the first description file. The transceiver module 601 is used to receive the negotiation difference request and execute the step of obtaining the second description file according to the first description file.
[0165] In a possible implementation, the network device further includes a storage module 603. The storage module 603 is configured to store the inspection result, so that when the management device sends a difference discovery request to the network device, the network device returns the stored inspection result to the management device.
[0166] In a possible implementation, the transceiver module 601 is used to receive a difference discovery request from a management device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with the information of the description file of the network device. The processing module 602 is used to compare whether the description file information is consistent with the information of the description file of the network device to obtain a comparison result, the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file. The transceiver module 601 is used to send the comparison result to the management device, so that the management device sends the description file with inconsistent hash values to the network device according to the comparison result.
[0167] The present application also provides a network device. The device includes a transceiver module and a processing module. The transceiver module is used to receive a target description file. The processing module is used to encode data reported to the network device based on the target description file when the target description file is compatible with the YANG model of the network device.
[0168] like Figure 7 As shown, the present application also provides an electronic device. The electronic device 700 includes a processor 701 and a memory 702, the processor 701 is coupled to the memory 702, and the processor 701 is configured to execute the file synchronization method of any of the above method embodiments based on the instructions stored in the memory 702.
[0169] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a computer, the file synchronization method of any of the above method embodiments is implemented.
[0170] The present application also provides a computer program product, including a program, which, when running on a processor, executes the file synchronization method process of any of the above method embodiments.
[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0172] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A file synchronization method, characterized in that: The method comprises: The management device sends a first description file of the management device to the network device; The management device receives a second description file returned by the network device, where the second description file is a portion of the first description file that is compatible with a YANG model of a next generation modeling language of the network device; If the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
2. The method according to claim 1, characterized in that Before the management device sends the first description file of the management device to the network device, the method includes: The management device receives a third description file from the network device; The management device checks whether the third description file is compatible with the first description file; When the third description file is incompatible with the first description file, the management device executes the step of sending the first description file of the management device to the network device.
3. The method according to claim 1, characterized in that: Before the management device receives the second description file returned by the network device, the method includes: The management device receives a verification result from the network device, wherein the verification result indicates that the third description file of the network device is incompatible with the first description file; The management device sends a difference negotiation request to the network device, where the difference negotiation request instructs the network device to generate the second description file according to the first description file.
4. The method according to claim 1 or 3, characterized in that: Before the management device sends the first description file of the management device to the network device, the method includes: The management device sends a difference discovery request to the network device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with information in the description file of the network device; The management device receives a comparison result returned by the network device, where the comparison result includes a name of a description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes a name of the first description file; The management device executes the step of sending a first description file of the management device to a network device.
5. A file synchronization method, characterized in that: The method comprises: The network device receives a first description file of the management device sent by the management device; The network device obtains a second description file according to the first description file, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device; The network device sends the second description file to the management device, so that when the management device determines that the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
6. The method according to claim 5, characterized in that Before the network device receives the first description file of the management device sent by the management device, the method includes: The network device sends a third description file of the network device to the management device, so that the management device sends the first description file to the network device when the third description file is incompatible with the first description file.
7. The method according to claim 5, characterized in that Before the network device obtains the second description file according to the first description file, the method includes: The network device checks whether the first description file is compatible with the third description file, and obtains a check result; The network device sends the inspection result to the management device, so that the management device sends a difference negotiation request to the network device when the inspection result indicates that the third description file is incompatible with the first description file; The network device receives the negotiation difference request and executes the step of obtaining a second description file according to the first description file.
8. The method according to claim 7, characterized in that The network device stores the inspection result, so that when the management device issues a difference discovery request to the network device, the network device returns the stored inspection result to the management device.
9. The method according to any one of claims 5, 7-8, characterized in that: Before the network device receives the first description file of the management device sent by the management device, the method includes: The network device receives a difference discovery request from the management device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with information in the description file of the network device; The network device compares whether the description file information is consistent with information of the description file of the network device to obtain a comparison result, wherein the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file; The network device sends the comparison result to the management device, so that the management device sends the description file with inconsistent hash values to the network device according to the comparison result.
10. A file synchronization method, characterized in that: Methods include: The network device receives the target description file; If the target description file is compatible with the YANG model of the network device, the network device encodes the data reported to the management device based on the target description file, and the data reported to the management device is obtained by encoding the data organized by the YANG model based on the second description file.
11. A management device, characterized in that: The device comprises: A transceiver module, used for sending a first description file of the management device to the network device; The transceiver module is used to receive a second description file returned by the network device, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device; A processing module is used to decode the data reported by the network device based on the second description file when the second description file meets the conditions, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
12. The device according to claim 11, characterized in that The transceiver module is used to receive a third description file from the network device; The processing module is used to check whether the third description file is compatible with the first description file; The transceiver module is used to send the first description file of the management device to the network device when the third description file is incompatible with the first description file.
13. The device according to claim 11, characterized in that The transceiver module is used to receive a test result from the network device, wherein the test result indicates that the third description file is incompatible with the first description file; The transceiver module is used to send a difference negotiation request to the network device, where the difference negotiation request instructs the network device to generate the second description file according to the first description file.
14. The method according to claim 11 or 13, characterized in that The transceiver module is used to send a difference discovery request to the network device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with information in the description file of the network device; The transceiver module is used to receive a comparison result returned by the network device, wherein the comparison result includes a name of a description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes a name of the first description file; The transceiver module is specifically configured to send the first description file to the network device when the name of the description file with inconsistent hash values includes the name of the first description file.
15. A network device, characterized in that: The device comprises: A transceiver module, configured to receive a first description file of the management device sent by the management device; A processing module, configured to obtain a second description file according to the first description file, where the second description file is a portion of the first description file that is compatible with the YANG model of the network device; The transceiver module is used to send the second description file to the management device, so that when the management device determines that the second description file meets the conditions, the management device decodes the data reported by the network device based on the second description file, and the data reported by the network device is obtained by encoding the data organized by the YANG model based on the second description file.
16. The device according to claim 15, characterized in that The transceiver module is used to send the third description file of the network device to the management device, so that the management device sends the first description file to the network device when the third description file is incompatible with the first description file.
17. The device according to claim 15, characterized in that The processing module is used to check whether the first description file is compatible with the third description file, and obtain a check result; The transceiver module is used to send the inspection result to the management device, so that the management device sends a difference negotiation request to the network device when the inspection result indicates that the third description file is incompatible with the first description file; The transceiver module is used to receive the negotiation difference request and execute the step of obtaining the second description file according to the first description file.
18. The device according to claim 17, characterized in that The network device also includes a storage module; The storage module is used to store the inspection result, so that when the management device sends a difference discovery request to the network device, the network device returns the stored inspection result to the management device.
19. The device according to any one of claims 15, 17-18, characterized in that The transceiver module is used to receive a difference discovery request from the management device, the difference discovery request carries description file information, the description file information includes at least one description file name and a hash value, and the difference discovery request instructs the network device to compare whether the description file information is consistent with information in the description file of the network device; The processing module is used to compare whether the description file information is consistent with the information of the description file of the network device to obtain a comparison result, wherein the comparison result includes the name of the description file with inconsistent hash values, and the name of the description file with inconsistent hash values includes the name of the first description file; The transceiver module is used to send the comparison result to the management device, so that the management device sends the description file with inconsistent hash values to the network device according to the comparison result.
20. A network device, characterized in that: The device comprises: A transceiver module, used for receiving a target description file; A processing module is used to encode data reported to a management device based on the target description file when the target description file is compatible with the YANG model of the network device, and the data reported to the management device is obtained by encoding the data organized by the YANG model based on the second description file.
21. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the processor is coupled to the memory, and the processor is configured to execute the file synchronization method according to any one of claims 1 to 10 based on instructions stored in the memory.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when the computer-readable storage medium is executed on an electronic device, causes the electronic device to execute the file synchronization method as described in any one of claims 1 to 10.
23. A computer program product, characterized in that The invention comprises a program, and when the program is run on a processor, the file synchronization method according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Compiling method based on YANG model, and corresponding interface, module and system
CN106559251A
Equipment management method, device and system, equipment and storage medium
CN112187525A
Method for automatic matching terminal devices in household network
CN1481118A
Active software renewing apparatus and method thereof
CN1786908A
Device management method, apparatus, system, and device, and storage medium
US20220255818A1
