WO2013000294A1 - 网元日志同步方法和系统 - Google Patents

网元日志同步方法和系统 Download PDF

Info

Publication number
WO2013000294A1
WO2013000294A1 PCT/CN2012/072354 CN2012072354W WO2013000294A1 WO 2013000294 A1 WO2013000294 A1 WO 2013000294A1 CN 2012072354 W CN2012072354 W CN 2012072354W WO 2013000294 A1 WO2013000294 A1 WO 2013000294A1
Authority
WO
WIPO (PCT)
Prior art keywords
network element
log
synchronization
network
ftp server
Prior art date
Application number
PCT/CN2012/072354
Other languages
English (en)
French (fr)
Inventor
宋奇兵
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013000294A1 publication Critical patent/WO2013000294A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present invention relates to telecommunications network management and maintenance, and in particular, to a network element log synchronization method and system.
  • the ability to synchronize and process the NE log file is a basic function required by the NMS software.
  • the NE file records the abnormal information, operation information, and operation information of the NE device during operation, which facilitates the device provider to locate the fault.
  • the reliability analysis of the equipment provides a data foundation.
  • the NEs respond in two ways: First, the NE renames the log files so that Other network element log files are distinguished. Generally, the IP address or the NE name is prefixed, and the renamed file is uploaded to a specified unified directory of the File Transfer Protocol (FTP) server. The NE does not need to change the name of the log file. The file is uploaded to the specified directory on the FTP server. The directory name is the IP address or NE name. The latter method requires that the synchronization command parameters delivered include the directory where the log files are stored. In batch processing, the synchronization command is sent to all NEs. After all NEs are uploaded, all files are parsed.
  • FTP File Transfer Protocol
  • the NMS first needs to send a synchronization log file command to the NE through SNMP.
  • the NE responds to the command, you need to log in to the NMS server to upload log files through FTP.
  • Each communication uses two communication modes to improve communication complexity and communication reliability. reduce. Summary of the invention
  • a network element log synchronization method includes:
  • the network element log file of the network element is obtained from the network element FTP server, and the network element synchronization is performed.
  • the step of acquiring the network element log file of the network element from the network element FTP server, and performing the network element log synchronization includes:
  • the determining the NE log file added when the network element log synchronization is synchronized with the last time is:
  • the log file is the new NE log file added to the NE FTP server.
  • the method further includes: establishing a thread pool when the network element log is synchronized in a plurality of network elements;
  • the synchronization network element is sequentially processed to perform log synchronization.
  • the foregoing method for synchronizing the network element logs further includes:
  • the method further includes:
  • the identifier (ID) of the network element is used as the prefix of the NE log file name corresponding to the NE, and the NE log file name database table is created to store the synchronized NE log file name.
  • the invention also provides a network element log synchronization method, including:
  • the foregoing method for synchronizing the network element logs further includes:
  • the present invention also provides a network element log synchronization system, where the system includes a network management system and at least one network element under the network management system;
  • the network management device is configured to: log in to the network element FTP server of the network element to be synchronized, obtain the network element log file of the network element from the network element FTP server, and perform network element log synchronization;
  • the network element is configured to: log in to the local network element FTP server by the network management system, and synchronize the network element log file on the local network element FTP server to the network management device according to the indication of the network management.
  • the network management is further configured to: when the network element FTP server is unavailable, send a command to the to-be-synchronized network element according to the SNMP, and instruct the to-be-synchronized network element to reply to all the network element logs on the network element FTP.
  • the name of the file, the name of the NE that is synchronized when the last NE log is synchronized is compared with the name of the NE in the current FTP server.
  • the NE log name is synchronized in the last NE log synchronization.
  • No NE log file is added to the NE FTP server. a network element log file, and sending an SNMP indication to the network element, instructing the network element FTP server to return a newly added network element log file;
  • the network element is further configured to: receive a command sent by the network management device to reply to the name of all the network element log files on the local network element FTP server, and report the network to the network management system to report all the networks on the local network element FTP server.
  • the name of the meta-log file and then receives the SNMP indication of the uploaded NE log file sent by the network management system, and uploads the network element log file specified by the SNMP indication to the network management system.
  • the network management system is further configured to: establish a thread pool when the network element logs are synchronized in a plurality of network elements, establish a synchronization task for each of the to-be-synchronized network elements, and put the synchronization task into the task queue of the thread pool.
  • the log synchronization is performed on the synchronous network element in sequence according to the order of the task queue.
  • An embodiment of the present invention provides a network element log synchronization method and system.
  • the network management system is configured to log in to the network element FTP server of the network element to be synchronized, and obtain the network element of the network element from the network element FTP server.
  • the meta-log synchronization synchronizes the synchronization of the NE log files only through the FTP server, which reduces the complexity of the network and solves the problem of high communication complexity and low reliability in the synchronization process of the existing NE log files.
  • FIG. 1 is a flowchart of a method for synchronizing a network element log according to Embodiment 1 of the present invention
  • FIG. 2 is a specific flowchart of step 104 in FIG.
  • FIG. 3 is a flowchart of processing a synchronous network element log in Embodiment 2 of the present invention.
  • FIG. 4 is a service flow diagram of a synchronization log execution thread in an embodiment of the present invention. Preferred embodiment of the invention
  • the NMS first needs to send the synchronization log file command to the NE through SNMP.
  • the NE responds to the command, you need to log in to the NMS server to upload the file through FTP.
  • Communication method improve communication complexity, and make communication reliability Lower.
  • the file IP address or NE name is used as the log file naming prefix or directory name. This may cause file read and write errors.
  • the NE log file is synchronized ⁇ When the network element has a large number of log files, the new synchronization and parsing files are very wasteful of bandwidth and system resources.
  • batch synchronization when the number of network elements connected to the NMS is large, all NEs are simultaneously uploaded. A file upload storm occurs when the log file is generated, which has an impact on the performance of the NMS.
  • the embodiment of the present invention provides a method for synchronizing a network element log.
  • the process of synchronizing the network element log file to the network management system using the method is as shown in FIG. 1 , and includes:
  • Step 101 The network management system establishes a thread pool when the network element logs are synchronized in the multi-network element batch.
  • the thread pool is established.
  • the threading mechanism processes the batch NE synchronization command to establish a synchronization task for each network element and put it into the thread pool task queue. If it is a single network element, a new thread is started to perform the synchronization task.
  • the maximum number of threads in the thread pool N determines the number of network elements that the network management system performs log synchronization and processing at the same time, so as to prevent uploading storms when all network elements upload files at the same time, so according to the current network capacity and network element logs.
  • the size of the synchronization is appropriately determined to the N value, so that the network element log synchronization is completed efficiently and stably without affecting the network quality and the normal service.
  • Step 102 The network management performs the synchronization of the synchronization network element according to the order of the task queues in sequence; determining whether the FTP server is available, if yes, performing step 103; if not, executing step 105;
  • Step 103 Log in to the network element FTP server of the network element to be synchronized.
  • the network management system directly logs in to the network element FTP server in each synchronization thread.
  • the NE FTP server is enabled and the NE log file is stored.
  • the NMS obtains the file name of all current log files of the NE from the FTP server of the NE, and then obtains the log file in incremental mode.
  • Step 104 Obtain an NE log file of the network element from the network element FTP server, and perform network element log synchronization.
  • the NE log file in the current NE FTP server can be obtained.
  • it can be partially obtained to further reduce network pressure.
  • it includes:
  • Step 1041 Determine a network element log file that is added when the network element log synchronization is synchronized with the previous time in the network element FTP server.
  • the NE log name synchronized with the last NE log synchronization is compared with the NE log name in the current FTP server, and the NE log name is not synchronized in the last NE log synchronization.
  • the NE log file is the new NE log file in the NE FTP server.
  • Step 1042 Obtain the newly added network element log file.
  • the network management unit instructs the network element to upload the newly added NE log file determined in step 1041 to the network management FTP server.
  • the file is obtained through the FTP GET operation to the unified directory specified on the network management FTP server.
  • the NE ID is used as a prefix to complete NE log synchronization.
  • the NMS saves the names of all NE log files obtained by the synchronization.
  • the specific method is as follows: Maintain a NE log file name table in the NMS database, including the NE ID number and the log file name. The name of the log file on all NEs.
  • step 104 if the acquisition succeeds, the synchronization ends. If the network FTP server is damaged or unavailable, the log file fails to be obtained, and other means, such as SNMP, is required to complete the synchronization of the network element, and the process proceeds to step 105.
  • Step 105 When the network element FTP server is unavailable, the network management system sends a command to the to-be-synchronized network element according to the SNMP, instructing the to-be-synchronized network element to reply to the name of all network element log files on the network element FTP.
  • the synchronization log command is sent to the NE through SNMP, and the NE is sent back to the current log file name.
  • Step 106 The network element receives a command sent by the network management unit to reply to the name of all the network element log files on the local network element FTP server, and reports the entire network element log file on the local network element FTP server to the network management system.
  • the name ;
  • Step 107 The network management compares the network element log name synchronized with the last network element log synchronization with the network element log name in the current network element FTP server, and the last time the network element log is synchronized in the synchronized network element name
  • the network element log file that is not included is the newly added network element file in the FTP server of the network element;
  • Step 108 The network management system sends an SNMP indication to the network element, indicating that the network element FTP server returns the newly added network element log file.
  • the newly added network element log file name, the network element ID number, and the network management FTP are added.
  • the parameters IP, user name, password, and directory
  • the NE uploads the NE log file specified by the NMS.
  • Step 109 The network element receives an SNMP indication of the uploaded network element log file sent by the network management, and uploads, to the network management, the network element log file specified by the SNMP indication.
  • the NE responds to the command and logs in to the FTP server to upload the newly added file to the specified directory.
  • the file name is prefixed with the NE ID.
  • the network element After uploading all the log files, the network element sends a trap message to the network management system, and the trap message includes the name of the successfully transmitted file.
  • the embodiment of the present invention provides a network element log synchronization method.
  • FIG. 3 is a schematic flowchart of the process for processing a synchronous network element log according to the present invention, including the following steps:
  • Step 301 The user initiates a log synchronization command to the network management system or the timer task is automatically initiated, and the network management system accepts the command and starts processing;
  • Step 302 Determine whether the multi-network element is in batch synchronization or single-network element synchronization; multi-network element batch synchronization, step 303 is performed, otherwise, step 306 is performed;
  • Step 303 Multi-network element batch synchronization operation: establish a thread pool in the main thread, and establish a synchronization task for each network element, and put the task into the task queue of the thread pool to wait for execution.
  • the number of threads owned by the thread pool determines the number of network elements that perform simultaneous synchronization tasks;
  • Step 304 The main thread sleeps for 100 ms, waiting for all synchronization tasks to be executed;
  • Step 305 The main thread completes the hibernation, determines whether all the synchronization tasks have been executed, and if so, ends the synchronization operation, otherwise returns to step 304 to continue the sleep waiting;
  • Step 306 Single network element synchronization operation: starting a new thread in the main thread to perform a synchronization task, and waiting;
  • Step 307 After the synchronization thread is executed, return to the main thread, and end the synchronization operation.
  • NE log synchronization can be performed.
  • 4 is a service flow of a synchronization log execution thread in an embodiment of the present invention, including the following steps:
  • Step 401 Log in to the NE FTP server.
  • Step 402 Determine whether the FTP server of the network element can be used normally. If it is normal, enter the step.
  • Step 403. Log in to the NE to directly obtain the branching process of the file. If it is not available, use the SNMP to send the synchronization command and the NE to upload the log file to the branch process of the FTP server. Go to Step 406.
  • Step 403 The network element FTP is available, and obtain the current log file name of the network element.
  • Step 404 Read all log file names from the network element log file name database table when the network element was last synchronized, and perform proofreading to obtain a newly added file name.
  • Step 405 Use the get operation to obtain a new log file from the network element FTP server, and store it in a unified path of the network management.
  • the file name is prefixed with the network element ID number to ensure that the file name is absolutely unique.
  • Step 406 When the network element FTP is unavailable, the synchronization command is sent through the SNMP command, and the network element is required to feed back all the current log file names through SNMP after accepting the command.
  • Step 407 Determine whether the network element feeds back all the current log file names. If the feedback is successful, go to step 408. If the feedback fails, the synchronization ends.
  • Step 408 Read all log file names from the NE log file name database table when the network element was last synchronized, and perform proofreading with the file name returned by the network element to obtain a newly added file name.
  • Step 409 The name of the newly added NE log file, the NE ID number assigned by the network management system, and the U2000 FTP server parameter (IP address, user name, password, and file storage path) are sent to the NE.
  • the U2000 FTP server parameter IP address, user name, password, and file storage path
  • Step 410 The NE is logged in to the FTP server.
  • the newly added log file is uploaded to the specified storage directory.
  • the file name is prefixed with the NE ID.
  • Step 411 The network management determines whether the NE log file is successfully uploaded. If successful, perform step 412, otherwise, the synchronization ends.
  • the NE After uploading all the log files to the network management server, the NE sends a trap message to the NMS.
  • the trap message contains the name of the successfully transmitted file.
  • Step 412 Update the obtained NE log file name to the database log file name table.
  • Step 413 Parse the obtained log file, and store the log content into the database; delete the file record after the parsing is completed, and end the synchronization thread.
  • the embodiment of the present invention provides a network element log synchronization system, where the system includes a network management system and at least one network element under the network management system;
  • the network management device is configured to log in to the network element FTP server of the network element to be synchronized, obtain the network element log file of the network element from the network element FTP server, and perform network element log synchronization.
  • the network element is configured to receive the network element FTP server on the local network element FTP server from the network management system according to the indication of the network management.
  • the network management system is further configured to perform SNMP according to the SNMP server when the network element is unavailable.
  • the NE log file in the NE FTP server is compared.
  • the NE log file that is not in the NE log name synchronized in the previous NE log synchronization is the NE log file added to the NE FTP server.
  • sending an SNMP indication to the network element instructing the network element FTP server to return the newly added network element log file;
  • the network element is further configured to receive a command sent by the network management device to reply to the name of all network element log files on the local network element FTP server, and report the local network element FTP server to the network management system.
  • the name of the entire network element log file is received, and the SNMP indication of the uploaded network element log file sent by the network management system is received thereafter, and the network element log file specified in the SNMP indication is uploaded to the network management system.
  • the network management system is further configured to establish a thread pool when the network element logs are synchronized in a plurality of network elements, and establish a synchronization task for each of the to-be-synchronized network elements, and put the synchronization task into the task queue of the thread pool.
  • the log synchronization is performed on the synchronous network element in sequence according to the order of the task queue.
  • the network element log synchronization system provided by the embodiment of the present invention can be combined with the network element log synchronization method provided by the embodiment of the present invention, and the network management system logs in to the network element FTP server of the to-be-synchronized network element, and from the network element FTP
  • the server obtains the NE log of the NE and performs NE log synchronization.
  • the synchronization of the NE log file is completed only through the FTP server, which reduces the complexity of the network and solves the communication process of the existing NE log file synchronization process. High complexity and low reliability.
  • the operation of synchronizing the network element log files to the network management system is performed in an incremental synchronization file manner, which greatly saves the network traffic required for synchronizing the log files, and also saves the system overhead caused by parsing the files;
  • the thread pool-based multi-threading mechanism of the present invention to process the synchronous network element log command in batches, a fixed number of network elements are processed at the same time, which avoids the impact on the system caused by the file upload storm.
  • the NMS directly logs in to the NE to obtain log files. This prevents the SNMP and FTP from being used together to improve communication complexity and reliability. The latter is used to ensure that the NMS obtains log files when the NE FTP server is unavailable.
  • the NE ID number is used as the prefix of the log file name, and the uniqueness of the file name can be absolutely guaranteed.
  • all or part of the steps of the foregoing embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the invention is not limited to any particular combination of hardware and software.
  • the various devices/function modules/functional units in the above embodiments may be implemented using a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • Each device/function module/functional unit in the above embodiments can be stored in a computer readable storage medium when implemented in the form of a software function module and sold or used as a standalone product.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the embodiment of the present invention provides a network element log synchronization method and system.
  • the network management system is configured to log in to the network element FTP server of the network element to be synchronized, and obtain the network element of the network element from the network element FTP server.
  • the NE log synchronization is performed.
  • the synchronization of the NE log files is completed only through the FTP server, which reduces the complexity of the network and solves the problem of high communication complexity and low reliability in the synchronization process of the existing NE log files.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供了一种网元日志同步方法和系统。涉及电信网络管理与维护;解决了现有网元日志文件同步过程通信复杂性高、可靠性低的问题。该方法包括:登录待同步网元的网元FTP服务器;从所述网元FTP服务器中获取所述网元的网元日志文件,执行网元日志同步。本发明提供的技术方案适用于网管网络,实现了高效高可靠性的网元日志同步。

Description

网元日志同步方法和系统
技术领域
本发明涉及到电信网络管理与维护, 尤其涉及一种网元日志同步方法和 系统。
背景技术
能够同步并处理网元日志文件是一个网管软件必备的基本功能, 网元曰 志文件记录了网元设备运行过程中的异常信息、 运行信息以及操作信息, 便 于设备提供商进行故障定位, 为设备的可靠性分析提供数据基础。
目前, 同步网元日志文件的通常做法是网管通过简单网络管理协议 ( Simple Network Management Protocol , SNMP )直接下发同步命令, 网元有 两种方法响应: 一是网元先将日志文件更名以便与其它网元日志文件区分, 一般加上 IP地址或者网元名称为前缀, 将更名后的文件上传至网管文件传输 协议( File Transfer Protocol, FTP )服务器的某个指定的统一目录下; 另外一 种就是网元不必更改日志文件名称, 直接通过 FTP 方式将文件上传至网管 FTP服务器上指定的独立目录下, 目录名称为网元 IP地址或网元名称。 后一 种方法要求下发的同步命令参数中包含日志文件的存放目录。 批量处理时先 将同步命令下发至所有网元, 等待所有网元都上传完毕后再进行集中解析所 有文件。
上述做法在以下缺点:
网管首先需要通过 SNMP给网元下发同步日志文件命令, 网元响应命令 时需要登录网管服务器通过 FTP上传日志文件, 每次交互均使用到两种通信 方式, 提高通信复杂性, 使得通信可靠性降低。 发明内容
本发明提供了一种网元日志同步方法和系统, 解决了现有网元日志文件 同步过程通信复杂性高、 可靠性低的问题。 一种网元日志同步方法, 包括:
登录待同步网元的网元 FTP服务器;
从所述网元 FTP服务器中获取所述网元的网元日志文件, 执行网元曰志 同步。
优选的, 从所述网元 FTP服务器中获取所述网元的网元日志文件, 执行 网元日志同步的步骤包括:
确定所述网元 FTP服务器中较上一次网元日志同步时新增的网元日志文 件;
获取所述新增的网元日志文件。
优选的, 所述确定所述网元 FTP服务器中较上一次网元日志同步时新增 的网元日志文件为:
将上一次网元日志同步时同步的网元日志名与当前所述网元 FTP服务器 中的网元日志名进行对比, 上一次网元日志同步时同步的网元日志名中所没 有的网元日志文件即为所述网元 FTP服务器中新增的网元日志文件。
优选的, 所述登录待同步网元的网元 FTP服务器的步骤之前, 还包括: 在多网元批量进行网元日志同步时, 建立线程池;
为各个待同步网元分别建立一同步任务, 将同步任务放入所述线程池的 任务队列中;
按照所述任务队列的次序, 依序对待同步网元执行日志同步。
优选的, 上述网元日志同步方法还包括:
在所述网元 FTP服务器不可用时,依据 SNMP向所述待同步网元发送命 令, 指示所述待同步网元回复所述网元 FTP上全部网元日志文件的名称; 将上一次网元日志同步时同步的网元日志名与当前所述网元 FTP服务器 中的网元日志名进行对比, 上一次网元日志同步时同步的网元日志名中所没 有的网元日志文件即为所述网元 FTP服务器中新增的网元日志文件;
向所述网元发送 SNMP指示,指示所述网元 FTP服务器返回新增的网元 日志文件。 优选的 , 所述从所述网元 FTP服务器中获取所述网元的网元日志文件 , 执行网元日志同步的步骤之后, 还包括:
将所述网元的标识号 (ID )作为该网元对应的网元日志文件名称前缀, 创建网元日志文件名称数据库表存储已同步的网元日志文件名称。
本发明还提供了一种网元日志同步方法, 包括:
接受网管登录本地的网元 FTP服务器;
根据所述网管的指示, 向所述网管同步所述本地网元 FTP服务器上的网 元日志文件。
优选的, 上述网元日志同步方法还包括:
接收所述网管发送的指示回复所述本地的网元 FTP服务器上全部网元日 志文件名称的命令, 向所述网管上报所述本地的网元 FTP服务器上全部网元 日志文件的名称;
接收所述网管发送的上传网元日志文件的 SNMP指示, 向所述网管上传 其在该 SNMP指示中指定的网元日志文件。
本发明还提供了一种网元日志同步系统, 该系统包括网管和该网管下至 少一个网元;
所述网管, 其设置为: 登录待同步网元的网元 FTP服务器, 并从所述网 元 FTP服务器中获取所述网元的网元日志文件, 执行网元日志同步;
所述网元, 其设置为: 接受网管登录本地的网元 FTP服务器, 并根据所 述网管的指示,向所述网管同步所述本地网元 FTP服务器上的网元日志文件。
优选的, 所述网管还设置为: 在所述网元 FTP服务器不可用时, 依据 SNMP向所述待同步网元发送命令, 指示所述待同步网元回复所述网元 FTP 上全部网元日志文件的名称, 将上一次网元日志同步时同步的网元日志名与 当前所述网元 FTP服务器中的网元日志名进行对比, 上一次网元日志同步时 同步的网元日志名中所没有的网元日志文件即为所述网元 FTP服务器中新增 的网元日志文件, 并向所述网元发送 SNMP指示, 指示所述网元 FTP服务器 返回新增的网元日志文件;
所述网元还设置为: 接收所述网管发送的指示回复所述本地的网元 FTP 服务器上全部网元日志文件名称的命令, 向所述网管上报所述本地的网元 FTP服务器上全部网元日志文件的名称, 并在其后接收所述网管发送的上传 网元日志文件的 SNMP指示, 向所述网管上传其在该 SNMP指示中指定的网 元日志文件。
优选的, 所述网管还设置为: 在多网元批量进行网元日志同步时, 建立 线程池, 为各个待同步网元分别建立一同步任务, 将同步任务放入所述线程 池的任务队列中, 按照所述任务队列的次序, 依序对待同步网元执行日志同 步。
本发明实施例提供了一种网元日志同步方法和系统, 网管登录待同步网 元的网元 FTP服务器 ,并从所述网元 FTP服务器中获取所述网元的网元曰志, 执行网元日志同步, 仅通过 FTP服务器就完成了网元日志文件的同步, 降低 了网络的复杂度, 解决了现有网元日志文件同步过程通信复杂性高、 可靠性 低的问题。 附图概述
图 1为本发明的实施例一提供的一种网元日志同步方法的流程图; 图 2为图 1中步骤 104的具体流程图;
图 3为本发明的实施例二中处理同步网元日志总体流程图;
图 4为为本发明实施例中同步日志执行线程的业务流程图。 本发明的较佳实施方式
现有的网元日志文件同步过程中, 网管首先需要通过 SNMP给网元下发 同步日志文件命令, 网元响应命令时需要登录网管服务器通过 FTP上传曰志 文件, 每次交互均使用到两种通信方式, 提高通信复杂性, 使得通信可靠性 降低。
此外, 当网元 IP地址发生变化或者网元名称发生重复时, 以网元 IP地 址或网元名称作为日志文件命名前缀或者目录名称时会造成文件读写错误; 每次同步网元日志文件釆用全新同步获取所有日志文件, 当网元拥有众多数 量的日志文件时, 全新同步与解析文件非常浪费带宽及系统资源; 批量同步 时, 当网管下接网元数量众多时, 所有网元同时上传日志文件时会产生文件 上传风暴, 给网管性能带来冲击。
为了解决上述问题, 本发明的实施例提供了一种网元日志同步方法和系 统。 下文中将结合附图对本发明的实施例进行详细说明。 需要说明的是, 在 不冲突的情况下, 本申请中的实施例及实施例中的特征可以相互任意组合。
首先结合附图, 对本发明的实施例一进行说明。
本发明实施例提供了一种网元日志同步方法, 使用该方法完成网元日志 文件向网管同步的流程如图 1所示, 包括:
步骤 101、 网管在多网元批量进行网元日志同步时, 建立线程池; 本发明实施例中, 网管收到网元日志同步命令后, 若为多网元批量同步 则建立线程池, 基于多线程机制来处理批量网元同步命令, 为每个网元建立 一个同步任务, 放入线程池任务队列中; 若为单个网元则开启新线程执行同 步任务。
本发明实施例中, 线程池最大线程数 N决定网管同时进行日志同步并处 理的网元数量, 避免所有网元同时上传文件时产生上传风暴, 故, 可根据当 前网络^载能力和网元日志同步的规模适当的确定 N值, 以使得在不影响网 络质量和正常业务的情况下, 高效稳定的完成网元日志同步。
步骤 102、 网管按照所述任务队列的次序, 依序对待同步网元执行曰志 同步; 判断 FTP服务器是否可用, 如果可用, 执行步骤 103; 如果不可用, 执行步骤 105;
步骤 103、 登录待同步网元的网元 FTP服务器;
本步骤中, 每个同步线程中, 网管直接登录网元 FTP服务器; 网元亦已 开启了网元 FTP服务器并且存放了网元日志文件。 网管由网元 FTP服务器中 获取网元当前所有日志文件的文件名称, 然后釆用增量方式获取日志文件。
步骤 104、 从所述网元 FTP服务器中获取所述网元的网元日志文件, 执 行网元日志同步;
本步骤可以获取当前网元 FTP服务器中的网元日志文件; 优选的, 还可 部分获取, 以进一步降低网络压力, 具体如图 2所示, 包括:
步骤 1041、确定所述网元 FTP服务器中较上一次网元日志同步时新增的 网元日志文件;
具体的, 将上一次网元日志同步时同步的网元日志名与当前所述网元 FTP服务器中的网元日志名进行对比, 上一次网元日志同步时同步的网元日 志名中所没有的网元日志文件即为所述网元 FTP服务器中新增的网元日志文 件。
步骤 1042、 获取所述新增的网元日志文件;
本步骤中,网管指示网元将步骤 1041确定的新增的网元日志文件上传至 网管 FTP服务器, 具体的, 通过 FTP GET操作获取文件到网管 FTP服务器 上指定的统一目录下,文件名称釆用网元 ID号作为前缀,完成网元日志同步。 所述网元 ID 号指在网管系统中新建网元时分配给该网元区分与其它网元的 唯一标识, 如 "mw.nr8250=12" 、 "mw.nr8250=80" 等, ID号中等号后的数 值由 1向上递增且不重复。
在网元日志同步完成后, 网管保存同步得到的所有网元日志文件名称, 具体方法为: 在网管数据库中维护一张网元日志文件名称表, 包含网元 ID号 与日志文件名称两个字段, 记录所有网元上的日志文件名称。
对于步骤 104, 如果获取成功, 同步结束, 若网元 FTP服务器损坏或不 可用导致获取日志文件失败, 则需要依赖其他手段, 如 SNMP, 来完成网元 曰志同步, 进入步骤 105。
步骤 105、 在所述网元 FTP服务器不可用时, 网管依据 SNMP向所述待 同步网元发送命令, 指示所述待同步网元回复所述网元 FTP上全部网元日志 文件的名称; 本步骤中, 通过 SNMP向网元下发同步日志命令, 等待网元反馈当前所 有日志文件名称。
步骤 106、 网元接收所述网管发送的指示回复所述本地的网元 FTP服务 器上全部网元日志文件名称的命令, 向所述网管上报所述本地的网元 FTP服 务器上全部网元日志文件的名称;
步骤 107、 网管将上一次网元日志同步时同步的网元日志名与当前所述 网元 FTP服务器中的网元日志名进行对比, 上一次网元日志同步时同步的网 元曰志名中所没有的网元日志文件即为所述网元 FTP服务器中新增的网元曰 志文件;
步骤 108、 网管向所述网元发送 SNMP指示, 指示所述网元 FTP服务器 返回新增的网元日志文件; 本步骤中,将新增的网元日志文件名称、 网元 ID号、 网管 FTP参数(IP、 用户名、 密码、 目录)通过 SNMP下发至网元, 以指定网元上传网管所指定 的网元日志文件。
步骤 109、 网元接收所述网管发送的上传网元日志文件的 SNMP指示, 向所述网管上传其在该 SNMP指示中指定的网元日志文件;
本步骤中, 网元响应命令, 登录网管 FTP服务器, 将新增的文件上传至 指定目录, 文件名称以网元 ID号作为前缀。
优选的, 网元在上传完所有的日志文件后, 向网管发送 trap消息 4艮告传 送结果, trap消息中包含本次成功传送文件名称。
下面结合附图, 对本发明的实施二进行详细说明。
为了解决现有网元日志文件同步过程通信复杂性高、 可靠性低的问题, 本发明实施例提供了一种网元日志同步方法。
图 3为本发明处理同步网元日志总体流程, 包括以下步骤:
步骤 301、 用户向网管发起日志同步命令或者定时器任务自动发起, 网 管接受命令并开始处理; 步骤 302、 判断是多网元批量同步还是单网元同步; 多网元批量同步, 执行步骤 303 , 否则, 执行步骤 306;
步骤 303、 多网元批量同步操作: 在主线程中建立一个线程池, 并且为 每一个网元建立一个同步任务, 将任务放入线程池的任务队列中等待执行。 线程池拥有的线程数决定进行同时处理同步任务的网元数量;
步骤 304、 主线程休眠 100ms, 等待所有同步任务执行完毕;
步骤 305、 主线程完成休眠, 判断所有的同步任务是否已经执行完毕, 如果完毕则结束本次同步操作, 否则返回步骤 304, 继续休眠等待;
步骤 306、 单网元同步操作: 主线程中启动新线程执行同步任务, 并等 待;
步骤 307、 同步线程执行完毕, 返回主线程, 结束本次同步操作。
在网元日志同步任务的顺序确定后, 即可执行网元日志同步。 图 4为本 发明实施例中同步日志执行线程的业务流程, 包括以下步骤:
步骤 401、 登录网元 FTP服务器。
步骤 402、 判断网元 FTP服务器是否可以正常使用, 若正常则进入步骤
403 , 登录网元 FTP直接获取文件的分支流程, 若不可用则釆用 SNMP下发 同步命令、 网元上传日志文件至网管 FTP服务器的分支流程, 转入步骤 406。
步骤 403、 网元 FTP可用, 获取网元当前所有日志文件名称。
步骤 404、 从网元日志文件名称数据库表中读取该网元上次同步时所有 的日志文件名称并进行校对, 得到新增的文件名称。
步骤 405、利用 get操作从网元 FTP服务器上获取新增的日志文件,存放 在网管一个统一的路径下, 文件命名以网元 ID号作为前缀,保证文件名绝对 唯一。
在网元 FTP服务器不可用的情况下,仍需要通过 SNMP来完成网元日志 同步, 具体流程如下:
步骤 406、在网元 FTP不可用的情况下:通过 SNMP命令下发同步命令, 要求网元在接受命令后通过 SNMP反馈当前所有日志文件名称。 步骤 407、 判断网元是否反馈了当前所有日志文件名称, 如果反馈成功, 执行步骤 408, 如果反馈失败则结束同步。
步骤 408、 从网元日志文件名称数据库表中读取该网元上次同步时所有 的日志文件名称, 与网元反馈回来的文件名称进行校对, 得到新增的文件名 称。
步骤 409、 通过 SNMP将新增的网元日志文件名称、 网管给网元分配的 网元 ID号、 网管 FTP服务器参数(IP地址、 用户名、 密码、 文件存放路径) 下发给网元。
步骤 410、 网元登录网管 FTP服务器, 将新增的日志文件上传至指定的 存放目录下, 文件命名以网元 ID号作为前缀。
步骤 411、 网管判断网元日志文件是否上传成功; 如果成功, 执行步骤 412, 否则结束同步。
网元将所有日志文件上传至网管服务器后, 给网管上报一个文件传送结 果的 trap消息, trap消息中包含本次成功传送文件名称。
步骤 412、 将本次获取的网元日志文件名称更新到数据库日志文件名称 表中。
步骤 413、 解析获取的日志文件, 将日志内容入库; 解析完毕后删除文 件记录, 结束同步线程。
下面, 对本发明的实施例三进行说明。
本发明实施例提供了网元日志同步系统, 该系统包括网管和该网管下至 少一个网元;
所述网管, 用于登录待同步网元的网元 FTP服务器, 并从所述网元 FTP 服务器中获取所述网元的网元日志文件, 执行网元日志同步;
所述网元, 用于接受网管登录本地的网元 FTP服务器, 并根据所述网管 的指示, 向所述网管同步所述本地网元 FTP服务器上的网元日志文件。
优选的,所述网管,还用于在所述网元 FTP服务器不可用时,依据 SNMP 向所述待同步网元发送命令 , 指示所述待同步网元回复所述网元 FTP上全部 网元日志文件的名称, 将上一次网元日志同步时同步的网元日志名与当前所 述网元 FTP服务器中的网元日志名进行对比, 上一次网元日志同步时同步的 网元日志名中所没有的网元日志文件即为所述网元 FTP服务器中新增的网元 日志文件, 并向所述网元发送 SNMP指示, 指示所述网元 FTP服务器返回新 增的网元日志文件;
对应的, 所述网元, 还用于接收所述网管发送的指示回复所述本地的网 元 FTP服务器上全部网元日志文件名称的命令, 向所述网管上报所述本地的 网元 FTP服务器上全部网元日志文件的名称, 并在其后接收所述网管发送的 上传网元日志文件的 SNMP指示, 向所述网管上传其在该 SNMP指示中指定 的网元日志文件。
优选的, 所述网管, 还用于在多网元批量进行网元日志同步时, 建立线 程池, 为各个待同步网元分别建立一同步任务, 将同步任务放入所述线程池 的任务队列中, 按照所述任务队列的次序,依序对待同步网元执行日志同步。
本发明的实施例提供的网元日志同步系统, 能够与本发明的实施例所提 供的网元日志同步方法相结合, 网管登录待同步网元的网元 FTP服务器, 并 从所述网元 FTP服务器中获取所述网元的网元日志, 执行网元日志同步, 仅 通过 FTP服务器就完成了网元日志文件的同步, 降低了网络的复杂度, 解决 了现有网元日志文件同步过程通信复杂性高、 可靠性低的问题。
本发明实施例中, 向网管同步网元日志文件的操作以增量同步文件方式 进行, 大大节省了同步日志文件所需要的网络流量, 同时也节省因解析曰志 文件带来的系统开销; 而釆用本发明基于线程池的多线程机制来批量处理同 步网元日志命令, 则实现了同时处理固定数量的网元, 避免了文件上传风暴 造成对系统的冲击。
此外, 网管优先直接登录网元 FTP获取日志文件,避免 SNMP与 FTP配 合使用提高通信复杂度和降低可靠性, 后者用于保证网管在网元 FTP服务器 不可用的情况下获取到日志文件; 将网元 ID号作为日志文件名前缀, 可以绝 对保证文件名称的唯一性。 本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计 算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中, 所述计算机程序在相应的硬件平台上(如系统、 设备、 装置、 器件等)执行, 在执行时, 包括方法实施例的步骤之一或其组合。
可选地, 上述实施例的全部或部分步骤也可以使用集成电路来实现, 这 些步骤可以被分别制作成一个个集成电路模块, 或者将它们中的多个模块或 步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬 件和软件结合。
上述实施例中的各装置 /功能模块 /功能单元可以釆用通用的计算装置来 实现, 它们可以集中在单个的计算装置上, 也可以分布在多个计算装置所组 成的网络上。
上述实施例中的各装置 /功能模块 /功能单元以软件功能模块的形式实现 并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。 上述提到的计算机可读取存储介质可以是只读存储器, 磁盘或光盘等。
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想 到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范 围应以权利要求所述的保护范围为准。
工业实用性 本发明实施例提供了一种网元日志同步方法和系统, 网管登录待同步网 元的网元 FTP服务器 ,并从所述网元 FTP服务器中获取所述网元的网元曰志, 执行网元日志同步, 仅通过 FTP服务器就完成了网元日志文件的同步, 降低 了网络的复杂度, 解决了现有网元日志文件同步过程通信复杂性高、 可靠性 低的问题。

Claims

权 利 要 求 书
1、 一种网元日志同步方法, 包括:
登录待同步网元的网元文件传输协议(FTP )服务器;
从所述网元 FTP服务器中获取所述网元的网元日志文件, 执行网元曰志 同步。
2、 根据权利要求 1 所述的网元日志同步方法, 其中, 从所述网元 FTP 服务器中获取所述网元的网元日志文件, 执行网元日志同步的步骤包括: 确定所述网元 FTP服务器中较上一次网元日志同步时新增的网元日志文 件;
获取所述新增的网元日志文件。
3、 根据权利要求 2所述的网元日志同步方法, 其中, 所述确定所述网元 FTP服务器中较上一次网元日志同步时新增的网元日志文件为:
将上一次网元日志同步时同步的网元日志名与当前所述网元 FTP服务器 中的网元日志名进行对比, 上一次网元日志同步时同步的网元日志名中所没 有的网元日志文件即为所述网元 FTP服务器中新增的网元日志文件。
4、 根据权利要求 1所述的网元日志同步方法, 其中, 所述登录待同步网 元的网元 FTP服务器的步骤之前, 还包括:
在多网元批量进行网元日志同步时, 建立线程池;
为各个待同步网元分别建立一同步任务, 将同步任务放入所述线程池的 任务队列中;
按照所述任务队列的次序, 依序对待同步网元执行日志同步。
5、 根据权利要求 1所述的网元日志同步方法, 其中, 该方法还包括: 在所述网元 FTP服务器不可用时, 依据简单网络管理协议(SNMP ) 向 所述待同步网元发送命令, 指示所述待同步网元回复所述网元 FTP上全部网 元日志文件的名称; 将上一次网元日志同步时同步的网元日志名与当前所述网元 FTP服务器 中的网元日志名进行对比, 上一次网元日志同步时同步的网元日志名中所没 有的网元日志文件即为所述网元 FTP服务器中新增的网元日志文件;
向所述网元发送 SNMP指示,指示所述网元 FTP服务器返回新增的网元 日志文件。
6、 根据权利要求 1 所述的网元日志同步方法, 其中, 所述从所述网元 FTP服务器中获取所述网元的网元日志文件,执行网元日志同步的步骤之后, 还包括: 将所述网元的标识号 (ID )作为该网元对应的网元日志文件名称前缀, 创建网元日志文件名称数据库表存储已同步的网元日志文件名称。
7、 一种网元日志同步方法, 包括:
接受网管登录本地的网元 FTP服务器;
根据所述网管的指示, 向所述网管同步所述本地网元 FTP服务器上的网 元日志文件。
8、 根据权利要求 7所述的网元日志同步方法, 其中, 该方法还包括: 接收所述网管发送的指示回复所述本地的网元 FTP服务器上全部网元日 志文件名称的命令, 向所述网管上报所述本地的网元 FTP服务器上全部网元 日志文件的名称;
接收所述网管发送的上传网元日志文件的 SNMP指示, 向所述网管上传 其在该 SNMP指示中指定的网元日志文件。
9、 一种网元日志同步系统, 该系统包括网管和该网管下至少一个网元; 所述网管, 其设置为: 登录待同步网元的网元 FTP服务器, 并从所述网 元 FTP服务器中获取所述网元的网元日志文件, 执行网元日志同步;
所述网元, 其设置为: 接受网管登录本地的网元 FTP服务器, 并根据所 述网管的指示,向所述网管同步所述本地网元 FTP服务器上的网元日志文件。
10、 根据权利要求 9所述的网元日志同步系统, 其中,
所述网管还设置为: 在所述网元 FTP服务器不可用时, 依据 SNMP向所 述待同步网元发送命令, 指示所述待同步网元回复所述网元 FTP上全部网元 日志文件的名称, 将上一次网元日志同步时同步的网元日志名与当前所述网 元 FTP服务器中的网元日志名进行对比, 上一次网元日志同步时同步的网元 曰志名中所没有的网元日志文件即为所述网元 FTP服务器中新增的网元曰志 文件, 并向所述网元发送 SNMP指示, 指示所述网元 FTP服务器返回新增的 网元日志文件;
所述网元还设置为: 接收所述网管发送的指示回复所述本地的网元 FTP 服务器上全部网元日志文件名称的命令, 向所述网管上报所述本地的网元 FTP服务器上全部网元日志文件的名称, 并在其后接收所述网管发送的上传 网元日志文件的 SNMP指示, 向所述网管上传其在该 SNMP指示中指定的网 元日志文件。
11、 根据权利要求 9所述的网元日志同步系统, 其中,
所述网管还设置为: 在多网元批量进行网元日志同步时, 建立线程池, 为各个待同步网元分别建立一同步任务, 将同步任务放入所述线程池的任务 队列中, 按照所述任务队列的次序, 依序对待同步网元执行日志同步。
PCT/CN2012/072354 2011-06-30 2012-03-15 网元日志同步方法和系统 WO2013000294A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2011101811880A CN102855249A (zh) 2011-06-30 2011-06-30 网元日志同步方法和系统
CN201110181188.0 2011-06-30

Publications (1)

Publication Number Publication Date
WO2013000294A1 true WO2013000294A1 (zh) 2013-01-03

Family

ID=47401842

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/072354 WO2013000294A1 (zh) 2011-06-30 2012-03-15 网元日志同步方法和系统

Country Status (2)

Country Link
CN (1) CN102855249A (zh)
WO (1) WO2013000294A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610996B (zh) * 2015-10-23 2022-03-11 北京奇虎科技有限公司 热词典切换方法和装置
CN109376136A (zh) * 2018-10-19 2019-02-22 郑州云海信息技术有限公司 一种分布式日志处理系统、网络设备及方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848759A (zh) * 2005-04-28 2006-10-18 华为技术有限公司 多网元日志文件上载方法
WO2009016369A1 (en) * 2007-07-31 2009-02-05 British Telecommunications Public Limited Company Communications network
CN101800764A (zh) * 2009-12-25 2010-08-11 无锡市美普索特电子科技有限公司 一种分布式多媒体下载系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855840A (zh) * 2005-04-26 2006-11-01 华为技术有限公司 一种网络管理器从网元设备获取日志信息的方法
CN101018148A (zh) * 2006-02-09 2007-08-15 中兴通讯股份有限公司 网络管理系统与网元管理系统之间数据的增量同步方法
EP2045961A1 (en) * 2007-10-03 2009-04-08 British Telecommunications Public Limited Company Communications network
CN102023899B (zh) * 2010-12-14 2014-11-05 中兴通讯股份有限公司 多线程数据同步方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848759A (zh) * 2005-04-28 2006-10-18 华为技术有限公司 多网元日志文件上载方法
WO2009016369A1 (en) * 2007-07-31 2009-02-05 British Telecommunications Public Limited Company Communications network
CN101800764A (zh) * 2009-12-25 2010-08-11 无锡市美普索特电子科技有限公司 一种分布式多媒体下载系统

Also Published As

Publication number Publication date
CN102855249A (zh) 2013-01-02

Similar Documents

Publication Publication Date Title
CN110086652B (zh) 一种针对5g核心网中服务网元的管理系统及其方法
CN104144098B (zh) 消息推送方法、系统及推送服务器设备
US20060274674A1 (en) Packet transmitting apparatus for setting configuration
CN108259215B (zh) 一种设备管理方法及装置
WO2013097719A1 (zh) 资源同步方法和装置
CN102739775A (zh) 物联网数据采集服务器集群的监控和管理方法
WO2010078748A1 (zh) 同步网管与网元的配置的方法和装置
EP3094047A1 (en) Method and device for automatically commissioning aisg remote electrical tilt antennas in batches
WO2011082581A1 (zh) 网管数据配置管理方法及系统
US20120278456A1 (en) Method and apparatus for data configuration
WO2018010616A1 (zh) 基于链路层的网络管理
CN103731507A (zh) 一种分布式数据存储设备处理数据的方法及装置
CN104219100A (zh) 一种信息采集方法和装置
CN109379239B (zh) 一种OpenStack环境中配置接入交换机的方法及装置
CN107872492B (zh) 一种在服务端支持多用户编辑数据对象的方法和装置
WO2020010906A1 (zh) 操作系统os批量安装方法、装置和网络设备
US20240097979A1 (en) Fabric availability and synchronization
CA2795782A1 (en) Cloud node management method, system and central server
US20210274020A1 (en) Communication method, client device, and server device
WO2013000294A1 (zh) 网元日志同步方法和系统
CN112468367A (zh) 一种数据采集与交互的方法、系统、设备及介质
CN104618474B (zh) 设备信息保存方法以及装置
CN105933973A (zh) 一种云接入控制器管理的接入点同步方法和系统
WO2016065925A1 (zh) 控制器替换方法及装置
CN116346834A (zh) 一种会话同步方法、装置、计算设备及计算机存储介质

Legal Events

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

Ref document number: 12805132

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12805132

Country of ref document: EP

Kind code of ref document: A1