Data transmission method and apparatus, and storage medium
By using the character device communication mechanism of the internal and external management devices and utilizing USB character devices for data transmission, the problem of PCIe devices not supporting hot-swapping is solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202110704458.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-24
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-06-24
AI Technical Summary
PCIe devices do not support hot-swapping and require driver installation to function, which can lead to device security issues and monitoring alarms, affecting the timeliness and reliability of data transmission.
It adopts a communication mechanism between in-band and out-of-band character devices, transmits data through character devices managed by out-of-band and in-band devices, utilizes USB character devices to support hot-plugging, and performs data encapsulation and decapsulation through user-mode programs, thus avoiding the need for driver installation.
It improves the efficiency and reliability of data transmission between in-band and out-of-band management devices, solves device security and monitoring alarm issues, supports hot-swapping, and requires no user compilation or driver installation.
Smart Images

Figure CN115525595B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus and storage medium. Background Technology
[0002] Server management can be achieved through two methods: out-of-band management devices or in-band management devices. Out-of-band management devices run server out-of-band management software, responsible for the overall intelligent management of the server. In-band management devices run in-band management software, operating on the server's in-band operating system, and are responsible for functions such as server hardware information collection, performance data collection, driver management, and software management.
[0003] In related technologies, such as Figure 1 As shown, the out-of-band management device 12 and the in-band management device 14 of server 10 typically communicate via a Peripheral Component Interconnect Express (PCIe) device 16. The PCIe device 16 can be a network device.
[0004] However, in the above communication mechanism, PCIe devices do not support hot-swapping and require the installation of corresponding drivers to work. Furthermore, the process of installing drivers may lead to device security issues and monitoring alarm problems. Summary of the Invention
[0005] In view of this, embodiments of this application propose a data transmission method, apparatus, and storage medium. Embodiments of this application provide a communication mechanism between in-band and out-of-band character devices, avoiding the problem in related technologies where PCIe devices do not support hot-swapping and require driver installation to function. This solves the device security and monitoring alarm problems caused by network devices and improves the timeliness and reliability of data transmission between in-band and out-of-band management devices.
[0006] In a first aspect, embodiments of this application provide a data transmission method for use in a server including a first management device and a second management device, the method comprising:
[0007] The first management device acquires message data, which is used to request a specified service from the second management device;
[0008] The first management device sends the message data to the second management device through its own first character device;
[0009] The second management device receives the message data through its own second character device;
[0010] The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
[0011] In this implementation, out-of-band and in-band management devices can transmit message data through their respective character devices, realizing a communication mechanism between in-band and out-of-band character devices. This avoids the problem in related technologies where PCIe devices do not support hot-swapping and require driver installation to work, thus improving the data transmission efficiency between in-band and out-of-band management devices. Furthermore, it solves the device security and monitoring alarm problems caused by network devices, ensuring the reliability of data transmission between in-band and out-of-band management devices.
[0012] In one possible implementation, the first management device acquires message data, including:
[0013] The first management device listens for message requests from local applications through a first network port, and the message requests are used to request a specified service from the second service port of the second management device;
[0014] The first management device encapsulates the received message request to obtain the message data.
[0015] In this implementation, the first management device can listen for message requests from local applications through the first network port, encapsulate the listened message requests to obtain message data, and then send the message data to the second management device to request the specified service of the second service port of the second management device.
[0016] In another possible implementation, the method further includes:
[0017] The first management device pre-establishes and stores the binding relationship between the first network port and the second service port.
[0018] In this implementation, the first management device pre-establishes and stores the binding relationship between the first network port and the second service port, and uses the first network port to listen to the service port of the other end, thereby realizing direct access to the service port of the other end.
[0019] In another possible implementation, the first management device includes a first user-mode program and a second user-mode program. The first management device listens for message requests from local applications through a first network port, including:
[0020] The first user-space program listens for message requests from the local application through the first network port;
[0021] The first management device encapsulates the received message request to obtain the message data, including:
[0022] The first user-space program sends the detected message request to the second user-space program;
[0023] The second user-space program encapsulates the message request to obtain the message data.
[0024] In this implementation, the first user-mode program listens for message requests from the local application through the first network port. The first user-mode program sends the listened message requests to the second user-mode program, which encapsulates the message requests to obtain message data, thus realizing the data interaction mechanism between user-mode programs in the first management device.
[0025] In another possible implementation, before the first management device sends the message data to the second management device via its own first character device, it further includes:
[0026] The second user-mode program writes the message data into the first character device.
[0027] In this implementation, the second user-mode program writes message data into the first character device, so that the first character device can subsequently send the message data to the second management device through a specified transmission channel, thereby realizing the communication mechanism between in-band and out-of-band character devices.
[0028] In another possible implementation, after the second management device receives the message data via its own second character device, it further includes:
[0029] The second management device decapsulates the received message data to obtain the message request;
[0030] The second management device sends the message request to the second service port through the second network port.
[0031] In this implementation, the second management device decapsulates the received message data to obtain a message request. The second management device then sends the message request to the second service port through the second network port so that the second service port can process the message request, thus ensuring the reliability of data transmission between in-band and out-of-band management devices.
[0032] In another possible implementation, the second management device includes a third user-mode program and a fourth user-mode program. The second management device decapsulates the received message data to obtain the message request, including:
[0033] The third user-mode program obtains the message data from the second character device;
[0034] The third user-space program decapsulates the message data to obtain the message request;
[0035] The second management device sends the message request to the second service port through the second network port, including:
[0036] The third user-space program sends the message request to the fourth user-space program;
[0037] The fourth user-mode program sends the message request to the second service port through the second network port.
[0038] In this implementation, the third user-mode program obtains message data from the second character device, decapsulates the message data to obtain a message request, and sends the message request to the fourth user-mode program. The fourth user-mode program then sends the message request to the second service port through the second network port, thus realizing the data interaction mechanism between user-mode programs in the second management device.
[0039] In another possible implementation, the method further includes:
[0040] The second management device receives the response information sent by the second service port through the second network port;
[0041] The second management device sends the response information to the first management device through its own second character device;
[0042] The first management device receives the response information through its own first character device.
[0043] In this implementation, the second management device receives the response information sent by the second service port through the second network port, and sends the response information to the first management device through its own second character device. The first management device receives the response information through its own first character device. That is, the out-of-band management device and the in-band management device can transmit response information through their respective character devices, realizing the communication mechanism between in-band and out-of-band character devices, and further improving the timeliness and reliability of data transmission between in-band and out-of-band management devices.
[0044] In another possible implementation, the first character device is a USB character device created by a first kernel-mode program of the first management device, and the second character device is a USB character device created by a second kernel-mode program of the second management device.
[0045] In this implementation, external management devices and in-band management devices can communicate through their respective USB character devices. On the one hand, USB devices support hot-plugging, can be enabled when needed, and can be disabled after use; on the other hand, the operating system comes with drivers, so users do not need to compile and install drivers separately; on the other hand, there will be no compatibility issues when the kernel version is upgraded; and on the other hand, there will be no unknown devices under the Windows system. Thus, while improving the data transmission efficiency between in-band and out-of-band management devices, the security and reliability of data transmission between in-band and out-of-band management devices are guaranteed.
[0046] Secondly, embodiments of this application provide a data transmission method for use in a first management device, the method comprising:
[0047] The first management device acquires message data, which is used to request a specified service from the second management device;
[0048] The first management device sends the message data to the second management device's second character device via its own first character device;
[0049] The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
[0050] In one possible implementation, the first management device acquires message data, including:
[0051] The first management device listens for message requests from local applications through a first network port, and the message requests are used to request a specified service from the second service port of the second management device;
[0052] The first management device encapsulates the received message request to obtain the message data.
[0053] In another possible implementation, the method further includes:
[0054] The first management device pre-establishes and stores the binding relationship between the first network port and the second service port.
[0055] In another possible implementation, the first management device includes a first user-mode program and a second user-mode program. The first management device listens for message requests from local applications through a first network port, including:
[0056] The first user-space program listens for message requests from the local application through the first network port;
[0057] The first management device encapsulates the received message request to obtain the message data, including:
[0058] The first user-space program sends the detected message request to the second user-space program;
[0059] The second user-space program encapsulates the message request to obtain the message data.
[0060] In another possible implementation, before the first management device sends the message data to the second character device of the second management device via its own first character device, it further includes:
[0061] The second user-mode program writes the message data into the first character device.
[0062] In another possible implementation, the method further includes:
[0063] The first management device receives the response information sent by the second character device of the second management device through its own first character device.
[0064] In another possible implementation, the first character device is a USB character device created by a first kernel-mode program of the first management device, and the second character device is a USB character device created by a second kernel-mode program of the second management device.
[0065] Thirdly, embodiments of this application provide a data transmission method for use in a second management device, the method comprising:
[0066] The second management device receives message data sent by the first character device of the first management device through its own second character device. The message data is used to request a specified service from the second management device.
[0067] The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
[0068] In one possible implementation, the method further includes:
[0069] The second management device decapsulates the received message data to obtain the message request;
[0070] The second management device sends the message request to the second service port through the second network port.
[0071] In another possible implementation, the second management device includes a third user-mode program and a fourth user-mode program. The second management device decapsulates the received message data to obtain the message request, including:
[0072] The third user-mode program obtains the message data from the second character device;
[0073] The third user-space program decapsulates the message data to obtain the message request;
[0074] The second management device sends the message request to the second service port through the second network port, including:
[0075] The third user-space program sends the message request to the fourth user-space program;
[0076] The fourth user-mode program sends the message request to the second service port through the second network port.
[0077] In another possible implementation, the method further includes:
[0078] The second management device receives the response information sent by the second service port through the second network port;
[0079] The second management device sends the response information to the first character device of the first management device through its own second character device.
[0080] In another possible implementation, the first character device is a USB character device created by a first kernel-mode program of the first management device, and the second character device is a USB character device created by a second kernel-mode program of the second management device.
[0081] Fourthly, a data transmission apparatus is provided, the apparatus comprising at least one unit for implementing the data transmission method provided in the first aspect or any possible implementation thereof.
[0082] Fifthly, a data transmission apparatus is provided, the apparatus comprising at least one unit for implementing the data transmission method provided in the second aspect or any possible implementation thereof.
[0083] In a sixth aspect, a data transmission apparatus is provided, the apparatus comprising at least one unit for implementing the data transmission method provided in the third aspect or any possible implementation thereof.
[0084] In a seventh aspect, embodiments of this application provide a data transmission apparatus, the apparatus comprising:
[0085] processor;
[0086] Memory used to store processor-executable instructions;
[0087] The processor is configured to implement the data transmission method provided by the first aspect or any possible implementation of the first aspect when executing the instructions.
[0088] Eighthly, embodiments of this application provide a data transmission apparatus, the apparatus comprising:
[0089] processor;
[0090] Memory used to store processor-executable instructions;
[0091] The processor is configured to implement the data transmission method provided by the second aspect or any possible implementation of the second aspect when executing the instructions.
[0092] Ninthly, embodiments of this application provide a data transmission apparatus, the apparatus comprising:
[0093] processor;
[0094] Memory used to store processor-executable instructions;
[0095] The processor is configured to implement the data transmission method provided by the third aspect or any possible implementation of the third aspect when executing the instructions.
[0096] In a tenth aspect, embodiments of this application provide a computer program product including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in an electronic device, a processor in the electronic device executes the data transmission method provided by the first aspect or any possible implementation thereof.
[0097] Eleventhly, embodiments of this application provide a computer program product including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in an electronic device, the processor in the electronic device executes the data transmission method provided by the second aspect or any possible implementation thereof.
[0098] In a twelfth aspect, embodiments of this application provide a computer program product including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in an electronic device, a processor in the electronic device executes the data transmission method provided by the third aspect or any possible implementation thereof.
[0099] In a thirteenth aspect, embodiments of this application provide a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the data transmission method provided by the first aspect or any possible implementation thereof.
[0100] In a fourteenth aspect, embodiments of this application provide a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the data transmission method provided by the second aspect or any possible implementation thereof.
[0101] In a fifteenth aspect, embodiments of this application provide a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the data transmission method provided by the third aspect or any possible implementation thereof. Attached Figure Description
[0102] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this application together with the specification and serve to explain the principles of this application.
[0103] Figure 1 A schematic diagram of the server structure provided in the related technology is shown.
[0104] Figure 2 This is a schematic diagram of the structure of a server provided in an exemplary embodiment of this application.
[0105] Figure 3 A flowchart illustrating a data transmission method provided in an exemplary embodiment of this application is shown.
[0106] Figure 4 A schematic diagram illustrating an application scenario of the data transmission method provided in an exemplary embodiment of this application is shown.
[0107] Figure 5 A flowchart illustrating a method for a BMA to send a message request to a BMC, provided in another exemplary embodiment of this application, is shown.
[0108] Figure 6A flowchart illustrating a method for a BMC to send a message request to a BMA, provided in another exemplary embodiment of this application, is shown.
[0109] Figure 7 A block diagram of a data transmission apparatus provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0110] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0111] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0112] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0113] First, some terms used in the embodiments of this application will be introduced.
[0114] 1. Out-of-band management devices are devices that transmit management and control information and data through different physical channels. Out-of-band management devices are responsible for the intelligent management of the entire server. For example, an out-of-band management device can be called an Intelligent Baseboard Management Controller (iBMC) or a BMC.
[0115] 2. In-band management devices are devices that transmit management and control information and data through the same physical channel. In-band management devices operate on the server's in-band operating system and are responsible for functions such as server hardware information acquisition, performance data acquisition, driver management, and software management. For example, an in-band management device can run an agent client, through which it interacts with out-of-band management devices. In-band management devices can be called Intelligent Baseboard Management Agent (iBMA) or BMA.
[0116] 3. Character devices: These provide a continuous data stream that applications can read sequentially, but typically do not support random access. Character devices support reading and writing data byte-by-byte / character-by-character. For example, a character device is a virtualized version of a USB device (hereinafter referred to as a USB character device). This application does not limit this specific type of device.
[0117] In related technologies, taking the out-of-band management device BMC and the in-band management device BMA as an example, the PCIe devices required for communication between BMC and BMA have the following problems: 1. PCIe devices do not support hot-swapping. Enabling or disabling them requires a system restart to take effect, affecting user services and is unacceptable to users; 2. There are many Linux system kernel versions, requiring users to build their own compilation environment, compile the driver, and install iBMA. After the system kernel is upgraded, the driver needs to be compiled and installed again, and different kernel versions require different drivers. Some users do not accept the self-compiled driver installation solution for security and maintainability considerations; 3. After installing the Windows operating system, PCIe unknown device information will appear. Drivers need to be installed to display it as a known device; 4. PCIe devices can be network devices. After the driver is installed, the corresponding virtual network port will be seen on the operating system. Some users do not accept this solution (for example, an extra virtual network port is added, which the management software cannot recognize and may report alarm information for an unknown network port).
[0118] This application provides a communication mechanism between in-band and out-of-band character devices, avoiding the problem in related technologies where PCIe devices do not support hot-swapping and require driver installation to work. It solves the device security and monitoring alarm problems caused by network devices and improves the timeliness and reliability of data transmission between in-band and out-of-band management devices.
[0119] This application provides a data transmission method, in which the server is the executing entity. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of the structure of a server 20 provided in an exemplary embodiment of this application. The server 20 includes an out-of-band management device 22 and an in-band management device 24, and data can be transmitted between the out-of-band management device 22 and the in-band management device 24.
[0120] Among them, out-of-band management device 22 and in-band management device 24 are physical devices. Optionally, out-of-band management device 22 is a physical device with a chip, and in-band management device 24 is a physical device with a central processing unit (CPU).
[0121] In this embodiment, out-of-band management device 22 and in-band management device 24 transmit data through their respective character devices. Specifically, the character device 26 of out-of-band management device 22 is a virtualized device based on out-of-band management device 22, and the character device 28 of in-band management device 24 is a virtualized device based on in-band management device 24.
[0122] Optionally, there is a USB transmission channel between out-of-band management device 22 and in-band management device 24. Character device 26 of out-of-band management device 22 is a USB character device created by the kernel program of out-of-band management device 22, and character device 28 of in-band management device 24 is a USB character device created by the kernel program of in-band management device 24.
[0123] Optionally, the character device 26 of the out-of-band management device 22 and the character device 28 of the in-band management device 24 are connected via a hardware interface provided by a connectivity device. For example, the connectivity device can be a 1710 device, a 1711 device, an evolution of the 1711 device, or a device that can connect to both out-of-band and in-band devices.
[0124] The data transmission method provided in the embodiments of this application will now be described using several exemplary embodiments.
[0125] Please refer to Figure 3 It illustrates a flowchart of a data transmission method provided in an exemplary embodiment of this application, which is used in this embodiment for... Figure 2 The following example uses a server as an example. The method includes the following steps.
[0126] Step 301: The first management device obtains message data, which is used to request a specified service from the second management device.
[0127] Optionally, the first management device is the client requesting the service, and the second management device is the server providing the service.
[0128] The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of an out-of-band management device and an in-band management device. For a description of the out-of-band management device and the in-band management device, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0129] Optionally, the second management device pre-establishes and stores the binding relationship between the second network port and the second service port. The second network port is used to listen for message requests from the local application of the second management device, and the second service port is used to provide a specified service. For example, the second network port may be the localhost port, and the second service port may be the Redfish port or the SSH port. This embodiment of the application does not limit this.
[0130] Optionally, the first management device pre-establishes and stores the binding relationship between a first network port and a second service port. The first network port is used to listen for message requests from the local application of the first management device, and the second service port is used to provide a specified service. For example, the first network port may be a localhost port, and the second service port may be a Redfish port or an SSH port. This embodiment of the application does not limit this.
[0131] Optionally, the first management device listens for message requests from local applications through a first network port. These message requests are used to request a specified service from the second service port of the second management device. The first management device encapsulates the listened-for message requests to obtain message data. That is, the message data is the encapsulated data of the message requests.
[0132] In one possible implementation, the first management device includes a first user-mode program and a second user-mode program. The first user-mode program listens for message requests from local applications through a first network port; the first user-mode program sends the listened-for message requests to the second user-mode program; the second user-mode program encapsulates the message requests to obtain message data.
[0133] Optionally, the user-space programs of the first management device transmit data via Socket communication. That is, the first user-space program sends the listened-to message requests to the second user-space program via Socket communication.
[0134] The first user-mode program and the second user-mode program can be combined to form a single user-mode program. That is, the user-mode program of the first management device listens for message requests from the local application through the first network port, and the user-mode program encapsulates the listened message requests to obtain message data.
[0135] Optionally, the first user-mode program includes one or more first user-mode programs, and the second user-mode program is a second user-mode program. The second user-mode program has a preset correspondence with the first character device, and the second user-mode program is used to read and write to the first character device.
[0136] Schematic illustration: The first management device includes two first user-mode programs (user-mode program A and user-mode program B) and one second user-mode program (user-mode program C). User-mode program A or user-mode program B listens for message requests from local applications through a first network port. User-mode program A or user-mode program B sends the listened-for message requests to user-mode program C, which encapsulates the message requests to obtain message data.
[0137] Step 302: The first management device sends the message data to the second management device through its own first character device.
[0138] Optionally, the second user-mode program writes the message data to the first character device, and the first character device sends the message data to the second management device through a specified transmission channel.
[0139] The specified transmission channel is the data transmission channel between the first character device and the second character device. Optionally, the first character device is a USB character device created by the first kernel-mode program of the first management device, the second character device is a USB character device created by the second kernel-mode program of the second management device, and the specified transmission channel is a USB transmission channel.
[0140] Step 303: The second management device receives message data through its own second character device.
[0141] Optionally, the second management device receives message data through its own second character device, decapsulates the received message data to obtain a message request, and sends the message request to the second service port through the second network port.
[0142] In one possible implementation, the second management device includes a third user-space program and a fourth user-space program. The second character device receives message data, the third user-space program obtains the message data from the second character device, decapsulates the message data to obtain a message request, the third user-space program sends the message request to the fourth user-space program, and the fourth user-space program sends the message request to the second service port through the second network port.
[0143] Optionally, the user-space programs of the second management device transmit data via Socket communication. That is, the third user-space program sends message requests to the fourth user-space program via Socket communication.
[0144] The third and fourth user-mode programs can be combined into a single user-mode program. The user-mode program that receives message data from the second character device and sends the message data to the second management device decapsulates the received message data to obtain a message request. The user-mode program then sends the message request to the second service port through the second network port.
[0145] Optionally, the third user-mode program includes one user-mode program, and the fourth user-mode program includes one or more fourth user-mode programs. The third user-mode program has a preset correspondence with the second character device, and the third user-mode program is used to read and write to the second character device.
[0146] Schematic illustration: The second management device includes a third user-mode program (user-mode program A) and two fourth user-mode programs (user-mode program B and user-mode program C). The second character device receives message data. User-mode program A retrieves the message data from the second character device, decapsulates the message data to obtain a message request. User-mode program A sends the message request to user-mode program B or user-mode program C. User-mode program B or user-mode program C then sends the message request to the second service port through the second network port.
[0147] Optionally, the second service port receives the message request, processes the message request to obtain the processing result, and returns response information to the second network port. The response information includes the processing result. For example, if the message request is used to request a target webpage, the response information includes the webpage content of the target webpage.
[0148] Optionally, the second management device receives the response information sent by the second service port through the second network port; the second management device sends the response information to the first management device through its own second character device; and the first management device receives the response information through its own first character device.
[0149] In one possible implementation, the first management device includes a first user-mode program and a second user-mode program, and the second management device includes a third user-mode program and a fourth user-mode program. The fourth user-mode program receives response information sent from the second service port through a second network port. The fourth user-mode program sends the response information to the third user-mode program, which encapsulates the response information and writes it into a second character device. The second character device then sends the encapsulated response information to the first management device through a designated transmission channel. The first character device of the first management device receives the encapsulated response information. The second user-mode program retrieves the encapsulated response information from the first character device, decapsulates the encapsulated response information to obtain the response information, and sends the response information to the first user-mode program. The first user-mode program then sends the response information to a local application through the first network port. This local application is the application that provides the service specified in the aforementioned request.
[0150] It should be noted that the path by which the second management device sends the response information to the first management device through its second character device is the opposite of the path by which the message data is sent. The relevant description of the first management device sending message data to the second management device through its first character device can be referred to, and will not be repeated here.
[0151] In summary, in this embodiment, out-of-band management devices and in-band management devices can transmit message data through their respective character devices, realizing a communication mechanism between in-band and out-of-band character devices. On the one hand, USB devices support hot-plugging, enabling when needed and disabling after use; on the other hand, the operating system comes with drivers, eliminating the need for users to compile and install additional drivers; furthermore, there are no compatibility issues when upgrading kernel versions; and under Windows systems, no unknown devices will appear. Thus, while improving the data transmission efficiency between in-band and out-of-band management devices, the security and reliability of data transmission between them are also guaranteed.
[0152] In this embodiment, the binding relationship between the first network port and the second service port is pre-established and stored by the first management device, and the service port of the other end is listened to by the first network port to realize the method of directly accessing the service port of the other end.
[0153] This application embodiment also allows the first user-mode program and the second user-mode program to be merged into a single user-mode program, and the third user-mode program and the fourth user-mode program to be merged into a single user-mode program, without the need for data interaction through Socket communication, thereby improving the data interaction efficiency in in-band and out-of-band management devices.
[0154] In one possible implementation, the data transmission method provided in this application embodiment is applied to, for example... Figure 4 In the application scenarios shown. Figure 4 In this architecture, the out-of-band management device is the BMC. The BMC creates its own USB character device S1 through kernel-mode program A. The BMC includes user-mode programs A and B. User-mode program B is used to read and write to the USB character device S1. User-mode programs A and B communicate with each other via Socket. The in-band management device is the BMA. The BMA creates its own USB character device S2 through kernel-mode program B. The BMA includes user-mode programs C and D. User-mode program D is used to read and write to the USB character device S2. User-mode programs C and D communicate with each other via Socket. Both the BMC and BMA transmit data through their respective USB character devices.
[0155] based on Figure 4In the provided application scenario, in an illustrative example, BMC is the server (the second management device mentioned above), and BMA is the client (the first management device mentioned above). BMC pre-establishes and stores the binding relationship between its own localhost port and its own service port X1. BMA's user-space program C is used to pre-establish and store the binding relationship between its own localhost port and BMC's service port X1. The process of BMA sending a message request to BMC includes, but is not limited to, the following steps: Figure 5 As shown:
[0156] Step 501: User-mode program C listens for message requests from local applications through its own localhost port and sends the listened message requests to user-mode program D.
[0157] Step 502: User-mode program D encapsulates the message request to obtain message data and writes the message data to USB character device S2.
[0158] Step 503: The USB character device S2 sends the message data to the BMC via the USB transmission channel.
[0159] Step 504: The BMC's USB character device S1 receives message data.
[0160] Step 505: User-mode program B obtains message data from USB character device S1.
[0161] Step 506: User-space program B decapsulates the message data to obtain the message request, and sends the message request to user-space program A.
[0162] Step 507: User-space program A sends a message request to service port X1 through its own localhost port.
[0163] Step 508: After receiving the response information sent by service port X1, user-mode program A sends the response information back to the local application of BMA.
[0164] After receiving the response information from service port X1, user-mode program A sends the response information to user-mode program B. User-mode program B encapsulates the response information and writes the encapsulated response information into USB character device S1. USB character device S1 sends the encapsulated response information to BMA through the USB transmission channel. BMA's USB character device S2 receives the encapsulated response information. User-mode program D obtains the encapsulated response information from USB character device S2, decapsulates the encapsulated response information to obtain the response information, and sends the response information to user-mode program C. User-mode program C sends the response information to the local application through the localhost port. It should be noted that the description of each step in this embodiment can be compared with the relevant descriptions in the above embodiments, and will not be repeated here.
[0165] based on Figure 4 In another illustrative example of the provided application scenario, BMC is the client, i.e., the first management device mentioned above, and BMA is the server, i.e., the second management device mentioned above. BMA pre-establishes and stores the binding relationship between its own localhost port and its own service port X2. BMC's user-space program A is used to establish and store the binding relationship between its own localhost port and BMA's service port X2. The process of BMC sending a message request to BMA includes, but is not limited to, the following steps: Figure 6 As shown:
[0166] Step 601: User-space program A listens for message requests from local applications through its own localhost port and sends the listened message requests to user-space program B.
[0167] Step 602: User-mode program B encapsulates the message request to obtain message data and writes the message data to USB character device S1.
[0168] Step 603: The USB character device S1 sends the message data to the BMA via the USB transmission channel.
[0169] Step 604: BMA's USB character device S2 receives message data.
[0170] Step 605: User-mode program D obtains message data from USB character device S2.
[0171] Step 606: User-space program D decapsulates the message data to obtain the message request, and sends the message request to user-space program C.
[0172] Step 607: User-mode program C sends a message request to service port X2 through its own localhost port.
[0173] In step 608, after receiving the response information sent by service port X2, user-mode program C sends the response information back to the local application of BMC.
[0174] After receiving the response information from service port X2, user-mode program C sends the response information to user-mode program D. User-mode program D encapsulates the response information and writes the encapsulated response information to USB character device S2. USB character device S2 sends the encapsulated response information to BMC via the USB transmission channel. BMC's USB character device S1 receives the encapsulated response information. User-mode program B retrieves the encapsulated response information from USB character device S1, decapsulates the encapsulated response information to obtain the response information, and sends the response information to user-mode program A. User-mode program A sends the response information to the local application via the localhost port.
[0175] It should be noted that the descriptions of each step in this embodiment can be compared with the relevant descriptions in the above embodiments, and will not be repeated here.
[0176] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0177] Please refer to Figure 7 The diagram illustrates a block diagram of a data transmission apparatus provided in an exemplary embodiment of this application. This apparatus can be implemented using software, hardware, or a combination of both. Figure 2 The provided server may be all or part thereof. The apparatus may include: a first management device 710 and a second management device 720, the apparatus comprising:
[0178] The first management device 710 is used to acquire message data, which is used to request a specified service from the second management device 720.
[0179] The first management device 710 is also used to send message data to the second management device 720 through its own first character device;
[0180] The second management device 720 is used to receive message data through its own second character device;
[0181] Among them, the first management device 710 is one of the external management device and the internal management device, and the second management device 720 is another of the external management device and the internal management device.
[0182] In one possible implementation, the first management device 710 is further configured to listen for message requests from local applications via a first network port, the message requests being used to request a specified service from a second service port of the second management device 720.
[0183] The first management device 710 is also used to encapsulate the monitored message requests to obtain message data.
[0184] In another possible implementation, the first management device 710 is also used to pre-establish and store the binding relationship between the first network port and the second service port.
[0185] In another possible implementation, the first management device 710 includes a first user-mode program and a second user-mode program, and the first management device 710 is further used for:
[0186] The first user-mode program listens for message requests from local applications through the first network port;
[0187] The first user-space program sends the detected message requests to the second user-space program.
[0188] The message request is encapsulated to obtain the message data through the second user-space program.
[0189] In another possible implementation, the first management device 710 is also used for:
[0190] The message data is written to the first character device through the second user-mode program.
[0191] In another possible implementation, the second management device 720 is also used for:
[0192] The received message data is decapsulated to obtain the message request;
[0193] The message request is sent to the second service port through the second network port.
[0194] In another possible implementation, the second management device 720 includes a third user-mode program and a fourth user-mode program, and the second management device 720 is further used for:
[0195] The message data is obtained from the second character device through a third user-mode program;
[0196] The message request is obtained by decapsulating the message data through a third user-space program;
[0197] The message request is sent to the fourth user-mode program through the third user-mode program;
[0198] The fourth user-mode program sends the message request to the second service port through the second network port.
[0199] In another possible implementation,
[0200] The second management device 720 is also used to receive response information sent by the second service port through the second network port;
[0201] The second management device 720 is also used to send response information to the first management device 710 through its own second character device;
[0202] The first management device 710 is also used to receive response information through its own first character device.
[0203] In another possible implementation, the first character device is a USB character device created by the first kernel-mode program of the first management device 710, and the second character device is a USB character device created by the second kernel-mode program of the second management device 720.
[0204] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0205] This application provides a server, which includes a first management device and a second management device. The first management device executes the method executed by the first management device in the above embodiments, and the second management device executes the method executed by the second management device in the above embodiments.
[0206] This application provides a physical device, which includes: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method executed by the first management device or the second management device in the above embodiments.
[0207] This application provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the method executed by the first management device and / or the second management device in the above embodiments.
[0208] This application provides a non-volatile computer-readable storage medium storing computer program instructions thereon. When the computer program instructions are executed by a processor, they implement the method executed by the first management device and / or the second management device in the above embodiments.
[0209] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), electrically programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital video disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing.
[0210] The computer-readable program instructions or code described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0211] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" or similar languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from computer-readable program instructions. These electronic circuits can execute computer-readable program instructions to implement various aspects of this application.
[0212] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0213] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0214] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0215] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
[0216] It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented using hardware (such as circuits or ASICs (Application Specific Integrated Circuits)) that performs the corresponding function or action, or using a combination of hardware and software, such as firmware.
[0217] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0218] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A data transmission method, characterized by, For a server, the server includes a first management device and a second management device, the first management device being a client requesting a service, and the second management device being a server providing the service, the method comprising: The first management device acquires message data, which is used to request a specified service from the second management device; The first management device sends the message data to the second management device through its own first character device, wherein the first character device is a USB character device created by the first kernel-mode program of the first management device; The second management device receives the message data through its own second character device, wherein the second character device is a USB character device created by the second kernel-mode program of the second management device; The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
2. The method of claim 1, wherein, The first management device acquires message data, including: The first management device listens for message requests from local applications through a first network port, and the message requests are used to request a specified service from the second service port of the second management device; The first management device encapsulates the received message request to obtain the message data.
3. The method of claim 2, wherein, The method further includes: The first management device pre-establishes and stores the binding relationship between the first network port and the second service port.
4. The method of claim 2, wherein, The first management device includes a first user-mode program and a second user-mode program. The first management device listens for message requests from local applications through a first network port, including: The first user-space program listens for message requests from the local application through the first network port; The first management device encapsulates the received message request to obtain the message data, including: The first user-space program sends the detected message request to the second user-space program; The second user-space program encapsulates the message request to obtain the message data.
5. The method of claim 4, wherein, Before the first management device sends the message data to the second management device through its own first character device, it further includes: The second user-mode program writes the message data into the first character device.
6. The method according to claim 2, characterized in that, After receiving the message data through its own second character device, the second management device further includes: The second management device decapsulates the received message data to obtain the message request; The second management device sends the message request to the second service port through the second network port.
7. The method according to claim 6, characterized in that, The second management device includes a third user-mode program and a fourth user-mode program. The second management device decapsulates the received message data to obtain the message request, including: The third user-mode program obtains the message data from the second character device; The third user-space program decapsulates the message data to obtain the message request; The second management device sends the message request to the second service port through the second network port, including: The third user-space program sends the message request to the fourth user-space program; The fourth user-mode program sends the message request to the second service port through the second network port.
8. The method according to any one of claims 2 to 7, characterized in that, The method further includes: The second management device receives the response information sent by the second service port through the second network port; The second management device sends the response information to the first management device through its own second character device; The first management device receives the response information through its own first character device.
9. A data transmission method, characterized in that, Used in a first management device, where the first management device is a client requesting a service, the method includes: The first management device acquires message data, which is used to request a specified service from the second management device; The first management device sends the message data to the second character device of the second management device through its own first character device, wherein the first character device is a USB character device created by the first kernel-mode program of the first management device, and the second character device is a USB character device created by the second kernel-mode program of the second management device; The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
10. A data transmission method, characterized in that, Used in a second management device, where the second management device is a server providing services, the method includes: The second management device receives message data sent by the first character device of the first management device through its own second character device. The message data is used to request a specified service from the second management device. The first character device is a USB character device created by the first kernel-mode program of the first management device, and the second character device is a USB character device created by the second kernel-mode program of the second management device. The first management device is one of an out-of-band management device and an in-band management device, and the second management device is the other of the out-of-band management device and the in-band management device.
11. A data transmission device, characterized in that, The device includes: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1-8, or the method of claim 9, or the method of claim 10 when executing the instructions.
12. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method of any one of claims 1-8, or the method of claim 9, or the method of claim 10.
Citation Information
Patent Citations
Data transmission system, method and device
CN108733614A
Data transmission method and device, electronic equipment and readable storage medium
CN109992352A