CN116932449B - Method, system, equipment and medium for realizing serial port redirection to remote equipment - Google Patents

Method, system, equipment and medium for realizing serial port redirection to remote equipment Download PDF

Info

Publication number
CN116932449B
CN116932449B CN202311190091.5A CN202311190091A CN116932449B CN 116932449 B CN116932449 B CN 116932449B CN 202311190091 A CN202311190091 A CN 202311190091A CN 116932449 B CN116932449 B CN 116932449B
Authority
CN
China
Prior art keywords
serial port
equipment
redirection
operation request
remote
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
CN202311190091.5A
Other languages
Chinese (zh)
Other versions
CN116932449A (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 Shandong Computer Technology Co Ltd
Original Assignee
Inspur Shandong Computer 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 Shandong Computer Technology Co Ltd filed Critical Inspur Shandong Computer Technology Co Ltd
Priority to CN202311190091.5A priority Critical patent/CN116932449B/en
Publication of CN116932449A publication Critical patent/CN116932449A/en
Application granted granted Critical
Publication of CN116932449B publication Critical patent/CN116932449B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method, a system, a device and a medium for realizing serial port redirection to a remote device, which relate to the technical field of remote control and aim to solve the problem that the rapid switching of a redirection serial port cannot be realized when remote control is performed based on an SOL function, so that the working efficiency is low, the method is applied to a serial port redirection client, and a redirection service component is arranged in the serial port redirection client, and comprises the following steps: acquiring an operation request for remote equipment initiated by control equipment; determining device information of the control device according to the operation request; the equipment information is sent to a redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports; and redirecting the operation request to the remote equipment by utilizing the data transmission channel corresponding to the target serial port.

Description

Method, system, equipment and medium for realizing serial port redirection to remote equipment
Technical Field
The present invention relates to the field of remote control technologies, and in particular, to a method, a system, an apparatus, an electronic device, and a computer readable storage medium for redirecting a serial port to a remote device.
Background
IPMI (Intelligent Platform Management Interface ) is an important tool in the server field, which can configure SOL (Serial Over Lan), an implementation manner of a redirection function transmitted by an on-board Serial controller based on IPMI commands, to implement remote control on a remote device. The hardware logic implementation of the traditional SOL needs to configure a BMC (Baseboard Management Controller ) chip, and a standard serial port controller is arranged in the BMC chip, so that an operation request for a remote device is redirected to the remote device through a serial port, and remote control for the remote device is realized. However, according to the SOL function defined in the standard IPMI protocol provided by the BMC chip, only one path of serial port is redirected to the remote device, and the industry generally uses a single switching command to switch the serial port of SOL, so that the problems of complex operation flow, poor usability and low working efficiency exist, and meanwhile, the problems of long research and development period and high development cost are caused in the early research and development stage.
Therefore, how to realize fast switching of the redirecting serial port in the remote control process based on the SOL function, so as to effectively improve the working efficiency is a problem to be solved by the person skilled in the art.
Disclosure of Invention
The invention aims to provide a method for realizing the redirection of a serial port to a remote device, which can realize the rapid switching of the redirection serial port in a remote control process based on an SOL function, thereby effectively improving the working efficiency; it is another object of the present invention to provide a system, an apparatus, an electronic device, and a computer readable storage medium for implementing serial port redirection to a remote device, which have the above advantages.
In a first aspect, the present invention provides a method for implementing serial port redirection to a remote device, applied to a serial port redirection client, where a redirection service component is deployed in the serial port redirection client, the method includes:
acquiring an operation request for the remote equipment initiated by control equipment;
determining equipment information of the control equipment according to the operation request;
the equipment information is sent to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
And redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port.
Optionally, the sending the device information to the redirection service component, so that the redirection service component determines, according to the device information, a target serial port corresponding to the control device, including:
and sending the equipment information to the redirection service component so that the redirection service component can check the equipment information by using the record information, and determining the target serial port corresponding to the control equipment according to the equipment information after the equipment information passes the check.
Optionally, the redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port includes:
acquiring the operation authority of the control equipment fed back by the redirection service component to the remote equipment;
judging whether the operation request meets the operation authority or not;
if yes, redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
if not, rejecting the operation request.
Optionally, before the obtaining the operation request for the remote device initiated by the control device, the method further includes:
Determining the current working parameters of the serial port redirection client;
and sending the current working parameters to the control equipment so that the control equipment adjusts the working parameters according to the current working parameters.
Optionally, the sending the current working parameter to the control device, so that the control device adjusts the working parameter thereof according to the current working parameter, including:
and sending the current working parameters to the control equipment through a baseboard management controller so that the control equipment adjusts the working parameters according to the current working parameters, wherein the baseboard management controller is deployed at the serial port redirection client.
Optionally, the implementation method for redirecting the serial port to the remote device further includes:
receiving a working parameter acquisition request sent by the remote equipment;
and sending the current working parameters to the remote equipment according to the working parameter acquisition request so that the remote equipment adjusts the working parameters according to the current working parameters.
Optionally, the receiving the operation parameter obtaining request sent by the remote device includes:
Receiving an intelligent platform management interface command sent by the remote equipment;
and analyzing and obtaining the working parameter acquisition request according to the intelligent platform management interface command.
Optionally, the sending the current working parameter to the remote device according to the working parameter obtaining request, so that the remote device adjusts the working parameter thereof according to the current working parameter, including:
and sending the current working parameters to the remote equipment according to the working parameter acquisition request, so that the remote equipment updates the working parameters to the current working parameters by executing an intelligent platform management interface command.
Optionally, the implementation method for redirecting the serial port to the remote device further includes:
acquiring preset working parameters;
and sending the preset working parameters to a baseboard management controller so that the baseboard management controller can set the preset working parameters as the current working parameters, and the baseboard management controller is deployed at the serial port redirection client.
Optionally, after redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port, the method further includes:
Receiving a request response fed back by the remote equipment according to the operation request;
the request response is fed back to the control device.
In a second aspect, the present invention also discloses another implementation method for redirecting a serial port to a remote device, where the implementation method is applied to the remote device, and the method includes:
receiving an operation request sent by a serial port redirection client; the operation request is sent to the serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to a target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request;
processing the operation request to obtain a request response;
and feeding back the request response to the serial port redirection client so that the serial port redirection client feeds back the request response to the control equipment.
Optionally, a serial port component and a processing component are deployed in the remote device;
The receiving the operation request sent by the serial port redirection client comprises the following steps: receiving the operation request sent by the serial port redirection client by utilizing the serial port component;
the processing the operation request to obtain a request response comprises the following steps: processing the operation request by using the processing component to obtain the request response;
the feeding back the request response to the serial port redirection client comprises: and feeding back the request response to the serial port redirection client by using the serial port component.
Optionally, a conversion component is further disposed in the remote device;
the processing the operation request, before obtaining the request response, further includes: converting the data format of the operation request into a preset format through the conversion component, obtaining a converted operation request, and sending the converted operation request to the processing component;
before the request response is fed back to the serial port redirection client, the method further comprises the following steps: determining an initial format of the operation request; and converting the data format of the request response into the initial format through the conversion component, obtaining a converted request response, and sending the converted request response to the serial port component.
Optionally, the converting, by the converting component, the data format of the operation request into a preset format, obtaining a converted operation request, and sending the converted operation request to the processing component, where the converting includes:
judging whether the data format of the operation request is the preset format or not through the conversion component;
if yes, the operation request is sent to the processing component;
if not, converting the data format of the operation request into the preset format, obtaining the converted operation request, and sending the converted operation request to the processing component.
Optionally, a storage component is further disposed in the remote device, and the method further includes:
recording the operation request and the processing information corresponding to the request response;
and storing the operation request, the request response and the processing information through the storage component.
In a third aspect, the invention also discloses a system for implementing serial port redirection to a remote device, which comprises a control device, a serial port redirection client and the remote device, wherein a redirection service component is arranged in the serial port redirection client;
The control device is configured to send an operation request for the remote device to the serial port redirection client;
the serial port redirection client is used for determining equipment information of the control equipment according to the operation request; the equipment information is sent to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports; redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
the remote equipment is used for receiving the operation request and carrying out request processing on the operation request.
In a fourth aspect, the present invention also discloses an implementation apparatus for redirecting a serial port to a remote device, where the implementation apparatus is applied to a serial port redirecting client, and the serial port redirecting client is provided with a redirection service component, and the apparatus includes:
the acquisition module is used for acquiring an operation request for the remote equipment, which is initiated by the control equipment;
a determining module, configured to determine device information of the control device according to the operation request;
The sending module is used for sending the equipment information to the redirection service component so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
and the redirection module is used for redirecting the operation request to the remote equipment by utilizing the data transmission channel corresponding to the target serial port.
In a fifth aspect, the present invention also discloses another implementation apparatus for redirecting a serial port to a remote device, where the implementation apparatus is applied to the remote device, the apparatus includes:
the receiving module is used for receiving an operation request sent by the serial port redirection client; the operation request is sent to the serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to a target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request;
The processing module is used for processing the operation request to obtain a request response;
and the feedback module is used for feeding back the request response to the serial port redirection client so that the serial port redirection client feeds back the request response to the control equipment.
In a sixth aspect, the present invention also discloses an electronic device, including:
a memory for storing a computer program;
a processor for implementing the steps of any of the implementation methods of serial port redirection to a remote device as described above when executing the computer program.
In a seventh aspect, the present invention also discloses a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the methods of serial port redirection to a remote device as described above.
The invention provides a method for realizing serial port redirection to remote equipment, which is applied to a serial port redirection client, wherein a redirection service component is arranged in the serial port redirection client, and the method comprises the following steps: acquiring an operation request for the remote equipment initiated by control equipment; determining equipment information of the control equipment according to the operation request; the equipment information is sent to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports; and redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port.
The technical scheme provided by the invention has the following technical effects:
the remote control of the control equipment to the remote equipment is realized based on a serial port redirection client (SOL client), wherein a redirection service component is deployed in the SOL client and is used for recording the corresponding relation between equipment information of various control equipment and the redirection serial port, so that the SOL client can determine the equipment information of the control equipment according to the received operation request of the control equipment to the remote equipment, then the redirection service component of the SOL client is utilized to inquire a target serial port corresponding to the equipment information, namely the redirection serial port corresponding to the control equipment, thereby being capable of directly switching to the target serial port, and redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port, thereby realizing the remote control of the control equipment to the remote equipment. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
The invention also discloses another implementation method for redirecting the serial port to the remote equipment, an implementation device, a system, electronic equipment and a computer readable storage medium for redirecting the serial port to the remote equipment, which have the technical effects as well, and the invention is not repeated here.
Drawings
In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the following will briefly describe the drawings that need to be used in the description of the prior art and the embodiments of the present invention. Of course, the following drawings related to embodiments of the present invention are only a part of embodiments of the present invention, and it will be obvious to those skilled in the art that other drawings can be obtained from the provided drawings without any inventive effort, and the obtained other drawings also fall within the scope of the present invention.
Fig. 1 is a schematic structural diagram of an implementation system for redirecting serial ports to a remote device according to the present invention;
fig. 2 is a flow chart of a method for implementing serial port redirection to a remote device according to the present invention;
fig. 3 is a flow chart of another implementation method for redirecting a serial port to a remote device according to the present invention;
FIG. 4 is a schematic diagram of a remote device according to the present invention;
FIG. 5 is a schematic view illustrating an internal structure of a processing assembly according to the present invention;
FIG. 6 is a schematic diagram of a connection structure between a processing module and a storage module according to the present invention;
fig. 7 is a schematic diagram of an internal structure of a serial port assembly according to the present invention;
FIG. 8 is a schematic diagram illustrating the operation of a conversion assembly according to the present invention;
fig. 9 is a schematic structural diagram of an implementation apparatus for redirecting serial ports to a remote device according to the present invention;
fig. 10 is a schematic structural diagram of another implementation apparatus for redirecting serial ports to a remote device according to the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to the present invention.
Detailed Description
The core of the invention is to provide a method for realizing the redirection of the serial port to the remote equipment, which can realize the rapid switching of the redirection serial port in the remote control process based on the SOL function, thereby effectively improving the working efficiency; another core of the present invention is to provide a system, an apparatus, an electronic device, and a computer readable storage medium for implementing serial port redirection to a remote device, which all have the above advantages.
In order to more clearly and completely describe the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The embodiment of the invention provides a method for realizing serial port redirection to remote equipment.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an implementation system for serial port redirection to a remote device provided by the present invention, where the implementation system for serial port redirection to a remote device includes a control device 100, a serial port redirection client 200, and a remote device 300, and the implementation method for serial port redirection to a remote device provided by the embodiment of the present invention is applied to the serial port redirection client 200, so as to redirect an operation request initiated by the control device 100 for the remote device 300 to the remote device 300, so as to facilitate remote control of the remote device 300 by the control device 100.
Further, referring to fig. 2, fig. 2 is a flow chart of a method for implementing serial port redirection to a remote device, where the method for implementing serial port redirection to a remote device is applied to the serial port redirection client shown in fig. 1, where a redirection service component is disposed in the serial port redirection client, and the method for implementing serial port redirection to a remote device may include the following steps S101 to S104.
S101: and acquiring an operation request for the remote equipment, which is initiated by the control equipment.
This step aims at realizing the acquisition of an operation request, which is an operation request for a remote device initiated by a control device, for realizing remote control of the remote device by the control device based on a serial port redirection client (SOL client described below). The type of the operation request is not unique, and may be, for example, an information read operation request, a data write operation request, etc., which is not limited in the present invention.
S102: device information of the control device is determined according to the operation request.
This step aims at enabling the determination of device information of the control device. It can be understood that the control device for remotely controlling the remote device may not be unique, that is, there may be a plurality of control devices capable of remotely controlling the remote device, so that the device information of the control device may be determined first, so that the subsequent target serial port query is realized according to the device information of the control device, and further, the determination of the redirection serial port corresponding to the control device is realized, thereby realizing the automatic serial port switching function.
In the implementation process, the received operation request can be subjected to data analysis, so that the equipment information of the control equipment initiating the operation request can be obtained. The content included in the device information is not unique, and may include, for example, but not limited to, device type/model information, device ID information, device port information, in-device registered user information, in-device registered password information, and the like.
S103: the equipment information is sent to a redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports.
The method aims at realizing the query determination of the target serial port. As described above, the SOL client is configured to deploy a redirection service component, where the redirection service component is configured to record correspondence between device information of various control devices and a redirection serial port, so that after obtaining the device information of the control device, the SOL client may send the device information to the redirection service component, and the redirection service component performs serial port query according to the correspondence, and determines a redirection serial port corresponding to the device information, that is, the target serial port corresponding to the determined control device, thereby implementing automatic switching of the redirection serial port.
In a possible implementation manner, the sending the device information to the redirection service component, so that the redirection service component determines, according to the device information, a target serial port corresponding to the control device, may include: and sending the equipment information to the redirection service component so that the redirection service component can check the equipment information by using the record information, and determining a target serial port corresponding to the control equipment according to the equipment information after the equipment information passes the check.
The embodiment of the invention provides a method for realizing redirection serial port inquiry based on a redirection service component. In the implementation process, in order to ensure the validity of the control equipment and further ensure the safety of the remote equipment, after receiving the equipment information of the control equipment, the redirection service component can firstly check the equipment information of the control equipment before carrying out target serial port inquiry on the equipment information, and the check process can be implemented based on the pre-placed record information.
Specifically, in the SOL client research and development process, record information of various control devices can be pre-placed in the redirection service component for storage, the record information essentially refers to standard device information of the corresponding control devices, then the redirection service component can verify the device information by using the record information after obtaining the device information of the control devices, if the device information hits the record information, the control device can be determined to be legal, namely, the verification of the device information is determined to pass, and at the moment, the subsequent redirection serial port inquiry operation can be continuously executed; otherwise, if the device information does not hit the record information, it can be determined that the control device is an illegal device, that is, it is determined that the verification of the device information is not passed, and at this time, the subsequent redirection serial port query operation is not continuously executed.
Therefore, the technical scheme realizes the validity check of the corresponding control equipment by checking the equipment information, can effectively ensure the validity of the control equipment, and further ensures the safety of the remote equipment.
S104: and redirecting the operation request to the remote equipment by utilizing the data transmission channel corresponding to the target serial port.
This step is intended to enable remote redirection of the operation request. After the target serial port corresponding to the control device is determined, the control device can be directly switched to the target serial port, so that the operation request is redirected to the remote device by utilizing the data transmission channel corresponding to the target serial port, and the remote control of the remote device by the control device based on the redirection of the operation request of the control device to the remote device by the SOL client is realized.
In one possible implementation manner, the redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port may include the following steps:
acquiring the operation authority of the control equipment fed back by the redirection service component to the remote equipment;
judging whether the operation request meets the operation authority;
if yes, redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
If not, rejecting the operation request.
The embodiment of the invention provides a method for redirecting an operation request to remote equipment based on a data transmission channel corresponding to a target serial port. It will be appreciated that, for a remote device, different types of control devices may have different operation rights, for example, the remote device may only open read-only rights for one control device and open read-write rights for another control device, so, to avoid unnecessary transmission resource occupation, the remote device may be subjected to rights judgment before redirecting an operation request to the remote device, and only when the rights requirement is met, the operation of redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port may be allowed, otherwise, the operation request is refused, i.e. the execution of the subsequent operation is refused.
Specifically, in the process of developing the SOL client, various control devices can be put in advance in the redirection service component to save the operation authority of the remote device, so that the redirection service component can query the operation authority corresponding to the device information and output the operation authority to the SOL client after obtaining the device information of the control device. Further, before redirecting the operation request to the remote device, the SOL client may first determine whether the operation request meets the operation permission, if so, the SOL client may continue to perform the operation of redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port, otherwise, the SOL client does not perform the redirection sending on the operation request.
Therefore, before the operation request is redirected to the remote equipment, authority judgment is carried out, the redirection operation of the operation request can be allowed to be executed only when the authority requirement is met, otherwise, the execution is refused, and therefore the operation request redirected to the remote equipment can be effectively guaranteed to be the operation request with legal authority, the operation request which does not have legal authority is prevented from being redirected to the remote equipment, and further unnecessary transmission resource occupation is effectively avoided.
Furthermore, based on the above operation flow, the embodiment of the present invention provides an implementation manner of automatically switching the redirection serial port as follows:
1. and (3) deploying a SOL Server (redirection service component) in the BMC of the SOL client, and configuring the SOL Server, wherein the configuration content mainly comprises record information of each control device, corresponding redirection serial port information, operation authority and the like, and the record information comprises device parameters, device ports, user names, user passwords and the like.
2. When the SOL client is connected to the SOL Server of the BMC, the SOL client provides corresponding user credentials (namely the equipment information) through an authentication mechanism, the SOL Server verifies and matches the user credentials after receiving the user credentials, and if the SOL Server verifies and matches, the user is granted corresponding operation rights. After authorization, the SOL Server can perform corresponding operation according to the operation request and the authority, namely, automatic switching of the SOL data transmission channel corresponding to the redirection serial port is realized.
It can be appreciated that by the above manner, when the matched record information is identified, the automatic switching function can be realized on the SOL data transmission channel without manual operation of a user. Therefore, the operation flow of the user is effectively simplified, and the use convenience of the user is improved; moreover, as the workload of manual intervention of a user is reduced, the possibility of errors can be reduced, so that the reliability and the stability of the system are improved; meanwhile, the user can be more focused on own work, the work efficiency is improved, and the work experience is improved.
In summary, the implementation method for redirecting the serial port to the remote device provided by the embodiment of the invention realizes remote control of the remote device by the control device based on the serial port redirecting client (SOL client), wherein a redirecting service component is deployed in the SOL client and is used for recording the corresponding relation between the device information of various control devices and the redirecting serial port, so that the SOL client can determine the device information of the control device according to the received operation request of the control device for the remote device, and then query a target serial port corresponding to the device information, namely the redirecting serial port corresponding to the control device by utilizing the self redirecting service component, thereby being capable of directly switching to the target serial port, and redirecting the operation request to the remote device by utilizing the data transmission channel corresponding to the target serial port, thereby realizing remote control of the remote device by the control device. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
Based on the above embodiments:
in an embodiment of the present invention, before the obtaining the operation request for the remote device initiated by the control device, the method may further include the following steps:
determining the current working parameters of the serial port redirection client;
and sending the current working parameters to the control equipment so that the control equipment adjusts the working parameters according to the current working parameters.
It will be appreciated that the size of the working parameters supportable by each control device may be different from the size of the working parameters supportable by the SOL client, however, if the working parameters of the SOL client and the control device cannot be kept consistent, the problem that the serial port redirection cannot work normally will be caused, for example, if the size of the working parameters supported by the SOL client is far beyond the maximum working parameters supported by a certain control device, the signal noise in the serial port output will be seriously increased, so that the problem of data transmission errors or loss will be caused. Therefore, the embodiment of the invention provides a scheme for realizing the consistency of the working parameters between the SOL client and the control equipment so as to effectively ensure that the serial port redirection can work normally.
In the implementation process, the SOL client can determine the current working parameter of the SOL client, and then send the current working parameter to the control equipment, so that the control equipment can adjust the working parameter of the SOL client according to the current working parameter, and the purpose that the working parameter of the control equipment is matched with the working parameter of the SOL client is achieved. The sending the current working parameter to the control device, so that the control device adjusts the working parameter according to the current working parameter, may include: and the current working parameters are sent to the control equipment through the baseboard management controller, so that the control equipment adjusts the working parameters according to the current working parameters, and the baseboard management controller is deployed at the serial port redirection client.
That is, the SOL client can directly utilize the self-deployed BMC to perform data interaction with the control device, so as to realize the transmission of the working parameters.
In one possible implementation, the above-mentioned operating parameter may specifically be the baud rate.
In one embodiment of the present invention, the implementation method for redirecting the serial port to the remote device may further include the following steps:
receiving a working parameter acquisition request sent by remote equipment;
and sending the current working parameters to the remote equipment according to the working parameter acquisition request so that the remote equipment adjusts the working parameters according to the current working parameters.
It will be appreciated that the size of the supportable working parameters of the remote device may be different from that of the SOL client, however, if the working parameters of the SOL client and the remote device cannot be kept consistent, for example, the BMC baud rate of the SOL client is not matched with the BIOS (Basic Input/Output System) baud rate of the remote device, the problem of displaying messy codes will be caused, and the problem of the serial port redirection cannot work normally also exists. Therefore, the embodiment of the invention provides a scheme for realizing the consistency of the working parameters between the SOL client and the remote equipment so as to effectively ensure that the serial port redirection can work normally.
In the implementation process, the remote equipment can actively initiate a working parameter acquisition request to the SOL client, so that the SOL client can respond to the working parameter acquisition request and send the current working parameter of the remote equipment to the remote equipment, so that the remote equipment can adjust the working parameter of the remote equipment according to the current working parameter, and the aim of matching the working parameter of the remote equipment with the working parameter of the SOL client is fulfilled.
The receiving the operation parameter obtaining request sent by the remote device may include: receiving an intelligent platform management interface command (IPMI command) sent by remote equipment; and analyzing and obtaining a working parameter acquisition request according to the intelligent platform management interface command.
The sending the current working parameter to the remote device according to the working parameter obtaining request, so that the remote device adjusts the working parameter according to the current working parameter, may include: and sending the current working parameters to the remote equipment according to the working parameter acquisition request, so that the remote equipment updates the working parameters to the current working parameters by executing the intelligent platform management interface command.
That is, the SOL client may utilize the IPMI command to perform data interaction with the remote device, so as to implement sending and adjusting of the working parameters.
In one embodiment of the present invention, the implementation method for redirecting the serial port to the remote device may further include the following steps:
acquiring preset working parameters;
and sending the preset working parameters to the baseboard management controller so that the baseboard management controller can set the preset working parameters as current working parameters, and the baseboard management controller is deployed at the serial port redirection client.
In the embodiment of the invention, the setting or updating of the working parameters in the SOL client can be further realized. Specifically, the method is used for directly inputting preset working parameters, namely the preset working parameters, into the SOL client, so that after the SOL client acquires the preset working parameters, the SOL client can send the preset working parameters to the self BMC, and the BMC sets the preset working parameters as current working parameters.
Furthermore, based on the above embodiments, taking the operating parameter as the baud rate as an example, the embodiments of the present invention provide the following implementation manners of setting and matching the baud rate to be effective immediately:
1. the user sets a new baud rate (preset working parameters) at the SOL client;
2. the SOL client sends the new baud rate information to the BMC itself;
3. after receiving the new baud rate information, the BMC stores the new baud rate information in a corresponding configuration file;
4. The BMC immediately updates the current baud rate setting according to the new baud rate configuration file;
5. after the updating is finished, the BMC sends new baud rate information to the control equipment through the SOL data transmission channel;
6. the control equipment immediately adjusts the baud rate of the serial port communication according to the new baud rate information after receiving the information;
7. the remote device BIOS obtains the current baud rate of the BMC through the IPMI command and compares the current baud rate with the baud rate preset by the BIOS;
8. and comparing the two baud rates, if the two baud rates are the same, continuing the flow, otherwise, changing the baud rate of the BMC SOL baud rate through the IPMI instruction, so that the BMC SOL baud rate can take effect immediately.
It will be appreciated that after the user sets a new baud rate at the SOL client, the BMC will immediately validate the baud rate according to the new setting without performing other operations or restarting the system. The real-time updating method can rapidly and conveniently switch the baud rate of the SOL data transmission channel, and provides more flexible and efficient serial communication experience. Meanwhile, due to the fact that the data transmission channel is updated immediately, a user can communicate and operate at a new baud rate immediately, and working efficiency is improved.
In an embodiment of the present invention, after redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port, the method may further include the following steps:
Receiving a request response fed back by the remote equipment according to the operation request;
the request response is fed back to the control device.
Specifically, after the remote device is sent to the remote device based on the operation request of the control device for the remote device, the remote device can respond to the operation request to perform corresponding request processing, and feed back a request response (i.e. a processing result of the operation request) to the SOL client, and finally, the SOL client feeds back the request response to the control device, so that the remote device can respond to the request of the control device.
The embodiment of the invention provides another implementation method for redirecting the serial port to the remote equipment.
Referring to fig. 3, fig. 3 is a flow chart of another implementation method of serial port redirection to a remote device provided by the present invention, where the implementation method of serial port redirection to a remote device is applied to the remote device shown in fig. 1, and the implementation method of serial port redirection to a remote device may include the following steps S201 to S203.
S201: receiving an operation request sent by a serial port redirection client; the operation request is sent to a serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to the target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request;
S202: processing the operation request to obtain a request response;
s203: the request response is fed back to the serial port redirection client, so that the serial port redirection client feeds back the request response to the control device.
It can be seen that, in the implementation method for redirecting the serial port to the remote device provided by the embodiment of the invention, remote control of the remote device by the control device is implemented based on the serial port redirecting client (SOL client), where a redirecting service component is deployed in the SOL client and is used for recording the corresponding relationship between the device information of various control devices and the redirecting serial port, so that the SOL client can determine the device information of the control device according to the received operation request for the remote device initiated by the control device, and then query the target serial port corresponding to the device information, that is, the redirecting serial port corresponding to the control device by using its own redirecting service component, so that the remote control of the remote device by using the data transmission channel corresponding to the target serial port can be directly switched to. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
Based on the above embodiments:
in one embodiment of the invention, a serial port component and a processing component are deployed in a remote device;
the receiving the operation request sent by the serial port redirection client may include: receiving an operation request sent by a serial port redirection client by using a serial port component;
the processing the operation request to obtain the request response may include: processing the operation request by using a processing component to obtain a request response;
the feeding back the request response to the serial port redirecting client may include: and feeding back the request response to the serial port redirection client by using the serial port component.
It will be appreciated that the conventional SOL transfer process is completed by relying on ASCII (American Standard Code for Information Interchange, american standard information interchange code) chips in the remote device, meaning that SOL functionality cannot be used if the remote device does not have an integrated ASCII chip. Thus, this may limit the compatibility of some devices and may require additional hardware support to implement SOL functionality.
Therefore, in order to solve the above technical problems, the embodiment of the present invention implements functional simulation of an ASCII chip by deploying corresponding functional components in a remote device. Specifically, a serial port component and a processing component are deployed in the remote controlled remote device, wherein the serial port component is used for realizing a transmission function, including receiving an operation request and sending a request response, and the processing component is used for realizing a processing function, namely processing the operation request.
In the implementation process, the remote equipment can receive an operation request sent by the SOL client through the serial port component in a redirection way, and the operation request is an operation request of the control equipment to the remote equipment; then, the processing component is utilized to process the request according to the type of the operation request, such as a reading operation, a storing operation, a setting operation, a query operation and the like, so as to obtain a corresponding request response; and finally, feeding back the request response to the control equipment through the SOL client by utilizing the serial port component.
Therefore, the function simulation of the ASCII chip can be realized through the cooperative work of the multifunctional components, and the efficient and reliable data transmission is further realized. In addition, the scheme can be widely applied to various scenes needing simulating ASCII chip data transmission, and has higher flexibility and customization.
In one embodiment of the invention, a conversion component is also disposed in the remote device;
the processing the operation request, before obtaining the request response, may further include: converting the data format of the operation request into a preset format through a conversion component, obtaining a converted operation request, and sending the converted operation request to a processing component;
Before the request response is fed back to the serial port redirection client, the method may further include: determining an initial format of an operation request; and converting the data format of the request response into an initial format through a conversion component, obtaining a converted request response, and sending the converted request response to the serial port component.
It will be appreciated that different devices may support different data formats, and in order to ensure normal processing of an operation request in the remote device, a conversion module may be further deployed in the remote device, so as to implement a data format conversion function.
Therefore, after the operation request is received based on the serial port component, before the operation request is processed based on the processing component, the conversion component can be utilized to convert the operation request into a preset format, and the preset format is a data format which can be supported by the remote equipment, and then the converted operation request is sent to the processing module for subsequent processing. Correspondingly, in the request response process, after the request response is obtained based on the processing component, before the request response is fed back to the SOL client based on the serial port module, the format of the request response can be converted by the conversion component, and the request response is converted into the initial format of the operation request, and of course, the initial format is a data format supportable by the SOL client, and then the converted request response is sent to the serial port module for request response feedback.
The converting, by the converting component, the data format of the operation request into a preset format, obtaining a converted operation request, and sending the converted operation request to the processing component may include: judging whether the data format of the operation request is a preset format or not through a conversion component; if yes, sending an operation request to a processing component; if not, converting the data format of the operation request into a preset format, obtaining a converted operation request, and sending the converted operation request to the processing component.
As described above, different devices may support different data formats, so the data format of the operation request may be a preset format or may not be a preset format, so the data format may be determined first, if the data format meets the preset format, the data format conversion operation is not required to be executed, and the operation request is directly sent to the processing component; otherwise, if the data format of the operation request is the preset format, the data format conversion operation is executed again, so that the converted operation request is sent to the processing component.
In one embodiment of the invention, a storage component is also disposed in the remote device; the implementation method for redirecting the serial port to the remote equipment can further comprise the following steps:
Recording processing information corresponding to the operation request and the request response;
and storing the operation request, the request response and the processing information through the storage component.
It may be understood that during the processing of the operation request, temporary storage and buffering of relevant data may be involved, so that a storage component may be disposed in the remote device, so as to implement storage of the operation request and the request response and relevant information of the operation request and the request response (i.e. the above processing information), where the processing information refers to various data information generated during the processing and the transmission of the operation request and the request response, and specifically may be recorded in real time through a serial port component, a processing component, and a conversion component, and forwarded to the storage component for storage.
Furthermore, based on the above embodiments, the embodiment of the present invention provides the following technical solutions for implementing ASCII chip functional simulation by cooperation of multifunctional components:
referring to fig. 4, fig. 4 is a schematic structural diagram of a remote device provided by the present invention, where the remote device includes a serial port component, a conversion component, a processing component, and a storage component, and the implementation flow is as follows:
1. the serial port component (specifically, UART serial port component, universal Asynchronous Receiver/Transmitter, universal asynchronous receiver-Transmitter) receives an operation request for remote equipment, which is initiated by control equipment and sent by a SOL client;
2. The serial port component sends the operation request to a conversion component (specifically, an LPC component, low pin count Bus, a computer bus) for format conversion processing;
3. the conversion component performs format conversion on the operation request to obtain the operation request in a data format which can be supported by the remote equipment;
4. the conversion component sends the operation request after format conversion to the processing component (specifically, ARM component, advanced RISC Machine, a processor) for subsequent processing;
5. the processing component performs request processing on the operation request after format conversion, obtains a request response and sends the request response to the conversion component;
6. the conversion component performs format conversion on the request response to obtain a request response in a data format which can be supported by the SOL client;
7. the conversion component sends the request response after format conversion to the serial port component;
8. the serial port component feeds back the request response after format conversion to the SOL client so that the SOL client feeds back the request response to the control equipment;
9. in the data flow process from step 1 to step 8, various related data information may be sent to a storage component (specifically, an Avalon component, an Avalon interface is a control interface commonly used for high-speed data flow transmission, reading and writing registers, a memory, and off-chip devices) for storage/temporary storage.
Further, please refer to fig. 5 to 8, fig. 5 is a schematic diagram of an internal structure of a processing assembly provided by the present invention, fig. 6 is a schematic diagram of a connection structure of a processing assembly and a storage assembly provided by the present invention, fig. 7 is a schematic diagram of an internal structure of a serial port assembly provided by the present invention, and fig. 8 is a schematic diagram of a conversion assembly provided by the present invention.
1. And a processing component:
the processing assembly comprises two physically independent transmitting serial data buffers and receiving serial data buffers, and can simultaneously transmit and receive data, wherein the transmitting serial data buffers can only be written and cannot be read, the receiving serial data buffers can only be read and cannot be written, and the two buffers share a special function register byte address. In addition, the processing component is internally controlled by a serial control register and a timer, the serial control register judges whether to interrupt the serial port line by modifying the first flag bit and the second flag bit, and the timer controls the sending and receiving time.
2. And a storage component:
under the control of shift clock pulse sent by the data sending pin of the processing component, the data information is shifted into the signal interface end of the storage component bit by bit from the data input pin, after the data information is shifted out, the first flag bit of the serial control register of the processing component is automatically set to be 1, and then the content of the storage component can be outputted in parallel. In addition, the reset port of the memory component is a zero segment, and the reset port must be 1 when outputting, otherwise, each output port (the first output port, the second output port, and the third output port) will output 0.
3. Serial port assembly:
the serial port component receives data from the control equipment, and temporarily stores the data in the transmission shift register through the transmission data register, and waits for the transmitter to send out a signal; the transmitter is controlled by the transmitter clock module and transmits a corresponding signal to the transmission shift register after the timing sequence is completed, so that the transmission shift register transmits data to the conversion component after receiving the signal. In addition, the conversion component converts the data and then sends the converted data to the receiving shift register for the storage component to read.
4. And a conversion component:
when power is on, the conversion component firstly initializes communication parameters, pins, priority and the like and waits for receiving data. When the data is sent, whether the data format is a preset format is judged, if not, the data is standardized according to the preset format, otherwise, the data is sequentially stored in a receiving array and packaged. After all data receiving processes are completed, data is sent to the next component, the received data is cleared, and relevant marks are initialized.
Therefore, through the cooperative work of the multifunctional components, the function simulation of the ASCII chip is realized, and efficient and reliable data transmission is further realized. In addition, the multifunctional component can be widely applied to various scenes needing simulating ASCII chip data transmission, and has higher flexibility and customization.
The embodiment of the invention provides an implementation system for redirecting a serial port to remote equipment.
As shown in fig. 1, the system for implementing serial port redirection to a remote device according to the embodiment of the present invention includes a control device 100, a serial port redirection client 200, and a remote device 300, where a redirection service component is disposed in the serial port redirection client 200;
a control device 100 for sending an operation request for the remote device 300 to the serial port redirection client 200;
a serial port redirection client 200 for determining device information of the control device 100 according to the operation request; the device information is sent to a redirection service component, so that the redirection service component determines a target serial port corresponding to the control device 100 according to the device information; the redirection service component records the corresponding relation between the equipment information and the serial ports; redirecting the operation request to the remote device 300 by using the data transmission channel corresponding to the target serial port;
the remote device 300 is configured to receive an operation request and perform request processing on the operation request.
Therefore, the implementation system for redirecting the serial port to the remote device provided by the embodiment of the invention realizes remote control of the remote device by the control device based on the serial port redirecting client (SOL client), wherein a redirecting service component is deployed in the SOL client and is used for recording the corresponding relation between the device information of various control devices and the redirecting serial port, so that the SOL client can determine the device information of the control device according to the received operation request of the control device for the remote device, and then query a target serial port corresponding to the device information, namely the redirecting serial port corresponding to the control device by utilizing the self redirecting service component, thereby being capable of directly switching to the target serial port, and redirecting the operation request to the remote device by utilizing the data transmission channel corresponding to the target serial port, thereby realizing remote control of the remote device by the control device. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
For the description of the system provided by the embodiment of the present invention, please refer to the above method embodiment, and the description of the present invention is omitted here.
The embodiment of the invention provides a device for realizing serial port redirection to remote equipment.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an implementation apparatus for serial port redirection to a remote device, where the implementation apparatus for serial port redirection to a remote device is applied to a serial port redirection client, where a redirection service component is disposed in the serial port redirection client, and the implementation apparatus for serial port redirection to a remote device may include:
the acquisition module 1 is used for acquiring an operation request for the remote equipment, which is initiated by the control equipment;
a determining module 2 for determining device information of the control device according to the operation request;
the sending module 3 is used for sending the equipment information to the redirection service component so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
and the redirecting module 4 is used for redirecting the operation request to the remote equipment by utilizing the data transmission channel corresponding to the target serial port.
It can be seen that, according to the implementation device for redirecting the serial port to the remote device provided by the embodiment of the invention, remote control of the remote device by the control device is implemented based on the serial port redirecting client (SOL client), wherein a redirecting service component is deployed in the SOL client and is used for recording the corresponding relationship between the device information of various control devices and the redirecting serial port, so that the SOL client can determine the device information of the control device according to the received operation request of the control device for the remote device, and then query a target serial port corresponding to the device information, that is, the redirecting serial port corresponding to the control device by using the self redirecting service component, so that the remote control of the remote device by the control device can be directly switched to the target serial port, and the operation request is redirected to the remote device by using the data transmission channel corresponding to the target serial port. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
In one embodiment of the present invention, the sending module 3 may be specifically configured to send the device information to the redirection service component, so that the redirection service component verifies the device information by using the record information, and determines, after the verification is passed, a target serial port corresponding to the control device according to the device information.
In one embodiment of the present invention, the redirection module 4 may be specifically configured to obtain an operation right of the control device fed back by the redirection service component to the remote device; judging whether the operation request meets the operation authority; if yes, redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port; if not, rejecting the operation request.
In one embodiment of the present invention, the implementation apparatus for redirecting the serial port to the remote device may further include a first adjustment module, configured to determine, before the obtaining, by the control device, the current operating parameter of the serial port redirecting client; and sending the current working parameters to the control equipment so that the control equipment adjusts the working parameters according to the current working parameters.
In an embodiment of the present invention, the first adjustment module may be specifically configured to send the current working parameter to the control device through the baseboard management controller, so that the control device adjusts the working parameter according to the current working parameter, and the baseboard management controller is deployed at the serial port redirection client.
In one embodiment of the present invention, the implementation apparatus for redirecting the serial port to the remote device may further include a second adjustment module, configured to receive an operation parameter acquisition request sent by the remote device; and sending the current working parameters to the remote equipment according to the working parameter acquisition request so that the remote equipment adjusts the working parameters according to the current working parameters.
In an embodiment of the present invention, the second adjustment module may be specifically configured to receive an intelligent platform management interface command sent by a remote device; and analyzing and obtaining a working parameter acquisition request according to the intelligent platform management interface command.
In an embodiment of the present invention, the second adjustment module may be specifically configured to send the current operating parameter to the remote device according to the operating parameter obtaining request, so that the remote device updates the operating parameter to the current operating parameter by executing the intelligent platform management interface command.
In one embodiment of the present invention, the implementation apparatus for redirecting the serial port to the remote device may further include a configuration module, configured to obtain a preset operating parameter; and sending the preset working parameters to the baseboard management controller so that the baseboard management controller can set the preset working parameters as current working parameters, and the baseboard management controller is deployed at the serial port redirection client.
In one embodiment of the present invention, the implementation apparatus for redirecting the serial port to the remote device may further include a response module, configured to receive a request response fed back by the remote device according to the operation request after redirecting the operation request to the remote device by using the data transmission channel corresponding to the target serial port; the request response is fed back to the control device.
For the description of the apparatus provided by the embodiment of the present invention, refer to the above method embodiment, and the description of the present invention is omitted here.
The embodiment of the invention provides a device for realizing serial port redirection to remote equipment.
Referring to fig. 10, fig. 10 is a schematic structural diagram of another implementation apparatus for serial port redirection to a remote device, where the implementation apparatus for serial port redirection to a remote device is applied to a serial port redirection client, and the implementation apparatus for serial port redirection to a remote device may include:
the receiving module 5 is used for receiving an operation request sent by the serial port redirection client; the operation request is sent to a serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to the target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request;
The processing module 6 is used for processing the operation request to obtain a request response;
and the feedback module 7 is used for feeding back the request response to the serial port redirection client so that the serial port redirection client feeds back the request response to the control equipment.
It can be seen that, according to the implementation device for redirecting the serial port to the remote device provided by the embodiment of the invention, remote control of the remote device by the control device is implemented based on the serial port redirecting client (SOL client), wherein a redirecting service component is deployed in the SOL client and is used for recording the corresponding relationship between the device information of various control devices and the redirecting serial port, so that the SOL client can determine the device information of the control device according to the received operation request of the control device for the remote device, and then query a target serial port corresponding to the device information, that is, the redirecting serial port corresponding to the control device by using the self redirecting service component, so that the remote control of the remote device by the control device can be directly switched to the target serial port, and the operation request is redirected to the remote device by using the data transmission channel corresponding to the target serial port. Therefore, the technical scheme can realize automatic switching of the redirection serial port in the remote control process based on the SOL function, so that a user can directly realize serial port connection between the local device and the remote device through remote operation without actual physical contact, the usability and convenience of the SOL device are greatly improved, the operation flow is effectively simplified, and the working efficiency is further improved. In addition, based on the implementation mode, development of various switching instructions is not needed in the research and development stage, so that the research and development period is effectively shortened, and the development cost is reduced.
In one embodiment of the invention, a serial port component and a processing component are deployed in a remote device;
the receiving module 5 may be specifically configured to receive, by using a serial port component, an operation request sent by a serial port redirection client;
the processing module 6 may be specifically configured to process the operation request by using a processing component to obtain a request response;
the feedback module 7 may be specifically configured to use the serial component to feed back the request response to the serial redirection client.
In one embodiment of the present invention, a conversion component is further disposed in the remote device, and the implementation apparatus for redirecting the serial port to the remote device may further include:
the first conversion module is used for converting the data format of the operation request into a preset format through the conversion component before the operation request is processed to obtain a request response, obtaining a converted operation request and sending the converted operation request to the processing component;
the second conversion module is used for determining the initial format of the operation request before the request response is fed back to the serial port redirection client; and converting the data format of the request response into an initial format through a conversion component, obtaining a converted request response, and sending the converted request response to the serial port component.
In an embodiment of the present invention, the first conversion module may be specifically configured to determine, through the conversion component, whether the data format of the operation request is a preset format; if yes, sending an operation request to a processing component; if not, converting the data format of the operation request into a preset format, obtaining a converted operation request, and sending the converted operation request to the processing component.
In one embodiment of the invention, a storage component is further deployed in the remote device, and the implementation device for redirecting the serial port to the remote device can further comprise a storage module, used for recording processing information corresponding to the operation request and the request response; and storing the operation request, the request response and the processing information through the storage component.
For the description of the apparatus provided by the embodiment of the present invention, refer to the above method embodiment, and the description of the present invention is omitted here.
The embodiment of the invention provides electronic equipment.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an electronic device according to the present invention, where the electronic device may include:
a memory 11 for storing a computer program;
processor 10, when executing a computer program, implements the steps of a method for implementing any of the serial port redirection to a remote device as described above.
As shown in fig. 11, which is a schematic diagram of a composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all complete communication with each other through a communication bus 13.
In an embodiment of the present invention, the processor 10 may be a central processing unit (Central Processing Unit, CPU), an asic, a dsp, a field programmable gate array, or other programmable logic device, etc.
Processor 10 may invoke programs stored in memory 11 and, in particular, processor 10 may perform operations in embodiments of methods of implementing serial redirection to a remote device.
The memory 11 is used for storing one or more programs, and the programs may include program codes including computer operation instructions, and in the embodiment of the present invention, at least the programs for implementing the following functions are stored in the memory 11:
acquiring an operation request for remote equipment initiated by control equipment;
determining device information of the control device according to the operation request;
the equipment information is sent to a redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
And redirecting the operation request to the remote equipment by utilizing the data transmission channel corresponding to the target serial port.
In one possible implementation, the memory 11 may include a storage program area and a storage data area, where the storage program area may store an operating system, and at least one application program required for functions, etc.; the storage data area may store data created during use.
In addition, the memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage device.
The communication interface 12 may be an interface of a communication module for interfacing with other devices or systems.
Of course, it should be noted that the structure shown in fig. 11 is not limited to the electronic device in the embodiment of the present invention, and the electronic device may include more or less components than those shown in fig. 11 or may be combined with some components in practical applications.
Embodiments of the present invention provide a computer-readable storage medium.
The computer readable storage medium provided by the embodiment of the invention stores a computer program, and when the computer program is executed by a processor, the steps of the method for implementing any serial port redirection to a remote device can be implemented.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
For the description of the computer-readable storage medium provided in the embodiment of the present invention, refer to the above method embodiment, and the description of the present invention is omitted here.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The technical scheme provided by the invention is described in detail. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that the present invention may be modified and practiced without departing from the spirit of the present invention.

Claims (19)

1. A method for implementing serial port redirection to a remote device, the method being applied to a serial port redirection client, the serial port redirection client having a redirection service component deployed, the method comprising:
Carrying out parameter adjustment on control equipment and remote equipment by utilizing the current working parameters of the serial port redirection client so as to keep the working parameters of the serial port redirection client, the control equipment and the remote equipment consistent;
acquiring an operation request for the remote equipment initiated by control equipment;
determining equipment information of the control equipment according to the operation request;
the equipment information is sent to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
the sending the device information to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control device according to the device information, including: the equipment information is sent to the redirection service component, so that the redirection service component utilizes the record information to check the equipment information, and after the equipment information passes the check, the target serial port corresponding to the control equipment is determined;
Wherein the redirecting service component verifies the device information by using the record information, including: the redirection service component judges whether the equipment information hits the recorded information, if so, the verification is determined to pass, and the control equipment is determined to be legal equipment; if not, determining that the verification fails, and determining that the control equipment is illegal equipment.
2. The method of claim 1, wherein redirecting the operation request to the remote device using the data transmission channel corresponding to the target serial port comprises:
acquiring the operation authority of the control equipment fed back by the redirection service component to the remote equipment;
judging whether the operation request meets the operation authority or not;
if yes, redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
if not, rejecting the operation request.
3. The method according to claim 1 or 2, wherein prior to the obtaining the operation request for the remote device initiated by the control device, further comprising:
determining the current working parameters of the serial port redirection client;
And sending the current working parameters to the control equipment so that the control equipment adjusts the working parameters according to the current working parameters.
4. A method according to claim 3, wherein said sending the current operating parameter to the control device to cause the control device to adjust its operating parameter in accordance with the current operating parameter comprises:
and sending the current working parameters to the control equipment through a baseboard management controller so that the control equipment adjusts the working parameters according to the current working parameters, wherein the baseboard management controller is deployed at the serial port redirection client.
5. A method according to claim 3, further comprising:
receiving a working parameter acquisition request sent by the remote equipment;
and sending the current working parameters to the remote equipment according to the working parameter acquisition request so that the remote equipment adjusts the working parameters according to the current working parameters.
6. The method of claim 5, wherein receiving the operating parameter acquisition request sent by the remote device comprises:
Receiving an intelligent platform management interface command sent by the remote equipment;
and analyzing and obtaining the working parameter acquisition request according to the intelligent platform management interface command.
7. The method of claim 5, wherein the sending the current operating parameter to the remote device according to the operating parameter acquisition request to cause the remote device to adjust its operating parameter according to the current operating parameter comprises:
and sending the current working parameters to the remote equipment according to the working parameter acquisition request, so that the remote equipment updates the working parameters to the current working parameters by executing an intelligent platform management interface command.
8. A method according to claim 3, further comprising:
acquiring preset working parameters;
and sending the preset working parameters to a baseboard management controller so that the baseboard management controller can set the preset working parameters as the current working parameters, and the baseboard management controller is deployed at the serial port redirection client.
9. The method of claim 1, wherein after redirecting the operation request to the remote device using the data transmission channel corresponding to the target serial port, further comprising:
Receiving a request response fed back by the remote equipment according to the operation request;
the request response is fed back to the control device.
10. A method for implementing serial port redirection to a remote device, wherein the method comprises:
receiving an operation request sent by a serial port redirection client; the operation request is sent to the serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to a target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request; the serial port redirection client is specifically configured to redirect the device information to the remote device through a data transmission channel corresponding to the target serial port after the device information is verified by using the record information; the verification process for the equipment information specifically comprises the following steps: judging whether the equipment information hits the recorded information or not through the redirection service component, if yes, determining that verification is passed, and determining that the control equipment is legal equipment; if not, determining that the verification fails, and determining that the control equipment is illegal equipment;
Processing the operation request to obtain a request response;
feeding back the request response to the serial port redirection client so that the serial port redirection client feeds back the request response to the control equipment;
the remote device and the control device perform local parameter adjustment in advance according to the current working parameters of the serial port redirection client so as to achieve the purpose that the working parameters of the serial port redirection client, the control device and the remote device are kept consistent.
11. The method of claim 10, wherein the remote device has a serial port component and a processing component disposed therein;
the receiving the operation request sent by the serial port redirection client comprises the following steps: receiving the operation request sent by the serial port redirection client by utilizing the serial port component;
the processing the operation request to obtain a request response comprises the following steps: processing the operation request by using the processing component to obtain the request response;
the feeding back the request response to the serial port redirection client comprises: and feeding back the request response to the serial port redirection client by using the serial port component.
12. The method of claim 11, wherein the remote device further has a conversion component disposed therein;
the processing the operation request, before obtaining the request response, further includes: converting the data format of the operation request into a preset format through the conversion component, obtaining a converted operation request, and sending the converted operation request to the processing component;
before the request response is fed back to the serial port redirection client, the method further comprises the following steps: determining an initial format of the operation request; and converting the data format of the request response into the initial format through the conversion component, obtaining a converted request response, and sending the converted request response to the serial port component.
13. The method according to claim 12, wherein the converting, by the converting component, the data format of the operation request into a preset format, obtaining a converted operation request, and sending the converted operation request to the processing component, includes:
judging whether the data format of the operation request is the preset format or not through the conversion component;
If yes, the operation request is sent to the processing component;
if not, converting the data format of the operation request into the preset format, obtaining the converted operation request, and sending the converted operation request to the processing component.
14. The method of claim 10, wherein the remote device further has a storage component disposed therein, the method further comprising:
recording the operation request and the processing information corresponding to the request response;
and storing the operation request, the request response and the processing information through the storage component.
15. The system for realizing the serial port redirection to the remote equipment is characterized by comprising control equipment, a serial port redirection client and the remote equipment, wherein a redirection service component is arranged in the serial port redirection client;
the control device is configured to send an operation request for the remote device to the serial port redirection client;
the serial port redirection client is used for determining equipment information of the control equipment according to the operation request; the equipment information is sent to the redirection service component, so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information after the equipment information is checked by using the record information; the redirection service component records the corresponding relation between the equipment information and the serial ports; redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
The remote equipment is used for receiving the operation request and carrying out request processing on the operation request;
the serial port redirection client is specifically configured to determine, through the redirection service component, whether the device information hits the recorded information, if yes, determine that verification passes, and determine that the control device is legal; if not, determining that the verification fails, and determining that the control equipment is illegal equipment;
the serial port redirection client is also used for carrying out parameter adjustment on the control equipment and the remote equipment by utilizing the current working parameters of the serial port redirection client so as to keep the working parameters of the serial port redirection client, the control equipment and the remote equipment consistent.
16. An implementation apparatus for redirecting a serial port to a remote device, wherein the implementation apparatus is applied to a serial port redirecting client, and a redirecting service component is deployed in the serial port redirecting client, and the apparatus comprises:
the adjusting module is used for carrying out parameter adjustment on the control equipment and the remote equipment by utilizing the current working parameters of the serial port redirection client so as to keep the working parameters of the serial port redirection client, the control equipment and the remote equipment consistent;
The acquisition module is used for acquiring an operation request for the remote equipment, which is initiated by the control equipment;
a determining module, configured to determine device information of the control device according to the operation request;
the sending module is used for sending the equipment information to the redirection service component so that the redirection service component determines a target serial port corresponding to the control equipment according to the equipment information; the redirection service component records the corresponding relation between the equipment information and the serial ports;
the redirecting module is used for redirecting the operation request to the remote equipment by utilizing a data transmission channel corresponding to the target serial port;
the sending module is specifically configured to send the device information to the redirection service component, so that the redirection service component verifies the device information by using the record information, and determines the target serial port corresponding to the control device according to the device information after the verification is passed;
the sending module is specifically configured to determine, through the redirection service component, whether the device information hits the record information, if yes, determine that verification passes, and determine that the control device is legal; if not, determining that the verification fails, and determining that the control equipment is illegal equipment.
17. An apparatus for implementing serial port redirection to a remote device, wherein the apparatus is applied to the remote device, the apparatus comprising:
the receiving module is used for receiving an operation request sent by the serial port redirection client; the operation request is sent to the serial port redirection client by the control device, and the serial port redirection client redirects to the remote device through a data transmission channel corresponding to a target serial port; the target serial port is determined by a redirection service component deployed in the serial port redirection client according to the equipment information of the control equipment; the redirection service component records the corresponding relation between the equipment information and the serial ports; the equipment information is determined by the redirection client according to the operation request; the port redirection client is specifically configured to redirect the device information to the remote device through a data transmission channel corresponding to the target serial port after the device information is verified by using the record information; the verification process for the equipment information specifically comprises the following steps: judging whether the equipment information hits the recorded information or not through the redirection service component, if yes, determining that verification is passed, and determining that the control equipment is legal equipment; if not, determining that the verification fails, and determining that the control equipment is illegal equipment;
The processing module is used for processing the operation request to obtain a request response;
the feedback module is used for feeding back the request response to the serial port redirection client so that the serial port redirection client feeds back the request response to the control equipment;
the remote device and the control device perform local parameter adjustment in advance according to the current working parameters of the serial port redirection client so as to achieve the purpose that the working parameters of the serial port redirection client, the control device and the remote device are kept consistent.
18. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of implementing serial port redirection to a remote device according to any of claims 1 to 14 when said computer program is executed.
19. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the method of serial port redirection to a remote device according to any of claims 1 to 14.
CN202311190091.5A 2023-09-15 2023-09-15 Method, system, equipment and medium for realizing serial port redirection to remote equipment Active CN116932449B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311190091.5A CN116932449B (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for realizing serial port redirection to remote equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311190091.5A CN116932449B (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for realizing serial port redirection to remote equipment

Publications (2)

Publication Number Publication Date
CN116932449A CN116932449A (en) 2023-10-24
CN116932449B true CN116932449B (en) 2023-12-15

Family

ID=88377471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311190091.5A Active CN116932449B (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for realizing serial port redirection to remote equipment

Country Status (1)

Country Link
CN (1) CN116932449B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212334A (en) * 2006-12-26 2008-07-02 环达电脑(上海)有限公司 Serial port data redirecting system and method
CN103051716A (en) * 2012-12-25 2013-04-17 中标软件有限公司 Method and system for redirecting network-oriented serial device
CN106445762A (en) * 2016-08-29 2017-02-22 广州视源电子科技股份有限公司 Complete equipment debugging method and system
CN107153529A (en) * 2016-03-02 2017-09-12 中兴通讯股份有限公司 A kind of embedded software development method, device and platform
WO2017157039A1 (en) * 2016-03-17 2017-09-21 华为技术有限公司 Redirection method, apparatus, and system
CN108460271A (en) * 2016-12-09 2018-08-28 腾讯科技(深圳)有限公司 Terminal identification method and device
CN108540318A (en) * 2018-04-02 2018-09-14 郑州云海信息技术有限公司 A kind of Lower level logical implementation method and device for realizing that serial ports redirects
CN111177052A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 System for redirecting serial port of computer peripheral equipment to network far end
CN112463083A (en) * 2020-12-11 2021-03-09 苏州浪潮智能科技有限公司 Remote collection method and system for information of substrate control manager
CN114020678A (en) * 2021-11-10 2022-02-08 网易(杭州)网络有限公司 Redirection method, device and system for server serial console and electronic equipment
CN115237735A (en) * 2022-07-28 2022-10-25 苏州浪潮智能科技有限公司 Method, device, equipment and medium for collecting logs of serial port of virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7225247B2 (en) * 2002-10-17 2007-05-29 Intel Corporation Serial port redirection using a management controller

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212334A (en) * 2006-12-26 2008-07-02 环达电脑(上海)有限公司 Serial port data redirecting system and method
CN103051716A (en) * 2012-12-25 2013-04-17 中标软件有限公司 Method and system for redirecting network-oriented serial device
CN107153529A (en) * 2016-03-02 2017-09-12 中兴通讯股份有限公司 A kind of embedded software development method, device and platform
WO2017157039A1 (en) * 2016-03-17 2017-09-21 华为技术有限公司 Redirection method, apparatus, and system
CN106445762A (en) * 2016-08-29 2017-02-22 广州视源电子科技股份有限公司 Complete equipment debugging method and system
CN108460271A (en) * 2016-12-09 2018-08-28 腾讯科技(深圳)有限公司 Terminal identification method and device
CN108540318A (en) * 2018-04-02 2018-09-14 郑州云海信息技术有限公司 A kind of Lower level logical implementation method and device for realizing that serial ports redirects
CN111177052A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 System for redirecting serial port of computer peripheral equipment to network far end
CN112463083A (en) * 2020-12-11 2021-03-09 苏州浪潮智能科技有限公司 Remote collection method and system for information of substrate control manager
CN114020678A (en) * 2021-11-10 2022-02-08 网易(杭州)网络有限公司 Redirection method, device and system for server serial console and electronic equipment
CN115237735A (en) * 2022-07-28 2022-10-25 苏州浪潮智能科技有限公司 Method, device, equipment and medium for collecting logs of serial port of virtual machine

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Design And Implementation Of Terminal Redirection For Multi-Forth Processors On Chip;Hui M.等;2023 3rd International Symposium on Computer Technology and Information Science (ISCTIS);全文 *
利用TCP/IP网络实现嵌入式Linux平台串口重定向;李志辉, 李燕新, 查建中;工业控制计算机(第12期);全文 *

Also Published As

Publication number Publication date
CN116932449A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
JP5595490B2 (en) Implementation method, operation method, and system for data card driver without installation
US20080250173A1 (en) Communication adapter and data transfer method of communication adapter
CN106874056A (en) TI C2000 DSP serial ports online upgrading methods based on Ymodem
US20010013540A1 (en) An ic card reading/writing apparatus and an ic card system
US20080307132A1 (en) Expanded Memory for Communications Controller
CN110941444A (en) Upgrade configuration logic circuit, method and system and programmable logic device
CN116932449B (en) Method, system, equipment and medium for realizing serial port redirection to remote equipment
CN105657172A (en) DSP power amplifier interaction system
WO2024032474A1 (en) Device access method, data exchange method and related device
US20070198753A1 (en) Method and protocol for transmitting extended commands to USB devices
US7366957B2 (en) Method and apparatus for controlling SAS/fibre target behavior from a host
US20100106869A1 (en) USB Storage Device and Interface Circuit Thereof
CN115827543A (en) Method, system, device and medium for realizing eSIP communication based on FPGA
US7443886B1 (en) Communication protocol system and method
US20060095643A1 (en) Slave device in information processing system, operation control program for slave device, and operation control method for slave device
KR100306596B1 (en) VLSI Emulator Using Processors and Reconfigurable Chips
CN107885523A (en) A kind of serial ports upgrading software approach of fast and stable
CN115328708A (en) Parameter testing method and device for serial peripheral interface timing sequence
CN114303106A (en) Transmission of diagnostic and/or parametric data between a control module and an input/output module
US20020023245A1 (en) Transmission controlling apparatus, transmission controlling method, data processing unit, and data recording medium
US20190089767A1 (en) File uploading and downloading method based on a smart device
US20210157764A1 (en) Data conversion device and data conversion system
US9043496B2 (en) Bridge circuit
KR100751405B1 (en) An interface device between FPGA and USB
JP2006106999A (en) Programmable controller

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