Communication data verification method and device, electronic equipment and storage medium

The communication data verification method with immediate read-after-write operations and CRC8 checksums addresses the lack of comprehensive verification in BMC-CPLD communication, improving data reliability and server performance.

CN120315933AActive Publication Date: 2025-07-15INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510786943.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-07-15
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

The I2C communication between BMC and CPLD lacks a complete data verification mechanism, resulting in poor data transmission reliability and accuracy, and the CPLD side cannot confirm whether the data is executed correctly.

Method used

Read verification is performed immediately after the BMC sends data to the CPLD. The improved communication format includes terminal address, write flag bits, register address, target data and verification value to ensure data integrity, and confirm that the data transmission is correct through CRC8 verification.

Benefits of technology

Improve the reliability and accuracy of data transmission, optimize the server's response speed and performance, and ensure the integrity and continuity of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120315933A_ABST
    Figure CN120315933A_ABST
Patent Text Reader

Abstract

The invention discloses a communication data verification method and device, electronic equipment and a storage medium, and relates to the technical field of communication, and the method comprises the steps: after executing a write-in operation on a target terminal, immediately initiating a read-in operation, and through the design of writing first and reading second, immediately checking whether the written-in communication data is correctly received and processed after the data is sent, thereby improving the verification efficiency. According to the method and the device, the communication verification format is improved, and the write operation is seamlessly switched to the read operation under the condition of keeping the communication continuity, so that the reliability of data transmission is improved, and the response speed and the performance of the server are optimized. Therefore, the problems that a verification mechanism is incomplete during data transmission, and the reliability and accuracy of data transmission are poor in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a communication data verification method, apparatus, electronic device, and storage medium. Background Art

[0002] BMC (Baseboard Management Controller, a controller used for server management on the server motherboard) and CPLD (Complex Programming Logic Device) are two extremely important firmware chips in a server, ensuring the normal operation and status monitoring of the server. The communication behavior between the BMC and the CPLD mainly occurs through the I2C (Inter-Integrated Circuit BUS) bus protocol. Through the I2C protocol, functions such as real-time monitoring, fault warning, configuration management, and function coordination can be achieved.

[0003] To ensure accurate data transmission, promptly detect and correct errors, and guarantee the stable operation of the system, data verification needs to be added to the I2C communication between the BMC and the CPLD. In the related art, during the data writing from the BMC side to the CPLD side in communication data verification, only the verification bit is sent, but it cannot be ensured that the CPLD side also verifies the data sent by the BMC and compares it with the verification value sent by the BMC side. When the CPLD side does not perform the verification value comparison, there is still a situation where data communication errors lead to incorrect execution at the CPLD side. And even if the CPLD side performs the verification value comparison at this time, the BMC side cannot know whether the instructions it sends are actually executed. Summary of the Invention

[0004] This application provides a communication data verification method, apparatus, electronic device, and storage medium to at least solve the problem in the related art that the verification mechanism during data transmission is incomplete, resulting in poor reliability and accuracy of data transmission.

[0005] This application provides a communication data verification method, including the following steps: After performing a write operation on a target terminal, initiate a read verification operation on the written data; fill the terminal address and read flag bit of the target terminal into the first data of the first communication format corresponding to the read verification operation, where the first communication format includes multiple filling bits, and at least one filling bit for the target terminal is reserved among the multiple filling bits. The filling content within at least one filling bit of the target terminal includes a comparison value, read data, and a first verification value; in response to the read verification operation, send the first data of the first communication format to the target terminal, obtain the second data of the first communication format fed back by the target terminal, identify the filling content of the target terminal in the second data, and verify the write operation according to the filling content of the target terminal.

[0006] The present application also provides a communication data verification device, including: a triggering module, configured to trigger a read verification operation on the written data after performing a write operation on a target terminal; a filling module, configured to fill the terminal address and read flag bit of the target terminal into the first data of the first communication format corresponding to the read verification operation, where the first communication format includes a plurality of filling bits, and at least one filling bit of the target terminal is reserved among the plurality of filling bits, and the filling content in at least one filling bit of the target terminal includes a comparison value, read data, and a first verification value; a verification module, configured to respond to the read verification operation, send the first data of the first communication format to the target terminal, obtain the second data of the first communication format fed back by the target terminal, identify the filling content of the target terminal in the second data, and verify the write operation according to the filling content of the target terminal.

[0007] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any one of the above communication data verification methods when executing the computer program.

[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above communication data verification methods are implemented.

[0009] Through the present application, after performing a write operation on a target terminal, a read operation is immediately triggered. Through the design of writing first and then reading, it is possible to immediately check whether the written communication data is correctly received and processed after sending the data, and the communication verification format is improved. While maintaining communication continuity, it seamlessly switches from the write operation to the read operation, which not only improves the reliability of data transmission but also optimizes the response speed and performance of the server. Thereby, the problem that the verification mechanism in the related art is incomplete during data transmission and the reliability and accuracy of data transmission are poor is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0011] Figure 1 It is a flowchart of a communication data verification method provided by an embodiment of the present application; Figure 2 It is an example diagram of the communication format of the write operation provided by an embodiment of the present application; Figure 3 It is an example diagram of the communication format of the read operation provided by an embodiment of the present application; Figure 4 It is a block diagram of a communication data verification device provided by an embodiment of the present application. Specific embodiments

[0012] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0013] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

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

[0015] An embodiment of the present application provides a communication data verification method. In combination with the execution process of the communication data verification method, the method will be described in detail, as Figure 1 shown, including the following steps: In step S101, after performing a write operation on the target terminal, a read verification operation for the written data is initiated.

[0016] Among them, the target terminal can be the CPLD side. The data interaction between BMC and CPLD in the server mainly passes through the I2C protocol, and the I2C communication between BMC and CPLD is extremely frequent. To ensure the correctness of the data sent from BMC to CPLD and the accuracy of the data read from CPLD, a data verification mechanism needs to be added to the I2C communication between the two. To solve the problem that BMC cannot obtain whether the instruction has been successfully sent, simply writing data from BMC to CPLD is meaningless. Therefore, in the embodiment of the present application, the data can be read back immediately after BMC writes the data (i.e., the read process). At this time, BMC can know whether the instruction has been successfully sent. In this way, BMC can verify in real time whether the previously written data has been correctly received and processed, thereby ensuring the accuracy and integrity of data transmission.

[0017] In an embodiment of the present application, performing a write operation on a target terminal includes: obtaining the terminal address, write flag bit, register address, and target data of the target terminal; calculating a second check value according to the terminal address, write flag bit, register address, and target data, and filling the terminal address, register address, write flag bit, target data, and second check value into the third data of the second communication format corresponding to the write operation, where the second communication format includes a plurality of padding bits, and the padding content of the plurality of padding bits is the terminal address, write flag bit, register address, target data, and second check value; in response to the write operation on the target terminal, writing the third data in the second communication format to the target terminal.

[0018] Specifically, in the related art, when the BMC writes data to the CPLD, only the check bit (PECByte) is sent, but it cannot be guaranteed that the CPLD also checks the data sent by the BMC and compares it with the check value sent by the BMC; when the CPLD does not perform the check value comparison, there is still a situation where a data communication error causes the CPLD to execute incorrectly. Therefore, the embodiment of the present application improves the data communication check format of I2C. The second communication format when the BMC writes data to the CPLD refers to a data structure or protocol format that needs to be followed before performing the I2C communication write operation. This format ensures that the sent data packet can be correctly parsed and processed. Specifically, the first communication format contains five padding bits for storing different information in sequence. Specifically, the first padding bit: is used to store the terminal address of the target terminal (which can also be called the I2C address or Address). This is a unique identifier for each device on the I2C bus, ensuring that data can be accurately sent to the specified CPLD; the second padding bit is used to store the write flag bit (Wr), which indicates that the current operation is a write operation, distinguishing it from the read operation. The third padding bit: is used to store the register address (Command Code). It indicates the position of the target register where the data will be written, which is crucial for the CPLD to know which internal storage area to update. The fourth padding bit: is used to store the actual target data to be written (Data byte1). That is, the specific data content that the BMC wants to transfer to the CPLD. The fifth padding bit: is used to store the second check value (PEC Byte2), which is the CRC8 (Cyclic Redundancy Check) check value (PEC Byte2) calculated based on the above information (Address, Wr, Command Code, and Data byte1), mainly to detect possible errors during the transmission process and ensure the integrity of the data.

[0019] Specifically, the BMC first sends the I2C address of the target terminal and the write flag bit. Then it sends the register address to inform the CPLD of the destination where the data will be written. Next, it sends the actual communication data. Finally, it sends the second check value (PEC Byte2) calculated based on all the aforementioned information for the CPLD to verify the integrity and accuracy of the data. In this way, not only is the accurate transmission of data ensured, but also the reliability of communication is improved by introducing a check mechanism. In addition, since the entire process is improved based on the standard data communication format, it can effectively enhance the security and stability of I2C communication without significantly increasing the complexity.

[0020] Immediately after sending the data, confirm whether the data is correctly received and processed through subsequent read operations. In an embodiment of the present application, before initiating the read check operation for the written data, it includes: after performing a write operation on the target terminal, identifying whether the target terminal feeds back an acknowledgment signal, where the target terminal generates an acknowledgment signal if it receives the first data in the first communication format; if the acknowledgment signal is identified, initiate the read check operation for the communication data.

[0021] It can be understood that when the target terminal successfully receives the third data in the second communication format (i.e., the data packet including the target terminal address, register address, write flag bit, target data, and second check value), it will parse this information and calculate the CRC8 check value to verify the integrity of the data. If the data is correct, the target terminal will generate an acknowledgment signal (ACK signal). This acknowledgment signal is part of the I2C protocol, indicating that the CPLD has successfully received the data from the BMC. In the actual execution process, the acknowledgment signal not only indicates the successful reception of the data, but may also contain some additional information, such as whether the BMC needs to perform further operations or indicate the type of data to be returned next. However, in the embodiments of the present application, the acknowledgment signal is mainly used to inform the BMC that it can safely perform the next operation, that is, initiate a read request for the communication data. Thus, it is ensured that the BMC can timely understand the execution status of the instructions it issues, use the acknowledgment signal as a trigger point to initiate the read operation, and improve the reliability of the entire I2C communication process and the accuracy of data transmission. In the actual execution process, if the acknowledgment signal is not identified, a communication interruption prompt is generated.

[0022] In step S102, the terminal address and read flag bit of the target terminal are filled into the first data in the first communication format corresponding to the read check operation, where the first communication format includes multiple filling bits, and at least one filling bit for the target terminal is reserved among the multiple filling bits. The filling content in at least one filling bit of the target terminal includes a comparison value, read data, and a first check value; Among them, the first communication format refers to a specific data structure or protocol format followed when performing I2C communication read verification operations. It ensures that the BMC can correctly request the data required to be read from the target terminal CPLD. The first data of the first communication format contains two key padding bits, namely the sixth padding bit and the seventh padding bit. The sixth padding bit is used to store the terminal address (I2C address) of the target terminal. This is to clearly indicate which target terminal the BMC wants to communicate with, ensuring that the data packet can be accurately sent to the specified target terminal. The seventh padding bit is used to store the read flag bit (Rd), indicating that the current operation is a read operation.

[0023] Furthermore, after filling the terminal address of the target terminal into the sixth padding bit and the read flag bit into the seventh padding bit, after completion of the filling, the BMC will send the organized data to the target terminal according to the second communication format. Specifically, after executing the write operation and receiving the acknowledgment signal (ACK signal) from the target terminal, the BMC does not immediately end the communication but instead performs a restart (Sr) operation. This operation allows the BMC to switch from the write mode to the read mode without releasing the bus, thus maintaining the continuity of the communication. After the restart operation, the BMC sends the I2C address of the target terminal again, and this time it is accompanied by the read flag bit (Rd), clarifying that the next action of the BMC is to read data.

[0024] It should be noted that generally, a complete I2C communication includes a start signal (Start), data transmission, and an end signal (Stop). When wanting to initiate a new communication, it will send a start signal and send an end signal to release the bus after the data exchange is completed. In the embodiment of the present application, multiple different types of operations need to be performed in an uninterrupted communication sequence, such as first writing some command or address information to a certain device and then immediately reading data from the same device. In this case, using the restart operation can avoid sending the stop signal (Stop), thus maintaining the coherence of the communication and saving time.

[0025] It can be understood that the first communication format also includes padding bits reserved for the target terminal, and the padding content includes a comparison value, read data, and a first check value. After completing the write operation and initiating a read request, the BMC will receive a set of second data returned by the target terminal as a response result. These response data include parts such as a comparison value (CRC8-check code), read data (Data byte2), and a first check value PEC Byte1, which are jointly used to verify whether the write operation is successful. Among them, the first check value is calculated based on the terminal address, read flag bit, target data, and comparison value.

[0026] Among them, the CRC8-check code field contains the result of comparing the CRC8 check result of the data received at the CPLD end with the second check value (PEC Byte2) sent by the BMC, and is used to determine whether an error occurs during data transmission. If the CRC8-check code indicates that the check results of the two are consistent, it means that the data transmission is error-free; otherwise, it indicates that there may be a transmission error. The read data (Data byte2) contains the data content that the BMC actually wants to read. By comparing the read Data byte2 with the originally written target data Data byte1, it can be further confirmed whether the write operation is successful. The first verification value (PEC Byte1) recalculated based on the four parts of Address, Rd, CRC8-check code, and Data byte2 is used to finally verify the data integrity and accuracy during the entire communication process.

[0027] In step S103, in response to the read check operation, the first data in the first communication format is sent to the target terminal, the second data in the first communication format fed back by the target terminal is obtained, the padding content of the target terminal in the second data is identified, and the write operation is verified according to the padding content of the target terminal.

[0028] It should be understood that after the write operation is completed and a read request is initiated, the BMC will receive the second data in the first communication format returned by the target terminal. The second data includes parts such as the comparison value (CRC8-check code), the read data (Data byte2), and the first check value (PEC Byte1), which are jointly used to verify whether the write operation is successful.

[0029] In an embodiment of the present application, verifying the write operation according to the padding content of the target terminal includes: if the comparison value is the first value and the read data is the same as the target data, it is determined that the write operation is successful; if the comparison value is the second value, it is determined that the data transmission is in error and the write operation fails; if the comparison value is the third value, it is determined that the register address in the third data in the second communication format is in error and the write operation fails.

[0030] Among them, the target terminal calculates the third check value according to the terminal address, write flag bit, register address, and target data. In the embodiment of the present application, the comparison value is calculated according to the second check value and the third check value calculated by the target terminal.

[0031] It can be understood that after receiving the I2C address, write flag bit, register address, and target data, the target terminal CPLD also performs CRC8 calculation on these four parts to obtain the third check value, and then compares the calculation result with the PECByte2 sent by the BMC, and places the comparison result in the comparison value (CRC8-check code). The regulations for the CRC8-check code value are as follows: If the return value is the first value (i.e., 8’h00): The third check value calculated by the target terminal CPLD is the same as the second check value sent by the BMC, and the BMC can successfully read the written target data Data byte1 from the target terminal, then it can be determined that there is no error in the data transmission process and the write operation is successful; this indicates that the target terminal not only correctly received the data, but also processed or stored it as expected. In this case, the BMC can continue to perform other operations as needed, or record this successful write event for subsequent reference.

[0032] If the return value is the second value (i.e., 8’hAA): The third check value calculated by the CPLD is different from the second check value sent by the BMC, then it is determined that the data transmission is incorrect and the write operation fails; If the return value is the third value (i.e., 8’hFF): It is determined that the Command byte sent by the BMC is incorrect, and the value sent is not defined by the CPLD, and it can be determined that the write operation fails.

[0033] It should be noted that if it is determined that the write operation fails, this situation may be caused by various reasons, such as data transmission errors, internal failures of the target terminal, etc. In the embodiments of the present application, the reasons and specific details of the failure can be recorded for subsequent analysis and troubleshooting.

[0034] For example, assume that the BMC needs to write a new configuration parameter to the CPLD and confirm whether the parameter is correctly received and applied. In the write stage, the BMC sends a data packet containing the new configuration parameter to the CPLD, along with the calculated second check value (PEC Byte2). In the confirmation stage, after the CPLD successfully receives the data packet, it returns an acknowledgment signal. Receiving the acknowledgment signal indicates that the data has been successfully received and preliminarily verified without error. In the read stage, the BMC performs a restart operation and sends a read request, and then receives the CRC8-check code, Data byte2, and PEC Byte1 returned by the CPLD. If all the verification results are consistent, it is confirmed that the write operation is successful; otherwise, the BMC records an error log and may trigger a retry mechanism. Thus, by this method of reading immediately after writing, the reliability and accuracy of data transmission are improved.

[0035] In an embodiment of the present application, if the write operation fails, a re-write mechanism is triggered; and a re-write operation is performed on the target terminal based on the re-write mechanism.

[0036] Based on the above embodiment, before triggering the re-write, the BMC first records the reason for the write failure this time and related information. This may include but is not limited to: the timestamp of the failure, the type of operation attempted (which register to write), the data content sent, and the error code returned, etc.

[0037] It can be understood that when the BMC determines that the write operation fails according to the response result received from the target terminal (for example, the CRC8-check code shows that the verification result is inconsistent or the expected data cannot be read), the embodiment of the present application will automatically trigger the re-write mechanism and attempt to write to the register again. In the actual execution process, to avoid the problem that infinite loop retries may cause resource exhaustion. The embodiment of the present application can preset a maximum number of retries (such as three times). If all three attempts fail, the BMC abandons operating this register and operates on other registers until this register is polled again and the operation is attempted.

[0038] In summary, the process and communication format of the BMC performing a write operation on the CPLD side in the embodiment of the present application are as Figure 2 shown. The BMC writes the I2C address (Address) and write flag bit (Wr) to the CPLD, then writes the register address (CommandCode) of the CPLD and the target data to be written (Data byte1), and then writes the second check value (PEC Byte2). The value of this check bit is the calculation result of the four parts of Address, Wr, Command Code, and Data byte1; after the CPLD returns ACK, the BMC side performs restart (Sr), then writes the I2C address (Address) of the CPLD and read flag bit (Rd), and then the CPLD returns data including three parts: CRC8-check code, Data byte2, PEC Byte1. After the BMC side receives PECByte1, it returns NACK (N) to the CPLD, and then ends this communication.

[0039] In some embodiments, to ensure the correctness of data sent from the BMC to the CPLD and the accuracy of data read from the CPLD. Different from the above embodiments where the reading is for verifying whether the writing is successful, the BMC can also simply read data from the CPLD. In this case, the communication data verification method further includes: obtaining the terminal address and register address where the communication data to be read is located; generating a fourth verification value based on the terminal address, register address, and write flag bit, where the fourth verification value is calculated based on the cyclic redundancy check algorithm for the terminal address, register address, and write flag bit. Among them, the target terminal verifies the fourth verification value. If the target terminal passes the verification, the communication data to be read is identified; a read operation is performed on the target terminal, where the target terminal returns the communication data to be read based on the read operation.

[0040] In the embodiments of the present application, the definitions of the terminal address and register address are the same as those in the above embodiments. To ensure the security and integrity of data transmission, the embodiments of the present application still need to calculate a verification value. Specifically, the cyclic redundancy check (CRC8) algorithm is used to calculate a verification value for the terminal address, register address, and write flag bit. Specifically, the BMC sends a data packet containing its I2C address, write flag bit (Wr), register address (Commond Code), and fourth verification value (PEC Byte4) to the target terminal. After receiving this information, the target terminal will perform the same CRC8 verification algorithm again based on the received terminal address, register address, and write flag bit, and compare the calculation result with the fourth verification value sent by the BMC. If the calculated verification value is consistent with the fourth verification value sent by the BMC, it indicates that the data transmission is error-free, and the target terminal can identify and prepare to return the communication data to be read (Data byte3). Among them, the target terminal returns the data (Data byte3) in the specified register to the BMC. A fifth verification value (PEC Byte5) will also be attached, which is recalculated based on four parts: Address, Rd, CRC8-check code, and Data byte3, and is used to further verify the integrity and accuracy of the data. After receiving the data returned by the target terminal, the BMC will also verify these data to confirm the correctness of the data. If the verification passes, the read operation is considered successful; otherwise, an error log will be recorded and corresponding remedial measures (such as a retry mechanism) will be considered.

[0041] Therefore, the process and communication format of the BMC performing a read operation on the CPLD side in the embodiments of the present application are as Figure 3As shown, first, the I2C address (Address) and the read / write flag bit (Wr) of the CPLD need to be written. After receiving the ACK signal from the CPLD, the register address to be read (Commond Code) is written. After receiving the ACK signal from the CPLD, the fourth parity check value (PEC Byte4) needs to be sent. This fourth parity check value is a parity check value calculated based on the address, Wr, and Command Code; after receiving the ACK from the CPLD, a restart (Sr) operation is performed, the I2C address (Address) and the read / write flag bit (Rd) are written. After receiving the ACK from the CPLD, the data returned to the CPLD immediately follows. This data consists of three parts: 1. Comparison value (CRC8-check code): This byte stores the comparison result between the CRC8 calculation result of the data sent by the BMC to the CPLD and the PEC Byte4 sent by the BMC; 2. Data byte3: This byte stores the communication data to be read by the BMC. This part can be a single byte or multiple bytes; 3. PEC Byte5: This byte stores the parity check result of the data reported by the CPLD. This value is the calculation result of the four parts of data: Address, Rd, CRC8-check code, and Data byte3; After the BMC receives the PEC Byte5, a NACK (N) is returned to the CPLD, and then this communication ends.

[0042] For example, assume that in a server environment, the BMC needs to read the status information of a specific register (e.g., the current hardware temperature) from the CPLD. First, the BMC obtains the I2C address of the CPLD. Assume the I2C address of the CPLD is 0x4E. It is also necessary to determine the specific register address from which to read the data. Assume the target register address is 0x20, which is used to store the data of the current hardware temperature. The BMC calculates a fourth parity check value (PEC Byte4) using the CRC8 algorithm based on the terminal address (0x4E), the register address (0x20), and the write flag bit (Wr). Assume the calculated fourth parity check value is 0x3F.

[0043] In the specific implementation process, the BMC sends a data packet containing its I2C address (0x4E), write flag bit (Wr), register address (0x20), and the fourth check value (0x3F) to the CPLD. After receiving the data packet sent by the BMC, the CPLD recalculates the CRC8 check value based on the same terminal address (0x4E), register address (0x20), and write flag bit (Wr), and compares it with the fourth check value (0x3F) sent by the BMC. If the two match, it indicates that the data transmission is error-free, and the CPLD can identify and prepare to return the target data to be read; if they do not match, an error code or other form of feedback may be returned to the BMC. After confirming that the check passes, the BMC performs a restart operation and sends the I2C address of the CPLD again, but this time with a read flag bit (Rd) attached, clearly indicating that the next operation is a read request. The CPLD starts to prepare and return the corresponding response data based on the previous write information. After receiving the data returned by the CPLD, the BMC will perform a detailed analysis and check on these data. If the CRC8-check code shows that the check results are consistent, the read operation can be considered successful. For example, if the Data byte3 received by the BMC is 0x64 and all check results are consistent, it is confirmed that the read operation is successful, and the current hardware temperature is 100 degrees Celsius.

[0044] In summary, the data interaction between the BMC and the CPLD in the server mainly uses the I2C protocol, and the I2C communication between the BMC and the CPLD is extremely frequent. To ensure the correctness of the data sent by the BMC to the CPLD and the accuracy of the data read from the CPLD, a data check mechanism needs to be added to the I2C communication between the two. Using the data communication format in the embodiments of the present application and the method of calculating the data check value by CRC8, on the basis of not interrupting the I2C communication and not increasing the working complexity of the BMC, it is ensured that the CPLD end checks the data and returns the check result to the BMC, and when a communication exception occurs, the BMC end can record and re-operate. Among them, the polynomial of CRC8 is:

[0045] The following combines specific examples to elaborate in detail on the communication data check method of the embodiments of the present application: 1. The BMC reads data from the CPLD After the BMC writes the terminal address (I2C address), write flag bit, and register address to the CPLD, it places the CRC8 calculation results of the three parts in PEC Byte4 and sends them to the CPLD; then the BMC performs a restart operation, writes the I2C address and read flag bit, and waits for the CPLD to report data; After receiving the I2C address, write flag bit, and register address, the CPLD also performs CRC8 calculations on these three parts, then compares the calculation result with the PEC Byte4 sent by the BMC, and places the comparison result in the CRC8-check code. The regulations for the CRC8-check code value are as follows: If the return value is 8’h00: The check result calculated by the CPLD is the same as the PEC Byte4 value sent by the BMC, and there is no error during the data transmission process; If the return value is 8’hAA: The check result calculated by the CPLD is different from the PEC Byte4 value sent by the BMC, and there is an error during the data transmission process; If the return value is 8’hFF: The Command byte sent by the BMC is incorrect, and the value sent is not defined by the CPLD.

[0046] Then the CPLD returns Data byte3: This part is the value stored in the CPLD register. When the Command byte sent by the BMC is correct, regardless of whether the CRC8-check code is 8’h00 or 8’hAA (regardless of whether the check results are consistent), the CPLD will report the value of this register; Finally, the CPLD places the CRC8 calculation results of the four parts of Address, Rd, CRC8-check code, and Data byte3 in PEC Byte5 and returns it to the BMC.

[0047] 2. The BMC performs write and read operations on data: After writing the I2C address, write flag bit, register address, and target data to the CPLD, the BMC places the CRC8 calculation results of the four parts in PEC Byte2 and sends it to the CPLD; then the BMC performs a restart operation, writes the I2C address and read flag bit, and waits for the CPLD to report data; After receiving the I2C address, write flag bit, register address, and register data, the CPLD also performs CRC8 calculations on these four parts, then compares the calculation result with the PEC Byte2 sent by the BMC, and places the comparison result in the CRC8-check code. The regulations for the CRC8-check code value are the same as those in the read data process. Then the CPLD returns the value of the register operated by the BMC (Data Byte2).

[0048] When the calculation result of CPLD is the same as the PEC Byte2 value sent by BMC, CPLD will execute the data instruction sent by BMC, and the data read back is the real-time updated data; when the calculation result of CPLD is different from the PEC Byte1 value sent by BMC, CPLD will not execute the data instruction sent by BMC, and the data read back will not be updated, and will be the data before BMC writes the data.

[0049] Finally, CPLD places the CRC8 calculation results of Address, Rd, CRC8-check code and Data byte2 in PEC Byte1 and sends it back to BMC.

[0050] BMC uses CRC8-check code to determine whether the data is written successfully. If the data is written successfully, it continues to operate other registers. If the data is written unsuccessfully, it tries to send the data again (retry mechanism) and records the failure reason in the BMC log for easy analysis and positioning. The retry behavior is repeated three times. If all three times fail, BMC gives up operating the register and operates other registers until the next time the register is polled and the operation is attempted again.

[0051] In summary, the communication data verification method of the embodiment of the present application immediately initiates a read operation after performing a write operation on the target terminal. Through the design of read after write, it is possible to check whether the written communication data is correctly received and processed immediately after sending the data, and improve the communication verification format. While maintaining the continuity of communication, it seamlessly switches from the write operation to the read operation, which not only improves the reliability of data transmission, but also optimizes the response speed and performance of the server. Thus, the problem of incomplete verification mechanism during data transmission in the related technology and poor reliability and accuracy of data transmission is solved.

[0052] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0053] Secondly, the embodiment of the present application also provides a communication data verification device, such as Figure 4 As shown, the communication data verification device 10 includes: an initiating module 101 , a filling module 102 and a verification module 103 .

[0054] Among them, the initiating module 101 is used to initiate a read verification operation on the written data after performing a write operation on the target terminal; the filling module 102 is used to fill the terminal address and read flag bit of the target terminal into the first data of the first communication format corresponding to the read verification operation, where the first communication format includes multiple filling bits, and at least one filling bit for the target terminal is reserved among the multiple filling bits. The filling content in at least one filling bit of the target terminal includes a comparison value, read data, and a first verification value; the verification module 103 is used to respond to the read verification operation, send the first data of the first communication format to the target terminal, obtain the second data of the first communication format fed back by the target terminal, identify the filling content of the target terminal in the second data, and verify the write operation according to the filling content of the target terminal.

[0055] In an embodiment of the present application, the initiating module 101 is further used to obtain the terminal address, write flag bit, register address, and target data of the target terminal; calculate a second verification value according to the terminal address, write flag bit, register address, and target data, and fill the terminal address, register address, target data, and second verification value into the third data of the second communication format corresponding to the write operation, where the second communication format includes multiple filling bits, and the filling content of the multiple filling bits is the terminal address, write flag bit, register address, target data, and second verification value; respond to the write operation on the target terminal and write the third data of the second communication format into the target terminal.

[0056] In an embodiment of the present application, the communication data verification device 10 further includes: a confirmation module, configured to identify whether the target terminal feeds back a confirmation signal after performing a write operation on the target terminal before initiating a read verification operation on the written data, where the target terminal generates a confirmation signal if it receives the third data of the second communication format; if a confirmation signal is identified, initiate a read verification operation on the communication data.

[0057] In an embodiment of the present application, the communication data verification device 10 further includes: a prompt module, configured to generate a communication interruption prompt if a confirmation signal is not identified.

[0058] In an embodiment of the present application, the calculation methods for the target terminal to calculate the comparison value and the first verification value are: calculate the first verification value according to the terminal address, read flag bit, read data, and comparison value; calculate a third verification value according to the terminal address, write flag bit, register address, and target data, and calculate the comparison value according to the second verification value and the third verification value.

[0059] In an embodiment of the present application, the verification module 103 is further configured to determine that the write operation is successful if the comparison value is the first numerical value and the read data is the same as the target data; determine that the data transmission is in error and the write operation fails if the comparison value is the second numerical value; and determine that the register address in the third data of the second communication format is in error and the write operation fails if the comparison value is the third numerical value.

[0060] In an embodiment of the present application, the communication data verification device 10 further includes: a re-execution module, configured to trigger a re-write mechanism after determining that the write operation fails; and perform a re-write operation on the target terminal based on the re-write mechanism.

[0061] It should be noted that for the description of the features in the embodiments corresponding to the communication data verification device, reference may be made to the relevant descriptions in the embodiments corresponding to the communication data verification method, which will not be elaborated here one by one.

[0062] According to the communication data verification device of the embodiments of the present application, after performing a write operation on the target terminal, a read operation is immediately initiated. Through the design of reading after writing, it is possible to immediately check whether the written communication data is correctly received and processed after sending the data, and improve the communication verification format. While maintaining communication continuity, it seamlessly switches from the write operation to the read operation, which not only improves the reliability of data transmission, but also optimizes the response speed and performance of the server. Thus, the problem of incomplete verification mechanism in the related art during data transmission and poor reliability and accuracy of data transmission is solved.

[0063] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the communication data verification method.

[0064] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-mentioned embodiments of the communication data verification method when running.

[0065] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs, and other various media that can store computer programs.

[0066] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0067] The above has introduced in detail a communication data verification method provided by this application. Specific examples are used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A communication data verification method, characterized in that, Including: After performing a write operation on the target terminal, initiate a read verification operation on the written data; Fill the terminal address and read flag bit of the target terminal into the first data of the first communication format corresponding to the read verification operation, where the first communication format includes multiple padding bits, and at least one padding bit of the target terminal is reserved among the multiple padding bits, and the padding content within at least one padding bit of the target terminal includes a comparison value, read data, and a first check value; In response to the read verification operation, send the first data of the first communication format to the target terminal, obtain the second data of the first communication format feedback by the target terminal, identify the padding content of the target terminal in the second data, and verify the write operation according to the padding content of the target terminal.

2. The communication data verification method according to claim 1, wherein Performing the write operation on the target terminal includes: Obtain the terminal address, write flag bit, register address, and target data of the target terminal; Calculate a second check value according to the terminal address, the write flag bit, the register address, and the target data, and fill the terminal address, the register address, the target data, and the second check value into the third data of the second communication format corresponding to the write operation, where the second communication format includes multiple padding bits, and the padding content of the multiple padding bits is the terminal address, the write flag bit, the register address, the target data, and the second check value; In response to the write operation on the target terminal, write the third data of the second communication format to the target terminal.

3. The communication data verification method according to claim 2, wherein Before initiating the read verification operation on the written data, it includes: After performing the write operation on the target terminal, identify whether the target terminal feedbacks an acknowledgement signal, where the target terminal generates the acknowledgement signal after receiving the third data of the second communication format; If the acknowledgement signal is identified, then initiate the read verification operation on the communication data.

4. The communication data verification method according to claim 3, wherein Before initiating the read verification operation on the written data, it further includes: If the acknowledgement signal is not identified, then generate a communication interruption prompt.

5. The communication data verification method according to claim 2, characterized in that, The calculation methods for the target terminal to calculate the comparison value and the first check value are: Calculate the first check value according to the terminal address, the read flag bit, the read data, and the comparison value; Calculate a third check value according to the terminal address, the write flag bit, the register address, and the target data, and calculate the comparison value according to the second check value and the third check value.

6. The communication data verification method according to claim 5, wherein Verifying the write operation according to the padding content of the target terminal includes: If the comparison value is the first value and the read data is the same as the target data, then determine that the write operation is successful; If the comparison value is the second value, then determine that the data transmission is incorrect and the write operation fails; If the comparison value is the third value, then determine that the register address in the third data of the second communication format is incorrect and determine that the write operation fails.

7. The communication data verification method according to claim 6, characterized in that, After determining that the write operation fails, it further includes: If the write operation fails, then trigger a re-write mechanism; Perform a re-write operation on the target terminal based on the re-write mechanism.

8. A communication data verification device, characterized in that, Including: The initiating module is used to initiate a read verification operation on the written data after performing a write operation on the target terminal; The filling module is used to fill the terminal address and read flag bit of the target terminal into the first data of the first communication format corresponding to the read verification operation, where the first communication format includes a plurality of filling bits, and at least one filling bit of the target terminal is reserved among the plurality of filling bits, and the filling content in at least one filling bit of the target terminal includes a comparison value, read data, and a first verification value; The verification module is used to respond to the read verification operation, send the first data of the first communication format to the target terminal, obtain the second data of the first communication format fed back by the target terminal, identify the filling content of the target terminal in the second data, and verify the write operation according to the filling content of the target terminal.

9. An electronic device, characterized in that, Comprising: A memory for storing computer programs; A processor for implementing the steps of the communication data verification method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the communication data verification method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Data transmission method and device and electronic device

    CN107872422A

  • Data access method, and flash memory apparatus

    CN110383698A

  • Server and non-transitory computer-readable recording medium

    US20180246682A1

Cited By

  • Millisecond FPGA distributed management and control method and system

    CN121542205A

  • Millisecond-level FPGA distributed management and control method and system

    CN121542205B