CN111294228B - Line card number detection method, device and storage medium thereof - Google Patents

Line card number detection method, device and storage medium thereof Download PDF

Info

Publication number
CN111294228B
CN111294228B CN201811507570.4A CN201811507570A CN111294228B CN 111294228 B CN111294228 B CN 111294228B CN 201811507570 A CN201811507570 A CN 201811507570A CN 111294228 B CN111294228 B CN 111294228B
Authority
CN
China
Prior art keywords
line card
response
keep
alive
numbers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811507570.4A
Other languages
Chinese (zh)
Other versions
CN111294228A (en
Inventor
何三波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201811507570.4A priority Critical patent/CN111294228B/en
Publication of CN111294228A publication Critical patent/CN111294228A/en
Application granted granted Critical
Publication of CN111294228B publication Critical patent/CN111294228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The invention provides a line card number detection method, a line card number detection device and a storage medium thereof, and relates to the technical field of distributed equipment data communication. The processing method comprises the following steps: respectively sending keep-alive messages to a plurality of line cards; receiving a response message returned by each line card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card number is an identifier which is distributed by the line card and used for representing the identity of the line card; and determining that the line card number or the response serial number of the received response message does not accord with a preset rule, and determining that the line card number or the response serial number does not accord with the line card number corresponding to the response message of the preset rule is repeated. The method does not depend on hardware resources, and simply and quickly determines the faults of the line cards with the same number.

Description

Line card number detection method, device and storage medium thereof
Technical Field
The invention relates to the technical field of distributed equipment data communication, in particular to a line card number detection method, a line card number detection device and a storage medium of the line card number detection device.
Background
Due to the complexity of distributed data communication devices, the devices are difficult to fail, especially during the development and commissioning phase of the devices. Many avoidance faults are difficult to avoid, so automatic location of various faults is significant.
In the development and debugging stage of the distributed equipment, because a bottom driver or hardware is not stable enough, the numbers obtained by two or more line cards are often the same, so that the line cards are in failure in the loading process or after the line cards are loaded, the line cards cannot work normally, and the difficulty in troubleshooting is very high, and a large amount of manpower is consumed.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting a line card number, and a storage medium thereof, so as to solve the problems in the prior art that troubleshooting is difficult and a large amount of manpower and material resources are consumed when a plurality of line cards obtain the same number.
In a first aspect, an embodiment of the present invention provides a line card number detection method, where the method includes: respectively sending keep-alive messages to a plurality of line cards; receiving a response message returned by each line card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card number is an identifier which is distributed by the line card and used for representing the identity of the line card; and determining that the line card number or the response serial number of the received response message does not accord with a preset rule, and determining that the line card number or the response serial number which does not accord with the preset rule corresponds to a repeated line card number.
According to the embodiment, the main control board card sends the keep-alive messages to the line card and receives the response messages returned by the line card, whether faults with repeated line card numbers exist is determined based on the line card numbers and the response serial numbers in the response messages, other special fault judgment hardware is not needed to participate, the hardware requirement of fault judgment is reduced, meanwhile, the fault judgment of the repeated line card numbers is simpler and faster, and the efficiency of line card number detection is improved.
In a first aspect, the response serial number is a global variable determined by the line card, the value of the global variable changes according to a preset rule after the line card sends a response message, and the response serial numbers in response messages successively returned by the line cards with the same line card number are different, and the line card number or the response serial number of the received response message is determined not to conform to the preset rule, including: and when the received response serial number is repeated with the response serial number of the response message of the serial number of the same line card received before, determining that the line card number or the response serial number of the received response message does not accord with a preset rule.
According to the embodiment, after the line card receives the keep-alive message, the response serial number which is changed according to the preset rule after each response message is sent is added to the response message returned to the control board card, the main control board card receives the response message through the main control board card, when the response serial number is the same as the response serial number with the same number, the main control board card determines the line card number repetition of the corresponding line card, fault determination is carried out based on the response serial number sent by each line card, the determination accuracy rate is improved, meanwhile, the line card carries out global variable increase and decrease of the response serial number, the operation burden of the main control board card is dispersed, and the determination efficiency of the line card number repetition fault is improved.
In summary of the first aspect, the keep-alive messages include keep-alive sequence numbers, where the keep-alive sequence numbers are global variables determined by the main control board, the numerical values of the global variables change after the main control board sends a keep-alive message, the response sequence numbers in the response keep-alive messages are the same as the keep-alive sequence numbers in the received keep-alive messages, and it is determined that the line card numbers or the response sequence numbers of the received response messages do not conform to a preset rule, including: and when the response serial numbers of the at least two received response messages are the same as the line card number, determining that the response serial numbers of the received response messages do not accord with the preset rule.
According to the embodiment, whether the fault of the line card number repetition exists is judged through the fact that whether the main control board card receives the line card numbers of the plurality of response messages and the response serial numbers are the same, the global variable does not need to be set, the operation difficulty is reduced, and therefore the higher judging efficiency of the fault of the line card number repetition is obtained.
In summary of the first aspect, the keep-alive messages include keep-alive sequence numbers, the keep-alive messages include line card numbers of each line card and a mapping table of the keep-alive sequence numbers, each line card number corresponds to a unique keep-alive sequence number, a response sequence number in the response keep-alive messages is the same as the keep-alive sequence number in the received keep-alive messages, and it is determined that the line card number or the response sequence number of the received response messages does not conform to a preset rule, including: and when the same response serial number is received, determining that the response serial number of the received response message does not accord with a preset rule.
In the embodiment, the same keep-alive message containing the mapping table of the line card number and the keep-alive sequence number is sent to each line card through the main control board card, whether the fault with the repeated line card number exists is determined based on the response message returned by the line card by comparing with the mapping table, and the main control board card only needs to broadcast and send the same keep-alive message, so that the fault judgment accuracy is ensured according to the mapping table, and meanwhile, the operation burden of the main control board card is reduced.
In summary of the first aspect, the sending keep-alive messages to a plurality of line cards respectively includes: and sending the keep-alive messages to the plurality of line cards based on a broadcast sending mode.
In a second aspect, an embodiment of the present invention provides a method for detecting a serial number of a line card, where the method includes: receiving a keep-alive message sent by a main control board card; and returning a response message to the main control board card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card number is an identifier which is allocated by the line card and used for representing the identity of the line card.
In a third aspect, an embodiment of the present invention provides a method for detecting a serial number of a line card, where the method includes: receiving a keep-alive message sent by a main control board card, wherein the keep-alive message comprises a main control board card number and a learning bitmap, the main control board card number is an identifier which is distributed by the main control board card and used for representing the identity of the main control board card, and a value of a bit corresponding to the line card number in the learning bitmap is used for representing whether the line card sends a response message to the main control board card before the keep-alive message is received; and when the keep-alive message is the first keep-alive message received by the line card from the main control board card and the value of the bit corresponding to the line card number in the learning bitmap indicates that the line card sends a response message to the main control board card before receiving the keep-alive message, determining that the number of the line card corresponding to the response message of which the response serial number does not accord with a preset rule is repeated.
In the embodiment, the learning bitmap is added in the keep-alive message through the main control board card, so that the line cards can automatically judge whether other line cards with the same number are communicated with the main control board card or not based on the learning bitmap in the received keep-alive message, and the judgment operation tasks are dispersed to the line cards, thereby improving the failure judgment efficiency.
In a fourth aspect, an embodiment of the present invention provides a line card serial number detection apparatus, where the apparatus includes: the keep-alive message sending module is used for sending keep-alive messages to the line cards respectively; the response message receiving module is used for receiving response messages returned by each line card aiming at the keep-alive messages, the response messages comprise response serial numbers and line card numbers, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card numbers are the marks which are distributed by the line cards and used for representing the line card identities; and the number repetition determining module is used for determining that the line card number or the response serial number of the received response message does not accord with the preset rule, and determining that the line card number corresponding to the response message of which the line card number or the response serial number does not accord with the preset rule is repeated.
In summary of the fourth aspect, the response sequence number is a global variable determined by the line card, the value of the global variable changes according to a preset rule after each response message is sent by the line card, and the response sequence numbers in response messages successively returned by the line cards with the same line card number are different, and the number repetition determination module is specifically configured to determine that the response sequence number of the received response message does not conform to the preset rule when the received response sequence number is repeated with the response sequence number of the response message numbered by the same line card received before.
In a fourth aspect, the keep-alive messages include keep-alive sequence numbers, the keep-alive sequence numbers are global variables determined by the main control board, the value of the global variables changes after the main control board sends each keep-alive message, the response sequence numbers in the response keep-alive messages are the same as the keep-alive sequence numbers in the received keep-alive messages, and the number repetition determination module is specifically configured to determine that the response sequence numbers of the received response messages do not conform to the preset rule when the response sequence numbers and the line card numbers of at least two received response messages are the same.
In a fourth aspect, the keep-alive messages include keep-alive serial numbers, the keep-alive messages include line card numbers of each line card and a mapping table of the keep-alive serial numbers, each line card number corresponds to a unique keep-alive serial number, a response serial number in the response keep-alive messages is the same as a keep-alive serial number in the received keep-alive messages, and the repeated number determining module is specifically configured to determine that the response serial number of the received response message does not conform to a preset rule when the same response serial number is received.
In a fourth aspect, the keep-alive message sending module is specifically configured to send keep-alive messages to multiple line cards based on a broadcast sending manner.
In a fifth aspect, an embodiment of the present invention provides a line card number detection apparatus, where the apparatus includes: the keep-alive message receiving module is used for receiving the keep-alive messages sent by the main control board card; and the response message sending module is used for returning a response message to the main control board card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card number is an identifier which is allocated by the line card and used for representing the identity of the line card.
In a sixth aspect, an embodiment of the present invention provides a line card number detection apparatus, where the apparatus includes: the keep-alive message receiving device is used for receiving keep-alive messages sent by the master control board card, the keep-alive messages comprise master control board card numbers and a learning bitmap, the master control board card numbers are identifiers which are distributed by the master control board card and used for representing the identity of the master control board card, and the value of a bit corresponding to the line card number in the learning bitmap is used for representing whether the line card sends a response message to the master control board card before the keep-alive messages are received; and the number repetition determining module is used for determining that the number of the line card corresponding to the response message with the response serial number not conforming to the preset rule is repeated when the keep-alive message is the first keep-alive message received by the line card from the main control board card and the value of the bit corresponding to the line card number in the learning bitmap indicates that the line card sends the response message to the main control board card before the keep-alive message is received.
In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, where computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are read and executed by a processor, the steps in the method in any of the above aspects are performed.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic diagram of connection between a master control board card and a line card;
fig. 2 is a schematic flow chart of a method for detecting a serial number of a line card according to a first embodiment of the present invention;
fig. 3 is a diagram of another line card number detection method according to the first embodiment of the present invention;
fig. 4 is a schematic block diagram of a line card serial number detection apparatus 110 according to a second embodiment of the present invention;
fig. 5 is a block diagram of a line card serial number detection apparatus 120 according to a second embodiment of the present invention.
Icon: 110-line card number detection device; 111-keep-alive message sending module; 112-keep-alive message receiving module; 113-response message sending module; 114-response message receiving module; 115-number repetition determination module; 120-line card number detection device; 121-keep-alive message receiving means; 122-number repeat determination module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
First embodiment
The applicant researches and discovers that the distributed equipment is composed of a main control board card and a line card, wherein the main control board card is connected with the line card through an ethernet chip, please refer to fig. 1, and fig. 1 is a schematic connection diagram of the main control board card and the line card, and the main control board card and the line card perform data communication through sending and receiving messages. In the development and debugging stage of the existing distributed equipment, because a bottom driver or hardware is not stable enough, the numbers of two or more line cards obtained from a system are often the same, so that the line cards are in failure in the loading process or after the line cards are loaded, but the difficulty in troubleshooting and determining the failure is very high, and a large amount of manpower and material resources are consumed.
In order to solve the above problem, a first embodiment of the present invention provides a method for detecting a serial number of a line card, where an execution main body of the method is a main control board card.
Referring to fig. 2, fig. 2 is a schematic flow chart of a method for detecting a serial number of a line card according to a first embodiment of the present invention, where the method includes the following specific steps:
step S11: the main control board card sends keep-alive messages to the line cards respectively.
In this embodiment, the main control board card may send the keep-alive message when the main control board card does not perform data message transceiving with the line card. The main control board card and the line card establish interactive connection, but data interaction does not exist all the time, some connections can actively release the connection after the data interaction is finished, and some connections cannot, so that in a long-time period without data interaction, various accidents such as power failure, crash, abnormal restart and the like can occur to both interaction sides.
Step S12: the line card receives the keep-alive messages sent by the main control board card, and response messages are returned to the main control board card aiming at the keep-alive messages, wherein the response messages comprise response serial numbers and line card numbers, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card numbers are the marks which are distributed by the line cards and used for representing the identity of the line cards.
Step S13: and the main control board card receives a response message returned by each line card aiming at the keep-alive message.
In this embodiment, the response message returned by the line card and the keep-alive message sent by the main control board card are of the same message type.
In the design and implementation of the board card communication of the distributed device, generally, the keep-alive message generally carries a sequence number, and in this embodiment, the sequence number in the acknowledgement message is an acknowledgement sequence number. Meanwhile, the number used for representing the identity of the line card should be a unique number corresponding to one line card in a non-failure situation, and the number may be, but is not limited to, a number assigned to each line card by other processing devices in the master control board or the distributed device when the line card is started.
Step S14: the main control board card determines that the line card number or the response serial number of the received response message does not accord with the preset rule, and determines that the line card number or the response serial number which does not accord with the response message of the preset rule is repeated.
The preset rule in this embodiment may be adjusted according to different processing and determining modes of the main control board card and the line card for the response serial number.
The line card number detection method provided by the embodiment of the invention sends the keep-alive message to the line card through the main control board card and receives the response message returned by the line card, determines whether the fault with repeated line card numbers exists or not based on the response serial number in the response message, does not need other special fault determination hardware to participate, reduces the hardware requirement of fault determination, simultaneously enables the fault determination with repeated line card numbers to be simpler and faster, and improves the line card number detection efficiency.
As an optional implementation manner, the response serial number in the response message in step S12 may be a global variable uniquely determined by the line card, a value of the global variable changes according to a preset rule after each response message is sent by the line card, and response serial numbers in response messages successively returned by line cards with the same number are different.
Corresponding to the above steps, the step S14 of determining that the line card number or the response sequence number of the received response packet does not meet the preset rule includes: and when the received response serial number is repeated with the response serial number of the response message of the number of the same line card received before, determining that the line card number or the response serial number of the received response message does not accord with a preset rule.
For example, the preset rule in step S12 in the above embodiment may be, but is not limited to, that each time the line card sends a response message, the response sequence number of the response message when the response message is sent next time is increased by 1, that is, when the response sequence number of the response message sent last by the line card with line card number 5 is 56, the response sequence number of the response message sent this time is 57. Further, in step S14, when the response message received by the main control board card receives a response serial number 57 that is less than or equal to the response serial number predicted according to the preset rule, and the line card number that transmits the response message is 5, it is determined that there is another line card that also obtains the line card number 5, and the line card that transmits the response serial number that is less than or equal to 57 is a line card that has a line card number repeat failure.
It should be understood that, in addition to increasing by 1 with each transmission of the response message, the response sequence number may be incremented or decremented by other fixed values each time, or may be increased or decreased in an equal-ratio series, or the like.
According to the embodiment, after the line card receives the keep-alive message, the response serial number which is changed according to the preset rule after each response message is sent is added to the response message returned to the control board card, the main control board card receives the response message, when the response serial number is the same as the response serial number of the previous collinear card, the main control board card determines that the serial number of the corresponding line card is repeated, fault determination is carried out based on the response serial number sent by each line card, the determination accuracy rate is improved, meanwhile, the line card increases and decreases the global variable of the response serial number, the operation burden of the main control board card is dispersed, and the determination efficiency of the repeated fault of the serial number of the line card is improved.
As an optional implementation manner, the response sequence number in step S12 may be determined according to a keep-alive message sent by the main control board, specifically, the keep-alive message includes a keep-alive sequence number, the keep-alive sequence number is a global variable determined by the main control board, and a value of the global variable changes after the main control board sends one keep-alive message each time.
Corresponding to the above step S13, the step S14 of this embodiment of "determining that the line card number or the response serial number of the received response packet does not meet the preset rule" includes: and when the response serial numbers and the line card numbers of the at least two received response messages are the same, determining that the line card numbers or the response serial numbers of the received response messages do not accord with a preset rule.
It should be understood that the change rule of the saved serial number in step S12 may be to increment or decrement by a fixed value each time, or to increase or decrease in an equal-ratio series, etc.
For example, in step S11 of the above embodiment, if the keep-alive sequence number in the keep-alive message sent by the main control board to the line card with the line card number 21 this time is 12, then the response sequence number in the response message returned by the line card with the line card number 21 in step S12 is also 12, and if the main control board receives a response message with another line card number 21 and the response sequence number 12, it indicates that the line card number of another line card is also 21.
According to the embodiment, whether the fault of the line card number repetition exists is judged through the fact that whether the main control board card receives the line card numbers of the plurality of response messages and the response serial numbers are the same, the global variable does not need to be set, the operation difficulty is reduced, and therefore the higher judging efficiency of the fault of the line card number repetition is obtained.
As an optional implementation manner, when the main control board may determine the number that each line card should obtain, the response sequence number in step S12 may be determined according to the corresponding line card number of each line card in the keep-alive message sent by the main control board and the keep-alive sequence number. In this embodiment, the keep-alive message includes a mapping table of a line card number and a keep-alive sequence number of each line card, each line card number corresponds to a unique keep-alive sequence number, and a response sequence number in the response keep-alive message is the same as a keep-alive sequence number in the received keep-alive message.
Corresponding to the above step S13, the step S14 of this embodiment of "determining that the line card number or the response serial number of the received response packet does not meet the preset rule" includes: and when the same response serial number is received, determining that the line card number or the response serial number of the received response message does not accord with a preset rule.
For example, in this embodiment, the mapping table in the same keep-alive message sent by step S11 to all line cards includes: line cards with different line card numbers return sequence numbers corresponding to the line card numbers of the line cards to the main control board card as response sequence numbers, namely the response sequence number in a response message returned by the line card with the line card number 15 is 101, the response sequence number in a response message returned by the line card with the line card number 16 is 102, and the response sequence number in a response message returned by the line card with the line card number 16 is 103 in step S12. When the main control board card receives two or more response messages with response serial numbers of 101, it is determined that the corresponding number of line cards obtain the same line card number 15.
In the embodiment, the same keep-alive message containing the mapping table of the line card number and the keep-alive sequence number is sent to each line card through the main control board card, whether the fault with the repeated line card number exists is determined based on the response message returned by the line card by comparing with the mapping table, and the main control board card only needs to broadcast and send the same keep-alive message, so that the fault judgment accuracy is ensured according to the mapping table, and meanwhile, the operation burden of the main control board card is reduced.
As an optional implementation manner, whether there are other line cards with the same number as the line card of the line card itself may also be determined by the line card itself, and the main execution body of the line card number detection method is the line card. Referring to fig. 3, fig. 3 is a diagram illustrating another line card number detection method according to a first embodiment of the present invention, which includes the following specific steps:
step S21: the line card receives keep-alive messages sent by the main control board card, the keep-alive messages comprise main control board card numbers and a learning bitmap, the main control board card numbers are marks which are distributed by the main control board card and used for representing the identity of the main control board card, and values of bits corresponding to the line card numbers in the learning bitmap are used for representing whether the line card sends response messages to the main control board card before the keep-alive messages are received.
Step S22: when the keep-alive message is the first keep-alive message received by the line card from the main control board card, and the value of the bit corresponding to the line card number in the learning bitmap indicates that the line card sends a response message to the main control board card before receiving the keep-alive message, the number of the line card corresponding to the response message of which the response serial number does not accord with the preset rule is determined to be repeated.
The learning bitmap in this embodiment is a field newly opened up in the keep-alive message, and if the main control board card receives the keep-alive message 1 of the line card B, the value of the bit corresponding to the line card number of the line card B in the learning bitmap sent to the keep-alive message of the line card B by the subsequent main control board card indicates that the line card has sent the keep-alive message to the main control board card before receiving the keep-alive message 1, and it is determined that the line card number of the line card corresponding to the response message whose response sequence number does not conform to the preset rule is repeated. The value of the bit corresponding to the learning bitmap may be, but is not limited to, 0 indicating that the line card has not sent the keep-alive message to the main control board before receiving the keep-alive message, and 1 indicating that the line card has sent the keep-alive message to the main control board before receiving the keep-alive message.
It should be understood that when the line card receives the keep-alive message sent by the main control board card for the first time, the bit corresponding to the line card number of the line card and the learning bitmap of the keep-alive message is not assigned, and whether a line card with the same number as the line card has responded the keep-alive message to the main control board card can be judged based on whether the bit corresponding to the line card number is assigned.
It should be understood that, in this embodiment, when it is determined that a line card has a fault with a duplicate line card number, the line card is not loaded, so that the line card does not send messages (e.g., data messages) other than the keep-alive messages, thereby preventing the influence caused by the fault from being expanded.
In the line card number detection method provided by this embodiment, the master control board adds the learning bitmap in the keep-alive message, so that the line card can automatically determine whether the line cards with the same number as other line cards have communicated with the master control board based on the learning bitmap in the received keep-alive message, and disperse the determination operation task to each line card, thereby improving the failure determination efficiency.
Second embodiment
In order to cooperate with the method for detecting a line card number applied to a distributed device according to the first embodiment of the present invention, a device 110 for detecting a line card number is also provided in the second embodiment of the present invention.
Referring to fig. 4, fig. 4 is a schematic block diagram of a line card number detection apparatus 110 according to a second embodiment of the present invention.
The line card number detection device 110 includes a keep-alive message sending module 111, a keep-alive message receiving module 112, a response message sending module 113, a response message receiving module 114, and a number repetition determining module 115.
And the keep-alive message sending module 111 is configured to send keep-alive messages to the multiple line cards respectively.
A keep-alive message receiving module 112, configured to receive the keep-alive message sent by the main control board.
And the response message sending module 113 is configured to return a response message to the main control board card for the keep-alive message, where the response message includes a response serial number and a line card number, the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, and the line card number is an identifier that is allocated by the line card and used for indicating the identity of the line card.
And the response message receiving module 114 is configured to receive a response message returned by each line card for the keep-alive message.
And a number repetition determination module 115, configured to determine that the line card number or the response serial number of the received response packet does not meet a preset rule, and determine that the line card number corresponding to the response packet whose line card number or response serial number does not meet the preset rule is repeated.
As an optional implementation manner, the response serial number is a global variable determined by the line card, and when the line card sends a response message and the response serial numbers in the response messages successively returned by the line cards with the same line card number are different, the number repetition determination module 115 is specifically configured to determine that the line card number or the response serial number of the received response message does not conform to the preset rule when the received response serial number is repeated with the response serial number of the response message with the same line card number previously received.
As an optional implementation manner, the keep-alive messages include keep-alive sequence numbers, where the keep-alive sequence numbers are global variables determined by the main control board, a numerical value of the global variable changes after the main control board sends one keep-alive message, a response sequence number in the response keep-alive messages is the same as the keep-alive sequence number in the received keep-alive messages, and the number repetition determination module 115 is specifically configured to determine that the line card numbers or the response sequence numbers of the received response messages do not conform to the preset rule when the response sequence numbers and the numbers of the received at least two response messages are the same.
As an optional implementation manner, the keep-alive message includes a keep-alive sequence number, the keep-alive message includes a line card number of each line card and a mapping table of the keep-alive sequence number, each line card number corresponds to a unique keep-alive sequence number, and the number repetition determination module 115 is specifically configured to determine that the line card number or the response sequence number of the received response message does not meet a preset rule when the same response sequence number is received under the condition that the response sequence number in the response keep-alive message is the same as the keep-alive sequence number in the received keep-alive message.
As an optional implementation manner, the keep-alive message sending module 111 may be further specifically configured to send keep-alive messages to the multiple line cards based on a broadcast sending manner.
In order to cooperate with the method for detecting the line card serial number applied to the line card according to the first embodiment of the present invention, a device 120 for detecting the line card serial number is further provided according to the second embodiment of the present invention.
Referring to fig. 5, fig. 5 is a schematic block diagram of a line card number detection apparatus 120 according to a second embodiment of the present invention.
The keep-alive message receiving module 121 is configured to receive a keep-alive message sent by the master control board, where the keep-alive message includes a master control board number and a learning bitmap, the master control board number is an identifier allocated by the master control board and used for indicating an identity of the master control board, and a value of a bit in the learning bitmap corresponding to the board number is used for indicating whether the line card sends a response message to the master control board before receiving the keep-alive message.
And a number repetition determination module 122, configured to determine that the number of the line card corresponding to the response message with the response sequence number that does not meet the preset rule is repeated when the keep-alive message is the first keep-alive message received by the line card from the main control board card and the value of the bit corresponding to the line card number in the learning bitmap indicates that the line card sends the response message to the main control board card before receiving the keep-alive message.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and redundant description is not repeated here.
Line card number detection apparatus 110 and line card number detection apparatus 120 include at least one software function module that may be stored in the memory in the form of software or firmware (firmware) or fixed in an Operating System (OS) of line card number detection apparatus 110 and line card number detection apparatus 120. To cause the processor to execute executable modules stored in the memory, such as software functional modules or computer programs included in the line card number detection apparatus 110 and the line card number detection apparatus 120.
The Memory may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory is used for storing a program, and the processor executes the program after receiving an execution instruction, and the method executed by the server defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to or implemented by the processor.
The processor may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
In summary, embodiments of the present invention provide a line card number detection method, an apparatus, and a storage medium thereof, in which the method sends a keep-alive message to a line card through a main control board card and receives a response message returned by the line card, determines whether a fault with a repeated line card number exists based on a response sequence number in the response message, and does not need other special fault determination hardware to participate, thereby reducing hardware requirements for fault determination, and simultaneously making fault determination with a repeated line card number simpler and faster, and improving efficiency of line card number detection.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which 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) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A line card number detection method is characterized by comprising the following steps:
respectively sending keep-alive messages to a plurality of line cards;
receiving response messages returned by each line card aiming at the keep-alive messages, wherein the response messages comprise response serial numbers and line card numbers, the response serial numbers in the response messages successively returned by the same line card are different, and the line card numbers are the marks which are distributed by the line cards and used for representing the identity of the line cards;
and determining that the line card number and the response serial number of the received response message do not accord with the preset rule, and determining that the line card number and the response serial number which do not accord with the preset rule correspond to the line card number repeatedly.
2. The line card number detection method according to claim 1, wherein the response sequence number is a global variable determined by the line card, a value of the global variable changes according to a preset rule after the line card sends a response packet, and determining that the line card number and the response sequence number of the received response packet do not comply with the preset rule comprises:
and when the received response serial number is repeated with the response serial number of the response message of the number of the same line card received before, determining that the line card number and the response serial number of the received response message do not accord with the preset rule.
3. The line card number detection method according to claim 1, wherein the keep-alive messages include keep-alive sequence numbers, the keep-alive sequence numbers are global variables determined by a master control board, the numerical values of the global variables change after the master control board sends one keep-alive message each time, the response sequence numbers in the response messages are the same as the keep-alive sequence numbers in the received keep-alive messages, and the line card numbers and the response sequence numbers of the received response messages are determined not to meet preset rules, including:
when the response serial numbers and the line card numbers of at least two received response messages are the same, determining that the line card numbers and the response serial numbers of the received response messages do not accord with preset rules.
4. The line card number detection method according to claim 1, wherein the keep-alive messages include keep-alive sequence numbers, the keep-alive messages include mapping tables of the line card numbers and the keep-alive sequence numbers of each line card, each line card number corresponds to a unique keep-alive sequence number, the response sequence numbers in the response messages are the same as the keep-alive sequence numbers in the received keep-alive messages, and the determining that the line card numbers and the response sequence numbers of the received response messages do not meet preset rules includes:
when the response serial numbers and the line card numbers of at least two response messages are received to be the same, the response serial numbers and the line card numbers of the received response messages are determined not to accord with the preset rules.
5. The line card number detection method according to claim 4, wherein the sending keep-alive messages to the plurality of line cards, respectively, comprises:
and sending the keep-alive messages to the line cards based on a broadcast sending mode.
6. A line card number detection method is characterized by comprising the following steps:
receiving a keep-alive message sent by a main control board card;
and returning a response message to the main control board card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the same line card are different, and the line card number is an identifier which is distributed by the line card and used for representing the identity of the line card.
7. A line card number detection method is characterized by comprising the following steps:
receiving keep-alive messages sent by a main control board card, wherein the keep-alive messages comprise main control board card numbers and a learning bitmap, the main control board card numbers are identifiers which are distributed by the main control board card and used for representing the identity of the main control board card, and the value of a bit corresponding to the line card number in the learning bitmap is used for representing whether the line card sends a response message to the main control board card before the keep-alive messages are received;
and when the keep-alive message is the first keep-alive message received by the line card from the main control board card, and the value of the bit corresponding to the line card number in the learning bitmap indicates that the line card sends a response message to the main control board card before receiving the keep-alive message, determining that the number of the line card corresponding to the response message of which the response serial number does not accord with a preset rule is repeated.
8. The utility model provides a line card serial number detection device which characterized in that, the device includes:
the keep-alive message sending module is used for respectively sending keep-alive messages to the line cards;
the response message receiving module is used for receiving response messages returned by each line card aiming at the keep-alive messages, the response messages comprise response serial numbers and line card numbers, the response serial numbers in the response messages successively returned by the same line card are different, and the line card numbers are marks which are distributed by the line cards and used for representing line card identities;
and the number repetition determining module is used for determining that the line card number and the response serial number of the received response message do not accord with the preset rule, and determining that the line card number corresponding to the response message of which the line card number and the response serial number do not accord with the preset rule is repeated.
9. The utility model provides a line card serial number detection device which characterized in that, the device includes:
the keep-alive message receiving module is used for receiving the keep-alive messages sent by the main control board card;
and the response message sending module is used for returning a response message to the main control board card aiming at the keep-alive message, wherein the response message comprises a response serial number and a line card number, the response serial numbers in the response messages successively returned by the same line card are different, and the line card number is an identifier which is distributed by the line card and used for representing the identity of the line card.
10. A computer-readable storage medium having computer program instructions stored thereon which, when read and executed by a processor, perform the steps of the method of any of claims 1-7.
CN201811507570.4A 2018-12-07 2018-12-07 Line card number detection method, device and storage medium thereof Active CN111294228B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811507570.4A CN111294228B (en) 2018-12-07 2018-12-07 Line card number detection method, device and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811507570.4A CN111294228B (en) 2018-12-07 2018-12-07 Line card number detection method, device and storage medium thereof

Publications (2)

Publication Number Publication Date
CN111294228A CN111294228A (en) 2020-06-16
CN111294228B true CN111294228B (en) 2022-10-18

Family

ID=71025072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811507570.4A Active CN111294228B (en) 2018-12-07 2018-12-07 Line card number detection method, device and storage medium thereof

Country Status (1)

Country Link
CN (1) CN111294228B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746842A (en) * 2013-12-31 2014-04-23 迈普通信技术股份有限公司 Method and system for detecting fault restarting of line card
CN106712983A (en) * 2015-07-27 2017-05-24 中兴通讯股份有限公司 OAM message processing method and apparatus
CN107493209A (en) * 2017-09-12 2017-12-19 安徽皖通邮电股份有限公司 The processing unit and method of a kind of bidirectional forward detection report
CN107872340A (en) * 2016-09-27 2018-04-03 华为技术有限公司 A kind of method, veneer and the forwarding unit of veneer registration

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3128728B1 (en) * 2015-08-06 2018-05-02 Alcatel Lucent Method and device for detecting a broken binder

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746842A (en) * 2013-12-31 2014-04-23 迈普通信技术股份有限公司 Method and system for detecting fault restarting of line card
CN106712983A (en) * 2015-07-27 2017-05-24 中兴通讯股份有限公司 OAM message processing method and apparatus
CN107872340A (en) * 2016-09-27 2018-04-03 华为技术有限公司 A kind of method, veneer and the forwarding unit of veneer registration
CN107493209A (en) * 2017-09-12 2017-12-19 安徽皖通邮电股份有限公司 The processing unit and method of a kind of bidirectional forward detection report

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名."Ethernet Line Card Installation and Configuration".《https://www.cisco.com/c/en/us/td/docs/routers/12000/gsr_linecards/emet_lc/installtion/guide/enet_lc.html》.2007, *

Also Published As

Publication number Publication date
CN111294228A (en) 2020-06-16

Similar Documents

Publication Publication Date Title
CN109739527B (en) Method, device, server and storage medium for client gray scale release
CN108287769B (en) Information processing method and device
CN111988191B (en) Fault detection method and device for distributed communication network
CN110275992B (en) Emergency processing method, device, server and computer readable storage medium
CN112199240B (en) Method for switching nodes during node failure and related equipment
US20210373929A1 (en) Offline configuration method and apparatus for intelligent device
CN113518002B (en) Monitoring method, device, equipment and storage medium based on server-free platform
CN111294228B (en) Line card number detection method, device and storage medium thereof
CN109697117B (en) Terminal control method, terminal control device and computer-readable storage medium
CN112817883A (en) Method, device and system for adapting interface platform and computer readable storage medium
CN112634973A (en) Data rereading method and system of storage medium, terminal device and storage medium
CN112565348A (en) Intelligent equipment testing method and system, computer equipment and storage medium
CN115629951B (en) Task full-link tracking method, first node, link system and medium
CN115933591A (en) Controller diagnosis method, device, equipment and storage medium
CN111181777A (en) Service degradation method, device, computer equipment and storage medium
CN116225804A (en) PCIe link detection method, system, equipment and storage medium
CN111885159B (en) Data acquisition method and device, electronic equipment and storage medium
CN110928679B (en) Resource allocation method and device
CN110188007B (en) Distributed data repair method, device, network node and storage medium
CN103595781A (en) Service providing method, first server and system based on zookeeper
CN109993406B (en) Information processing method and device
CN108882268B (en) Method and device for updating device configuration
CN111555927B (en) Test system, method and device for satellite-borne Ethernet switch
CN114020435A (en) Task scheduling method, device, equipment and medium
CN110971716A (en) Address configuration method, device, system and computer readable storage medium

Legal Events

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