Message transmission method and device

文档序号:1819652 发布日期:2021-11-09 浏览:18次 中文

阅读说明:本技术 一种报文传输方法及装置 (Message transmission method and device ) 是由 程晓亮 于 2021-08-18 设计创作,主要内容包括:本申请实施例提供了一种报文传输方法及装置,应用于处理器,该方法包括:检测处理器与光模块间的多条链路中是否存在故障链路;当存在故障链路时,处理器修改报文传输机制,基于修改后的报文传输机制,处理器与光模块使用正常的链路传输报文。应用本申请实施例提供的技术方案,在光模块的链路出现故障,等待维修或更换光模块的过程中,光模块仍能工作,降低了因光模块的链路故障,导致断网事故发生的概率。(The embodiment of the application provides a message transmission method and a message transmission device, which are applied to a processor, wherein the method comprises the following steps: detecting whether a fault link exists in a plurality of links between the processor and the optical module; and when a fault link exists, the processor modifies a message transmission mechanism, and based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit messages. By applying the technical scheme provided by the embodiment of the application, the optical module can still work in the process of waiting for maintenance or replacement of the optical module when the link of the optical module breaks down, so that the probability of network disconnection accidents caused by the link failure of the optical module is reduced.)

1. A message transmission method is applied to a processor, wherein a plurality of links exist between the processor and an optical module, and the method comprises the following steps:

detecting whether a fault link exists in the plurality of links;

when a fault link in the plurality of links is detected, modifying a message transmission mechanism so that the modified message transmission mechanism indicates that the processor and the optical module transmit messages through other links, wherein the other links are links in the plurality of links except the fault link.

2. The method according to claim 1, wherein the plurality of links include a plurality of receiving links, and the receiving links are configured to receive a packet sent by the optical module;

the step of detecting whether there is a failed link in the plurality of links includes:

detecting whether a receiving link with abnormal electric signals exists in the plurality of receiving links;

and if the electrical signal of the first receiving link is detected to be abnormal, determining that the first receiving link has a fault.

3. The method of claim 2, wherein the step of modifying the messaging mechanism comprises:

modifying a first message transmission mechanism in the processor so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link;

and modifying a second message transmission mechanism in the optical module so that the modified second message transmission mechanism indicates the optical module to send a message to the processor through the other receiving links.

4. The method according to claim 1, wherein the plurality of links include a plurality of transmission links, and the transmission links are configured to transmit a packet to the optical module;

the step of detecting whether there is a failed link in the plurality of links includes:

detecting whether a bit set as a preset value exists in an internal register of the optical module, wherein the internal register comprises bits corresponding to each transmitting link, the preset value is a value set by the optical module when the electrical signal of the transmitting link is detected to be abnormal, and the preset value indicates that the transmitting link fails;

and if the value of the first bit in the internal register is the preset value, determining that the first sending link corresponding to the first bit has a fault.

5. The method of claim 4, wherein the step of modifying the messaging mechanism comprises:

and modifying a third message transmission mechanism in the processor so that the modified third message transmission mechanism instructs the processor to transmit messages to the optical module through other transmission links, wherein the other transmission links are transmission links except the first transmission link.

6. The method of claim 4, wherein the step of modifying the messaging mechanism comprises:

and modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

7. Method according to any of claims 4-6, wherein before the step of detecting whether a bit set to a preset value is present in an internal register of the light module, the method further comprises:

receiving an interrupt signal sent by the optical module, wherein the interrupt signal is a signal sent by the optical module when a fault sending link exists in the plurality of sending links;

and according to the interrupt signal, executing the step of detecting whether a bit set as a preset value exists in an internal register of the optical module.

8. A message transmission device is applied to a processor, a plurality of links exist between the processor and an optical module, and the device comprises:

a detecting unit, configured to detect whether a faulty link exists in the plurality of links;

and a modification unit, configured to modify a message transmission mechanism when a faulty link is detected in the multiple links, so that the modified message transmission mechanism indicates that the processor and the optical module transmit a message through another link, where the another link is a link of the multiple links except the faulty link.

9. The apparatus according to claim 8, wherein the plurality of links include a plurality of receive links, and the receive links are configured to receive messages sent by the optical module;

the detection unit is specifically configured to:

detecting whether a receiving link with abnormal electric signals exists in the plurality of receiving links;

and when the electrical signal abnormality of the first receiving link is detected, determining that the first receiving link is in failure.

10. The apparatus according to claim 9, wherein the modifying unit is specifically configured to:

modifying a first message transmission mechanism in the processor so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link;

and modifying a second message transmission mechanism in the optical module so that the modified second message transmission mechanism indicates the optical module to send a message to the processor through the other receiving links.

11. The apparatus of claim 8, wherein the plurality of links comprise a plurality of transmit links, and wherein the transmit links are configured to transmit messages to the optical module;

the detection unit is specifically configured to:

detecting whether a bit set as a preset value exists in an internal register of the optical module, wherein the internal register comprises bits corresponding to each transmitting link, the preset value is a value set by the optical module when the electrical signal of the transmitting link is detected to be abnormal, and the preset value indicates that the transmitting link fails;

and if the value of the first bit in the internal register is the preset value, determining that the first sending link corresponding to the first bit has a fault.

12. The apparatus according to claim 11, wherein the modifying unit is specifically configured to:

and modifying a third message transmission mechanism in the processor so that the modified third message transmission mechanism instructs the processor to transmit messages to the optical module through other transmission links, wherein the other transmission links are transmission links except the first transmission link.

13. The apparatus according to claim 11, wherein the modifying unit is specifically configured to:

and modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

14. The apparatus according to any one of claims 11-13, wherein the detection unit is further configured to:

receiving an interrupt signal sent by the optical module, wherein the interrupt signal is a signal sent by the optical module when a fault sending link exists in the plurality of sending links;

and detecting whether a bit set as a preset value exists in an internal register of the optical module according to the interrupt signal.

Technical Field

The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a message.

Background

In a communication networking, an optical module comprises a plurality of transmitting links and a plurality of receiving links. When one of the plurality of sending links and the plurality of receiving links fails, the optical module works abnormally. At this time, the optical module needs to be repaired or replaced so that the operation of the optical module is recovered to normal.

However, during maintenance of the optical module or replacement of the optical module, a communication network based on the optical module is disconnected. If the optical module is a high-speed optical module, that is, the optical module is located at an uplink/convergence position, a large-scale network disconnection accident may occur.

Disclosure of Invention

An object of the embodiments of the present application is to provide a method and an apparatus for transmitting a packet, so as to reduce the probability of a network outage accident when a link of an optical module fails. The specific technical scheme is as follows:

in a first aspect, an embodiment of the present application provides a packet transmission method, which is applied to a processor, where multiple links exist between the processor and an optical module, and the method includes:

detecting whether a fault link exists in the plurality of links;

when a fault link in the plurality of links is detected, modifying a message transmission mechanism so that the modified message transmission mechanism indicates that the processor and the optical module transmit messages through other links, wherein the other links are links in the plurality of links except the fault link.

Optionally, the multiple links include multiple receiving links, where the receiving links are used to receive a message sent by the optical module;

the step of detecting whether there is a failed link in the plurality of links includes:

detecting whether a receiving link with abnormal electric signals exists in the plurality of receiving links;

and if the electrical signal of the first receiving link is detected to be abnormal, determining that the first receiving link has a fault.

Optionally, the step of modifying the message transmission mechanism includes:

modifying a first message transmission mechanism in the processor so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link;

and modifying a second message transmission mechanism in the optical module so that the modified second message transmission mechanism indicates the optical module to send a message to the processor through the other receiving links.

Optionally, the multiple links include multiple sending links, where the sending links are used to send a packet to the optical module;

the step of detecting whether there is a failed link in the plurality of links includes:

detecting whether a bit set as a preset value exists in an internal register of the optical module, wherein the internal register comprises bits corresponding to each transmitting link, the preset value is a value set by the optical module when the electrical signal of the transmitting link is detected to be abnormal, and the preset value indicates that the transmitting link fails;

and if the value of the first bit in the internal register is the preset value, determining that the first sending link corresponding to the first bit has a fault.

Optionally, the step of modifying the message transmission mechanism includes:

and modifying a third message transmission mechanism in the processor so that the modified third message transmission mechanism instructs the processor to transmit messages to the optical module through other transmission links, wherein the other transmission links are transmission links except the first transmission link.

Optionally, the step of modifying the message transmission mechanism further includes:

and modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

Optionally, before the step of detecting whether a bit set to a preset value exists in an internal register of the optical module, the method further includes:

receiving an interrupt signal sent by the optical module, wherein the interrupt signal is a signal sent by the optical module when a fault sending link exists in the plurality of sending links;

and according to the interrupt signal, executing the step of detecting whether a bit set as a preset value exists in an internal register of the optical module.

In a second aspect, an embodiment of the present application provides a packet transmission apparatus, which is applied to a processor, where multiple links exist between the processor and an optical module, and the apparatus includes:

a detecting unit, configured to detect whether a faulty link exists in the plurality of links;

and a modification unit, configured to modify a message transmission mechanism when a faulty link is detected in the multiple links, so that the modified message transmission mechanism indicates that the processor and the optical module transmit a message through another link, where the another link is a link of the multiple links except the faulty link.

Optionally, the multiple links include multiple receiving links, where the receiving links are used to receive a message sent by the optical module;

the detection unit is specifically configured to:

detecting whether a receiving link with abnormal electric signals exists in the plurality of receiving links;

and when the electrical signal abnormality of the first receiving link is detected, determining that the first receiving link is in failure.

Optionally, the modifying unit is specifically configured to:

modifying a first message transmission mechanism in the processor so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link;

and modifying a second message transmission mechanism in the optical module so that the modified second message transmission mechanism indicates the optical module to send a message to the processor through the other receiving links.

Optionally, the multiple links include multiple sending links, where the sending links are used to send a packet to the optical module;

the detection unit is specifically configured to:

detecting whether a bit set as a preset value exists in an internal register of the optical module, wherein the internal register comprises bits corresponding to each transmitting link, the preset value is a value set by the optical module when the electrical signal of the transmitting link is detected to be abnormal, and the preset value indicates that the transmitting link fails;

and if the value of the first bit in the internal register is the preset value, determining that the first sending link corresponding to the first bit has a fault.

Optionally, the modifying unit is specifically configured to:

and modifying a third message transmission mechanism in the processor so that the modified third message transmission mechanism instructs the processor to transmit messages to the optical module through other transmission links, wherein the other transmission links are transmission links except the first transmission link.

Optionally, the modifying unit is specifically configured to:

and modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

Optionally, the detection unit is further configured to:

receiving an interrupt signal sent by the optical module, wherein the interrupt signal is a signal sent by the optical module when a fault sending link exists in the plurality of sending links;

and detecting whether a bit set as a preset value exists in an internal register of the optical module according to the interrupt signal.

In a third aspect, embodiments provide an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: implementing any of the above described message transmission method steps.

In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program product is stored in the computer-readable storage medium, and when being executed by a processor, the computer program product implements any of the message transmission method steps described above.

The embodiment of the application has the following beneficial effects:

in the technical scheme provided by the embodiment of the application, the processor detects whether a fault link exists in a plurality of links between the processor and the optical module. And when a fault link exists, the processor modifies a message transmission mechanism, and based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit messages. Therefore, when the link of the optical module fails and waits for maintenance or replacement of the optical module, the optical module can still work, and the probability of network disconnection accidents caused by the failure of the link of the optical module is reduced.

Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and it is also obvious for a person skilled in the art to obtain other embodiments according to the drawings.

Fig. 1 is a first flowchart of a message transmission method according to an embodiment of the present application;

fig. 2 is a second flowchart of a message transmission method according to an embodiment of the present application;

fig. 3 is a third flowchart illustrating a message transmission method according to an embodiment of the present application;

fig. 4 is a schematic diagram of an application scenario of message transmission according to an embodiment of the present application;

fig. 5 is a fourth flowchart illustrating a message transmission method according to an embodiment of the present application;

fig. 6 is a schematic flowchart of a fifth flow of a message transmission method according to an embodiment of the present application;

fig. 7 is a sixth flowchart of a message transmission method according to an embodiment of the present application;

fig. 8 is a seventh flowchart illustrating a message transmission method according to an embodiment of the present application.

Fig. 9 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present application;

fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the description herein are intended to be within the scope of the present disclosure.

In a communication networking, when one of a plurality of sending links and receiving links between an optical module and a processor fails, the operation of the optical module is abnormal. At this time, the optical module needs to be repaired or replaced so that the operation of the optical module is recovered to normal.

However, during maintenance of the optical module or replacement of the optical module, a communication network based on the optical module is disconnected. If the optical module is a high-speed optical module, that is, the optical module is located at an uplink/convergence position, a large-scale network disconnection accident may occur.

In order to solve the above problem, an embodiment of the present application provides a message transmission method. In the method, a processor detects whether a fault link exists in a plurality of links between the processor and an optical module. And when a fault link exists, the processor modifies a message transmission mechanism, and based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit messages. Therefore, when the link of the optical module fails and waits for maintenance or replacement of the optical module, the optical module can still work, and the probability of network disconnection accidents caused by the failure of the link of the optical module is reduced.

The following describes in detail a message transmission method provided in the embodiment of the present application, with reference to a specific embodiment.

As shown in fig. 1, fig. 1 is a first flowchart of a message transmission method provided in this embodiment, where the method is applied to a processor, and multiple links exist between the processor and an optical module. The message transmission method comprises the following steps.

S101, whether a fault link exists in a plurality of links between the processor and the optical module is detected.

The plurality of links between the processor and the optical module include a plurality of receiving links and/or a plurality of transmitting links. Here, the receive chain and the transmit chain refer to the receive chain and the transmit chain of the processor. The receiving link of the processor is used for receiving the message sent by the optical module, and the receiving link of the processor is equivalent to the sending link of the optical module. The sending link of the processor is used for sending messages to the optical module, and the sending link of the processor is equivalent to the receiving link of the optical module. The receiving link and the transmitting link both refer to the receiving link and the transmitting link of the processor, and are not described in detail later.

Taking the QSFP28 packaged high-speed optical module as an example, a 50G high-speed optical module has 2 groups of receiving links and 2 groups of transmitting links, and a 100G high-speed optical module has 4 groups of receiving links and 4 groups of transmitting links. The transmitting chain may also be referred to as an electrical signal transmitting chain, and the receiving chain may also be referred to as an electrical signal receiving chain.

The QSFP28 packaged high-speed optical module is only an example, and the optical module is not limited.

In this embodiment, the processor may periodically detect whether a failed link exists in the plurality of links between the processor and the optical module. The processor may also detect whether a faulty link exists in the plurality of links between the processor and the optical module after receiving the detection instruction. The detection instruction may be directly input into the processor by the user, or may be acquired from another device, which is not limited herein.

S102, when a fault link exists in the plurality of links, modifying a message transmission mechanism so that the modified message transmission mechanism indicates that the processor and the optical module transmit messages through other links, wherein the other links are links except the fault link in the plurality of links.

The message transmission mechanism is used for indicating which links are adopted by the processor and the optical module to transmit messages.

In the embodiment of the application, when the processor detects that a fault link exists in the plurality of links, the message transmission mechanism is modified, the modified message transmission mechanism indicates that the processor and the optical module transmit a message through a normal link except the fault link in the plurality of links, that is, the modified message transmission mechanism indicates that the processor and the optical module transmit a message through a normal link.

If the processor does not detect that a faulty link exists in the plurality of links, the processor may not perform any processing, and return to re-execute step S101.

Based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit the message. Therefore, when the link of the optical module breaks down and waits for maintenance or replacement of the optical module, as long as a group of normal links exist between the processor and the optical module, the message between the processor and the optical module can be continuously transmitted, and the probability of network failure accidents caused by the link failure of the optical module is reduced.

In the embodiment of the application, when a fault link is detected, a message transmission mechanism is modified, and based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit a message. This strives for a certain time for repair or replacement of the light module.

In most cases, the link cannot be fully loaded, and particularly, the link load at night is smaller, so that in the technical scheme provided by the embodiment of the application, although part of the link is removed, the transmission rate of the link is reduced, but a certain communication requirement can still be met. Therefore, the problem of serious network disconnection can be avoided, and the maintenance of the communication network is facilitated.

In an embodiment of the present application, the plurality of links between the processor and the optical module include a plurality of receiving links, and the receiving links are used for receiving messages sent by the optical module. In this case, an embodiment of the present application further provides a message transmission method, as shown in fig. 2. In this method, step S101 may be refined into steps S1011 and S1012.

S1011, detecting whether there is a receiving link with an abnormal electrical signal in the plurality of receiving links between the processor and the optical module.

S1012, if the electrical signal of the first receiving link is detected to be abnormal, determining that the first receiving link is faulty.

In the embodiment of the present application, the number of the first receiving links may be one or more.

In the circuit, a receiving side of the link can sense whether the electrical signal of the link is abnormal or not. For example, the receiving side can perceive whether the level amplitude of the link satisfies a minimum requirement, and can perceive whether there is an idle signal flow in the link. A link failure may be determined if the level amplitude of the link does not meet a minimum requirement and/or if there is no idle signal flow in the link. Otherwise, the link is determined to be normal.

For the receiving link in the embodiment of the present application, the receiving side is the processor, that is, the processor may sense whether the receiving link fails. The processor can detect whether the abnormal receiving link of the electric signals exists in the plurality of receiving links in real time. If the electrical signals of one or more receiving chains (such as a first receiving chain) in the plurality of receiving chains are abnormal, the first receiving chain is determined to be in failure.

If there is no abnormal electrical signal receiving link among the plurality of receiving links, the processor may determine that there is no faulty receiving link, and then return to step S1011.

In the technical scheme provided by the embodiment of the application, the processor can conveniently and quickly determine the faulty receiving link by detecting the electric signal. Therefore, as long as a group of normal receiving links exist between the processor and the optical module, the messages between the processor and the optical module can be continuously transmitted, and the probability of network failure accidents caused by the failure of the receiving links of the optical module is reduced.

Based on the message transmission method shown in fig. 2, an embodiment of the present application further provides a message transmission method, as shown in fig. 3. In this method, step S102 may be refined into steps S1021 and S1022.

And S1021, modifying a first message transmission mechanism in the processor, so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link.

In this embodiment, the first message transmission mechanism is a message transmission mechanism in a processor. The message transmission mechanism instructs the processor to receive the messages sent by the optical module through which receiving links.

Upon detecting a failure of the first receive link, the processor modifies the first message transmission mechanism. The modified first message transmission mechanism instructs the processor to receive messages sent by the optical module through other receiving links. That is, based on the modified first message transmission mechanism, the processor receives the message sent by the optical module through the normal receiving link, thereby ensuring the communication between the processor and the optical module.

S1022, modify the second message transmission mechanism in the optical module, so that the modified second message transmission mechanism instructs the optical module to send a message to the processor through another receiving link.

In this embodiment of the present application, the second message transmission mechanism is a message transmission mechanism in an optical module. The message transmission mechanism instructs the optical module through which receive links to send messages to the processor.

When the failure of the first receiving link is detected, the processor modifies the first message transmission mechanism and simultaneously modifies the second message transmission mechanism in the optical module. The modified second message transmission mechanism instructs the optical module to send messages to the processor through other receiving links. That is, based on the modified second message transmission mechanism, the optical module sends a message to the processor through the normal receiving link, so that the communication between the processor and the optical module is ensured.

In the embodiment of the present application, the execution sequence of steps S1021 and S1022 is not limited.

In one embodiment of the application, upon detecting a failure of the first receive link, the processor may send a notification message to the optical module over an Inter-Integrated Circuit (IIC) bus, the notification message instructing the optical module to modify the second messaging mechanism. And the optical module modifies a second message transmission mechanism in the optical module based on the notification message, and the modified second message transmission mechanism instructs the optical module to send a message to the processor through other receiving links.

For example, the link structure between the optical module and the processor is shown in fig. 4. Fig. 4 takes a 100G high-speed optical module packaged by QSFP28 as an example, and the links between the optical module and the processor include 4 receiving links, namely receiving link 1, receiving link 2, receiving link 3, and receiving link 4.

The processor detects whether the abnormal receiving link of the electric signals exists in the receiving links 1-4 in real time. And if the electric signal of the receiving link 2 is abnormal, determining that the receiving link 2 is in failure, and modifying the first message transmission mechanism by the processor. The modified first message transmission mechanism indicates: the processor receives the message sent by the optical module through the receiving link 1, the receiving link 3 and the receiving link 4.

The processor can send a notification message to the optical module through the IIC while modifying the first message transmission mechanism. The optical module modifies a second message transmission mechanism in the optical module based on the notification message, wherein the modified second message transmission mechanism indicates that: the optical module sends a message to the processor through the receiving link 1, the receiving link 3 and the receiving link 4.

In another embodiment of the present application, the plurality of links between the processor and the optical module include a plurality of transmission links, and the transmission links are used for transmitting messages received by the optical module. In this case, an embodiment of the present application further provides a message transmission method, as shown in fig. 5. In this method, step S101 may be subdivided into steps S1013 and S1014.

S1013, detecting whether a bit set as a preset value exists in an internal register of the optical module, where the internal register includes bits corresponding to each transmission link, the preset value is a value set by the optical module when detecting that an electrical signal of the transmission link is abnormal, and the preset value indicates a failure of the transmission link.

And S1014, if the value of the first bit in the internal register is a preset value, determining that the first transmission link corresponding to the first bit has a fault.

In this embodiment of the application, the number of the first bits may be one or more, and correspondingly, the number of the first transmission links may also be one or more.

The internal register of the optical module includes bits corresponding to each transmission link, that is, the bits in the internal register correspond to the transmission links one to one. The values of the bits in the internal register include preset values and other values. Wherein the preset value indicates that the transmission link is failed, and the other values indicate that the transmission link is normal. In the embodiment of the present application, the initial value of the bit in the internal register is other values.

The preset value and other values can be set according to actual requirements. For example, the preset value is 1, and the other values are 0; or the preset value is 0 and the other values are 1.

Based on the working principle described in the above section of fig. 2, that is: in the circuit, a receiving side of the link can sense whether the electrical signal of the link is abnormal or not. For the transmission link in the embodiment of the application, a receiver of the transmission link is the optical module, that is, the optical module can sense whether the transmission link is in failure.

The optical module can detect whether the abnormal sending link of the electric signal exists in the plurality of sending links in real time. If the electrical signals of one or more of the plurality of transmission links (for example, the first transmission link) are abnormal, the first transmission link is determined to be in failure. When the optical module detects that the electrical signal of the first transmission link is abnormal, namely when the first transmission link is determined to be in fault, the value of the bit corresponding to the first transmission link in the internal register is set to be a preset value.

The processor can detect in real time whether a bit set to a preset value exists in an internal register of the optical module. If the processor detects that a bit set to a preset value (for example, a value of a first bit) exists in an internal register of the optical module, it is determined that a transmission link (for example, a first transmission link) corresponding to the first bit has a fault.

If the processor detects that there is no bit set as the preset value in the internal register of the optical module, the processor may determine that there is no faulty transmission link, and then return to step S1013.

In the technical scheme provided by the embodiment of the application, the processor can conveniently and quickly determine the sending link with the fault through the internal register of the detection optical module. Therefore, as long as a group of normal sending links exist between the processor and the optical module, the messages between the processor and the optical module can be continuously transmitted, and the probability of network disconnection accidents caused by the failure of the sending links of the optical module is reduced.

Based on the message transmission method shown in fig. 5, an embodiment of the present application further provides a message transmission method, as shown in fig. 6. In this method, step S102 may be refined to step S1023.

S1023, a third message transmission mechanism in the processor is modified, so that the modified third message transmission mechanism instructs the processor to send a message to the optical module through other sending links, where the other sending links are sending links other than the first sending link.

In this embodiment, the third message transmission mechanism is a message transmission mechanism in the processor. The message transmission mechanism instructs the processor through which transmission links to transmit messages to the optical module.

The processor modifies the third message transmission mechanism upon detecting a failure of the first transmission link. And the modified third message transmission mechanism instructs the processor to send messages to the optical module through other sending links. That is, based on the modified third message transmission mechanism, the processor sends a message to the optical module through the normal sending link, so that the communication between the processor and the optical module is ensured.

Based on the message transmission method shown in fig. 5, an embodiment of the present application further provides a message transmission method, as shown in fig. 7. In this method, step S102 may be refined to step S1024.

And S1024, modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive the messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

In this embodiment, the fourth packet transmission mechanism is a packet transmission mechanism in the optical module. The message transmission mechanism indicates which processors the optical module receives the messages sent by the processors through the sending links of the processors.

The processor may modify a fourth message transmission mechanism in the optical module upon detecting the failure of the first transmission link. The modified fourth message transmission mechanism indicates the optical module to receive the message sent by the processor through other sending links. That is, based on the modified fourth message transmission mechanism, the optical module receives the message sent by the processor through the normal sending link, so as to ensure the communication between the processor and the optical module.

In this embodiment of the present application, the embodiments shown in fig. 6 and fig. 7 may be combined to modify the third message transmission mechanism and the fourth message transmission mechanism.

In another embodiment of the present application, when the optical module detects a failure of the first transmission link, the optical module may directly modify a fourth message transmission mechanism in the optical module, so that the modified fourth message transmission mechanism indicates the optical module to receive a message sent by the processor through another transmission link.

In the circuit, a receiving side of the link can sense whether the electrical signal of the link is abnormal or not. In the embodiment of the application, the optical module serves as a receiving party and can sense whether a sending link of the processor fails. And when the optical module senses that a plurality of sending links of the processor have a fault link, the fourth message transmission mechanism can be modified, so that the modified fourth message transmission mechanism indicates the optical module to receive the messages sent by the processor through other sending links. The time consumed from the detection of the first sending link failure to the completion of the modification of the fourth message transmission mechanism is effectively shortened, and the packet loss is further reduced.

In this embodiment, the fourth message transmission mechanism modification manner shown in fig. 7 and the fourth message transmission mechanism in the optical module directly modified by the optical module may be combined. Therefore, double guarantee is provided for modifying the fourth message transmission mechanism, the optical module can be further ensured to receive the message sent by the processor through a normal sending link, and the communication between the processor and the optical module is ensured.

In an embodiment of the present application, the processor may query an internal register of the optical module through the IIC, detect whether a bit set as a preset value exists in the internal register of the optical module, and further determine a failed transmission link. When detecting that the first transmission link is failed, the process may further send a notification message to the optical module through the IIC, where the notification message instructs the optical module to modify the fourth packet transmission mechanism. And the optical module modifies a fourth message transmission mechanism in the optical module based on the notification message, and the modified fourth message transmission mechanism instructs the optical module to send messages to the processor through other receiving links.

For example, the link structure between the optical module and the processor is shown in fig. 4. Fig. 4 takes a 100G high-speed optical module packaged by QSFP28 as an example, and the links between the optical module and the processor include 4 transmission links, namely transmission link 1, transmission link 2, transmission link 3, and transmission link 4. The preset value is 1.

And the processor queries an internal register of the optical module through the IIC to determine a fault sending link. The specific determination method is as follows: and detecting whether a bit set to be 1 exists in an internal register of the optical module in real time.

And the processor modifies the third message transmission mechanism when detecting that the transmission link 1 and the transmission link 2 are in failure. The modified third message transmission mechanism indicates: the processor sends a message to the optical module through the sending link 3 and the sending link 4.

The processor may send a notification message to the optical module through the IIC while modifying the third message transmission mechanism. The optical module modifies a fourth message transmission mechanism in the optical module based on the notification message, and the modified fourth message transmission mechanism indicates the optical module to receive the message sent by the processor through the sending link 3 and the sending link 4.

Based on the message transmission methods shown in fig. 5 to 7, the embodiment of the present application further provides a message transmission method. As shown in fig. 8, the method may further include step S1010 before the step of detecting whether a bit set to a preset value exists in the internal register of the optical module, that is, step S1013.

S1010, receiving an interrupt signal sent by the optical module, where the interrupt signal is a signal sent by the optical module when detecting that a faulty transmission link exists in the plurality of transmission links.

As described in the section of fig. 5, the optical module may perceive the failed transmit link. The optical module may send an interrupt signal to the processor when it senses a failure of the first transmission link. The processor then executes step S1013 in accordance with the interrupt signal.

The link structure between the optical module and the processor shown in fig. 4 is still taken as an example for description. The optical module can send an interrupt signal to the processor when sensing that the transmission link 1 and the transmission link 2 are failed. And the processor queries an internal register of the optical module through the IIC, determines a fault sending link and modifies a message transmission mechanism.

Corresponding to the above message transmission method, an embodiment of the present application provides a message transmission apparatus, as shown in fig. 9, which is applied to a processor, where multiple links exist between the processor and an optical module, and the apparatus includes:

a detecting unit 901, configured to detect whether a faulty link exists in multiple links;

a modifying unit 902, configured to modify a message transmission mechanism when a faulty link is detected in multiple links, so that the modified message transmission mechanism indicates that a message is transmitted between the processor and the optical module through other links, where the other links are links of the multiple links except the faulty link.

In an embodiment of the present application, the plurality of links between the processor and the optical module include a plurality of receiving links, and the receiving links are used for receiving messages sent by the optical module.

In this case, the detection unit 901 may be specifically configured to:

detecting whether a receiving link with abnormal electric signals exists in a plurality of receiving links;

and when the electrical signal abnormality of the first receiving link is detected, determining that the first receiving link is in failure.

In an embodiment of the present application, the modifying unit 902 may specifically be configured to:

modifying a first message transmission mechanism in the processor so that the modified first message transmission mechanism indicates the processor to receive messages sent by the optical module through other receiving links, wherein the other receiving links are receiving links except the first receiving link;

and modifying a second message transmission mechanism in the optical module so that the modified second message transmission mechanism indicates the optical module to send a message to the processor through the other receiving links.

In an embodiment of the present application, the plurality of links between the processor and the optical module include a plurality of transmission links, and the transmission links are used for transmitting a message to the optical module;

in this case, the detecting unit 901 may be specifically configured to:

detecting whether a bit set as a preset value exists in an internal register of the optical module, wherein the internal register comprises bits respectively corresponding to each transmitting link, the preset value is a value set by the optical module when the electrical signal of the transmitting link is detected to be abnormal, and the preset value indicates that the transmitting link fails;

and when the value of the first bit in the internal register is a preset value, determining that the first transmission link corresponding to the first bit has a fault.

In an embodiment of the present application, the modifying unit 902 may specifically be configured to:

and modifying a third message transmission mechanism in the processor so that the modified third message transmission mechanism instructs the processor to transmit messages to the optical module through other transmission links, wherein the other transmission links are transmission links except the first transmission link.

In an embodiment of the present application, the modifying unit 902 may specifically be configured to:

and modifying a fourth message transmission mechanism in the optical module so that the modified fourth message transmission mechanism indicates the optical module to receive messages sent by the processor through other sending links, wherein the other sending links are sending links except the first sending link.

In an embodiment of the present application, the detecting unit 901 may further be configured to:

receiving an interrupt signal sent by an optical module, wherein the interrupt signal is a signal sent by the optical module when a fault sending link exists in a plurality of sending links;

and detecting whether a bit set as a preset value exists in an internal register of the optical module or not according to the interrupt signal.

In the technical scheme provided by the embodiment of the application, the processor detects whether a fault link exists in a plurality of links between the processor and the optical module. And when a fault link exists, the processor modifies a message transmission mechanism, and based on the modified message transmission mechanism, the processor and the optical module use a normal link to transmit messages. Therefore, when the link of the optical module fails and waits for maintenance or replacement of the optical module, the optical module can still work, and the probability of network disconnection accidents caused by the failure of the link of the optical module is reduced.

Corresponding to the message transmission method, an embodiment of the present application further provides an electronic device, as shown in fig. 10, including a processor 1001 and a machine-readable storage medium 1002, where the machine-readable storage medium 1002 stores machine-executable instructions capable of being executed by the processor 1001, and the processor 1001 is caused by the machine-executable instructions to: implementing any of the above message transmission method steps.

The machine-readable storage medium may include Random Access Memory (RAM) and may also include Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the machine-readable storage medium may be at least one memory device located remotely from the processor.

The Processor may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), etc.; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.

Corresponding to the message transmission method, in another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program product is stored, and the computer program product, when executed by a processor, implements any of the message transmission method steps described above.

In another embodiment, the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the message transmission methods in the above embodiments.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the invention are, in whole or in part, generated upon loading and execution of the computer program product instructions on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

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 phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.

The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:光学链路诊断系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!