CN114157582A - Switch port state monitoring method and device and network communication system - Google Patents

Switch port state monitoring method and device and network communication system Download PDF

Info

Publication number
CN114157582A
CN114157582A CN202111369307.5A CN202111369307A CN114157582A CN 114157582 A CN114157582 A CN 114157582A CN 202111369307 A CN202111369307 A CN 202111369307A CN 114157582 A CN114157582 A CN 114157582A
Authority
CN
China
Prior art keywords
port
state
switch
state change
processing mode
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.)
Withdrawn
Application number
CN202111369307.5A
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111369307.5A priority Critical patent/CN114157582A/en
Publication of CN114157582A publication Critical patent/CN114157582A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a method and a device for monitoring the state of a switch port, a network communication system, a switch and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining configuration information, subscribing a port information table of a switch system database, determining the current state change times of a target port when the state information of any port in the port information table is changed, and determining and executing a preset processing mode corresponding to the target port according to the current state change times. By adopting the method, the corresponding preset processing mode can be automatically executed according to the state change condition of the target port, so that the monitoring of the port state and the processing of the corresponding event have automation and timeliness, the manual processing time is saved, and the smoothness of the network is favorably ensured.

Description

Switch port state monitoring method and device and network communication system
Technical Field
The present application relates to the field of switch communication technologies, and in particular, to a method and an apparatus for monitoring a switch port state, a network communication system, a switch, and a storage medium.
Background
As the application of the white box switch in a large data center becomes more extensive, the cable problem, software logic error, misoperation and the like of the switch can cause the state of the port to change frequently, and at this time, in the conventional technology, the state of the port of the switch generally needs to be confirmed manually, and then corresponding processing is performed according to the state of the port, which needs to spend a lot of manual processing time.
Disclosure of Invention
In view of the above, it is necessary to provide a switch port status monitoring method, device, network communication system, switch and storage medium capable of saving manual processing time.
A method for monitoring the state of a switch port comprises the following steps:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
in the port information table, when the state information of any port changes, determining the current state change times of a target port;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
In one embodiment, when the state information of any port in the port information table changes, determining the current state change times of the target port includes:
when the state information of any port changes in the port information table, generating or updating an oscillation state recording table, wherein the oscillation state recording table is used for recording the state change information of a target port;
and determining the current state change times of the target port according to the oscillation state recording table.
In one embodiment, the switch port status monitoring method further includes:
receiving inquiry information of a control device;
and transmitting the oscillation state record table to the control equipment according to the inquiry information.
In one embodiment, determining and executing a preset processing mode corresponding to the target port according to the current state change times includes:
when the current state change times are first preset times, determining that a preset processing mode corresponding to the target port is to set the state of the target port to be a non-working state;
and setting the state of the target port to be in a non-working state.
In one embodiment, determining and executing a preset processing mode corresponding to the target port according to the current state change times includes:
and when the current state change times are second preset times, determining that the preset processing mode corresponding to the target port is the state of the target port.
In one embodiment, the configuration information records the relationship between the effective time interval and the state change times corresponding to each port of the switch and the preset processing mode;
determining a preset processing mode corresponding to the target port according to the current state change times and executing, wherein the preset processing mode comprises the following steps:
determining the state change times of the target port in an effective time interval according to the current state change times;
and determining and executing a corresponding preset processing mode according to the state change times of the target port in the effective time interval.
A switch port status monitoring apparatus comprising:
the configuration information acquisition module is used for acquiring configuration information, and the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
the subscription module is used for subscribing a port information table of a switch system database;
the current time determining module is used for determining the current state change times of the target port when the state information of any port in the port information table changes;
and the processing module is used for determining a preset processing mode corresponding to the target port according to the current state change times and executing the preset processing mode.
A network communication system comprises a plurality of switches and control equipment respectively connected with the switches;
the control equipment is used for sending configuration information to each switch, sending polling requests to each switch, receiving and storing an oscillation state recording table returned by each switch, wherein the configuration information records the relationship between the state change times of each port of each switch and a preset processing mode;
each switch is used for acquiring configuration information and subscribing a port information table of a switch system database, when the state information of any port in the port information table changes, an oscillation state recording table is generated or updated, the current state change times of a target port are determined according to the oscillation state recording table, and a preset processing mode corresponding to the target port is determined and executed according to the current state change times, wherein the oscillation state recording table is used for recording the state change information of the target port;
each switch is also used for receiving the polling request sent by the control equipment and returning the oscillation state record table to the control equipment after the oscillation state record table is generated.
A switch comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
in the port information table, when the state information of any port changes, determining the current state change times of a target port;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
in the port information table, when the state information of any port changes, determining the current state change times of a target port;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
According to the switch port state monitoring method, the switch port state monitoring device, the network communication system, the switch and the storage medium, the preset processing modes corresponding to different port state change conditions can be determined by acquiring the configuration information, the port information table of the switch system database is subscribed, and the state change condition of the target port can be determined in time. Therefore, the corresponding preset processing mode can be automatically executed according to the state change condition of the target port, so that the monitoring of the port state and the processing of the corresponding event have automation and timeliness, the manual processing time is saved, and the smoothness of the network is favorably ensured.
Drawings
FIG. 1 is a diagram of an application environment of a switch port state monitoring method in some embodiments;
FIG. 2 is a flow diagram illustrating a method for monitoring switch port status in some embodiments;
FIG. 3 is a schematic flow chart of steps involved in generating or updating an oscillation state record table in some embodiments;
FIG. 4 is a flow chart illustrating steps involved in returning an oscillation state record table to a control device in some embodiments;
FIG. 5 is a block diagram of a switch port status monitor in some embodiments;
FIG. 6 is an internal block diagram of some embodiments in which the control device is a server;
fig. 7 is an internal structure diagram of the control device in some embodiments when the control device is a terminal.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The switch port state monitoring method provided by the application can be applied to the application environment shown in fig. 1. The plurality of switches 110 include white box switches such as a switch 111, a switch 112, and a switch 113, each switch communicates with the control device 120 through a network, and the control device 120 can send the configuration information to each switch. The control device 120 may be a server implemented by a stand-alone server or a server cluster composed of a plurality of servers, or a terminal implemented by, but not limited to, various personal computers, notebook computers, smart phones, and tablet computers. It should be noted that fig. 1 is only one of typical application environments of the switch port status monitoring method, and the application of the switch port status monitoring method may not be limited by the number of switches and the type of the switch.
In some embodiments, as shown in fig. 2, the present application provides a switch port status monitoring method, which is described by taking the method as an example applied to the switch 111 in fig. 1, and the method includes steps S201, S202, S203, and S204 that can be performed by the switch 111. The foregoing steps are explained in turn below.
Step S201, obtaining configuration information, where the configuration information records a relationship between the number of state changes of each port of the switch 111 and a preset processing mode.
The configuration information is used for configuring data items to be acquired when the switch 111 performs port state monitoring, and the configuration information is also used for configuring a preset processing mode adopted by the switch 111 for different state change times. The data items to be collected include state information of each port of the switch 111, where the state information is used to indicate a state of a corresponding port, and generally includes a working state and a non-working state. When the state of a PORT is working, the corresponding state information is usually recorded as up, and when the state of a PORT is non-working, the corresponding state information is usually recorded as down, and these state information can be obtained from a PORT information TABLE, also called PORT _ TABLE, of the system database of the switch 111. The switch 111 system database is used to store the operation log of the switch 111 or the system information of the switch 111, and may be implemented by a redis database (an open-source key-value pair storage database that is written by using ANSI C standard, contains various data structures, supports a network, and is based on a memory and has optional persistence).
Usually, the configuration information is sent to the switch 111 by the control device 120, and after the switch 111 analyzes the configuration information, the relationship between the number of state changes of each port of the switch 111 and the preset processing mode can be obtained. At this time, the switch 111 may monitor the ports according to the data items to be collected, so as to obtain the status information of the ports. And determining the number of changes of the state information of a port is essentially to determine the number of changes of the state of the port. Configuration information indicating the corresponding preset processing modes that the switch 111 can perform for different state change times.
In the configuration information, the relationship between the number of state changes of each port and the preset processing mode can be designed according to actual needs. For example, more than two value intervals may be set, the number of state changes in different value intervals corresponds to different preset processing modes, and the number of state changes in the same value interval corresponds to the same preset processing mode. The preset processing manner includes, but is not limited to, maintaining the state of the corresponding port, setting the state of the corresponding port to a non-operating state, restarting the switch 111, and generating and transmitting alarm information to the control device 120. Wherein, keeping the state of the corresponding port means not performing special processing and continuously monitoring the port information table; setting the state of the corresponding port to be a non-working state means that the corresponding port is offline, so that the state of the port is changed to be down.
In some cases, obtaining configuration information may also refer to obtaining new configuration information. The switch 111 may receive new configuration information from the control device 120 to replace the old configuration information, and the switch 111 performs the subsequent steps based on the new configuration information.
Step S202, subscribe to the port information table of the system database of the switch 111.
As described above, the PORT information TABLE is also called PORT _ TABLE, is a kind of data in the system database of the switch 110, and mainly records the state information of each PORT of the switch 111 at different times, or records the time when the state of each PORT of the switch 111 changes and the state information after the change. In general, there is an entry of operator _ status in the port information table, and this entry is used to record the status information of the port. When the value of operator _ status changes, it indicates that the status of the port has changed. The state information of each port of the switch 111 can be known in time by subscribing the port information table of the system database of the switch 111.
Step S203, determining the current state change times of the target port when the state information of any port changes in the port information table.
The destination port refers to a port where status information is sent and changed. In a time period, for example, within 10 minutes or 30 minutes, if the state information of the plurality of ports all changes, each of the plurality of ports is regarded as a target port, and at this time, the current state change number of each target port may be determined separately. If only one port's state information changes, then only that port is considered the target port. The current state change count refers to the accumulated state change count of the target port at the current time, and the accumulated state change count may be calculated from the time when the switch 110 is powered on, or may be calculated according to a sliding time window. When the calculation is performed according to the sliding time window, the current state change times may refer to the state change times accumulated in a past period of time, and the specific period of time may be several minutes, tens of minutes, or even longer, and may be set according to actual needs.
And step S204, determining a preset processing mode corresponding to the target port according to the current state change times and executing.
Since the switch 111 has already determined the relationship between the number of state changes of each port and the preset processing mode by acquiring the configuration information, for the target port, after determining the current number of state changes thereof, the preset processing mode can be determined according to the relationship, so that the process of executing the preset processing mode can be started.
The above contents are general explanations for steps S201 to S204, and the switch 111 can automatically monitor the port state and automatically execute the preset processing mode by executing steps S201 to S204, so that when an abnormal condition occurs at the port of the switch 111, the abnormal condition can be processed in time, and meanwhile, the manual processing time is saved, which is beneficial to ensuring the smoothness of the network.
In some embodiments, as shown in fig. 3, step S203 comprises:
step S301, when the state information of any port changes in the port information table, generating or updating an oscillation state recording table, wherein the oscillation state recording table is used for recording the state change history of a target port;
step S302, determining the current state change times of the target port according to the oscillation state record table.
The oscillation state record table may be generated when the state information of the port of the switch 111 is changed for the first time, and the oscillation state record table may be updated when the state information of the port is changed after the oscillation state record table is generated.
The oscillation state recording table is used for recording the state change history of the target port, that is, the oscillation state recording table records the corresponding state information of the target port when the state of the target port changes in a past period of time, and usually, the corresponding state information of the target port is recorded in the oscillation state table every time the state of the target port changes. Thus, the current state change times of the target port can be determined according to the oscillation state table.
The history of state change of the target port, which generally refers to the history of state change of the target port after the switch 111 is powered on or restarted; of course, the time period may also refer to the state change history in the past, for example, the state change history in the past day or the state change history in the past half day, and the specific time period may be set according to actual needs.
Further, the oscillation state recording table may further record a state value for triggering the preset processing mode, and different state values may trigger different preset processing modes. The state value is determined by the current state change times, and if the current state change times is less than 5, the state value can be set to 0, and the corresponding preset processing mode can be set to maintain the state of the target port and continue to monitor the port information table; when the current state change time is greater than or equal to 5, the state value may be set to 1, and the corresponding preset processing mode may be set to set the state of the target port to a non-working state. When the switch 111 obtains the state value of the oscillation state record table, the preset processing mode to be executed can be determined according to the state value.
In some embodiments, as shown in fig. 4, the switch port status monitoring method further includes:
step S401, receiving a polling request of the control device 120;
in step S402, according to the polling request, after the oscillation state record table is generated or updated, the oscillation state record table is returned to the control device 120.
In general, switch 111 may initiate three processes for port status monitoring. The first process may execute step S201, step S202, and step S203, wherein step S203 may be subdivided into step S301 and step S302; a second process that may execute step S204; the third process, step S401 and step S402 may be performed.
After the step S401 is executed this time, if there is no oscillation state record table temporarily, or the content of the oscillation state record table is not changed compared to the last time step S401 is executed, the switch 111 may return a preset message to the control device 120 to indicate that there is no oscillation state record table temporarily or the oscillation state record table is not changed.
In some embodiments, step S204 includes:
when the current state change times are first preset times, determining that a preset processing mode corresponding to the target port is to set the state of the target port to be a non-working state;
and setting the state of the target port to be in a non-working state.
The aforementioned first preset number of times can be set according to actual requirements, for example, 10 times, 20 times or other times. The first preset number may also be a numerical interval, for example, greater than 10 times or greater than 20 times. The first predetermined number of times generally refers to the number of accumulated state changes over a predetermined time period, which may be a sliding time window.
In some embodiments, step S204 includes:
and when the current state change times are second preset times, determining that the preset processing mode corresponding to the target port is the state of the target port.
The second preset times can also be a numerical value interval generally, and the second preset times can be set according to actual requirements by taking the setting mode of the first preset times as reference. The preset processing mode corresponding to the second preset number of times is to keep the state of the target port, which is equivalent to no need of executing additional processing actions.
In some embodiments, the configuration information records the relationship between the effective time interval and the state change times corresponding to each port of the switch and the preset processing mode;
step S204 includes:
determining the state change times of the target port in an effective time interval according to the current state change times;
and determining and executing a corresponding preset processing mode according to the state change times of the target port in the effective time interval.
The switch 111 may monitor the state of the port according to the valid time interval, for example, count the number of changes in the state of the port in each valid time interval, so as to determine the preprocessing mode. The effective time interval can be set according to actual requirements and can be several minutes, tens of minutes or even longer. At this time, the current state change number refers to the number of state changes accumulated after the latest one valid time interval has elapsed. The state change times of the target port in the latest effective time interval can be determined according to the state change times accumulated at the beginning of the latest effective time interval and by combining the current state change times, so that the corresponding preset processing mode is executed after the latest effective time interval.
In some embodiments, the switch port status monitoring method further comprises the steps of:
and accumulating the state change times of each target port in a plurality of effective time intervals to obtain the accumulated state change times of each target port, and setting the state of the corresponding target port to be in a non-working state when the accumulated state change times reach a third preset time.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps illustrated in fig. 2-4, as well as other embodiments, relate to steps that are not performed in the exact order recited, unless explicitly stated herein, and may be performed in other orders. Moreover, at least a portion of the steps of the foregoing embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In some embodiments, as shown in fig. 5, there is provided a switch port status monitoring apparatus 500, comprising:
a configuration information obtaining module 501, configured to obtain configuration information, where the configuration information records a relationship between state change times of each port of the switch and a preset processing mode;
a subscription module 502, configured to subscribe to a port information table of a switch system database;
a current time determining module 503, configured to determine the current state change time of the target port when the state information of any port in the port information table changes;
and the processing module 504 is configured to determine a preset processing mode corresponding to the target port according to the current state change frequency and execute the preset processing mode.
In some embodiments, the current number determining module 503 includes:
a recording unit (not shown) configured to generate or update an oscillation state record table when state information of any port in the port information table changes, the oscillation state record table being configured to record a state change history of a target port;
and a determining unit (not shown) for determining the current state change times of the target port according to the oscillation state recording table.
In some embodiments, the switch port status monitoring apparatus 500 further comprises:
an information receiving module (not shown) for receiving a polling request from the control device;
and an information sending module (not shown) for returning the oscillation state record table to the control device after generating or updating the oscillation state record table according to the polling request.
In some embodiments, the processing module 504 includes:
a first determining unit (not shown) configured to determine, when the current state change frequency is a first preset frequency, that the preset processing mode corresponding to the target port is to set the state of the target port to a non-working state;
a first execution unit (not shown) for setting the state of the target port to a non-operating state.
In some embodiments, the processing module 504 includes a second determining unit (not shown), and the second determining unit is configured to determine, when the current state change time is a second preset time, that the preset processing manner corresponding to the target port is to maintain the state of the target port.
In some embodiments, the configuration information records a relationship between an effective time interval and a number of state changes corresponding to each port of the switch and a preset processing manner, and the processing module 504 includes:
the counting unit is used for determining the state change times of the target port in the effective time interval according to the current state change times;
and the execution unit is used for determining and executing the corresponding preset processing mode according to the state change times of the target port in the effective time interval.
For specific limitations of the switch port status monitoring apparatus 500, reference may be made to the above limitations of the switch port status monitoring method, which is not described herein again. The modules in the switch port status monitoring apparatus 500 may be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the switch, and can also be stored in a memory in the switch in a software form, so that the processor can call and execute the corresponding operations of the modules.
In some embodiments, the present application further provides a network communication system including a plurality of switches and control devices respectively connected to the switches;
the control equipment is used for sending configuration information to each switch, sending polling requests to each switch, receiving and storing an oscillation state recording table returned by each switch, wherein the configuration information records the relationship between the state change times of each port of each switch and a preset processing mode;
each switch is used for acquiring configuration information and subscribing a port information table of a switch system database, when the state information of any port in the port information table changes, an oscillation state recording table is generated or updated, the current state change times of a target port are determined according to the oscillation state recording table, a preset processing mode corresponding to the target port is determined and executed according to the current state change times, and the oscillation state recording table is used for recording the state change history of the target port;
each switch is also used for receiving the polling request sent by the control equipment and returning the oscillation state record table to the control equipment after the oscillation state record table is generated.
One configuration of a network communication system is shown in fig. 1, and includes a plurality of switches 110 and a control device 120. The control device 120 sends the configuration information to each switch, and each switch executes the steps of the switch port state monitoring method according to the configuration information, so that the data processing pressure of the control device 120 can be reduced. The control device 120 does not need to collect port state information of each switch one by one and determine whether the state of each port is abnormal, or send control information to control the corresponding switch to execute a preset processing mode when the state of each port is abnormal. The control device 120 only needs to set corresponding configuration information according to actual requirements, such as communication requirements and test requirements, and send the configuration information to the corresponding switch, so that the switch can monitor the state of the port by itself, and execute a preset processing mode by itself when the state of the port is abnormal. Under the condition that the number of the switches is large, the data processing pressure of the control equipment 120 is greatly reduced, and meanwhile, the switches can also automatically and timely process abnormal conditions, so that the smoothness of the network is ensured.
In the network communication system, the switch may perform the steps of the switch port status monitoring method in any of the foregoing embodiments, which are not specifically developed herein.
In the network communication system, the control device 120 may be a server, and its internal structure diagram may be as shown in fig. 6. The server includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the server is configured to provide computing and control capabilities. The memory of the server comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the server is used for storing an oscillation state record table. The network interface of the server is used for communicating with an external switch through a network connection.
In the network communication system, the control device 120 may be a terminal, and its internal configuration diagram may be as shown in fig. 7. The terminal comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the terminal is configured to provide computing and control capabilities. The memory of the terminal comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the terminal is used for communicating with an external switch through a network connection. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device of the terminal can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the configurations shown in fig. 6 and 7 are block diagrams of only some of the configurations relevant to the present disclosure, and do not constitute a limitation on the terminal to which the present disclosure may be applied, and that a particular terminal may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In some embodiments, the present application provides a switch comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
in the port information table, when the state information of any port changes, determining the current state change times of a target port;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
In some embodiments, the step of determining the number of current state changes of the target port when the state information of any port changes in the port information table is implemented by the processor executing the computer program, and includes:
when the state information of any port changes in the port information table, generating or updating an oscillation state recording table, wherein the oscillation state recording table is used for recording the state change history of a target port;
and determining the current state change times of the target port according to the oscillation state recording table.
In some embodiments, the processor, when executing the computer program, further performs the steps of:
receiving a polling request of a control device;
according to the polling request, after the oscillation state record table is generated or updated, the oscillation state record table is returned to the control device.
In some embodiments, the step of determining and executing the preset processing mode corresponding to the target port according to the current state change times when the processor executes the computer program includes:
when the current state change times are first preset times, determining that a preset processing mode corresponding to the target port is to set the state of the target port to be a non-working state;
and setting the state of the target port to be in a non-working state.
In some embodiments, the step of determining and executing the preset processing mode corresponding to the target port according to the current state change times when the processor executes the computer program includes:
and when the current state change times are second preset times, determining that the preset processing mode corresponding to the target port is the state of the target port.
In some embodiments, the configuration information records the relationship between the effective time interval and the state change times corresponding to each port of the switch and the preset processing mode;
when the processor executes the computer program, the preset processing mode corresponding to the target port is determined and executed according to the current state change times, and the method comprises the following steps:
determining the state change times of the target port in an effective time interval according to the current state change times;
and determining and executing a corresponding preset processing mode according to the state change times of the target port in the effective time interval.
In some embodiments, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
in the port information table, when the state information of any port changes, determining the current state change times of a target port;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
In some embodiments, the step of determining the number of current state changes of the target port when the state information of any port changes in the port information table is implemented by a computer program executed by a processor, includes:
when the state information of any port changes in the port information table, generating or updating an oscillation state recording table, wherein the oscillation state recording table is used for recording the state change history of a target port;
and determining the current state change times of the target port according to the oscillation state recording table.
In some embodiments, the computer program when executed by the processor further performs the steps of:
receiving a polling request of a control device;
according to the polling request, after the oscillation state record table is generated or updated, the oscillation state record table is returned to the control device.
In some embodiments, when executed by a processor, a computer program implements a step of determining a preset processing mode corresponding to a target port according to a current state change number and executing the preset processing mode, including:
when the current state change times are first preset times, determining that a preset processing mode corresponding to the target port is to set the state of the target port to be a non-working state;
and setting the state of the target port to be in a non-working state.
In some embodiments, when executed by a processor, a computer program implements a step of determining a preset processing mode corresponding to a target port according to a current state change number and executing the preset processing mode, including:
and when the current state change times are second preset times, determining that the preset processing mode corresponding to the target port is the state of the target port.
In some embodiments, the configuration information records the relationship between the effective time interval and the state change times corresponding to each port of the switch and the preset processing mode;
when being executed by a processor, the computer program realizes the steps of determining the preset processing mode corresponding to the target port according to the current state change times and executing, and comprises the following steps:
determining the state change times of the target port in an effective time interval according to the current state change times;
and determining and executing a corresponding preset processing mode according to the state change times of the target port in the effective time interval.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for monitoring switch port status, the method comprising:
acquiring configuration information, wherein the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
subscribing a port information table of a switch system database;
determining the current state change times of a target port when the state information of any port is changed in the port information table;
and determining a preset processing mode corresponding to the target port according to the current state change times and executing.
2. The method according to claim 1, wherein the determining the number of current state changes of the target port when the state information of any port in the port information table changes comprises:
when the state information of any port in the port information table changes, generating or updating an oscillation state record table, wherein the oscillation state record table is used for recording the state change history of a target port;
and determining the current state change times of the target port according to the oscillation state record table.
3. The method of claim 2, further comprising:
receiving a polling request of a control device;
and according to the polling request, after generating or updating an oscillation state record table, returning the oscillation state record table to the control equipment.
4. The method according to claim 1, wherein the determining and executing the preset processing mode corresponding to the target port according to the current state change times comprises:
when the current state change times are first preset times, determining that a preset processing mode corresponding to the target port is to set the state of the target port to be a non-working state;
and setting the state of the target port to be a non-working state.
5. The method according to claim 1, wherein the determining and executing the preset processing mode corresponding to the target port according to the current state change times comprises:
and when the current state change times are second preset times, determining that the preset processing mode corresponding to the target port is the state of the target port.
6. The method according to claim 1, wherein the configuration information records the relationship between the effective time interval and the number of state changes corresponding to each port of the switch and a preset processing mode;
the determining and executing a preset processing mode corresponding to the target port according to the current state change times includes:
determining the state change times of the target port in an effective time interval according to the current state change times;
and determining a corresponding preset processing mode and executing according to the state change times of the target port in the effective time interval.
7. A switch port status monitoring apparatus, the apparatus comprising:
the configuration information acquisition module is used for acquiring configuration information, and the configuration information records the relationship between the state change times of each port of the switch and a preset processing mode;
the subscription module is used for subscribing a port information table of a switch system database;
a current time determining module, configured to determine the current state change time of the target port when the state information of any port in the port information table changes;
and the processing module is used for determining a preset processing mode corresponding to the target port according to the current state change times and executing the preset processing mode.
8. A network communication system is characterized by comprising a plurality of switches and control equipment respectively connected with the switches;
the control equipment is used for sending configuration information to each switch, sending polling requests to each switch, receiving and storing an oscillation state record table returned by each switch, wherein the configuration information records the relationship between the state change times of each port of each switch and a preset processing mode;
each switch is used for acquiring the configuration information, subscribing a port information table of a switch system database, generating or updating an oscillation state record table when the state information of any port in the port information table changes, determining the current state change times of a target port according to the oscillation state record table, determining a preset processing mode corresponding to the target port according to the current state change times and executing the preset processing mode, wherein the oscillation state record table is used for recording the state change history of the target port;
each switch is further configured to receive a polling request sent by the control device, and return an oscillation state record table to the control device after the oscillation state record table is generated.
9. A switch comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 6 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202111369307.5A 2021-11-15 2021-11-15 Switch port state monitoring method and device and network communication system Withdrawn CN114157582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111369307.5A CN114157582A (en) 2021-11-15 2021-11-15 Switch port state monitoring method and device and network communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111369307.5A CN114157582A (en) 2021-11-15 2021-11-15 Switch port state monitoring method and device and network communication system

Publications (1)

Publication Number Publication Date
CN114157582A true CN114157582A (en) 2022-03-08

Family

ID=80457125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111369307.5A Withdrawn CN114157582A (en) 2021-11-15 2021-11-15 Switch port state monitoring method and device and network communication system

Country Status (1)

Country Link
CN (1) CN114157582A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941632A (en) * 2023-02-16 2023-04-07 北京天弛网络有限公司 Acquisition method, device, medium and equipment based on network switch equipment state

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941632A (en) * 2023-02-16 2023-04-07 北京天弛网络有限公司 Acquisition method, device, medium and equipment based on network switch equipment state

Similar Documents

Publication Publication Date Title
US11683671B2 (en) System, method, apparatus, and computer program product for providing mobile device support services
CN109522287B (en) Monitoring method, system, equipment and medium for distributed file storage cluster
CN108834086B (en) Method and device for sending short message, computer equipment and storage medium
CN111611137A (en) Alarm monitoring method and device, computer equipment and storage medium
CN108304553B (en) Data migration method and device, computer equipment and storage medium
CN110309109B (en) Data monitoring method, device, computer equipment and storage medium
CN104346264A (en) System and method for processing system event logs
CN108964977B (en) Node exception handling method and system, storage medium and electronic device
CN110119290A (en) The spare page switching method of application program, device, computer equipment and storage medium
CN112115167A (en) Cache system hot spot data access method, device, equipment and storage medium
CN108763046B (en) Thread running monitoring method, device, computer equipment and storage medium
CN114157582A (en) Switch port state monitoring method and device and network communication system
CN114500315A (en) Equipment state monitoring method and device, computer equipment and storage medium
CN112070585A (en) Order state unified management method and device, computer equipment and storage medium
CN111966701A (en) Metadata updating method, device, equipment and storage medium
CN111211925A (en) Alarm information synchronization method and device, computer equipment and storage medium
CN113824590B (en) Method for predicting problem in micro service network, computer device, and storage medium
CN112303811B (en) Processing method, device and system for air conditioner operation data, air conditioner and storage medium
CN110879757B (en) Restarting method and device for abnormal operation of client and computer equipment
CN115442225A (en) Method and device for reporting buried point log and method and device for monitoring buried point quality
CN109254997B (en) Data synchronization method, system, computer device and readable storage medium
CN110162320B (en) Uninterruptible power supply system upgrading method, device, computer equipment and storage medium
CN108896068B (en) Step counting method, server, mobile terminal and storage medium
CN112463783A (en) Index data monitoring method and device, computer equipment and storage medium
CN110955647A (en) Database assistance method, database assistance device, computer equipment and storage medium

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220308