A method and device for accessing BMC database

By combining a web front-end with a local method library and utilizing TCP connections and IPMI/Redfish technology, the problem of users being unable to easily access the BMC database is solved, enabling secure and reliable BMC database operations that are suitable for various server hardware.

CN117271630BActive Publication Date: 2025-10-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311100292.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-10-28
Estimated Expiration
2043-08-29

AI Technical Summary

Technical Problem

Users cannot easily access and manipulate the server's BMC database, especially under security policies and network isolation environments, making it impossible to quickly query and modify data.

Method used

The system receives user input parameters through a web frontend, generates packaged data, and sends it to a local method library via an internal interface. It then uses a TCP connection to access the BMC database on the target server, combining IPMI and Redfish technologies to enable access and manipulation of the BMC database.

Benefits of technology

It provides a convenient way to access and manipulate the BMC database from the front end of a web page, ensuring security and reliability, applicable to different types of server hardware, and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271630B_ABST
    Figure CN117271630B_ABST
Patent Text Reader

Abstract

This invention provides a method and corresponding apparatus for accessing a BMC database. The method includes: receiving parameters input by a user through a web page frontend, and generating packaged data based on the parameters, the parameters including a target server address; sending the packaged data to a local method library through an internal interface; receiving and parsing the packaged data through the local method library, generating a data packet, and sending the data packet to the target server to access the BMC database of the target server, wherein the target server corresponds to the target server address. Through this invention, parameters can be input through a web page frontend on a computer device to send a TCP request to the BMC database of a target server, thereby enabling access to and control of the server's BMC database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for accessing a BMC database. Background Technology

[0002] Due to security policies, users, R&D, testing, and maintenance personnel are unable to log into the BMC server system to execute shell commands, making it difficult to conveniently query, retrieve, modify, or update data stored in the database.

[0003] Meanwhile, many data center servers are not directly accessible from the external network, with only one server exposed to the outside. Therefore, when operations are needed on the BMC database of the internal network server, there is no quick and convenient method to perform these operations. Summary of the Invention

[0004] This invention provides a method for accessing a BMC database, the method comprising:

[0005] The web page frontend receives parameters input by the user and generates packaged data based on the parameters, including the target server address.

[0006] The packaged data is sent to the local method library via an internal interface;

[0007] The packaged data is received and parsed through a local method library, a datagram is generated, and the datagram is sent to the target server to access the BMC database of the target server, wherein the target server corresponds to the target server address.

[0008] Optionally, generating packaged data based on the parameters includes: encapsulating the user-input parameters into JSON data; correspondingly, sending the packaged data to the local method library through an internal interface includes: sending the JSON data to the RESTful interface of the local method library via XMLHttpRequest.

[0009] Optionally, the step of parsing the packaged data to generate a datagram and sending the datagram to the target server to access the target server's BMC database includes:

[0010] Parse the packaged data to generate the parameters;

[0011] Based on the parameters, a TCP connection is established with the target server using standard library functions.

[0012] In the case of establishing a TCP connection, a datagram is generated based on the parameters and sent to the target server to access the target server's BMC database.

[0013] Optionally, the method further includes:

[0014] The returned data from the BMC database is obtained through the local method library, and the web page front-end return information is set according to the returned data;

[0015] The web page front-end response information is sent to the web page front-end via an internal interface.

[0016] Optionally, the webpage front-end returns information based on the returned data, including:

[0017] The returned data is categorized, and the categorization types include raw data types and file types.

[0018] When the returned data is of raw data type, it is directly encapsulated into JSON data; when the returned data is of file type, it is saved locally and returned to the web page front-end as a blob data stream.

[0019] Optionally, receiving user-input parameters through a web page front-end and generating packaged data based on the parameters includes: receiving the data transmission method selected by the user, wherein the data transmission method includes data stream mode and data packet mode;

[0020] Accordingly, the step of receiving and parsing the packaged data through the local method library to generate a datagram includes:

[0021] When the user selects data transmission method as data stream, the packaged data is parsed to generate a data stream, and then the data stream is encapsulated into a data packet;

[0022] When the user selects data transmission method as datagram mode, the packaged data is parsed to directly generate a datagram.

[0023] Optionally, when the user selects data transmission mode as datagram mode, parsing the packaged data to directly generate a datagram includes:

[0024] The packaged data is parsed to generate the target server address and BMC setting parameters, which correspond to the input parameters.

[0025] The sending socket is determined based on the user's own address and the target server address; a datagram is generated according to the BMC settings parameters and the determined sending socket.

[0026] Optionally, determining the sending socket based on the user's own address and the target server address includes:

[0027] Initialize the sending socket, including binding the local IP address;

[0028] The target address of the initialized send socket is set according to the target server address obtained by parsing, so as to generate a definite send socket;

[0029] Datagrams are generated based on the other parameters and the configured send socket.

[0030] Optionally, after sending the webpage frontend return information to the webpage frontend via the internal interface, the method further includes:

[0031] Determine if the information returned by the webpage frontend is a file;

[0032] If the information returned by the web page frontend is not a file, format the information returned by the web page frontend and display the formatted information on the web page;

[0033] If the returned webpage shows a file, send a download notification.

[0034] Optionally, setting the webpage front-end return information based on the returned data includes:

[0035] Determine whether a file is included based on the returned data;

[0036] If a file is included, the file is sent to the webpage frontend;

[0037] Without including the file, determine if there is an error, and set the information returned by the webpage frontend based on the result.

[0038] Optionally, before setting the webpage front-end return information based on the returned data, the method further includes:

[0039] Determine whether the data packet was sent successfully based on the returned data;

[0040] If the data is sent successfully, check whether the returned data contains the file.

[0041] If the transmission fails, determine if there is an error, and set the information returned by the webpage frontend based on the determination result.

[0042] The present invention also provides an apparatus for accessing a BMC database, the apparatus comprising a web page front-end and a local method library, wherein the web page front-end and the local method library are connected through an internal interface;

[0043] The webpage front-end includes:

[0044] A packaged data generation unit is used to obtain parameters input by the user and generate packaged data based on the parameters, wherein the parameters include the target server address;

[0045] A packaged data sending unit is used to send the packaged data to the local method library through an internal interface;

[0046] The local method library includes:

[0047] A packaged data parsing unit is used to receive and parse the packaged data and generate a data packet;

[0048] A datagram sending unit is used to send the datagram to a target server to access the BMC database, wherein the target server corresponds to the target server address.

[0049] The present invention provides a terminal device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method for accessing the BMC database.

[0050] The present invention provides an information storage medium storing a computer program, which, when executed, implements the aforementioned method for accessing the BMC database.

[0051] Through this invention, parameters can be input at the front end of a computer device's webpage to send a TCP request to the target server's BMC, thereby enabling access to and control of the server's BMC database. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0053] Figure 1 This is a flowchart of the method for accessing the BMC database proposed in this invention;

[0054] Figure 2 This is a functional architecture diagram of the method for accessing the BMC database proposed in this invention;

[0055] Figure 3 This is a flowchart illustrating the specific operations of the Web front-end in this invention;

[0056] Figure 4 This is a flowchart illustrating the specific operation of the local method library in this invention;

[0057] Figure 5 This is an architecture diagram of the device for accessing the BMC database proposed in this invention, which sends a TCP request.

[0058] Figure 6 This is an architecture diagram of the device for accessing the BMC database proposed in this invention, which sends TCP requests and displays returned information.

[0059] Figure 7 This is a hardware structure diagram of the terminal device proposed in this invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0061] This application notes the advantages of TCP in inter-application communication and data query operations. Specifically, TCP can dynamically adapt to the characteristics of the Internet, where different parts of the Internet have drastically different topologies, bandwidths, latency, packet sizes, and other parameters. TCP enables reliable, pipe-like connections between application layers on different hosts. This application innovatively uses TCP to establish connections between the BMCs of different servers.

[0062] This invention provides a method for accessing a BMC database, such as... Figure 1 As shown, the method includes:

[0063] S1. Receive parameters input by the user through the web page front-end, and generate packaged data based on the parameters, wherein the parameters include the target server address;

[0064] S2. Send the packaged data to the local method library via the internal interface;

[0065] S3. Receive and parse the packaged data using the local method library to generate a datagram;

[0066] S4. Send the datagram to the target server to access the BMC database of the target server, wherein the target server corresponds to the target server address.

[0067] The above method employs a technique that connects the web front-end with a local method library, eliminating the need for users to directly log in to the back-end management system, thus ensuring the security and reliability of the back-end management system. The web front-end (user interface) can be implemented using browser software without requiring the installation of other software or tools, making its implementation very convenient.

[0068] Using the above method, user-defined data can be sent to a network-reachable BMC by filling in a few parameters, thereby enabling functional operations or data acquisition / modification of the BMC database. Therefore, this invention can solve database operation problems encountered by users in daily operation and maintenance.

[0069] In step S1, when the user fills in the relevant parameters for the TCP request, the address information of the specific target needs to be entered. If the BMC database of another server is to be accessed, the address information of that other server needs to be entered. If the BMC database of the local server is to be accessed, only the address information of the local server needs to be entered, or it can be left blank. Therefore, this invention can control the BMC of the local machine or other servers by different inputs of the target server's address information. The parameter of the specific target address information is the first parameter to be entered, which includes the target's IP address and port number. The IP address supports IPv4 or IPv6 protocols. If the TCP request requires special request parameters, they need to be entered as well, such as specific request header information. Therefore, the parameter input can be flexibly configured, which is conducive to realizing various control methods of the target server.

[0070] In steps S2-S4, this invention innovatively proposes a method for connecting and communicating between a web page front-end and an existing standard back-end method library. This allows users to input parameters through the web page front-end, and then the back-end local method library automatically calls the corresponding standard functions based on the input to perform access operations to obtain information about the target server's BMC database or to perform configuration operations on it.

[0071] The Intelligent Platform Management Interface (IPMI) is a standard used in server management system design. Utilizing this interface standard facilitates system management across different types of server hardware, enabling centralized management of various platforms. Users can use IPMI to monitor the physical health characteristics of servers, such as temperature, voltage, fan operating status, and power supply status. In the IPMI management platform, the Baseboard Management Controller (BMC) is the core controller; the system management software manages each managed server through communication with its BMC.

[0072] IPMI is based on specialized firmware running on the BMC (Baseboard Management Controller). The BMC exists completely independently of the server's CPU / BIOS / OS. Even if the system is not powered on, it can function normally as long as it is powered on. It has its own complete system, including its own CPU (ARM), OS, storage devices, etc., essentially meaning the server has two systems: one for business operations and another for managing the business operations and hardware. IPMI's excellent autonomy overcomes the limitations of traditional operating system-based management methods; for example, it can still perform power-on / off and information retrieval operations even when the operating system is unresponsive or not loaded.

[0073] During operation, all IPMI functions are accomplished by sending commands to the BMC. These commands use instructions specified in the IPMI specification. The BMC receives these commands and records event messages in the system event log, maintaining sensor data records that describe the status of sensors in the system. When remote system access is required, IPMI's new Serial Over LAN (SOL) feature is useful. SOL changes the direction of local serial port transmission during an IPMI session, thereby providing remote access to Emergency Management Services, Windows-specific management consoles, or Linux serial consoles. The BMC does this by changing the direction of information transmitted to the serial port over the LAN, providing a vendor-independent standard way to remotely view bootloaders, operating system loaders, or Emergency Management consoles for diagnosing and troubleshooting.

[0074] In the method for accessing the BMC database provided by this invention, the local method library can be the IPMI backend method library. By establishing a connection between the web page frontend and the IPMI backend method library, the difficulty of operating the firmware running on the backend BMC can be overcome. By inputting operations on the web page, settings or operations can be controlled on the BMC of the local machine or other servers. The local machine communicates with the BMC of other servers through message protocols.

[0075] Redfish is an open, industry-standard specification that provides simple, modern, and secure management capabilities for scalable platform hardware. It's a hypermedia API, allowing for a consistent interface to represent various implementations. It includes mechanisms for managing data center resources, handling events, long-running tasks, and discovery. The unified management interface based on Redfish effectively reduces the significant adaptation, development, and testing work required by different server hardware management interfaces.

[0076] Furthermore, Redfish is a management standard based on HTTPS services, utilizing RESTful interfaces for device management. Each HTTPS operation submits or returns a resource or result in UTF-8 encoded JSON format (JSON is a key-value data format), much like a web application returns HTML to a browser. Redfish technology offers advantages such as reduced development complexity, ease of implementation, ease of use, and scalability, allowing for design flexibility.

[0077] Redfish set the following goals when it first established the standard:

[0078] 1. Safety

[0079] 2. Highly scalable management

[0080] 3. Human-readable data interface

[0081] 4. Can be achieved based on existing hardware.

[0082] Redfish effectively addresses security requirements compared to IPMI. For example, Redfish is based on the Hypertext Transfer Protocol Security (HTTPS) / Secure Sockets Layer (SSL) standard for its network transport protocol, which is more universal, secure, and auditable than the sole IPMI network protocol.

[0083] Based on the existing BMC that supports IPMI, RedFish can be supported with little to no hardware modification, meaning hardware compatibility. High scalability is achieved by defining all APIs as RESTful APIs. REST (Represent State Transfer) is a concept derived from Web APIs. Compared to traditional SOAP APIs, RESTful APIs are much simpler to define (e.g., POST, GET, PUT, or DELETE), transferring the object's state between the server and client using JSON or XML format, hence its name.

[0084] Redfish = REST API + software-defined server (data model).

[0085] Simply put, it defines certain resources and allows you to operate on these resources through a RESTful API.

[0086] In the method for accessing the BMC database provided by this invention, the local method library can be the Redfish backend method library. By establishing a connection between the web page frontend and the Redfish backend method library, the difficulty of operating RESTful APIs can be overcome. By inputting operations on the web page, settings or operations can be controlled on the BMC of the local machine or other servers. The BMC of the local machine and other servers communicate with each other through message protocols.

[0087] As two specific implementation methods, this invention innovatively utilizes the essence of IPMI technology or Redfish technology, especially the latter as the preferred implementation method. It defines the browser software's output port as RESTful and the Redfish API's input as the browser software's output, thereby establishing a connection between the web page frontend (which can be implemented through a browser) and the Redfish backend method library. This implementation method requires no further hardware modifications to implement this invention, and it can be applied to the control and management of data center server clusters and cloud server clusters.

[0088] As one implementation method, generating packaged data based on the parameters includes: encapsulating the user-input parameters into JSON data; correspondingly, sending the packaged data to the local method library through an internal interface includes: sending the JSON data to the RESTful interface of the local method library via XMLHttpRequest.

[0089] The RESTful (Representational State Transfer) programming interface allows for simple queries using various programming languages. Data transmission is over HTTPS in JSON format and supports multiple invocation methods, including apps, GUIs, and scripts. HTTP is easily understood by operations personnel and has a well-known security model. JSON is a modern data format that is simpler than XML and can be understood by most people. Operations personnel can use their existing DevOps skills and toolchains to perform BMC system administration tasks.

[0090] As one specific implementation, when filling in the parameters, the user can customize whether to send the data as a data stream or a datagram. If the data stream method is selected, the local method library needs to assemble the data stream into a datagram before sending it. If the datagram method is selected, the datagram can be sent directly without processing. The choice between data stream and datagram methods depends on the data transmission format of the target server's receiver.

[0091] In this invention, the step of receiving user-input parameters through a webpage frontend and generating packaged data based on the parameters includes: receiving the data transmission method selected by the user, whereby the data transmission method includes data stream mode and data packet mode; correspondingly, the step of receiving and parsing the packaged data through a local method library to generate a data packet includes: when the user selects data stream mode, parsing the packaged data to generate a data stream, and then encapsulating the data stream into a data packet; when the user selects data packet mode, parsing the packaged data to directly generate a data packet. Through this implementation, the present invention exhibits strong compatibility with the server transmission interface to be accessed and can be applied to servers with various types of transmission interfaces.

[0092] The reason for sending datagrams is that datagram service is provided by a datagram switching network, and the BMCs of each server in a server cluster are often connected through this network. The network layer of the end system and the network layers of the network nodes consistently exchange data using datagram operations. When an end system wants to send data, the network layer appends information such as address and sequence number to the data, and then sends it as a datagram to the network node. During datagram transmission, each packet may travel a different path; due to these different paths, the processing time at each node varies, and the arrival time at the destination also differs. This can result in packets arriving at the destination in a different order than when they were sent, requiring reordering and reassembly into a message. This is why the handling of transmission failures will be discussed later.

[0093] In one specific implementation, the step of parsing the packaged data to generate a datagram and sending the datagram to the target server to access the target server's BMC database includes: parsing the packaged data to generate the parameters; establishing a TCP connection with the target server using standard library functions based on the parameters; and, with a TCP connection established with the target server, generating a datagram based on the parameters and sending the datagram to the target server to access the target server's BMC database. In this embodiment, a TCP connection is established using a native method library, leveraging the advantages of the TCP stream mode protocol, which offers strong compatibility with the product versions and models of both the initiating device (including terminals and servers) and the accessed device (including servers).

[0094] In this invention, the returned data from the BMC database is obtained through a local method library, and the web page front-end return information is set according to the returned data; the web page front-end return information is sent to the web page front-end through an internal interface.

[0095] As a preferred implementation, setting the webpage frontend return information based on the returned data includes: classifying the returned data, wherein the classification types include raw data type and file type; when the returned data is raw data type, directly encapsulating it into JSON data; when the returned data is file type, saving it locally and returning it to the webpage frontend as a blob data stream.

[0096] After sending the webpage frontend return information to the webpage frontend through the internal interface, the method further includes: determining whether the webpage frontend return information is a file; if the webpage frontend return information is not a file, formatting the webpage frontend return information and displaying the formatted webpage frontend return information on the web page; if the returned webpage frontend return information is a file, issuing a download notification.

[0097] This implementation method displays the returned data in a familiar webpage format, which is more user-friendly and helps improve the user experience.

[0098] The step of setting the webpage front-end return information based on the returned data includes: determining whether the returned data contains a file; if the file is contained, sending the file to the webpage front-end; if the file is not contained, determining whether there is an error, and setting the webpage front-end return information based on the determination result.

[0099] Before setting the webpage front-end return information based on the returned data, the method further includes: determining whether the data packet was sent successfully based on the returned data; if the sending was successful, determining whether the returned data contains a file; if the sending was unsuccessful, determining whether there is an error, and setting the webpage front-end return information based on the determination result.

[0100] Using the aforementioned technical means, error information can be displayed on the front end of the webpage in a timely manner, thereby enabling a comprehensive understanding of the actual situation of access to the target server.

[0101] In this invention, when the user selects data transmission mode as datagram mode, parsing the packaged data to directly generate a datagram includes: parsing the packaged data to generate a target server address and BMC setting parameters, wherein the BMC setting parameters correspond to the input parameters; determining a sending socket based on the user's own address and the target server address; and generating a datagram according to the BMC setting parameters and the determined sending socket. A socket, as a process communication mechanism in BSD UNIX, is used to describe IP addresses and ports and is a handle to a communication link, which can be used to implement communication between different virtual machines or different computers.

[0102] As one specific implementation, determining the sending socket based on the user's own address and the target server address includes: initializing the sending socket, including binding a local IP address; setting the target address of the initialized sending socket according to the parsed target server address to generate a determined sending socket; and generating a datagram based on the other parameters and the set sending socket.

[0103] Two programs on a network exchange data through a bidirectional communication connection, one end of which is called a socket.

[0104] Establishing a network communication connection requires at least one pair of port sockets. A socket is essentially a programming interface (API), a wrapper around TCP / IP. TCP / IP also provides interfaces for programmers to use in network development; this is the socket programming interface. HTTP is like a car, providing the specific form for encapsulating or displaying data. A socket is like an engine, providing the capability for network communication.

[0105] like Figure 2 As shown, from a functional perspective, this invention consists of two main parts. The first part is the operation of the web front-end, which includes: 1. Filling in the relevant parameters of the TCP request, including the address information of the specific target server; 2. Filling in the data for the TCP request; 3. Displaying the returned results. When a TCP request returns successfully, the returned data is formatted and displayed on the web page. The second part is the operation of the local method library. The local method library processes the received request data and establishes a connection with the target. After successfully establishing the connection, the datagram is sent to the target address. After obtaining the returned data, it is returned to the web front-end page for the user to perceive. Communication between the two parts uses a RESTful interface for data transmission.

[0106] like Figure 3 As shown, the operation flow of the Web front-end of this invention includes:

[0107] S31. Enter the target address: The parameter for requesting the target address is the first parameter to be filled in. It includes the target address information, IP address and port number. The IP address supports IPv4 or IPv6 protocol.

[0108] S32. Fill in additional parameters: If this request requires special request parameters, these should also be filled in, such as specific request header information.

[0109] S33. Select Data Sending Method: The user can customize whether the requested data is sent as a data stream or a datagram. If a data stream is selected, the backend needs to assemble the data stream into a datagram before sending it. Datagrams can be sent directly without processing.

[0110] S34. Fill in the data to send: The data to be filled in cannot be empty. After filling in the data to send, a check is performed to see if the data is empty. If it is empty, the web front-end will terminate the sending operation and prompt an error. If it is not empty, the filled parameters will be packaged and sent to the local method library.

[0111] S35. Return Result Display: After receiving the returned data, first determine whether the TCP request was sent successfully. If the sending failed, display the error message on the page. If the sending was successful, further determine whether the returned data is a file. If it is not a file, format the returned data for display; if it is a file, create a Blob, display the message, and download the file.

[0112] The above implementation packaged the input parameters and specific request data from the web page frontend and sent them to the local method library, and retrieved the returned data from the local method library for display. It provides a convenient human-computer interaction interface by using the processing method of Web and backend method library. It is not only easy to operate, but also ensures the security and reliability of data transmission because it does not require users to log in to the backend management system directly.

[0113] like Figure 4 As shown, the operation flow of the native method library includes:

[0114] S41. Receive request data: After receiving the data sent by the Web frontend, extract and parse the data.

[0115] S42. Initialize the sending engine: This step includes initializing the sending socket and binding its own IP address as the sending source so that the target can be aware of it.

[0116] S43. Set the target server address for the request: Set the target address for the socket, thus determining the target of the request.

[0117] S44. Set request parameters: If there are user-defined special request parameters, set them together, specifically by adding them to the data before the data packet.

[0118] S45. Encapsulate the data stream into a datagram: If the user chooses to send the data stream, the data stream needs to be encapsulated into a datagram, that is, the data stream and the previous data are integrated and encapsulated into a datagram; if no data stream is sent, a datagram is generated directly.

[0119] S46. Establish connection with target: Establish a connection with the target address by handshaking and keep it active.

[0120] S47. Send Redfish Request: Send the datagram to the target address and further determine whether the request was sent successfully.

[0121] S48. Set Return Data: If the request is sent successfully, set the return data and further determine whether the file in the return data has been sent to the Web frontend.

[0122] S49. Delete file locally: If the file has been sent, delete the file locally.

[0123] S410, Return: If the request fails to send, return an error directly so that the web frontend can be aware of it. Send the returned data to the web frontend and further determine if there is an error. If there is an error, set an error code and let the web frontend know what kind of error occurred. If there is no error, also let the web frontend know.

[0124] Through the above implementation method, the execution processes of the Web front-end and the local method library are respectively achieved, realizing the technical effect that users only need to interact with the Web front-end to realize the automatic execution of operations by the local method library, thereby enabling TCP requests to be initiated on the BMC Web client.

[0125] This invention provides an apparatus for accessing a BMC database, such as... Figure 5 As shown, it includes a web page front-end and a local method library, which are connected through an internal interface;

[0126] The webpage front-end includes:

[0127] The packaged data generation unit 51 is used to obtain parameters input by the user and generate packaged data according to the parameters, wherein the parameters include the target server address;

[0128] Packaging data sending unit 52 is used to send the packaging data to the local method library through an internal interface;

[0129] The local method library includes:

[0130] Packed data parsing unit 53 is used to receive and parse the packaged data and generate a data packet;

[0131] The datagram sending unit 54 is used to send the datagram to the target server to access the BMC database, and the target server corresponds to the target server address.

[0132] Optionally, the packaged data generation unit 51 includes a JSON data encapsulation subunit, used to encapsulate the user-input parameters into JSON data; correspondingly, the packaged data sending unit 52 sends the JSON data to the local method library RESTful interface via XMLHttpRequest.

[0133] Optionally, the packaged data parsing unit 53 includes: a parsing subunit for parsing the packaged data and generating the parameters; a TCP connection establishment subunit for establishing a TCP connection with the target server using standard library functions based on the parameters; and a datagram generation subunit for generating datagrams based on the parameters when a TCP connection is established.

[0134] Optionally, the packaged data generation unit 51 includes a data transmission mode receiving subunit, used to receive the data transmission mode selected by the user, wherein the data transmission mode includes a data stream mode and a data packet mode; correspondingly, the packaged data parsing unit 53 includes: a data stream generation subunit, used to parse the packaged data to generate a data stream when the user selects the data transmission mode as a data stream mode; a data packet encapsulation subunit, used to encapsulate the data stream into a data packet; and a data packet generation subunit, used to parse the packaged data directly to generate a data packet when the user selects the data transmission mode as a data packet mode.

[0135] Optionally, the datagram generation subunit includes: a parsing module, used to parse the packaged data and generate a target server address and BMC setting parameters, wherein the BMC setting parameters correspond to the input parameters; a sending socket determination module, used to determine the sending socket based on the user's own address and the target server address; and a datagram generation module, used to generate a datagram according to the BMC setting parameters and the determined sending socket.

[0136] The socket determination module performs the following process: initializing the socket, including binding the local IP address; setting the target address of the initialized socket according to the parsed target server address to generate a determined socket; and the datagram generation module generates a datagram according to the input additional parameters and the set socket.

[0137] like Figure 6 As shown, the local method library further includes: a return data acquisition unit 61, used to acquire return data from the BMC database; a web page front-end return information setting unit 62, used to set web page front-end return information according to the return data; and a web page front-end return information sending unit 63, used to send the web page front-end return information to the web page front-end through an internal interface.

[0138] Optionally, the webpage front-end return information setting unit 62 includes: a file judgment module, used to determine whether the returned data contains a file; a file sending module, used to send the file to the webpage front-end if the file is contained; and an error judgment module, used to determine whether an error exists if the file is not contained, and to set the webpage front-end return information according to the judgment result.

[0139] Optionally, the local method library further includes: a data packet sending status judgment unit, used to judge whether the data packet was sent successfully based on the returned data; a file judgment unit, used to judge whether the returned data contains a file if the sending was successful; and an error judgment unit, used to judge whether there is an error if the sending was unsuccessful. The web page front-end return information setting unit sets the web page front-end return information according to the judgment result.

[0140] Optionally, the webpage front-end return information setting unit 62 includes: a return data classification subunit, used to classify the return data, wherein the classification type includes raw data type and file type; a JSON data encapsulation subunit, used to directly encapsulate the return data into JSON data when the return data is raw data type; a file saving subunit, used to save the return data to the local machine when the return data is file type; and a file return subunit, used to return the file to the webpage front-end as a blob data stream.

[0141] like Figure 6 As shown, the webpage front-end further includes: a file judgment unit 66, used to determine whether the information returned by the webpage front-end is a file; an information formatting unit 65, used to format the information returned by the webpage front-end if it is not a file; and an information display unit 64, used to display the formatted information returned by the webpage front-end on the web page. In a preferred embodiment, the webpage front-end further includes a download notification unit, used to issue a download notification if the returned information is a file.

[0142] It should be noted that the apparatus for accessing the BMC database provided in this embodiment of the invention can implement all the steps of the above-described method for accessing the BMC database and achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0143] The present invention provides a terminal device, which includes a processor 71, a memory 72, a communication interface 73 for sending data to or receiving data from the outside, and a communication bus 74 connecting the processor 71 and the memory 72. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method for accessing the BMC database.

[0144] The present invention provides an information storage medium storing a computer program, which, when executed, implements the aforementioned method for accessing the BMC database.

[0145] Through this invention, parameters can be input at the front end of a computer device's webpage to send a TCP request to the target server's BMC, thereby enabling access to and control of the server's BMC database.

[0146] The device embodiments described above are merely illustrative. The variables described as separate components may or may not be physically separate. The components shown as variables may or may not be physical variables; that is, they may be located in one place or distributed across multiple network variables. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for accessing a BMC database, characterized in that, The method includes: The web page frontend receives parameters input by the user and generates packaged data based on the parameters, including the target server address. The packaged data is sent to the local method library via an internal interface; The packaged data is received and parsed using a local method library to generate a datagram; Send the datagram to the target server to access the BMC database of the target server, wherein the target server corresponds to the target server address; The step of receiving user-input parameters through a web page front-end and generating packaged data based on the parameters includes: receiving the data transmission method selected by the user, wherein the data transmission method includes data stream mode and data packet mode; Accordingly, the step of receiving and parsing the packaged data through the local method library to generate a datagram includes: When the user selects data transmission method as data stream, the packaged data is parsed to generate a data stream, and then the data stream is encapsulated into a data packet; When the user selects data transmission mode as datagram mode, the packaged data is parsed to generate the target server address and BMC setting parameters, which correspond to the input parameters; the sending socket is initialized, including binding the local IP address; the target address of the initialized sending socket is set according to the parsed target server address to generate a determined sending socket; and a datagram is generated according to the BMC setting parameters and the determined sending socket.

2. The method for accessing the BMC database according to claim 1, characterized in that, The process of parsing the packaged data to generate a datagram includes: Parse the packaged data to generate the parameters; Based on the parameters, a TCP connection is established with the target server using standard library functions. In the case of establishing a TCP connection, a datagram is generated based on the parameters.

3. The method for accessing the BMC database according to claim 1, characterized in that, The method also includes: The returned data from the BMC database is obtained through the local method library, and the web page front-end return information is set according to the returned data; The web page front-end response information is sent to the web page front-end via an internal interface.

4. The method for accessing the BMC database according to claim 3, further characterized in that, Based on the returned data, set the webpage frontend return information, including: The returned data is categorized, and the categorization types include raw data types and file types. When the returned data is of raw data type, it is directly encapsulated into JSON data; when the returned data is of file type, it is saved locally and returned to the web page front-end as a blob data stream.

5. The method for accessing the BMC database according to claim 3, further characterized in that, After sending the webpage frontend return information to the webpage frontend via the internal interface, the method further includes: Determine if the information returned by the webpage frontend is a file; If the information returned by the web page frontend is not a file, format the information returned by the web page frontend and display the formatted information on the web page; If the returned webpage shows a file, send a download notification.

6. The method for accessing the BMC database according to claim 3, further characterized in that, The step of setting the webpage front-end return information based on the returned data includes: Determine whether a file is included based on the returned data; If a file is included, the file is sent to the webpage frontend; Without including the file, determine if there is an error, and set the information returned by the webpage frontend based on the result.

7. An apparatus for accessing a BMC database, characterized in that, The device includes a web front-end and a native method library, which are connected via an internal interface. The webpage front-end includes: A packaged data generation unit is used to obtain parameters input by the user and generate packaged data based on the parameters, wherein the parameters include the target server address; A packaged data sending unit is used to send the packaged data to the local method library through an internal interface; The local method library includes: A packet data parsing unit is used to receive and parse the packet data to generate a datagram; A datagram sending unit is used to send the datagram to a target server to access the BMC database, wherein the target server corresponds to the target server address; The packaged data parsing unit includes: a data stream generation subunit, used to parse the packaged data to generate a data stream when the user selects the data sending method as data stream mode; a data packet encapsulation subunit, used to encapsulate the data stream into a data packet; and a data packet generation subunit, used to parse the packaged data directly to generate a data packet when the user selects the data sending method as data packet mode. The datagram generation subunit includes: a parsing module, used to parse the packaged data and generate a target server address and BMC setting parameters, wherein the BMC setting parameters correspond to the input parameters; a sending socket determination module, used to determine the sending socket based on the user's own address and the target server address; and a datagram generation module, used to generate a datagram according to the BMC setting parameters and the determined sending socket.

8. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for accessing the BMC database as described in any one of claims 1-6.

9. An information storage medium storing a computer program, which, when executed, implements the method for accessing a BMC database as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Request processing method and device and readable storage medium

    CN115665254A