Log Information Transmission Backup Method, System, Device and Storage Medium

The communication packets are generated by custom extended RAPS message protocol and sent to the backup neighbor device, which solves the problem of log information loss after the switch is faulty and powered down, and realizes effective backup and fault analysis of log information.

CN117118839BActive Publication Date: 2025-08-05SHENZHEN TEFA TYCO COMM TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311188869.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-08-05
Estimated Expiration
2043-09-15

AI Technical Summary

Technical Problem

When the switch equipment fails abnormally, the log information is lost, resulting in difficulty in troubleshooting operations and maintenance.

Method used

Through custom extended RAPS message protocol, communication message information is generated and sent to the backup neighbor device for storage, and the backup neighbor device is determined using the spanning tree list to realize the transmission and backup of log information.

Benefits of technology

In the event of a switch failure, log information can be obtained from the backup neighbor device for fault analysis, improving the fault processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117118839B_ABST
    Figure CN117118839B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, device and storage medium for log information transmission and backup, which relates to the field of communication technologies and includes: when a startup instruction of a target device is detected, obtaining a current spanning tree list, and based on the spanning tree list, determining a backup neighbor device corresponding to the target device; generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device; and sending the communication message information to the backup neighbor device for storage and backup. By determining the backup neighbor device corresponding to the target device based on the spanning tree list, the present invention can, after the log information is generated, send the log information to the backup neighbor device for storage, so that when the target device fails or for other reasons fails to save the original log information, the log information of the target device can be obtained from the backup neighbor device for fault analysis, thereby improving the efficiency of fault handling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and particularly to a method, a system, a device, and a storage medium for transmitting and backing up log information. Background Art

[0002] The logs recorded during the operation of a server are the first-hand materials for locating and resolving server failures, and play an important role in server fault location and the patrol inspection of operation and maintenance personnel. The location personnel can rely on the persistent logs stored in the server for analysis and location to find out the problem.

[0003] Currently, there are mainly two ways to save the log information of switch devices: one is that the log information is only saved in the cache chip, and the log information will be lost after the device is powered off and restarted; the other is that the log information is saved in both the cache chip and the power-off save chip (such as FLASH, EPROM, etc.) at the same time. After the device is powered off and restarted, the log information is still saved in the device. However, in this way, because the power-off save chip needs to be configured, the device cost will increase. However, for edge-layer Ethernet switches, due to high cost pressure, manufacturers generally do not configure the power-off save chip for log information in order to save costs. Therefore, when the switch device fails and powers off abnormally, the corresponding log information of the device will be lost. However, the lack of retention and recovery of log information brings great difficulties to subsequent operation and maintenance troubleshooting. Summary of the Invention

[0004] The present invention provides a method, a system, a device, and a storage medium for transmitting and backing up log information, aiming to solve the technical problem that when a switch device fails and powers off abnormally, the log information of the device will be lost, and the lack of retention and recovery of log information brings great difficulties to subsequent operation and maintenance troubleshooting.

[0005] The present invention provides a method for transmitting and backing up log information, including:

[0006] When a startup instruction of a target device is detected, obtain the current spanning tree list, and based on the spanning tree list, determine a backup neighbor device corresponding to the target device;

[0007] Generate communication packet information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol obtained by customizing and modifying the fields in the RAPS packet protocol in advance;

[0008] Send the communication packet information to the backup neighbor device for saving and backing up.

[0009] A method for transmitting and backing up log information provided by the present invention customizes the message indicator corresponding to the request status field in the preset communication protocol, where the message indicator is used to indicate the identifier of the log information of the transmission target device;

[0010] Customize the format information of the format field in the preset communication protocol, where the format information includes log type, log length, and log information.

[0011] A method for transmitting and backing up log information provided by the present invention, generating communication message information corresponding to the preset communication protocol based on the log information generated during the operation of the target device, includes:

[0012] Determine the target log type and target log length of the log information;

[0013] Generate communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length, and the preset identifier.

[0014] A method for transmitting and backing up log information provided by the present invention, determining the backup neighbor device corresponding to the target device based on the spanning tree list, includes:

[0015] Determine the neighbor device connected to the target device in the spanning tree list, where the spanning tree list is constructed based on the spanning tree protocol.

[0016] If there is one neighbor device, use the neighbor device as the backup neighbor device;

[0017] If there are multiple neighbor devices, calculate the distance between each neighbor device and the root node in the spanning tree list, and use the neighbor device with the smallest distance as the backup neighbor device.

[0018] A method for transmitting and backing up log information provided by the present invention, after sending the communication message information to the backup neighbor device for saving and backing up, further includes:

[0019] Monitor the node status corresponding to the spanning tree list;

[0020] If the node status of the spanning tree list changes, according to the new spanning tree list, return to execute the step of determining the backup neighbor device corresponding to the target device, so as to send the new log information to the newly determined backup neighbor device for saving and backing up.

[0021] A method for transmitting and backing up log information provided by the present invention, after sending the communication message information to the backup neighbor device for saving and backing up, further includes:

[0022] When a failure of the target device is detected, a failure recovery instruction is generated;

[0023] The failure recovery signaling is sent to the backup neighbor device to obtain the log information of the target device stored in the backup neighbor device;

[0024] Based on the log information of the target device, a failure analysis is performed on the target device.

[0025] According to a log information transmission backup method provided by the present invention, the log type includes at least one of system operation logs, operation logs, device logs, and alarm logs.

[0026] The present invention also provides a log information transmission backup system, including:

[0027] A determination module, configured to obtain a current spanning tree list when a startup instruction of a target device is detected, and determine a backup neighbor device corresponding to the target device based on the spanning tree list;

[0028] A generation module, configured to generate communication packet information corresponding to a preset communication protocol based on log information generated during the operation of the target device, where the preset communication protocol is a communication protocol obtained by customizing and modifying fields in the RAPS packet protocol in advance;

[0029] A backup module, configured to send the communication packet information to a backup neighbor device for storage and backup.

[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, the log information transmission backup method described in any one of the above is implemented.

[0031] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the log information transmission backup method described in any one of the above is implemented.

[0032] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the log information transmission backup method described in any one of the above is implemented.

[0033] The log information transmission and backup method, system, device and storage medium provided by the present invention determine the backup neighbor device corresponding to the target device based on the spanning tree list, and generate communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device. The preset communication protocol is a communication protocol obtained by customizing and modifying the fields in the RAPS message protocol in advance. The communication message information is sent to the backup neighbor device for storage and backup, so that when the target device fails or fails to save the original log information due to other reasons, the log information of the target device can be obtained from the backup neighbor device for fault analysis, thereby improving the efficiency of fault handling. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art one by one. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0035] Figure 1 is a schematic flowchart of the log information transmission and backup method provided by the present invention;

[0036] Figure 2 is a schematic implementation flowchart of the log information transmission and backup method provided by an embodiment of the present invention;

[0037] Figure 3 is a schematic structural diagram of the log information transmission and backup system provided by the present invention;

[0038] Figure 4 is a schematic structural diagram of the electronic device provided by the present invention. EMBODIMENTS

[0039] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.

[0040] The terms used in one or more embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present invention. The singular forms "a", "the", and "said" used in one or more embodiments of the present invention are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0041] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present invention to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while".

[0042] Figure 1 It is a schematic flowchart of the log information transmission backup method provided by the present invention. As Figure 1 shown, the log information transmission backup method includes:

[0043] Step S11, when a startup instruction of the target device is detected, obtain the current spanning tree list, and based on the spanning tree list, determine the backup neighbor device corresponding to the target device;

[0044] It should be noted that the target device represents an Ethernet switch device. The spanning tree list is constructed based on the Spanning Tree Protocol (STP). Optionally, in a switching network with a physical loop, each switch device runs the spanning tree protocol to automatically generate a loop-free logical topology. This loop-free logical topology is also called the STP spanning tree. Among them, the nodes of the spanning tree are certain specific switches, and the branches are certain specific links. A spanning tree contains a unique root node. The spanning tree list in this embodiment can be formed by the nodes in the STP spanning tree.

[0045] Specifically, when a startup instruction of the target device is monitored, obtain the current spanning tree list formed by the communication of each switch device. Further, in the spanning tree list, select the adjacent device directly communicatively connected to the target device as the backup neighbor device. When there are multiple directly communicatively connected adjacent devices, the neighbor device with the smallest distance from the root node in the spanning tree list can be used as the backup neighbor device, or an adjacent device can be randomly selected as the backup neighbor device.

[0046] Step S12: Generate communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol obtained by customizing and modifying fields in the RAPS message protocol in advance.

[0047] It should be noted that ERPS (Ethernet Ring Protection Switching) can prevent broadcast storms caused by data loops when the Ethernet ring is complete, and can quickly restore communication between nodes on the Ethernet ring when a link on the Ethernet ring is disconnected. There is only one type of message in the ERPS protocol, namely the RAPSS PDU protocol message. The RAPSS PDU message contains ERPS ring information and is transmitted on the ERPS ring to achieve the intercommunication of device port information.

[0048] Furthermore, it should be noted that in the RAPSS PDU message, there is a TLV field. The TLV field is used to describe the information to be loaded in the message. Among them, the End TLV is a fixed value of 0x00, and the TLV field represents a message packet that meets the format of "message type - data length - data content". The RAPSS PDU message also includes a Request / State field, which is used to identify whether the information is request information or current status information, including: 1101: FS (Forced Switch) RAPSS; 1110: Event message; 1011: SF (Signal Failed) RAPSS; 0111: MS (Manual Switch) RAPSS; 0000: NR (No Request) RAPSS; others: reserved fields.

[0049] In the embodiments of the present invention, by customizing and modifying the relevant information in the Request / State field and the TLV field of the RAPS PDU, the log information is made to generate the communication message information corresponding to the preset communication protocol. More specifically, the log information can be sent according to a preset time period, for example, once every 10 seconds. In other embodiments, the log information can also be sent in real time. Specifically, first, determine the target log type and the target log length of the log information. Optionally, the target log type includes types of logs such as system operation logs, operation logs, device logs, and alarm logs. Further, in order to facilitate backup, the neighbor device can identify that the log information is sent by the target device, and a preset identifier can be set in advance. The preset identifier is used to indicate the identifier for transmitting the log information of the target device. Then, based on the log information, the target log type, the target log length, and the preset identifier, generate the communication message information corresponding to the preset communication protocol, and send the communication message information to the backup neighbor device for backup storage.

[0050] In addition, in other scenarios, the modified RAPS message protocol can also be used to transmit other communication information, such as alarm information, etc.

[0051] It should be noted that the log information is automatically generated by the target device during operation. It can contain various information about device status, events, and operations. The purpose of generating logs is to help administrators and developers perform troubleshooting, performance monitoring, security auditing, and other tasks. There are various ways to generate log information.

[0052] Step S13: Send the communication message information to the backup neighbor device for backup storage.

[0053] Specifically, send the communication message information to the backup neighbor device, so that the backup neighbor device can parse and obtain the log information for backup storage.

[0054] An embodiment of the present invention provides a method for transmitting and backing up log information, including: when a startup instruction of a target device is detected, obtaining the current spanning tree list, and based on the spanning tree list, determining a backup neighbor device corresponding to the target device; generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol obtained by customizing and modifying fields in the RAPS message protocol in advance; and sending the communication message information to the backup neighbor device for storage and backup. By determining the backup neighbor device corresponding to the target device based on the spanning tree list, after the log information is generated, the log information can be sent to the backup neighbor device for storage, so that when the target device fails or for other reasons fails to save the original log information, the log information of the target device can be obtained from the backup neighbor device for fault analysis, thereby improving the efficiency of fault handling.

[0055] In an embodiment of the present invention, the generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device includes:

[0056] Determining the target log type and target log length of the log information; generating communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length, and a preset identifier.

[0057] Before generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, it further includes:

[0058] Customizing the message indicator corresponding to the request status field in the preset communication protocol, where the message indicator is used to indicate the identifier for transmitting the log information of the target device; customizing the format information of the format field in the preset communication protocol, where the format information includes the log type, log length, and log information.

[0059] Specifically, before the log information is transmitted and backed up, in this embodiment, the message indicator corresponding to the request status field in the preset communication protocol is customarily set, where the message indicator is an identifier used to indicate the log information of the transmission target device. Optionally, the request status field represents the Request / State field. For example, the character 0010 is selected as the message indicator for log information transmission from the reserved fields in the Request / State field. Since the inter-symbol distance (BIT difference) between 0010 and the key characters (1101, 1011, 0111) defined by the ITU G.8032 standard is greater than or equal to 2 bits, it can, to a certain extent, prevent the log message from being recognized as a loop status message due to line no code, thus affecting the loop switching problem.

[0060] In addition, the format information of the format field in the preset communication protocol is also customarily set, where the format field represents the TLV field in the RAPSS PDU message, and the TLV field represents a message packet that satisfies the format of "message type - data length - data content". The format information includes the log type, log length, and log information. The log type includes types such as system operation logs, operation logs, device logs, and alarm logs. For example, the type of log information is defined in 4 types: 0x8001 represents device operation logs; 0x8002 represents system operation logs; 0x8003 represents system operation logs; 0x8004 represents system alarm logs.

[0061] More specifically, first, determine the target log type and target log length corresponding to the current log information. Further, based on the log information, the target log type, the target log length, and a preset identifier, generate communication message information corresponding to the preset communication protocol, where the Request / State field in the communication message information contains the preset identifier, and the preset identifier is the same as the above message indicator. The TLV field in the communication message information contains the log information, the target log type, and the target log length. In addition, the communication message information may also include information such as the device identifier of the target device, so as to send the communication message information to the backup neighbor device for storage and backup. For example, Request / State "0010" represents a log message for transmitting and backing up log information to the backup neighbor device; TLV: ALM TLV (t = 0x8004, l = 0x12), TLV: Port 1 signal loss. Where t = 0x8004 indicates that the type of log information is a system alarm log, l = 0x12 indicates that the length of the log information is 18 characters, and the specific alarm information of the log information is Port 1 signal loss.

[0062] In an embodiment of the present invention, by customizing the request status field and format field in the preset communication protocol, and then generating communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length, and the preset identifier, it is realized to define an identifier indicating the transmission of log information by using the reserved identifier in the Request / State field of the R-APS Specific Information message of the ERPS protocol, redefine the type field of the TLV message to indicate the log type, so as to use the TLV message to transmit the log information, and further realize the transmission of the log information of the switch between adjacent switches.

[0063] In an embodiment of the present invention, after sending the communication message information to the backup neighbor device for storage and backup, it further includes:

[0064] When it is detected that a target device fails, a fault recovery instruction is generated; the fault recovery signaling is sent to the backup neighbor device to obtain the log information of the target device stored by the backup neighbor device; based on the log information of the target device, a fault analysis of the target device is performed.

[0065] Specifically, after sending the communication message information to the backup neighbor device for storage and backup, the log information of the target device stored by the backup neighbor device can be queried. Thus, when it is detected that the target device fails, a fault recovery instruction can be generated, and then the fault recovery signaling is sent to the backup neighbor device to query and obtain the log information of the target device stored by the backup neighbor device. Further, based on the log information of the target device, a fault analysis of the target device is performed, so as to improve the efficiency of fault repair.

[0066] In an embodiment of the present invention, when the target device fails, since the backup neighbor device also stores the log information of the original data, the target device can be fault-analyzed according to the log information stored by the backup neighbor device, so as to improve the efficiency of fault repair.

[0067] In an embodiment of the present invention, the determining the backup neighbor device corresponding to the target device based on the spanning tree list includes:

[0068] Determine the neighbor device connected to the target device in the spanning tree list, where the spanning tree list is constructed based on the spanning tree protocol. If there is one neighbor device, use the neighbor device as the backup neighbor device; if there are multiple neighbor devices, calculate the distance between each neighbor device and the root node in the spanning tree list, and use the neighbor device with the smallest distance as the backup neighbor device.

[0069] It should be noted that the generation process of the STP tree is mainly divided into the following four steps: electing the root bridge as the root of the entire network; determining the root port, which is the optimal port for connecting the non-root bridge to the root bridge; determining the designated port, which is the optimal port for connecting each link to the root bridge; and blocking the alternate port (AP) to form a loop-free network. Among them, the root bridge is the root node of the STP tree. To generate an STP tree, a root bridge needs to be determined first. The root bridge is the logical center of the entire switching network, but not necessarily the physical center. When the network topology changes, the root bridge may also change. Optionally, the main steps for electing the root bridge between switches are as follows: The principle for electing the root bridge is to compare the bridge ID (Bridge lD), and the one with a smaller value is preferred. The bridge ID can be understood as the identity flag of the switch, with a total of 8B, consisting of a 16-bit bridge priority and a 48-bit bridge MAC address. Among them, the priority is configurable, and the default value is 32768 (the value range is 0 to 65535). In addition, since the MAC address of the bridge is globally unique, the bridge ID is also globally unique.

[0070] Specifically, determine the neighbor device connected to the target device in the spanning tree list. Further, if there is only one neighbor device for the target device, directly set the neighbor device as the backup neighbor device. Additionally, if there are multiple neighbor devices for the target device, calculate the distance between each neighbor device and the root node in the spanning tree list, and then use the neighbor device with the smallest distance as the backup neighbor device.

[0071] In an embodiment of the present invention, by selecting the backup neighbor device of the target device from the current spanning tree list, the log information of the target device can be transmitted and backed up to the backup neighbor device. Thus, when the target device fails or fails to save the original log information due to other reasons, the log information of the target device can be obtained from the backup neighbor device for fault analysis, thereby improving the efficiency of fault handling.

[0072] In an embodiment of the present invention, after sending the communication message information to the backup neighbor device for backup storage, the following steps are further included:

[0073] Monitor the node status corresponding to the spanning tree list; if the node status of the spanning tree list changes, then according to the new spanning tree list, return to execute the step of determining the backup neighbor device corresponding to the target device to send the new log information to the newly determined backup neighbor device for backup storage.

[0074] Specifically, before each log information transmission, it is necessary to monitor the node status corresponding to the spanning tree list, that is, to monitor whether there are new or reduced nodes in the spanning tree list. If the node status of the spanning tree list changes, a new spanning tree list needs to be re-determined. Then, according to the new spanning tree list, the step of determining the backup neighbor device corresponding to the target device is returned for execution, so as to send the subsequent newly added node information to the re-determined backup neighbor device for storage and backup. Additionally, if the node status of the spanning tree list does not change, the subsequent newly added node information is still sent to the backup neighbor device determined last time for storage and backup.

[0075] In the embodiment of the present invention, before each log information transmission, it is monitored whether the spanning tree list changes. If it changes, a new spanning tree list needs to be re-determined, so as to send the subsequent newly added node information to the re-determined backup neighbor device for storage and backup, improving the security of log information transmission and backup.

[0076] Refer to Figure 2 , Figure 2 FIG. is a schematic diagram of the implementation process of the log information transmission and backup method provided by an embodiment of the present invention. Specifically: when the target device is started, the current spanning tree list is queried to determine the neighbor devices directly communicatively connected to the target device. Then, if there is only one neighbor device, the neighbor device is used as the backup neighbor device; if there are multiple neighbor devices, the neighbor device with the smallest distance from the root node in the spanning tree list is directly used as the backup neighbor device. Then, the log information of the target device is sent to the backup neighbor device for storage and backup. Further, before each log information transmission, it is necessary to monitor the node status corresponding to the spanning tree list. If there is no change, the subsequent newly added node information is still sent to the backup neighbor device determined last time for storage and backup. If there is a change, a new spanning tree list needs to be re-determined. Then, according to the new spanning tree list, the step of determining the backup neighbor device corresponding to the target device is returned for execution, so as to send the subsequent newly added node information to the re-determined backup neighbor device for storage and backup. Furthermore, when it is detected that the target device fails, the log information of the target device stored in the backup neighbor device is obtained, so that based on the log information, a fault analysis of the target device can be performed. Thus, when the target device fails or fails to save the original log information due to other reasons, the log information of the target device can be obtained from the backup neighbor device for fault analysis, thereby improving the efficiency of fault handling.

[0077] The log information transmission and backup system provided by the present invention will be described below. The log information transmission and backup system described below can be correspondingly referred to the log information transmission and backup method described above.

[0078] Figure 3 It is a schematic structural diagram of the log information transmission and backup system provided by the present invention. As Figure 3 shown, a log information transmission and backup system according to an embodiment of the present invention includes:

[0079] A determination module 21, configured to obtain a current spanning tree list when detecting a start instruction of a target device, and determine a backup neighbor device corresponding to the target device based on the spanning tree list;

[0080] A generation module 22, configured to generate communication message information corresponding to a preset communication protocol based on log information generated during the operation of the target device, wherein the preset communication protocol is a communication protocol obtained by customizing and modifying fields in the RAPS message protocol in advance;

[0081] A backup module 23, configured to send the communication message information to a backup neighbor device for storage and backup.

[0082] The log information transmission and backup system further includes:

[0083] Determine the target log type and target log length of the log information;

[0084] Generate the communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length, and a preset identifier.

[0085] The log information transmission and backup system further includes:

[0086] Customize and set a message indicator corresponding to a request status field in the preset communication protocol, wherein the message indicator is an identifier used to indicate the log information of the transmission target device;

[0087] Customize and set format information of a format field in the preset communication protocol, wherein the format information includes a log type, a log length, and log information.

[0088] The determination module 21 is further configured to:

[0089] Determine a neighbor device connected to the target device in the spanning tree list, wherein the spanning tree list is constructed based on the spanning tree protocol.

[0090] If there is one neighbor device, use the neighbor device as the backup neighbor device;

[0091] If there are multiple neighbor devices, calculate the distance between each neighbor device and the root node in the spanning tree list, and use the neighbor device with the minimum distance as the backup neighbor device.

[0092] The log information transmission and backup system further includes:

[0093] After sending the communication message information to the backup neighbor device for storage and backup, it further includes:

[0094] Monitor the node status corresponding to the spanning tree list;

[0095] If the node status of the spanning tree list changes, then according to the new spanning tree list, return to execute the step of determining the backup neighbor device corresponding to the target device, so as to send the new log information to the re-determined backup neighbor device for storage and backup.

[0096] The log information transmission and backup system further includes:

[0097] When it is detected that the target device fails, generate a fault recovery instruction;

[0098] Send the fault recovery signaling to the backup neighbor device to obtain the log information of the target device stored in the backup neighbor device;

[0099] Based on the log information of the target device, perform a fault analysis on the target device.

[0100] The log information transmission and backup system further includes:

[0101] The log type includes at least one of system operation logs, operation logs, device logs, and alarm logs.

[0102] It should be noted here that the above system provided by the embodiments of the present invention can implement all the method steps implemented by the above method embodiments and can achieve the same technical effects. Therefore, the same parts and beneficial effects as those in the method embodiments will not be specifically described in this embodiment.

[0103] Figure 4 It is a schematic structural diagram of an electronic device provided by the present invention, as Figure 4As shown, the electronic device may include: a processor 310, a memory 320, a communications interface 330, and a communication bus 340. Among them, the processor 310, the memory 320, and the communications interface 330 complete their mutual communication through the communication bus 340. The processor 310 can call the logical instructions in the memory 320 to execute the log information transmission backup method, which includes: when detecting a startup instruction of a target device, obtaining the current spanning tree list, and based on the spanning tree list, determining the backup neighbor device corresponding to the target device; generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol that is pre-customized to extend and modify the fields in the RAPS message protocol; and sending the communication message information to the backup neighbor device for storage backup.

[0104] In addition, when the logical instructions in the above-mentioned memory 320 are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0105] On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to execute the log information transmission backup method provided by the above-mentioned various methods. The method includes: when detecting a startup instruction of a target device, obtaining the current spanning tree list, and based on the spanning tree list, determining the backup neighbor device corresponding to the target device; generating communication message information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol that is pre-customized to extend and modify the fields in the RAPS message protocol; and sending the communication message information to the backup neighbor device for storage backup.

[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the log information transmission and backup method provided by each of the above methods. The method includes: when a start instruction of a target device is detected, obtaining the current spanning tree list, and based on the spanning tree list, determining a backup neighbor device corresponding to the target device; generating communication packet information corresponding to a preset communication protocol based on the log information generated during the operation of the target device, where the preset communication protocol is a communication protocol obtained by customizing and modifying fields in the RAPS packet protocol in advance; and sending the communication packet information to the backup neighbor device for storage and backup.

[0107] The system embodiments described above are merely illustrative. 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 to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A log information transmission and backup method, characterized in that: include: When a startup instruction of a target device is detected, obtaining a current spanning tree list to determine a backup neighbor device corresponding to the target device based on the spanning tree list; Generate communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation, wherein the preset communication protocol is a communication protocol that is pre-defined to extend and modify fields in the RAPS message protocol; Sending the communication message information to the backup neighbor device for storage and backup; Before generating communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation, the method further includes: Customizing a message indicator corresponding to a request status field in the preset communication protocol, wherein the message indicator is used to indicate an identifier of log information of a transmission target device; Customizing format information of the format field in the preset communication protocol, wherein the format information includes log type, log length, and log information; The RAPS message protocol includes the Request / State field and the TLV field; The request status field represents the Request / State field, which is used to identify whether the information is request information or current state information; the characters 0010 are selected in the reserved field of the Request / State field as the message indicator symbol for log information transmission; The format field represents the TLV field. The TLV field is used to describe the information to be loaded in the message. The TLV field represents a message message that satisfies the "message type-data length-data content" format. The generating of communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation includes: Determining a target log type and a target log length of the log information; Generate communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length and a preset identifier; The Request / State field in the communication message information includes a preset identifier, which is the same as the message indicator; the TLV field in the communication message information includes log information, target log type, and target log length; the communication message information also includes a device identifier of the target device, so that the communication message information is sent to the backup neighbor device for storage and backup; The log type includes at least one of a system operation log, an operation log, a device log, and an alarm log.

2. The log information transmission and backup method according to claim 1, characterized in that: The determining, based on the spanning tree list, a backup neighbor device corresponding to the target device includes: Determining a neighboring device connected to the target device in the spanning tree list, wherein the spanning tree list is constructed based on a spanning tree protocol; If there is a neighboring device, the neighboring device is used as the backup neighboring device; If there are multiple neighboring devices, the distance between each neighboring device and the root node in the spanning tree list is calculated, and the neighboring device with the smallest distance is used as the backup neighboring device.

3. The log information transmission and backup method according to claim 1, characterized in that: After the communication message information is sent to the backup neighbor device for storage and backup, the method further includes: Monitoring the node status corresponding to the spanning tree list; If the node status of the spanning tree list changes, the step of determining the backup neighbor device corresponding to the target device is returned to according to the new spanning tree list, so as to send the new log information to the newly determined backup neighbor device for storage and backup.

4. The log information transmission and backup method according to claim 1, characterized in that: After the communication message information is sent to the backup neighbor device for storage and backup, the method further includes: When a target device failure is detected, a fault recovery instruction is generated; Sending the fault recovery instruction to the backup neighbor device to obtain log information of the target device stored in the backup neighbor device; Performing a fault analysis on the target device based on the log information of the target device.

5. A log information transmission and backup system, characterized in that: include: a determination module, configured to, when detecting a startup instruction of a target device, obtain a current spanning tree list, and determine a backup neighbor device corresponding to the target device based on the spanning tree list; A generation module, configured to generate communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation, wherein the preset communication protocol is a communication protocol that is pre-defined to extend and modify fields in the RAPS message protocol; A backup module, configured to send the communication message information to a backup neighbor device for storage and backup; Before generating communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation, the method further includes: Customizing a message indicator corresponding to a request status field in the preset communication protocol, wherein the message indicator is used to indicate an identifier of log information of a transmission target device; Customizing format information of the format field in the preset communication protocol, wherein the format information includes log type, log length, and log information; The RAPS message protocol includes the Request / State field and the TLV field; The request status field represents the Request / State field, which is used to identify whether the information is request information or current state information; the characters 0010 are selected in the reserved field of the Request / State field as the message indicator symbol for log information transmission; The format field represents the TLV field. The TLV field is used to describe the information to be loaded in the message. The TLV field represents a message message that satisfies the "message type-data length-data content" format. The generating of communication message information corresponding to a preset communication protocol based on log information generated by the target device during operation includes: Determining a target log type and a target log length of the log information; Generate communication message information corresponding to the preset communication protocol based on the log information, the target log type, the target log length and a preset identifier; The Request / State field in the communication message information includes a preset identifier, which is the same as the message indicator; the TLV field in the communication message information includes log information, target log type, and target log length; the communication message information also includes a device identifier of the target device, so that the communication message information is sent to the backup neighbor device for storage and backup; The log type includes at least one of a system operation log, an operation log, a device log, and an alarm log.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the log information transmission and backup method according to any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the log information transmission and backup method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Loop network protection data configuration method and device

    CN106571936A

  • Cooperative node determination method and device

    CN107689883A

  • Log management method, device and equipment and machine readable storage medium

    CN114968641A