Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
CN113965500B - Method, equipment and medium for managing port occupation of serial server - Google Patents
[go: Go Back, main page]

CN113965500B - Method, equipment and medium for managing port occupation of serial server - Google Patents

Method, equipment and medium for managing port occupation of serial server Download PDF

Info

Publication number
CN113965500B
CN113965500B CN202111095085.2A CN202111095085A CN113965500B CN 113965500 B CN113965500 B CN 113965500B CN 202111095085 A CN202111095085 A CN 202111095085A CN 113965500 B CN113965500 B CN 113965500B
Authority
CN
China
Prior art keywords
port
server
serial
occupied
serial port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111095085.2A
Other languages
Chinese (zh)
Other versions
CN113965500A (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.)
Inspur Network Technology Shandong Co ltd
Original Assignee
Inspur Cisco Networking 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 Inspur Cisco Networking Technology Co Ltd filed Critical Inspur Cisco Networking Technology Co Ltd
Priority to CN202111095085.2A priority Critical patent/CN113965500B/en
Publication of CN113965500A publication Critical patent/CN113965500A/en
Application granted granted Critical
Publication of CN113965500B publication Critical patent/CN113965500B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

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

Abstract

本申请公开了一种串口服务器端口占用管理方法、设备及介质,方法包括:确定串口服务器的第一IP地址;根据第一IP地址确定串口服务器的查询接口;通过查询接口对串口服务器进行查询,确定串口服务器的活动TCP连接信息;活动TCP连接信息用于表示串口服务器的端口占用信息;根据活动TCP连接信息,对串口服务器对应的端口进行占用,以通过对应的端口将待测试交换机与串口服务器进行连接。本申请实施例在交换机的测试环境中,通过串口服务器的活动TCP信息,能够对串口服务器的端口资源进行管理,使得用户得知串口服务器端口占用情况,由软件系统查询方式代替人工查询,查询方式简单并且查询速度快,提高测试效率。

Figure 202111095085

The present application discloses a serial server port occupation management method, equipment and medium. The method includes: determining the first IP address of the serial server; determining the query interface of the serial server according to the first IP address; querying the serial server through the query interface, Determine the active TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server; according to the active TCP connection information, the corresponding port of the serial port server is occupied, so as to connect the switch to be tested with the serial port server through the corresponding port to connect. In the test environment of the switch, the embodiment of the present application can manage the port resources of the serial server through the active TCP information of the serial server, so that the user can know the port occupancy of the serial server, and the manual query is replaced by the software system query method. Simple and fast query speed, improving test efficiency.

Figure 202111095085

Description

一种串口服务器端口占用管理方法、设备及介质A serial port server port occupation management method, equipment and medium

技术领域technical field

本申请涉及软件系统技术领域,尤其涉及一种串口服务器端口占用管理方法、设备及介质。The present application relates to the technical field of software systems, and in particular to a serial server port occupancy management method, equipment and media.

背景技术Background technique

在交换机的测试环境中,往往要用到串口服务器来远程管理交换机,用户对交换机进行测试时,将交换机的串口连接到串口服务器的端口上之后,用户就可以在计算机设备上通过TCP/IP(Transmission Control Protocol/Internet Protocol,传输控制协议/网际协议)网络来远程管理待测试交换机。In the test environment of the switch, it is often necessary to use a serial server to remotely manage the switch. When the user tests the switch, after connecting the serial port of the switch to the port of the serial server, the user can use the TCP/IP ( Transmission Control Protocol/Internet Protocol, Transmission Control Protocol/Internet Protocol) network to remotely manage the switch to be tested.

目前,通过人工方式去询问串口服务器的端口占用情况,并且询问之后已占用端口的用户不一定会及时回应或者有时根本不会回应,影响测试工作的执行,导致测试效率低下。At present, the port occupancy status of the serial port server is manually inquired, and the users who have occupied the port after the inquiry may not respond in time or sometimes at all, which affects the execution of the test work and leads to low test efficiency.

发明内容Contents of the invention

本申请实施例提供一种串口服务器端口占用管理方法、设备及介质,用于解决在交换机的测试环境中,测试效率低的问题。The embodiment of the present application provides a serial port server port occupation management method, equipment and medium, which are used to solve the problem of low test efficiency in the test environment of the switch.

本申请实施例采用下述技术方案:The embodiment of the application adopts the following technical solutions:

一方面,本申请实施例提供了一种串口服务器端口占用管理方法,该方法包括:确定串口服务器的第一网际互连协议IP地址;根据所述第一IP地址确定所述串口服务器的查询接口;通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动传输控制协议TCP连接信息;所述活动TCP连接信息用于表示所述串口服务器的端口占用信息;根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接。On the one hand, the embodiment of the present application provides a method for managing port occupancy of a serial port server, the method comprising: determining a first Internet Protocol IP address of the serial port server; determining a query interface of the serial port server according to the first IP address ; query the serial port server through the query interface to determine the active transmission control protocol TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server; according to the activity The TCP connection information occupies the port corresponding to the serial port server, so as to connect the switch to be tested with the serial port server through the corresponding port.

一个示例中,所述根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,具体包括:根据所述活动TCP连接信息,生成活动TCP连接信息表;根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表;所述第一端口映射表用于表示所述串口服务器的端口是否被占用;根据所述第一端口映射表,生成所述串口服务器的第二端口映射表;所述第一端口映射表用于表示所述串口服务器的端口占用者;通过所述第二端口映射表,对所述串口服务器对应的端口进行占用。In an example, the occupying the port corresponding to the serial port server according to the active TCP connection information specifically includes: generating an active TCP connection information table according to the active TCP connection information; table to generate the first port mapping table of the serial port server; the first port mapping table is used to indicate whether the port of the serial port server is occupied; according to the first port mapping table, generate the first port mapping table of the serial port server Two port mapping tables; the first port mapping table is used to represent the port occupants of the serial port server; the port corresponding to the serial port server is occupied through the second port mapping table.

一个示例中,所述根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表,具体包括:确定所述串口服务器预先设置的端口映射模板;根据所述活动TCP连接信息表,确定所述串口服务器的被占用端口以及占用所述被占用端口的第二IP地址;在所述端口映射模板中,根据TCP端口号检索所述被占用端口,确定所述被占用端口对应的位置;根据所述被占用端口对应的位置,确定所述第二IP地址对应的位置;将所述第二IP地址写入所述第二IP地址对应的位置,以生成所述串口服务器的第一端口映射表。In an example, the generating the first port mapping table of the serial port server according to the active TCP connection information table specifically includes: determining the port mapping template preset by the serial port server; according to the active TCP connection information table , determine the occupied port of the serial port server and the second IP address occupying the occupied port; in the port mapping template, retrieve the occupied port according to the TCP port number, and determine the corresponding IP address of the occupied port position; according to the position corresponding to the occupied port, determine the position corresponding to the second IP address; write the second IP address into the position corresponding to the second IP address to generate the first serial port server A port mapping table.

一个示例中,所述根据所述第一端口映射表,生成所述串口服务器的第二端口映射表,具体包括:在所述第一端口映射表中,对所述第二IP地址进行解析,确定所述第二IP地址对应的主机名;通过所述主机名确定所述第二IP地址对应的用户名,以生成所述串口服务器的第二端口映射表。In an example, the generating the second port mapping table of the serial port server according to the first port mapping table specifically includes: parsing the second IP address in the first port mapping table, Determining a host name corresponding to the second IP address; determining a user name corresponding to the second IP address through the host name, so as to generate a second port mapping table of the serial port server.

一个示例中,所述通过所述第二端口映射表,对所述串口服务器对应的端口进行占用,具体包括:确定所述串口服务器的指定占用端口;在所述第二端口映射表中,判断所述指定占用端口是否被占用;若否,则对所述指定占用端口进行占用。In an example, the occupying the port corresponding to the serial port server through the second port mapping table specifically includes: determining the designated occupied port of the serial port server; in the second port mapping table, judging Whether the designated occupied port is occupied; if not, occupy the designated occupied port.

一个示例中,所述判断所述指定占用端口是否被占用,具体包括:判断所述指定占用端口是否被占用;若是,判断所述串口服务器是否具有空闲端口;若是,则对所述指定占用端口进行占用。In an example, the judging whether the designated occupied port is occupied specifically includes: judging whether the designated occupied port is occupied; if so, judging whether the serial port server has an idle port; to occupy.

一个示例中,所述判断所述指定占用端口是否被占用,具体包括:判断所述指定占用端口是否被占用;所述指定占用端口为必须占用端口;若是,则确定所述指定占用端口对应的占用者;通过用户向所述占用者发送消息进行沟通,以确定是否能够对所述指定占用端口进行占用。In an example, the judging whether the designated occupied port is occupied specifically includes: judging whether the designated occupied port is occupied; the designated occupied port is a port that must be occupied; if so, determining the corresponding The occupant: the user sends a message to the occupant for communication, so as to determine whether the designated occupied port can be occupied.

一个示例中,所述判断所述串口服务器是否具有空闲端口,具体包括:判断所述串口服务器是否具有空闲端口;若否,则判断其他串口服务器是否具有对应的空闲端口;若是,则对所述对应的空闲端口进行占用。In an example, the judging whether the serial port server has an idle port specifically includes: judging whether the serial port server has an idle port; if not, then judging whether other serial port servers have corresponding idle ports; The corresponding free port is occupied.

另一方面,本申请实施例提供了一种串口服务器端口占用管理设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:确定串口服务器的第一IP地址;根据所述第一IP地址确定所述串口服务器的查询接口;通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动传输控制协议TCP连接信息;所述活动TCP连接信息用于表示所述串口服务器的端口占用信息;根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接。On the other hand, the embodiment of the present application provides a serial port server port occupancy management device, including: at least one processor; and a memory connected to the at least one processor in communication; Instructions executed by the at least one processor, the instructions are executed by the at least one processor, so that the at least one processor can: determine the first IP address of the serial port server; determine the The query interface of the serial port server; the serial port server is queried through the query interface to determine the active transmission control protocol TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server ; According to the active TCP connection information, occupy the port corresponding to the serial port server, so as to connect the switch to be tested with the serial port server through the corresponding port.

另一方面,本申请实施例提供了一种串口服务器端口占用管理非易失性计算机存储介质,存储有计算机可执行指令,其特征在于,所述计算机可执行指令设置为:确定串口服务器的第一IP地址;根据所述第一IP地址确定所述串口服务器的查询接口;通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动传输控制协议TCP连接信息;所述活动TCP连接信息用于表示所述串口服务器的端口占用信息;根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接。On the other hand, an embodiment of the present application provides a non-volatile computer storage medium for port occupation management of a serial port server, which stores computer-executable instructions, wherein the computer-executable instructions are set to: determine the first port of the serial port server An IP address; determine the query interface of the serial server according to the first IP address; query the serial server through the query interface, and determine the active transmission control protocol TCP connection information of the serial server; the activity The TCP connection information is used to represent the port occupancy information of the serial port server; according to the active TCP connection information, the port corresponding to the serial port server is occupied, so as to connect the switch to be tested with the serial port server through the corresponding port to connect.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:The above at least one technical solution adopted in the embodiment of the present application can achieve the following beneficial effects:

在交换机的测试环境中,通过串口服务器的活动TCP信息,能够对串口服务器的端口资源进行管理,使得用户得知串口服务器端口占用情况,对串口服务器对应的端口进行占用,并通过对应的端口将待测试交换机与串口服务器进行连接,由软件系统查询方式代替人工查询,查询方式简单并且查询速度快,提高测试效率。In the test environment of the switch, through the active TCP information of the serial port server, the port resources of the serial port server can be managed, so that the user can know the port occupancy of the serial port server, occupy the corresponding port of the serial port server, and pass the corresponding port. The switch to be tested is connected to the serial port server, and the manual query is replaced by the software system query method. The query method is simple and the query speed is fast, which improves the test efficiency.

附图说明Description of drawings

为了更清楚地说明本申请的技术方案,下面将结合附图来对本申请的部分实施例进行详细说明,附图中:In order to illustrate the technical solution of the present application more clearly, some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the accompanying drawings:

图1为本申请实施例提供的一种串口服务器端口占用管理系统的框架示意图;Fig. 1 is the frame diagram of a kind of serial port server port occupancy management system provided by the embodiment of the present application;

图2为本申请实施例提供的一种串口服务器端口占用管理方法的流程示意图;FIG. 2 is a schematic flow diagram of a serial port server port occupancy management method provided by an embodiment of the present application;

图3为本申请实施例提供的一种串口服务器端口占用管理设备的结构示意图。FIG. 3 is a schematic structural diagram of a serial port server port occupancy management device provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合具体实施例及相应的附图对本申请的技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

在交换机测试环境中,用户对交换机进行测试时,将交换机的串口连接到串口服务器的端口上之后,用户就可以在计算机设备上通过TCP/IP网络来远程管理待测试交换机。In the switch test environment, when the user tests the switch, after connecting the serial port of the switch to the port of the serial port server, the user can remotely manage the switch to be tested on the computer device through the TCP/IP network.

一般情况下,交换机测试环境中有多个串口服务器,一个串口服务器上有多个端口,多个用户共享使用所有串口服务器的端口。但是,由于串口服务器上没有办法直接查询到每个端口的占用情况,导致当某个用户想使用串口服务器上的指定端口时,查询不到指定端口是否被占用。Generally, there are multiple serial servers in the switch test environment, and there are multiple ports on one serial server, and multiple users share the ports of all serial servers. However, since there is no way to directly query the occupancy of each port on the serial port server, when a user wants to use a designated port on the serial port server, he cannot query whether the designated port is occupied.

目前,通过人工方式去询问串口服务器的端口占用情况效率低下,并且询问之后已占用端口的用户不一定会及时回应或者有时根本不会回应。因此,为了解决以上问题,本申请提供了一种串口服务器端口占用管理方法、设备及介质。At present, it is inefficient to manually inquire about the port occupancy of the serial port server, and the user who has already occupied the port may not respond in time or sometimes at all after inquiring. Therefore, in order to solve the above problems, the present application provides a serial port server port occupancy management method, device and medium.

其中,串口服务器提供串口转网络功能,能够将RS-232/485/422串口转换成TCP/IP协议网络接口,实现RS-232/485/422串口与TCP/IP协议网络接口的数据双向透明传输,或者支持MODBUS协议双向传输。Among them, the serial port server provides the serial port to network function, which can convert the RS-232/485/422 serial port into a TCP/IP protocol network interface, and realize the two-way transparent transmission of data between the RS-232/485/422 serial port and the TCP/IP protocol network interface , or support MODBUS protocol bidirectional transmission.

下面参照附图来对本申请的一些实施例进行详细说明。Some embodiments of the present application will be described in detail below with reference to the accompanying drawings.

图1为本申请实施例提供的一种串口服务器端口占用管理系统的框架示意图。FIG. 1 is a schematic framework diagram of a serial port server port occupancy management system provided by an embodiment of the present application.

如图1所示,串口服务器端口占用管理系统至少包括:串口服务器、与串口服务器连接的若干计算机设备,与串口服务器连接的若干待测试交换机,其中,串口服务器包括查询接口、若干端口。As shown in Figure 1, the serial server port occupancy management system at least includes: a serial server, some computer equipment connected to the serial server, and some switches to be tested connected to the serial server, wherein the serial server includes a query interface and several ports.

若干计算机设备设置于办公区内,并且各计算机设备都有自己的IP地址和主机名,串口服务器和若干待测试交换机设置于机房内。其中,办公区与机房通过路由互联进行通信。A number of computer devices are installed in the office area, and each computer device has its own IP address and host name, and a serial port server and a number of switches to be tested are installed in the computer room. Among them, the office area and the computer room communicate through router interconnection.

需要说明的是,图1中只示出了一个串口服务器,实际上能够包括若干串口服务器,可以根据实际需要进行设置,在此不作具体限定。It should be noted that only one serial port server is shown in FIG. 1 , but actually several serial port servers can be included, which can be set according to actual needs, and are not specifically limited here.

具体地,当用户在计算机设备上的串口服务器端口占用管理系统输入串口服务器的第一IP地址时,例如,输入“172.16.1.1”。Specifically, when the user enters the first IP address of the serial server in the serial server port occupancy management system on the computer equipment, for example, input "172.16.1.1".

然后,计算机设备根据第一IP地址确定串口服务器的查询接口,用串口服务器提供的查询接口去查询串口服务器的活动TCP连接信息。其中,活动TCP连接信息用于表示串口服务器的端口占用信息。Then, the computer device determines the query interface of the serial server according to the first IP address, and uses the query interface provided by the serial server to query the active TCP connection information of the serial server. Wherein, the active TCP connection information is used to represent the port occupation information of the serial port server.

最后,计算机设备通过活动TCP连接信息查询到的串口服务器的端口占用信息,对串口服务器对应的端口进行占用,从而将待测试交换机与串口服务器进行连接。Finally, the computer equipment queries the port occupancy information of the serial port server through the active TCP connection information, and occupies the port corresponding to the serial port server, thereby connecting the switch to be tested with the serial port server.

接下来继续阐述说明本申请实施例具体如何将待测试交换机与所述串口服务器进行连接,如图2所示。Next, continue to explain how to connect the switch to be tested with the serial port server in the embodiment of the present application, as shown in FIG. 2 .

图2为本申请实施例提供的一种串口服务器端口占用管理方法的流程示意图,应用于图1中的串口服务器占用管理系统。FIG. 2 is a schematic flowchart of a serial server port occupancy management method provided by an embodiment of the present application, which is applied to the serial server occupation management system in FIG. 1 .

本申请实施例涉及的分析方法的实现可以为计算机设备,也可以为服务器,本申请对此不作特殊限制。为了方便理解和描述,以下实施例均以计算机设备为例进行详细描述。The analysis method involved in the embodiment of the present application may be implemented as a computer device or as a server, which is not particularly limited in this application. For the convenience of understanding and description, the following embodiments are described in detail by taking computer equipment as an example.

图2中的流程可以包括以下步骤:The process in Figure 2 may include the following steps:

S201:确定串口服务器的第一IP地址。S201: Determine the first IP address of the serial port server.

在本申请的一些实施例中,用户在串口服务器端口占用管理系统中输入待查询的串口服务器的第一IP地址,从而计算机设备能够确定串口服务器的第一IP地址。In some embodiments of the present application, the user inputs the first IP address of the serial server to be queried in the serial server port occupancy management system, so that the computer device can determine the first IP address of the serial server.

S202:根据第一IP地址确定串口服务器的查询接口。S202: Determine the query interface of the serial port server according to the first IP address.

其中,查询接口用于计算机设备与串口服务器进行通信。Among them, the query interface is used for communication between the computer equipment and the serial port server.

S203:通过查询接口对串口服务器进行查询,确定串口服务器的活动TCP连接信息。S203: Query the serial port server through the query interface, and determine the active TCP connection information of the serial port server.

其中,当计算机设备占用串口服务器的端口后,在串口服务器上可以查到该端口的活动TCP连接信息,如果端口没有被占用,则在活动TCP连接信息中查询不到。Wherein, after the computer equipment occupies the port of the serial port server, the active TCP connection information of the port can be found on the serial port server, if the port is not occupied, then the active TCP connection information cannot be found.

S204:根据活动TCP连接信息,对串口服务器对应的端口进行占用,以通过对应的端口将待测试交换机与串口服务器进行连接。S204: Occupy the port corresponding to the serial port server according to the active TCP connection information, so as to connect the switch to be tested with the serial port server through the corresponding port.

在本申请的一些实施例中,计算机设备通过活动TCP连接信息,生成活动TCP连接信息表。In some embodiments of the present application, the computer device generates an active TCP connection information table through the active TCP connection information.

其中,活动TCP连接信息中携带了串口服务器的第一IP地址、被占用端口的TCP端口号、占用被占用端口对应计算机设备的第二IP地址。比如,活动TCP连接信息表,如表1所示。Wherein, the active TCP connection information carries the first IP address of the serial port server, the TCP port number of the occupied port, and the second IP address of the computer device corresponding to the occupied port. For example, the active TCP connection information table is shown in Table 1.

表1Table 1

Local AddressLocal Address Foreign AddressForeign Address StateState 172.16.1.1:10001172.16.1.1:10001 10.1.1.11:6001910.1.1.11:60019 ESTABLISHEDESTABLISHED 172.16.1.1:10002172.16.1.1:10002 10.1.1.12:6002410.1.1.12:60024 ESTABLISHEDESTABLISHED 172.16.1.1:10016172.16.1.1:10016 10.1.1.13:323310.1.1.13:3233 ESTABLISHEDESTABLISHED

在表1中,Local Address中携带了串口服务器的第一IP地址和TCP端口号,Foreign Address中携带了计算机设备的第二IP地址和TCP端口号。In Table 1, the Local Address carries the first IP address and TCP port number of the serial port server, and the Foreign Address carries the second IP address and TCP port number of the computer device.

串口服务器建TCP连接时,串口服务器的TCP端口号生成规则是“10000+物理端口号”,所以Local Address中10001对应端口1,10002对端口2,以此类推,如果串口服务器的端口在Local Address中没有,则表明该端口没有被任何计算机设备占用。When the serial server establishes a TCP connection, the TCP port number generation rule of the serial server is "10000+physical port number", so 10001 in the Local Address corresponds to port 1, 10002 corresponds to port 2, and so on. If the port of the serial server is in the Local Address If not, it means that the port is not occupied by any computer equipment.

进一步地,计算机设备根据活动TCP连接信息表,生成串口服务器的第一端口映射表,第一端口映射表用于表示串口服务器的端口是否被占用。Further, the computer device generates a first port mapping table of the serial port server according to the active TCP connection information table, and the first port mapping table is used to indicate whether the port of the serial port server is occupied.

其中,计算机设备确定串口服务器预先设置的端口映射模板,然后根据活动TCP连接信息表,确定串口服务器的被占用端口以及占用被占用端口的第二IP地址,在端口映射模板中,根据TCP端口号检索被占用端口,确定被占用端口对应的位置,根据被占用端口对应的位置,确定第二IP地址对应的位置,将第二IP地址写入第二IP地址对应的位置,以生成串口服务器的第一端口映射表。比如,第一端口映射表,如表2所示。Wherein, the computer device determines the port mapping template preset by the serial port server, and then determines the occupied port of the serial port server and the second IP address occupying the occupied port according to the active TCP connection information table. In the port mapping template, according to the TCP port number Retrieve the occupied port, determine the position corresponding to the occupied port, determine the position corresponding to the second IP address according to the position corresponding to the occupied port, write the second IP address into the position corresponding to the second IP address, to generate the serial port server The first port mapping table. For example, the first port mapping table is shown in Table 2.

表2:Table 2:

Figure BDA0003268808620000071
Figure BDA0003268808620000071

Figure BDA0003268808620000081
Figure BDA0003268808620000081

其中,在端口映射模板中,TCP端口号与第二IP地址中的值,是空的。然后计算机设备在活动TCP信息表中提取TCP端口号与第二IP地址的值,补全端口映射模板中的TCP端口号与第二IP地址中的值。即,若有TCP端口号在活动TCP信息表中,则提取对应的第二IP地址填入端口映射模板中的第二IP地址列中,TCP端口号不在活动TCP信息表中,则填写NA,表明该端口没有任何计算机设备占用。Wherein, in the port mapping template, the values in the TCP port number and the second IP address are empty. Then the computer device extracts the values of the TCP port number and the second IP address from the active TCP information table, and completes the values of the TCP port number and the second IP address in the port mapping template. That is, if there is a TCP port number in the active TCP information table, then extract the corresponding second IP address and fill in the second IP address column in the port mapping template, if the TCP port number is not in the active TCP information table, then fill in NA, Indicates that the port is not occupied by any computer equipment.

更进一步地,计算机设备根据第一端口映射表,生成串口服务器的第二端口映射表,第二端口映射表用于表示串口服务器的端口占用者。Furthermore, the computer device generates a second port mapping table of the serial port server according to the first port mapping table, and the second port mapping table is used to represent the port occupants of the serial port server.

其中,计算机设备在第一端口映射表中,对第二IP地址进行解析,确定第二IP地址对应的主机名,通过主机名确定第二IP地址对应的用户名,其中,解析出来的用户名就是端口占用者,用户名与主机名可以保持一致,即,用户名就是主机名,以生成串口服务器的第二端口映射表。比如,第二端口映射表,如表3所示。Wherein, the computer device analyzes the second IP address in the first port mapping table, determines the host name corresponding to the second IP address, and determines the user name corresponding to the second IP address through the host name, wherein the resolved user name It is the port occupant, the user name and the host name can be consistent, that is, the user name is the host name, so as to generate the second port mapping table of the serial port server. For example, the second port mapping table is shown in Table 3.

Figure BDA0003268808620000082
Figure BDA0003268808620000082

计算机设备在第一端口映射表中,根据每行的第二IP地址的值解析对应的主机名,将主机名填写到对应的“用户名”列中,如果第二IP地址为“NA”则不作任何处理。In the first port mapping table, the computer device resolves the corresponding host name according to the value of the second IP address in each row, and fills in the host name in the corresponding "User Name" column, if the second IP address is "NA" then Do nothing.

更进一步地,计算机设备将第二端口映射表进行打印,进行可视化展示,从而用户从计算机设备输出的第二端口映射表中,能够了解串口服务器每个端口的占用情况。Furthermore, the computer device prints the second port mapping table for visual display, so that the user can know the occupancy of each port of the serial server from the second port mapping table output by the computer device.

更进一步地,计算机设备通过第二端口映射表,对串口服务器对应的端口进行占用。Furthermore, the computer device occupies the port corresponding to the serial port server through the second port mapping table.

其中,计算机设备确定串口服务器的指定占用端口,然后在第二端口映射表中,判断指定占用端口是否被占用,若否,则对指定占用端口进行占用。Wherein, the computer device determines the designated occupied port of the serial port server, and then judges whether the designated occupied port is occupied in the second port mapping table, and if not, occupies the designated occupied port.

若是,判断串口服务器是否具有空闲端口,若是,则对指定占用端口进行占用。若否,则重复执行步骤S101-105,查询其它串口服务器的端口占用情况,直到找到一个空闲端口并占用。If so, judge whether the serial port server has an idle port, and if so, occupy the designated occupied port. If not, repeat steps S101-105 to query the port occupancy of other serial port servers until an idle port is found and occupied.

此外,若指定占用端口为必须占用端口,则确定指定占用端口对应的占用者,通过向占用者发送消息进行沟通,以确定是否能够对指定占用端口进行占用。In addition, if the designated occupied port is a port that must be occupied, the occupant corresponding to the designated occupied port is determined and communicated by sending a message to the occupant to determine whether the designated occupied port can be occupied.

即,某些特殊情况下必须占用该端口但是该端口已经被占用的,通过串口服务器端口占用管理系统查询到占用该端口的计算机设备的用户后,用户能够通过串口服务器端口占用管理系统向占用该端口的计算机设备的用户发送消息进行沟通,经沟通决定由谁来使用当前端口。That is, if the port must be occupied under some special circumstances but the port is already occupied, after the user of the computer equipment occupying the port is inquired through the serial port server port occupation management system, the user can request the user to occupy the port through the serial port server port occupation management system. The users of the computer equipment on the port send messages to communicate, and through the communication, it is decided who will use the current port.

需要说明的是,虽然本申请实施例是参照图2来对步骤S201至步骤S204依次进行介绍说明的,但这并不代表步骤S201至步骤S204必须按照严格的先后顺序执行。本申请实施例之所以按照图2中所示的顺序对步骤S201至步骤S204依次进行介绍说明,是为了方便本领域技术人员理解本申请实施例的技术方案。换句话说,在本申请实施例中,步骤S201至步骤S204之间的先后顺序可以根据实际需要进行适当调整。It should be noted that although the embodiment of the present application describes step S201 to step S204 sequentially with reference to FIG. 2 , this does not mean that step S201 to step S204 must be executed in strict order. The reason why the embodiment of the present application sequentially introduces step S201 to step S204 according to the sequence shown in FIG. 2 is to facilitate the understanding of the technical solution of the embodiment of the present application by those skilled in the art. In other words, in the embodiment of the present application, the order of steps S201 to S204 may be adjusted appropriately according to actual needs.

通过图2的方法,在交换机的测试环境中,通过串口服务器的活动TCP信息,获取占用端口的第二IP地址,然后根据第二IP地址解析主机名,最后输出第二端口映射表,能够使得用户得知串口服务器端口占用情况,可以对串口服务器的端口资源进行管理,可以查询端口是否被占用以及谁在占用,由软件系统查询方式代替人工查询,查询方式简单并且查询速度快,同时,当多个用户想占用同一个端口时,能够使得用户之间发送消息进行沟通解决端口冲突问题,从而提高了测试效率。By the method of Fig. 2, in the test environment of the switch, through the active TCP information of the serial port server, obtain the second IP address of the occupied port, then resolve the host name according to the second IP address, and finally output the second port mapping table, which can make The user knows the port occupancy of the serial port server, can manage the port resources of the serial port server, can query whether the port is occupied and who is occupying it, and the manual query is replaced by the software system query method. The query method is simple and the query speed is fast. At the same time, when When multiple users want to occupy the same port, users can send messages to communicate with each other to solve the port conflict problem, thereby improving the test efficiency.

基于同样的思路,本申请的一些实施例还提供了上述方法对应的设备和非易失性计算机存储介质。Based on the same idea, some embodiments of the present application also provide devices and non-volatile computer storage media corresponding to the above methods.

图3为本申请实施例提供的一种串口服务器端口占用管理设备的结构示意图,包括:Fig. 3 is a schematic structural diagram of a serial port server port occupancy management device provided by the embodiment of the present application, including:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to:

确定串口服务器的第一网际互连协议IP地址;Determine the first Internet Protocol IP address of the serial port server;

根据第一IP地址确定串口服务器的查询接口;Determine the query interface of the serial port server according to the first IP address;

通过查询接口对串口服务器进行查询,确定串口服务器的活动传输控制协议TCP连接信息;活动TCP连接信息用于表示串口服务器的端口占用信息;Query the serial port server through the query interface to determine the active transmission control protocol TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupation information of the serial port server;

根据活动TCP连接信息,对串口服务器对应的端口进行占用,以通过对应的端口将待测试交换机与串口服务器进行连接。According to the active TCP connection information, the port corresponding to the serial port server is occupied, so as to connect the switch to be tested with the serial port server through the corresponding port.

本申请的一些实施例提供的一种串口服务器端口占用管理非易失性计算机存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为:Some embodiments of the present application provide a serial port server port occupancy management non-volatile computer storage medium, which stores computer-executable instructions, and the computer-executable instructions are set to:

确定串口服务器的第一网际互连协议IP地址;Determine the first Internet Protocol IP address of the serial port server;

根据第一IP地址确定串口服务器的查询接口;Determine the query interface of the serial port server according to the first IP address;

通过查询接口对串口服务器进行查询,确定串口服务器的活动传输控制协议TCP连接信息;活动TCP连接信息用于表示串口服务器的端口占用信息;Query the serial port server through the query interface to determine the active transmission control protocol TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupation information of the serial port server;

根据活动TCP连接信息,对串口服务器对应的端口进行占用,以通过对应的端口将待测试交换机与串口服务器进行连接。According to the active TCP connection information, the port corresponding to the serial port server is occupied, so as to connect the switch to be tested with the serial port server through the corresponding port.

本申请中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备和介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in the present application is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiments.

本申请实施例提供的设备和介质与方法是一一对应的,因此,设备和介质也具有与其对应的方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述设备和介质的有益技术效果。The devices and media provided in the embodiments of the present application correspond to the methods one by one, therefore, the devices and media also have beneficial technical effects similar to their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, therefore, The beneficial technical effects of the equipment and media will not be repeated here.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请技术原理之内所作的任何修改、等同替换、改进等,均应落入本申请的保护范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modifications, equivalent replacements, improvements, etc. made within the technical principles of this application shall fall within the protection scope of this application.

Claims (9)

1.一种串口服务器端口占用管理方法,其特征在于,所述方法包括:1. A serial port server port occupation management method is characterized in that, the method comprises: 确定串口服务器的第一网际互连协议IP地址;Determine the first Internet Protocol IP address of the serial port server; 根据第一IP地址确定所述串口服务器的查询接口;Determine the query interface of the serial port server according to the first IP address; 通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动传输控制协议TCP连接信息;活动TCP连接信息用于表示所述串口服务器的端口占用信息;Querying the serial port server through the query interface to determine the active transmission control protocol TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server; 根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接;Occupy the port corresponding to the serial server according to the active TCP connection information, so as to connect the switch to be tested with the serial server through the corresponding port; 所述根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,具体包括:According to the active TCP connection information, the port corresponding to the serial port server is occupied, specifically including: 根据所述活动TCP连接信息,生成活动TCP连接信息表;Generate an active TCP connection information table according to the active TCP connection information; 根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表;所述第一端口映射表用于表示所述串口服务器的端口是否被占用;Generate the first port mapping table of the serial port server according to the active TCP connection information table; the first port mapping table is used to indicate whether the port of the serial port server is occupied; 根据所述第一端口映射表,生成所述串口服务器的第二端口映射表;所述第二端口映射表用于表示所述串口服务器的端口占用者;Generate a second port mapping table of the serial port server according to the first port mapping table; the second port mapping table is used to represent the port occupant of the serial port server; 通过所述第二端口映射表,对所述串口服务器对应的端口进行占用。Occupy the port corresponding to the serial port server through the second port mapping table. 2.根据权利要求1所述的方法,其特征在于,所述根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表,具体包括:2. The method according to claim 1, wherein the first port mapping table of the serial port server is generated according to the active TCP connection information table, specifically comprising: 确定所述串口服务器预先设置的端口映射模板;Determine the port mapping template preset by the serial port server; 根据所述活动TCP连接信息表,确定所述串口服务器的被占用端口以及占用所述被占用端口的第二IP地址;According to the active TCP connection information table, determine the occupied port of the serial port server and the second IP address occupying the occupied port; 在所述端口映射模板中,根据TCP端口号检索所述被占用端口,确定所述被占用端口对应的位置;In the port mapping template, retrieve the occupied port according to the TCP port number, and determine the position corresponding to the occupied port; 根据所述被占用端口对应的位置,确定所述第二IP地址对应的位置;Determine the location corresponding to the second IP address according to the location corresponding to the occupied port; 将所述第二IP地址写入所述第二IP地址对应的位置,以生成所述串口服务器的第一端口映射表。Writing the second IP address into a position corresponding to the second IP address to generate a first port mapping table of the serial port server. 3.根据权利要求2所述的方法,其特征在于,所述根据所述第一端口映射表,生成所述串口服务器的第二端口映射表,具体包括:3. The method according to claim 2, wherein the generating the second port mapping table of the serial port server according to the first port mapping table specifically includes: 在所述第一端口映射表中,对所述第二IP地址进行解析,确定所述第二IP地址对应的主机名;In the first port mapping table, the second IP address is analyzed to determine the host name corresponding to the second IP address; 通过所述主机名确定所述第二IP地址对应的用户名,以生成所述串口服务器的第二端口映射表。A user name corresponding to the second IP address is determined through the host name, so as to generate a second port mapping table of the serial port server. 4.根据权利要求1所述的方法,其特征在于,所述通过所述第二端口映射表,对所述串口服务器对应的端口进行占用,具体包括:4. The method according to claim 1, wherein the occupying the port corresponding to the serial port server through the second port mapping table specifically includes: 确定所述串口服务器的指定占用端口;Determine the specified occupied port of the serial port server; 在所述第二端口映射表中,判断所述指定占用端口是否被占用;In the second port mapping table, it is judged whether the specified occupied port is occupied; 若否,则对所述指定占用端口进行占用。If not, occupy the specified occupied port. 5.根据权利要求4所述的方法,其特征在于,所述判断所述指定占用端口是否被占用,具体包括:5. The method according to claim 4, wherein the judging whether the designated occupied port is occupied specifically comprises: 判断所述指定占用端口是否被占用;judging whether the designated occupied port is occupied; 若是,判断所述串口服务器是否具有空闲端口;If so, determine whether the serial port server has an idle port; 若是,则对所述指定占用端口进行占用。If yes, occupy the designated occupied port. 6.根据权利要求5所述的方法,其特征在于,所述判断所述指定占用端口是否被占用,具体包括:6. The method according to claim 5, wherein the judging whether the designated occupied port is occupied specifically comprises: 判断所述指定占用端口是否被占用;所述指定占用端口为必须占用端口;judging whether the designated occupied port is occupied; the designated occupied port is a must occupied port; 若是,则确定所述指定占用端口对应的占用者;If so, then determine the occupant corresponding to the designated occupied port; 通过用户向所述占用者发送消息进行沟通,以确定是否能够对所述指定占用端口进行占用。The user sends a message to the occupant for communication to determine whether the designated occupied port can be occupied. 7.根据权利要求5所述的方法,其特征在于,所述判断所述串口服务器是否具有空闲端口,具体包括:7. The method according to claim 5, wherein said judging whether said serial port server has an idle port specifically comprises: 判断所述串口服务器是否具有空闲端口;Judging whether the serial port server has an idle port; 若否,则判断其他串口服务器是否具有对应的空闲端口;If not, then judge whether other serial port servers have corresponding idle ports; 若是,则对所述对应的空闲端口进行占用。If yes, occupy the corresponding idle port. 8.一种串口服务器端口占用管理设备,其特征在于,包括:8. A serial port server port occupancy management device, characterized in that, comprising: 至少一个处理器;以及,at least one processor; and, 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to: 确定串口服务器的第一IP地址;Determine the first IP address of the serial port server; 根据所述第一IP地址确定所述串口服务器的查询接口;determining the query interface of the serial port server according to the first IP address; 通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动TCP连接信息;所述活动TCP连接信息用于表示所述串口服务器的端口占用信息;Querying the serial port server through the query interface to determine the active TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server; 根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接;Occupy the port corresponding to the serial port server according to the active TCP connection information, so as to connect the switch to be tested with the serial port server through the corresponding port; 所述根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,具体包括:According to the active TCP connection information, the port corresponding to the serial port server is occupied, specifically including: 根据所述活动TCP连接信息,生成活动TCP连接信息表;Generate an active TCP connection information table according to the active TCP connection information; 根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表;所述第一端口映射表用于表示所述串口服务器的端口是否被占用;Generate the first port mapping table of the serial port server according to the active TCP connection information table; the first port mapping table is used to indicate whether the port of the serial port server is occupied; 根据所述第一端口映射表,生成所述串口服务器的第二端口映射表;所述第二端口映射表用于表示所述串口服务器的端口占用者;Generate a second port mapping table of the serial port server according to the first port mapping table; the second port mapping table is used to represent the port occupant of the serial port server; 通过所述第二端口映射表,对所述串口服务器对应的端口进行占用。Occupy the port corresponding to the serial port server through the second port mapping table. 9.一种串口服务器端口占用管理非易失性计算机存储介质,存储有被处理器执行的计算机可执行指令,其特征在于,所述计算机可执行指令设置为:9. A serial port server port occupies a non-volatile computer storage medium, which is stored with a computer-executable instruction executed by a processor, wherein the computer-executable instruction is set to: 确定串口服务器的第一IP地址;Determine the first IP address of the serial port server; 根据所述第一IP地址确定所述串口服务器的查询接口;determining the query interface of the serial port server according to the first IP address; 通过所述查询接口对所述串口服务器进行查询,确定所述串口服务器的活动TCP连接信息;所述活动TCP连接信息用于表示所述串口服务器的端口占用信息;Querying the serial port server through the query interface to determine the active TCP connection information of the serial port server; the active TCP connection information is used to represent the port occupancy information of the serial port server; 根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,以通过所述对应的端口将待测试交换机与所述串口服务器进行连接;Occupy the port corresponding to the serial server according to the active TCP connection information, so as to connect the switch to be tested with the serial server through the corresponding port; 所述根据所述活动TCP连接信息,对所述串口服务器对应的端口进行占用,具体包括:According to the active TCP connection information, the port corresponding to the serial port server is occupied, specifically including: 根据所述活动TCP连接信息,生成活动TCP连接信息表;Generate an active TCP connection information table according to the active TCP connection information; 根据所述活动TCP连接信息表,生成所述串口服务器的第一端口映射表;所述第一端口映射表用于表示所述串口服务器的端口是否被占用;Generate the first port mapping table of the serial port server according to the active TCP connection information table; the first port mapping table is used to indicate whether the port of the serial port server is occupied; 根据所述第一端口映射表,生成所述串口服务器的第二端口映射表;所述第二端口映射表用于表示所述串口服务器的端口占用者;Generate a second port mapping table of the serial port server according to the first port mapping table; the second port mapping table is used to represent the port occupant of the serial port server; 通过所述第二端口映射表,对所述串口服务器对应的端口进行占用。Occupy the port corresponding to the serial port server through the second port mapping table.
CN202111095085.2A 2021-09-17 2021-09-17 Method, equipment and medium for managing port occupation of serial server Active CN113965500B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111095085.2A CN113965500B (en) 2021-09-17 2021-09-17 Method, equipment and medium for managing port occupation of serial server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111095085.2A CN113965500B (en) 2021-09-17 2021-09-17 Method, equipment and medium for managing port occupation of serial server

Publications (2)

Publication Number Publication Date
CN113965500A CN113965500A (en) 2022-01-21
CN113965500B true CN113965500B (en) 2023-04-25

Family

ID=79462069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111095085.2A Active CN113965500B (en) 2021-09-17 2021-09-17 Method, equipment and medium for managing port occupation of serial server

Country Status (1)

Country Link
CN (1) CN113965500B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800652A (en) * 2010-02-04 2010-08-11 深圳市金宏威实业发展有限公司 Mode switching method and system of serial port and Ethernet and industrial Ethernet switch
KR20120029617A (en) * 2010-09-17 2012-03-27 주식회사 케이티 System for remote controlling communication equipment with communication interface conversion
US9235372B2 (en) * 2011-06-07 2016-01-12 Clearcube Technology, Inc. Zero client device with assignment of unique IP address based on MAC address
US9787671B1 (en) * 2017-01-30 2017-10-10 Xactly Corporation Highly available web-based database interface system
CN107122324B (en) * 2017-04-20 2019-11-12 新华三信息技术有限公司 A message transmission method and device
CN109302325A (en) * 2018-11-30 2019-02-01 迈普通信技术股份有限公司 Serial server, device management method and readable storage medium storing program for executing
CN112202628B (en) * 2020-09-08 2022-09-02 杭州涂鸦信息技术有限公司 WiFi module serial port protocol automatic test system and method

Also Published As

Publication number Publication date
CN113965500A (en) 2022-01-21

Similar Documents

Publication Publication Date Title
CN106982236B (en) Information processing method, device and system
US10243919B1 (en) Rule-based automation of DNS service discovery
US10193997B2 (en) Encoded URI references in restful requests to facilitate proxy aggregation
CN109936640A (en) Address allocation method and device for slave node equipment
CN105991694B (en) A method and device for implementing distributed service invocation
CN102982141A (en) Method and device for realizing distributed database agent
CN104144073A (en) Master-slave device environment deployment method and master-slave device environment deployment system
CN106936925A (en) Load-balancing method and system
CN106657180B (en) Information transmission method, device, terminal device and system for cloud service
CN110249588A (en) System and method for detecting network topology
CN107517119A (en) Virtual network detection method and device under VPC environment
CN110837499B (en) Data access processing method, device, electronic equipment and storage medium
CN115250206B (en) Shared risk warning method and electronic equipment
CN103440345B (en) Distributed database extension method and distributed database extension system based on relational database
CN107154959A (en) A kind of method and apparatus of the access network address
CN112527453A (en) Virtualization information simulation system, method and computer-readable storage medium
CN115174398A (en) Network equipment configuration method, equipment and medium based on python interactive shell
CN114371914A (en) Container IP address configuration method and device, storage medium and electronic equipment
CN112532666B (en) Reverse proxy method, device, storage medium and equipment
CN113965500B (en) Method, equipment and medium for managing port occupation of serial server
CN114791905B (en) Methods, devices, storage media and electronic equipment for storing resource records
CN113315849B (en) Data processing method, device, equipment and storage medium
CN115277816B (en) Service adaptation method, device, system and computer readable medium
CN107547382B (en) Neighbor relation discovery method and device
CN116192931A (en) A microservice agent method, device, electronic 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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 250101 s01-6 / F, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province

Patentee after: Inspur Network Technology (Shandong) Co.,Ltd.

Country or region after: China

Address before: 250101 s01-6 / F, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province

Patentee before: INSPUR CISCO NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China