WO2023273100A1 - Port state adjustment method and apparatus, and computer-readable storage medium - Google Patents

Port state adjustment method and apparatus, and computer-readable storage medium Download PDF

Info

Publication number
WO2023273100A1
WO2023273100A1 PCT/CN2021/130417 CN2021130417W WO2023273100A1 WO 2023273100 A1 WO2023273100 A1 WO 2023273100A1 CN 2021130417 W CN2021130417 W CN 2021130417W WO 2023273100 A1 WO2023273100 A1 WO 2023273100A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
state
information
message
status
Prior art date
Application number
PCT/CN2021/130417
Other languages
French (fr)
Chinese (zh)
Inventor
周国斌
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023273100A1 publication Critical patent/WO2023273100A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • H04L49/111Switch interfaces, e.g. port details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • Embodiments of the present disclosure relate to the communication field, and in particular, relate to a port state adjustment method, device, computer-readable storage medium, and electronic device.
  • Link aggregation control protocol Link Aggregation Control Protocol
  • LACP Link Aggregation Control Protocol
  • This technology can treat multiple physical connections as a single logical connection, allowing two network devices to be connected in parallel through multiple ports and transmit data at the same time to provide higher bandwidth and throughput.
  • Dynamic aggregation is a way to realize link aggregation.
  • information is exchanged with the peer through the link aggregation control protocol data unit (Link Aggregation Control Protocol Data Unit, referred to as LACPDU).
  • LACPDU Link Aggregation Control Protocol Data Unit
  • Embodiments of the present disclosure provide a port state adjustment method, device, computer-readable storage medium, and electronic device, so as to at least solve the problem of data packet loss caused by abnormal port state in the related art.
  • a port state adjustment method including:
  • the first device acquires a first packet from the second device, where the first packet carries first status information, and the first status information is used to indicate a first port included in the first device state, the first device performs data transmission with the second device through the first port;
  • the first device determines capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether to allow The first port returns to a normal state from an abnormal state;
  • the first device activates the first port, so that the state of the first port changes from the abnormal state to the normal state, wherein, the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
  • the determining, by the first device, the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
  • the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the first port read by the first device When the actual state of a port is the normal state, determine that the capability information of the first port is the first capability information.
  • the determining, by the first device, the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
  • the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state
  • the first port read by the first device If the actual state of the port is the normal state and the first device performs the first protocol interaction negotiation with the second device and determines that the first port can be restored, determine the state of the first port
  • the capability information is the first capability information.
  • the method further includes:
  • the first device sends a second message to the second device, where the second message includes second state information for indicating that the state of the first port has returned to the normal state;
  • the first device terminates sending a third message to the second device, where the third message includes third status information for indicating that the status of the first port is the abnormal status.
  • the method further includes:
  • the first device performs a second protocol interaction negotiation with the second device through the first port
  • the first device determines that the negotiation with the second device cannot be successful based on the second protocol interaction negotiation process, deactivate the first port, so that the state of the first port is changed to The normal state transitions to the abnormal state.
  • the method further includes:
  • the first device sends a fourth message to the second device to instruct the second device to perform deactivation processing on a second port included in the second device that is connected to the first port, wherein,
  • the fourth message includes fourth status information for indicating that the status of the first port is the abnormal status.
  • the method further includes:
  • the first device sends alarm information.
  • the method further includes:
  • the first device replies a fifth message to the second device based on the first message, where the fifth message carries fifth state information, and the fifth state information is used to indicate that the The state of the first port obtained by the first device based on the first packet;
  • the first device acquires the fifth state information, and compares the first state information with the fifth state information to obtain a comparison result;
  • the method further includes:
  • the first device sends a notification message to the second device, where the notification message is used to notify the second device to resend the packet.
  • the method further includes:
  • the first device constructs and sends a sixth message, where the sixth message carries sixth state information, and the sixth state information is used to indicate the state indicated by the first state information.
  • an apparatus for adjusting a port state is provided, which is applied to a first device, including:
  • a message collection module configured to acquire a first message from a second device, wherein the first message carries first state information, and the first state information is used to indicate that the first device includes The state of the first port of the device, the first device performs data transmission with the second device through the first port;
  • a capability determining module configured to determine capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether allowing the first port to recover from an abnormal state to a normal state;
  • a port activation module configured to activate the first port when the capability information is the first capability information, so that the state of the first port changes from the abnormal state to the normal state , wherein the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
  • a computer-readable storage medium wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform any one of the above-mentioned methods when running Steps in the examples.
  • an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a port state adjustment method according to an embodiment of the disclosure
  • Fig. 2 is a flow chart of a port state adjustment method according to an embodiment of the present disclosure
  • Fig. 3 is a structural block diagram of a port state adjustment device according to an embodiment of the present disclosure.
  • Fig. 4 is a structural block diagram of a protocol network according to a specific embodiment of the present disclosure.
  • Fig. 5 is a structural schematic diagram 1 according to a specific embodiment of the present disclosure.
  • FIG. 6 is a flowchart one according to a specific embodiment of the present disclosure.
  • FIG. 7 is a second structural schematic diagram according to a specific embodiment of the present disclosure.
  • Fig. 8 is a second flowchart according to a specific embodiment of the present disclosure.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a port state adjustment method according to an embodiment of the present disclosure.
  • the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) and a memory 104 configured to store data, wherein the above-mentioned mobile terminal may also include a transmission device 106 and an input/output device 108 configured to communicate.
  • processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.
  • memory 104 configured to store data
  • the above-mentioned mobile terminal may also include a transmission device 106 and an input/output device 108 configured to communicate.
  • FIG. 1 is only for illustration, and it does not limit the structure of the above mobile terminal.
  • the mobile terminal may also include more or fewer components than those shown in FIG. 1 , or have a different configuration from that shown in FIG. 1 .
  • the memory 104 may be configured to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a port state adjustment method in an embodiment of the present disclosure, and the processor 102 executes the computer program stored in the memory 104 , so as to perform various functional applications and data processing, that is, to realize the above-mentioned method.
  • the memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory that is remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is configured to receive or transmit data via a network.
  • the specific example of the above network may include a wireless network provided by the communication provider of the mobile terminal.
  • the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a port state adjustment method according to an embodiment of the present disclosure. As shown in FIG. 2 , the process includes the following steps:
  • Step S202 the first device acquires a first message from the second device, wherein the first message carries first state information, and the first state information is used to indicate the state of the first port included in the first device, The first device performs data transmission with the second device through the first port;
  • the first status information includes (but is not limited to) activation/inactivation/abnormal status information of the first port included in the first device, address information of the first port, port type of the first port, and other information
  • the number of the first port can be (but not limited to) one or at least two
  • both the first device and the second device are (but not limited to) devices or devices that can execute the interaction of the LACP protocol, such as switches, gateways, etc.
  • the number of the first device and the second device can be (but not limited to) multiple, as long as the information interaction between the first device and the second device can be realized
  • the first message can be (but not limited to)
  • the data packet can also be other information streams capable of various information
  • the data transmission method of the first message can be (but not limited to) Ethernet, etc., or a wireless network, such as 3G/4G/5G/quantum communication Wait.
  • the first device receives the LACP packet sent by the second device, and parses the first packet to obtain port parameters in the first packet.
  • Step S204 the first device determines the capability information of the first port based on the first state information and the actual state of the first port read by the first device, wherein the capability information is used to indicate whether the first port is allowed to recover from the abnormal state to normal state;
  • the actual state of the first port is the state of the first port within the time range of receiving the first message, and the time range can be the time node when the first message is received, or a specified delay time.
  • the actual status reading of the first port can be (but not limited to) realized by reading the status code identifying the first port, or by receiving the port status information or signal fed back by the first port
  • the determination may also be realized by other means; the actual status of the first port includes (but not limited to) normal, abnormal, activated but not activated, inactivated, and so on.
  • the first device reads the actual port status of the first device itself while parsing the first packet.
  • Step S206 if the capability information is the first capability information, the first device activates the first port so that the state of the first port changes from an abnormal state to a normal state, wherein the first capability information is used to indicate The first port is allowed to recover from the abnormal state to the normal state.
  • the first capability information is that the first port is in an abnormal state that can be activated but not activated.
  • the normal information exchange of the first port can be realized, and the abnormal state of the port can be avoided. data loss.
  • the activation process for the first port may be normal activation or forced activation, and the activation status may indicate that the first port remains activated within a predetermined time, or indicate that the first port is always in an activated state;
  • the method can be realized by sending an activation command to the first port, or by adjusting the physical information (such as address code, current and voltage, etc.) of the first port.
  • the first device confirms whether the first port in the LACP aggregation group between itself and the second device can recover through LACP protocol interaction and negotiation, and when the physical status of the first port itself is normal, the port may be blocked due to protocol interaction failure. Deactivated and unable to send and receive data. Therefore, if the physical state of the port of the first device is normal, but when data cannot be sent and received due to protocol interaction, a forced activation command can be sent to the first port to make it forcedly activated; wherein, the physical state of the first port can (but Not limited to) is determined by polling and scanning the first port.
  • the first port can perform data interaction normally, thereby avoiding the data packet loss phenomenon caused by the abnormal state of the port, and solving the data loss caused by the abnormal state of the port. Packet problem, improved data transmission stability.
  • the execution subject of the above steps may be a base station, a terminal, etc., but is not limited thereto.
  • the first device determining the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
  • step S2042 the first device determines that the first state information is used to indicate that the state of the first port included in the first device is an abnormal state or a normal state, and the actual state of the first port read by the first device is a normal state. In some cases, it is determined that the capability information of the first port is the first capability information.
  • the second device since the first message is from the second device, there may be a situation where the state information of the first port lags behind, and by comparing and confirming the state information of the first port, the second device can store The state information of the first port of the device is updated, so as to prevent the second device from sending and receiving packets by mistake.
  • the first device determining the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
  • step S2044 the first device determines that the first state information is used to indicate that the state of the first port included in the first device is an abnormal state or a normal state, the actual state of the first port read by the first device is a normal state, and In a case where the first device determines that the first port can be recovered after performing the first protocol interaction negotiation with the second device, determine the capability information of the first port as the first capability information.
  • the purpose of determining the capability information of the first port as the first capability information after it is determined that the first port can be restored is to perform a forced activation operation on the first port, so that the first port can realize normal operation. data interaction.
  • the method further includes:
  • Step S208 the first device sends a second message to the second device, wherein the second message includes second state information for indicating that the state of the first port has returned to a normal state;
  • Step S2010 the first device terminates sending a third message to the second device, wherein the third message includes third status information for indicating that the status of the first port is an abnormal status.
  • the purpose of sending the second message to the second device is to enable the second device to update the stored state information of the first port, and the purpose of stopping sending the third message is to prevent the second device from Messages send feedback messages to avoid data loss.
  • both the second message and the third message may include (but not limited to) information such as status information and an IP address of the first port, and the first port indicated by the third message may be the first port included in the first device.
  • One or more of the multiple first ports similarly, the first port indicated by the second message may be one or more of the multiple first ports contained in the first device; the second message
  • the method of sending the third message may be (but not limited to) Ethernet, or wireless network, such as 3G/4G/5G/quantum communication.
  • the first device when entering the fast recovery processing flow (that is, the forced activation process), the first device needs to directly restore (that is, forcibly activate) the port that has not been restored, and at the same time, the first device sends a message that the first port has been restored to the second device.
  • LACP protocol packets At the same time, it is necessary to intercept the LACP protocol message whose port status has not been restored and which the first device is about to send.
  • the method further includes:
  • Step S2012 the first device performs a second protocol interaction negotiation with the second device through the first port
  • Step S2014 when the first device determines that it cannot successfully negotiate with the second device based on the second protocol interaction negotiation process, it performs a first deactivation process on the first port, so that the state of the first port changes from a normal state to an abnormal state state.
  • the activation process after the activation process is performed, it is determined whether the first port is recovered through interactive negotiation, and then subsequent data interaction is performed, so as to avoid data loss caused by the unrecovered port status;
  • the purpose of port deactivation is to avoid data interaction with abnormal ports and further avoid data loss.
  • the second protocol may be (but not limited to) the LACP protocol, or other interactive protocols;
  • the deactivation process may be (but not limited to) adjusting the state of the first port, or making the first port Identified as abnormal;
  • the way of deactivation processing may be sending a deactivation command to the first port, or changing the physical information of the first port, etc.
  • the status is rolled back, and the fast-recovery port of the first device is deactivated from the aggregated link.
  • the method further includes:
  • Step S2016 the first device sends a fourth message to the second device to instruct the second device to perform a second deactivation process on the second port connected to the first port included in the second device, wherein, in the fourth message It includes fourth state information for indicating that the state of the first port is an abnormal state.
  • the second port when it is determined that the first port cannot be recovered, the second port is also made to perform the second deactivation process, so as to prevent the second port from sending data to the first port.
  • the information sent in different states to indicate that the state of the first port is an abnormal state may be the same information or different information.
  • the fourth state information Both the aforementioned third status information and the aforementioned third status information are used to indicate that the status of the first port is an abnormal status, and the two may be the same information or different information.
  • an LACP protocol packet for port deactivation is sent to the second device, so as to notify the second device to perform deactivation processing on the docking port of the second device.
  • the method further includes:
  • Step S2018 the first device sends an alarm message.
  • the purpose of sending the alarm information is to remind the staff to perform further processing on the relevant ports, so as to adjust the ports in time.
  • the abnormal state of the first device port that cannot be recovered is sent through an alarm or other means, and relevant personnel are notified to perform troubleshooting.
  • the method further includes:
  • Step S2022 the first device replies a fifth message to the second device based on the first message, wherein the fifth message carries fifth state information, and the fifth state information is used to instruct the first device to The obtained state of the first port;
  • Step S2024 the first device acquires fifth state information, and compares the first state information with the fifth state information to obtain a comparison result
  • Step S2026 when the first device determines that the comparison result indicates that the states indicated by the first state information and the fifth state information are different, stop replying the fifth message to the second device.
  • a first device and a second device having the same function of sending and receiving data may be set.
  • the first device After the first device receives the fifth message sent by the second device, it parses the fifth message to determine the fifth status information, and at the same time sends reply information to the second device through the control system in the first device , and before the reply information is sent, the first device captures and analyzes the reply that has been generated but not sent, and determines whether the fifth state information is consistent with the actual state of the first port read by the first device.
  • the reply message is intercepted; correspondingly, after the second device receives the fifth message sent by the first device, the control system of the second device also generates a reply message, and before sending the reply message
  • the fifth state information is compared with the pre-stored first state information, and if they are inconsistent, the reply is intercepted.
  • the method further includes:
  • Step S20262 the first device sends a notification message to the second device, wherein the notification message is used to notify the second device to resend the packet.
  • the purpose of resending the message is to ensure the consistency of the port status, realize normal data interaction, and avoid data loss.
  • the second device may also send a notification message to the first device, so as to instruct the first device to resend the message.
  • the method further includes:
  • Step S20264 the first device constructs and sends a sixth message, wherein the sixth message carries sixth state information, and the sixth state information is used to indicate the state indicated by the first state information.
  • the purpose of reconstructing the sixth packet is to update the port status information stored in the second device and ensure consistency of the port status.
  • the second device may also reconstruct the sixth message, so as to notify the first device that the first port status information stored in the second device has been updated.
  • the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation.
  • the technical solution of the present disclosure can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present disclosure.
  • module may be a combination of software and/or hardware that realizes a predetermined function.
  • devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
  • Fig. 3 is a structural block diagram of a port state adjustment device according to an embodiment of the present disclosure. As shown in Fig. 3 , the device is applied to the first device, and the device includes:
  • the message collection module 32 is configured to obtain a first message from the second device, wherein the first message carries first state information, and the first state information is used to indicate that the first message in the first device The state of the included first port, the first device performs data transmission with the second device through the first port;
  • a capability determining module 34 configured to determine capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate Whether to allow the first port to recover from an abnormal state to a normal state;
  • the port activation module 36 is configured to activate the first port when the capability information is the first capability information, so that the state of the first port changes from the abnormal state to the normal state state, wherein the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
  • the capability determination module 34 includes:
  • the first determining unit 342 is configured to determine that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the first device reads If the actual state of the first port is the normal state, determine that the capability information of the first port is the first capability information.
  • the capability determination module 34 includes:
  • the second determining unit 344 is configured to determine that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the information read by the first device If the actual state of the first port is the normal state, and it is determined that the first port can be recovered after the first device performs the first protocol interaction negotiation with the second device, determine that the second The capability information of a port is the first capability information.
  • the device also includes:
  • the first message sending module 38 is configured to send a second message to the second device after the first device activates the first port, wherein the second message includes There is second state information for indicating that the state of the first port has been restored to the normal state;
  • the second message sending module 310 is configured to stop sending a third message to the second device, wherein the third message includes a first message indicating that the state of the first port is the abnormal state Three state information.
  • the device also includes:
  • the interaction module 312 is configured to perform a second protocol interaction negotiation with the second device through the first port after the activation process is performed on the first port;
  • the state conversion module 314 is configured to deactivate the first port when it is determined that the negotiation with the second device cannot be successful based on the second protocol interaction negotiation process, so that the first port state transition from said normal state to said abnormal state.
  • the device also includes:
  • the second activation module 316 is configured to, after deactivating the first port, send a fourth message to the second device to instruct the second device to The second port connected to the first port performs deactivation processing, wherein the fourth message includes fourth status information for indicating that the status of the first port is the abnormal status.
  • the device also includes:
  • the alarm module 318 is configured to send alarm information after deactivating the first port.
  • the device also includes:
  • the third message sending unit 322 is configured to, after acquiring the first message from the second device, reply a fifth message to the second device based on the first message, wherein the fifth message carrying fifth state information, where the fifth state information is used to indicate the state of the first port obtained by the first device based on the first packet;
  • the status information collection unit 324 is configured to acquire the fifth status information, and compare the first status information with the fifth status information to obtain a comparison result;
  • the fourth message sending unit 326 is configured to stop replying to the second device when it is determined that the comparison result is used to indicate that the states indicated by the first state information and the fifth state information are different The fifth message.
  • the device also includes:
  • the message sending subunit 3262 is configured to send a notification message to the second device after terminating the recovery of the fifth message to the second device, where the notification message is used to notify the second device to resume Send message.
  • the device also includes:
  • the fifth message sending unit 3264 is configured to construct and send a sixth message after terminating restoring the fifth message to the second device, wherein the sixth message carries sixth state information , the sixth state information is used to indicate the state indicated by the first state information.
  • the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
  • a network environment in which two devices interact through aggregated links.
  • the LACP protocol message based on the IEEE802.3ad standard stores the port states of the local device and the peer device respectively.
  • the status of the device port can read the status of the sending port in the received message.
  • the subsequent protocol message reply fill in the own port status and the read port status in the message and send it.
  • the status of the peer read in the reply message may be wrong. In view of this situation, the data transmission method of the present application can solve this problem.
  • the second device may wrongly judge the port status of the first device.
  • the port status is 0x05, which means that the port of the first device cannot be restored currently.
  • the port status of the first device in the reply message is 0x0d, indicating that the port of the first device can be aggregated, that is, can be restored. This is due to an error in the state of the port, causing the second port to send the data stream to the wrongly judged first device port, thus causing packet loss.
  • Data exchange can be performed normally only after the first device port is actually recovered.
  • this embodiment provides a data transmission system, which is used in the aforementioned first device, including:
  • a packet sending and receiving module 51 which is mainly responsible for receiving and sending LACP protocol packets.
  • the module can be responsible for receiving the message and handing the message information to the protocol module of the first device for analysis.
  • the first device needs to perform fast recovery processing, it can send the LACP protocol message for port recovery, and intercept the LACP protocol message for port recovery sent by the first device.
  • a protocol module 52 which is mainly responsible for parsing LACP protocol messages, recording port states in the messages and comparing port state differences. If the first device needs to perform fast port recovery processing, the protocol module is also responsible for constructing an LACP protocol message, and handing it over to the sending and receiving packet module to send to the second device. In addition, the protocol module is also responsible for judging whether the port undergoing fast recovery processing on the first device needs state rollback, that is, to deactivate the fast recovered port from the aggregated link, and re-interact with the LACP protocol to determine the port status.
  • Port module 53 this module is mainly responsible for reading the actual port status of the first device's ready to restore port when necessary, and handing the read port status to the protocol module, the actual status and the second device sent by the protocol module The port status of the first device in the LACP message is compared and processed. In addition, the module notifies the port to perform fast recovery during fast recovery processing or notifies the port to deactivate when state rollback is required.
  • Alarm module 54 this module is mainly responsible for sending relevant alarms to colleagues who perform state rollback port deactivation when the port of the first device is quickly restored and found that the port cannot be negotiated successfully through subsequent LACP protocol interaction. Notify the staff to troubleshoot in time.
  • the data transmission method of this embodiment includes the following steps:
  • step S61 (corresponding to the aforementioned step S202), the first device receives the LACP message sent by the second device, and parses the port parameters in the message. And read the actual port status of the first device itself.
  • Step S62 (corresponding to the aforementioned steps S204 and S206), comparing the port status of the first device in the message sent by the second device with the actual port status of the first device. If it is found that the port of the first device in the message can be restored, but in fact the port has not been restored, it will enter the fast recovery process; in other cases, do not do any processing, and continue to interact with the LACP protocol.
  • the ports in the LACP aggregation group in the first device and the second device confirm whether they can recover through LACP protocol interaction and negotiation.
  • the port may be deactivated due to protocol interaction failure and cannot send and receive data. Therefore, in the above step S62, if the physical state of the port of the first device is normal, but the data cannot be sent and received due to protocol interaction, it can be activated forcibly. This situation is exactly the method for fast recovery of ports mentioned in this patent.
  • step S63 when entering the fast recovery process flow, the first device needs to directly recover the port that has not been recovered, and at the same time, the first device sends the LACP protocol message of the port that has been recovered. At the same time, it is necessary to intercept the LACP protocol message whose port status has not been restored and which the first device is about to send.
  • step S64 (corresponding to the aforementioned steps S2012, S2014, and S2016), the LACP protocol interaction is continued after the first device port has recovered. If the port of the first device can indeed be recovered, it is maintained; if it is found through subsequent LACP protocol interaction that the LACP protocol of the port that is recovering quickly cannot be successfully negotiated, the state is rolled back. That is, the port on which the first device quickly recovers is deactivated from the aggregated link, and sends a port deactivation LACP protocol packet to notify the second device to deactivate the interconnected port.
  • step S65 (corresponding to the aforementioned step S2018), if the fallback in step S64 occurs, it is necessary to send the abnormal state that the first device port cannot recover by means of an alarm, etc., and notify relevant personnel to perform troubleshooting.
  • step S71 the second device receives the LACP protocol message sent by the first device, parses and records the port status of the first device in the message.
  • Step S72 after the second device receives the message, the system replies with the LACP protocol message after protocol processing, and at this time analyzes the replied protocol message, and records the port status of the first device in the reply message.
  • Step S73 comparing the port status in the received message and the reply message, if it is found that the second device mistakenly identifies the port status of the first device, that is, the port status of the first device in the received message is not consistent with the sent message, then The wrong LACP protocol message replied by the second device is intercepted, and at the same time, the second device is notified to perform protocol interaction again.
  • Step S74 After intercepting the wrong LACP protocol message, in order to improve the interaction efficiency, the LACP protocol message with the correct port status can be constructed and sent to the first device without waiting for the result of the second device's re-protocol interaction.
  • the system applied to the aforementioned second device includes:
  • a packet sending and receiving module 81 which is mainly responsible for receiving and sending LACP protocol packets. After the LACP protocol is sent from the first device, the module can be responsible for receiving the message. In addition, when it is found that the port states in the above messages are inconsistent, the port recovery protocol message can be sent instead of the second system, and the wrong port state protocol message sent by the second system can be intercepted.
  • a protocol module 82 which is mainly responsible for parsing LACP protocol port messages and comparing port states. If it is found that the port state in the message is inconsistent, the second system is notified to perform protocol interaction again, and a protocol message with the correct port state is constructed and sent to the sending and receiving packet module.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • Embodiments of the present disclosure also provide an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
  • the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input and output device is connected to the processor.
  • each module or each step of the above-mentioned disclosure can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present application provide a port state adjustment method and apparatus, a computer-readable storage medium, and an electronic apparatus. The method comprises: a first device obtains a first packet from a second device; the first device determines capability information of a first port on the basis of first state information and the actual state of the first port which is read by the first device; when the capability information is first capability information, the first device activates the first port, so as to convert the state of the first port from an abnormal state to a normal state.

Description

一种端口状态调整方法、装置及计算机可读存储介质A port state adjustment method, device and computer-readable storage medium
相关申请的交叉引用Cross References to Related Applications
本公开基于2021年6月30日提交的发明名称为“一种端口状态调整方法、装置及计算机可读存储介质”的中国专利申请CN202110745495.0,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本公开。This disclosure is based on the Chinese patent application CN202110745495.0 filed on June 30, 2021 with the title of "A Port State Adjustment Method, Device, and Computer-Readable Storage Medium", and claims the priority of this patent application, which is incorporated by reference The contents disclosed therein are fully incorporated into the present disclosure.
技术领域technical field
本公开实施例涉及通信领域,具体而言,涉及一种端口状态调整方法、装置、计算机可读存储介质及电子装置。Embodiments of the present disclosure relate to the communication field, and in particular, relate to a port state adjustment method, device, computer-readable storage medium, and electronic device.
背景技术Background technique
在当前网络组网建设中,为了保证网络稳定可靠以及网络的经济性,经常启用链路聚合控制协议(Link Aggregation Control Protocol,简称为LACP)组方法来增强带宽。该技术可以将多个物理连接当做一个单一的逻辑连接来处理,允许两个网络设备之间通过多个端口并行连接,同时传输数据,以提供更高的带宽和吞吐量。In the current network construction, in order to ensure the stability and reliability of the network and the economy of the network, the link aggregation control protocol (Link Aggregation Control Protocol, referred to as LACP) group method is often used to enhance the bandwidth. This technology can treat multiple physical connections as a single logical connection, allowing two network devices to be connected in parallel through multiple ports and transmit data at the same time to provide higher bandwidth and throughput.
动态聚合实现链路聚合的一种方式,在LACP协议的交互下,通过链路聚合控制协议数据单元(Link Aggregation Control Protocol Data Unit,简称LACPDU)与对端交互信息。当两端协商成功后,流量就可以在各个激活的成员端口中负荷分担。Dynamic aggregation is a way to realize link aggregation. Under the interaction of the LACP protocol, information is exchanged with the peer through the link aggregation control protocol data unit (Link Aggregation Control Protocol Data Unit, referred to as LACPDU). After the negotiation between the two ends is successful, the traffic can be load-balanced among the activated member ports.
在使用LACP的场景中,需要保证链路恢复的过程中不要出现大量丢包。当两端设备进行LACP协议交互时,对端设备端口恢复后,数据流就会在此端口发送,而此时本端设备端口尚未恢复,收到对端发来的数据流就会因为端口未恢复而丢失。当恢复时间相差越大,丢包就会越多,恢复性能也就越差。In the scenario where LACP is used, it is necessary to ensure that a large number of packets are not lost during link restoration. When the devices at both ends perform LACP protocol interaction, after the port of the peer device recovers, the data flow will be sent on this port, but at this time the port of the local device has not recovered and lost. When the recovery time difference is larger, the packet loss will be more, and the recovery performance will be worse.
而当网络环境出现波动,或对端设备进行协议处理异常时,会错误判断本端设备尚未恢复的端口已经恢复,从而向未恢复的端口发包,造成丢包情况的出现。However, when the network environment fluctuates, or the peer device performs abnormal protocol processing, it will mistakenly judge that the unrecovered port of the local device has been restored, and then send packets to the unrecovered port, resulting in packet loss.
针对上述问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.
发明内容Contents of the invention
本公开实施例提供了一种端口状态调整方法、装置、计算机可读存储介质及电子装置,以至少解决相关技术中因端口状态异常造成的数据丢包的问题。Embodiments of the present disclosure provide a port state adjustment method, device, computer-readable storage medium, and electronic device, so as to at least solve the problem of data packet loss caused by abnormal port state in the related art.
根据本公开的一个实施例,提供了一种端口状态调整方法,包括:According to an embodiment of the present disclosure, a port state adjustment method is provided, including:
第一设备获取来自第二设备的第一报文,其中,所述第一报文中携带有第一状态信息,所述第一状态信息用于指示所述第一设备中包括的第一端口的状态,所述第一设备通过所述第一端口与所述第二设备进行数据传输;The first device acquires a first packet from the second device, where the first packet carries first status information, and the first status information is used to indicate a first port included in the first device state, the first device performs data transmission with the second device through the first port;
所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的能力信息,其中,所述能力信息用于指示是否允许所述第一端口由异常状态恢复为正常状态;The first device determines capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether to allow The first port returns to a normal state from an abnormal state;
所述第一设备在所述能力信息为第一能力信息的情况下,对所述第一端口进行激活处理,以使所述第一端口的状态由所述异常状态转换为所述正常状态,其中,所述第一能力信息用 于指示允许所述第一端口由异常状态恢复为正常状态。When the capability information is the first capability information, the first device activates the first port, so that the state of the first port changes from the abnormal state to the normal state, Wherein, the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
在一个示例性实施例中,所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的第一能力信息包括:In an exemplary embodiment, the determining, by the first device, the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
所述第一设备在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态,且所述第一设备读取的所述第一端口的实际状态为所述正常状态的情况下,确定所述第一端口的能力信息为所述第一能力信息。When the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the first port read by the first device When the actual state of a port is the normal state, determine that the capability information of the first port is the first capability information.
在一个示例性实施例中,所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的第一能力信息包括:In an exemplary embodiment, the determining, by the first device, the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
所述第一设备在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态、所述第一设备读取的所述第一端口的实际状态为所述正常状态、以及通过所述第一设备执行与所述第二设备的第一协议交互协商后确定所述第一端口能够恢复的情况下,确定所述第一端口的能力信息为所述第一能力信息。When the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, the first port read by the first device If the actual state of the port is the normal state and the first device performs the first protocol interaction negotiation with the second device and determines that the first port can be restored, determine the state of the first port The capability information is the first capability information.
在一个示例性实施例中,所述第一设备在对所述第一端口进行激活处理之后,所述方法还包括:In an exemplary embodiment, after the first device activates the first port, the method further includes:
所述第一设备向所述第二设备发送第二报文,其中,所述第二报文中包括有用于指示所述第一端口的状态已恢复为所述正常状态的第二状态信息;The first device sends a second message to the second device, where the second message includes second state information for indicating that the state of the first port has returned to the normal state;
所述第一设备终止向所述第二设备发送第三报文,其中,所述第三报文中包括有用于指示所述第一端口的状态为所述异常状态的第三状态信息。The first device terminates sending a third message to the second device, where the third message includes third status information for indicating that the status of the first port is the abnormal status.
在一个示例性实施例中,所述第一设备在对所述第一端口进行激活处理之后,所述方法还包括:In an exemplary embodiment, after the first device activates the first port, the method further includes:
所述第一设备通过所述第一端口执行与所述第二设备的第二协议交互协商;The first device performs a second protocol interaction negotiation with the second device through the first port;
所述第一设备在基于所述第二协议交互协商处理确定无法与所述第二设备协商成功的情况下,对所述第一端口进行去激活处理,以使所述第一端口的状态由所述正常状态转换为所述异常状态。In a case where the first device determines that the negotiation with the second device cannot be successful based on the second protocol interaction negotiation process, deactivate the first port, so that the state of the first port is changed to The normal state transitions to the abnormal state.
在一个示例性实施例中,在所述第一设备对所述第一端口进行去激活处理之后,所述方法还包括:In an exemplary embodiment, after the first device deactivates the first port, the method further includes:
所述第一设备向所述第二设备发送第四报文以指示所述第二设备对所述第二设备中包括的与所述第一端口对接的第二端口执行去激活处理,其中,所述第四报文中包括有用于指示所述第一端口的状态为所述异常状态的第四状态信息。The first device sends a fourth message to the second device to instruct the second device to perform deactivation processing on a second port included in the second device that is connected to the first port, wherein, The fourth message includes fourth status information for indicating that the status of the first port is the abnormal status.
在一个示例性实施例中,在所述第一设备对所述第一端口进行去激活处理之后,所述方法还包括:In an exemplary embodiment, after the first device deactivates the first port, the method further includes:
所述第一设备发送告警信息。The first device sends alarm information.
在一个示例性实施例中,第一设备获取来自第二设备的第一报文之后,所述方法还包括:In an exemplary embodiment, after the first device obtains the first message from the second device, the method further includes:
所述第一设备基于所述第一报文向所述第二设备回复第五报文,其中,所述第五报文中携带有第五状态信息,所述第五状态信息用于指示所述第一设备基于所述第一报文所获取到的所述第一端口的状态;The first device replies a fifth message to the second device based on the first message, where the fifth message carries fifth state information, and the fifth state information is used to indicate that the The state of the first port obtained by the first device based on the first packet;
所述第一设备获取所述第五状态信息,并对所述第一状态信息和所述第五状态信息进行比对,以得到比对结果;The first device acquires the fifth state information, and compares the first state information with the fifth state information to obtain a comparison result;
所述第一设备在确定所述比对结果用于指示所述第一状态信息和所述第五状态信息所指 示的状态不同的情况下,终止向所述第二设备回复所述第五报文。When the first device determines that the comparison result is used to indicate that the states indicated by the first state information and the fifth state information are different, stop replying the fifth report to the second device. arts.
在一个示例性实施例中,所述第一设备在终止向所述第二设备恢复所述第五报文之后,所述方法还包括:In an exemplary embodiment, after the first device terminates restoring the fifth message to the second device, the method further includes:
所述第一设备向所述第二设备发送通知消息,其中,所述通知消息用于通知所述第二设备重新发送报文。The first device sends a notification message to the second device, where the notification message is used to notify the second device to resend the packet.
在一个示例性实施例中,所述第一设备在终止向所述第二设备恢复所述第五报文之后,所述方法还包括:In an exemplary embodiment, after the first device terminates restoring the fifth message to the second device, the method further includes:
所述第一设备构造并发送第六报文,其中,所述第六报文中携带有第六状态信息,所述第六状态信息用于指示所述第一状态信息所指示的状态。The first device constructs and sends a sixth message, where the sixth message carries sixth state information, and the sixth state information is used to indicate the state indicated by the first state information.
根据本公开的另一个实施例,提供了一种端口状态调整装置,应用于第一设备中,包括:According to another embodiment of the present disclosure, an apparatus for adjusting a port state is provided, which is applied to a first device, including:
报文采集模块,设置为获取来自第二设备的第一报文,其中,所述第一报文中携带有第一状态信息,所述第一状态信息用于指示所述第一设备中包括的第一端口的状态,所述第一设备通过所述第一端口与所述第二设备进行数据传输;A message collection module, configured to acquire a first message from a second device, wherein the first message carries first state information, and the first state information is used to indicate that the first device includes The state of the first port of the device, the first device performs data transmission with the second device through the first port;
能力确定模块,设置为基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的能力信息,其中,所述能力信息用于指示是否允许所述第一端口由异常状态恢复为正常状态;A capability determining module, configured to determine capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether allowing the first port to recover from an abnormal state to a normal state;
端口激活模块,设置为在所述能力信息为第一能力信息的情况下,对所述第一端口进行激活处理,以使所述第一端口的状态由所述异常状态转换为所述正常状态,其中,所述第一能力信息用于指示允许所述第一端口由异常状态恢复为正常状态。A port activation module, configured to activate the first port when the capability information is the first capability information, so that the state of the first port changes from the abnormal state to the normal state , wherein the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
根据本公开的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present disclosure, there is also provided a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform any one of the above-mentioned methods when running Steps in the examples.
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present disclosure, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
附图说明Description of drawings
图1是本公开实施例的一种端口状态调整方法的移动终端的硬件结构框图;FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a port state adjustment method according to an embodiment of the disclosure;
图2是根据本公开实施例的一种端口状态调整方法的流程图;Fig. 2 is a flow chart of a port state adjustment method according to an embodiment of the present disclosure;
图3是根据本公开实施例的一种端口状态调整装置的结构框图;Fig. 3 is a structural block diagram of a port state adjustment device according to an embodiment of the present disclosure;
图4是根据本公开具体实施例的协议网络的结构框图;Fig. 4 is a structural block diagram of a protocol network according to a specific embodiment of the present disclosure;
图5是根据本公开具体实施例的结构示意图一;Fig. 5 is a structural schematic diagram 1 according to a specific embodiment of the present disclosure;
图6是根据本公开具体实施例的流程图一;FIG. 6 is a flowchart one according to a specific embodiment of the present disclosure;
图7是根据本公开具体实施例的结构示意图二;FIG. 7 is a second structural schematic diagram according to a specific embodiment of the present disclosure;
图8是根据本公开具体实施例的流程图二。Fig. 8 is a second flowchart according to a specific embodiment of the present disclosure.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本公开的实施例。Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings and in combination with the embodiments.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等 是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the specification and claims of the present disclosure and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence.
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本公开实施例的一种端口状态调整方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和设置为存储数据的存储器104,其中,上述移动终端还可以包括设置为通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in the embodiments of the present application may be executed in mobile terminals, computer terminals or similar computing devices. Taking running on a mobile terminal as an example, FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a port state adjustment method according to an embodiment of the present disclosure. As shown in Figure 1, the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) and a memory 104 configured to store data, wherein the above-mentioned mobile terminal may also include a transmission device 106 and an input/output device 108 configured to communicate. Those skilled in the art can understand that the structure shown in FIG. 1 is only for illustration, and it does not limit the structure of the above mobile terminal. For example, the mobile terminal may also include more or fewer components than those shown in FIG. 1 , or have a different configuration from that shown in FIG. 1 .
存储器104可设置为存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的一种端口状态调整方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 may be configured to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a port state adjustment method in an embodiment of the present disclosure, and the processor 102 executes the computer program stored in the memory 104 , so as to perform various functional applications and data processing, that is, to realize the above-mentioned method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory that is remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置106设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其设置为通过无线方式与互联网进行通讯。The transmission device 106 is configured to receive or transmit data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the mobile terminal. In one example, the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is configured to communicate with the Internet in a wireless manner.
在本实施例中提供了一种端口状态调整方法,图2是根据本公开实施例的端口状态调整方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a port state adjustment method is provided. FIG. 2 is a flowchart of a port state adjustment method according to an embodiment of the present disclosure. As shown in FIG. 2 , the process includes the following steps:
步骤S202,第一设备获取来自第二设备的第一报文,其中,第一报文中携带有第一状态信息,第一状态信息用于指示第一设备中包括的第一端口的状态,第一设备通过第一端口与第二设备进行数据传输;Step S202, the first device acquires a first message from the second device, wherein the first message carries first state information, and the first state information is used to indicate the state of the first port included in the first device, The first device performs data transmission with the second device through the first port;
在本实施例中,第一状态信息包括(但不限于)第一设备中包括的第一端口的激活/非激活/异常状态信息、第一端口的地址信息、第一端口的端口类型等信息,第一端口的数量可以(但不限于)是一个或至少两个;第一设备和第二设备均为(但不限于)可以执行LACP协议的交互的设备或装置,如交换机、网关等;第一设备和第二设备的数量均可以(但不限于)是有多个,只要能够实现第一设备与第二设备之间的信息交互即可;第一报文可以(但不限于)是数据包,也可以是其它的能够多种信息的信息流;第一报文的数据传输方式可以(但不限于)是以太网等,也可以是无线网络,如3G/4G/5G/量子通信等。In this embodiment, the first status information includes (but is not limited to) activation/inactivation/abnormal status information of the first port included in the first device, address information of the first port, port type of the first port, and other information , the number of the first port can be (but not limited to) one or at least two; both the first device and the second device are (but not limited to) devices or devices that can execute the interaction of the LACP protocol, such as switches, gateways, etc.; The number of the first device and the second device can be (but not limited to) multiple, as long as the information interaction between the first device and the second device can be realized; the first message can be (but not limited to) The data packet can also be other information streams capable of various information; the data transmission method of the first message can be (but not limited to) Ethernet, etc., or a wireless network, such as 3G/4G/5G/quantum communication Wait.
例如,第一设备接收第二设备发送来LACP报文,并对第一报文进行解析以获取第一报文中的端口参数。For example, the first device receives the LACP packet sent by the second device, and parses the first packet to obtain port parameters in the first packet.
步骤S204,第一设备基于第一状态信息以及第一设备读取的第一端口的实际状态确定第一端口的能力信息,其中,能力信息用于指示是否允许第一端口由异常状态恢复为正常状态;Step S204, the first device determines the capability information of the first port based on the first state information and the actual state of the first port read by the first device, wherein the capability information is used to indicate whether the first port is allowed to recover from the abnormal state to normal state;
在本实施例中,第一端口的实际状态为在接收到第一报文的时间范围内的第一端口的状态,时间范围可以是接收到第一报文的时间节点,也可以是指定延时时长的时间节点;第一 端口的实际状态读取可以(但不限于)是通过读取识别第一端口的状态代码实现的,也可以是通过接收第一端口反馈的端口状态信息或信号来确定的,还可以是通过其它方式实现的;第一端口的实际状态包括(但不限于)正常、异常、可激活但未激活、不可激活等。In this embodiment, the actual state of the first port is the state of the first port within the time range of receiving the first message, and the time range can be the time node when the first message is received, or a specified delay time. A long time node; the actual status reading of the first port can be (but not limited to) realized by reading the status code identifying the first port, or by receiving the port status information or signal fed back by the first port The determination may also be realized by other means; the actual status of the first port includes (but not limited to) normal, abnormal, activated but not activated, inactivated, and so on.
例如,第一设备在对第一报文进行解析的同时,读取第一设备自身实际端口状态。For example, the first device reads the actual port status of the first device itself while parsing the first packet.
步骤S206,第一设备在能力信息为第一能力信息的情况下,对第一端口进行激活处理,以使第一端口的状态由异常状态转换为正常状态,其中,第一能力信息用于指示允许第一端口由异常状态恢复为正常状态。Step S206, if the capability information is the first capability information, the first device activates the first port so that the state of the first port changes from an abnormal state to a normal state, wherein the first capability information is used to indicate The first port is allowed to recover from the abnormal state to the normal state.
在本实施例中,第一能力信息为第一端口处于可被激活但未激活的异常状态,通过对第一端口进行激活,则可以实现第一端口的正常信息交互,避免因端口状态异常造成的数据丢失。In this embodiment, the first capability information is that the first port is in an abnormal state that can be activated but not activated. By activating the first port, the normal information exchange of the first port can be realized, and the abnormal state of the port can be avoided. data loss.
其中,对第一端口进行激活处理可以是正常激活,也可以是强制激活,且激活状态可以是指示第一端口在预定时间内保持激活状态,也可以是指示第一端口始终处于激活状态;激活的方式可以是通过向第一端口发送激活指令实现的,也可以是通过调整第一端口的物理信息(如地址代码、电流电压等)实现的。Wherein, the activation process for the first port may be normal activation or forced activation, and the activation status may indicate that the first port remains activated within a predetermined time, or indicate that the first port is always in an activated state; The method can be realized by sending an activation command to the first port, or by adjusting the physical information (such as address code, current and voltage, etc.) of the first port.
例如,第一设备通过LACP协议交互与协商确认自身与第二设备中LACP聚合组中的第一端口是否能够恢复,而第一端口自身物理状态正常时,也可能因为协议交互失败而导致端口被去激活而无法收发数据。因此,如果第一设备的端口物理状态正常,只是因为协议交互而导致无法收发数据时,是可以向第一端口发送一个强制激活指令使其强制激活;其中,第一端口的物理状态可以(但不限于)是通过对第一端口进行轮询扫描确定的。For example, the first device confirms whether the first port in the LACP aggregation group between itself and the second device can recover through LACP protocol interaction and negotiation, and when the physical status of the first port itself is normal, the port may be blocked due to protocol interaction failure. Deactivated and unable to send and receive data. Therefore, if the physical state of the port of the first device is normal, but when data cannot be sent and received due to protocol interaction, a forced activation command can be sent to the first port to make it forcedly activated; wherein, the physical state of the first port can (but Not limited to) is determined by polling and scanning the first port.
通过上述步骤,由于对异常状态的第一端口进行端口状态调整,使得第一端口能够正常进行数据交互,从而避免因端口状态异常造成的数据丢包现象,解决了因端口状态异常造成的数据丢包的问题,提高了数据传输稳定性。Through the above steps, due to the adjustment of the port state of the first port in the abnormal state, the first port can perform data interaction normally, thereby avoiding the data packet loss phenomenon caused by the abnormal state of the port, and solving the data loss caused by the abnormal state of the port. Packet problem, improved data transmission stability.
其中,上述步骤的执行主体可以为基站、终端等,但不限于此。Wherein, the execution subject of the above steps may be a base station, a terminal, etc., but is not limited thereto.
在一个可选的实施例中,第一设备基于第一状态信息以及第一设备读取的第一端口的实际状态确定第一端口的第一能力信息包括:In an optional embodiment, the first device determining the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
步骤S2042,第一设备在确定第一状态信息用于指示第一设备中包括的第一端口的状态为异常状态或者正常状态,且第一设备读取的第一端口的实际状态为正常状态的情况下,确定第一端口的能力信息为第一能力信息。In step S2042, the first device determines that the first state information is used to indicate that the state of the first port included in the first device is an abnormal state or a normal state, and the actual state of the first port read by the first device is a normal state. In some cases, it is determined that the capability information of the first port is the first capability information.
在本实施例中,由于第一报文是来自第二设备的,因此可能存在第一端口的状态信息滞后的情况,而通过对第一端口的状态信息的对比确认,能够使得第二设备存储的第一端口状态信息得到更新,避免第二设备错误收发报文。In this embodiment, since the first message is from the second device, there may be a situation where the state information of the first port lags behind, and by comparing and confirming the state information of the first port, the second device can store The state information of the first port of the device is updated, so as to prevent the second device from sending and receiving packets by mistake.
在一个可选的实施例中,第一设备基于第一状态信息以及第一设备读取的第一端口的实际状态确定第一端口的第一能力信息包括:In an optional embodiment, the first device determining the first capability information of the first port based on the first state information and the actual state of the first port read by the first device includes:
步骤S2044,第一设备在确定第一状态信息用于指示第一设备中包括的第一端口的状态为异常状态或者正常状态、第一设备读取的第一端口的实际状态为正常状态、以及通过第一设备执行与第二设备的第一协议交互协商后确定第一端口能够恢复的情况下,确定第一端口的能力信息为第一能力信息。In step S2044, the first device determines that the first state information is used to indicate that the state of the first port included in the first device is an abnormal state or a normal state, the actual state of the first port read by the first device is a normal state, and In a case where the first device determines that the first port can be recovered after performing the first protocol interaction negotiation with the second device, determine the capability information of the first port as the first capability information.
在本实施例中,在确定第一端口能够被恢复的情况下再确定第一端口的能力信息为第一能力信息是为了能够对第一端口执行强制激活操作,从而使第一端口能够实现正常的数据交 互。In this embodiment, the purpose of determining the capability information of the first port as the first capability information after it is determined that the first port can be restored is to perform a forced activation operation on the first port, so that the first port can realize normal operation. data interaction.
在一个可选的实施例中,第一设备在对第一端口进行激活处理之后,该方法还包括:In an optional embodiment, after the first device activates the first port, the method further includes:
步骤S208,第一设备向第二设备发送第二报文,其中,第二报文中包括有用于指示第一端口的状态已恢复为正常状态的第二状态信息;Step S208, the first device sends a second message to the second device, wherein the second message includes second state information for indicating that the state of the first port has returned to a normal state;
步骤S2010,第一设备终止向第二设备发送第三报文,其中,第三报文中包括有用于指示第一端口的状态为异常状态的第三状态信息。Step S2010, the first device terminates sending a third message to the second device, wherein the third message includes third status information for indicating that the status of the first port is an abnormal status.
在本实施例中,向第二设备发送第二报文是为了使第二设备能够对存储的第一端口的状态信息进行更新,而终止发送第三报文是为了避免第二设备基于第三报文发送反馈报文,从而避免数据的丢失。In this embodiment, the purpose of sending the second message to the second device is to enable the second device to update the stored state information of the first port, and the purpose of stopping sending the third message is to prevent the second device from Messages send feedback messages to avoid data loss.
其中,第二报文和第三报文均可以包括(但不限于)第一端口的状态信息、I P地址等信息,且第三报文所指示的第一端口可以是第一设备中包含的多个第一端口中的一个或多个,同理,第二报文所指示的第一端口可以是第一设备中包含的多个第一端口中的一个或多个;第二报文和第三报文的发送方式可以(但不限于)是以太网等,也可以是无线网络,如3G/4G/5G/量子通信等。Wherein, both the second message and the third message may include (but not limited to) information such as status information and an IP address of the first port, and the first port indicated by the third message may be the first port included in the first device. One or more of the multiple first ports, similarly, the first port indicated by the second message may be one or more of the multiple first ports contained in the first device; the second message The method of sending the third message may be (but not limited to) Ethernet, or wireless network, such as 3G/4G/5G/quantum communication.
例如,当进入快速恢复处理流程(即强制激活处理)时,需要对第一设备对尚未恢复的端口直接进行恢复(即强制激活),同时第一设备向第二设备发送第一端口已经恢复的LACP的协议报文。同时,需要拦截第一设备准备发送的端口状态未恢复的LACP协议报文。For example, when entering the fast recovery processing flow (that is, the forced activation process), the first device needs to directly restore (that is, forcibly activate) the port that has not been restored, and at the same time, the first device sends a message that the first port has been restored to the second device. LACP protocol packets. At the same time, it is necessary to intercept the LACP protocol message whose port status has not been restored and which the first device is about to send.
在一个可选的实施例中,第一设备在对第一端口进行激活处理之后,该方法还包括:In an optional embodiment, after the first device activates the first port, the method further includes:
步骤S2012,第一设备通过第一端口执行与第二设备的第二协议交互协商;Step S2012, the first device performs a second protocol interaction negotiation with the second device through the first port;
步骤S2014,第一设备在基于第二协议交互协商处理确定无法与第二设备协商成功的情况下,对第一端口进行第一去激活处理,以使第一端口的状态由正常状态转换为异常状态。Step S2014, when the first device determines that it cannot successfully negotiate with the second device based on the second protocol interaction negotiation process, it performs a first deactivation process on the first port, so that the state of the first port changes from a normal state to an abnormal state state.
在本实施例中,在执行激活处理之后,再通过交互协商确定第一端口是否恢复,随后再进行后续的数据交互,从而避免因端口状态未恢复造成的数据丢失;而对不能正常交互协商的端口进行去激活处理是为了避免异常的端口进行数据交互,进一步避免数据丢失。In this embodiment, after the activation process is performed, it is determined whether the first port is recovered through interactive negotiation, and then subsequent data interaction is performed, so as to avoid data loss caused by the unrecovered port status; The purpose of port deactivation is to avoid data interaction with abnormal ports and further avoid data loss.
其中,第二协议可以(但不限于)是LACP协议,也可以是其它交互协议;去激活处理可以(但不限于)是对第一端口的状态进行调整,也可以是其它方式使第一端口被标识为异常;去激活处理的方式可以是向第一端口发送去激活指令,也可以更改第一端口的物理信息等。Wherein, the second protocol may be (but not limited to) the LACP protocol, or other interactive protocols; the deactivation process may be (but not limited to) adjusting the state of the first port, or making the first port Identified as abnormal; the way of deactivation processing may be sending a deactivation command to the first port, or changing the physical information of the first port, etc.
例如,如果根据后续LACP协议交互,确认快速恢复的端口LACP协议无法协商成功,则进行状态回退,第一设备快速恢复的端口从聚合链路中执行去激活处理。For example, if it is confirmed according to the subsequent LACP protocol interaction that the LACP protocol negotiation of the fast-recovery port fails, the status is rolled back, and the fast-recovery port of the first device is deactivated from the aggregated link.
在一个可选的实施例中,在第一设备对第一端口进行去激活处理之后,该方法还包括:In an optional embodiment, after the first device deactivates the first port, the method further includes:
步骤S2016,第一设备向第二设备发送第四报文以指示第二设备对第二设备中包括的与第一端口对接的第二端口进行第二去激活处理,其中,第四报文中包括有用于指示第一端口的状态为异常状态的第四状态信息。Step S2016, the first device sends a fourth message to the second device to instruct the second device to perform a second deactivation process on the second port connected to the first port included in the second device, wherein, in the fourth message It includes fourth state information for indicating that the state of the first port is an abnormal state.
在本实施例中,在确定第一端口无法恢复的情况下,使第二端口也执行第二去激活处理,避免第二端口向第一端口发送数据。另外,需要说明的是,不同状态下所发送的用于指示第一端口的状态为异常状态的信息可以是相同的信息,也可以是不同的信息,对于本实施例而 言,第四状态信息和前述的第三状态信息都是用于指示第一端口的状态为异常状态的信息,二者可以是同一个信息也可以是不同的信息。In this embodiment, when it is determined that the first port cannot be recovered, the second port is also made to perform the second deactivation process, so as to prevent the second port from sending data to the first port. In addition, it should be noted that the information sent in different states to indicate that the state of the first port is an abnormal state may be the same information or different information. For this embodiment, the fourth state information Both the aforementioned third status information and the aforementioned third status information are used to indicate that the status of the first port is an abnormal status, and the two may be the same information or different information.
例如,向第二设备发送端口去激活的LACP协议报文,以通知第二设备向第二设备的对接端口执行去激活处理。For example, an LACP protocol packet for port deactivation is sent to the second device, so as to notify the second device to perform deactivation processing on the docking port of the second device.
在一个可选的实施例中,在所述第一设备对所述第一端口进行去激活处理之后,所述方法还包括:In an optional embodiment, after the first device deactivates the first port, the method further includes:
步骤S2018,第一设备发送告警信息。Step S2018, the first device sends an alarm message.
在本实施例中,发送告警信息是为了提醒工作人员对相关端口进行进一步处理,以及时对端口进行调整。In this embodiment, the purpose of sending the alarm information is to remind the staff to perform further processing on the relevant ports, so as to adjust the ports in time.
例如,将第一设备端口无法恢复的异常状态通过告警等方式发送,通知相关人员进行故障排查。For example, the abnormal state of the first device port that cannot be recovered is sent through an alarm or other means, and relevant personnel are notified to perform troubleshooting.
在一个可选的实施例中,第一设备获取来自第二设备的第一报文之后,该方法还包括:In an optional embodiment, after the first device acquires the first packet from the second device, the method further includes:
步骤S2022,第一设备基于第一报文向第二设备回复第五报文,其中,第五报文中携带有第五状态信息,第五状态信息用于指示第一设备基于第一报文所获取到的第一端口的状态;Step S2022, the first device replies a fifth message to the second device based on the first message, wherein the fifth message carries fifth state information, and the fifth state information is used to instruct the first device to The obtained state of the first port;
步骤S2024,第一设备获取第五状态信息,并对第一状态信息和第五状态信息进行比对,以得到比对结果;Step S2024, the first device acquires fifth state information, and compares the first state information with the fifth state information to obtain a comparison result;
步骤S2026,第一设备在确定比对结果用于指示第一状态信息和第五状态信息所指示的状态不同的情况下,终止向第二设备回复第五报文。Step S2026, when the first device determines that the comparison result indicates that the states indicated by the first state information and the fifth state information are different, stop replying the fifth message to the second device.
在本实施例中,为提高对数据交互能力,可以设置具有相同数据收发功能的第一设备和第二设备。In this embodiment, in order to improve the ability to interact with data, a first device and a second device having the same function of sending and receiving data may be set.
例如,在第一设备接收到第二设备发送的第五报文后,对第五报文进行解析,以确定第五状态信息,同时通过第一设备中的控制系统向第二设备发送回复信息,而在回复信息发送之前,第一设备对已生成但未发送的回复进行抓取分析,确定第五状态信息与第一设备读取的第一端口的实际状态是否一致,若不一致,则对该回复信息进行拦截;对应的,在第二设备接收到第一设备发送的第五报文后,第二设备的控制系统也生成回复信息,并在回复信息进行发送之前对回复信息中包含的第五状态信息以及预先存储的第一状态信息进行比较,若不一致,则对回复进行拦截。For example, after the first device receives the fifth message sent by the second device, it parses the fifth message to determine the fifth status information, and at the same time sends reply information to the second device through the control system in the first device , and before the reply information is sent, the first device captures and analyzes the reply that has been generated but not sent, and determines whether the fifth state information is consistent with the actual state of the first port read by the first device. The reply message is intercepted; correspondingly, after the second device receives the fifth message sent by the first device, the control system of the second device also generates a reply message, and before sending the reply message The fifth state information is compared with the pre-stored first state information, and if they are inconsistent, the reply is intercepted.
在一个可选的实施例中,第一设备在终止向第二设备恢复第五报文之后,该方法还包括:In an optional embodiment, after the first device terminates restoring the fifth message to the second device, the method further includes:
步骤S20262,第一设备向第二设备发送通知消息,其中,通知消息用于通知第二设备重新发送报文。Step S20262, the first device sends a notification message to the second device, wherein the notification message is used to notify the second device to resend the packet.
在本实施例中,重新发送报文是为了保证端口状态的一致性,实现数据的正常交互,避免出现数据丢失的情况。In this embodiment, the purpose of resending the message is to ensure the consistency of the port status, realize normal data interaction, and avoid data loss.
需要说明的是,第二设备在确认回复报文错误的时候,也可以向第一设备发送通知消息,以指示第一设备重新发送报文。It should be noted that, when the second device confirms that the reply message is wrong, it may also send a notification message to the first device, so as to instruct the first device to resend the message.
在一个可选的实施例中,第一设备在终止向第二设备恢复所述第五报文之后,该方法还包括:In an optional embodiment, after the first device terminates restoring the fifth message to the second device, the method further includes:
步骤S20264,第一设备构造并发送第六报文,其中,第六报文中携带有第六状态信息,第六状态信息用于指示第一状态信息所指示的状态。Step S20264, the first device constructs and sends a sixth message, wherein the sixth message carries sixth state information, and the sixth state information is used to indicate the state indicated by the first state information.
在本实施例中,重新构造第六报文是为了使第二设备存储的端口状态信息得到更新,保证端口状态的一致性。In this embodiment, the purpose of reconstructing the sixth packet is to update the port status information stored in the second device and ensure consistency of the port status.
需要说明的是,第二设备在确认回复报文错误的时候,也可以重新构造第六报文,以将第二设备中存储的第一端口状态信息已得到更新的信息通知第一设备。It should be noted that when the second device confirms that the reply message is wrong, it may also reconstruct the sixth message, so as to notify the first device that the first port status information stored in the second device has been updated.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present disclosure can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present disclosure.
在本实施例中还提供了一种端口状态调整装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a port state adjustment device, which is used to implement the above embodiments and preferred implementation modes, and what has been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
图3是根据本公开实施例的端口状态调整装置的结构框图,如图3所示,该装置应用于第一设备中,该装置包括:Fig. 3 is a structural block diagram of a port state adjustment device according to an embodiment of the present disclosure. As shown in Fig. 3 , the device is applied to the first device, and the device includes:
报文采集模块32,设置为获取来自第二设备的第一报文,其中,所述第一报文中携带有第一状态信息,所述第一状态信息用于指示所述第一设备中包括的第一端口的状态,所述第一设备通过所述第一端口与所述第二设备进行数据传输;The message collection module 32 is configured to obtain a first message from the second device, wherein the first message carries first state information, and the first state information is used to indicate that the first message in the first device The state of the included first port, the first device performs data transmission with the second device through the first port;
能力确定模块34,设置为基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的能力信息,其中,所述能力信息用于指示是否允许所述第一端口由异常状态恢复为正常状态;A capability determining module 34, configured to determine capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate Whether to allow the first port to recover from an abnormal state to a normal state;
端口激活模块36,设置为在所述能力信息为第一能力信息的情况下,对所述第一端口进行激活处理,以使所述第一端口的状态由所述异常状态转换为所述正常状态,其中,所述第一能力信息用于指示允许所述第一端口由异常状态恢复为正常状态。The port activation module 36 is configured to activate the first port when the capability information is the first capability information, so that the state of the first port changes from the abnormal state to the normal state state, wherein the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
在一个可选的实施例中,能力确定模块34包括:In an optional embodiment, the capability determination module 34 includes:
第一确定单元342,设置为在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态,且所述第一设备读取的所述第一端口的实际状态为所述正常状态的情况下,确定所述第一端口的能力信息为所述第一能力信息。The first determining unit 342 is configured to determine that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the first device reads If the actual state of the first port is the normal state, determine that the capability information of the first port is the first capability information.
在一个可选的实施例中,能力确定模块34包括:In an optional embodiment, the capability determination module 34 includes:
第二确定单元344,设置为在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态、所述第一设备读取的所述第一端口的实际状态为所述正常状态、以及通过所述第一设备执行与所述第二设备的第一协议交互协商后确定所述第一端口能够恢复的情况下,确定所述第一端口的能力信息为所述第一能力信息。The second determining unit 344 is configured to determine that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the information read by the first device If the actual state of the first port is the normal state, and it is determined that the first port can be recovered after the first device performs the first protocol interaction negotiation with the second device, determine that the second The capability information of a port is the first capability information.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
第一报文发送模块38,设置为在所述第一设备在对所述第一端口进行激活处理之后,向所述第二设备发送第二报文,其中,所述第二报文中包括有用于指示所述第一端口的状态已恢复为所述正常状态的第二状态信息;The first message sending module 38 is configured to send a second message to the second device after the first device activates the first port, wherein the second message includes There is second state information for indicating that the state of the first port has been restored to the normal state;
第二报文发送模块310,设置为终止向所述第二设备发送第三报文,其中,所述第三报文中包括有用于指示所述第一端口的状态为所述异常状态的第三状态信息。The second message sending module 310 is configured to stop sending a third message to the second device, wherein the third message includes a first message indicating that the state of the first port is the abnormal state Three state information.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
交互模块312,设置为在对所述第一端口进行激活处理之后,通过所述第一端口执行与所述第二设备的第二协议交互协商;The interaction module 312 is configured to perform a second protocol interaction negotiation with the second device through the first port after the activation process is performed on the first port;
状态转换模块314,设置为在基于所述第二协议交互协商处理确定无法与所述第二设备协商成功的情况下,对所述第一端口进行去激活处理,以使所述第一端口的状态由所述正常状态转换为所述异常状态。The state conversion module 314 is configured to deactivate the first port when it is determined that the negotiation with the second device cannot be successful based on the second protocol interaction negotiation process, so that the first port state transition from said normal state to said abnormal state.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
第二激活模块316,设置为在对所述第一端口进行去激活处理之后,向所述第二设备发送第四报文以指示所述第二设备对所述第二设备中包括的与所述第一端口对接的第二端口执行去激活处理,其中,所述第四报文中包括有用于指示所述第一端口的状态为所述异常状态的第四状态信息。The second activation module 316 is configured to, after deactivating the first port, send a fourth message to the second device to instruct the second device to The second port connected to the first port performs deactivation processing, wherein the fourth message includes fourth status information for indicating that the status of the first port is the abnormal status.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
告警模块318,设置为在对所述第一端口进行去激活处理之后,发送告警信息。The alarm module 318 is configured to send alarm information after deactivating the first port.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
第三报文发送单元322,设置为在获取来自第二设备的第一报文之后,基于所述第一报文向所述第二设备回复第五报文,其中,所述第五报文中携带有第五状态信息,所述第五状态信息用于指示所述第一设备基于所述第一报文所获取到的所述第一端口的状态;The third message sending unit 322 is configured to, after acquiring the first message from the second device, reply a fifth message to the second device based on the first message, wherein the fifth message carrying fifth state information, where the fifth state information is used to indicate the state of the first port obtained by the first device based on the first packet;
状态信息采集单324,设置为获取所述第五状态信息,并对所述第一状态信息和所述第五状态信息进行比对,以得到比对结果;The status information collection unit 324 is configured to acquire the fifth status information, and compare the first status information with the fifth status information to obtain a comparison result;
第四报文发送单元326,设置为在确定所述比对结果用于指示所述第一状态信息和所述第五状态信息所指示的状态不同的情况下,终止向所述第二设备回复所述第五报文。The fourth message sending unit 326 is configured to stop replying to the second device when it is determined that the comparison result is used to indicate that the states indicated by the first state information and the fifth state information are different The fifth message.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
消息发送子单元3262,设置为在终止向所述第二设备恢复所述第五报文之后,向所述第二设备发送通知消息,其中,所述通知消息用于通知所述第二设备重新发送报文。The message sending subunit 3262 is configured to send a notification message to the second device after terminating the recovery of the fifth message to the second device, where the notification message is used to notify the second device to resume Send message.
在一个可选的实施例中,该装置还包括:In an optional embodiment, the device also includes:
第五报文发送单元3264,设置为在终止向所述第二设备恢复所述第五报文之后,构造并发送第六报文,其中,所述第六报文中携带有第六状态信息,所述第六状态信息用于指示所述第一状态信息所指示的状态。The fifth message sending unit 3264 is configured to construct and send a sixth message after terminating restoring the fifth message to the second device, wherein the sixth message carries sixth state information , the sixth state information is used to indicate the state indicated by the first state information.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以 下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
下面结合具体实施例对本公开进行说明。The present disclosure will be described below in conjunction with specific embodiments.
如图4所示,提供一种网络环境,在该网络环境中,两台设备之间通过聚合链路进行交互。As shown in FIG. 4 , a network environment is provided, in which two devices interact through aggregated links.
其中,基于IEEE802.3ad标准的LACP协议报文中,分别保存着本端和对端设备的端口状态。通常情况下,设备端口状态可以在接收的报文中读取到发送端口的状态。并且在后续的协议报文回复中,将自身端口状态和读取到的端口状态填写在报文中发送。但由于网络原因或自身协议处理问题,可能会导致回复报文读取到的对端状态错误。针对这种情况,本申请的数据传输方法可以解决该问题。Wherein, the LACP protocol message based on the IEEE802.3ad standard stores the port states of the local device and the peer device respectively. Usually, the status of the device port can read the status of the sending port in the received message. And in the subsequent protocol message reply, fill in the own port status and the read port status in the message and send it. However, due to network reasons or its own protocol processing problems, the status of the peer read in the reply message may be wrong. In view of this situation, the data transmission method of the present application can solve this problem.
需要说明的是,本申请中的第一设备和第二设备主要用于区别类似的对象。第二设备会错误判断第一设备的端口状态。例如,第一设备发出的报文中,端口状态为0x05,表示当前第一设备的端口还无法恢复。但在第二设备接收到报文后,回复的报文中第一设备端口状态为0x0d,表示第一设备的端口已经可以聚合,即可以恢复。这是由于端口状态的错误,导致第二端口会将数据流发送给错误判断的第一设备端口,从而导致了丢包情况的出现。只有当第一设备端口真正恢复后,才能正常进行数据交互。It should be noted that the first device and the second device in this application are mainly used to distinguish similar objects. The second device may wrongly judge the port status of the first device. For example, in the packet sent by the first device, the port status is 0x05, which means that the port of the first device cannot be restored currently. However, after the second device receives the message, the port status of the first device in the reply message is 0x0d, indicating that the port of the first device can be aggregated, that is, can be restored. This is due to an error in the state of the port, causing the second port to send the data stream to the wrongly judged first device port, thus causing packet loss. Data exchange can be performed normally only after the first device port is actually recovered.
如图5所示,对应于上述网络环境及协议报文收发,本实施例提供一种数据传输系统,该系统用于前述第一设备中,包括:As shown in Figure 5, corresponding to the above-mentioned network environment and protocol message sending and receiving, this embodiment provides a data transmission system, which is used in the aforementioned first device, including:
收发包模块51,该模块主要负责接收和发送LACP协议报文。当LACP协议报文从第二设备发送过来后,该模块可以负责接收报文,并将报文信息交给第一设备的协议模块解析。另外,当第一设备需要进行快速恢复处理时,可以发送端口恢复的LACP协议报文,并拦截第一设备发送的端口未恢复的LACP协议报文。A packet sending and receiving module 51, which is mainly responsible for receiving and sending LACP protocol packets. After the LACP protocol message is sent from the second device, the module can be responsible for receiving the message and handing the message information to the protocol module of the first device for analysis. In addition, when the first device needs to perform fast recovery processing, it can send the LACP protocol message for port recovery, and intercept the LACP protocol message for port recovery sent by the first device.
协议模块52,该模块主要负责解析LACP协议报文,记录报文中的端口状态并比较端口状态差异。如果第一设备需要进行端口快速恢复处理,协议模块也负责构造LACP协议报文,交给收发包模块发送给第二设备。此外,协议模块也负责判断第一设备上进行快速恢复处理的端口是否需要状态回退,即将已经快速恢复的端口从聚合链路中去激活,重新进行LACP协议交互决定端口状态。A protocol module 52, which is mainly responsible for parsing LACP protocol messages, recording port states in the messages and comparing port state differences. If the first device needs to perform fast port recovery processing, the protocol module is also responsible for constructing an LACP protocol message, and handing it over to the sending and receiving packet module to send to the second device. In addition, the protocol module is also responsible for judging whether the port undergoing fast recovery processing on the first device needs state rollback, that is, to deactivate the fast recovered port from the aggregated link, and re-interact with the LACP protocol to determine the port status.
端口模块53,该模块主要负责在必要时读取第一设备的准备恢复端口的实际端口状态,并将读取到的端口状态交给协议模块,由协议模块将实际状态与第二设备发送的LACP报文中第一设备的端口状态进行比较处理。此外该模块还在快速恢复处理时通知端口进行快速恢复或再需要状态回退时通知端口去激活。 Port module 53, this module is mainly responsible for reading the actual port status of the first device's ready to restore port when necessary, and handing the read port status to the protocol module, the actual status and the second device sent by the protocol module The port status of the first device in the LACP message is compared and processed. In addition, the module notifies the port to perform fast recovery during fast recovery processing or notifies the port to deactivate when state rollback is required.
告警模块54,该模块主要负责在第一设备端口进行快速恢复后,经过后续LACP协议交互发现该端口无法协议协商成功时,在进行状态回退端口去激活的同事发送相关告警。通知工作人员及时排查故障。 Alarm module 54, this module is mainly responsible for sending relevant alarms to colleagues who perform state rollback port deactivation when the port of the first device is quickly restored and found that the port cannot be negotiated successfully through subsequent LACP protocol interaction. Notify the staff to troubleshoot in time.
对应的,如图6所示,本实施例的数据传输方法包括以下步骤:Correspondingly, as shown in FIG. 6, the data transmission method of this embodiment includes the following steps:
步骤S61(对应前述步骤S202),第一设备接收第二设备发送来LACP报文,解析报文中的端口参数。并且读取第一设备自身实际端口状态。In step S61 (corresponding to the aforementioned step S202), the first device receives the LACP message sent by the second device, and parses the port parameters in the message. And read the actual port status of the first device itself.
步骤S62(对应前述步骤S204及步骤S206),比较第二设备发送报文中第一设备端口状态与第一设备实际的端口状态。如果发现报文中第一设备端口已经可以恢复,但是实际上端 口还未恢复时,则进入快速恢复处理流程;其他情况下不做任何处理,继续进行LACP协议交互。Step S62 (corresponding to the aforementioned steps S204 and S206), comparing the port status of the first device in the message sent by the second device with the actual port status of the first device. If it is found that the port of the first device in the message can be restored, but in fact the port has not been restored, it will enter the fast recovery process; in other cases, do not do any processing, and continue to interact with the LACP protocol.
需要说明的是,第一设备与第二设备中LACP聚合组中的端口,是通过LACP协议交互与协商确认自身是否能够恢复。端口自身物理状态正常时,也可能因为协议交互失败而导致端口被去激活而无法收发数据。因此上述步骤S62中,如果第一设备的端口物理状态正常,只是因为协议交互而导致无法收发数据时,是可以使其强制激活。这种情况就是本专利提到的端口快速恢复方法。It should be noted that, the ports in the LACP aggregation group in the first device and the second device confirm whether they can recover through LACP protocol interaction and negotiation. When the physical state of the port itself is normal, the port may be deactivated due to protocol interaction failure and cannot send and receive data. Therefore, in the above step S62, if the physical state of the port of the first device is normal, but the data cannot be sent and received due to protocol interaction, it can be activated forcibly. This situation is exactly the method for fast recovery of ports mentioned in this patent.
步骤S63(对应前述步骤S208及步骤S2010),当进入快速恢复处理流程时,需要对第一设备对尚未恢复的端口直接进行恢复,同时第一设备发送端口已经恢复的LACP的协议报文。同时,需要拦截第一设备准备发送的端口状态未恢复的LACP协议报文。In step S63 (corresponding to the aforementioned steps S208 and S2010), when entering the fast recovery process flow, the first device needs to directly recover the port that has not been recovered, and at the same time, the first device sends the LACP protocol message of the port that has been recovered. At the same time, it is necessary to intercept the LACP protocol message whose port status has not been restored and which the first device is about to send.
步骤S64(对应前述步骤S2012及步骤S2014、步骤S2016),在第一设备端口已经恢复后,继续进行LACP协议交互。如果第一设备端口确实可以恢复,则保持;如果根据后续LACP协议交互发现,快速恢复的端口LACP协议无法协商成功,则进行状态回退。即第一设备快速恢复的端口从聚合链路中去激活,且发送端口去激活的LACP协议报文,通知第二设备去激活对接端口。In step S64 (corresponding to the aforementioned steps S2012, S2014, and S2016), the LACP protocol interaction is continued after the first device port has recovered. If the port of the first device can indeed be recovered, it is maintained; if it is found through subsequent LACP protocol interaction that the LACP protocol of the port that is recovering quickly cannot be successfully negotiated, the state is rolled back. That is, the port on which the first device quickly recovers is deactivated from the aggregated link, and sends a port deactivation LACP protocol packet to notify the second device to deactivate the interconnected port.
步骤S65(对应前述步骤S2018),如果步骤S64中的回退情况出现,需要将第一设备端口无法恢复的异常状态通过告警等方式发送,通知相关人员进行故障排查。In step S65 (corresponding to the aforementioned step S2018), if the fallback in step S64 occurs, it is necessary to send the abnormal state that the first device port cannot recover by means of an alarm, etc., and notify relevant personnel to perform troubleshooting.
如图7所示,为防止第二设备错误判断第一设备端口状态,从而防止第二设备向第一设备尚未恢复的端口发送数据导致丢包,提升恢复性能,在另一个具体实施例中,包括以下步骤:As shown in Figure 7, in order to prevent the second device from misjudging the port status of the first device, thereby preventing the second device from sending data to the unrecovered port of the first device and causing packet loss, and improving recovery performance, in another specific embodiment, Include the following steps:
步骤S71,第二设备接收第一设备发送来的LACP协议报文,解析并记录下报文中第一设备的端口状态。In step S71, the second device receives the LACP protocol message sent by the first device, parses and records the port status of the first device in the message.
步骤S72,第二设备收到报文后,系统经过协议处理后回复LACP协议报文,此时解析回复的协议报文,记录回复报文中的第一设备端口状态。Step S72, after the second device receives the message, the system replies with the LACP protocol message after protocol processing, and at this time analyzes the replied protocol message, and records the port status of the first device in the reply message.
步骤S73,比较接收报文和回复报文中的端口状态,如果发现第二设备错误认定第一设备的端口状态,即接收报文与发送报文中,第一设备的端口状态并不一致,则拦截第二设备回复的错误LACP协议报文,同时通知第二设备重新进行协议交互。Step S73, comparing the port status in the received message and the reply message, if it is found that the second device mistakenly identifies the port status of the first device, that is, the port status of the first device in the received message is not consistent with the sent message, then The wrong LACP protocol message replied by the second device is intercepted, and at the same time, the second device is notified to perform protocol interaction again.
步骤S74,拦截错误LACP协议报文之后,为了提高交互效率,可以构造正确端口状态的LACP协议报文发送给第一设备,而不必等待第二设备重新协议交互的结果。Step S74: After intercepting the wrong LACP protocol message, in order to improve the interaction efficiency, the LACP protocol message with the correct port status can be constructed and sent to the first device without waiting for the result of the second device's re-protocol interaction.
对应的,如图8所示,应用在前述第二设备的系统包括:Correspondingly, as shown in Figure 8, the system applied to the aforementioned second device includes:
收发包模块81,该模块主要负责接收和发送LACP协议报文。当LACP协议从第一设备发送过来后,该模块可以负责接收报文。另外,当发现上述报文中端口状态不一致的情况出现,可以代替第二系统发送端口恢复的协议报文,并拦截第二系统发送的错误端口状态协议报文。A packet sending and receiving module 81, which is mainly responsible for receiving and sending LACP protocol packets. After the LACP protocol is sent from the first device, the module can be responsible for receiving the message. In addition, when it is found that the port states in the above messages are inconsistent, the port recovery protocol message can be sent instead of the second system, and the wrong port state protocol message sent by the second system can be intercepted.
协议模块82,该模块主要负责解析LACP协议端口报文,并且比较端口状态。如果发现报文中端口状态不一致的情况出现,则通知第二系统重新进行协议交互,并构造正确端口状态的协议报文,交给收发包模块发送。A protocol module 82, which is mainly responsible for parsing LACP protocol port messages and comparing port states. If it is found that the port state in the message is inconsistent, the second system is notified to perform protocol interaction again, and a protocol message with the correct port state is constructed and sent to the sending and receiving packet module.
本公开的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储 器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。Embodiments of the present disclosure also provide an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input and output device is connected to the processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and exemplary implementation manners, and details will not be repeated here in this embodiment.
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned disclosure can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present disclosure is not limited to any specific combination of hardware and software.
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。The above descriptions are only preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims (13)

  1. 一种端口状态调整方法,包括:A port state adjustment method, comprising:
    第一设备获取来自第二设备的第一报文,其中,所述第一报文中携带有第一状态信息,所述第一状态信息用于指示所述第一设备中包括的第一端口的状态,所述第一设备通过所述第一端口与所述第二设备进行数据传输;The first device acquires a first packet from the second device, where the first packet carries first status information, and the first status information is used to indicate a first port included in the first device state, the first device performs data transmission with the second device through the first port;
    所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的能力信息,其中,所述能力信息用于指示是否允许所述第一端口由异常状态恢复为正常状态;The first device determines capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether to allow The first port returns to a normal state from an abnormal state;
    所述第一设备在所述能力信息为第一能力信息的情况下,对所述第一端口进行激活处理,以使所述第一端口的状态由所述异常状态转换为所述正常状态,其中,所述第一能力信息用于指示允许所述第一端口由异常状态恢复为正常状态。When the capability information is the first capability information, the first device activates the first port, so that the state of the first port changes from the abnormal state to the normal state, Wherein, the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
  2. 根据权利要求1所述的方法,其中,所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的第一能力信息包括:The method according to claim 1, wherein the first device determines the first capability of the first port based on the first status information and the actual status of the first port read by the first device Information includes:
    所述第一设备在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态,且所述第一设备读取的所述第一端口的实际状态为所述正常状态的情况下,确定所述第一端口的能力信息为所述第一能力信息。When the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, and the first port read by the first device When the actual state of a port is the normal state, determine that the capability information of the first port is the first capability information.
  3. 根据权利要求2所述的方法,其中,所述第一设备基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的第一能力信息包括:The method according to claim 2, wherein the first device determines the first capability of the first port based on the first status information and the actual status of the first port read by the first device Information includes:
    所述第一设备在确定所述第一状态信息用于指示所述第一设备中包括的第一端口的状态为所述异常状态或者正常状态、所述第一设备读取的所述第一端口的实际状态为所述正常状态、以及通过所述第一设备执行与所述第二设备的第一协议交互协商后确定所述第一端口能够恢复的情况下,确定所述第一端口的能力信息为所述第一能力信息。When the first device determines that the first state information is used to indicate that the state of the first port included in the first device is the abnormal state or the normal state, the first port read by the first device If the actual state of the port is the normal state and the first device performs the first protocol interaction negotiation with the second device and determines that the first port can be restored, determine the state of the first port The capability information is the first capability information.
  4. 根据权利要求1所述的方法,其中,所述第一设备在对所述第一端口进行激活处理之后,所述方法还包括:The method according to claim 1, wherein, after the first device activates the first port, the method further comprises:
    所述第一设备向所述第二设备发送第二报文,其中,所述第二报文中包括有用于指示所述第一端口的状态已恢复为所述正常状态的第二状态信息;The first device sends a second message to the second device, where the second message includes second state information for indicating that the state of the first port has returned to the normal state;
    所述第一设备终止向所述第二设备发送第三报文,其中,所述第三报文中包括有用于指示所述第一端口的状态为所述异常状态的第三状态信息。The first device terminates sending a third message to the second device, where the third message includes third status information for indicating that the status of the first port is the abnormal status.
  5. 根据权利要求1所述的方法,其中,所述第一设备在对所述第一端口进行激活处理之后,所述方法还包括:The method according to claim 1, wherein, after the first device activates the first port, the method further comprises:
    所述第一设备通过所述第一端口执行与所述第二设备的第二协议交互协商;The first device performs a second protocol interaction negotiation with the second device through the first port;
    所述第一设备在基于所述第二协议交互协商处理确定无法与所述第二设备协商成功的情况下,对所述第一端口进行去激活处理,以使所述第一端口的状态由所述正常状态转换为所述异常状态。In a case where the first device determines that the negotiation with the second device cannot be successful based on the second protocol interaction negotiation process, deactivate the first port, so that the state of the first port is changed to The normal state transitions to the abnormal state.
  6. 根据权利要求5所述的方法,其中,在所述第一设备对所述第一端口进行去激活处理之后,所述方法还包括:The method according to claim 5, wherein, after the first device deactivates the first port, the method further comprises:
    所述第一设备向所述第二设备发送第四报文以指示所述第二设备对所述第二设备中包括的与所述第一端口对接的第二端口执行去激活处理,其中,所述第四报文中包括有用于指示所述第一端口的状态为所述异常状态的第四状态信息。The first device sends a fourth message to the second device to instruct the second device to perform deactivation processing on a second port included in the second device that is connected to the first port, wherein, The fourth message includes fourth status information for indicating that the status of the first port is the abnormal status.
  7. 根据权利要求5所述的方法,其中,在所述第一设备对所述第一端口进行去激活处理之后,所述方法还包括:The method according to claim 5, wherein, after the first device deactivates the first port, the method further comprises:
    所述第一设备发送告警信息。The first device sends alarm information.
  8. 根据权利要求1所述的方法,其中,第一设备获取来自第二设备的第一报文之后,所述方法还包括:The method according to claim 1, wherein after the first device obtains the first message from the second device, the method further comprises:
    所述第一设备基于所述第一报文向所述第二设备回复第五报文,其中,所述第五报文中携带有第五状态信息,所述第五状态信息用于指示所述第一设备基于所述第一报文所获取到的所述第一端口的状态;The first device replies a fifth message to the second device based on the first message, where the fifth message carries fifth state information, and the fifth state information is used to indicate that the The state of the first port obtained by the first device based on the first message;
    所述第一设备获取所述第五状态信息,并对所述第一状态信息和所述第五状态信息进行比对,以得到比对结果;The first device acquires the fifth state information, and compares the first state information with the fifth state information to obtain a comparison result;
    所述第一设备在确定所述比对结果用于指示所述第一状态信息和所述第五状态信息所指示的状态不同的情况下,终止向所述第二设备回复所述第五报文。When the first device determines that the comparison result is used to indicate that the states indicated by the first state information and the fifth state information are different, stop replying the fifth report to the second device. arts.
  9. 根据权利要求8所述的方法,其中,所述第一设备在终止向所述第二设备恢复所述第五报文之后,所述方法还包括:The method according to claim 8, wherein after the first device terminates restoring the fifth message to the second device, the method further comprises:
    所述第一设备向所述第二设备发送通知消息,其中,所述通知消息用于通知所述第二设备重新发送报文。The first device sends a notification message to the second device, where the notification message is used to notify the second device to resend the packet.
  10. 根据权利要求8所述的方法,其中,所述第一设备在终止向所述第二设备恢复所述第五报文之后,所述方法还包括:The method according to claim 8, wherein after the first device terminates restoring the fifth message to the second device, the method further comprises:
    所述第一设备构造并发送第六报文,其中,所述第六报文中携带有第六状态信息,所述第六状态信息用于指示所述第一状态信息所指示的状态。The first device constructs and sends a sixth message, where the sixth message carries sixth state information, and the sixth state information is used to indicate the state indicated by the first state information.
  11. 一种端口状态调整装置,应用于第一设备,包括:A port state adjustment device, applied to a first device, comprising:
    报文采集模块,设置为获取来自第二设备的第一报文,其中,所述第一报文中携带有第一状态信息,所述第一状态信息用于指示所述第一设备中包括的第一端口的状态,所述第一设备通过所述第一端口与所述第二设备进行数据传输;A message collection module, configured to acquire a first message from a second device, wherein the first message carries first state information, and the first state information is used to indicate that the first device includes The state of the first port of the device, the first device performs data transmission with the second device through the first port;
    能力确定模块,设置为基于所述第一状态信息以及所述第一设备读取的所述第一端口的实际状态确定所述第一端口的能力信息,其中,所述能力信息用于指示是否允许所述第一端口由异常状态恢复为正常状态;A capability determining module, configured to determine capability information of the first port based on the first status information and the actual status of the first port read by the first device, where the capability information is used to indicate whether allowing the first port to recover from an abnormal state to a normal state;
    端口激活模块,设置为在所述能力信息为第一能力信息的情况下,对所述第一端口进行激活处理,以使所述第一端口的状态由所述异常状态转换为所述正常状态,其中,所述第一 能力信息用于指示允许所述第一端口由异常状态恢复为正常状态。A port activation module, configured to activate the first port when the capability information is the first capability information, so that the state of the first port changes from the abnormal state to the normal state , wherein the first capability information is used to indicate that the first port is allowed to recover from an abnormal state to a normal state.
  12. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求1至10任一项中所述的方法的步骤。A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein, when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented .
  13. 一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现所述权利要求1至10任一项中所述的方法的步骤。An electronic device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program, any one of claims 1 to 10 is realized The steps of the method described in item.
PCT/CN2021/130417 2021-06-30 2021-11-12 Port state adjustment method and apparatus, and computer-readable storage medium WO2023273100A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110745495.0 2021-06-30
CN202110745495.0A CN115567463A (en) 2021-06-30 2021-06-30 Port state adjusting method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2023273100A1 true WO2023273100A1 (en) 2023-01-05

Family

ID=84690191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/130417 WO2023273100A1 (en) 2021-06-30 2021-11-12 Port state adjustment method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN115567463A (en)
WO (1) WO2023273100A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552725A (en) * 2009-05-13 2009-10-07 杭州华三通信技术有限公司 Recovery processing method, system and apparatus of aggregation sublink
US20180307474A1 (en) * 2017-04-19 2018-10-25 Hewlett Packard Enterprise Development Lp Firmware update in a stacked network device
CN110278094A (en) * 2018-03-13 2019-09-24 中兴通讯股份有限公司 Link restoring method and device, system, storage medium, electronic device
CN111585883A (en) * 2019-02-18 2020-08-25 中兴通讯股份有限公司 Link aggregation port switching method, network equipment and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552725A (en) * 2009-05-13 2009-10-07 杭州华三通信技术有限公司 Recovery processing method, system and apparatus of aggregation sublink
US20180307474A1 (en) * 2017-04-19 2018-10-25 Hewlett Packard Enterprise Development Lp Firmware update in a stacked network device
CN110278094A (en) * 2018-03-13 2019-09-24 中兴通讯股份有限公司 Link restoring method and device, system, storage medium, electronic device
CN111585883A (en) * 2019-02-18 2020-08-25 中兴通讯股份有限公司 Link aggregation port switching method, network equipment and computer storage medium

Also Published As

Publication number Publication date
CN115567463A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
US8817624B2 (en) Higher layer compression with lower layer signaling
US20070115806A1 (en) Methods, systems, and computer program products for session initiation protocol (SIP) fast switchover
CN101729426B (en) Method and system for quickly switching between master device and standby device of virtual router redundancy protocol (VRRP)
TWI740210B (en) Method for terminal device management and server
EP3700258A1 (en) Method and apparatus for processing link establishment failure, and computer storage medium
US11683379B2 (en) Efficient message transmission and loop avoidance in an RPL network
WO2023273100A1 (en) Port state adjustment method and apparatus, and computer-readable storage medium
CN115801642B (en) RDMA communication management module, method, equipment and medium based on state control
US11863368B2 (en) Method and apparatus for subscribing to event streams
US11212204B2 (en) Method, device and system for monitoring node survival state
US11765076B2 (en) Distributed spanning tree protocol
CN116962284A (en) Efficient traffic redirection for MCLAG for controlled unavailability events
CN110602339B (en) Fault detection method, system and storage medium based on voice gateway
CN111224803B (en) Multi-master detection method in stacking system and stacking system
US20230155931A1 (en) Method and apparatus for switching length of bidirectional forwarding detection packet and storage medium
CN111835551A (en) Method and apparatus for operating a network element and a monitoring entity in a communication infrastructure
CN115334139B (en) Communication connection control method and device
CN115801555B (en) Main-standby switching method and device based on preemption delay and electronic equipment
WO2024066942A1 (en) Information transmission method and apparatus
US20230344747A1 (en) Method and apparatus for detecting state of bgp session, and network device
WO2022247675A1 (en) Device operation and maintenance method, network device, and storage medium
JP2010045497A (en) Software radio equipment
Beiroumi High available mobile infrastructure applications
CN116032831A (en) Link aggregation method and device
CN117640375A (en) UPF data hot updating method, device, equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE