CN113315665B - Message sending method, device, equipment and medium of dual-network-card terminal equipment - Google Patents

Message sending method, device, equipment and medium of dual-network-card terminal equipment Download PDF

Info

Publication number
CN113315665B
CN113315665B CN202110691839.4A CN202110691839A CN113315665B CN 113315665 B CN113315665 B CN 113315665B CN 202110691839 A CN202110691839 A CN 202110691839A CN 113315665 B CN113315665 B CN 113315665B
Authority
CN
China
Prior art keywords
network card
message
network
sending
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110691839.4A
Other languages
Chinese (zh)
Other versions
CN113315665A (en
Inventor
王倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Armyfly Technology Co Ltd
Original Assignee
Beijing Armyfly Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Armyfly Technology Co Ltd filed Critical Beijing Armyfly Technology Co Ltd
Priority to CN202110691839.4A priority Critical patent/CN113315665B/en
Publication of CN113315665A publication Critical patent/CN113315665A/en
Application granted granted Critical
Publication of CN113315665B publication Critical patent/CN113315665B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

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

Abstract

The embodiment of the invention discloses a message sending method, a message sending device, message sending equipment and a message sending medium of dual-network-card terminal equipment. The method comprises the following steps: detecting the communication link state of a dual network card in terminal equipment; and if the double network cards are determined to be in the link connection success state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card. The method can realize the quick switching of the double network cards of the terminal equipment, the switching performance can meet the telecommunication level requirement, and particularly, the method has higher reliability in a multicast scene.

Description

Message sending method, device, equipment and medium of dual-network-card terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of Ethernet communication, in particular to a message sending method, a message sending device, message sending equipment and a message sending medium for dual-network-card terminal equipment.
Background
In order to meet the requirements of high real-time performance, high stability and high reliability in an actual communication network, terminal equipment usually adopts redundant connection for failover. For example, a dual network card may be disposed in the terminal device to implement failover.
Fig. 1 is a schematic diagram of a redundant connection network topology in the prior art, where each terminal device employs a dual network card uplink switch, where the dual network cards are respectively connected to a master switch and a slave switch. The main switch and the slave switch are mutually backup, and the aggregation is used between the switches to carry out the redundancy protection of the link. The terminal equipment can select one main network card from the double network cards to work, and the other main network card does not work as a standby network card; when the main network card fails, the standby network card can be switched to work.
However, if the terminal device is a multicast receiver, when the link connected to the main network card fails, the working network card of the terminal device is switched from the main network card to the standby network card, and the communication can be recovered after the multicast is interrupted for a certain time. For example, in the prior art, a multicast querier periodically performs multicast query, and after a terminal device replies to a group to be joined, multicast traffic may be copied from a switch to the terminal device. The query interval and response duration are typically large, up to tens of seconds. When the network card is switched, the multicast traffic cannot be rapidly forwarded to the terminal device, the reliability is poor, and the internet experience of the user is influenced.
Disclosure of Invention
The embodiment of the invention provides a message sending method, a message sending device, message sending equipment and a message sending medium for dual-network card terminal equipment, which can reduce the switching time of dual-network cards in the terminal equipment and improve the reliability of data transmission.
In a first aspect, an embodiment of the present invention provides a packet sending method for a dual-network-card terminal device, where the method includes:
detecting the communication link state of a dual network card in terminal equipment;
and if the double network cards are determined to be in the link connection success state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card.
In a second aspect, an embodiment of the present invention further provides a packet sending apparatus for a dual-network card terminal device, where the apparatus includes:
the communication link state detection module is used for detecting the communication link state of the dual-network card in the terminal equipment;
and the first message receiving and sending processing module is used for synchronously sending the protocol message sent by the first network card through the second network card in the process of receiving and sending the message through the first network card if the condition that the double network cards are both in the link connection successful state is determined.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement a method for sending a message by a dual-network-card terminal device according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a message sending method for a dual-network card terminal device according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the communication link state of the dual network cards in the terminal equipment is detected; if the double network cards are determined to be in the link connection successful state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card, so that the problem of quick switching of the double network cards in the terminal equipment is solved, the switching time of the double network cards is shortened, the switching requirement of a carrier level is met, and the effect of improving the reliability of data transmission is achieved.
Drawings
FIG. 1 is a prior art schematic diagram of a redundant connection network topology;
fig. 2 is a flowchart of a message sending method of a dual-network-card terminal device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of virtual adaptation of dual network cards according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating initial adaptation of a dual network card in a terminal device according to an embodiment of the present invention;
fig. 5 is a flow chart of message sending of a dual network card terminal device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a topology of a multicast data redundant connection network according to an embodiment of the present invention;
fig. 7 is a flowchart of a message sending method of a dual-network-card terminal device according to a second embodiment of the present invention;
fig. 8 is a schematic diagram of a communication link status update event response logic according to a second embodiment of the present invention;
fig. 9 is a schematic structural diagram of a message sending apparatus of a dual-network-card terminal device according to a third embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 2 is a flowchart of a message sending method of a dual-network-card terminal device according to an embodiment of the present invention, where this embodiment is applicable to a situation where a dual-network card of a terminal device is rapidly switched in multicast data transmission, and the method may be executed by a message sending apparatus of the dual-network-card terminal device, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in an electronic device such as a terminal device, as shown in fig. 2, where the method specifically includes:
and 110, detecting the communication link state of the dual-network card in the terminal equipment.
The terminal device may be an electronic device performing network communication, such as a computer or a mobile phone. The network card may be a physical network card provided in the terminal device. The terminal device may send a message to an external device such as a switch or a router through the network card. The terminal device can also receive the message sent by the external device through the network card. The double network cards can realize data redundancy in the terminal equipment, and redundancy switching can be carried out when the working network card has a fault.
Specifically, a main network card and a standby network card are usually arranged in the dual network card. The terminal device defaults that the main network card is a working network card, and the standby network card is a non-working network card. And the standby network card performs redundancy switching when the main network card fails to work as a working network card. In the prior art, a working network card is used for transmitting and receiving messages, and a non-working network card does not participate in the transmitting and receiving of the messages.
The communication link status may indicate whether the network card is available for communication. The communication link state may be determined by detecting a port state of a network card in the terminal device. For example, the terminal device may detect an up/down port of the network card, and if the port is up, it indicates that the communication link state is a link connection success state; if the port is down, the communication link state is the link connection failure state. When the link connection is successful, the corresponding network card can normally communicate; and when the link connection fails, the corresponding network card cannot communicate.
And step 120, if it is determined that the dual network cards are both in the link connection successful state, synchronously sending the protocol message sent by the first network card through the second network card in the process of sending and receiving the message through the first network card.
When the dual-network cards are in a state of successful link connection, it is indicated that the dual-network cards can normally communicate, and a main network card in the dual-network cards can be used as a working network card and a standby network card can be used as a non-working network card. In the embodiment of the present invention, the first network card may be a master network card, and may perform the transmission and reception processing of the message. The second network card may be a standby network card, and may synchronously send the protocol message sent by the first network card, so that the switch on the upstream of the terminal device can identify the second network card.
If the first network card is in fault and needs to be switched to the second network card, the switching can be quickly carried out without waiting for the second network card to send the protocol message, and the switch confirms the received protocol message and then carries out the forwarding operation of the data message. The protocol message sent by the first network card is synchronously sent through the second network card, so that the switching time of the network cards can be shortened, and the reliability of data transmission is improved.
Specifically, in an optional implementation manner of the embodiment of the present invention, after determining that both dual network cards are in a link connection successful state, the method further includes: setting the first network card as a working network card of the terminal equipment to receive and send messages; and controlling the first network card to simultaneously start a message sending function and a message receiving function, and controlling the second network card to start the message sending function and simultaneously close the message receiving function.
When the first network card is used for receiving and sending messages, the message sending function and the message receiving function of the first network card need to be started. When the protocol message sent by the first network card is synchronously sent through the second network card, the message sending function of the second network card needs to be started, the protocol message can be sent from the second network card, and when the first network card fails, the data message can be directly copied from the switch through the second network card, so that data redundancy protection is formed. When the message sending function of the second network card is started, the message receiving function is closed, and redundant data can be prevented from being received from the second network card.
In an optional implementation manner of the embodiment of the present invention, in the process of performing a process of sending and receiving a message through a first network card, the synchronously sending, through a second network card, a protocol message sent by the first network card includes: in the process of transmitting and receiving the message through the first network card, acquiring a target message to be transmitted by the first network card in real time; if the target message is determined to belong to the multicast protocol message, generating a copy message of the target message; and sending the copy message through the second network card while sending the target message through the first network card.
The multicast Protocol packet may be an Internet Group Management Protocol (IGMP) packet. When the target message to be sent by the first network card is an IGMP protocol message, the IGMP protocol message needs to be synchronously sent through the second network card. If the second network card is in the link connection successful state, the synchronous transmission of the IGMP protocol message can be carried out through the second network card, the switch can inquire that the first network card and the second network card are both in the active state, and the switch can transmit the data message to the first network card and the second network card.
On the basis of the foregoing embodiment, optionally, after detecting the communication link status of the dual network card in the terminal, the method further includes: if the unique network card in the dual network cards is in the link connection successful state, controlling the unique network card to simultaneously start a message sending function and a message receiving function, and controlling the network card in the link connection failed state in the dual network cards to simultaneously stop the message sending function and the message receiving function; and if all the network cards in the double network cards are determined to be in the link connection failure state, controlling all the network cards to simultaneously close the message sending function and the message receiving function.
When only one network card in the dual network cards, namely the only network card, is in a link connection success state, the only network card can be set as a working network card to receive and send messages; specifically, the terminal device can control the unique network card to simultaneously start a message sending function and a message receiving function; and controlling the network card in the link connection failure in the double network cards as a non-working network card, and closing the message sending function and the message receiving function.
When the two network cards are in a link connection failure state, indicating that the physical network card of the terminal equipment is unavailable, stopping the receiving and sending processing of the message; specifically, the terminal device may control the dual network cards to simultaneously close the message sending function and the message receiving function.
According to the technical scheme of the embodiment of the invention, the communication link state of the dual network cards in the terminal equipment is detected; if the double network cards are determined to be in the state of successful link connection, the protocol message sent by the first network card is synchronously sent by the second network card in the process of sending and receiving the message through the first network card, so that the problem of quick switching of the double network cards when the terminal equipment is used as a multicast receiver is solved, the switching time of the double network cards is shortened, the time for multicast flow to reach the terminal equipment is shorter than 50 milliseconds when the network cards are switched due to faults, the switching requirement of a telecommunication level is met, and the effect of improving the reliability of data transmission is achieved.
On the basis of the foregoing embodiment, optionally, after detecting the communication link status of the dual network card in the terminal, the method further includes: and if at least one network card in the double network cards is determined to be in a link connection success state, setting a target communication link state presented by the virtual network card of the terminal equipment to be a link connection success state, wherein the link connection success state of the virtual network card is used for indicating that protocol messages sent by the working network card are synchronously sent through the non-working network card when the working network card which sends messages at present is in a link connection success state and meanwhile the non-working network card which does not send messages at present is in a link connection success state.
Specifically, the link connection success status of the virtual network card may be used to: when the message is sent, if the working network card which currently sends the message, and meanwhile, the non-working network card which currently does not send the message is in a link connection success state, and the target message belongs to the multicast protocol message, the multicast protocol message sent by the working network card is indicated to be synchronously sent through the non-working network card.
Optionally, if it is determined that all network cards in the dual network cards are in the link connection failure state, setting a target communication link state presented by the virtual network card of the terminal device as the link connection failure state; and the link connection failure state of the virtual network card is used for indicating that the message receiving and sending processing through the double network cards is stopped.
In the embodiment of the present invention, a virtual network card may be configured to adapt to a dual network card. Fig. 3 is a schematic diagram of virtual adaptation of dual network cards according to an embodiment of the present invention. As shown in fig. 3, the virtual network card may determine the presented target communication link state according to the communication link state of the dual network cards (both the main network card and the standby network card are physical network cards). The target communication link state of the virtual network card may indicate the current communication link state of the terminal device, that is, whether the terminal device can perform message transceiving processing, to a protocol stack, an application layer, even a switch external to the terminal device, and the like.
Specifically, the network card in the dual network cards is in a link connection successful state, and the virtual network card can present the link connection successful state, which indicates that the terminal device can perform message receiving and sending processing. The double network cards are in a link connection failure state, and the virtual network card can present the link connection failure state and indicate that the terminal equipment cannot process the receiving and sending messages. The virtual network card can clearly and conveniently indicate whether the terminal equipment can process the receiving and sending messages or not.
Fig. 4 is a schematic diagram illustrating initial adaptation of a dual network card in a terminal device according to an embodiment of the present invention.
As shown in fig. 4, the specific setting process of the dual network card in the terminal device may be as follows:
detecting the communication link state (up/down) of the dual network cards in the terminal equipment, and respectively marking the communication link states of the main network card and the standby network card.
If the double network cards are both up, setting the main network card as a working network card and the standby network card as a non-working network card; starting a message sending function and a message receiving function of the main network card; starting a message sending function of the standby network card and closing a message receiving function of the standby network card; and setting a virtual network card up.
If the unique network card up exists in the double network cards, setting the unique network card as a working network card, and setting the other network card as a non-working network card; starting a message sending function and a message receiving function of the unique network card; closing the message sending function and the message receiving function of the non-working network card; and setting a virtual network card up.
If the double network cards are all down, setting the main network card and the standby network card as non-working network cards; closing the message sending function and the message receiving function of the double network cards; and setting a virtual network card down.
Fig. 5 is a flowchart of message sending of a dual-network-card terminal device according to an embodiment of the present invention. As shown in fig. 5, when a user initiates a request for sending a message through an application in a terminal device, the terminal device may obtain a target communication link state presented by a virtual network card. If the target communication link state is a link connection failure state (down), the terminal equipment can refuse to send the message request; if the target communication link state is a link connection success state (up), the terminal device may select the working network card to send a message. If the sending message is not an IGMP protocol message, the non-working network card can not process the message sending request; if the sending message is an IGMP protocol message and the non-working network card is in a link connection success state (up), the non-working network card (at the moment, the standby network card) can send the message.
According to the technical scheme of the embodiment of the invention, when the dual-network cards are both up, the main network card sends and receives the message; when the main network card sends the IGMP protocol message, the standby network card synchronously sends the IGMP protocol message; and the virtual network card is set to present the target communication link state of the terminal equipment, so that the quick switching of the dual network cards can be realized, and the communication state of the terminal equipment can be conveniently displayed.
Specifically, when the terminal device is a multicast receiver and is switched from the main network card to the standby network card, the standby network card can quickly acquire the data message transmitted by the switch; the switch does not need to wait for the standby network card to send an IGMP protocol message to the switch, and the switch identifies the IGMP protocol message and then sends the data message to the standby network card; the switching time of the network card is shortened, and the reliability of data transmission can be improved.
Fig. 6 is a schematic diagram of a topology of a multicast data redundant connection network according to an embodiment of the present invention. As shown in fig. 6, it is assumed that the master network card is connected to the slave switch and the backup network card is connected to the master switch. When the terminal device 1 requests the server N for multicast data, the main network card and the standby network card in the terminal device 1 are both up. The message sending function and the message receiving function of the main network card are both started; the message sending function of the standby network card is started, and the message receiving function is closed. The terminal device 1 may select the master network card to send an IGMP protocol packet to the slave switch, and the slave switch forwards the IGMP protocol packet to the master switch. And after determining the IGMP protocol message, the master switch forwards the multicast data message sent by the server N to the slave switch. And the slave switch forwards the multicast data message to the master network card to realize that the terminal equipment 1 receives the multicast data of the server N.
In the above process, when the terminal device 1 may select the master network card to send an IGMP protocol message to the slave switch, the standby network card synchronously sends the IGMP protocol message to the master switch. And after determining the IGMP protocol message, the main switch forwards the multicast data message sent by the server N to the standby network card. The message receiving function of the standby network card is closed, and the multicast data message can not be received. If the main network card fails and the standby network card is updated to the working network card, the message receiving function of the standby network card can be started, the multicast data message is received, and the network cards can be quickly switched.
Example two
Fig. 7 is a flowchart of a message sending method of a dual-network-card terminal device according to a second embodiment of the present invention. The present embodiment is a further refinement of the above technical solutions, and the technical solutions in the present embodiment may be combined with various alternatives in one or more of the above embodiments. As shown in fig. 7, the method includes:
and step 210, detecting the communication link state of the dual network cards in the terminal equipment.
Step 220, if it is determined that the dual network cards are both in the link connection successful state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card.
And step 230, if the unique network card in the dual network cards is determined to be in the link connection success state, performing message receiving and sending processing through the unique network card.
And step 240, if all the network cards in the double network cards are determined to be in the link connection failure state, stopping the message receiving and sending processing.
The execution manner of steps 220 to 240 may be to alternatively execute according to the detected dual network card communication link status.
And step 250, detecting a communication link state updating event of the dual network cards in the terminal equipment.
The communication link state update event may include a link connection success event and a link connection failure event. Specifically, the link connection success event may refer to a change from a link connection failure state to a link connection success state (down to up) of the network card; the link connection failure event may refer to a network card changing from a link connection successful state to a link connection failed state (up to down).
And step 260, if it is determined that the working network card in the link connection success state exists in the dual network cards before the communication link state updating event, and the communication link state updating event is the link connection success event of the current non-working network card, synchronously sending the protocol message sent by the working network card through the current non-working network card.
Before the communication link state updating event, the current working network card can exist in the double network cards, and the other network card is the current non-working network card. When the current non-working network card is detected to be changed from down to up and the communication link state of the working network card is not changed, the working network card can be continuously used as the working network card, and a message sending function and a message receiving function are started; the network card which does not work at present can start the message sending function and simultaneously close the message receiving function.
When the double network cards are all up, the terminal equipment can be used as a multicast receiver, and when the current working network card fails, the double network cards are quickly switched; the current non-working network card can quickly receive the multicast data message, and can ensure the reliability of data transmission, and for specific description, reference may be made to fig. 6 and the explanation content corresponding to fig. 6, which is not described herein again.
On the basis of the foregoing embodiment, optionally, after detecting a communication link state update event of a dual network card in a terminal device, the method further includes: and if the double network cards are in the link connection failure state before the communication link state updating event is determined, and the communication link state updating event is the link connection success event of any link connection failure network card, performing message receiving and sending processing through the link connection failure network card.
Before a communication link state updating event, the dual network cards are both in a link connection failure state, which indicates that the dual network cards are both non-working network cards. Any link connection failure network card is changed from down to up, the link connection failure network card can be set as a working network card, and the message sending function and the message receiving function of the network card are started at the same time.
On the basis of the foregoing embodiment, optionally, after detecting a communication link status update event of a dual network card in the terminal device, the method further includes: if the communication link state updating event is a link connection failure event of the current working network card, and the current non-working network card in the double network cards is determined to be in a link connection successful state before the communication link state updating event, performing message receiving and sending processing through the current non-working network card, and stopping performing message receiving and sending processing through the current working network card.
Before the communication link state updating event, the dual-network cards are both up. When the current working network card is changed from up to down, the current non-working network card can be updated to a new working network card, the message receiving function of the current non-working network card is started, and the message is transmitted and received through the current non-working network card; and updating the current working network card into a message non-working network card, closing the message sending function and the message receiving function, and stopping the message sending and receiving processing through the current working network card.
On the basis of the foregoing embodiment, optionally, after detecting a communication link status update event of a dual network card in the terminal device, the method further includes: and if the communication link state updating event is a link connection failure event of the current working network card and the current non-working network card in the double network cards is determined to be in the link connection failure state before the communication link state updating event, stopping the message receiving and sending processing.
Before the communication link state updating event, the current working network card up and the current non-working network card down exist in the double network cards. When the current working network card is changed from up to down, the dual network cards are down, the terminal equipment cannot communicate, the current working network card can be updated to the non-working network card, the message sending function and the message receiving function are closed, and the message receiving and sending processing is stopped.
On the basis of the foregoing embodiment, optionally, after detecting a communication link status update event of a dual network card in the terminal device, the method further includes: and if the communication link state updating event is a link connection failure event of the current non-working network card, stopping synchronously sending the protocol message sent by the current working network card through the current non-working network card.
Wherein, before the communication link state updating event, the dual-network cards are both up. When the current non-working network card is changed from up to down, the current non-working network card can not send messages any more, the message sending function is closed, and the protocol messages sent by the current working network card are stopped being sent synchronously through the current non-working network card.
Specifically, fig. 8 is a schematic diagram of a communication link status update event response logic according to a second embodiment of the present invention. As shown in fig. 8, when a communication link status update event of the dual network card in the terminal device is detected, the following process may be performed:
when the network card is detected to be changed from up to down, the communication link state of the corresponding network card can be marked as down, and the message sending function and the message receiving function of the network card are closed. And if the current working network card is changed from up to down, judging whether the current non-working network card is up. If the current non-working network card is up, the network card can be switched to be a working network card, and the message sending function and the message receiving function of the current non-working network card are started; and if the current non-working network card is down, setting a virtual network card down.
When the network card is detected to be changed from down to up, the communication link state of the corresponding network card can be marked as up, and whether the dual-network cards are both down or not is judged before the network card is changed from down to up. If the network cards are all down before the network cards are changed from down to up, updating the network cards changed from down to up into working network cards, starting a message sending function and a message receiving function, and setting a virtual network card up; if the network card up exists before the network card is changed from down to up, the network card changed from down to up is the current non-working network card, the message sending function can be started, and the protocol message sent by the current working network card is synchronously sent through the current non-working network card.
According to the technical scheme of the embodiment, the communication link state of the dual-network card in the terminal equipment is detected; if the double network cards are determined to be in the state of successful link connection, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card; if the unique network card in the double network cards is determined to be in the link connection success state, the unique network card is used for receiving and sending messages; if all network cards in the double network cards are determined to be in a link connection failure state, stopping the receiving and sending processing of the message; detecting a communication link state updating event of a dual network card in terminal equipment; if the working network card in the link connection success state exists in the double network cards before the communication link state updating event is determined, and the communication link state updating event is the link connection success event of the current non-working network card, the protocol message sent by the working network card is synchronously sent through the current non-working network card, so that the problem of quick switching of the double network cards when the terminal device is used as a multicast receiver is solved, the protocol message can be synchronously sent when the link connection success event of the current non-working network card is detected, the switching time of the double network cards is shortened, the time for multicast flow to reach the terminal device is shorter than 50 milliseconds when the network cards are switched in a fault, the telecommunication level switching requirement is met, and the data transmission reliability is improved.
EXAMPLE III
Fig. 9 is a schematic structural diagram of a message sending apparatus of a dual-network-card terminal device according to a third embodiment of the present invention. With reference to fig. 9, the apparatus comprises: a communication link status detection module 310 and a first messaging processing module 320. Wherein:
a communication link state detection module 310, configured to detect a communication link state of a dual network card in a terminal device;
the first message transceiving processing module 320 is configured to, if it is determined that both the dual network cards are in the link connection successful state, send the protocol message sent by the first network card synchronously through the second network card in the transceiving processing process of the message through the first network card.
Optionally, the apparatus further includes:
the working network card setting module is used for setting the first network card as the working network card of the terminal equipment after determining that the double network cards are both in the link connection success state so as to receive and send the message;
and the message receiving and sending function control module is used for controlling the first network card to simultaneously start a message sending function and a message receiving function and controlling the second network card to close the message receiving function while starting the message sending function.
Optionally, the first message transceiving processing module 320 includes:
the target message acquisition unit is used for acquiring a target message to be sent by the first network card in real time in the process of sending and receiving the message through the first network card;
a duplicate message generation unit, configured to generate a duplicate message of the target message if it is determined that the target message belongs to the multicast protocol message;
and the copy message sending unit is used for sending the copy message through the second network card while sending the target message through the first network card.
Optionally, the apparatus further includes:
the second message receiving and sending processing module is used for controlling the unique network card to simultaneously start a message sending function and a message receiving function and controlling the network card in the link connection failure state to simultaneously close the message sending function and the message receiving function if the unique network card in the dual network cards is determined to be in the link connection success state after the communication link state of the dual network cards in the terminal is detected;
and the third message transceiving processing module is used for controlling all network cards to simultaneously close the message sending function and the message receiving function if all network cards in the double network cards are determined to be in the link connection failure state.
Optionally, the apparatus further includes:
the first target communication link state setting module is used for setting a target communication link state presented by a virtual network card of the terminal equipment as a link connection success state if at least one network card in the dual network cards is determined to be in the link connection success state after the communication link state of the dual network cards in the terminal is detected;
and the successful link connection state of the virtual network card is used for indicating that the protocol message sent by the working network card is synchronously sent through the non-working network card when the working network card which sends the message at present sends the message and the non-working network card which does not send the message at present is in the successful link connection state. (ii) a
Optionally, the successful link connection state of the virtual network card is specifically used for:
when sending the message, indicating to send and receive the message through the working network card, and when determining that the target message belongs to the multicast protocol message, sending the copy message through the non-working network card in the link connection success state.
The second target communication link state setting module is used for setting the target communication link state presented by the virtual network card of the terminal equipment as the link connection failure state if all the network cards in the double network cards are determined to be in the link connection failure state; and the link connection failure state of the virtual network card is used for indicating that the receiving and sending processing of the message through the double network cards is stopped.
Optionally, the apparatus further includes:
the communication link state updating event detection module is used for detecting a communication link state updating event of a dual network card in the terminal equipment;
and the fourth message transceiving processing module is used for synchronously sending the protocol message sent by the working network card through the current non-working network card if the working network card in the link connection success state exists in the double network cards before the communication link state updating event is determined, and the communication link state updating event is the link connection success event of the current non-working network card.
Optionally, the apparatus further includes:
a fifth message transceiving processing module, configured to, after detecting a communication link state update event of a dual network card in the terminal device, if it is determined that both the dual network cards are in a link connection failure state before the communication link state update event and the communication link state update event is a link connection success event of any link connection failure network card, perform transceiving processing of a message through the link connection failure network card;
a sixth message transceiving processing module, configured to, if the communication link state update event is a link connection failure event of the currently-operating network card, and it is determined that the currently-inoperative network card in the dual network cards is in a link connection successful state before the communication link state update event, perform transceiving processing of a message through the currently-inoperative network card, and stop performing transceiving processing of a message through the currently-operating network card;
a seventh message transceiving processing module, configured to stop transceiving a message if the communication link state update event is a link connection failure event of the currently-operating network card and it is determined that the currently-inoperative network card in the dual network cards is in a link connection failure state before the communication link state update event;
and the eighth message transceiving processing module is configured to stop synchronous sending of the protocol message sent by the current working network card through the current non-working network card if the communication link state update event is a link connection failure event of the current non-working network card.
The message sending device of the dual-network-card terminal equipment provided by the embodiment of the invention can execute the message sending method of the dual-network-card terminal equipment provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 10 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention, and as shown in fig. 10, the electronic device includes:
one or more processors 410, one processor 410 being exemplified in FIG. 10;
a memory 420;
the apparatus may further include: an input device 430 and an output device 440.
The processor 410, the memory 420, the input device 430 and the output device 440 in the apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 10.
The memory 420 is a non-transitory computer-readable storage medium, and can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the message sending method of the dual-network-card terminal device in the embodiment of the present invention (for example, the communication link status detecting module 310 and the first message sending and receiving processing module 320 shown in fig. 9). The processor 410 executes various functional applications and data processing of the computer device by running the software program, instructions and modules stored in the memory 420, that is, the message sending method of the dual-network card terminal device of the above-described method embodiment is implemented, that is, the message sending method of the dual-network card terminal device:
detecting the communication link state of a dual network card in terminal equipment;
and if the double network cards are determined to be in the state of successful link connection, synchronously sending the protocol message sent by the first network card through the second network card in the process of sending and receiving the message through the first network card.
The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 420 may optionally include memory located remotely from processor 410, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 440 may include a display device such as a display screen.
EXAMPLE five
The fifth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for sending a packet of a dual-network-card terminal device, according to the fifth embodiment of the present invention:
detecting the communication link state of a dual network card in terminal equipment;
and if the double network cards are determined to be in the link connection success state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (9)

1. A message sending method of a dual-network card terminal device is characterized by comprising the following steps:
detecting the communication link state of a dual network card in terminal equipment;
if the double network cards are determined to be in the link connection success state, the protocol message sent by the first network card is synchronously sent through the second network card in the process of sending and receiving the message through the first network card;
after determining that the dual network cards are both in the link connection successful state, the method further comprises the following steps:
setting the first network card as a working network card of the terminal equipment to receive and send messages;
and controlling the first network card to simultaneously start a message sending function and a message receiving function, and controlling the second network card to stop the message receiving function while starting the message sending function.
2. The method according to claim 1, wherein the synchronously transmitting the protocol message transmitted by the first network card through the second network card during the process of transmitting and receiving the message through the first network card comprises:
in the process of transmitting and receiving messages through a first network card, acquiring a target message to be transmitted by the first network card in real time;
if the target message is determined to belong to the multicast protocol message, generating a copy message of the target message;
and sending the copy message through the second network card while sending the target message through the first network card.
3. The method according to claim 1, further comprising, after detecting the communication link status of the dual network card in the terminal:
if the unique network card in the dual network cards is in the link connection success state, controlling the unique network card to simultaneously start a message sending function and a message receiving function, and controlling the network card in the link connection failure state in the dual network cards to simultaneously stop the message sending function and the message receiving function;
and if all the network cards in the double network cards are determined to be in a link connection failure state, controlling all the network cards to simultaneously close a message sending function and a message receiving function.
4. The method according to any one of claims 1-3, further comprising, after detecting the communication link status of the dual network card in the terminal:
if at least one network card in the double network cards is determined to be in a link connection success state, setting a target communication link state presented by a virtual network card of the terminal equipment as a link connection success state;
and the link connection success state of the virtual network card is used for indicating that the protocol message sent by the working network card is synchronously sent through the non-working network card when the working network card which sends the message at present sends the message and the non-working network card which does not send the message at present is in the link connection success state.
5. The method according to any one of claims 1-3, further comprising:
detecting a communication link state updating event of a dual network card in the terminal equipment;
and if the working network card in the link connection successful state exists in the double network cards before the communication link state updating event is determined, and the communication link state updating event is the link connection successful event of the current non-working network card, synchronously sending the protocol message sent by the working network card through the current non-working network card.
6. The method according to claim 5, further comprising, after detecting a communication link status update event of a dual network card in the terminal device:
if the fact that the double network cards are in the link connection failure state before the communication link state updating event is determined, and the communication link state updating event is the link connection success event of any link connection failure network card, the message is transmitted and received through the link connection failure network card;
if the communication link state updating event is a link connection failure event of the current working network card and the current non-working network card in the double network cards is determined to be in the link connection success state before the communication link state updating event, performing message receiving and sending processing through the current non-working network card and stopping performing message receiving and sending processing through the current working network card;
if the communication link state updating event is a link connection failure event of the current working network card and the current non-working network card in the double network cards is determined to be in the link connection failure state before the communication link state updating event, stopping the receiving and sending processing of the message;
and if the communication link state updating event is a link connection failure event of the current non-working network card, stopping synchronously sending the protocol message sent by the current working network card through the current non-working network card.
7. A message sending device of a dual network card terminal device is characterized by comprising:
the communication link state detection module is used for detecting the communication link state of the dual network cards in the terminal equipment;
the first message receiving and sending processing module is used for synchronously sending the protocol message sent by the first network card through the second network card in the process of receiving and sending the message through the first network card if the condition that the double network cards are both in the link connection successful state is determined;
the working network card setting module is used for setting the first network card as the working network card of the terminal equipment after determining that the double network cards are both in the state of successful link connection so as to receive and send messages;
and the message receiving and sending function control module is used for controlling the first network card to simultaneously start a message sending function and a message receiving function and controlling the second network card to close the message receiving function while starting the message sending function.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110691839.4A 2021-06-22 2021-06-22 Message sending method, device, equipment and medium of dual-network-card terminal equipment Active CN113315665B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110691839.4A CN113315665B (en) 2021-06-22 2021-06-22 Message sending method, device, equipment and medium of dual-network-card terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110691839.4A CN113315665B (en) 2021-06-22 2021-06-22 Message sending method, device, equipment and medium of dual-network-card terminal equipment

Publications (2)

Publication Number Publication Date
CN113315665A CN113315665A (en) 2021-08-27
CN113315665B true CN113315665B (en) 2023-01-06

Family

ID=77379826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110691839.4A Active CN113315665B (en) 2021-06-22 2021-06-22 Message sending method, device, equipment and medium of dual-network-card terminal equipment

Country Status (1)

Country Link
CN (1) CN113315665B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923739A (en) * 2021-10-27 2022-01-11 上海寰创通信科技股份有限公司 System for reducing roaming time delay of wireless client terminal equipment
CN114338457B (en) * 2021-12-23 2023-12-01 绿盟科技集团股份有限公司 Test system, method, device, equipment and medium for network card switching effectiveness
CN114928567B (en) * 2022-02-09 2023-08-29 浙江远望信息股份有限公司 Method for discovering multi-network card equipment based on network scanning technology
CN116896530A (en) * 2023-08-29 2023-10-17 广东保伦电子股份有限公司 Seamless communication method and device of double network card equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6512774B1 (en) * 1999-03-18 2003-01-28 3Com Corporation Fail over with multiple network interface cards
CN106301836A (en) * 2015-05-25 2017-01-04 北京视联动力国际信息技术有限公司 A kind of method of redundancy backup, terminal and regard networked system
CN111447078A (en) * 2019-11-14 2020-07-24 天津津航计算技术研究所 Redundancy method for Ethernet hot standby hot switching based on multicast protocol
CN112822102A (en) * 2020-12-30 2021-05-18 瑞斯康达科技发展股份有限公司 Link switching method, device, equipment, system and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6512774B1 (en) * 1999-03-18 2003-01-28 3Com Corporation Fail over with multiple network interface cards
CN106301836A (en) * 2015-05-25 2017-01-04 北京视联动力国际信息技术有限公司 A kind of method of redundancy backup, terminal and regard networked system
CN111447078A (en) * 2019-11-14 2020-07-24 天津津航计算技术研究所 Redundancy method for Ethernet hot standby hot switching based on multicast protocol
CN112822102A (en) * 2020-12-30 2021-05-18 瑞斯康达科技发展股份有限公司 Link switching method, device, equipment, system and storage medium

Also Published As

Publication number Publication date
CN113315665A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
CN113315665B (en) Message sending method, device, equipment and medium of dual-network-card terminal equipment
CN111343093B (en) Service data transmission method and device
CN102439903B (en) Method, device and system for realizing disaster-tolerant backup
US8107386B2 (en) VPLS N-PE redundancy using pseudo wire fast failover
US9219640B2 (en) Performing failover in a redundancy group
US20060176804A1 (en) Data transfer apparatus and multicast system
CN102904818A (en) Method and device for updating ARP (Address Resolution Protocol) information table
US11924024B2 (en) Switching method and apparatus, device, and storage medium
WO2011147312A1 (en) Method, device and system for port backup of service access router
EP4366334A1 (en) Message processing method, electronic device, and storage medium
CN106330699B (en) Multicast link switching method and device and routing equipment
CN113645312A (en) Method and device for protecting sub-ring network link based on ERPS protocol
CN102868616B (en) Method for establishing virtual MAC (Media Access Control) address table item in network as well as router and system
CN112217735A (en) Information synchronization method and load balancing system
CN109428814B (en) Multicast traffic transmission method, related equipment and computer readable storage medium
CN103166847B (en) Ensure the method and apparatus of Graceful Restart
WO2015158058A1 (en) Method and system for implementing call saving and recovery
CN114422335A (en) Communication method, communication device, server and storage medium
CN116074187A (en) Main-standby link switching method and device, electronic equipment and storage medium
CN109257444B (en) Load sharing method, device and system
CN109361781B (en) Message forwarding method, device, server, system and storage medium
CN112217718A (en) Service processing method, device, equipment and storage medium
CN111953786A (en) System, method and device for recording messages in whole network, network equipment and storage medium
CN106992878B (en) Multicast detection method and device
CN114727324B (en) Network disaster recovery processing method and device, storage medium and electronic equipment

Legal Events

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