CN114244700B - Port processing method and device, electronic equipment and computer readable storage medium - Google Patents

Port processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114244700B
CN114244700B CN202111558926.9A CN202111558926A CN114244700B CN 114244700 B CN114244700 B CN 114244700B CN 202111558926 A CN202111558926 A CN 202111558926A CN 114244700 B CN114244700 B CN 114244700B
Authority
CN
China
Prior art keywords
port
reset
script
preset
switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111558926.9A
Other languages
Chinese (zh)
Other versions
CN114244700A (en
Inventor
王笑天
宋文娜
黄世刚
石建勋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202111558926.9A priority Critical patent/CN114244700B/en
Publication of CN114244700A publication Critical patent/CN114244700A/en
Application granted granted Critical
Publication of CN114244700B publication Critical patent/CN114244700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • 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/0889Techniques to speed-up the configuration process
    • 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/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure provides a port processing method and device, electronic equipment and a computer readable storage medium, which can be applied to the technical field of network operation and maintenance and the financial field. The port processing method comprises the following steps: responding to a port recovery instruction, and respectively sending information acquisition requests to a plurality of switches; generating a port reset script based on at least one echo example under the condition that the received feedback information sent by the switch response information acquisition request contains the echo example of at least one target port; and logging into the switch, executing a port reset script in the switch to process the at least one destination port.

Description

Port processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of network operation and maintenance technology and the field of finance, and more particularly, to a port processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of network technology, SAN (Storage Area Network ) has been developed to solve the structural limitation caused by the tight combination of data and application systems in data center storage schemes and the limitation of small computer system interface standards.
When the line quality of an operator is unstable or the network is cut, the port of the large-area storage device is easy to shake and automatically isolate, the performance of data backup is easy to be reduced, and operation and maintenance personnel need to timely finish the operation of recovering the port after the line of the operator is recovered to be stable or after the change of the cut network is finished.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: the recovery port operation has higher professional requirements for operation and maintenance personnel, and can not meet the timeliness requirements of emergency treatment.
Disclosure of Invention
In view of this, the present disclosure provides a port processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to a first aspect of the present disclosure, there is provided a port processing method, including:
responding to a port recovery instruction, and respectively sending information acquisition requests to a plurality of switches;
generating a port reset script based on at least one echo example under the condition that the received feedback information sent by the switch in response to the information acquisition request contains the echo example of at least one target port; and
logging in the switch, executing the port reset script in the switch to process the at least one target port.
According to an embodiment of the present disclosure, the above method further includes:
under the condition that a preset number of ports are detected to send out isolation warning information, initiating the port recovery instruction; or alternatively
And under the condition that the preset clicking operation of the user is received, initiating the port recovery instruction.
According to an embodiment of the present disclosure, the above method further includes:
and terminating the processing of the port of the switch under the condition that the feedback information of the switch does not contain the echo example.
According to an embodiment of the present disclosure, the generating a port reset script based on at least one of the echo instances includes:
respectively acquiring data in a preset column of each echo example through a preset script to obtain at least one first reset data;
arranging each first reset data according to a preset strategy to obtain at least one second reset data; and
and filling the at least one second reset data into a preset script template to obtain the port reset script.
According to an embodiment of the present disclosure, the filling the at least one second reset data into a preset script template to obtain the port reset script includes:
modifying the number of execution sentences in the preset script template based on the number of the second reset data; and
and respectively adding each second reset data into one execution statement of the modified preset script template to obtain the port reset script.
According to an embodiment of the present disclosure, the above method further includes:
after executing the port reset script, for each of the target ports, controlling the target port to send out a heartbeat message based on a preset communication link; and
and under the condition that the target port receives a response message corresponding to the heartbeat message, determining that the target port is successfully recovered.
According to a second aspect of the present disclosure, there is provided a port processing apparatus comprising: the device comprises a sending module, a generating module and an executing module.
The sending module is used for responding to the port recovery instruction and respectively sending information acquisition requests to the plurality of switches;
the generating module is used for generating a port reset script based on at least one echo example under the condition that the received feedback information sent by the switch in response to the information acquisition request contains the echo example of at least one target port; and
and the execution module is used for logging in the switch, executing the port resetting script in the switch and processing the at least one target port.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; and a memory for storing one or more instructions that, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium storing computer executable instructions which when executed are adapted to carry out the method as described above.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions which, when executed, are adapted to carry out the method as described above.
According to the embodiment of the disclosure, by sending an information acquisition request to the switch, when feedback information containing a echo example is received, a port reset script is generated based on the echo example, and then the port reset script is run through the switch, so that the port recovery operation is completed. By the technical means, the technical problems that the professional requirements on operation and maintenance personnel are high and the timeliness of emergency treatment cannot be met in the related technology are at least partially solved, the efficiency and the accuracy of port recovery can be improved during emergency treatment, and the operation and maintenance cost is reduced.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates an exemplary system architecture to which the port processing methods and apparatus of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow chart of a port processing method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a method flow diagram of generating a port reset script in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a method of determining that a target port recovery was successful in accordance with an embodiment of the disclosure;
FIG. 5 schematically illustrates an overall flow diagram of a port processing method according to an embodiment of the disclosure;
FIG. 6 schematically illustrates a block diagram of a port processing device according to an embodiment of the disclosure; and
fig. 7 schematically illustrates a block diagram of a computer system suitable for implementing a port processing method in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related personal information of the user all conform to the regulations of related laws and regulations, necessary security measures are taken, and the public order harmony is not violated.
In the technical scheme of the disclosure, the authorization or consent of the user is obtained before the personal information of the user is obtained or acquired.
With the development of network technology, SAN (Storage Area Network ) has been developed to solve the structural limitation caused by the tight combination of data and application systems in data center storage schemes and the limitation of small computer system interface standards.
The SAN adopts FC (fabric Channel) technology, and connects the storage array and the server host through the FC switch, so that a local area network dedicated to data storage can be established, the SAN is convenient for integration, and the availability and network performance of data can be improved.
However, in the scenario of long-distance data transmission in disaster recovery in a data center, SAN-based network quality is susceptible to operator line quality. When the quality of the line of the operator is unstable or the network is cut, the port of the large-area storage equipment is easy to shake and automatically isolate, the performance of data backup is easy to be reduced, and operation and maintenance personnel of the related network need to restore the port in time after the line of the operator is restored to be stable or after the change of the cut network is finished, so that the purpose of restoring the data backup is realized.
In the related art, an operation and maintenance personnel is generally required to perform emergency treatment of a restoration port based on the following ways:
(1) Inquiring the logs of the switch one by one, and recovering the ports with the abnormality one by one;
(2) Integrating alarm information, and corresponding WWN (World Wide Name) of the abnormal port to the port of the switch, and then recovering one by one;
(3) Logging in related network equipment, inquiring the problem port through a special command of the optical fiber switch, and then recovering one by one.
However, the modes (1) and (2) consume manpower, and cannot guarantee the efficiency and accuracy of emergency treatment; the mode (3) has higher professional requirements on operation and maintenance personnel, can not meet the timeliness of emergency treatment when the lines of operators are cut at night, and can not guarantee the accuracy of the emergency treatment when a large number of ports are recovered.
In order to at least partially solve the technical problems in the related art, the present disclosure provides a port processing method and apparatus, an electronic device, and a computer readable storage medium, which can be applied to the network operation and maintenance technical field and the financial field. The port processing method comprises the following steps: responding to a port recovery instruction, and respectively sending information acquisition requests to a plurality of switches; generating a port reset script based on at least one echo example under the condition that the received feedback information sent by the switch response information acquisition request contains the echo example of at least one target port; and logging into the switch, executing a port reset script in the switch to process the at least one destination port.
It should be noted that the port processing method and the device determined by the embodiments of the present disclosure may be used in the technical field of network operation and maintenance or the financial field, for example, in a banking website for performing network operation and maintenance. The port processing method and the device determined by the embodiment of the disclosure can be used for providing services in any field except the technical field of network operation and maintenance and the financial field, such as an internet service provider. The application fields of the port processing method and the device determined by the embodiment of the disclosure are not limited.
Fig. 1 schematically illustrates an exemplary system architecture to which a port processing method may be applied according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a server 104, and a switch 105. Between the terminal devices 101, 102, 103 and the server 104, the server 104 and the switch 105 may be linked by a wired and/or wireless communication link or the like.
The user may interact with the server 104 using the terminal devices 101, 102, 103 to receive or send messages or the like.
The terminal devices 101, 102, 103 may be various electronic devices with display screens including, but not limited to, smartphones, tablets, laptop and desktop computers, and the like.
The server 104 may be a server providing various services, such as a background management server (merely an example) providing support for operations performed by the user with the terminal devices 101, 102, 103. The background management server may analyze and/or the like the received data such as the user operation and send the processing result (e.g., obtain or generate a request, information, data, or the like according to the user operation) to the switch 105.
Switch 105 may be any two network nodes that are capable of providing a single shared electrical signal path for access to the switch, such as an FC switch for connection to storage, or the like.
It should be noted that the port processing method provided in the embodiments of the present disclosure may be generally performed by the server 104. Accordingly, the port processing device provided in the embodiments of the present disclosure may be generally disposed in the server 104. The port processing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 104 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 104. Accordingly, the port processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster different from the server 104 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 104. Alternatively, the port processing method provided by the embodiment of the present disclosure may be performed by the terminal device 101, 102, or 103, or may be performed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the port processing apparatus provided in the embodiments of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically illustrates a flow chart of a port processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, information acquisition requests are respectively transmitted to a plurality of switches in response to a port recovery instruction.
According to embodiments of the present disclosure, the port recovery instructions may include automatic detection generation by a server, generation by manual operation, and the like.
According to embodiments of the present disclosure, a switch is a network device for electrical or electrical signal forwarding, which may provide a single shared electrical signal path for any two network nodes accessing the switch.
According to embodiments of the present disclosure, an information acquisition request may be used to acquire the echo information of a port.
In operation S202, in case that the feedback information received from the switch response information acquisition request includes at least one echo instance of the target port, a port reset script is generated based on the at least one echo instance.
According to embodiments of the present disclosure, a destination port may include a port that requires port processing.
According to the embodiment of the disclosure, when the target port displays the batch command being executed and the execution result, the port reset script can be automatically generated by using a preset script of Java, python and the like based on the echo example information.
In operation S203, the switch is logged in, and a port reset script is executed in the switch to process at least one target port.
According to the embodiment of the disclosure, the recovery operation of the target port can be completed by executing the port reset script in the switch.
According to the embodiment of the disclosure, by sending an information acquisition request to the switch, when feedback information containing a echo example is received, a port reset script is generated based on the echo example, and then the port reset script is run through the switch, so that the port recovery operation is completed. By the technical means, the technical problems that the professional requirements on operation and maintenance personnel are high and the timeliness of emergency treatment cannot be met in the related technology are at least partially solved, the efficiency and the accuracy of port recovery can be improved during emergency treatment, and the operation and maintenance cost is reduced.
The method shown in fig. 2 is further described below with reference to fig. 3-5 in conjunction with the exemplary embodiment.
According to an embodiment of the present disclosure, further comprising: under the condition that a preset number of ports are detected to send out isolation warning information, initiating a port recovery instruction; or under the condition that the preset clicking operation of the user is received, initiating a port recovery instruction.
According to the embodiment of the disclosure, the isolation warning information may include, for example, a plurality of port isolation warning information that occurs in a network manager, or link interruption information provided by an external door, etc.
According to the embodiments of the present disclosure, the present disclosure does not limit specific numerical values of the preset number, which may be set by those skilled in the art according to actual demands.
According to an embodiment of the present disclosure, the preset clicking operation may include, for example, a user clicking an emergency button with a terminal device, and may initiate a port recovery instruction, thereby automatically acquiring port information.
According to an embodiment of the present disclosure, in response to the port recovery instruction, information acquisition requests such as:
ssh*.*.*.*
switchshow|grep exceeded
according to embodiments of the present disclosure, other port recovery methods may be used due to port isolation caused by other issues with certain non-internet lines, such as module issues, fiber optic line issues, etc., where the port state may be different from the need to reset the port state in the present disclosure.
According to the embodiment of the disclosure, when the isolation warning information is sent out by the ports with the preset number or when the preset clicking operation of the user is received, the port recovery instruction is initiated, so that abnormal port processing under different application scenes can be met.
According to an embodiment of the present disclosure, further comprising: and terminating the processing of the port of the switch under the condition that the feedback information of the switch does not contain the echo example.
According to an embodiment of the present disclosure, the case where the feedback information does not include a feedback instance is, for example:
XX:admin>switchshow|grep exceeded
XX:admin>
according to the embodiment of the disclosure, when the feedback information of the switch does not contain the echo instance, the processing of the port of the switch can be terminated without generating a restoration port script.
Fig. 3 schematically illustrates a method flowchart of generating a port reset script in accordance with an embodiment of the present disclosure.
As shown in fig. 3, the method includes operations S301 to S303.
In operation S301, data in a preset column of each echo instance is obtained through a preset script, so as to obtain at least one first reset data.
According to an embodiment of the present disclosure, the feedback information includes a case of a feedback instance, for example:
XX:admin>switchshow|grep exceeded
313260300id N8 No_Sync FC Disabled(Port State Change threshold exceeded)
41 4260400id N8 No_Sync FC Disabled(Port State Change threshold exceeded)
in the above echo examples, according to the embodiments of the present disclosure, column 1 data of each row may represent a port code, column 2 and column 3 data may represent a state of the port, column 6 data may represent a port rate, and the like.
According to the embodiment of the disclosure, when a display example exists, for example, the 2 nd column and the 3 rd column data of each row in the display information can be automatically fetched through a preset Python script, so that first reset data is obtained.
According to embodiments of the present disclosure, the first reset data may include status information for each port in the echo instance.
In operation S302, each first reset data is arranged according to a preset policy, so as to obtain at least one second reset data.
According to an embodiment of the present disclosure, the preset policy may include a port recovery policy under different application scenarios, and the like.
According to an embodiment of the present disclosure, the second reset data may include port status information arranged according to actual needs of those skilled in the art after the first reset data is rearranged according to a preset policy.
In operation S303, at least one second reset data is filled into a preset script template to obtain a port reset script.
According to an embodiment of the present disclosure, the port reset script may be generated using the second reset data through a preset Python script template.
According to embodiments of the present disclosure, the port reset script may, for example:
ssh*.*.*.*
Portcfgpersistentenable 1/3
Portcfgpersistentenable 1/4
exit
according to an embodiment of the present disclosure, the number of execution statements in the preset script template is modified based on the number of second reset data; and adding each second reset data to one execution statement of the modified preset script template respectively to obtain a port reset script.
According to the embodiment of the disclosure, the abnormal port information can be automatically acquired by using the preset script, and the port reset script can be automatically generated according to the preset strategy, so that the recovery operation of the abnormal port can be carried out later, the operation and maintenance cost is reduced, and the efficiency and the accuracy of the abnormal port processing are improved.
Fig. 4 schematically illustrates a flow chart of a method of determining that a target port recovery was successful in accordance with an embodiment of the disclosure.
As shown in fig. 4, the method includes operations S401 to S402.
After executing the port reset script, the control target port sends out a heartbeat message based on the preset communication link for each target port in operation S401.
According to embodiments of the present disclosure, the preset communication links representing the physical channels between two nodes in the network may be provided as twisted pair, optical fiber, microwave, etc.
According to embodiments of the present disclosure, a heartbeat message may monitor an operating state of a machine network memory, indicate the operating state of the network memory with one-time transmission string information, and may be transmitted in a broadcast or unicast manner based on UDP (User Datagram Protocol, user data packet protocol).
According to the embodiment of the disclosure, the sending mode and the sending interval of the heartbeat message can be set by a user on a control interface of the network memory.
In operation S402, in the case that the target port receives the response message corresponding to the heartbeat message, it is determined that the target port is successfully recovered.
According to the embodiment of the disclosure, the response message can be fed back by one end of the heartbeat message of the receiving target port.
According to the embodiment of the disclosure, the operation condition of abnormal port recovery can be automatically judged through the response message corresponding to the heartbeat message, so that the operation and maintenance cost is reduced.
Fig. 5 schematically illustrates an overall flowchart of a port processing method according to an embodiment of the present disclosure.
As shown in fig. 5, the operation of recovering the port may be started when the isolation warning information is detected or the user clicks the peripheral port recovery button; initiating a port recovery instruction to a server, and judging whether a feedback instance is contained or not when the server acquires feedback information; when the feedback information does not contain the echo example, the method can prompt that recovery is not needed and terminate the processing of the port of the switch; when the feedback information contains a feedback instance, a port reset script can be generated by using a preset script template; the switch may then be logged in and the port reset script executed to complete the recovery of the port.
It should be noted that, unless there is an execution sequence between different operations or an execution sequence between different operations in technical implementation, the execution sequence between multiple operations may be different, and multiple operations may also be executed simultaneously in the embodiment of the disclosure.
Fig. 6 schematically illustrates a block diagram of a port processing device according to an embodiment of the disclosure.
As shown in fig. 6, the port processing device includes: a sending module 601, a generating module 602 and an executing module 603.
The sending module 601 is configured to send information obtaining requests to the plurality of switches, respectively, in response to the port recovery instruction.
The generating module 602 is configured to generate, when the feedback information sent by the switch response information obtaining request includes at least one echo instance of the target port, a port reset script based on the at least one echo instance.
An execution module 603 is configured to log into the switch, and execute a port reset script in the switch to process at least one target port.
According to the embodiment of the disclosure, by sending an information acquisition request to the switch, when feedback information containing a echo example is received, a port reset script is generated based on the echo example, and then the port reset script is run through the switch, so that the port recovery operation is completed. By the technical means, the technical problems that the professional requirements on operation and maintenance personnel are high and the timeliness of emergency treatment cannot be met in the related technology are at least partially solved, the efficiency and the accuracy of port recovery can be improved during emergency treatment, and the operation and maintenance cost is reduced.
According to an embodiment of the present disclosure, the port processing device further includes: a first initiating module and a second initiating module.
The first initiating module is used for initiating a port recovery instruction under the condition that a preset number of ports are detected to send isolation warning information.
And the second initiating module is used for initiating a port recovery instruction under the condition that the preset clicking operation of the user is received.
According to an embodiment of the present disclosure, the port processing device further includes: and (5) a termination module.
And the termination module is used for terminating the processing of the port of the switch under the condition that the feedback information of the switch does not contain the echo example.
According to an embodiment of the present disclosure, the generating module 602 includes: an acquisition unit, an arrangement unit and a filling unit.
The acquisition unit is used for respectively acquiring the data in the preset column of each echo example through the preset script to obtain at least one first reset data.
The arrangement unit is used for arranging each first reset data according to a preset strategy respectively to obtain at least one second reset data.
And the filling unit is used for filling at least one second reset data into the preset script template to obtain the port reset script.
According to an embodiment of the present disclosure, wherein the filling unit comprises: a modification subunit and an addition subunit.
And the modification subunit is used for modifying the number of execution sentences in the preset script template based on the number of the second reset data.
And the adding subunit is used for respectively adding each second reset data into one execution statement of the modified preset script template to obtain the port reset script.
According to an embodiment of the present disclosure, the port processing device further includes: a control module and a determination module.
And the control module is used for controlling the target ports to send heartbeat messages outwards based on a preset communication link for each target port after executing the port reset script.
And the determining module is used for determining that the target port is successfully recovered under the condition that the target port receives the response message corresponding to the heartbeat message.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the transmitting module 601, the generating module 602, and the executing module 603 may be combined in one module/unit/sub-unit, or any of them may be split into a plurality of modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. At least one of the sending module 601, the generating module 602, and the executing module 603 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or by hardware or firmware in any other reasonable way of integrating or packaging circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware, according to embodiments of the present disclosure. Alternatively, at least one of the sending module 601, the generating module 602 and the executing module 603 may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
It should be noted that, in the embodiment of the present disclosure, the port processing device portion corresponds to the port processing method portion in the embodiment of the present disclosure, and the description of the port processing device portion specifically refers to the port processing method portion, which is not described herein.
Fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a port processing method according to an embodiment of the disclosure. The electronic device shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 7, a computer electronic device 700 according to an embodiment of the present disclosure includes a processor 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. Note that the program may be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 702 and/or RAM 703 and/or one or more memories other than ROM 702 and RAM 703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, for causing the electronic device to implement the port processing methods provided by the embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium in the form of signals, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, or any suitable combination of the preceding.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (8)

1. A port processing method, comprising:
responding to a port recovery instruction, and respectively sending information acquisition requests to a plurality of switches;
generating a port reset script based on at least one echo instance of the target port under the condition that feedback information sent by the switch in response to the information acquisition request contains the echo instance of the target port;
logging in the switch, executing the port reset script in the switch to process the at least one destination port;
wherein the generating a port reset script based on at least one of the echo instances includes:
respectively acquiring data in a preset column of each echo example through a preset script to obtain at least one first reset data, wherein the first reset data comprises state information of each port in the echo example;
arranging each first reset data according to a preset strategy to obtain at least one second reset data, wherein the second reset data comprises port state information arranged according to actual requirements after rearranging the first reset data according to the preset strategy;
filling the at least one second reset data into a preset script template to obtain the port reset script; and
and under the condition that the feedback information of the switch does not contain the echo example, terminating the processing of the port of the switch.
2. The method of claim 1, further comprising:
under the condition that a preset number of ports are detected to send out isolation warning information, initiating a port recovery instruction; or alternatively
And under the condition that the preset clicking operation of the user is received, initiating the port recovery instruction.
3. The method of claim 1, wherein the filling the at least one second reset data into a preset script template to obtain the port reset script comprises:
modifying the number of execution sentences in the preset script template based on the number of the second reset data; and
and respectively adding each second reset data into one execution statement of the modified preset script template to obtain the port reset script.
4. The method of claim 1, further comprising:
after executing the port reset script, for each target port, controlling the target port to send out a heartbeat message based on a preset communication link; and
and under the condition that the target port receives a response message corresponding to the heartbeat message, determining that the target port is successfully recovered.
5. A port processing device, comprising:
the sending module is used for responding to the port recovery instruction and respectively sending information acquisition requests to the plurality of switches;
the generating module is used for generating a port reset script based on at least one echo example under the condition that the received feedback information sent by the switch in response to the information acquisition request contains the echo example of at least one target port;
an execution module for logging into the switch, executing the port reset script in the switch to process the at least one target port;
wherein, the generating module includes:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for respectively acquiring data in a preset column of each display case through a preset script to obtain at least one first reset data, and the first reset data comprises state information of each port in the display case;
the arrangement unit is used for arranging each first reset data according to a preset strategy to obtain at least one second reset data, wherein the second reset data comprises port state information arranged according to actual requirements after the first reset data are rearranged according to the preset strategy;
the filling unit is used for filling at least one second reset data into a preset script template to obtain a port reset script; and
and the termination module is used for terminating the processing of the port of the switch under the condition that the feedback information of the switch does not contain the echo example.
6. An electronic device, comprising:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 4.
7. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 4.
8. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 4 when executed.
CN202111558926.9A 2021-12-17 2021-12-17 Port processing method and device, electronic equipment and computer readable storage medium Active CN114244700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111558926.9A CN114244700B (en) 2021-12-17 2021-12-17 Port processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111558926.9A CN114244700B (en) 2021-12-17 2021-12-17 Port processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114244700A CN114244700A (en) 2022-03-25
CN114244700B true CN114244700B (en) 2024-03-22

Family

ID=80758867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111558926.9A Active CN114244700B (en) 2021-12-17 2021-12-17 Port processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114244700B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582176B (en) * 2023-07-13 2023-09-26 天津瑞利通科技有限公司 Optical fiber automatic wiring method, optical fiber automatic wiring device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101030A (en) * 2016-08-30 2016-11-09 烟台正维科技有限公司 The method and device that switch ports themselves is switched fast
CN111341379A (en) * 2020-02-22 2020-06-26 苏州浪潮智能科技有限公司 Method and equipment for testing storage device
CN113285822A (en) * 2020-02-19 2021-08-20 慧与发展有限责任合伙企业 Data center troubleshooting mechanism
CN113660136A (en) * 2021-08-12 2021-11-16 中国工商银行股份有限公司 Method, device, equipment and storage medium for checking availability of ports of two-way switch

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101030A (en) * 2016-08-30 2016-11-09 烟台正维科技有限公司 The method and device that switch ports themselves is switched fast
CN113285822A (en) * 2020-02-19 2021-08-20 慧与发展有限责任合伙企业 Data center troubleshooting mechanism
CN111341379A (en) * 2020-02-22 2020-06-26 苏州浪潮智能科技有限公司 Method and equipment for testing storage device
CN113660136A (en) * 2021-08-12 2021-11-16 中国工商银行股份有限公司 Method, device, equipment and storage medium for checking availability of ports of two-way switch

Also Published As

Publication number Publication date
CN114244700A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
US9081750B2 (en) Recovery escalation of cloud deployments
US11640247B2 (en) Providing service address space for diagnostics collection
CN110413676B (en) Database access method and device, electronic equipment and medium
US20170163691A1 (en) Methods, circuits, apparatus, systems and associated software applications for providing security on one or more servers, including virtual servers
KR20190136912A (en) Method and apparatus for operating on smart network interface card
CN114884796B (en) Fault processing method and device, electronic equipment and storage medium
CN114244700B (en) Port processing method and device, electronic equipment and computer readable storage medium
US9167052B2 (en) Apparatus, systems, and methods for providing policy in network-based applications
CN114257632B (en) Method and device for reconnecting broken wire, electronic equipment and readable storage medium
CN116302561A (en) State control method, device, equipment and storage medium for application instance
CN115934378A (en) Service data processing method and device, electronic equipment and storage medium
CN112953769B (en) Data transmission method, device, computer system and readable storage medium
CN110751560B (en) Transaction processing method and device, electronic equipment and readable storage medium
CN109474478B (en) Method, device and system for monitoring transmission data abnormity
CN112711499A (en) Unified backup management system and method based on cloud platform
CN111008041A (en) Command processing method and device for host, electronic equipment and storage medium
CN114826886B (en) Disaster recovery method and device for application software and electronic equipment
CN114640585B (en) Resource updating method and device, electronic equipment and storage medium
CN116133058A (en) Session establishment method, system, device, equipment and storage medium
CN114546290A (en) Block storage management method, device, equipment and storage medium
CN115664921A (en) WEB-based network switching equipment management system and method and electronic equipment
CN112953783A (en) Satellite link state detection method, device, server and storage medium
CN115115214A (en) Business process exception handling method and device, electronic equipment and storage medium
CN116319765A (en) Cloud desktop connection method and related equipment thereof
CN115134237A (en) Data updating method, heartbeat detection method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant