Data transmission method, device and equipment and computer readable storage medium

By using the serial port redirection component in a cloud computing environment, the monitoring data is forwarded from the client to the server, which solves the problem that the monitoring software cannot upload data without a network connection, and realizes reliable data transmission.

CN119728752AActive Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202412000284.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-28
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In cloud computing, monitoring software cannot upload collected data without a network between the client and the monitoring server, resulting in the inability to be monitored.

Method used

By receiving the target data sent by the client at the first forwarding node and sending it to the serial port redirection component, the serial port redirection component sends the data to the second forwarding node, and finally sends the data to the server.

Benefits of technology

It realizes that data can be sent and received without a network connection between the client and the server, and solves the problem that monitoring data cannot be uploaded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728752A_ABST
    Figure CN119728752A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method, device and equipment and a computer readable storage medium, which are applied to the technical field of data communication and applied to a first forwarding node, and comprises the following steps: receiving target data sent by a client; sending the target data to a serial port redirection component; the serial port redirection component is a component for realizing a virtual serial port on the substrate management controller, and the serial port redirection component is connected with the first forwarding node through the serial port; sending the target data to a second forwarding node by using the serial port redirection component, so that the second forwarding node sends the target data to a server; wherein the first forwarding node is a node connected with the client, and the second forwarding node is a node connected with the server. According to the invention, the first forwarding node is utilized to forward the data of the client, and the serial port redirection component and the second forwarding node are utilized to send the target data to the server, so that the client reports the data to the server in the absence of network connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data communication technology, and in particular to a data transmission method, device, equipment and computer-readable storage medium. Background Art

[0002] Currently, monitoring solutions in cloud computing basically use monitoring software (such as telegraf) to collect data on nodes and send the data to the monitoring server. In practice, if a machine does not have a network connected to the monitoring server, the data collected by the monitoring cannot be uploaded to the monitoring server. In this case, the machine cannot be monitored.

[0003] It can be seen that how to send the monitoring data collected by the monitoring software to the monitoring server when there is no network between the monitoring server and the monitoring software is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a data transmission method, apparatus, device and computer-readable storage medium, which solve the technical problem in the prior art that the client and server cannot communicate in the absence of a network.

[0005] In order to solve the above technical problem, the present invention provides a data transmission method, which is applied to a first forwarding node, comprising:

[0006] Receive target data sent by the client;

[0007] Sending the target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through the serial port;

[0008] The target data is sent to a second forwarding node using the serial port redirection component, so that the second forwarding node sends the target data to a server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0009] In some embodiments, when the client is monitoring software and the server is a monitoring server, before receiving the target data sent by the client, the method further includes:

[0010] Connecting to the first end of the serial port redirection component; wherein the first end of the serial port redirection component is the serial port side;

[0011] Determine that the second forwarding node is connected to the second end of the serial port redirection component; wherein the second end of the serial port redirection component is a local area network side.

[0012] In some embodiments, sending the target data to the serial port redirection component includes:

[0013] Determine the encoding method and decoding method corresponding to the target data currently being transmitted, and send the encoding method and decoding method to the first end and the second end of the serial port redirection component respectively; wherein the encoding method is an encoding method that prevents characters in the data from changing during the transmission process, and the decoding method is a decoding method corresponding to the encoding method;

[0014] Using the first end of the serial port redirection component, encoding the currently transmitted target data based on the encoding method to obtain target encoded data;

[0015] Using the first end of the serial port redirection component to send the target encoded data to the second end of the serial port redirection component, so as to decode the target encoded data using the decoding method based on the second end of the serial port redirection component to obtain target decoded data sent to the second forwarding node;

[0016] Accordingly, using the serial port redirection component to send the target data to the second forwarding node includes:

[0017] The target decoded data is sent to the second forwarding node using the second end of the serial port redirection component.

[0018] In some embodiments, using the first end of the serial port redirection component, encoding the currently transmitted target data based on the encoding method to obtain target encoded data includes:

[0019] When the encoding method is hexadecimal encoding, the target data currently being transmitted is changed from one-byte representation to two-byte representation by using the first end of the serial port redirection component;

[0020] When the encoding method is a special character replacement encoding, the first end of the serial port redirection component is used to determine the characters that will change after transmission from the currently transmitted target data, and the characters that will change are replaced by set characters; wherein the set characters are data that will not change after transmission.

[0021] In some embodiments, before receiving the target data sent by the client, the method further includes:

[0022] Determine whether the network between the client and the server is connected;

[0023] When the network between the client and the server is disconnected, it is determined to execute a step of receiving target data sent by the client.

[0024] In some embodiments, during the target data transmission process, the process further includes:

[0025] Sending a heartbeat packet to the second forwarding node at a set time period;

[0026] If the heartbeat response packet from the second forwarding node is not received within the preset time, the heartbeat packet is resent based on the set number of retries. After the number of retries is reached, it is determined that the heartbeat response packet is not received and the current data communication link is disconnected.

[0027] The present invention also provides a data transmission method, which is applied to a second forwarding node and is characterized by comprising:

[0028] Receive server data sent by the server;

[0029] Sending the server data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the second forwarding node through a network;

[0030] The server data is sent to a first forwarding node using the serial port redirection component, so that the first forwarding node sends the target data to the client; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0031] The present invention also provides a data transmission system, comprising:

[0032] A client, used for data communication with the first forwarding node;

[0033] A first forwarding node, configured to forward the data sent by the client to the serial port of the serial port redirection component, or forward the data sent by the serial port of the serial port redirection component to the client;

[0034] A serial port redirection component, used to implement data communication between the first forwarding node and the second forwarding node;

[0035] A second forwarding node, used for forwarding data sent by the network port of the serial port redirection component to the server, or receiving data sent by the server;

[0036] The server is configured to perform data communication with the second forwarding node.

[0037] The present invention also provides a data transmission device, comprising:

[0038] Memory for storing computer programs;

[0039] A processor is used to execute the computer program to implement the steps of the above data transmission method.

[0040] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.

[0041] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above data transmission method when executed by a processor.

[0042] To solve the above technical problems, an embodiment of the present invention provides a data transmission method, which may include: receiving target data sent by a client; sending the target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with a first forwarding node through the serial port; using the serial port redirection component to send the target data to a second forwarding node, so that the second forwarding node sends the target data to a server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0043] It can be seen from the above technical scheme that the beneficial effect of the present invention is that: compared with the current situation where data can only be sent when there is a network connection between the client and the server, the present invention uses the first forwarding node to receive the client's data without changing the original client, and sends the data to the serial port redirection component, thereby using the serial port redirection component to send the data of the first forwarding node to the second forwarding node, so that the second forwarding node sends the data to the server, thereby realizing data sending even when there is no network between the client and the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 A flowchart of a data transmission method provided by an embodiment of the present invention;

[0046] Figure 2A schematic diagram of a first forwarding node connection relationship provided by an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of a second forwarding node connection relationship provided by an embodiment of the present invention;

[0048] Figure 4 A data transmission method applied to a second forwarding node provided in an embodiment of the present invention;

[0049] Figure 5 A schematic diagram of a data transmission communication link provided by an embodiment of the present invention;

[0050] Figure 6 A schematic diagram of a port connection relationship provided by an embodiment of the present invention;

[0051] Figure 7 A schematic diagram of the structure of a data transmission device applied to a first forwarding node provided by an embodiment of the present invention;

[0052] Figure 8 A schematic diagram of the structure of a data transmission device applied to a second forwarding node provided by an embodiment of the present invention;

[0053] Fig. 9 A schematic diagram of the structure of a data transmission system provided by an embodiment of the present invention;

[0054] Fig.10 A schematic diagram of the structure of a data transmission device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0057] Some of the terms that appear in the description of the embodiments of the present invention may be interpreted as follows:

[0058] IPMI (Intelligent Platform Management Interface) is an open standard that allows system administrators to manage computer systems through an interface that is independent of the operating system and hardware manufacturer. IPMI provides a standardized method to monitor system health, event logs, power management, temperature, fan speed, voltage and other information, as well as remote control and recovery of the system.

[0059] BMC (Baseboard Management Controller) is an embedded management microcontroller used to monitor and manage the physical environment of the server. It is usually integrated on the server's motherboard, but can also exist as an independent hardware component. The main functions of BMC include monitoring the hardware status of the server (such as power supply, fan, temperature sensor, etc.), providing remote management interfaces (such as IPMI, Intelligent Platform Management Interface, Intelligent Platform Management Interface), logging, and system recovery.

[0060] ipmitool is a widely used command line tool in Linux systems that allows users to manage and monitor computer hardware through the IPMI standard. IPMI is an open standard hardware management interface specification that defines a specific method for embedded management subsystems to communicate.

[0061] SOL (Serial-over-LAN) is a remote access technology that allows users to remotely access the serial port of a server through a network (LAN) connection. This technology is often used for remote diagnosis and troubleshooting because it allows administrators to access the console of a server from a remote location.

[0062] Monitoring: The monitoring in this article refers to other general monitoring software, such as telegraf.

[0063] Monitoring server: The monitoring server in this article refers to the server that needs to send the data collected by the monitoring software. This server is the monitoring server. This monitoring server is responsible for collecting data from the monitoring software on multiple machines.

[0064] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0065] Next, a flowchart of a data transmission method applied to a first forwarding node provided by an embodiment of the present invention is described in detail. Figure 1A data transmission method applied to a first forwarding node provided in an embodiment of the present invention may include:

[0066] S101, receiving target data sent by the client.

[0067] The execution subject of this embodiment is the first forwarding node. The address of the network server created by the first forwarding node in this embodiment is consistent with the address of the client, and a connection is established between the client and the network server. If a client establishes a connection with the network server of the first forwarding node, the network server can communicate data with the client, and the first forwarding node forwards the received data sent by the client by writing it into the serial port. This embodiment does not limit the specific client. For example, the client in this embodiment can be monitoring software, or the client in this embodiment can also be remote control software, which allows users to remotely control another computer through the Internet or a local area network to perform file transfer, screen sharing and remote operation, etc.; or the client in this embodiment can also be network management software, which is used to monitor changes in website content to ensure the normal operation of the website and the accuracy of data. This type of software usually needs to communicate with the server to obtain web page content and update status. This embodiment does not limit specific target data. For example, the target data in this embodiment can be monitoring data; or the target data in this embodiment can be communication data.

[0068] It should be further explained that before receiving the target data sent by the client, the following may also be included:

[0069] Determine whether the network between the client and the server is connected; when the network between the client and the server is not connected, determine to execute the step of receiving the target data sent by the client. This embodiment will only execute the step of receiving the target data sent by the client when the client and the server are not connected, and when the network between the client and the server is connected, the target data can be directly transmitted based on the network without being transmitted based on the data transmission method provided by the present invention. The embodiment of the present invention determines the network connectivity of the corresponding server and the client, so that the transmission method of the target data can be determined based on the connectivity result, thereby improving the accuracy of the target data transmission.

[0070] It should be further explained that when the client is monitoring software and the server is a monitoring server, before receiving the target data sent by the client, it can also include: connecting with the first end of the serial port redirection component; wherein the first end of the serial port redirection component is the serial port side; determining that the second forwarding node is connected to the second end of the serial port redirection component; wherein the second end of the serial port redirection component is the local area network side. The serial port side in this embodiment is Serial, and the local area network side in this embodiment is LAN side. For ease of understanding, please refer to Figure 2, Figure 2 A schematic diagram of a first forwarding node connection relationship provided by an embodiment of the present invention, from Figure 2 It can be seen that the first forwarding node creates a TCP network server (address is 127.0.0.1) and allows tcp-client (that is, the monitoring software to establish a connection). If a monitoring software tcp-client establishes a connection with the TCP-server of forwarding node B, the TCP-server can communicate data with the TCP-client, and node B forwards the data sent by the monitoring software tcp-client to B's tcp-server (the part with number 1) by writing it to the serial port (the part with number 2). The first forwarding node will continuously read the serial port to see if there is any data coming in (the part with number 3), that is, serial port reading. The data read is the data sent from the LAN side, and then the read data is sent to the tcp-client of the monitoring software (the part with number 4) through the tcp-server. For ease of understanding, please refer to Figure 3 , Figure 3 A schematic diagram of a second forwarding node connection relationship provided by an embodiment of the present invention, from Figure 3 It can be seen that the second forwarding node establishes a SOL connection through tools or commands related to the BMC-SOL function, and then uses input and output to take over the connection. Input is equivalent to sending data to the serial port through SOL (part of number 5). Output is equivalent to being able to read data sent from the serial port (part of number 6). The second forwarding node establishes a tcp-client and a monitoring server connection (numbers 9 and 10). If the output reads data, that is, data is sent from the serial port, it is equivalent to the monitoring software client sending data. The second forwarding node sends the output data to the tcp-server of the monitoring server through the tcp-client of the second forwarding node (part of number 7). If the tcp-client of the second forwarding node has data sent from the monitoring server, node A forwards the data to the input, and the data can be sent to the serial port (part of number 8). This embodiment enables the entire technical solution to be implemented by providing a specific connection relationship between the first forwarding node and the second forwarding node, thereby improving the accuracy of the data communication link connection.

[0071] It should be further explained that, based on the above embodiment, the sending of the target data to the serial port redirection component may include:

[0072] S1, determine the encoding method and decoding method corresponding to the target data currently being transmitted, and send the encoding method and decoding method to the first end and the second end of the serial port redirection component respectively; wherein the encoding method is an encoding method that ensures that the characters in the data will not change during the transmission process, and the decoding method is a decoding method corresponding to the encoding method.

[0073] The encoding method in this embodiment is such that the target data does not change during the process of sending the target data from the first end of the SOL to the second end of the SOL.

[0074] S2, using the first end of the serial port redirection component, encoding the currently transmitted target data based on the encoding method to obtain target encoded data.

[0075] S3, using the first end of the serial port redirection component to send the target encoded data to the second end of the serial port redirection component, and decoding the target encoded data based on the second end of the serial port redirection component using a decoding method to obtain target decoded data sent to the second forwarding node.

[0076] The target data in this embodiment is the same as the target decoded data.

[0077] Accordingly, using the serial port redirection component to send the target data to the second forwarding node may include:

[0078] S4, using the second end of the serial port redirection component to send the target decoded data to the second forwarding node.

[0079] This embodiment adjusts the characters of the target data through the set encoding mode and decoding mode to prevent the characters from changing during the transmission process, thereby preventing the transmitted target data from being inaccurate.

[0080] It should be further explained that, based on the above embodiment, using the first end of the serial port redirection component to encode the currently transmitted target data based on the encoding method to obtain the target encoded data may include:

[0081] When the encoding method is hexadecimal encoding, the first end of the serial port redirection component is used to determine that the target data currently being transmitted is represented by one byte and changed to two bytes; when the encoding method is special character replacement encoding, the first end of the serial port redirection component is used to determine the characters that will change after transmission from the target data currently being transmitted, and replace the characters that will change with set characters; wherein the set characters are data that will not change after transmission. For example, the hexadecimal encoding in this embodiment refers to changing the data from one byte to two bytes. The content of the data is re-encoded before the SOL connection is transmitted, and the data is decoded after being transmitted to the other end. For example, a byte (8bit), the first 4 bits and the last 4 bits are represented by one byte respectively. For example: the byte value of the character "0" is represented in hexadecimal as: 0X30, 3 is the hexadecimal value of the first 4 bits, and 0 is the value of the last 4 bits. After encoding, the two characters "30" represent the "0" of the original data. The decoding process is the opposite of the encoding process. This embodiment does not limit specific special characters. For example, the special characters in this embodiment are characters that will not change. For example, the special characters in this embodiment may be A, or the special characters in this embodiment may also be B. This embodiment does not limit how to determine the characters that will change after transmission. For example, this embodiment may obtain a list of multiple characters that will change after multiple experiments. When determining the characters that will change, they may be determined directly according to the list; or this embodiment may also determine all characters that may change by transmitting data to SOL. The special character replacement encoding in this embodiment refers to replacing the characters that will change in the data after SOL transmission with character A, and then sending the information of the replacement characters (including content and position) to the opposite end after the transmission is completed, and the opposite end decodes the received data. Replace special data in the data, for example, "0" will change after SOL transmission, all "0" in the original data are replaced with "A", "A" will not change after transmission, record the position of the data "0", and after the data is transmitted, transmit a corrected content. For example, when transmitting data "0123455678", "0" is replaced by "A", and the transmitted data becomes "A12345678". After the transmission, a correction data "[position] [original data]" is transmitted. For example, the correction data "1, 1" is transmitted, indicating that the first character belongs to the first case of replacement (that is, 0 is replaced by A), and then the first character is restored to 0. This embodiment prevents the characters from changing and affecting the accuracy of the transmitted data by encoding and decoding the characters.

[0082] It should be further explained that, based on the above embodiment, in order to improve the accuracy of target data transmission, when the target data is sent to the second forwarding node using the serial port redirection component, it can include: encrypting the target data using a data encryption method to obtain encrypted data, and caching the target data at the same time; when the second end of the serial port redirection component decrypts the encrypted data to obtain the decrypted target data, the decrypted target data is verified, and when it is determined that the target data has not changed, the cached target data is deleted, otherwise it is determined that the target data is encoded before transmission. The embodiment of the present invention ensures the accuracy of target data transmission based on encryption, decryption and verification.

[0083] S102, sending target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through the serial port.

[0084] The serial port redirection component in this embodiment is SOL (Serial-over-LAN), which is a remote access technology that allows users to remotely access the serial port of the server through a network (LAN) connection. This technology is often used for remote diagnosis and troubleshooting because it allows administrators to access the server console from a remote location. It is to redirect the serial controller of the BMC during the IPMI (Intelligent Platform Management Interface) connection phase. A communication link based on the BMC-SOL function can be established through the ipmitool (command line tool) command. One end of this link is a UDP (User Datagram Protocol) connection and the other end is a serial port. After this link is established, data transmission can be carried out. In the following text, the SOL connection is directly used to represent this link. The two ends of SOL include the LAN (network) side and the Serial (serial port) side. The first forwarding node in this embodiment is connected to the serial port side of SOL.

[0085] S103, using the serial port redirection component to send the target data to the second forwarding node, so that the second forwarding node sends the target data to the server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0086] In this embodiment, the second forwarding node is connected to the server, the second forwarding node is connected to the network side of the SOL, and the second forwarding node establishes a tcp-client (transmission control protocol client) connection with the monitoring server.

[0087] It should be further explained that in order to improve communication efficiency, during the above-mentioned target data transmission process, it can also include: sending a heartbeat packet to the second forwarding node in a set time period; if the heartbeat response packet of the second forwarding node is not received within the preset time, determining to resend the heartbeat packet based on the set number of retries, after reaching the number of retries, determining that the heartbeat response packet is not received, and determining that the current data communication link is not connected. In this embodiment, during the process, real-time monitoring is performed on whether the data communication link composed of the client, the first forwarding node, the SOL, the second forwarding node and the server is connected. When it is not connected, it will be processed in time to prevent the content from being sent when the data communication link is not connected.

[0088] The data transmission method provided by the embodiment of the present invention may include: S101, receiving target data sent by the client; S102, sending the target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on the baseboard management controller, and the serial port redirection component establishes a connection with a first forwarding node through the serial port; S103, using the serial port redirection component to send the target data to a second forwarding node, so that the second forwarding node sends the target data to a server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server. Compared with the current situation where data can only be sent when there is a network connection between the client and the server, the present invention uses the first forwarding node to receive the data of the client without changing the original client, and sends the data to the serial port redirection component, thereby using the serial port redirection component to send the data of the first forwarding node to the second forwarding node, so that the second forwarding node sends the data to the server, and realizes that data can be sent even when there is no network between the client and the server.

[0089] In order to make the present invention easier to understand, please refer to Figure 4 , Figure 4 A data transmission method applied to a second forwarding node provided in an embodiment of the present invention may include:

[0090] S201, receiving server data sent by a server.

[0091] The execution subject of this embodiment is the second forwarding node.

[0092] S202, sending the server data to the serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on the baseboard management controller, and the serial port redirection component establishes a connection with the second forwarding node through the network;

[0093] S203, using the serial port redirection component to send the server data to the first forwarding node, so that the first forwarding node sends the target data to the client; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0094] The embodiment of the present invention can realize the functions of the client when the client has no network connection with the server. It reduces the use of the network and physical network card. Since the network connection is no longer required, the use of network equipment and network IP addresses can be saved, making it feasible for the client to have no internal network (the BMC network needs to be connected).

[0095] In order to make the present invention easier to understand, please refer to Figure 5 , Figure 5 A schematic diagram of a data transmission communication link provided by an embodiment of the present invention, from Figure 5 It can be seen that the nodes in the data transmission communication link include monitoring software, forwarding node A (corresponding to the second forwarding node above), forwarding node B (corresponding to the first forwarding node above), LAN side, serial side and monitoring server. The communication link has two directions. First, the monitoring software sends data to forwarding node B, forwarding node B sends data to the serial side, the data reaches the LAN side through the SOL connection, the data is sent to forwarding node A, and the data is sent from forwarding node A to the monitoring server. First, from the monitoring server to the monitoring software, the data direction is the opposite process.

[0096] As a client, the monitoring software needs to connect to a server connected to the network. Forwarding node B is the server end of a network connection. After receiving the data, the server of forwarding node B forwards the data to the serial port. The SOL in the figure is the data transmission link on the LAN side---Serial side. The data forwarded to the serial port by forwarding node B is transmitted to the LAN side. The LAN side is a client of a UDP network connection. It is represented by UDP-C later. Forwarding node A takes over the UDP client on the LAN side by marking the input and output (stdio) and forwards the data to the monitoring server. Since the monitoring server is the server end of a TCP network connection, forwarding node A is connected to the monitoring server through a client end of a TCP network connection. For ease of understanding, please refer to Figure 6 , Figure 6 A schematic diagram of a port connection relationship provided by an embodiment of the present invention, Figure 6Socket is a key abstract layer in computer networks that allows applications to communicate over the network. The working principle of Socket mainly involves two parts: server and client. Assume that the address of the monitoring server is ip-server and the port is 6000. The monitoring software needs to send the monitored data to ip-server. The process of constructing a communication link can include: 1. Modify the address and port of the monitoring server in the monitoring software configuration, modify the configuration, and the monitoring software will send the data to 127.0.0.1 (local) port 6000. 2. Data node B in the figure starts a socket server program, which listens to port 6000. When the monitoring software connects to the data node B program, or the monitoring software sends data to port 6000 of 127.0.0.1 (data node B), data node B will send the data to the serial side of the SOL connection. 3. After the data passes through the SOL connection, the data sent to the serial side in step 2 will reach the LAN side. After the LAN side receives the data, it establishes a data node A. Data node A is a socket client and connected to the monitoring server. 4. The data is sent to the monitoring server through data node A.

[0097] The present invention mainly solves the problem of transmission of monitoring data without network connection, and sends the monitoring data to the monitoring server through the function of BMC-SOL, so as to collect monitoring data and monitor the machine only with BMC network.

[0098] The following is an introduction to a data transmission device applied to a first forwarding node provided in an embodiment of the present invention. The data transmission device applied to a first forwarding node described below and the data transmission method applied to a first forwarding node described above can refer to each other.

[0099] Figure 7 A schematic structural diagram of a data transmission device applied to a first forwarding node provided in an embodiment of the present invention may include:

[0100] The target data receiving module 100 is used to receive the target data sent by the client;

[0101] A first data transmission module 200, configured to send the target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through the serial port;

[0102] The second data transmission module 300 is used to use the serial port redirection component to send the target data to the second forwarding node, so that the second forwarding node sends the target data to the server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0103] Further, based on the above embodiment, the above data transmission device may further include:

[0104] A first connection module, used to connect to the first end of the serial port redirection component; wherein the first end of the serial port redirection component is the serial port side;

[0105] The second connection module is used to determine that the second forwarding node is connected to the second end of the serial port redirection component; wherein the second end of the serial port redirection component is a local area network side.

[0106] Further, based on the above embodiment, the first data transmission module 200 may include:

[0107] The encoding mode and decoding mode determining unit is used to determine the encoding mode and decoding mode corresponding to the target data currently being transmitted, and send the encoding mode and decoding mode to the first end and the second end of the serial port redirection component respectively; wherein the encoding mode is an encoding mode that makes the characters in the data not change during the transmission process, and the decoding mode is a decoding method corresponding to the encoding mode;

[0108] A target coded data determining unit, configured to encode the currently transmitted target data based on the encoding method using the first end of the serial port redirection component to obtain target coded data;

[0109] a decryption unit, configured to send the target encoded data to the second end of the serial port redirection component by using the first end of the serial port redirection component, so as to decode the target encoded data by using the decoding method based on the second end of the serial port redirection component, and obtain target decoded data to be sent to the second forwarding node;

[0110] Accordingly, the second data transmission module 300 includes:

[0111] The second data transmission unit is used to send the target decoded data to the second forwarding node by using the second end of the serial port redirection component.

[0112] Further, based on the above embodiment, the above target coding data determination unit may include:

[0113] A hexadecimal encoding unit, used for, when the encoding mode is hexadecimal encoding, using the first end of the serial port redirection component to determine that the target data currently being transmitted is changed from being represented by one byte to being represented by two bytes;

[0114] A special character encoding unit is used to determine the characters that will change after transmission from the target data currently being transmitted using the first end of the serial port redirection component when the encoding method is special character replacement encoding, and replace the characters that will change with set characters; wherein the set characters are data that will not change after transmission.

[0115] Further, based on any of the above embodiments, the above data transmission device may further include:

[0116] A judgment module, used to determine whether the network between the client and the server is connected;

[0117] The network disconnection determination unit is used to determine to execute the step of receiving the target data sent by the client when the network between the client and the server is disconnected.

[0118] Further, based on any of the above embodiments, the above data transmission device may further include:

[0119] A heartbeat packet sending unit, configured to send a heartbeat packet to the second forwarding node at a set time period;

[0120] The data communication link disconnection determination unit is used to determine whether to resend the heartbeat packet based on a set number of retries if the heartbeat response packet from the second forwarding node is not received within a preset time. After the number of retries is reached, it is determined that the heartbeat response packet has not been received, and the current data communication link is determined to be disconnected.

[0121] It should be noted that the order of the modules and units in the data transmission device applied to the first forwarding node can be changed without affecting the logic.

[0122] Figure 7 The description of the features in the corresponding embodiments can be found in Figure 7 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.

[0123] The data transmission device applied to the first forwarding node provided by the embodiment of the present invention may include: a target data receiving module 100, which is used to receive the target data sent by the client; a first data transmission module 200, which is used to send the target data to the serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on the baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through the serial port; a second data transmission module 300, which is used to send the target data to the second forwarding node by using the serial port redirection component, so that the second forwarding node sends the target data to the server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server. Compared with the current situation that data can only be sent when there is a network connection between the client and the server, the present invention uses the first forwarding node to receive the data of the client without changing the original client, and sends the data to the serial port redirection component, so that the serial port redirection component is used to send the data of the first forwarding node to the second forwarding node, so that the second forwarding node sends the data to the server, and realizes that data can be sent even when there is no network between the client and the server.

[0124] The following is an introduction to a data transmission device applied to a second forwarding node provided in an embodiment of the present invention. The data transmission device applied to a second forwarding node described below and the data transmission method applied to a second forwarding node described above can refer to each other.

[0125] Figure 8 A schematic structural diagram of a data transmission device applied to a second forwarding node provided in an embodiment of the present invention may include:

[0126] The server data receiving module 400 is used to receive server data sent by the server;

[0127] The server data sending module 500 is used to send the server data to the serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on the baseboard management controller, and the serial port redirection component establishes a connection with the second forwarding node through the network;

[0128] The sending to client module 600 is used to use the serial port redirection component to send the server data to the first forwarding node, so that the first forwarding node sends the target data to the client; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

[0129] The following is an introduction to a data transmission system provided by an embodiment of the present invention. The data transmission system described below and the data transmission method described above can be referenced to each other.

[0130] Fig. 9 A structural diagram of a data transmission system provided in an embodiment of the present invention may include:

[0131] The client 10 is used to communicate data with the first forwarding node;

[0132] A first forwarding node 20, configured to forward the data sent by the client to the serial port of the serial port redirection component, or forward the data sent by the serial port of the serial port redirection component to the client;

[0133] A serial port redirection component 30, used to implement data communication between the first forwarding node and the second forwarding node;

[0134] A second forwarding node 40 is used to forward data sent by the network port of the serial port redirection component to the server, or receive data sent by the server;

[0135] The server 50 is configured to perform data communication with the second forwarding node.

[0136] A data transmission device provided in an embodiment of the present invention is introduced below. The data transmission device described below and the data transmission method described above can refer to each other.

[0137] Fig.10 A schematic diagram of the structure of a data transmission device provided by an embodiment of the present invention is shown in FIG. Fig.10 As shown, the data transmission device includes: a memory 60 for storing a computer program;

[0138] The processor 61 is used to implement the steps of the data transmission method in the above embodiment when executing a computer program.

[0139] The data transmission device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0140] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0141] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein the computer program can implement the relevant steps of the data transmission method disclosed in any of the aforementioned embodiments after being loaded and executed by the processor 61. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include but is not limited to data transmission data, etc.

[0142] In some embodiments, the data transmission device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .

[0143] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the data transmission device, and may include more or fewer components than shown in the figure.

[0144] It is understandable that if the data transmission method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.

[0145] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.

[0146] Based on this, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above data transmission method when executed by a processor.

[0147] The above is a detailed introduction to a data transmission method provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. 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 parts can be referred to the method part description.

[0148] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0149] The above is a detailed introduction to a data transmission method, device, equipment and computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A data transmission method, characterized in that: Applied to the first forwarding node, comprising: Receive target data sent by the client; Sending the target data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through the serial port; The target data is sent to a second forwarding node using the serial port redirection component, so that the second forwarding node sends the target data to a server; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

2. The data transmission method according to claim 1, characterized in that: When the client is monitoring software and the server is a monitoring server, before receiving the target data sent by the client, the method further includes: Connecting to the first end of the serial port redirection component; wherein the first end of the serial port redirection component is the serial port side; Determine that the second forwarding node is connected to the second end of the serial port redirection component; wherein the second end of the serial port redirection component is a local area network side.

3. The data transmission method according to claim 2, characterized in that: Sending the target data to the serial port redirection component includes: Determine the encoding method and decoding method corresponding to the target data currently being transmitted, and send the encoding method and decoding method to the first end and the second end of the serial port redirection component respectively; wherein the encoding method is an encoding method that prevents characters in the data from changing during the transmission process, and the decoding method is a decoding method corresponding to the encoding method; Using the first end of the serial port redirection component, encoding the currently transmitted target data based on the encoding method to obtain target encoded data; Using the first end of the serial port redirection component to send the target encoded data to the second end of the serial port redirection component, so as to decode the target encoded data using the decoding method based on the second end of the serial port redirection component to obtain target decoded data sent to the second forwarding node; Accordingly, using the serial port redirection component to send the target data to the second forwarding node includes: The target decoded data is sent to the second forwarding node using the second end of the serial port redirection component.

4. The data transmission method according to claim 3, characterized in that: Using the first end of the serial port redirection component, encoding the currently transmitted target data based on the encoding method to obtain target encoded data, including: When the encoding method is hexadecimal encoding, the target data currently being transmitted is changed from one-byte representation to two-byte representation by using the first end of the serial port redirection component; When the encoding method is a special character replacement encoding, the first end of the serial port redirection component is used to determine the characters that will change after transmission from the currently transmitted target data, and the characters that will change are replaced by set characters; wherein the set characters are data that will not change after transmission.

5. The data transmission method according to claim 1, characterized in that: Before receiving the target data sent by the client, the method further includes: Determine whether the network between the client and the server is connected; When the network between the client and the server is disconnected, it is determined to execute a step of receiving target data sent by the client.

6. The data transmission method according to claim 1, characterized in that: The process of transmitting the target data further includes: Sending a heartbeat packet to the second forwarding node at a set time period; If the heartbeat response packet from the second forwarding node is not received within a preset time, the heartbeat packet is resent based on a set number of retries. After the number of retries is reached, it is determined that the heartbeat response packet is not received and the current data communication link is disconnected.

7. A data transmission method, characterized in that: Applied to a second forwarding node, characterized by comprising: Receive server data sent by the server; Sending the server data to a serial port redirection component; wherein the serial port redirection component is a component that implements a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the second forwarding node through a network; The server data is sent to a first forwarding node using the serial port redirection component, so that the first forwarding node sends the target data to the client; wherein the first forwarding node is a node connected to the client, and the second forwarding node is a node connected to the server.

8. A data transmission system, characterized in that: include: A client, used for data communication with the first forwarding node; A first forwarding node, configured to forward the data sent by the client to the serial port of the serial port redirection component, or forward the data sent by the serial port of the serial port redirection component to the client; A serial port redirection component, used to implement data communication between the first forwarding node and the second forwarding node; A second forwarding node, used for forwarding data sent by the network port of the serial port redirection component to the server, or receiving data sent by the server; The server is configured to perform data communication with the second forwarding node.

9. A data transmission device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the data transmission method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data transmission system and method

    CN101064659A

  • Serial port debugging method and device, computer equipment and storage medium

    CN116483635A

  • File transmission method and device, equipment and medium

    CN116996504A

  • Data communication method and device, computer equipment, storage medium and program product

    CN119094611A

  • Securing serial console redirection via serial-over-LAN (SOL)

    US20070118641A1