Disclosure of Invention
The invention aims to provide a method for realizing signal degradation and failure detection based on OAM, which can accurately and continuously detect signal degradation and failure. Meanwhile, an apparatus and a storage medium for implementing the method are also provided.
In order to achieve the above object, the present invention provides a method for detecting signal degradation and failure based on OAM, the method comprising:
s10, judging whether a CCM message is received in the current detection period;
s20, in response to the judgment result of S10, setting the lowest position of the storage medium to a first preset value or a second preset value, wherein the bit width of the storage medium is at least N, the N is the number of detection cycles included in a detection interval, the N is an integer greater than 1, the first preset value is used for identifying that a CCM message is received, and the second preset value is used for identifying that the CCM message is not received;
s30, when the current detection period is over, counting the number of the first preset values in the storage medium, and judging whether the number is less than the signal failure generation threshold;
s40, responding to the number smaller than the signal failure generating threshold, generating a signal failure alarm, further shifting the data in the storage medium by one bit to the left, and executing S10-S30, or responding to the number not smaller than the signal failure generating threshold, further executing S50;
s50, determining whether the number is less than a signal degradation generation threshold;
s60, in response to the number being less than the signal degradation generation threshold, generating a signal degradation alarm, shifting the data in the storage medium by one bit to the left, and executing S10-S30.
As a modification of the method of the present invention, after S60, the method further includes:
s70, judging whether the number is larger than the signal degradation clearing threshold;
s80, in response to the number is larger than the signal degradation clearing threshold, clearing the signal degradation alarm, further shifting the data in the storage medium by one bit to the left, and executing S10-S30, or in response to the number is not larger than the signal degradation clearing threshold, executing S90;
s90, judging whether the number is larger than the signal failure clearing threshold;
s100, in response to the number being greater than the signal failure clearing threshold, clearing the signal failure alarm, further shifting the data in the storage medium by one bit to the left, and executing S10-S30.
As a modification of the method of the present invention, the first preset value is 1, the second preset value is 0, and all data of the storage medium is initially set to the first preset value.
As an improvement of the method of the present invention, it is determined whether the current detection period is over by a timer.
The invention also discloses a device for realizing signal degradation and failure detection based on OAM, which comprises:
the first judgment module is used for judging whether a CCM message is received in the current detection period;
the storage module is used for setting the lowest position of the storage medium to a first preset value or a second preset value according to the judgment result of the first judgment module, the bit width of the storage medium is at least N, the N is the number of detection cycles included in a detection interval, the N is an integer greater than 1, the first preset value is used for identifying that a CCM message is received, and the second preset value is used for identifying that the CCM message is not received;
the second judging module is used for counting the number of the first preset values in the storage medium when the current detection period is finished and judging whether the number is smaller than a signal failure generation threshold or not;
the first alarm generating module is used for generating a signal failure alarm when the second judging module judges that the number is less than the signal failure generating threshold, and shifting the data in the storage medium by one bit to the left;
a third judging module, configured to further judge whether the number is smaller than the signal degradation generation threshold when the second judging module judges that the number is not smaller than the signal failure generation threshold;
and the second alarm generating module is used for generating a signal degradation alarm when the third judging module judges that the number is less than the signal degradation generating threshold, and shifting the data in the storage medium by one bit to the left.
As an improvement of the apparatus of the present invention, the apparatus further comprises:
the fourth judging module is used for further judging whether the number is larger than the signal degradation clearing threshold or not when the third judging module judges that the number is not smaller than the signal degradation generating threshold;
the first clearing alarm module is used for clearing the signal degradation alarm when the fourth judgment module judges that the number is greater than the signal degradation clearing threshold and shifting the data in the storage medium by one bit to the left;
a fifth judging module, configured to further judge whether the number is greater than the signal failure clearing threshold when the fourth judging module judges that the number is not greater than the signal degradation clearing threshold;
and the second clearing alarm module is used for clearing the signal failure alarm when the fifth judgment module judges that the number is greater than the signal failure clearing threshold and shifting the data in the storage medium by one bit to the left.
As an improvement of the apparatus of the present invention, the first preset value is 1, the second preset value is 0, and all data of the storage medium is initially set to the first preset value.
The invention also discloses a device for realizing signal degradation and failure detection based on OAM, which comprises:
at least one processor; and
at least one memory coupled to the at least one processor and storing a computer program for execution by the at least one processor, the computer program, when executed by the at least one processor, causing the apparatus to perform the method described above.
The invention also discloses a computer readable storage medium on which a computer program is stored, which computer program, when being executed by a machine, realizes the above-mentioned method.
The invention has the beneficial effects that:
(1) the invention makes the data in the storage medium move left periodically to free the lowest bit for the next detection period to record whether the CCM message is received, that is, the window sliding is realized by the periodic displacement of the data in the storage medium, the condition of the CCM message received in the continuous N detection periods can be smoothly recorded, the number of the CCM messages received in the continuous N detection periods can be counted, and then the signal failure and signal degradation detection can be accurately carried out according to the number.
(2) The invention can also cooperate with the original LOC detection mechanism to provide richer link service state information for the upper system and assist the upper system to make processing strategy decisions.
Detailed Description
The technical solution of the embodiment of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention.
The method for realizing signal degradation and failure detection based on OAM can accurately and continuously detect signal degradation and failure. Specifically, referring to fig. 1 and fig. 2, the method for detecting signal degradation and failure based on OAM disclosed in the present invention includes the following steps:
s10, judging whether a CCM message is received in the current detection period;
specifically, for connectivity detection, in ethernet OAM, connectivity detection may be performed according to its preconfigured sending and receiving periods through CCM messages. The invention can judge the signal quality through the connectivity detection result, so the invention uses CCM message to detect the signal deterioration and signal failure.
As shown in fig. 3, before performing signal degradation and signal failure detection, a detection interval (which may also be referred to as a sliding window) is configured, and the detection interval includes N consecutive detection cycles. In each detection period, the CCM message may be received, or the CCM message may not be received, so that the signal degradation and the signal failure may be determined by the number of the CCM messages received in the detection interval, that is, the number of the CCM messages received in N consecutive detection periods is counted, and the signal degradation and the signal failure may be determined. As shown in the figure, in the detection interval 1, when counting the number of CCM messages, counting the number of CCM messages received from the first detection period to the nth detection period; and in the detection interval 2, counting the number of the CCM messages received from the second detection period to the (N + 1) th detection period when counting the number of the CCM messages. That is, at the next detection period, the detection interval is shifted by one detection period.
In this embodiment, N may be customized according to actual requirements, for example, N is 128, or N is 256, and the like, and may be set according to actual requirements.
Furthermore, before performing signal degradation and signal failure detection, a storage medium is configured, and the bit width of the storage medium corresponds to the detection section, that is, the bit width of the storage medium is at least N, where N is the number of detection cycles included in the detection section. Each bit may identify whether a CCM message is received within the current detection period. In implementation, when a CCM message is received in a current detection period, a corresponding bit may be set to a first preset value, and when a CCM message is not received in the current detection period, a corresponding bit may be set to a second preset value. Therefore, the number of the CCM messages received in the detection interval can be determined according to the number of the first preset values in the storage medium. For example, a storage medium with a bit width of 256, may determine the number of CCM messages received in 256 detection cycles according to the stored content.
In this embodiment, the first preset value is 1, and the second preset value is 0, that is, when a CCM packet is received in the current detection period, the value of the corresponding bit is 1, and when a CCM packet is not received in the current detection period, the value of the corresponding bit is 0.
After the detection interval and the corresponding storage medium are configured, signal degradation and signal failure detection can be performed. And when signal degradation and signal failure detection is carried out, judging whether a CCM message is received in the current detection period. In implementation, whether the received message is a CCM message or not can be determined by analyzing the received message.
S20, in response to the judgment result of S10, setting the lowest position of the storage medium to a first preset value or a second preset value, wherein the bit width of the storage medium is at least N, the N is the number of detection cycles included in a detection interval, the N is an integer greater than 1, the first preset value is used for identifying that a CCM message is received, and the second preset value is used for identifying that the CCM message is not received;
specifically, when a CCM message is received in a current detection period, the lowest position of the storage medium is set to a first preset value to identify that the CCM message is received in the latest detection period, and for example, the lowest position of the storage medium is set to 1 to identify that the CCM message is received in the current detection period. And when the CCM message is not received in the current detection period, setting the lowest position of the storage medium to be a second preset value to identify that the CCM message is received in the latest detection period, and if the lowest position of the storage medium is set to be 0, identifying that the CCM message is not received in the current detection period. Initially, all bit data of the storage medium is set to a first preset value. And when the CCM message is not received in the first detection period, the lowest position of the storage medium is set to be a second preset value.
S30, when the current detection period is over, counting the number of the first preset values in the storage medium, and judging whether the number is less than the signal failure generation threshold;
s40, responding to the number smaller than the signal failure generating threshold, generating a signal failure alarm, further shifting the data in the storage medium by one bit to the left, and executing S10-S30, or responding to the number not smaller than the signal failure generating threshold, further executing S50;
s50, determining whether the number is less than a signal degradation generation threshold;
s60, in response to the number being less than the signal degradation generation threshold, generating a signal degradation alarm, shifting the data in the storage medium by one bit to the left, and executing S10-S30.
Specifically, when the current detection period ends, the number of the first preset values in the storage medium may be counted, that is, the number of CCM messages received in the past N consecutive detection periods may be obtained. And if the current detection period is ended, calculating the number of 1 s in the current storage medium, so as to obtain the number of CCM messages received in the past continuous 256 detection periods. In practice, the counting may be performed by a timer to trigger counting the number of preset values in the storage medium at the end of the detection period.
Further, the number of received CCM messages is compared with a signal degradation generation threshold and a signal failure generation threshold, respectively, to determine whether to generate a signal degradation alarm or a signal failure alarm. When the CCM generating method is implemented, the number of the received CCM messages is compared with a signal failure generating threshold, and whether the number of the received CCM messages is smaller than the signal failure generating threshold or not is judged. And when the number of the received CCM messages is less than the signal failure generation threshold, setting a signal failure alarm mark and reporting a signal failure alarm, namely generating and reporting the signal failure alarm. The data in the storage medium is further shifted to the left by one bit, i.e. a periodic window sliding is performed, so as to discard the leftmost data (with the longest duration) and free the lowest bit for the next detection cycle to record whether the CCM message is received or not.
And when the number of the received CCM messages is not less than the signal failure generation threshold, further judging whether the number of the received CCM messages is less than the signal degradation generation threshold. And when the number of the received CCM messages is less than the signal degradation generation threshold, setting a signal degradation alarm flag and reporting a signal degradation alarm, namely generating and reporting the signal degradation alarm. The data in the storage medium is further shifted to the left by one bit, i.e. a periodic window sliding is performed, so as to discard the leftmost data (with the longest duration) and free the lowest bit for the next detection cycle to record whether the CCM message is received or not.
As shown in fig. 2, in implementation, the CCM messages are further compared with the signal degradation clear threshold and the signal failure clear threshold according to the number of the received CCM messages, so as to determine whether to generate a signal degradation clear alarm or a signal failure clear alarm. And when the number of the received CCM messages is not less than the signal degradation generation threshold, further judging whether the number of the received CCM messages is more than the signal degradation clearing threshold. And when the number of the received CCM messages is larger than the signal degradation clearing threshold, clearing the signal degradation warning mark and reporting a signal degradation clearing warning, namely generating the signal degradation clearing warning and reporting. The data in the storage medium is further shifted to the left by one bit, i.e. a periodic window sliding is performed, so as to discard the leftmost data (with the longest duration) and free the lowest bit for the next detection cycle to record whether the CCM message is received or not.
And when the number of the received CCM messages is smaller than the signal degradation clearing threshold, further judging whether the number of the received CCM messages is larger than the signal failure clearing threshold. When the number of the received CCM messages is larger than the signal failure clearing threshold, clearing the signal failure warning mark and reporting the signal failure clearing warning, namely generating the signal failure clearing warning and reporting. The data in the storage medium is further shifted to the left by one bit, i.e. a periodic window sliding is performed, so as to discard the leftmost data (with the longest duration) and free the lowest bit for the next detection cycle to record whether the CCM message is received or not.
As shown in fig. 4, the present invention further discloses a device for implementing signal degradation and failure detection based on OAM, which includes a first determining module, a storage module, a second determining module, a first alarm processing module, a third determining module, a second alarm generating module, a fourth determining module, a first clearing alarm module, a fifth determining module, and a second clearing alarm module, wherein the first determining module is configured to determine whether a CCM message is received in a current detection period; the storage module is used for responding to the received CCM message and setting the lowest position of the storage medium to a preset value, the bit width of the storage medium is at least N, the N is the number of detection cycles contained in the detection interval, and the N is an integer greater than 1; the second judging module is used for counting the number of the first preset values in the storage medium when the current detection period is finished, and judging whether the number is smaller than a signal failure generation threshold or not; the first alarm generating module is used for generating a signal failure alarm when the second judging module judges that the number is less than the signal failure generating threshold, and shifting the data in the storage medium by one bit to the left; the third judging module further judges whether the number is less than the signal degradation generation threshold when the second judging module judges that the number is not less than the signal failure generation threshold; the second alarm generating module is used for generating a signal degradation alarm when the third judging module judges that the number is less than the signal degradation generating threshold and shifting the data in the storage medium by one bit to the left; the fourth judging module is used for further judging whether the number is larger than the signal degradation clearing threshold or not when the third judging module judges that the number is not smaller than the signal degradation generating threshold; the first clearing alarm module is used for clearing the signal degradation alarm when the fourth judgment module judges that the number is greater than the signal degradation clearing threshold, and shifting the data in the storage medium by one bit to the left; the fifth judging module is used for further judging whether the number is greater than the signal failure clearing threshold or not when the fourth judging module judges that the number is not greater than the signal degradation clearing threshold; the second clearing alarm module is used for clearing the signal failure alarm and shifting the data in the storage medium by one bit to the left when the fifth judgment module judges that the number is larger than the signal failure clearing threshold.
Specifically, when signal degradation and signal failure detection is performed, whether a CCM message is received in a current detection period is judged through the first judgment module. When a CCM message is received in the current detection period, the lowest position of the storage medium is set to be a first preset value through the storage module so as to identify that the CCM message is received in the latest detection period. And when the CCM message is not received in the current detection period, setting the lowest position of the storage medium as a second preset value so as to identify that the CCM message is received in the latest detection period.
Further, when the current detection period ends, the number of the first preset values in the storage medium can be counted through the second judgment module, that is, the number of the CCM messages received in the past N consecutive detection periods can be obtained. And further comparing the number of the received CCM messages with a signal degradation generation threshold and a signal failure generation threshold respectively to determine whether to generate a signal degradation alarm or a signal failure alarm. When the CCM generating method is implemented, the number of the received CCM messages is compared with a signal failure generating threshold, and whether the number of the received CCM messages is smaller than the signal failure generating threshold or not is judged. When the number of the received CCM messages is smaller than the signal failure generation threshold, a first alarm generation module sets a signal failure alarm mark and reports a signal failure alarm, and data in the storage medium is shifted to the left by one bit, namely, periodic window sliding is carried out, so that the leftmost data (with the longest storage time) is discarded, and the lowest bit is vacated, and whether the CCM messages are received or not is recorded in the next detection period.
And when the number of the received CCM messages is not less than the signal failure generation threshold, further judging whether the number of the received CCM messages is less than the signal degradation generation threshold through a third judging module. When the number of the received CCM messages is smaller than the signal degradation generation threshold, a second alarm module sets a signal degradation alarm flag and reports a signal degradation alarm, and data in the storage medium is shifted to the left by one bit, namely, periodic window sliding is carried out, so that the leftmost data (with the longest storage time) is discarded, and the lowest bit is vacated for the next detection period to record whether the CCM messages are received or not.
When the number of the received CCM messages is not less than the signal degradation generation threshold, whether the number of the received CCM messages is greater than the signal degradation clearing threshold or not is further judged through a fourth judging module. When the number of the received CCM messages is larger than the signal degradation clearing threshold, clearing the signal degradation warning mark and reporting the signal degradation clearing warning through the first clearing warning module, namely generating the signal degradation clearing warning and reporting, and shifting the data in the storage medium by one bit to the left, namely performing periodic window sliding to discard the leftmost data (with the longest duration) and free the lowest bit for recording whether the CCM messages are received or not in the next detection period.
And when the number of the received CCM messages is smaller than the signal degradation clearing threshold, further judging whether the number of the received CCM messages is larger than the signal failure clearing threshold through a fifth judging module. When the number of the received CCM messages is larger than the signal failure clearing threshold, the second clearing alarm module clears the signal failure alarm mark and reports the signal failure clearing alarm, namely, the signal failure clearing alarm is generated and reported. The data in the storage medium is further shifted to the left by one bit, i.e. a periodic window sliding is performed, so as to discard the leftmost data (with the longest duration) and free the lowest bit for the next detection cycle to record whether the CCM message is received or not.
The invention also discloses a device for realizing signal degradation and failure detection based on OAM, which comprises a memory, a processor and a calculator program, wherein the calculator program is stored in the processor and can run in the processor, such as a program for realizing signal degradation and failure detection based on OAM. In implementation, when the processor executes the computer program, each step in the above method may be implemented, such as a step of determining whether a CCM message is received in a current detection period.
Illustratively, the computer program may be divided into one or more units, which are stored in and executed by the memory, to carry out the invention. One or more of the elements may be a sequence of computer program instruction segments for describing the execution of a computer program in the apparatus, which can perform the specified functions.
The invention also discloses a computer readable storage medium, in which a computer program is stored, which, when executed by a processor, implements the above method. Wherein the computer program comprises computer program code, which may be in source code form, an executable file or some intermediate form, etc., and the computer readable medium may comprise any entity or device capable of carrying the computer program code, a recording medium, a usb disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a Random Access Memory (RAM), etc.
The invention makes the data in the storage medium move left periodically to free the lowest bit for the next detection period to record whether the CCM message is received, that is, the window sliding is realized by the periodic displacement of the data in the storage medium, the condition of the CCM message received in the continuous N detection periods can be smoothly recorded, the number of the CCM messages received in the continuous N detection periods can be counted, and then the signal failure and signal degradation detection can be accurately carried out according to the number.
In addition, the invention can also cooperate with the original LOC detection mechanism to provide richer link service state information for the upper-layer system and assist the upper-layer system to make processing strategy decisions.
Therefore, the scope of the present invention should not be limited to the disclosure of the embodiments, but includes various alternatives and modifications without departing from the scope of the present invention, which is defined by the claims of the present patent application.