A data transmission method, system, device and computer readable storage medium

By implementing a serial port redirection component on the baseboard management controller, the data transmission problem when the monitoring server and monitoring software have no network connection is solved, enabling data transmission in the absence of a network and ensuring data accuracy and reliability.

CN119728752BActive Publication Date: 2025-12-12INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In cloud computing, when there is no network connection between the monitoring server and the monitoring software, the monitoring data cannot be uploaded to the monitoring server, resulting in the machine being unable to be monitored.

Method used

By using a serial port redirection component implemented on the baseboard management controller, client data is forwarded to a second forwarding node for transmission to the server. The serial port redirection component is used for data encoding and decoding to ensure data transmission even without a network connection.

Benefits of technology

It enables the successful transmission of monitoring data to the server even without a network connection between the client and the server, ensuring the accuracy and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728752B_ABST
    Figure CN119728752B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method, device and equipment and a computer readable storage medium, and is applied to the technical field of data communication and 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 implementing a virtual serial port on a baseboard management controller, and the serial port redirection component is connected with the first forwarding node through a serial port; the target data is sent 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. The application forwards the data of the client by using the first forwarding node, sends the target data to the server by using the serial port redirection component and the second forwarding node, and realizes that the client reports data to the server without network connection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data communication, and in particular to a data transmission method, device, equipment and computer readable storage medium. BACKGROUND

[0002] At present, the monitoring scheme in cloud computing basically collects data on nodes through monitoring software (for example, telegraf), and sends the data to a monitoring server. In practice, if a machine has no network connected to the monitoring server, the monitoring collected data cannot be uploaded to the monitoring server, and 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 in the case that there is no network between the monitoring server and the monitoring software is a technical problem that needs to be solved by those skilled in the art. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a data transmission method, device, equipment and computer readable storage medium, which solves the technical problem that the client and the server cannot communicate in the prior art without network.

[0005] To solve the above technical problems, the present application provides a data transmission method applied to a first forwarding node, comprising:

[0006] receiving target data sent by a client;

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

[0008] 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.

[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 comprises:

[0010] connecting with a first end of the serial port redirection component; wherein the first end of the serial port redirection component is a serial port side;

[0011] determining that the second forwarding node is connected with a 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 comprises:

[0013] determining an encoding mode and a decoding mode corresponding to the target data currently being transmitted, and sending the encoding mode and the 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 does not change characters in the data during transmission, and the decoding mode is a decoding method corresponding to the encoding mode;

[0014] encoding the target data currently being transmitted based on the encoding mode using the first end of the serial port redirection component to obtain target encoded data;

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

[0016] Correspondingly, sending the target data to the second forwarding node using the serial port redirection component comprises:

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

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

[0019] when the encoding mode is hexadecimal encoding, changing one-byte representation of the target data currently being transmitted to two-byte representation using the first end of the serial port redirection component;

[0020] when the encoding mode is special character replacement encoding, determining characters in the target data currently being transmitted that will change after transmission using the first end of the serial port redirection component, and replacing the characters that will change after transmission with a set character; wherein the set character is data that will not change after transmission.

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

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

[0023] When the network between the client and the server is not connected, it is determined to receive the target data sent by the client.

[0024] In some embodiments, during the transmission of the target data, further comprising:

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

[0026] If the heartbeat response packet of the second forwarding node is not received within a preset time, it is determined to resend the heartbeat packet based on a set number of retries, and after the number of retries is reached, it is determined that the heartbeat response packet is not received, and it is determined that the current data communication link is not connected.

[0027] The application also provides a data transmission method applied to a second forwarding node, characterized in that it comprises:

[0028] receiving server data sent by a server;

[0029] sending the server data to a serial port redirection component; wherein the serial port redirection component is a component for implementing 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] sending the server data to a first forwarding node by using the serial port redirection component, so that the first forwarding node sends the target data to a client; wherein the first forwarding node is a node connected with the client, and the second forwarding node is a node connected with the server.

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

[0032] a client for performing data communication with a first forwarding node;

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

[0034] a serial port redirection component for implementing data communication between the first forwarding node and a second forwarding node;

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

[0036] a server for performing data communication with the second forwarding node.

[0037] The application further provides a data transmission device, comprising:

[0038] a memory for storing a computer program;

[0039] a processor for executing the computer program to implement the steps of the above data transmission method.

[0040] The application further provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the above data transmission method.

[0041] The application further provides a computer program product, which comprises a computer program / instruction, and the computer program / instruction, when executed by a processor, implements the steps of the above data transmission method.

[0042] To solve the above technical problem, the application provides a data transmission method, which can comprise: 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 for implementing a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with a first forwarding node through a 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.

[0043] From the above technical solution, it can be seen that the application has the beneficial effect that, compared with the current situation that data can only be sent when a network connection exists between a client and a server, the application, without changing the original client, uses a first forwarding node to undertake the data of the client, sends the data to a serial port redirection component, and then uses the serial port redirection component to send the data of the first forwarding node to a second forwarding node, so that the second forwarding node sends the data to a server, thereby realizing the sending of data when no network exists between the client and the server. BRIEF DESCRIPTION OF DRAWINGS

[0044] To more clearly illustrate the application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0045] Figure 1 A flowchart of a data transmission method provided by the application;

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

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

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

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

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

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

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

[0053] Figure 9 A data transmission system structure schematic diagram provided by the embodiment of the present application;

[0054] Figure 10 A data transmission device structure schematic diagram provided by the embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0056] The terms “include” and “have” and any variations of the terms “include” and “have” in the specification and the above drawings of the present application are intended to cover the non-exclusive inclusion. 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 can include steps or units not listed.

[0057] Some nouns appearing in the description of the embodiments of the present application or belonging to the following explanations:

[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 for monitoring system health, event logs, power management, temperature, fan speed, voltage, and other information, as well as performing 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 a server. It is usually integrated on the motherboard of the server, but can also exist as a separate hardware component. The main functions of BMC include monitoring the hardware status of the server (such as power supply, fan, temperature sensor, etc.), providing a remote management interface (such as IPMI, Intelligent Platform Management Interface), logging, and system recovery, etc.

[0060] ipmitool is a command-line tool widely used 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 specific methods for communication between embedded management subsystems.

[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). This technology is commonly used for remote diagnosis and troubleshooting, as it allows administrators to access the server console from a remote location.

[0062] Monitoring: In this context, monitoring refers to other general-purpose monitoring software, such as telegraf.

[0063] Monitoring server: In this context, the monitoring server refers to the server to which the monitoring software collects data and sends it. This server is responsible for collecting data from multiple machines running monitoring software.

[0064] In order to better understand the present application by those skilled in the art, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0065] Next, the flowchart of a data transmission method applied to a first forwarding node provided by the embodiment of the present application is described in detail. Figure 1A data transmission method applied to a first forwarding node is provided in the embodiment of the present application, and the method can include the following steps:

[0066] In S101, target data sent by a client is received.

[0067] The first forwarding node in the embodiment creates a network server with the same address as that of the client, and establishes a connection between the client and the network server. If the client establishes a connection with the network server of the first forwarding node, the network server can communicate with the client, and the first forwarding node transmits the data sent by the client by writing the data into a serial port. The embodiment is not limited to a specific client. For example, the client in the embodiment can be monitoring software, or the client in the embodiment can also be remote control software, which allows a user to remotely control another computer through the Internet or a local area network, and perform file transmission, screen sharing, remote operation, etc.; or the client in the embodiment can also be network management software, which is used to monitor changes in website content, and ensure the normal operation of the website and the accuracy of the data. Such software usually needs to communicate with the server to obtain web page content and update status. The embodiment is not limited to a specific target data. For example, the target data in the embodiment can be monitoring data; or the target data in the embodiment can be communication data.

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

[0069] It is determined whether the network between the client and the server is connected; and when the network between the client and the server is not connected, the step of receiving the target data sent by the client is determined to be performed. The embodiment only performs 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 the need for transmission based on the data transmission method provided by the present application. The embodiment determines the transmission mode of the target data based on the network connectivity of the corresponding server and client, so as to improve 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, the following steps can also be included: connecting with a first end of a serial port redirection component; wherein the first end of the serial port redirection component is a serial port side; determining that a second forwarding node is connected with a second end of the serial port redirection component; wherein the second end of the serial port redirection component is a local area network side. The serial port side in the embodiment is Serial, and the local area network side in the embodiment is LAN side. For ease of understanding, please refer to Figure 2, Figure 2 A schematic diagram of a connection relationship of a first forwarding node provided for an embodiment of the present application is shown in FIG. 1. Figure 2 As can be seen, the first forwarding node creates a TCP network server (address is 127.0.0.1) allowing the tcp-client (i.e. the monitoring software to establish a connection). If the monitoring software tcp-client and the TCP-server of the forwarding node B establish a connection, the TCP-server can communicate data with the TCP-client, and the node B sends the data (part of number 1) from the monitoring software tcp-client to the tcp-server of B to the outside through the way of writing to the serial port (part of number 2). The first forwarding node will continuously read whether there is data coming in from the serial port (part of number 3), i.e. serial port reading. The read data is the data sent from the LAN side, and then the read data is sent to the tcp-client of the monitoring software through the tcp-server (part of number 4). For the convenience of understanding, please refer to FIG. 2. Figure 3 , Figure 3 A schematic diagram of a connection relationship of a second forwarding node provided for an embodiment of the present application is shown in FIG. 3. Figure 3 As can be seen, the second forwarding node establishes a SOL connection through a tool or a command related to the BMC-SOL function, and then uses the input and output to take over the connection. The input is equivalent to sending data to the serial port side through the SOL (part of number 5). The output is equivalent to reading the data sent from the serial port side (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, i.e. there is data sent from the serial port side, it is equivalent to that the monitoring software client has data sent. 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, the node A forwards the data to the input, and the data can be sent to the serial port (part of number 8). The embodiment shows the specific connection relationship of the first forwarding node and the second forwarding node, so that the whole technical scheme can be implemented, and the accuracy of the data communication link connection is improved.

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

[0072] S1, determine the encoding mode and decoding mode corresponding to the target data of the current transmission, 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 does not change the characters in the data during transmission, and the decoding mode is a decoding method corresponding to the encoding mode.

[0073] The encoding mode in this embodiment is a mode that does not change the target data 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 target data of the current transmission based on the encoding mode 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, so as to decode the target encoded data based on the second end of the serial port redirection component using the decoding mode, and obtain the 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] Correspondingly, using the serial port redirection component to send the target data to the second forwarding node can 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 by setting the encoding mode and decoding mode, prevents the characters from changing during transmission, and makes the transmitted target data accurate.

[0080] It should be further pointed out that, based on the above embodiment, using the first end of the serial port redirection component, encoding the target data of the current transmission based on the encoding mode to obtain target encoded data can include:

[0081] When the encoding mode is hexadecimal encoding, the first end of the serial port redirection component determines that the target data currently being transmitted is represented by one byte, and is changed to two bytes; when the encoding mode is special character replacement encoding, the first end of the serial port redirection component determines the characters that will change after transmission from the target data currently being transmitted, and replaces the characters that will change with a set character; wherein the set character is data that will not change after transmission. For example, the hexadecimal encoding in this embodiment refers to changing data from one byte representation to two byte representation. The content of the data is re-encoded before SOL connection transmission, and the data is decoded after transmission to the opposite end. For example, one byte (8 bits) is represented by one byte, and the first four bits and the last four bits are represented by one byte. For example, the byte value of the character "0" is represented in hexadecimal as 0X30, 3 is the hexadecimal value of the first four bits, and 0 is the value of the last four bits. After encoding, "30" two characters are used to represent the original data "0". The decoding process is the opposite of the encoding process. This embodiment does not limit the specific special characters, for example, the special characters in this embodiment are characters that do not change, for example, the special characters in this embodiment can be A, or the special characters in this embodiment can also be B. This embodiment does not limit how to determine the characters that will change after transmission, for example, the embodiment can obtain a list of multiple characters that will change after multiple experiments, and when determining the characters that will change, the list can be directly determined; or the embodiment can also determine all possible characters that will change by the way of SOL transmission data. The special character replacement encoding in this embodiment refers to replacing the characters in the data that will change after SOL transmission with the character A, and then transmitting the information of the replaced characters (including content and position) to the opposite end after transmission is completed. The opposite end decodes the received data. Replace special data in the data, for example, "0" will change after SOL transmission, and all "0"s in the original data are replaced with "A", "A" will not change after transmission, and the position of the data "0" is recorded. After transmitting the data, a correction content is transmitted. For example, the transmitted data "0123455678" is replaced with "A", and the transmitted data becomes "A12345678". After 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 (i.e., 0 is replaced with A), and then the first character is restored to 0. This embodiment prevents characters from changing and affecting the accuracy of the transmitted data by encoding and decoding the characters.

[0082] It needs to be further explained that, based on the above embodiment, in order to improve the accuracy of target data transmission, when the above-mentioned target data is sent to the second forwarding node by using the serial port redirection component, it can include: using a data encryption method to encrypt the target data to obtain encrypted data, and at the same time, the target data is cached; when the second end of the serial port redirection component decrypts the encrypted data, the decrypted target data is obtained, and the decrypted target data is checked, when it is determined that the target data has not changed, it is determined to delete the cached target data, otherwise it is determined to encode the target data before transmission. The embodiment of the application can ensure the accuracy of target data transmission by encryption and decryption and checking.

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

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

[0085] S103, the target data is sent 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 with the client, and the second forwarding node is a node connected with the server.

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

[0087] It needs to be further explained that, in order to improve the communication efficiency in the process of the above target data transmission, a heartbeat packet can also be sent to the second forwarding node at a set time period; if a heartbeat response packet of the second forwarding node is not received within a preset time, it is determined that the heartbeat packet is re-sent based on a set retry number, and after the retry number is reached, it is determined that the heartbeat response packet is not received, and it is determined that the current data communication link is not connected. This embodiment can monitor in real time whether the data communication link composed of the client, the first forwarding node, the SOL, the second forwarding node and the server is connected during the process, and when it is not connected, it can be processed in time to prevent the sending content from being still waited for in the case of the data communication link being not connected.

[0088] The data transmission method provided by the embodiment of the application can comprise: S101, receiving target data sent by a client; S102, sending the target data to a serial port redirection component; wherein the serial port redirection component is a component for implementing a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with a first forwarding node through a serial port; S103, 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. Compared with the case that data can only be sent when a network connection exists between the client and the server, the application uses the first forwarding node to undertake the data of the client without changing the original client, sends the data to the serial port redirection component, and then sends the data of the first forwarding node to the second forwarding node by using the serial port redirection component, so that the second forwarding node sends the data to the server, thereby realizing the sending of data when no network exists between the client and the server.

[0089] For the convenience of understanding the application, please refer to Figure 4 , Figure 4 A data transmission method applied to a second forwarding node is provided in the embodiment of the application, and the method can comprise:

[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 a serial port redirection component; wherein the serial port redirection component is a component for implementing 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;

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

[0094] The embodiment of the application can realize the function of the client without network connection with the server, reduces the use of network and physical network card, saves the use of network equipment and network IP address due to the requirement of network connection, and makes the node without internal network (BMC network needs to be connected) become feasible.

[0095] For better understanding of the application, please refer to the following Figure 5 , Figure 5 The embodiment of the application provides a schematic diagram of a data transmission communication link, 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 in the above), forwarding node B (corresponding to the first forwarding node in the above), LAN side, Serial side and monitoring server. There are two directions in the communication link, first: the monitoring software sends data to the forwarding node B, the forwarding node B sends the data to the serial side, the data reaches the LAN side through the SOL connection, the data is sent to the forwarding node A, and the data is sent from the forwarding node A to the monitoring server. First, from the monitoring server to the monitoring software, the data direction is the reverse process.

[0096] The monitoring software is a client, which needs to be connected with a network connected server. The forwarding node B is a network connected server. After the server of the forwarding node B receives the data, the data is forwarded to the serial port. The SOL in the figure is the data transmission link of the LAN side --- Serial side. The data forwarded by the forwarding node B to the serial port is transmitted to the LAN side. The LAN side is a UDP network connected client, which is represented as UDP-C. The forwarding node A takes over the LAN side UDP client by marking the input and output (stdio), and forwards the data to the monitoring server. Since the monitoring server is a TCP network connected server, the forwarding node A is connected with the monitoring server through a TCP network connected client. For better understanding, please refer to Figure 6 , Figure 6 The embodiment of the application provides a schematic diagram of a port connection relationship, Figure 6Socket (socket) in the computer network is a key abstraction layer, which allows the application program to communicate through the network. The working principle of Socket mainly involves server (server) and client (client) two parts. Assuming that the address of the monitoring server is ip-server, the port is 6000, the monitoring software needs to send the monitoring data collected to ip-server. The process of communication link construction can include: 1. Modify the address and port of the monitoring server in the configuration of the monitoring software, modify the configuration, and the monitoring software will send the data to 127.0.0.1 (local) port 6000. 2. The 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 127.0.0.1 6000 port (data node B), data node B will send the data to the serial side of 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, and the LAN side receives the data, establishes a data node A, which is a socket client connected to the monitoring server. 4. The data is sent to the monitoring server through the data node A.

[0097] The present application mainly solves the transmission of monitoring data without network connection, and sends the monitoring data to the monitoring server through the function of BMC-SOL. The monitoring data can be collected and the machine can be monitored only on the machine with BMC network.

[0098] The application of the data transmission device applied to the first forwarding node provided by the embodiment of the application will be introduced below, and the data transmission device applied to the first forwarding node described below can be correspondingly referred to the data transmission method applied to the first forwarding node described above.

[0099] Figure 7 The structure diagram of the data transmission device applied to the first forwarding node provided by the embodiment of the application can include:

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

[0101] The first data transmission module 200 is used for sending the target data to the serial port redirection component; wherein the serial port redirection component is a component for realizing a virtual serial port on the baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through a serial port;

[0102] The second data transmission module 300 is configured to send 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.

[0103] Further, based on the above-mentioned embodiments, the data transmission device can further include:

[0104] The first connection module is configured to be connected with the first end of the serial port redirection component; wherein the first end of the serial port redirection component is a serial port side;

[0105] The second connection module is configured to determine that the second forwarding node is connected with 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-mentioned embodiments, the first data transmission module 200 can include:

[0107] The encoding mode and decoding mode determination unit is configured to determine an encoding mode and a decoding mode corresponding to the target data currently transmitted, and send the encoding mode and the 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 characters in data not change in the transmission process, and the decoding mode is a decoding method corresponding to the encoding mode;

[0108] The target encoded data determination unit is configured to encode the target data currently transmitted based on the encoding mode by using the first end of the serial port redirection component to obtain target encoded data;

[0109] The decryption unit is 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 based on the second end of the serial port redirection component by using the decoding mode to obtain target decoded data sent to the second forwarding node;

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

[0111] The second data transmission unit is configured 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-mentioned embodiments, the target encoded data determination unit can include:

[0113] A hexadecimal encoding unit is used to determine, using the first end of the serial port redirection component, to change the currently transmitted target data from one byte to two bytes when the encoding method is hexadecimal encoding.

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

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

[0116] The determination module is used to determine whether the network between the client and the server is connected.

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

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

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

[0120] The data communication link disconnection determination unit is used to determine that if the heartbeat response packet of the second forwarding node is not received within a preset time, the heartbeat packet will be resent based on a set number of retries. After the number of retries is reached, the heartbeat response packet is not received, and the current data communication link is 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 For a description of the features in the corresponding embodiments, please refer to Figure 7 The relevant descriptions of the corresponding embodiments will not be repeated here.

[0123] The data transmission device applied to the first forwarding node provided by the embodiment of the application can comprise: a target data receiving module 100, configured to receive target data sent by a client; 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 for implementing a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through a serial port; and a second data transmission module 300, configured to send 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. Compared with the case that data can be sent only when a network connection exists between the client and the server, the application can, without changing the original client, use the first forwarding node to undertake the data of the client, send the data to the serial port redirection component, send the data of the first forwarding node to the second forwarding node by using the serial port redirection component, and make the second forwarding node send the data to the server, so that the sending of data can be realized even when no network exists between the client and the server.

[0124] The data transmission device applied to the second forwarding node provided by the embodiment of the application will be introduced below. The data transmission device applied to the second forwarding node described below can be referred to the data transmission method applied to the second forwarding node described above.

[0125] Figure 8 The structure diagram of the data transmission device applied to the second forwarding node provided by the embodiment of the application can comprise:

[0126] A server data receiving module 400, configured to receive server data sent by a server;

[0127] A server data sending module 500, configured to send the server data to a serial port redirection component; wherein the serial port redirection component is a component for implementing 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;

[0128] A sending-to-client module 600, configured to send the server data to a first forwarding node by using the serial port redirection component, so that the first forwarding node sends the target data to a client; wherein the first forwarding node is a node connected with the client, and the second forwarding node is a node connected with the server.

[0129] The data transmission system provided by the embodiment of the present application is introduced as follows, and the data transmission system described below can be correspondingly referred to the data transmission method described above.

[0130] Figure 9 The structural schematic diagram of the data transmission system provided by the embodiment of the present application can include:

[0131] The client 10 is configured to communicate data with the first forwarding node.

[0132] The first forwarding node 20 is 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] The serial port redirection component 30 is configured to realize the data communication between the first forwarding node and the second forwarding node.

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

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

[0136] The data transmission device provided by the embodiment of the present application is introduced as follows, and the data transmission device described below can be correspondingly referred to the data transmission method described above.

[0137] Figure 10 The structural schematic diagram of the data transmission device provided by the embodiment of the present application is shown as follows, Figure 10 The data transmission device includes a memory 60 configured to store a computer program.

[0138] A processor 61 is configured to execute the computer program to realize the steps of the data transmission method of the above-described embodiment.

[0139] The data transmission device provided by the embodiment can include but is not limited to a smart phone, a tablet computer, a notebook computer or a desktop computer, etc.

[0140] The processor 61 can 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 of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA), etc. The processor 61 can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a central processing unit (CPU). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 61 can be integrated with a graphics processing unit (GPU) that is responsible for rendering and drawing content required to be displayed on the display screen. In some embodiments, the processor 61 can further include an artificial intelligence (AI) processor for processing computing operations related to machine learning.

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

[0142] In some embodiments, the data transmission device can 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 can understand that the structure shown in the above embodiments does not constitute a limitation on the data transmission device, and can include more or fewer components than those shown in the drawings. Figure 10 The structure shown in the above embodiments does not constitute a limitation on the data transmission device, and can include more or fewer components than those shown in the drawings.

[0144] It can be understood that if the data transmission method in the above embodiments is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), an electrically erasable programmable ROM, a register, a hard disk, a removable magnetic disk, a CD-ROM, a magnetic disk or an optical disk, and various media that can store program codes.

[0145] Based on this, the embodiment of the present application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to realize the steps of the above data transmission method.

[0146] Based on this, the present application also provides a computer program product, which includes computer programs / instructions. The computer programs / instructions are executed by a processor to realize the steps of the above data transmission method.

[0147] The above has introduced in detail a data transmission method provided by the embodiment of the present application. The embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the difference from other embodiments. The same and similar parts of each embodiment 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 related parts can be referred to the method part.

[0148] The skilled person can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly show the interchangeability of hardware and software, the components and steps of each example have been described in the above description. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solutions. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0149] The above describes in detail the data transmission method, device, equipment and computer readable storage medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A data transmission method, characterized by, The application is applied to a first forwarding node, comprising: When the network between the client and the server is not connected, determining to execute 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 for implementing a virtual serial port on a baseboard management controller, and the serial port redirection component establishes a connection with the first forwarding node through a 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 the 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; Wherein, sending the target data to the second forwarding node by using the serial port redirection component comprises: encrypting the target data by using a data encryption method to obtain encrypted data, and simultaneously buffering the target data; decrypting the encrypted data by using a second end of the serial port redirection component to obtain decrypted target data, and verifying the decrypted target data; when it is determined that the target data has not changed, it is determined to delete the buffered target data, otherwise it is determined to encode the target data before transmission; 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 comprises: Connecting with a first end of the serial port redirection component; wherein the first end of the serial port redirection component is a serial port side; the serial port side is Serial, Determining that the second forwarding node is connected with a second end of the serial port redirection component; wherein the second end of the serial port redirection component is a local area network side; the local area network side is LAN side; the data transmission process comprises: the first forwarding node creates a tcp-server, if a monitoring software tcp-client and the tcp-server of the first forwarding node establish a connection, the tcp-server of the first forwarding node and the monitoring software tcp-client communicate data, the first forwarding node sends the data from the monitoring software tcp-client to the tcp-server of the first forwarding node through the writing mode of the serial port, the first forwarding node constantly reads whether there is data coming into the serial port, the read data is the data sent from the LAN side, and then the read data is sent to the tcp-client of the monitoring software through the tcp-server of the first forwarding node; the second forwarding node establishes a tcp-client and a monitoring server connection, if the output read data is output, 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, if the tcp-client of the second forwarding node has data sent from the monitoring server, the second forwarding node forwards the data to the input and sends it to the serial port; Wherein, sending the target data to the serial port redirection component comprises: determining an encoding mode and a decoding mode corresponding to the target data of the current transmission, and sending the encoding mode and the decoding mode to a first end and a second end of the serial port redirection component respectively; the encoding mode is an encoding mode that does not change the characters in the data during transmission, and the decoding mode is a decoding method corresponding to the encoding mode; encoding the target data of the current transmission based on the encoding mode by using the first end of the serial port redirection component to obtain target encoded data; sending 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 mode based on the second end of the serial port redirection component to obtain target decoded data sent to the second forwarding node; correspondingly, sending the target data to the second forwarding node by using the serial port redirection component, comprising: sending the target decoded data to the second forwarding node by using the second end of the serial port redirection component; wherein, encoding the target data of the current transmission based on the encoding mode by using the first end of the serial port redirection component to obtain target encoded data, comprising: when the encoding mode is hexadecimal encoding, changing the one-byte representation of the target data of the current transmission to two-byte representation by using the first end of the serial port redirection component; when the encoding mode is special character replacement encoding, determining the characters that will change after transmission from the target data of the current transmission by using the first end of the serial port redirection component, and replacing the characters that will change with a set character; the set character is data that will not change after transmission; in the process of transmitting the target data, further comprising: 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, determining to resend the heartbeat packet based on a set number of retries, and determining that the heartbeat response packet is not received after the number of retries is reached, and determining that the current data communication link is not connected.

2. The data transmission method of claim 1, wherein, before receiving the target data sent by the client, further comprising: determining whether the network between the client and the server is connected; when the network between the client and the server is not connected, determining to perform the step of receiving the target data sent by the client.

3. A data transmission method, characterized by, applied to the second forwarding node, comprising: receiving server data sent by a server; sending the server data to a serial port redirection component; 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; sending the server data to a first forwarding node by using the serial port redirection component, so that the first forwarding node sends the target data to a client; the first forwarding node is a node connected with the client, and the second forwarding node is a node connected with the server; The first forwarding node is a node of the data transmission method for the first forwarding node according to any one of claims 1 or 2.

4. A data transmission system, characterized by The method comprises the steps of: a client, configured to communicate data with the first forwarding node; the first forwarding node, configured to forward data sent by the client to a serial port of the serial port redirection component, or forward data sent by the serial port of the serial port redirection component to the client; the first forwarding node is a node of the data transmission method for the first forwarding node according to any one of claims 1 or 2; a serial port redirection component, configured to realize data communication between the first forwarding node and the second forwarding node; the second forwarding node, configured to forward data sent by the network port of the serial port redirection component to a server, or receive data sent by the server; the second forwarding node is a node of the data transmission method for the second forwarding node according to claim 3; a server, configured to communicate data with the second forwarding node.

5. A data transmission device, characterized by The method comprises the steps of: a memory, configured to store a computer program; a processor, configured to execute the computer program to realize the steps of the data transmission method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to realize the steps of the data transmission method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • File transmission method and device, equipment and medium

    CN116996504A

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

    CN119094611A