CN108809756B - Communication method of photoelectric conversion module under linux system and related product - Google Patents

Communication method of photoelectric conversion module under linux system and related product Download PDF

Info

Publication number
CN108809756B
CN108809756B CN201810483414.2A CN201810483414A CN108809756B CN 108809756 B CN108809756 B CN 108809756B CN 201810483414 A CN201810483414 A CN 201810483414A CN 108809756 B CN108809756 B CN 108809756B
Authority
CN
China
Prior art keywords
state
optical
linux system
setting
optical port
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
CN201810483414.2A
Other languages
Chinese (zh)
Other versions
CN108809756A (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.)
Shenzhen JWIPC Technology Co Ltd
Original Assignee
Shenzhen JWIPC 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 Shenzhen JWIPC Technology Co Ltd filed Critical Shenzhen JWIPC Technology Co Ltd
Priority to CN201810483414.2A priority Critical patent/CN108809756B/en
Publication of CN108809756A publication Critical patent/CN108809756A/en
Application granted granted Critical
Publication of CN108809756B publication Critical patent/CN108809756B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • 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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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

Abstract

The invention discloses a communication method of a light-to-electricity module under a linux system and a related product, wherein the method comprises the following steps: detecting the state of an optical port of a photoelectric conversion module under a linux system; if the linux system script detects that the electric port state identifier is TP, the linux system script continues to run; and detecting the link state of the optical port connection under the system by the linux system script, and if the link state of the connection is not, setting and activating the optical port connection network. The technical scheme provided by the invention has the advantage of high user experience.

Description

Communication method of photoelectric conversion module under linux system and related product
Technical Field
The invention relates to the field of internet, in particular to a communication method of a photoelectric conversion module under a linux system and a related product.
Background
In the network security industry, an optical fiber network port (hereinafter referred to as an optical port) is more and more popular in practical use due to high transmission speed and stable transmission rate; in the using process, the optical port has two common connection communication modes, one is connection by an optical fiber module and communication with the outside through an optical fiber line, and the other is connection by an optical port-to-electric port module, which is hereinafter referred to as an optical-to-electric module, and then communication with the outside through a common network line;
the optical interface is connected with the optical conversion module, when the optical conversion module is communicated with the outside through a common network cable, two conditions exist, wherein one condition is that the optical interface is connected with the optical conversion module before entering a system, network communication is normal after entering the system, but when the optical conversion module is connected after being pulled out, the optical interface indicator lamp is not on, the optical interface is not connected with the network, so that the use is inconvenient, and the user experience degree is influenced.
Disclosure of Invention
The invention mainly aims to overcome the defects of the background technology and provide a communication method of an optical-to-electrical module under a linux system by combining with the reality, and the method is applied to realize network connection and improve the user experience.
In order to achieve the purpose, the invention is realized by the following technical scheme:
in a first aspect, a method for communication of an opto-electric module in a linux system is provided, the method comprising the steps of:
detecting the state of an optical port of a photoelectric conversion module under a linux system;
if the linux system script detects that the electric port state identifier is TP, the linux system script continues to run;
and detecting the link state of the optical port connection under the system by the linux system script, and if the link state of the connection is not, setting and activating the optical port connection network.
Optionally, the setting and activating optical port connection network specifically includes:
the network is connected by automatically acquiring an IP address or setting a fixed IP address.
Optionally, before detecting the optical port status of the optical-to-electrical module in the linux system, the method further includes:
setting two types of state identifiers for all communication ports of a photoelectric conversion module under a linux system, wherein the two types of state identifiers specifically comprise: optical interface state identification and electric interface state identification.
Optionally, the method further includes:
and continuously detecting the state of the optical port communication, and if the state of the optical port communication is not, continuously setting and activating the optical port connection network.
In a second aspect, a communication system for an optical-to-electrical module in a linux system is provided, the system comprising:
the detection unit is used for detecting the state of an optical port of the photoelectric conversion module under the linux system;
the processing unit is used for continuing running the linux system script if the linux system script detects that the electric port state identifier is TP;
the detection unit is also used for detecting the link state of the lower optical port connection of the system;
and the processing unit is also used for setting and activating the optical port connection network if the link state of the connection is negative.
Optionally, the processing unit is specifically configured to connect to a network by automatically acquiring an IP address or setting a fixed IP address.
Optionally, the system further includes:
the setting unit is used for setting two types of state identifiers for all communication ports of the optical-to-electrical module in the linux system, and the two types of state identifiers specifically include: optical interface state identification and electric interface state identification.
Optionally, the detection unit is further configured to continue detecting a state of optical port communication;
and the processing unit is also used for continuously setting and activating the optical interface connection network if the communication state of the optical interface is negative.
In a third aspect, a computer-readable storage medium is provided, storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform the method according to the first aspect.
In a fourth aspect, there is provided a computer program product comprising a non-transitory computer readable storage medium having a computer program stored thereon, the computer program being operable to cause a computer to perform the method of the first aspect.
The beneficial effects of the invention are as follows:
the method is completed through the script under the linux system, the script automatically detects each network card hardware under the linux, under the condition that the network chip is not clear, the script automatically detects which network ports are optical port chips, and then the real-time state of the optical port chips is detected, judged and set, so that the normal network communication function is kept after the optical-to-electrical conversion module is plugged in or unplugged from any situation.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a communication method of a photovoltaic-to-electrical module in a linux system according to the present application.
Fig. 2 is a schematic structural diagram of a communication system of an optoelectronic module under a linux system according to the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 provides a communication method of an opto-electric module in a linux system, where the method is shown in fig. 1 and includes the following steps:
s101, detecting the light port state of a light-to-electricity module under a linux system;
step S102, if the linux system script detects that the electric port state identification is TP, the linux system script continues to run;
and S103, detecting the link state of the optical port connection under the system by the linux system script, and if the link state of the connection is No (No), setting and activating the optical port connection network.
Optionally, the setting and activating the optical port connection network specifically may include:
the network is connected by automatically acquiring an IP address or setting a fixed IP address.
Optionally, before step S101, the method may further include:
setting two types of state identifiers for all communication ports of a photoelectric conversion module under a linux system, wherein the two types of state identifiers specifically comprise: optical interface state identification and electric interface state identification. The method specifically comprises the following steps: the optical port type state mark is FIBRE; the electrical port class state is identified as TP.
Optionally, after step S103, the method may further include:
and continuously detecting the state of the optical port communication, if the state of the optical port communication is no, and continuously setting and activating the optical port connection network.
The optical interface can be used in different Linux systems and optical interfaces of different network chips;
the script is used independently under the system, and when the network is not communicated after the optical-to-electrical module is plugged, the script is executed under the system, so that the problem of optical-to-electrical interface communication can be solved, and normal network communication can be kept;
the script is loaded and detected automatically when the system is started, and the script automatically runs to solve the problem when the network is not connected, so that the normal network communication is kept;
if there are many optical ports, the workload is increased if the optical ports are manually set individually
The script is very large, all optical ports can be monitored at any time, and no matter which optical port goes wrong, the script program can quickly enable the network to automatically recover communication, and the workload is reduced to a great extent.
1. Detecting hardware of the network card:
the network port of the equipment is distinguished by an electric port and an optical port, under a Linux system, the optical port equipment is uniformly listed, and the PCI equipment numbers of the optical ports are recorded, wherein the PCI equipment numbers comprise bus numbers, equipment numbers and function numbers;
and positioning the corresponding specific identifier of each optical port under the system through the PCI equipment number, such as ETH0, ETH1, ETH2 and the like, wherein ETH0 represents a first optical port, ETH1 represents a second optical port, and the like.
2. Detecting the state under the Linux system:
detecting the recognized optical ports, and checking the state identification of the optical ports through an ethnool command if the optical ports are recognized as ETH0, ETH1 and ETH 2;
when the state identifier of the optical interface in the system is the FIBRE, the script abandons execution and continues monitoring, and the FIBRE is represented as the optical interface state identifier;
when the state identifier of the optical port in the system is TP, the script continues to execute, and records the current state of the optical port, wherein the TP is represented as the state identifier of the electrical port.
3. Detecting the connection state of the network card:
under a Linux system, identifying that the state identifier of an optical port is TP, and executing according to the following two states:
1) when the system detects that the connection state of the optical port link is 'yes', the script returns to be not executed, and continues to detect the state again, wherein the 'yes' state indicates that a connection network exists;
2) when the optical switching mode is plugged, the network under the system is disconnected, the network cannot be connected, the script detects that the optical port connection state is 'no', the script continues to execute, and the 'no' state indicates that no network connection exists;
4. network card setting device under system
In the Linux system, after the optical-to-electrical conversion mode is plugged, the network cannot be connected, and at the moment, the script automatically sets the network card state, and at the moment, two setting methods are provided:
the default script is set according to the rate supported by the optical interface, and the network connection is normal after the setting is finished;
such as gigabit optical ports, the script is set to gigabit rate by default; the reason is that the optical port recognizes a TP state and displays that a 10M/100M/1000M rate is supported, and when the optical port is connected to a 10M or 100M network, although the link state of the optical port is yes, the rate that the optical port actually supports and can communicate is giga, and therefore, the rate is set to a giga rate.
5. The communication with the external network is realized by automatically acquiring the IP address or setting the fixed IP address, and the setting can be compiled according to actual requirements.
Referring to fig. 2, fig. 2 provides a communication system of an optical to electrical module in a linux system, the system comprising:
the detection unit 201 is used for detecting the state of an optical port of a photoelectric conversion module in the linux system;
the processing unit 202 is configured to, if the linux system script detects that the port state identifier is TP, continue running the linux system script;
the detection unit 201 is further configured to detect a link state of the connection of the lower optical port of the system;
the processing unit 202 is further configured to set and activate the optical interface connection network if the link status of the connection is negative.
Optionally, the processing unit 202 is specifically configured to connect to a network by automatically acquiring an IP address or setting a fixed IP address.
Optionally, the system further includes:
the setting unit 203 is configured to set two types of status identifiers for all communication ports of the optical-to-electrical module in the linux system, where the two types of status identifiers specifically include: optical interface state identification and electric interface state identification.
Optionally, the detecting unit 201 is further configured to continue to detect a state of optical port communication;
the processing unit 202 is further configured to continue to set and activate the optical interface connection network if the state of the optical interface communication is negative.
It will be appreciated by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The content downloading method, the related device and the system provided by the embodiment of the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the embodiment of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (9)

1. A communication method of an optical-to-electrical module under a linux system is characterized by comprising the following steps:
detecting the state of an optical port of a photoelectric conversion module under a linux system;
if the linux system script detects that the electric port state identifier is TP, the linux system script continues to run;
and detecting the link state of the optical port connection under the system by the linux system script, and if the link state of the connection is not, setting and activating the optical port connection network.
2. The method according to claim 1, wherein the setting and activating the optical interface connection network specifically comprises:
the network is connected by automatically acquiring an IP address or setting a fixed IP address.
3. The method of claim 1, wherein before detecting the optical port status of the photovoltaic module in the linux system, the method further comprises:
setting two types of state identifiers for all communication ports of a photoelectric conversion module under a linux system, wherein the two types of state identifiers specifically comprise: optical interface state identification and electric interface state identification.
4. The method of claim 1, further comprising:
and continuously detecting the state of the optical port communication, and if the state of the optical port communication is not, continuously setting and activating the optical port connection network.
5. A communication system of an opto-electric module in a linux system, the system comprising:
the detection unit is used for detecting the state of an optical port of the photoelectric conversion module under the linux system;
the processing unit is used for continuing running the linux system script if the linux system script detects that the electric port state identifier is TP;
the detection unit is also used for detecting the link state of the lower optical port connection of the system;
and the processing unit is also used for setting and activating the optical port connection network if the link state of the connection is negative.
6. The system of claim 5,
the processing unit is specifically configured to connect to a network by automatically acquiring an IP address or setting a fixed IP address.
7. The system of claim 5, further comprising:
the setting unit is used for setting two types of state identifiers for all communication ports of the optical-to-electrical module in the linux system, and the two types of state identifiers specifically include: optical interface state identification and electric interface state identification.
8. The system of claim 5,
the detection unit is also used for continuously detecting the state of the optical port communication;
and the processing unit is also used for continuously setting and activating the optical interface connection network if the communication state of the optical interface is negative.
9. A computer-readable storage medium, characterized in that it stores a computer program for electronic data exchange, wherein the computer program causes a computer to perform the method according to any one of claims 1-4.
CN201810483414.2A 2018-05-18 2018-05-18 Communication method of photoelectric conversion module under linux system and related product Active CN108809756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810483414.2A CN108809756B (en) 2018-05-18 2018-05-18 Communication method of photoelectric conversion module under linux system and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810483414.2A CN108809756B (en) 2018-05-18 2018-05-18 Communication method of photoelectric conversion module under linux system and related product

Publications (2)

Publication Number Publication Date
CN108809756A CN108809756A (en) 2018-11-13
CN108809756B true CN108809756B (en) 2020-11-27

Family

ID=64092703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810483414.2A Active CN108809756B (en) 2018-05-18 2018-05-18 Communication method of photoelectric conversion module under linux system and related product

Country Status (1)

Country Link
CN (1) CN108809756B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0661848A2 (en) * 1993-12-28 1995-07-05 NEC Corporation Monitor and control system for communication equipment
CN101252448A (en) * 2008-03-31 2008-08-27 杭州华三通信技术有限公司 Method and system for detecting current failure of power receiving equipment as well as power supply equipment
CN102208987A (en) * 2010-03-29 2011-10-05 鸿富锦精密工业(深圳)有限公司 Mainboard management controller network configuration system and method
CN103248420A (en) * 2012-02-14 2013-08-14 华为技术有限公司 Methods, systems and devices for detecting and identifying fiber connection
CN105553544A (en) * 2015-12-08 2016-05-04 中国航空工业集团公司西安航空计算技术研究所 AFDX photoelectric converter testing method
CN106452834A (en) * 2016-08-31 2017-02-22 大连环宇移动科技有限公司 Method for guaranteeing series connection equipment to keep consistency of main/standby network ports in communication process
CN107995068A (en) * 2017-12-20 2018-05-04 北京百度网讯科技有限公司 Network interface test method and equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0661848A2 (en) * 1993-12-28 1995-07-05 NEC Corporation Monitor and control system for communication equipment
CN101252448A (en) * 2008-03-31 2008-08-27 杭州华三通信技术有限公司 Method and system for detecting current failure of power receiving equipment as well as power supply equipment
CN102208987A (en) * 2010-03-29 2011-10-05 鸿富锦精密工业(深圳)有限公司 Mainboard management controller network configuration system and method
CN103248420A (en) * 2012-02-14 2013-08-14 华为技术有限公司 Methods, systems and devices for detecting and identifying fiber connection
CN105553544A (en) * 2015-12-08 2016-05-04 中国航空工业集团公司西安航空计算技术研究所 AFDX photoelectric converter testing method
CN106452834A (en) * 2016-08-31 2017-02-22 大连环宇移动科技有限公司 Method for guaranteeing series connection equipment to keep consistency of main/standby network ports in communication process
CN107995068A (en) * 2017-12-20 2018-05-04 北京百度网讯科技有限公司 Network interface test method and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Shan Chuang,Hou Min-xian.Wireless Landscape Lighting Control System Based on ARM-Linux.《20i0 2nd international Conforence on Education Technology and Computer (ICETC)》.2010,全文. *
魏丰,潘小虎,曾勇,丁洪林.光纤CAN总线集线器及其组网研究.《仪器仪表学报》.2011,全文. *

Also Published As

Publication number Publication date
CN108809756A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
JP6244042B2 (en) Method, apparatus, and computer program product for transitioning to USB Type-C accessory device docking mode
US9817468B2 (en) System and method for automatic detection and switching between USB host and device rolls on a type-A connector
CN104639468A (en) Optical port adaptive Ethernet switch and adaptive method thereof
CN110677292A (en) Optical interface rate configuration method and device
CN102983989B (en) Removing method, device and equipment of server virtual address
US20240045751A1 (en) Lighting Method and Apparatus Based on AMD Platform, Device and Readable Medium
CN102801467A (en) Device and method for implementing dual optical fiber protection switching based on ONU
CN102724093A (en) Advanced telecommunications computing architecture (ATCA) machine frame and intelligent platform management bus (IPMB) connection method thereof
CN104794870B (en) Electric power optical cable maintenance pre-warning system and method
RU2015109465A (en) STAND WITH AUTO RECOVERY FUNCTION AND METHOD FOR AUTOMATIC RECOVERY FOR THIS STAND
CN111736867A (en) FPGA updating device, method and storage medium
CN102073602A (en) Computer system, connection control device as well as connecting and disconnecting method
CN102768561B (en) Design method for twinbridge piece mainboard redundancy
CN104104519B (en) A kind of power-off restarting method, apparatus and system
CN108809756B (en) Communication method of photoelectric conversion module under linux system and related product
CN104898070B (en) Power supply test method and device
CN109557453B (en) Multi-master-control-chip identification processing method and system
CN110545494A (en) method and device for rapidly switching passive optical network types and related equipment thereof
CN112866061A (en) NCSI (network control information system) testing method, device, equipment and medium of onboard network port
CN107357698A (en) A kind of method and device of acquisition BMC Serial Port Informations
CN111541958A (en) Optical interface rate self-adaption method, equipment, device and readable storage medium
US8996737B1 (en) Method for emulating communication standards of transceiver modules for native host devices
CN115129378A (en) Intelligent network card starting method and device capable of being actively adjusted, storage medium and equipment
CN103825650A (en) System and method for monitoring optical fibers
CN108540217B (en) Test method for improving OLT test ONT or ONU efficiency

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Futian District Che Kung Temple Tairan nine road Haisong building B-1303

Applicant after: Shenzhen smart Micro Intelligent Technology Co., Ltd

Address before: 518000 Guangdong city of Shenzhen province Futian District Che Kung Temple Tairan nine road Haisong building B-1303

Applicant before: JWIPC TECHNOLOGY DEVELOPMENT Ltd.

GR01 Patent grant
GR01 Patent grant