Ethernet port configuration method, Ethernet equipment and storage medium

By using a combination of control modules and indicator modules in Ethernet devices to dynamically configure Ethernet ports, the problem of restricting flexibility in fixed port configuration methods is solved, and higher port configuration flexibility and communication adaptability are achieved.

CN119071147APending Publication Date: 2024-12-03深圳市三旺通信股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411196285.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The fixed port configuration method of existing Ethernet slave devices limits functional flexibility, making it difficult to adjust the direction of data flow or change the communication mode according to actual application scenarios, and cannot adapt to the changing industrial environment and user needs.

Method used

Provides an Ethernet port configuration method, which sends configuration commands to the communication port through the control module, flexibly configures the input port and output port according to the interface protocol and operating status, and uses port configuration policy and level signal control of the indicating module to realize port dynamics. Configuration.

Benefits of technology

It improves the port configuration flexibility and communication flexibility of Ethernet devices, can adjust the data flow direction and communication mode according to user needs, reduces maintenance costs, and expands the scope of use scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071147A_ABST
    Figure CN119071147A_ABST
Patent Text Reader

Abstract

The invention relates to the field of communication, and discloses an Ethernet port configuration method, Ethernet equipment and a storage medium, the method is applied to a control module of the Ethernet equipment, and the method comprises the following steps: sending a configuration command to a corresponding communication port to configure an interface protocol supported by the corresponding communication port, and if the interface protocol is a target protocol, sending a configuration command to the control module of the Ethernet equipment; and if yes, selecting a first target port from the corresponding communication ports through a port configuration strategy, and configuring the first target port as an input port and / or an output port. According to the method and the device, the corresponding communication port can be flexibly selected to configure the input port or the output port based on the requirement of a user, so that the flexibility of communication between the Ethernet equipment and the external equipment is improved while the flexibility of port configuration is improved; according to the invention, the port can be flexibly configured according to the change of actual requirements, so that the method can adapt to various complex and changeable network architectures, the maintenance cost is reduced, and the application scene is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to an Ethernet port configuration method, an Ethernet device, and a storage medium. Background Art

[0002] Currently, most Ethernet slave devices use a fixed port configuration; these devices usually preset an input port (IN port) for receiving data packets from the master station, and an output port (OUT port) for sending data to the master station. This design enables the slave device to exchange data stably, but it also brings a certain degree of functional flexibility limitation.

[0003] Based on this fixed port configuration method, the port configuration is fixed when the device leaves the factory, and users cannot customize the port configuration according to the needs of actual application scenarios; this means that once the device is deployed, any operation that wants to adjust the data flow direction or change the communication mode will become very difficult.

[0004] Furthermore, although the existing Ethernet slave devices meet the current application requirements to a certain extent, their fixed port configuration methods still have obvious limitations. In order to better adapt to the ever-changing industrial environment and user needs, exploring more flexible port configuration solutions has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In a first aspect, the present application provides an Ethernet port configuration method, wherein the Ethernet device includes a plurality of communication ports and a control module; the method is applied to the control module, comprising:

[0006] Sending a configuration command to a corresponding communication port to configure an interface protocol supported by the corresponding communication port;

[0007] If the interface protocol is a target protocol, a first target port is selected from the corresponding communication ports through a port configuration strategy, and the first target port is configured as an input port and / or an output port.

[0008] In an optional implementation, the Ethernet device further includes an indication module, each indication unit in the indication module is connected to the control module, and each indication unit is used to indicate the operating status of a corresponding communication port; after configuring the interface protocol supported by the corresponding communication port, it further includes:

[0009] After the interface protocol is configured successfully, sending a level signal to the indication unit corresponding to the corresponding communication port, so that the indication unit presents a first indication state;

[0010] If the interface protocol is a target protocol, selecting a first target port from the corresponding communication port through a port configuration strategy includes:

[0011] If the first indication state is a target state, a first target port is selected from the communication ports corresponding to the corresponding indication unit through a port configuration strategy.

[0012] In an optional implementation manner, selecting a first target port from the corresponding communication port through a port configuration strategy and configuring the first target port as an input port and / or an output port includes:

[0013] Select any one of the corresponding communication ports as the second target port, and perform quotient and integer operation on the port number of the second target port and the port number of the adjacent port of the second target port to obtain respective corresponding operation values;

[0014] If the calculated values ​​of the second target port and the adjacent port are consistent, the second target port is used as an input port and the adjacent port is used as an output port.

[0015] In an optional implementation manner, performing quotient and integer operation on the port number of the second target port and the port number of the adjacent port of the second target port respectively to obtain respective corresponding operation values ​​includes:

[0016] After adding one to the first port number of the second target port and the second port number of the adjacent port, the first port number and the second port number are halved and rounded to obtain respective calculated values.

[0017] In an optional implementation, after the interface protocol is configured successfully, sending a level signal to the indication unit corresponding to the corresponding communication port so that the indication unit presents a first indication state includes:

[0018] If the interface protocol is an Ethernet protocol, a first level signal is sent to the indication unit corresponding to the corresponding communication port, wherein the first level signal is used to control a first indicator light in the indication unit to present a first indication state;

[0019] If the interface protocol is a non-Ethernet protocol or the corresponding communication port is not configured with a supported interface protocol, a second type of level signal is sent to the indication unit corresponding to the corresponding communication port, and the second type of level signal is used to control the second indicator light in the indication unit to present a first indication state or to control the first indicator light to present a second indication state.

[0020] In an optional implementation, the method further includes: according to the operating status of each of the communication ports, controlling the corresponding indicating unit to present a corresponding indicating status.

[0021] In an optional embodiment, it also includes:

[0022] Determining an operating state of the input port or the output port;

[0023] If the input port or the output port is currently in a connected state, a third level signal is sent to the corresponding indication unit, and the third level signal is used to control the first indicator light in the indication unit to present a third indication state;

[0024] If the input port or the output port is currently in a disconnected state, a fourth level signal is sent to the corresponding indication unit, and the fourth level signal is used to control the first indicator light in the indication unit to present a fourth indication state.

[0025] In an optional embodiment, it also includes:

[0026] Determining the operating status of the remaining ports in the Ethernet device except the input port and the output port;

[0027] If the remaining ports are currently in a connected state, a third level signal is sent to the indicating unit corresponding to the remaining ports, wherein the third level signal is used to control the second indicator light in the indicating unit to present a third indicating state;

[0028] If the remaining ports are currently in a disconnected state, a fourth level signal is sent to the indicating unit corresponding to the remaining ports, and the fourth level signal is used to control the second indicator light in the indicating unit to present a fourth indicating state.

[0029] In a second aspect, the present application provides an Ethernet device, comprising a plurality of communication ports and a control module; the control module is used to execute the Ethernet port configuration method as described above.

[0030] In a third aspect, the present application provides a computer storage medium storing a computer program, which, when executed, implements the aforementioned Ethernet port configuration method.

[0031] The embodiments of the present application have the following beneficial effects:

[0032] The embodiment of the present application provides an Ethernet port configuration method, which, when applied to a control module of an Ethernet device, includes: sending a configuration command to a corresponding communication port to configure an interface protocol supported by the corresponding communication port, and if the interface protocol is a target protocol, selecting a first target port from the corresponding communication port through a port configuration strategy, and configuring the first target port as an input port and / or an output port. The embodiment of the present application can flexibly select a corresponding communication port based on user needs to configure an input port or an output port, thereby improving the flexibility of port configuration while also improving the flexibility of communication between the Ethernet device and the external device; and, based on the flexibility of port configuration, the data flow direction can be flexibly adjusted or the communication mode can be changed during actual use; in addition, when additional input / output ports are needed or new demand functions need to be adapted, there is no need to replace the device, but the input / output ports can be flexibly added and set according to the change in demand, so that the device can adapt to new functional requirements that may be added in the future or a more complex network architecture, thereby reducing maintenance costs, improving the market competitiveness of the device, and expanding the scope of use scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0034] Figure 1 A communication architecture diagram of a networking system in an embodiment of the present application is shown;

[0035] Figure 2 A first structural diagram of an Ethernet device in an embodiment of the present application is shown;

[0036] Figure 3 A first flow chart of the Ethernet port configuration method in an embodiment of the present application is shown;

[0037] Figure 4 A second structural schematic diagram of an Ethernet device in an embodiment of the present application is shown;

[0038] Figure 5 A schematic diagram of the structure of a communication port in an Ethernet device in an embodiment of the present application is shown;

[0039] Figure 6 A circuit diagram of an indication unit in an Ethernet device in an embodiment of the present application is shown;

[0040] Figure 7 A second flow chart of the Ethernet port configuration method in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0042] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0043] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0044] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0045] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0046] Interface protocol refers to the communication method and requirements that need to be followed between interfaces for information exchange.

[0047] The present application embodiment provides an Ethernet device, which can be used as a slave device in a networking system. Figure 1As shown, a continuous slave number (such as slave 1, slave 2, slave 3, etc.) is set for each slave device in the networking system according to the distance from the Ethernet master station device (master station); if the Ethernet device belongs to the first slave station device (slave station 1) or the intermediate slave station device (slave station 3, slave station x-1, etc.) in the networking system, the Ethernet device can be configured with two communication ports as an input port (Port 1) and an output port (Port 2); if the Ethernet device belongs to the last slave station device (slave station x), the Ethernet device can be configured with one communication port as an input port; further, when the master station device in the networking system communicates with each slave station device by broadcasting a message, each Ethernet device can communicate with the master station device or the previous slave station device through the configured input port, and communicate with the next slave station device through the configured output port.

[0048] Optionally, the Ethernet device includes but is not limited to Ethernet slave devices such as switches, routers, and hubs.

[0049] Furthermore, the Ethernet device will configure input ports and / or output ports accordingly during use, such as Figure 2 As shown, the Ethernet device includes multiple communication ports 100 (communication port 1, communication port 2, ..., communication port x) and a control module 200; wherein each Ethernet device can select a corresponding port from the multiple communication ports 100 according to actual needs to set an input port and an output port for communicating with a master station device or other slave station devices.

[0050] For example, Figure 3 As shown, the control module 200 may perform the Ethernet port configuration process including the following steps:

[0051] S210 , sending a configuration command to the corresponding communication port 100 to configure the interface protocol supported by the corresponding communication port 100 .

[0052] S220: If the interface protocol is a target protocol, a first target port is selected from the corresponding communication port 100 according to a port configuration strategy, and the first target port is configured as an input port and / or an output port.

[0053] It can be understood that when the Ethernet device configures the input port and the output port, the control module 200 sends a configuration command to the multiple communication ports 100 according to the device type (such as router, switch, server, etc.), port function requirements (such as Ethernet, serial communication, IP, TCP, UDP, etc.) or specific business requirements (such as supporting IPv4, IPv6, SSL / TLS encrypted communication, etc.), and the configuration command is used to indicate the interface protocol required to be configured for the communication port 100, and then the control module 200 configures the interface protocol of each communication port 100 based on the configuration command. Among them, the number of communication ports 100 required to be configured is not limited here, and can be 2, 4, 6 or all the ports; and each communication port 100 can be configured with the same or different interface protocols according to actual needs, and this embodiment is not limited to this.

[0054] For example, the user uses a command line interface (CLI) or a network management tool (such as Telnet, SSH, Netconf, etc.) to enable the control module 200 to first write a specific configuration command according to the selected port protocol and the command language of the device, and execute the configuration command. The configuration command is used to activate the communication port 100, configure the working mode and working speed of the communication port 100, and enable the corresponding interface protocol for communication, etc. The specific generation rules, configuration process and functional application of the configuration command can be adjusted accordingly according to actual needs and are not limited here.

[0055] In some examples, after executing the configuration command, the control module 200 may further need to verify whether the configuration is successfully applied. For example, the running configuration of the device or the status and configuration information of the corresponding communication port 100 may be checked to determine whether the configuration is successfully applied.

[0056] Furthermore, after the interface protocol configuration is completed, a port configuration strategy can be used to select at least one first target port from multiple communication ports 100 whose interface protocol is the target protocol, and configure the first target port as an input port or an output port; wherein, during the configuration process, corresponding receiving parameters can also be configured for the input port, and corresponding sending parameters can be configured for the output port. The receiving parameters and sending parameters can be set specifically according to actual needs, and this embodiment does not limit this.

[0057] It can be understood that the present application only selects the target port from the communication ports whose interface protocol is the target protocol to be configured as an input port or an output port, and does not process the communication ports whose interface protocol is a non-target protocol; the target protocol is the Ethernet protocol. It should be noted that the present application embodiment only uses Ethernet devices as an example, and the port configuration method of the present application embodiment can also be applied to other types of devices, such as serial port devices, etc., and the target protocol for the serial port device corresponds to the serial port protocol.

[0058] The port configuration strategy may adopt any one or more strategies such as a static configuration strategy or an adjacent port configuration strategy. The setting of the strategy may be set accordingly according to actual needs, and this embodiment does not limit this.

[0059] Exemplarily, when the static configuration strategy is used to configure the ports, any two ports are selected from the plurality of communication ports 100 whose interface protocol is the Ethernet protocol to correspond to an input port and an output port.

[0060] If the adjacent port configuration strategy is adopted, any one of the communication ports 100 whose interface protocol is the Ethernet protocol is selected as the second target port, and the port number of the second target port and the port number of the adjacent port of the second target port are respectively calculated and rounded to obtain the corresponding operation values. Among them, after adding one to the first port number of the second target port and the second port number of the adjacent port, the first port number and the second port number are halved and rounded to obtain the respective operation values. Furthermore, if the operation values ​​of the second target port and the adjacent port are consistent, the second target port is used as the input port and the adjacent port is used as the output port.

[0061] It should be noted that, in this embodiment, a port is first selected from the corresponding communication ports 100 as an input port, and then the port number of the input port is added by one and then rounded to the nearest integer, and another adjacent port in the corresponding communication port 100 is determined as an output port according to the obtained calculation value. The specific input port and output port determination process and determination order can be set according to actual needs, and this embodiment does not limit this.

[0062] It can be understood that any one port is configured as an input port from multiple communication ports 100 whose interface protocol is the Ethernet protocol, the port number (ID number) of the input port is increased by 1, then divided by 2 and rounded to the integer to obtain an operation value, and based on the operation value, adjacent ports with the same operation value obtained through the same operation process are selected from the corresponding multiple communication ports 100 as output ports.

[0063] For example, from the corresponding multiple communication ports 100, the port with port number 3 (3 plus 1 is 4, and then 4 divided by 2 is rounded to 2) is configured as an input port, and the adjacent port with port number 4 (4 plus 1 is 5, and then 5 divided by 2 is rounded to 2) is configured as an output port.

[0064] Based on this, the present embodiment can effectively configure the communication port 100 to support a specific interface protocol, and flexibly adjust the port role and configuration parameters according to business requirements, ensure that the role of the port (input or output) meets the network operation requirements, and ensure that the communication process runs stably and efficiently. In addition, during the port configuration process, the present embodiment can flexibly select the corresponding communication port 100 to configure the input port or output port based on the user's needs, thereby improving the flexibility of port configuration while also improving the flexibility of the Ethernet device communicating with the external device.

[0065] For reference, Figure 4 As shown, the Ethernet device also includes an indication module 300; wherein each indication unit (indication unit 1, indication unit 2, ..., indication unit n) in the indication module 300 is connected to the control module 200, and each indication unit is used to indicate the operating status of a communication port 100 and the interface protocol configuration.

[0066] It can be understood that the indication state of the corresponding indication unit in the indication module 300 can represent the operation state of the corresponding communication port 100. In addition, the control module 200 can also dynamically control the performance configuration of each communication port 100, thereby correspondingly adjusting the indication state of the indication unit.

[0067] In one possible approach, Figure 5 As shown, each indicating unit includes a plurality of LED lamps, a plurality of resistors and a switch tube; wherein one end of each LED lamp is connected in series with a resistor and then connected to the power supply end (i.e., the VCC end), and the other end of each LED lamp is connected to one end of the switch tube. Furthermore, the control module 200 can input a level signal to the GIPO pin of the corresponding indicating unit according to the state of each communication port 100, so that the indicating unit controls the corresponding LED lamp to be in a light-on or light-off state based on the level state of the level signal.

[0068] Based on this, in one embodiment, if Figure 6As shown, each communication port 100 (Port1, Port2, Port3, Port4) can represent the current working state or working mode of the communication port 100 based on the display state of at least two LED lights in the corresponding indication unit. Among them, the at least two LED lights in the same indication unit can be LED lights of different colors respectively; furthermore, the current working state of the communication port 100 and the configuration of the interface protocol can be intuitively determined based on the color displayed by the LED light when it is on.

[0069] For example, Figure 7 As shown, the process of performing Ethernet port configuration by the Ethernet device including the indication module 300 may include the following steps:

[0070] S710, the control module 200 sends a configuration command to the corresponding communication port 100 to configure the interface protocol supported by the corresponding communication port 100, and after the interface protocol is configured successfully, sends a level signal to the indication unit corresponding to the corresponding communication port 100 to make the indication unit present a first indication state.

[0071] S720: If the first indication state is a target state, a first target port is selected from the communication port 100 corresponding to the corresponding indication unit according to a port configuration strategy, and the first target port is configured as an input port and / or an output port.

[0072] It can be understood that the control module 200 sends a configuration command to any one or more communication ports 100, and the configuration command is used to control the corresponding communication port 100 to configure the interface protocol. Since the device is an Ethernet device, the interface protocol can be set to the Ethernet protocol (i.e., Ethercat protocol); the number of communication ports 100 that need to configure the interface protocol can be set accordingly according to actual needs and is not limited here.

[0073] After the interface protocol is successfully configured, the control module 200 also sends a level signal to the indicating unit corresponding to the corresponding communication port 100, so that the indicating unit presents a first indicating state. The first indicating state can be a light-on state or other states, which can be set according to actual needs, and this embodiment does not limit this. Furthermore, this embodiment can intuitively reflect the interface protocol configuration of the current communication port 100 through the indicating state presented by the indicating unit.

[0074] Further, if the interface protocol of the communication port 100 is configured as the Ethernet protocol, the control module 200 sends a first level signal to the indication unit corresponding to the corresponding communication port 100, and the first level signal is used to control the first indicator light in the indication unit to present a first indication state.

[0075] If the interface protocol of the communication port 100 is not an Ethernet protocol or the communication port 100 is not configured with a supported interface protocol, the control module 200 sends a second type of level signal to the indication unit corresponding to the corresponding communication port 100. The second type of level signal is used to control the second indicator light in the indication unit to present a first indication state or to control the first indicator light to present a second indication state.

[0076] Optionally, the first indication state may be on, the second indication state may be off, and the first indicator light and the second indicator light may be indicators of different colors, such as orange when the first indicator light is on, and green when the second indicator light is on. This embodiment does not limit the indicator light or indication state or display color of the indicator light required to be configured in the above process, and can be set accordingly according to actual needs.

[0077] Furthermore, this embodiment uses the indication status of the indication module 300 to intuitively view the interface protocol configuration status of each communication port 100, and can select a suitable target port for port configuration based on the indication status of each indication module 300, thereby improving the efficiency of port configuration and enabling Ethernet devices to use port resources more flexibly, thereby improving the adaptability and scalability of the device.

[0078] Furthermore, when the Ethernet device is communicating with the master station device or other slave station devices, the control module 200 can also control the corresponding indication unit to present a corresponding indication state according to the operating state of each communication port 100 in the Ethernet device.

[0079] For example, the control module 200 determines the operating status of the input port and / or the output port during the communication process of the Ethernet device; if the input port and / or the output port is currently in a connected state, a third-type level signal is sent to the corresponding indication unit, and the third-type level signal is used to control the first indicator light or the third indicator light in the indication unit to present a third indication state.

[0080] If the input port or the output port is currently in a disconnected state, a fourth level signal is sent to the corresponding indication unit, and the fourth level signal is used to control the first indicator light or the third indicator light in the indication unit to present a fourth indication state. The third indication state may be a light-on state, and the fourth indication state may be an off state; and the indicator light used to display the current connection state may be any one of the first indicator light, the second indicator light, or other indicator lights in the indication unit. This embodiment does not limit the settings of the third indication state, the fourth indication state, and the indicator light.

[0081] Furthermore, the control module 200 may also determine the operating status of the remaining ports in the Ethernet device except the input port and the output port during the Ethernet device communication process.

[0082] If the remaining ports are currently in a connected state, a third level signal is sent to the indicating unit corresponding to the remaining ports, and the third level signal is used to control the second indicator light or the fourth indicator light in the indicating unit to present a third indication state. If the remaining ports are currently in a disconnected state, a fourth level signal is sent to the indicating unit corresponding to the remaining ports, and the fourth level signal is used to control the second indicator light or the fourth indicator light in the indicating unit to present a fourth indication state.

[0083] Among them, the indicator light used to display the current connection status of the non-input port and the non-output port can be the first indicator light, the second indicator light or any one of the other indicator lights in the indication unit. This embodiment does not limit the third indication state, the fourth indication state and the setting of the indicator light.

[0084] Example, combined Figure 5 If the communication port 100 is configured as an Ethernet protocol and the port is currently in a connected state (i.e., an external device is connected), the control module 200 sends a high-level signal to the corresponding indication unit, and the high-level signal causes Figure 5 The switch tube Q1 shown in the figure is turned on, then LED2 lights up (displays orange), and there is no voltage difference between the two ends of LED1, and then LED1 turns off. If the communication port 100 is not configured with the Ethernet protocol and the port is currently in a connected state, the control module 200 sends a low-level signal to the corresponding indication unit, at which time the switch tube Q1 is turned off, then LED2 turns off, LED1 forms a loop with the ground terminal, and LED1 lights up (displays green); and if the communication port 100 is not configured with the Ethernet protocol and the port is currently not in a connected state, the control module 200 sends a high-impedance signal to the corresponding indication unit, at which time the LED1 does not form a loop with the ground terminal, and the switch tube Q1 is turned off, then both LED1 and LED2 turn off.

[0085] Furthermore, through the indication status of the indicator light, the current status of each communication port 100 can be intuitively determined, which is convenient for troubleshooting and daily management, thereby solving the problem of rigid port configuration process and unclear display of port working status of existing Ethernet slave station equipment, and improving the communication flexibility and management efficiency of the equipment.

[0086] This embodiment can flexibly select a target port from the communication ports 100 configured with the target protocol according to user needs, and configure it as an input port or an output port, thereby improving the flexibility of communication between the Ethernet device and the external device; and the indication status of the indication module 300 and the indicator light intuitively displays the working status of each communication port 100 and the interface protocol configuration, which is convenient for port configuration, maintenance and troubleshooting of each communication port 100 in combination with the lighting status of each indicator light, and also improves the flexibility of port configuration.

[0087] The embodiment of the present application also provides an Ethernet device, which may be, but is not limited to, a switch, a router, a hub, etc. Exemplarily, the Ethernet device includes a plurality of communication ports, a control module (i.e., a processor), and a storage module (i.e., a memory), wherein the storage module stores a computer program, and the control module runs the computer program to enable the Ethernet device to execute the Ethernet port configuration method of the present application.

[0088] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0089] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0090] In addition, the present application also provides a computer storage medium for storing a computer program used in the above-mentioned Ethernet device, wherein when the computer program is executed on a processor, the Ethernet port configuration method of the above-mentioned embodiment is implemented.

[0091] It can be understood that the options in the Ethernet port configuration method of the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.

[0092] The computer storage medium may be a non-volatile storage medium or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0093] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0095] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.

[0096] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for configuring an Ethernet port, characterized in that: The Ethernet device includes a plurality of communication ports and a control module; The method is applied to the control module and includes: Sending a configuration command to a corresponding communication port to configure an interface protocol supported by the corresponding communication port; If the interface protocol is a target protocol, a first target port is selected from the corresponding communication ports through a port configuration strategy, and the first target port is configured as an input port and / or an output port.

2. The Ethernet port configuration method according to claim 1, characterized in that: The Ethernet device further includes an indication module, each indication unit in the indication module is connected to the control module, and each indication unit is used to indicate the operation status of a corresponding communication port; after configuring the interface protocol supported by the corresponding communication port, it further includes: After the interface protocol is configured successfully, sending a level signal to the indication unit corresponding to the corresponding communication port, so that the indication unit presents a first indication state; If the interface protocol is a target protocol, selecting a first target port from the corresponding communication port through a port configuration strategy includes: If the first indication state is a target state, a first target port is selected from the communication ports corresponding to the corresponding indication unit through a port configuration strategy.

3. The Ethernet port configuration method according to claim 1 or 2, characterized in that: The selecting a first target port from the corresponding communication port by using a port configuration strategy and configuring the first target port as an input port and / or an output port comprises: Select any one of the corresponding communication ports as the second target port, and perform quotient and integer operation on the port number of the second target port and the port number of the adjacent port of the second target port to obtain respective corresponding operation values; If the calculated values ​​of the second target port and the adjacent port are consistent, the second target port is used as an input port and the adjacent port is used as an output port.

4. The Ethernet port configuration method according to claim 3, characterized in that: The performing quotient and integer operation on the port number of the second target port and the port number of the adjacent port of the second target port to obtain respective corresponding operation values ​​includes: After adding one to the first port number of the second target port and the second port number of the adjacent port, the first port number and the second port number are halved and rounded to obtain respective calculated values.

5. The Ethernet port configuration method according to claim 2, characterized in that: After the interface protocol is configured successfully, sending a level signal to the indication unit corresponding to the corresponding communication port so that the indication unit presents a first indication state includes: If the interface protocol is an Ethernet protocol, a first level signal is sent to the indication unit corresponding to the corresponding communication port, wherein the first level signal is used to control a first indicator light in the indication unit to present a first indication state; If the interface protocol is a non-Ethernet protocol or the corresponding communication port is not configured with a supported interface protocol, a second type of level signal is sent to the indication unit corresponding to the corresponding communication port, and the second type of level signal is used to control the second indicator light in the indication unit to present a first indication state or to control the first indicator light to present a second indication state.

6. The Ethernet port configuration method according to claim 2, characterized in that: Also includes: According to the operation status of each of the communication ports, the corresponding indication unit is controlled to present a corresponding indication status.

7. The Ethernet port configuration method according to claim 2 or 6, characterized in that: Also includes: Determining an operating state of the input port or the output port; If the input port or the output port is currently in a connected state, a third level signal is sent to the corresponding indication unit, and the third level signal is used to control the first indicator light in the indication unit to present a third indication state; If the input port or the output port is currently in a disconnected state, a fourth level signal is sent to the corresponding indication unit, and the fourth level signal is used to control the first indicator light in the indication unit to present a fourth indication state.

8. The Ethernet port configuration method according to claim 2 or 6, characterized in that: Also includes: Determining the operating status of the remaining ports in the Ethernet device except the input port and the output port; If the remaining ports are currently in a connected state, a third level signal is sent to the indicating unit corresponding to the remaining ports, wherein the third level signal is used to control the second indicator light in the indicating unit to present a third indicating state; If the remaining ports are currently in a disconnected state, a fourth level signal is sent to the indicating unit corresponding to the remaining ports, and the fourth level signal is used to control the second indicator light in the indicating unit to present a fourth indicating state.

9. An Ethernet device, characterized in that: It comprises a plurality of communication ports and a control module; the control module is used to execute the Ethernet port configuration method as claimed in any one of claims 1 to 8.

10. A computer storage medium, characterized in that: A computer program is stored therein, and when the computer program is executed, the Ethernet port configuration method according to any one of claims 1 to 8 is implemented.