Data interaction method, computer system, electronic device, and storage medium
By segmenting, compressing and encrypting the data packets between the BIOS and the BMC, the problem of inefficient data transmission is solved and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- PCT/CN2024/139290
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-30
- Filing Date
- 2024-12-13
- Publication Date
- 2025-08-07
AI Technical Summary
In the prior art, data transmission between BIOS and BMC has problems with inefficiency, especially in large-scale data centers, resulting in excessive bandwidth usage and may cause transmission delay.
By segmenting and compressing the data packets to be sent to the substrate management controller, repetitive string sequences are identified and processed, compressed data packets are generated, and transmitted through the memory-mapped motherboard management controller interface, combining encryption, serial number synchronization and timestamp verification to ensure data integrity and security.
It significantly reduces the amount of data transmission between the BIOS and the BMC, improves data transmission efficiency, avoids excessive bandwidth usage, and enhances the security and state consistency of data transmission.
Smart Images

Figure CN2024139290_07082025_PF_FP_ABST
Abstract
Description
Data interaction method, computer system, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on January 30, 2024, with application number 202410129339.5 and application name “Data interaction method, computer system, electronic device and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the technical field of data interaction, and in particular to a data interaction method, a computer system, an electronic device, and a non-volatile computer-readable storage medium. Background Art
[0004] In the field of server hardware management, communication between the BIOS (Basic Input / Output System) and the BMC (Baseboard Management Controller) is key to enabling hardware monitoring and remote management. The BIOS is the firmware code used during the server boot process, responsible for initializing the server's hardware and loading the operating system. The BMC, on the other hand, is a specialized microcontroller that monitors the server's physical status and performs management tasks such as rebooting, logging, and security controls.
[0005] In traditional server management practices, communication between the BIOS and the BMC relies on various communication interfaces and protocols, with the MMBI (Memory-Mapped BMC Interface) being a key communication mechanism. MMBI maps the BMC's memory space to the BIOS via the eSPI (enhanced Serial Peripheral Interface) bus, enabling the BIOS to directly access the BMC's memory, conveniently reading status information and issuing management commands, as shown in Figure 1. This mechanism significantly improves the response speed of management commands and is an indispensable component of modern data center server management.
[0006] The core of existing MMBI technology lies in its direct mapping communication method, leveraging the high bandwidth and low latency of the eSPI bus to achieve efficient communication between the BIOS and the BMC. However, this data transmission method is inefficient, especially in large-scale data centers. Transmitting large amounts of monitoring data can consume excessive bandwidth and, when bandwidth is limited, can lead to significant transmission delays. Summary of the Invention
[0007] In view of the above problems, a data interaction method, a computer system, an electronic device and a non-volatile computer-readable storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0008] A data interaction method is applied to a basic input / output system (BIOS), wherein the BIOS communicates with a baseboard management controller (BMC) via a memory-mapped motherboard management controller (MBMC) interface. The method includes:
[0009] Determining a first data packet to be sent to a baseboard management controller, and dividing the first data packet into a plurality of data blocks of a target size;
[0010] Determining repeated character string sequences in the plurality of data blocks, and determining position information of the repeated character string sequences in the first data packet;
[0011] generating a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks;
[0012] The second data packet is sent to the baseboard management controller via the memory-mapped motherboard management controller interface.
[0013] Optionally, determining a repeated string sequence in a plurality of data blocks includes:
[0014] Write the string sequence of the data block into the preset dictionary in sequence;
[0015] When the character string sequence currently written into the preset dictionary matches the character string sequence previously written into the preset dictionary, determining that the character string sequence currently written into the preset dictionary is a repeated character string sequence;
[0016] Generating a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks, including:
[0017] Generate a token for the repeated string sequence, where the token contains the literal length and matching length corresponding to the repeated string sequence;
[0018] A second data packet is generated according to the preset dictionary, the tokens corresponding to each repeated string sequence, and the position information.
[0019] Optionally, the method further comprises:
[0020] Determine the bandwidth and data transmission speed currently used by data interaction between the BIOS and the BMC.
[0021] determining a transmission priority of the first data packet;
[0022] The target compression level is determined based on the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority; the target compression level is used to determine the length of the matching length.
[0023] Optionally, sending the second data packet to the baseboard management controller through a memory-mapped motherboard management controller interface includes:
[0024] Encrypting the second data packet according to a preset key to obtain a third data packet;
[0025] The third data packet is sent to the baseboard management controller through the memory-mapped motherboard management controller interface. The baseboard management controller is used to decrypt the third data packet according to a preset key to obtain the second data packet.
[0026] Optionally, the method further comprises:
[0027] When a preset security event is detected, the preset key is replaced;
[0028] The replaced preset key is sent to the baseboard management controller.
[0029] Optionally, the method further comprises:
[0030] The basic input and output system synchronizes the serial number with the baseboard management controller;
[0031] Sending the second data packet to the baseboard management controller via the memory-mapped baseboard management controller interface includes:
[0032] Add the currently polled target sequence number to the second data packet;
[0033] The second data packet with the target serial number added thereto is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; the baseboard management controller is used to detect a replay attack on the second data packet according to the target serial number.
[0034] Optionally, the method further comprises:
[0035] Synchronize the time between the basic input and output system and the baseboard management controller;
[0036] Sending the second data packet to the baseboard management controller via the memory-mapped baseboard management controller interface includes:
[0037] Adding a target timestamp in the second data packet according to the current system time of the basic input and output system;
[0038] The second data packet with the target timestamp added thereto is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; the baseboard management controller is used to detect replay attacks on the second data packet according to the target timestamp.
[0039] Optionally, the method further comprises:
[0040] The basic input and output system synchronizes the serial number and time with the baseboard management controller;
[0041] Sending the second data packet to the baseboard management controller via the memory-mapped baseboard management controller interface includes:
[0042] Add the currently polled target sequence number to the second data packet;
[0043] adding a target timestamp to a second data packet to which the currently polled target sequence number is added according to the current system time of the basic input and output system;
[0044] sending a second data packet having a target timestamp and a target serial number added thereto to a baseboard management controller via a memory-mapped baseboard management controller interface;
[0045] Among them, the baseboard management controller is used to detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller after receiving the second data packet with the target timestamp and target serial number added thereto; when the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller, discard the second data packet; when the target serial number is greater than the previous serial number, determine whether the deviation between the target timestamp and the current system time of the baseboard management controller exceeds a preset deviation value; when the deviation between the target timestamp and the current system time of the baseboard management controller exceeds the preset deviation value, discard the second data packet.
[0046] Optionally, sending the second data packet to the baseboard management controller through a memory-mapped motherboard management controller interface includes:
[0047] adding a redundant check code to the second data packet to generate a fourth data packet;
[0048] The fourth data packet is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; the baseboard management controller is used to detect content errors of the second data packet according to the redundant check code.
[0049] Optionally, each of the plurality of data blocks is provided with an identifier; and the method further comprises:
[0050] In response to a data request of the baseboard management controller for the target identifier, a data block corresponding to the target identifier is sent to the baseboard management controller.
[0051] Some embodiments of the present application further provide a data interaction method, which is applied to a baseboard management controller, wherein the baseboard management controller communicates with a basic input / output system via a memory-mapped motherboard management controller interface, and the method includes:
[0052] receiving a second data packet sent by a basic input / output system through a memory-mapped baseboard management controller interface; wherein the second data packet is generated by the basic input / output system determining a first data packet to be sent to the baseboard management controller, dividing the first data packet into a plurality of data blocks of a target size, determining repeated character string sequences in the plurality of data blocks, and determining position information of the repeated character string sequences in the first data packet; and generating the data packet based on the non-repeated character string sequences, repeated character string sequences, and position information in the plurality of data blocks;
[0053] The second data packet is decompressed to obtain the first data packet.
[0054] Optionally, the second data packet is generated by the basic input and output system after the basic input and output system sequentially writes the character string sequence of the data block into the preset dictionary, and when the character string sequence currently written into the preset dictionary matches the character string sequence previously written into the preset dictionary, determining that the character string sequence currently written into the preset dictionary is a repeated character string sequence; generating a token for the repeated character string sequence, the token including the literal length and the matching length corresponding to the repeated character string sequence; and generating a data packet based on the preset dictionary, the tokens corresponding to each repeated character string sequence, and the position information;
[0055] Decompress the second data packet to obtain the first data packet, including:
[0056] Read the token and location information in the second data packet;
[0057] A first data packet is generated according to the token, the position information, and the data block in the preset dictionary.
[0058] Some embodiments of the present application further provide a computer system, including a basic input / output system and a baseboard management controller, wherein the basic input / output system and the baseboard management controller communicate via a memory-mapped motherboard management controller interface;
[0059] The basic input / output system includes a compression module, the compression module being configured to determine a first data packet to be sent to a baseboard management controller and to divide the first data packet into a plurality of data blocks of a target size; determine repeated character string sequences in the plurality of data blocks and determine position information of the repeated character string sequences in the first data packet; and generate a second data packet based on the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks;
[0060] The basic input and output system is used to send the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface;
[0061] The baseboard management controller includes a decompression module, which is used to decompress the second data packet to obtain the first data packet.
[0062] Optionally, the basic input and output system further includes an encryption module, which is used to encrypt the second data packet according to a preset key to obtain a third data packet;
[0063] The basic input and output system is used to send the third data packet to the baseboard management controller through the memory-mapped motherboard management controller interface;
[0064] The baseboard management controller further includes a decryption module, which is used to decrypt the third data packet according to a preset key to obtain a second data packet.
[0065] Optionally, the baseboard management controller further includes a replay protection module;
[0066] The basic input and output system is used to synchronize the serial number with the baseboard management controller and add the currently polled target serial number in the second data packet; and send the second data packet with the added target serial number to the baseboard management controller through the memory-mapped baseboard management controller interface;
[0067] The replay protection module is used to detect a replay attack on the second data packet according to the target sequence number.
[0068] Optionally, the baseboard management controller further includes a replay protection module;
[0069] The basic input / output system is used to synchronize time with the baseboard management controller and add a target timestamp to the second data packet according to the current system time of the basic input / output system; and the second data packet with the target timestamp added is sent to the baseboard management controller through the memory-mapped baseboard management controller interface;
[0070] The replay protection module is used to detect a replay attack on the second data packet according to the target timestamp.
[0071] Optionally, the baseboard management controller further includes a replay protection module;
[0072] The basic input / output system is used to synchronize the serial number and time with the baseboard management controller, and add the currently polled target serial number in the second data packet; add the target timestamp to the second data packet added with the currently polled target serial number according to the current system time of the basic input / output system; and send the second data packet added with the target timestamp and target serial number to the baseboard management controller through the memory-mapped baseboard management controller interface;
[0073] The replay protection module is used to detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller after receiving a second data packet with a target timestamp and a target serial number added thereto; when the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller, discard the second data packet; when the target serial number is greater than the previous serial number, determine whether the deviation between the target timestamp and the current system time of the baseboard management controller exceeds a preset deviation value; when the deviation between the target timestamp and the current system time of the baseboard management controller exceeds the preset deviation value, discard the second data packet.
[0074] Optionally, the baseboard management controller further includes an error checking module;
[0075] The basic input and output system is used to add a redundant check code to the second data packet to generate a fourth data packet; and send the fourth data packet to the baseboard management controller through the memory-mapped motherboard management controller interface;
[0076] The error checking module is used to detect content errors of the second data packet according to the redundant check code.
[0077] Optionally, each of the plurality of data blocks is provided with an identifier, and the baseboard management controller further comprises an error recovery module, the error recovery module being configured to send a data request for a target identifier to the basic input and output system;
[0078] The basic input and output system is used for sending a data block corresponding to the target identifier to the baseboard management controller in response to a data request of the baseboard management controller for the target identifier.
[0079] Some embodiments of the present application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the above data interaction method when executed by the processor.
[0080] Some embodiments of the present application further provide a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned data interaction method is implemented.
[0081] In some embodiments of the present application, a basic input / output system can first determine a first data packet to be sent to a baseboard management controller and segment the first data packet into multiple data blocks of a target size; then determine repeated character string sequences in the multiple data blocks and determine the location information of the repeated character string sequences in the first data packet; then generate a second data packet based on the non-repeated character string sequences, repeated character string sequences, and the location information in the multiple data blocks; and then send the second data packet to the baseboard management controller via a memory-mapped motherboard management controller interface. Compared to the basic input / output system directly sending the data packet to the baseboard management controller, some embodiments of the present application can significantly reduce the amount of data transmitted between the basic input / output system and the baseboard management controller, thereby improving data transmission efficiency, thereby avoiding excessive bandwidth occupation by data transmission, and improving the efficiency of circular buffer utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0083] FIG1 is a schematic diagram of a data interaction in the prior art;
[0084] FIG2 is a flowchart of the steps of a data interaction method according to some embodiments of the present application;
[0085] FIG3 is a flowchart of another data interaction method according to some embodiments of the present application;
[0086] FIG4 is a flowchart of another data interaction method according to some embodiments of the present application;
[0087] FIG5 is a flowchart of another data interaction method according to some embodiments of the present application;
[0088] FIG6 is a flowchart of another data interaction method according to some embodiments of the present application;
[0089] FIG7 is a flowchart of another data interaction method according to some embodiments of the present application;
[0090] FIG8 is a flowchart of another data interaction method according to some embodiments of the present application;
[0091] FIG9 is a schematic diagram of the structure of a computer system according to some embodiments of the present application;
[0092] FIG10 is a flowchart of compression and decompression steps in some embodiments of the present application;
[0093] FIG11 is a flowchart of a replay protection method according to some embodiments of the present application;
[0094] FIG12 is a flowchart of the steps of data interaction between a basic input / output system and a baseboard management controller according to some embodiments of the present application;
[0095] FIG13 is a schematic structural diagram of an electronic device according to some embodiments of the present application;
[0096] FIG14 is a schematic diagram of the structure of a non-volatile computer-readable storage medium in some embodiments of the present application. DETAILED DESCRIPTION
[0097] To make the above-mentioned purposes, features, and advantages of this application more clearly understood, this application is further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on some of the embodiments in this application without inventive effort are also within the scope of protection of this application.
[0098] In actual applications, since MMBI does not implement a data compression mechanism, the amount of data transmitted between the BIOS and the BMC is greater than what is actually required, which not only occupies too much bandwidth but also reduces the efficiency of the circular buffer. In order to reduce the bandwidth occupied and to improve the efficiency of the circular buffer, some embodiments of the present application provide a method for data interaction between a basic input / output system and a baseboard management controller. This data interaction method can be applied to the data interaction scenario of a memory-mapped motherboard management controller interface. In this method, the data packet sent by the basic input / output system to the baseboard management controller can be compressed first and then sent to the baseboard management controller through the memory-mapped motherboard management controller interface. Compared with the basic input / output system directly sending the data packet to the baseboard management controller, this method can significantly reduce the amount of data transmitted between the basic input / output system and the baseboard management controller, thereby improving data transmission efficiency, thereby avoiding excessive bandwidth occupied by data transmission, and also improving the efficiency of the circular buffer.
[0099] Specifically, reference may be made to FIG2 , which shows a flowchart of steps of a data interaction method according to some embodiments of the present application. The data interaction method may be applied to a basic input / output system, which may communicate with a baseboard management controller via a memory-mapped motherboard management controller interface. As shown in FIG2 , the data interaction method may include the following steps:
[0100] Step 201: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0101] In practical applications, the basic input / output system may first determine a first data packet to be sent to the baseboard management controller; then, the first data packet may be compressed. For example, LZ4 (Lempel-Ziv 4, a lossless data compression algorithm) may be used to compress the first data packet. LZ4 is an efficient compression algorithm that uses a dictionary compression method to divide input data into small blocks and then construct a dictionary to store previous data blocks to find and eliminate redundant information.
[0102] Specifically, after determining the first data packet to be sent by the BIOS to the baseboard management controller, the BIOS may first segment the first data packet into multiple data blocks of the target size based on a preset target size. The target size may be set based on actual conditions, for example, 16 kilobytes (KB), and some embodiments of the present application are not limited thereto.
[0103] Step 202: Determine repeated character string sequences in multiple data blocks, and determine position information of the repeated character string sequences in the first data packet.
[0104] After obtaining multiple data blocks, repeated character string sequences in the data blocks can be determined, that is, character string sequences whose mutual similarity exceeds a preset value. While determining the repeated character string sequences, the position information of these repeated character string sequences in the first data packet can also be determined, so that during subsequent decompression, they can be copied at corresponding positions based on the position information.
[0105] Step 203: Generate a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks.
[0106] When determining repeated character string sequences in multiple data blocks, non-repeated character string sequences in multiple data blocks can also be determined; then, based on the non-repeated character string sequences, repeated character string sequences, and position information in the multiple data blocks, a second data packet with a smaller data volume than the first data packet can be generated.
[0107] Step 204: Send the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface.
[0108] After generating the second data packet, the BIOS can send the generated second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface, thereby realizing data interaction between the BIOS and the baseboard management controller.
[0109] In some embodiments of the present application, a basic input / output system can first determine a first data packet to be sent to a baseboard management controller and segment the first data packet into multiple data blocks of a target size; then determine repeated character string sequences in the multiple data blocks and determine the location information of the repeated character string sequences in the first data packet; then generate a second data packet based on the non-repeated character string sequences, repeated character string sequences, and the location information in the multiple data blocks; and then send the second data packet to the baseboard management controller via a memory-mapped motherboard management controller interface. Compared to the basic input / output system directly sending the data packet to the baseboard management controller, some embodiments of the present application can significantly reduce the amount of data transmitted between the basic input / output system and the baseboard management controller, thereby improving data transmission efficiency, thereby avoiding excessive bandwidth occupation by data transmission, and improving the efficiency of circular buffer utilization.
[0110] 3 , which shows a flowchart of another data interaction method according to some embodiments of the present application, the data interaction method may include the following steps:
[0111] Step 301: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0112] In practical applications, the BIOS may first determine a first data packet to be sent to the baseboard management controller, and then compress the first data packet. Specifically, after determining the first data packet to be sent to the baseboard management controller, the BIOS may first segment the first data packet into a plurality of data blocks of a target size according to a preset target size.
[0113] In some feasible embodiments, LZ4 may be integrated into the firmware code of the basic input / output system as an independent module to ensure the decoupling of the module from other parts, thereby facilitating management and updating.
[0114] Step 302: Write the character string sequence of the data block into the preset dictionary in sequence.
[0115] In some embodiments of the present application, a preset dictionary can be created in advance; then, the string sequences of the segmented data blocks can be written into the preset dictionary in sequence; when the string sequences are written into the preset dictionary, a hash search can be performed, and repeated string sequences can be quickly located through the hash algorithm.
[0116] Step 303: When the character string sequence currently written into the preset dictionary matches the character string sequence previously written into the preset dictionary, it is determined that the character string sequence currently written into the preset dictionary is a repeated character string sequence.
[0117] If it is detected that the string sequence currently written into the preset dictionary matches the string sequence previously written into the preset dictionary, it can be determined that the string sequence currently written into the preset dictionary is a repeated string sequence; in this case, the repeated string sequence may not be written into the preset dictionary, that is, the preset dictionary only stores string sequences that have not appeared previously.
[0118] Step 304: Determine the position information of the repeated character string sequence in the first data packet.
[0119] When determining the repeated string sequence, the position information of the repeated string sequence in the first data packet may be determined; the position information may be represented by an offset value, and the offset value may be used to represent the position of the repeated string sequence in the first data packet.
[0120] Step 305: Generate a token for the repeated string sequence, where the token includes the literal length and matching length corresponding to the repeated string sequence.
[0121] When determining a repeated string sequence, a token may be generated for the repeated string sequence, in which the literal length and matching length corresponding to the repeated string sequence may be stored; wherein the literal length may refer to the length of the currently scanned string sequence, and the matching length refers to the length of the longest string sequence that matches the current string sequence.
[0122] In some embodiments of the present application, a compression level setting can be defined for LZ4 to accommodate different transmission requirements. Different compression levels can be selected based on the data transmission rate and urgency. When the data volume is large or the transmission is slow, a higher compression level can be selected to reduce the amount of data transmitted; when fast transmission is required, a lower compression level can be selected to reduce processing time. Specifically, different compression levels can be achieved through the following steps:
[0123] Determine the bandwidth occupied by the current data interaction and the data transmission speed between the basic input and output system and the baseboard management controller; determine the transmission priority of the first data packet; determine the target compression level based on the bandwidth occupied by the current data interaction and the data transmission speed, as well as the transmission priority; the target compression level is used to determine the length of the matching length.
[0124] In some feasible embodiments, the bandwidth occupied by the current data interaction between the basic input and output system and the baseboard management controller and the data transmission speed can be determined first; at the same time, the transmission priority of the first data packet can also be determined; the transmission priority can be set in advance for the data packet, and some embodiments of the present application do not limit this.
[0125] After determining the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority of the first data packet, the target compression level corresponding to the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority of the first data packet can be determined according to preset rules; illustratively, compression levels can be set in advance for different bandwidths, data transmission speeds, and transmission priorities; when determining the target compression level corresponding to the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority of the first data packet, the target compression level can be determined based on the preset correspondence.
[0126] After determining the target compression level, the first data packet can be compressed based on the target compression level; illustratively, the amount of compression for the first data packet can be determined based on the target compression level; when the target compression level is higher, the first data packet is compressed more, and when the target compression level is lower, the first data packet is compressed less.
[0127] As another example, the length of the matching length can be determined based on the target compression level; for example: the larger the target compression level, the longer the matching length, and the smaller the target compression level, the shorter the matching length. Some embodiments of the present application do not limit this.
[0128] Step 306: Generate a second data packet according to the preset dictionary, the tokens corresponding to each repeated string sequence, and the position information.
[0129] In some embodiments of the present application, after obtaining a preset dictionary, tokens corresponding to each repeated string sequence, and position information of each repeated string sequence, a second data packet with a smaller data volume than the first data packet can be generated based on the preset dictionary, tokens corresponding to each repeated string sequence, and position information.
[0130] Step 307: Send the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface.
[0131] After generating the second data packet, the BIOS can send the generated second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface, thereby realizing data interaction between the BIOS and the baseboard management controller.
[0132] In some embodiments of the present application, a basic input / output system can first determine a first data packet to be sent to a baseboard management controller (BMC) and divide the first data packet into multiple data blocks of a target size; then sequentially write the string sequences of the data blocks into a preset dictionary; when the string sequence currently written into the preset dictionary matches the string sequence previously written into the preset dictionary, determine that the string sequence currently written into the preset dictionary is a repeated string sequence; determine the position information of the repeated string sequence in the first data packet; generate a token for the repeated string sequence, the token including the literal length and matching length corresponding to the repeated string sequence; generate a second data packet based on the preset dictionary, the token corresponding to each repeated string sequence, and the position information; and send the second data packet to the BMC via a memory-mapped BMC interface. Compared to the basic input / output system directly sending the data packet to the BMC, some embodiments of the present application can significantly reduce the amount of data transmitted between the basic input / output system and the BMC, thereby improving data transmission efficiency, thereby avoiding excessive bandwidth occupation by data transmission, and improving the efficiency of circular buffer utilization.
[0133] 4 , which shows a flowchart of another data interaction method according to some embodiments of the present application, the data interaction method may include the following steps:
[0134] Step 401: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0135] Step 402: Determine repeated character string sequences in multiple data blocks, and determine position information of the repeated character string sequences in the first data packet.
[0136] Step 403: Generate a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks.
[0137] The above steps 401 to 403 are similar to the above steps 201 to 203 and are not described again here.
[0138] Step 404: Encrypt the second data packet according to the preset key to obtain a third data packet.
[0139] In actual applications, existing memory-mapped BMC interfaces lack data encryption or authentication mechanisms, making data transmitted through the interface vulnerable to interception and tampering. This significantly increases security risks when transmitting sensitive information. To mitigate the risks of interception and tampering when exchanging data through the memory-mapped BMC interface, the BIOS can encrypt the second data packet using a preset key before sending it to the BMC, thereby generating a third data packet.
[0140] For example, the second data packet can be encrypted using AES-128-GCM (Advanced Encryption Standard with a 128-bit key in Galois / Counter Mode). Specifically, the second data packet can be divided into blocks that meet the encryption block size requirements of AES-128-GCM. These blocks can then be independently encrypted using the AES-128-GCM algorithm to obtain a third data packet. The third data packet can include multiple data blocks independently encrypted using the AES-128-GCM algorithm.
[0141] Step 405: Send the third data packet to the baseboard management controller through the memory-mapped motherboard management controller interface. The baseboard management controller is configured to decrypt the third data packet according to a preset key to obtain a second data packet.
[0142] After obtaining the third data packet, the third data packet can be sent to the baseboard management controller through the memory-mapped motherboard management controller interface; after receiving the third data packet, the baseboard controller can decrypt the third data packet to obtain the second data packet; then, the second data packet can be further decompressed to obtain the first data packet.
[0143] In some feasible embodiments, when the third data packet is sent to the baseboard management controller through the memory-mapped motherboard management controller interface, TLS (Transport Layer Security) can be used during the transmission process to provide an additional security layer during transmission to prevent the data from being intercepted or tampered with.
[0144] In some embodiments of the present application, the following steps may also be included:
[0145] When a preset security event is detected, the preset key is replaced; and the replaced preset key is sent to the baseboard management controller.
[0146] In actual applications, a preset security event can be set. The security event can be a preset event interval or other event, such as an event of preset key leakage, etc. Some embodiments of the present application do not limit this.
[0147] When it is detected that a preset security event has been triggered, the basic input and output system can replace the preset key and transmit the replaced preset key to the baseboard management controller through a secure transmission channel, such as a TLS transmission channel; after receiving the replaced preset key, the baseboard management controller can subsequently use the replaced preset key to decrypt the received data packet. Some embodiments of the present application do not limit this.
[0148] In addition, after receiving the replaced preset key, the baseboard management controller may delete the previous preset key and save the replaced preset key.
[0149] In some embodiments of the present application, a first data packet to be sent to a baseboard management controller is determined, and the first data packet is divided into multiple data blocks of a target size; repeated character string sequences in the multiple data blocks are determined, and location information of the repeated character string sequences in the first data packet is determined; a second data packet is generated based on the non-repeated character string sequences, repeated character string sequences, and location information in the multiple data blocks; the second data packet is encrypted according to a preset key to obtain a third data packet; the third data packet is sent to the baseboard management controller via a memory-mapped motherboard management controller interface, and the baseboard management controller is configured to decrypt the third data packet according to the preset key to obtain a second data packet. Through some embodiments of the present application, the risk of data being decrypted and tampered with when a basic input and output system communicates with a baseboard management controller via a memory-mapped motherboard management controller interface can be avoided, thereby improving the security of data interaction.
[0150] 5 , which shows a flowchart of another data interaction method according to some embodiments of the present application, the data interaction method may include the following steps:
[0151] Step 501: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0152] Step 502: Determine repeated character string sequences in multiple data blocks, and determine position information of the repeated character string sequences in the first data packet.
[0153] Step 503: Generate a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks.
[0154] The above steps 501 to 503 are similar to the above steps 201 to 203 and are not described again here.
[0155] Step 504: Add the currently polled target sequence number to the second data packet.
[0156] In practical applications, existing MMBs lack effective data uniqueness verification mechanisms and have weak synchronization mechanisms, resulting in an inability to ensure data novelty and a failure to ensure state consistency between the baseboard management controller and the basic input / output system.
[0157] In order to ensure the state consistency between the baseboard management controller and the basic input and output system, the basic input and output system may add the currently polled target sequence number into the second data packet before sending the second data packet.
[0158] The sequence number can be a strictly monotonically increasing integer. The basic input and output system is responsible for updating this value each time data is transmitted to ensure the uniqueness of each data packet. The target sequence number can refer to the sequence number currently polled.
[0159] During the initial synchronization phase, a secure handshake process can be performed between the BIOS and the BMC using TLS to ensure that the serial numbers are synchronized on both ends. Specifically, the BIOS and the BMC synchronize the serial numbers.
[0160] Illustratively, the BIOS and the BMC may synchronize serial numbers through a secure handshake process via TLS.
[0161] Step 505: Send the second data packet with the target serial number added thereto to the baseboard management controller via the memory-mapped baseboard management controller interface; the baseboard management controller is configured to detect a replay attack on the second data packet according to the target serial number.
[0162] After the target serial number is added to the second data packet, the basic input and output system may send the second data packet with the target serial number added to the baseboard management controller through the memory-mapped baseboard management controller interface.
[0163] After receiving the second data packet with the target sequence number added, the BMC can detect replay attacks based on the target sequence number. Specifically, when receiving the second data packet, the BMC can first check the target sequence number to determine whether the target sequence number increases in the expected order. If the received target sequence number is less than or equal to the previous sequence number recorded by the BMC, the BMC will determine that the second data packet is a replay attack and immediately discard it, ensuring that an attacker cannot deceive the system by resending old data packets.
[0164] On the contrary, if the received target serial number is greater than the previous serial number recorded by the baseboard management controller, the second data packet may be subsequently processed, for example, decrypted, decompressed, etc., which is not limited in some embodiments of the present application.
[0165] In some embodiments of the present application, a first data packet to be sent to a baseboard management controller is determined and the first data packet is divided into multiple data blocks of a target size; repeated character string sequences in the multiple data blocks are determined, and the position information of the repeated character string sequences in the first data packet is determined; a second data packet is generated based on the non-repeated character string sequences, repeated character string sequences, and the position information in the multiple data blocks; a target sequence number currently polled is added to the second data packet; the second data packet with the added target sequence number is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; and the baseboard management controller is configured to detect replay attacks on the second data packet based on the target sequence number. Through some embodiments of the present application, the uniqueness of data transmitted between the baseboard management controller and the basic input / output system can be guaranteed.
[0166] 6 , which shows a flowchart of another data interaction method according to some embodiments of the present application, the data interaction method may include the following steps:
[0167] Step 601: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0168] Step 602: Determine repeated character string sequences in multiple data blocks, and determine position information of the repeated character string sequences in the first data packet.
[0169] Step 603: Generate a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks.
[0170] The above steps 601 to 603 are similar to the above steps 201 to 203 and are not described again here.
[0171] Step 604: Add a target timestamp to the second data packet according to the current system time of the basic input and output system.
[0172] In order to ensure the state consistency between the baseboard management controller and the basic input and output system, some of the present applications can also detect replay attacks based on time; specifically, after generating the second data packet, the basic input and output system can first determine the current system time of the basic input and output system, and based on the current system time, add a target timestamp in the second data packet.
[0173] In some embodiments of the present application, the above embodiments may further include the following steps:
[0174] The basic input and output system and the baseboard management controller perform time synchronization.
[0175] During the initial synchronization phase, a secure handshake process can be performed between the BIOS and the BMC using TLS to ensure that the time between the two is synchronized.
[0176] Step 605: Send the second data packet with the target timestamp added thereto to the baseboard management controller via the memory-mapped motherboard management controller interface; the baseboard management controller is configured to detect a replay attack on the second data packet according to the target timestamp.
[0177] After adding the target timestamp to the second data packet, the basic input and output system may send the second data packet with the target timestamp added to the baseboard management controller through the memory-mapped baseboard management controller interface.
[0178] After receiving the second data packet with the target timestamp added, the baseboard management controller can detect the second data packet for replay attack based on the target timestamp; specifically, the baseboard management controller can determine the current system time of the baseboard management controller and determine the difference between the current system time and the target timestamp; if the difference exceeds the preset tolerance time window, the baseboard management controller can determine that the second data packet is a delayed or replayed data packet and can discard it.
[0179] In some embodiments of the present application, the above steps 504-505 and steps 604-605 can be performed simultaneously. Specifically, steps 504-505 and steps 604-605 can be performed simultaneously in the following manner:
[0180] The target serial number currently polled is added to the second data packet; a target timestamp is added to the second data packet to which the target serial number currently polled is added according to the current system time of the basic input and output system; and the second data packet to which the target timestamp and target serial number are added is sent to the baseboard management controller through a memory-mapped motherboard management controller interface.
[0181] Among them, the baseboard management controller is used to detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller after receiving the second data packet with the target timestamp and target serial number added thereto; when the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller, discard the second data packet; when the target serial number is greater than the previous serial number, determine whether the deviation between the target timestamp and the current system time of the baseboard management controller exceeds a preset deviation value; when the deviation between the target timestamp and the current system time of the baseboard management controller exceeds the preset deviation value, discard the second data packet.
[0182] In practical applications, before sending the second data packet, the basic input / output system may add the currently polled target sequence number to the second data packet; at the same time, the basic input / output system may also add a target timestamp to the second data packet to which the currently polled target sequence number is added according to the current system time of the basic input / output system.
[0183] After adding the target timestamp and the target serial number to the second data packet, the basic input and output system can send the second data packet with the target timestamp and the target serial number added to the baseboard management controller through the memory-mapped baseboard management controller interface.
[0184] After receiving the second data packet with the target timestamp and the target serial number added thereto, the baseboard management controller may detect a replay attack on the second data packet based on the target timestamp and the target serial number.
[0185] Specifically, after receiving the second data packet with the target timestamp and the target serial number added thereto, the baseboard management controller may first detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller.
[0186] If the target sequence number is less than or equal to the last sequence number recorded in the baseboard management controller, the second data packet may be discarded.
[0187] On the contrary, if the target serial number is greater than the last serial number recorded in the baseboard management controller, it can be further determined whether the deviation between the target timestamp and the current system time of the baseboard management controller exceeds a preset deviation value.
[0188] If the deviation between the target timestamp and the current system time of the baseboard management controller exceeds the preset deviation value, the second data packet can be discarded; otherwise, the second data packet can be subsequently decrypted, decompressed, etc., which is not limited in some embodiments of the present application.
[0189] In some embodiments of the present application, some embodiments of simultaneously executing steps 504-505 and steps 604-605 may further include the following steps:
[0190] The BIOS synchronizes the serial number and time with the baseboard management controller.
[0191] In some feasible embodiments, during the initial synchronization phase, a secure handshake process may be performed between the BIOS and the BMC to ensure that the sequence number and time are synchronized on both ends via TLS.
[0192] In some embodiments of the present application, a first data packet to be sent to a baseboard management controller is determined and the first data packet is divided into multiple data blocks of a target size; repeated character string sequences in the multiple data blocks are determined, and the position information of the repeated character string sequences in the first data packet is determined; a second data packet is generated based on the non-repeated character string sequences, repeated character string sequences, and the position information in the multiple data blocks; a target timestamp is added to the second data packet based on the current system time of the basic input and output system; the second data packet with the target timestamp added is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; and the baseboard management controller is configured to detect replay attacks on the second data packet based on the target timestamp. Through some embodiments of the present application, the timeliness of data transmission between the baseboard management controller and the basic input and output system can be guaranteed.
[0193] 7 , which shows a flowchart of another data interaction method according to some embodiments of the present application, the data interaction method may include the following steps:
[0194] Step 701: Determine a first data packet to be sent to a baseboard management controller, and divide the first data packet into multiple data blocks of a target size.
[0195] Step 702: Determine repeated character string sequences in multiple data blocks, and determine position information of the repeated character string sequences in the first data packet.
[0196] Step 703: Generate a second data packet according to the non-repeated character string sequences, the repeated character string sequences, and the position information in the plurality of data blocks.
[0197] The above steps 701 to 703 are similar to the above steps 201 to 203 and are not described again here.
[0198] Step 704: Add a redundant check code to the second data packet to generate a fourth data packet.
[0199] During data transmission, the existing memory-mapped motherboard management controller interface does not provide a corresponding error detection mechanism to ensure data integrity and consistency. Based on this, some embodiments of the present application can add a redundant check code to the second data packet to obtain a fourth data packet.
[0200] Step 705: Send the fourth data packet to the baseboard management controller through the memory-mapped motherboard management controller interface; the baseboard management controller is configured to detect content errors of the second data packet based on the redundant check code.
[0201] The basic input / output system can then send the fourth data packet to the baseboard management controller via the memory-mapped motherboard management controller interface. After receiving the fourth data packet, the baseboard management controller can detect content errors in the second data packet based on a redundant checksum. Exemplarily, a cyclic redundancy check (CRC) can be used to detect content errors, although some embodiments of the present application are not limited thereto.
[0202] In some embodiments of the present application, each of the plurality of data blocks is provided with an identifier; the above method may further include the following steps:
[0203] In response to a data request of the baseboard management controller for the target identifier, a data block corresponding to the target identifier is sent to the baseboard management controller.
[0204] During the data transmission process, once an error occurs, the existing memory-mapped motherboard management controller interface does not provide sufficient error recovery mechanisms to ensure data integrity and consistency; to ensure data integrity and consistency, some embodiments of the present application can set a unique identifier for each data block; then, when the baseboard management controller detects a data error, it can only request data of the target identifier corresponding to the error without retransmitting the entire data stream.
[0205] Specifically, the baseboard management controller can send a target identifier of the data corresponding to the error to the basic input and output system; after receiving the data request for the target identifier from the baseboard management controller, the basic input and output system can respond to the request and send a data block corresponding to the target identifier to the baseboard management controller through the memory-mapped motherboard management controller interface.
[0206] In some embodiments of the present application, a first data packet to be sent to a baseboard management controller is determined, and the first data packet is divided into multiple data blocks of a target size; repeated string sequences in the multiple data blocks are determined, and the position information of the repeated string sequences in the first data packet is determined; a second data packet is generated based on the non-repeated string sequences, repeated string sequences, and position information in the multiple data blocks; a redundant check code is added to the second data packet to generate a fourth data packet; the fourth data packet is sent to the baseboard management controller via a memory-mapped motherboard management controller interface; the baseboard management controller is used to detect content errors in the second data packet based on the redundant check code. Through some embodiments of the present application, the reliability of data transmission can be improved. When an error is found, only the erroneous data block needs to be retransmitted, avoiding the retransmission of the entire data, thereby optimizing the time cost and resource consumption during the transmission process.
[0207] From the perspective of a baseboard management controller, some embodiments of the present application provide another data interaction method. FIG. 8 shows the data interaction method applied to a baseboard management controller. As shown in FIG. 8 , the data interaction method may include the following steps:
[0208] Step 801: Receive a second data packet sent by a basic input / output system through a memory-mapped baseboard management controller interface; wherein the second data packet is generated by the basic input / output system determining a first data packet to be sent to the baseboard management controller, dividing the first data packet into multiple data blocks of target size, determining repeated character string sequences in the multiple data blocks, and determining position information of the repeated character string sequences in the first data packet; and generating the data packet based on the non-repeated character string sequences, repeated character string sequences, and position information in the multiple data blocks.
[0209] In some embodiments of the present application, after the BIOS determines a first data packet to be sent to the baseboard management controller, the BIOS may first segment the first data packet into multiple data blocks of target sizes according to a preset target size.
[0210] After obtaining multiple data blocks, the basic input and output system can first determine repeated character string sequences in the data blocks, that is, character string sequences whose similarity to each other exceeds a preset value; while determining the repeated character string sequences, the basic input and output system can also determine the position information of these repeated character string sequences in the first data packet, so that during subsequent decompression, the repeated character string sequences can be copied at corresponding positions based on the position information.
[0211] When determining repeated character string sequences in the multiple data blocks, the basic input / output system may also determine non-repeated character string sequences in the multiple data blocks; then, the basic input / output system may generate a second data packet having a smaller data volume than the first data packet based on the non-repeated character string sequences, repeated character string sequences, and position information in the multiple data blocks, and send the second data packet to the baseboard management controller via a memory-mapped motherboard management controller interface.
[0212] Step 802: Decompress the second data packet to obtain the first data packet.
[0213] After receiving the second data packet, the baseboard management controller may decompress the second data packet to obtain a corresponding first data packet.
[0214] In some embodiments of the present application, the second data packet is generated after the basic input and output system sequentially writes the string sequence of the data block into the preset dictionary. When the string sequence currently written into the preset dictionary matches the string sequence previously written into the preset dictionary, it is determined that the string sequence currently written into the preset dictionary is a repeated string sequence; a token is generated for the repeated string sequence, and the token includes the literal length and the matching length corresponding to the repeated string sequence; the data packet is generated based on the preset dictionary, the tokens corresponding to each repeated string sequence, and the position information; the above-mentioned step 802 can be implemented by the following sub-steps:
[0215] Sub-step 11: Read the token and location information in the second data packet.
[0216] In some feasible embodiments, after receiving the second data packet, the baseboard management controller may first read the token and the position information of the repeated character string sequence.
[0217] Sub-step 12: Generate a first data packet according to the token, the location information, and the data block in the preset dictionary.
[0218] Then, the baseboard management controller may copy the literal to the output buffer according to the information in the token, and copy the repeated sequence from the previous position in the output buffer according to the position information and the length information, thereby completing data decompression and obtaining the first data packet.
[0219] In some embodiments of the present application, a baseboard management controller receives a second data packet sent by a basic input / output system (BIOS) via a memory-mapped motherboard management controller (MBMC) interface; wherein the second data packet is generated by the BIOS determining a first data packet to be sent to the BMC, segmenting the first data packet into multiple data blocks of a target size, determining repeated character string sequences in the multiple data blocks, and determining location information of the repeated character string sequences in the first data packet; generating a data packet based on the non-repeated character string sequences, repeated character string sequences, and location information in the multiple data blocks; and decompressing the second data packet to obtain the first data packet. Compared to the BIOS directly sending the data packet to the BMC, some embodiments of the present application can significantly reduce the amount of data transmitted between the BIOS and the BMC, thereby improving data transmission efficiency, thereby avoiding excessive bandwidth occupation by data transmission, and improving the efficiency of circular buffer usage.
[0220] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that some embodiments of the present application are not limited by the order of the actions described, because according to some embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that some embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily required for some embodiments of the present application.
[0221] The data interaction methods mentioned in some of the above embodiments can be specifically applied to a computer system. Specifically, as shown in FIG9 , the computer system 90 may include a basic input / output system 910 and a baseboard management controller 920. The basic input / output system 910 and the baseboard management controller 920 communicate with each other via a memory-mapped motherboard management controller interface.
[0222] The basic input and output system 910 includes a compression module 911, which is used to determine a first data packet to be sent to the baseboard management controller 920 and split the first data packet into multiple data blocks of a target size; determine repeated character string sequences in the multiple data blocks and determine location information of the repeated character string sequences in the first data packet; and generate a second data packet based on the non-repeated character string sequences, the repeated character string sequences, and the location information in the multiple data blocks;
[0223] The basic input and output system 910 is used to send the second data packet to the baseboard management controller 920 through the memory-mapped motherboard management controller interface;
[0224] The baseboard management controller 920 includes a decompression module 921 , which is configured to decompress the second data packet to obtain a first data packet.
[0225] In some embodiments of the present application, the basic input and output system 910 may include a compression module 911 for compressing data; the compression module 911 may be based on LZ4.
[0226] After determining the first data packet, the compression module 911 may first divide the first data packet into a plurality of data blocks of target sizes according to a preset target size.
[0227] After obtaining multiple data blocks, the compression module 911 can first determine repeated character string sequences in the data blocks, that is, character string sequences whose similarity to each other exceeds a preset value; while determining the repeated character string sequences, the position information of these repeated character string sequences in the first data packet can be determined so that during subsequent decompression, the repeated character string sequences can be copied at corresponding positions based on the position information.
[0228] When determining repeated character string sequences in multiple data blocks, the compression module 911 can also determine non-repeated character string sequences in multiple data blocks; then, the compression module 911 can generate a second data packet with a smaller data volume than the first data packet based on the non-repeated character string sequences, repeated character string sequences, and position information in the multiple data blocks.
[0229] After receiving the second data packet, the BIOS 910 may send the second data packet to the BMC 920 via the memory-mapped BMC interface.
[0230] After receiving the second data packet, the decompression module 921 in the baseboard management controller 920 may decompress the second data packet and obtain the corresponding first data packet.
[0231] For example, as shown in Figure 10, a flow chart of the compression and decompression steps of some embodiments of the present application is shown; as shown in Figure 10, after determining the first data packet, the first data packet can be first divided into data blocks of 16kb in size; then, the target compression level can be determined based on the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority of the first data packet.
[0232] When determining the target compression level, a preset dictionary can be constructed. Next, the string sequences in the data blocks can be written into the preset dictionary one by one and a hash lookup can be performed to quickly locate repeated string sequences using the hash algorithm.
[0233] When determining a repeated string sequence, a token can also be generated for the repeated string sequence. The information in the token specifies the exact length of the copied literals that need to be copied subsequently. In addition, the position information of the repeated string sequence in the first data packet can be stored, that is, the offset value is stored, and the length of the repeated string sequence is recorded, thereby obtaining a compressed second data packet.
[0234] The basic input / output system transmits the second data packet to the baseboard management controller through a security module (i.e., including an encryption module, a replay protection module, an error checking module, and an error recovery module); after receiving the second data packet, the baseboard management controller can read the token, copy the literal, and read the offset; and then merge the data based on the token, the copied literal, and the offset value to obtain the first data packet.
[0235] In some embodiments of the present application, as shown in FIG9 , the basic input and output system 910 further includes an encryption module 912 , which is configured to encrypt the second data packet according to a preset key to obtain a third data packet;
[0236] The basic input and output system 910 is used to send the third data packet to the baseboard management controller 920 through the memory-mapped motherboard management controller interface;
[0237] The baseboard management controller 920 further includes a decryption module 922 , which is configured to decrypt the third data packet according to a preset key to obtain a second data packet.
[0238] In some embodiments of the present application, the basic input and output system 910 may further include an encryption module 912 for encrypting data; specifically, after the compression module 911 obtains the second data packet, the encryption module 912 may encrypt the second data packet according to a preset key to obtain a third data packet.
[0239] After obtaining the third data packet, the basic input and output system 910 can send the third data packet to the baseboard management controller 920 through the memory-mapped motherboard management controller interface; after the baseboard management controller 920 receives the third data packet, the decryption module 922 in the baseboard management controller 920 can decrypt the third data packet according to the preset key to obtain the second data packet, and further call the decryption module 922 to decrypt the second data packet to obtain the first data packet.
[0240] In some embodiments of the present application, as shown in FIG9 , the baseboard management controller 920 further includes a replay protection module 923 ;
[0241] The basic input and output system 910 is used to synchronize the serial number with the baseboard management controller 920 and add the target serial number currently polled in the second data packet; and send the second data packet with the target serial number added to the baseboard management controller 920 through the memory-mapped baseboard management controller interface;
[0242] The replay protection module 923 is used to detect a replay attack on the second data packet according to the target sequence number.
[0243] In some embodiments of the present application, during the initial synchronization phase, a secure handshake process can be performed between the basic input / output system 910 and the baseboard management controller 920 to ensure that the serial numbers are synchronized at both ends through TLS. Specifically, the basic input / output system 910 and the baseboard management controller 920 synchronize the serial numbers.
[0244] Before sending the second data packet, the BIOS 910 may add the currently polled target sequence number to the second data packet. After adding the target sequence number to the second data packet, the BIOS 910 may send the second data packet with the target sequence number added to it to the baseboard management controller 920 via the memory-mapped baseboard management controller interface.
[0245] After the baseboard management controller 920 receives the second data packet with the target serial number added, the replay defense module 923 in the baseboard management controller 920 can detect the replay attack on the second data packet based on the target serial number; specifically, when the baseboard management controller 920 receives the second data packet, the replay defense module 923 can first check the target serial number to determine whether the target serial number increases in the expected order. If the received target serial number is less than or equal to the previous serial number recorded by the baseboard management controller 920, the replay defense module 923 will determine that the second data packet is a replay attack and immediately discard it to ensure that the attacker cannot deceive the system by resending the old data packet. On the contrary, if the received target serial number is greater than the previous serial number recorded by the baseboard management controller 920, the baseboard management controller 920 can perform subsequent processing on the second data packet, such as decryption, decompression, etc., and some embodiments of the present application do not limit this.
[0246] In other embodiments of the present application, the replay protection module 923 may also detect replay attacks based on timestamps. Specifically:
[0247] The basic input / output system 910 is configured to synchronize time with the baseboard management controller 920 and add a target timestamp to the second data packet according to the current system time of the basic input / output system 910; and transmit the second data packet with the target timestamp to the baseboard management controller 920 via a memory-mapped baseboard management controller interface.
[0248] The replay protection module 923 is configured to detect a replay attack on the second data packet according to the target timestamp.
[0249] In some embodiments of the present application, during the initial synchronization phase, a secure handshake process can be performed between the basic input / output system 910 and the baseboard management controller 920 to ensure that the time is synchronized at both ends through TLS. Specifically, the basic input / output system 910 and the baseboard management controller 920 perform time synchronization.
[0250] Before sending the second data packet, the BIOS 910 may add a target timestamp to the second data packet based on the current system time of the BIOS 910. After adding the target timestamp to the second data packet, the BIOS 910 may send the second data packet with the target timestamp to the baseboard management controller 920 via the memory-mapped baseboard management controller interface.
[0251] After the baseboard management controller 920 receives the second data packet with the target timestamp added, the replay defense module 923 in the baseboard management controller 920 can detect the replay attack on the second data packet based on the target timestamp; specifically, the replay defense module 923 can determine the current system time of the baseboard management controller 920, and determine the difference between the current system time and the target timestamp; if the difference exceeds the preset tolerance time window, the replay defense module 923 can determine that the second data packet is a delayed or replayed data packet, and can discard it.
[0252] In other embodiments of the present application, the replay protection module 923 may also detect replay attacks based on the sequence number and timestamp. Specifically:
[0253] The BIOS 910 is configured to synchronize the serial number and time with the baseboard management controller 920 and add the currently polled target serial number to the second data packet; add a target timestamp to the second data packet to which the currently polled target serial number is added based on the current system time of the BIOS 910; and send the second data packet to which the target timestamp and target serial number are added to the baseboard management controller 920 via a memory-mapped baseboard management controller interface.
[0254] The replay defense module 923 is used to detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller 920 after receiving the second data packet with the target timestamp and target serial number added thereto; when the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller 920, discard the second data packet; when the target serial number is greater than the previous serial number, determine whether the deviation between the target timestamp and the current system time of the baseboard management controller 920 exceeds a preset deviation value; when the deviation between the target timestamp and the current system time of the baseboard management controller 920 exceeds the preset deviation value, discard the second data packet.
[0255] In some embodiments of the present application, during the initial synchronization phase, a secure handshake process can be performed between the basic input / output system 910 and the baseboard management controller 920 to ensure that the time and serial number are synchronized at both ends through TLS. Specifically, the basic input / output system 910 and the baseboard management controller 920 synchronize the time and serial number.
[0256] Before sending the second data packet, the BIOS 910 may add a target timestamp to the second data packet according to the current system time of the BIOS 910. At the same time, the currently polled target sequence number may also be added to the second data packet.
[0257] Next, the BIOS 910 may send the second data packet with the target timestamp and the target serial number added thereto to the BMC 920 through the memory-mapped BMC interface.
[0258] After the baseboard management controller 920 receives the second data packet with the target timestamp and the target serial number added thereto, the replay protection module 923 may detect a replay attack on the second data packet based on the target timestamp and the target serial number.
[0259] Specifically, after the baseboard management controller 920 receives the second data packet with the target timestamp and target serial number, the replay protection module 923 may first detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller 920 .
[0260] If the target sequence number is less than or equal to the previous sequence number recorded in the baseboard management controller 920 , the replay prevention module 923 may discard the second data packet.
[0261] On the contrary, if the target serial number is greater than the last serial number recorded in the BMC 920 , the replay protection module 923 may further determine whether the deviation between the target timestamp and the current system time of the BMC 920 exceeds a preset deviation value.
[0262] If the deviation between the target timestamp and the current system time of the baseboard management controller 920 exceeds a preset deviation value, the replay protection module 923 can discard the second data packet; otherwise, the baseboard management controller 920 can perform subsequent decryption, decompression, and other processing on the second data packet. Some embodiments of the present application do not limit this.
[0263] For example, as shown in FIG11 , a flowchart of the steps of replay defense in some embodiments of the present application is shown; as shown in FIG11 , the basic input and output system can send a second data packet with a target serial number and a target timestamp to the baseboard management controller through the transport layer security protocol; after receiving the second data packet, the baseboard management controller can first detect the target serial number. If the target serial number is less than or equal to the previous serial number, it is determined that the second data packet is a replay attack and is discarded.
[0264] On the contrary, if the target sequence number is greater than the previous sequence number, the target timestamp is detected; if it is determined based on the target timestamp that the second data packet has timed out, it may be discarded.
[0265] In some embodiments of the present application, as shown in FIG9 , the baseboard management controller 920 further includes an error checking module 924 ;
[0266] The basic input and output system 910 is used to add a redundant check code to the second data packet to generate a fourth data packet; and send the fourth data packet to the baseboard management controller 920 through the memory-mapped motherboard management controller interface;
[0267] The error checking module 924 is configured to detect content errors in the second data packet according to the redundant check code.
[0268] In some embodiments of the present application, the basic input and output system 910 may add a redundant check code to the second data packet to obtain a fourth data packet.
[0269] Then, the BIOS 910 can send the fourth data packet to the baseboard management controller 920 via the memory-mapped baseboard management controller interface. After receiving the fourth data packet, the error checking module 924 in the baseboard management controller 920 can detect content errors in the second data packet based on the redundant checksum. For example, a CRC can be used to detect content errors, but some embodiments of the present application are not limited to this.
[0270] In some embodiments of the present application, each of the plurality of data blocks is provided with an identifier; as shown in FIG9 , the baseboard management controller 920 further includes an error recovery module 925 , which is configured to send a data request for a target identifier to the basic input and output system 910 ;
[0271] The BIOS 910 is configured to send a data block corresponding to the target identifier to the BMC 920 in response to a data request of the BMC 920 for the target identifier.
[0272] In some embodiments of the present application, when a data error is detected, the error recovery module 925 in the baseboard management controller 920 can send a target identifier of the data corresponding to the error to the basic input and output system 910; after receiving a data request for the target identifier from the baseboard management controller 920, the basic input and output system 910 can respond to the request and send a data block corresponding to the target identifier to the baseboard management controller 920 through the memory-mapped motherboard management controller interface.
[0273] For example, as shown in FIG12 , a flowchart of the steps of data interaction between the basic input / output system and the baseboard management controller in some embodiments of the present application is shown; as shown in FIG12 , after determining the first data packet, the basic input / output system can first use a compression module to compress the first data packet; wherein, the compression module can use the LZ4 algorithm for compression to obtain a second data packet.
[0274] After obtaining the second data packet, the compression module can send it to the encryption module; the encryption module can encrypt the second data packet using AES-128-GCM to obtain an encrypted data packet; then, the basic input and output system can add a target serial number and a target timestamp to the encrypted data packet, and send the processed data packet to the baseboard management controller through a memory-mapped motherboard management controller interface; wherein the memory-mapped motherboard management controller interface maps the memory space of the baseboard management controller to the basic input and output system through an enhanced serial peripheral interface bus; and data transmission is carried out in accordance with the transport layer security protocol.
[0275] After receiving a data packet, the baseboard management controller can first detect a replay attack through the replay defense module; after the detection passes, the error checking module is used to detect data errors; the error checking module can detect the data packet based on a cyclic redundancy check algorithm.
[0276] After the error checking module determines that the data is wrong, the error recovery module may request retransmission of the erroneous data block; after obtaining a complete and correct data packet, it may be decrypted and compressed to obtain a first data packet.
[0277] It should be noted that the embodiments of the method part proposed in some embodiments of the present application can be applied in whole or in part to the embodiments of the system part, and some embodiments of the present application will not repeat the contents of the repeated parts.
[0278] In some embodiments of the present application, a computer system includes a basic input / output system 910 and a baseboard management controller 920, and the basic input / output system 910 communicates with the baseboard management controller 920 through a memory-mapped motherboard management controller interface; the basic input / output system 910 includes a compression module 911, and the compression module 911 is used to determine a first data packet to be sent to the baseboard management controller 920, and split the first data packet into multiple data blocks of a target size; determine a repeated string sequence in the multiple data blocks, and determine the position information of the repeated string sequence in the first data packet; generate a second data packet based on the non-repeated string sequence, the repeated string sequence, and the position information in the multiple data blocks; the basic input / output system 910 is used to send the second data packet to the baseboard management controller 920 through the memory-mapped motherboard management controller interface; the baseboard management controller 920 includes a decompression module 921, and the decompression module 921 is used to decompress the second data packet to obtain a first data packet. Compared to the basic input and output system 910 directly sending data packets to the baseboard management controller 920, some embodiments of the present application can significantly reduce the amount of data transmitted between the basic input and output system 910 and the baseboard management controller 920, thereby improving data transmission efficiency, thereby avoiding data transmission occupying too much bandwidth, and also improving the utilization efficiency of the circular buffer.
[0279] Some embodiments of the present application also provide an electronic device, as shown in Figure 13, the electronic device 13 includes a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and capable of running on the processor, and when the computer program is executed by the processor, the above data interaction method is implemented.
[0280] Some embodiments of the present application further provide a non-volatile computer-readable storage medium, as shown in FIG14 , on which a computer program 1401 is stored. When the computer program 1401 is executed by a processor, the above-mentioned data interaction method is implemented.
[0281] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0282] The various embodiments in this specification are described in a progressive manner. Some embodiments focus on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.
[0283] Those skilled in the art will appreciate that some embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, some embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, some embodiments of the present application may take the form of a computer program product implemented on one or more non-volatile computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0284] Some embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to some embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0285] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0286] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0287] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0288] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0289] The above provides a detailed introduction to a data interaction method, a computer system, an electronic device and a non-volatile computer-readable storage medium. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present application.
Claims
1. A data interaction method, characterized in that: Applied to a basic input / output system, the basic input / output system communicates with a baseboard management controller via a memory-mapped motherboard management controller interface, the method comprising: determining a first data packet to be sent to the baseboard management controller, and dividing the first data packet into a plurality of data blocks of a target size; Determining a repeated string sequence in the plurality of data blocks, and determining position information of the repeated string sequence in the first data packet; generating a second data packet according to the non-repeated character string sequences in the plurality of data blocks, the repeated character string sequences, and the position information; The second data packet is sent to the baseboard management controller via the memory-mapped motherboard management controller interface.
2. The method according to claim 1, characterized in that Determining repeated character string sequences in the plurality of data blocks includes: Write the string sequence of the data block into the preset dictionary in sequence; When the character string sequence currently written into the preset dictionary matches the character string sequence previously written into the preset dictionary, determining that the character string sequence currently written into the preset dictionary is a repeated character string sequence; Generating a second data packet according to the non-repeated character string sequences in the plurality of data blocks, the repeated character string sequences, and the position information includes: Generating a token for the repeated string sequence, wherein the token includes a literal length and a matching length corresponding to the repeated string sequence; The second data packet is generated according to the preset dictionary, the tokens corresponding to each repeated string sequence, and the position information.
3. The method according to claim 1, characterized in that The position information is an offset value, and the offset value is used to indicate the position of the repeated character string sequence in the first data packet.
4. The method according to claim 2, characterized in that The literal length is the length of the repeated string sequence, and the matching length is the length of the longest string sequence matched by the repeated string sequence.
5. The method according to claim 2, characterized in that The method further comprises: Determining the bandwidth occupied by the current data interaction and the data transmission speed between the basic input and output system and the baseboard management controller; determining a transmission priority of the first data packet; The target compression level is determined according to the bandwidth occupied by the current data interaction, the speed of data transmission, and the transmission priority; the target compression level is used to determine the length of the matching length.
6. The method according to claim 5, characterized in that The greater the target compression level, the longer the matching length is; the smaller the target compression level, the shorter the matching length is.
7. The method according to claim 1, characterized in that The step of sending the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface includes: Encrypting the second data packet according to a preset key to obtain a third data packet; The third data packet is sent to the baseboard management controller via the memory-mapped motherboard management controller interface. The baseboard management controller is configured to decrypt the third data packet according to the preset key to obtain a second data packet.
8. The method according to claim 7, characterized in that The method further comprises: When a preset security event is detected, the preset key is replaced; The replaced preset key is sent to the baseboard management controller.
9. The method according to claim 1, characterized in that The method further comprises: The basic input and output system synchronizes serial numbers with the baseboard management controller; The step of sending the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface includes: Add the currently polled target sequence number to the second data packet; A second data packet with a target serial number added thereto is sent to the baseboard management controller via the memory-mapped motherboard management controller interface; the baseboard management controller is configured to detect a replay attack on the second data packet according to the target serial number.
10. The method according to claim 9, characterized in that The detecting of a replay attack on the second data packet according to the target sequence number includes: Upon receiving the second data packet, checking the target sequence number to determine whether the target sequence number increases in an expected order; When the target serial number is less than or equal to the last serial number recorded by the baseboard management controller, it is determined that the second data packet is a replay attack, and the second data packet is discarded.
11. The method according to claim 1, wherein The method further comprises: The basic input and output system and the baseboard management controller perform time synchronization; The step of sending the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface includes: adding a target timestamp to the second data packet according to the current system time of the basic input and output system; A second data packet with a target timestamp added thereto is sent to the baseboard management controller via the memory-mapped motherboard management controller interface; the baseboard management controller is configured to detect a replay attack on the second data packet according to the target timestamp.
12. The method according to claim 11, characterized in that The detecting of a replay attack on the second data packet according to the target timestamp includes: Determining a current system time of the baseboard management controller and determining a difference between the current system time and the target timestamp; When the difference exceeds a preset tolerance time window, the second data packet is determined to be a delayed or replayed data packet, and the second data packet is discarded.
13. The method according to claim 1, wherein The method further comprises: The basic input and output system synchronizes the serial number and time with the baseboard management controller; The step of sending the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface includes: Add the currently polled target sequence number to the second data packet; adding a target timestamp to a second data packet to which the currently polled target sequence number is added according to the current system time of the basic input and output system; sending a second data packet having the target timestamp and the target serial number added thereto to the baseboard management controller via the memory-mapped baseboard management controller interface; Wherein, the baseboard management controller is configured to, after receiving a second data packet to which a target timestamp and a target serial number are added, detect whether the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller; when the target serial number is less than or equal to the previous serial number recorded in the baseboard management controller, discard the second data packet; when the target serial number is greater than the previous serial number, determine whether the deviation between the target timestamp and the current system time of the baseboard management controller exceeds a preset deviation value; when the deviation between the target timestamp and the current system time of the baseboard management controller exceeds the preset deviation value, discard the second data packet.
14. The method according to claim 1, wherein The step of sending the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface includes: adding a redundant check code to the second data packet to generate a fourth data packet; The fourth data packet is sent to the baseboard management controller via the memory-mapped motherboard management controller interface; the baseboard management controller is configured to detect content errors of the second data packet according to the redundant check code.
15. The method according to claim 14, characterized in that Each of the plurality of data blocks is provided with an identifier; the method further comprising: In response to the baseboard management controller's data request for the target identifier, a data block corresponding to the target identifier is sent to the baseboard management controller.
16. A data interaction method, characterized in that: Applied to a baseboard management controller, the baseboard management controller communicates with a basic input and output system via a memory-mapped motherboard management controller interface, the method comprising: receiving a second data packet sent by the basic input / output system through the memory-mapped baseboard management controller interface; wherein the second data packet is generated by the basic input / output system after determining a first data packet to be sent to the baseboard management controller, dividing the first data packet into multiple data blocks of target size, determining repeated character string sequences in the multiple data blocks, and determining position information of the repeated character string sequences in the first data packet; and generating the data packet based on the non-repeated character string sequences in the multiple data blocks, the repeated character string sequences, and the position information; The second data packet is decompressed to obtain the first data packet.
17. The method according to claim 16, characterized in that The second data packet is a data packet in which the basic input / output system sequentially writes a character string sequence of a data block into a preset dictionary. When a character string sequence currently written into the preset dictionary matches a character string sequence previously written into the preset dictionary, the character string sequence currently written into the preset dictionary is determined to be a repeated character string sequence; a token is generated for the repeated character string sequence, the token including a literal length and a matching length corresponding to the repeated character string sequence; A data packet generated according to the preset dictionary, tokens corresponding to each repeated string sequence, and the location information; The decompressing the second data packet to obtain the first data packet includes: reading the token and the location information in the second data packet; The first data packet is generated according to the token, the location information, and the data block in the preset dictionary.
18. A computer system, characterized in that: It includes a basic input and output system and a baseboard management controller, wherein the basic input and output system communicates with the baseboard management controller via a memory-mapped motherboard management controller interface; The basic input and output system includes a compression module, the compression module being configured to determine a first data packet to be sent to the baseboard management controller and to split the first data packet into a plurality of data blocks of a target size; Determining a repeated string sequence in the plurality of data blocks, and determining position information of the repeated string sequence in the first data packet; generating a second data packet according to the non-repeated character string sequences in the plurality of data blocks, the repeated character string sequences, and the position information; The basic input and output system is configured to send the second data packet to the baseboard management controller through the memory-mapped motherboard management controller interface; The baseboard management controller includes a decompression module, and the decompression module is configured to decompress the second data packet to obtain the first data packet.
19. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data interaction method according to any one of claims 1 to 17 is implemented.
20. A non-volatile computer-readable storage medium, characterized in that The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data interaction method according to any one of claims 1 to 17 is implemented.
Citation Information
Patent Citations
Data de-duplication method based on combination of similarity and locality
CN102222085A
Data interaction method, device and system for BMC and BIOS
CN113238863A
Coding and decoding speed optimization method for LZ series compression algorithm
CN114244373A
Data interaction method, computer system, electronic equipment and storage medium
CN117667788A
Method, apparatus and system for data block rearrangement for LZ data compression
US20060018556A1
Cited By
Block chain data processing method and related device
CN122285563A
A blockchain data processing method and related apparatus
CN122285563B