Data synchronization methods, electronic devices, computer storage media, and software products

By dividing data into metadata and synchronizing it as it changes, the problems of wasted data synchronization links and crashes caused by version inconsistencies are solved, thus improving bandwidth utilization and software stability.

CN120763255BActive Publication Date: 2025-12-02INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511244188.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-12-02
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

In existing technologies, centralized storage systems waste effective bandwidth in their data synchronization links, and there are problems such as BMC software crashes and additional complexity in packet unpacking and repacking when versions are inconsistent.

Method used

The data of the module to be synchronized is divided into multiple independent metadata, and a local control metadata linked list is constructed. Updates are only performed when the metadata changes, and updated metadata is sent when conditions are met to achieve data synchronization.

Benefits of technology

It improves the effective bandwidth utilization of the data synchronization link, avoids memory out-of-bounds crashes, and reduces software complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763255B_ABST
    Figure CN120763255B_ABST
Patent Text Reader

Abstract

This application discloses a data synchronization method, electronic device, computer storage medium, and program product, relating to the field of data synchronization technology. The data synchronization method includes dividing the data to be synchronized into multiple independent metadata based on data attributes to construct a control metadata linked list. When a change in metadata is detected, the corresponding metadata in the control metadata linked list is updated, and the data identifier and data length of the updated metadata are used to construct a metadata linked list to be sent. When the metadata linked list to be sent meets the data synchronization conditions, the corresponding metadata is copied from the control metadata linked list to obtain the data to be synchronized. This improves the effective bandwidth utilization of the data synchronization link, solves the technical problem of wasted effective bandwidth in related technologies, and achieves the technical effect of improving resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data synchronization technology, and in particular to a data synchronization method, electronic device, computer storage medium, and program product. Background Technology

[0002] In a centralized storage single chassis, in order to improve reliability, it usually exists in a dual-controller configuration. The management software on each controller wants to obtain the full BMC monitoring data of the entire chassis from its own controller (BMC), rather than obtaining it from cross controllers, thereby improving the operating efficiency of the management software.

[0003] In related technologies, the controller's BMC stores the data collected by each module in the data structure of that module, periodically encapsulates it into a data packet, and sends it to the peer BMC for mirroring and storage. While this method is simple to implement, it wastes the effective bandwidth of the data synchronization link. Summary of the Invention

[0004] This application provides a data synchronization method, electronic device, computer-readable storage medium, and computer program product to at least solve the problem of wasted effective bandwidth in data synchronization links in related technologies.

[0005] This application provides a data synchronization method applied to a local control module. The method includes: determining a local control module metadata linked list corresponding to the module data to be synchronized, wherein the module data to be synchronized is divided into multiple metadata based on data attributes, and the local control module metadata linked list is constructed using metadata as linked list nodes; if there is updated metadata in the local control module metadata linked list, constructing a metadata linked list to be sent based on the data identifier and data length of the updated metadata; if the metadata linked list to be sent meets the data synchronization conditions, retrieving the data to be synchronized from the local control module metadata linked list based on the metadata linked list to be sent, and sending the data to be synchronized to the peer control module to complete the data synchronization of the peer control module.

[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described data synchronization methods when executing the computer program.

[0007] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described data synchronization methods.

[0008] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described data synchronization methods.

[0009] This application first divides the data to be synchronized into multiple independent metadata based on data attributes, and then constructs a control metadata linked list based on the metadata. During the monitoring of metadata according to a preset period, when data changes are detected, the corresponding metadata in the control metadata linked list is updated, and the data identifier and data length of the updated metadata are used to construct a metadata linked list to be sent. When the metadata linked list to be sent meets the data synchronization conditions, the corresponding metadata is copied from the control metadata linked list to obtain the data to be synchronized. This ensures that the data to be synchronized sent to the peer control module only contains the metadata that has changed, improving the effective bandwidth utilization of the data synchronization link. Therefore, it can solve the technical problem of wasting the effective bandwidth of the data synchronization link in related technologies and achieve the technical effect of improving resource utilization. Attached Figure Description

[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A schematic diagram of the architecture of a storage-frame dual-controller system in related technologies;

[0012] Figure 2 This is a schematic diagram of data synchronization methods in related technologies;

[0013] Figure 3 A flowchart illustrating a data synchronization method provided in an embodiment of this application;

[0014] Figure 4 A schematic diagram of a linked list of metadata to be sent, provided for an embodiment of this application;

[0015] Figure 5 This is a schematic diagram of data to be synchronized provided in an embodiment of this application;

[0016] Figure 6 This is a schematic diagram of the architecture of the local control module provided in an embodiment of this application. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0018] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0019] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] The specific application environment architecture or specific hardware architecture on which the execution of the data synchronization method depends is described here.

[0021] In the storage software stack, the management software and BMC software have a clear division of labor in server / storage device management. They collaborate in a layered manner to achieve comprehensive management of hardware resources and application services. The BMC, as an embedded controller independent of the main system, focuses on hardware monitoring and low-level control, such as real-time acquisition of sensor data on CPU (Central Processing Unit) / memory / hard disk temperatures, fan speeds, and power supply voltages. The management software handles storage-related faults, alarms, and events, and also obtains hardware-related status information from the BMC to comprehensively assess the operating status of the storage device and provide timely warnings and fault alarms to customers.

[0022] Storage devices are mainly divided into two categories: distributed storage and centralized storage. Centralized storage, in particular, has extremely high requirements for data responsiveness. In a single centralized storage chassis, to improve reliability, a dual-controller configuration is typically used. The management software on each controller aims to obtain full BMC monitoring data for the entire chassis directly from its own controller's BMC, rather than retrieving data from across controllers, thereby improving the efficiency of the management software. In this context, data mirroring between the dual-controller BMCs becomes a fundamental requirement for storage BMCs, such as... Figure 1 The storage system shown is a dual-controller system within a single frame.

[0023] In related technologies, such as Figure 2 As shown, BMC (assuming to be) Figure 1 In the A-controller baseboard management controller, the data collected by each module is stored in the data structure of its respective module. It is periodically encapsulated into a data packet and delivered to the synchronization queue. Then, the synchronization thread sends the data packet to the counterpart control BMC (i.e., the BMC). Figure 1 The BMC (Browser Control Module) receives data packets, places them in a distribution queue, and then distributes them to the corresponding modules according to their module names. Within each module, the data packets are copied to the local machine according to their corresponding data structure. If a module needs to synchronize data exceeding the maximum data length sent at one time by the synchronization link, the corresponding module must add a file transfer protocol layer to perform packet unpacking and repackaging to ensure data consistency.

[0024] The data synchronization methods used in related technologies have the following drawbacks:

[0025] 1. Periodically synchronizing all data in the module, while simple to implement, wastes valuable bandwidth in the data synchronization link. This is because during the synchronization period, not all data within the same module is updated; only a small amount of data is updated, or none at all.

[0026] 2. When the versions of the two control BMCs (such as the A control board management controller and the B control board management controller) are inconsistent, or when the internal data structures of the two control BMC modules are inconsistent, direct data copying is prone to memory overflow, which can cause the BMC software to crash and affect the stability of the BMC software.

[0027] 3. When the data synchronized by the module exceeds the length of data transmitted in one transmission of the synchronization link, additional software is required for packet unpacking and repacking, which increases the complexity.

[0028] To address at least one of the aforementioned technical problems, this application proposes a data synchronization method. First, the data to be synchronized is divided into multiple independent metadata based on data attributes. A control metadata linked list is then constructed based on this metadata. During the monitoring of the metadata at a preset period, when data changes are detected, the corresponding metadata in the control metadata linked list is updated. The updated metadata's data identifier and length are then used to construct a pending metadata linked list. When the pending metadata linked list meets the data synchronization conditions, the corresponding metadata is copied from the control metadata linked list to obtain the data to be synchronized. This ensures that the data to be synchronized sent to the peer control module contains only the metadata that has undergone data changes, improving the effective bandwidth utilization of the data synchronization link. Therefore, this method solves the technical problem of wasted effective bandwidth in related technologies, achieving the technical effect of improved resource utilization.

[0029] The data synchronization method of this application will be illustrated below with reference to the accompanying drawings.

[0030] Figure 1 This application presents a data synchronization method according to an embodiment.

[0031] Reference Figure 1 As shown in the embodiment of this application, the data synchronization method is applied to a local control module, and the data synchronization method includes:

[0032] S1, determine the local control metadata linked list corresponding to the module data to be synchronized. The module data to be synchronized is divided into multiple metadata based on data attributes. The local control metadata linked list is constructed using metadata as linked list nodes.

[0033] Specifically, assuming the local control module is Figure 1 Taking the controller-A board management controller shown as an example, the opposing control module is: Figure 1 The controller in the B-B control board management controller.

[0034] by Figure 1 For example, by sorting out the modules in the A-control board management controller and the data that needs to be synchronized within each module, the data of the modules to be synchronized is obtained, and the data of the modules to be synchronized is divided into multiple independent metadata based on data attributes. For example, a key value (identifier code) is assigned to each module, and a key value is also assigned to each independent data within the module. The two key values ​​have different dimensions and are independent enumeration sets, as shown in Table 1, to form multiple independent metadata.

[0035] Table 1

[0036]

[0037] For example, the data that needs to be synchronized in the A-controller board management controller includes: BMC version number (16 bytes) and controller type (1 byte). Therefore, the BMC version number and controller type are two independent metadata items. Furthermore, the data length of each independent metadata item should exceed the effective bandwidth of the synchronization link.

[0038] Then, based on the metadata, chain nodes are constructed to obtain the local control metadata chain list List1 corresponding to the module data to be synchronized in the A control baseboard management module.

[0039] S2, if there is updated metadata in the local control metadata chain, construct a metadata chain to be sent based on the data identifier and data length of the updated metadata;

[0040] Specifically, the metadata in the control metadata linked list List1 can be detected according to a preset period. When the actual sampled data of the metadata is inconsistent with the previous sampled data, it is determined that the metadata has been updated. Based on the actual sampled data, the data content of the metadata in the control metadata linked list List1 is changed to determine that there is updated metadata in the control metadata linked list.

[0041] At this point, the data identifier and data length of the updated metadata in the local metadata linked list List1 are obtained. The data identifier and data length of the updated metadata are used as linked list nodes to construct the synchronous metadata linked list List3. The data identifier may include the metadata key value of the metadata and the module key value of the module to which it belongs. The data length can be determined based on the updated content.

[0042] S3, if the metadata list to be sent meets the data synchronization conditions, retrieve the data to be synchronized from the metadata list of this controller based on the metadata list to be sent, and send the data to be synchronized to the peer control module to complete the data synchronization of the peer control module.

[0043] Specifically, when the effective construction time in the data list List3 to be synchronized reaches a preset time threshold, or when the total length of the data to be synchronized calculated based on the data list List3 to be synchronized reaches a preset threshold, or when the number of newly added nodes in the data list List3 to be synchronized reaches a preset node threshold, the metadata list List3 to be sent is considered to meet the data synchronization conditions and the data to be synchronized needs to be sent.

[0044] At this point, the corresponding metadata content is copied from the local control metadata list List1 based on the metadata list List3 to be sent, so as to obtain the data to be synchronized. The data to be synchronized is encapsulated into a data packet and delivered to the synchronization sending queue. Then, the synchronization thread sends the data packet to the B control baseboard management controller (i.e., the opposing control module), so that the B control baseboard management controller can obtain the corresponding data to be synchronized based on parsing the received data packet, obtain at least one metadata, and then distribute it to the corresponding module for storage according to the module key value and metadata key value of each metadata, thus completing the data synchronization.

[0045] This embodiment completes data synchronization based on independent metadata. When the versions of the local control module and the peer control module are inconsistent, or when the internal data structures of the local control module and the peer control module are inconsistent, the copying and sending of metadata will not cause memory overflow, BMC software crash, or affect the stability of BMC software. In addition, the data to be synchronized is determined based on the updated metadata, and only the metadata that has changed is sent, which improves the effective bandwidth utilization of the synchronization link.

[0046] In some embodiments of this application, determining the local control module's metadata linked list corresponding to the module data to be synchronized includes: determining the module data to be synchronized based on the sub-modules in the local control module and the target synchronization data within the sub-modules; dividing the module data to be synchronized into multiple metadata based on data attributes to determine the local control module's metadata configuration file, wherein the metadata configuration file corresponds to the sub-modules in the local control module; parsing the metadata configuration file to obtain multiple metadata in a preset data structure, wherein the preset data structure includes data identifier, data length, and data content; and using the multiple metadata in the preset data structure as linked list nodes to construct the local control module's metadata linked list.

[0047] Specifically, continue to use the local control module as... Figure 1 Taking the A-control board management controller as an example, by sorting out the modules in the A-control board management controller and the data that needs to be synchronized in each module, the data of the module to be synchronized is obtained. Based on the data attributes, the data of the module to be synchronized is divided into multiple independent metadata, as shown in Table 1. Each module is assigned a key value, and each independent data in the module is also assigned a key value, forming multiple independent metadata. The metadata is identified based on key values ​​of different dimensions to improve the identification accuracy of the metadata.

[0048] After sorting out the metadata that needs to be synchronized for each module in the A-control board management controller based on the above steps, the metadata configuration file of each module is output according to Table 1. Taking Module 1 of the many modules of the A-control board management controller as an example, after the Module 1 program starts, it first parses the metadata configuration file of Module 1, and generates a node of a linked list for each metadata in the metadata configuration file according to the preset data structure in Table 2. All metadata in the entire metadata configuration file is generated as linked list nodes in the same way, thus obtaining the metadata linked list List1 of this controller.

[0049] Table 2

[0050]

[0051] In other words, the independent metadata is abstracted into a unified preset data structure as shown in Table 2. This preset data structure includes data content, data length, and data identifier. The data identifier consists of the metadata's module name number (module key value) and the metadata's internal metadata number (metadata key value). The data content is a pointer to the metadata. Referring to the data structure shown in Table 2, a local control metadata linked list List1 for module 1 is generated, and corresponding memory is allocated for the data pointer portion (mod_data_ptr) of the metadata for each node in the local control metadata linked list List1. This process is repeated to complete the construction of the local control metadata linked list List1 for each module in the A-control baseboard management controller.

[0052] After each module in the A-control board management controller collects hardware data, it compares it with the previous data. If there are changes, the data in Table 2 is updated (the data length of the metadata remains unchanged, but the content may change, for example, the status of the alarm light, which may be on in the previous moment and off in the next moment). Then, based on the data identifier and data length of the updated metadata, a metadata chain list to be sent is constructed to determine whether to perform data synchronization transmission.

[0053] This embodiment improves data synchronization accuracy and ensures data synchronization efficiency by abstracting metadata into the same data structure to construct the local control metadata linked list List1.

[0054] In some embodiments of this application, when updated metadata exists in the control metadata linked list, a metadata linked list to be sent is constructed based on the data identifier and data length of the updated metadata, including: performing metadata traversal detection based on the control metadata linked list; if the traversal detection is completed and updated metadata exists in the control metadata linked list, obtaining the data identifier and data length of the updated metadata; and using the data identifier and data length of the updated metadata as linked list nodes to construct the metadata linked list to be sent.

[0055] In other words, after constructing the controlled metadata linked list List1, metadata traversal and testing are performed based on List1. After one round of testing of all metadata in List1, the data identifiers (mod_id, mod_data_id) and data lengths (mod_data_len) of the updated metadata in this round are extracted and added as linked list nodes to the metadata linked list List3 to be sent. Figure 4 As shown.

[0056] After completing the routine testing of all metadata, this embodiment counts the updated metadata in the local control metadata linked list List1, and then sends the data identifier and data length of the updated metadata to the metadata linked list List3 to be sent for the addition of nodes, thereby improving the construction quality of the metadata linked list to be sent. At the same time, it can form a periodic update of the metadata linked list to be sent, which facilitates the time planning between different processes and improves the data synchronization quality.

[0057] In some embodiments of this application, metadata traversal and detection based on the control metadata linked list includes: constructing a test data structure of metadata within a hardware information test thread based on the control metadata linked list, wherein the test data structure includes a data identifier and data content; based on the hardware information test thread, traversing the hardware objects of the local control module according to the data identifier of the metadata to obtain the current data value of the metadata; and updating the current data value of the metadata to the control metadata linked list if there is a deviation between the current data value of the metadata and the initial data value in the data content of the metadata.

[0058] Specifically, after constructing the local control metadata linked list List1, the hardware information test thread maintains a data structure for each metadata element to record its key value and the previous data value (i.e., the initial data value). The hardware acquisition thread iterates through the hardware objects according to the metadata key value. After acquiring the value of each metadata element, it first compares it with the previous data value of this metadata element. If they are inconsistent, the metadata element is updated in the local control data linked list List1; otherwise, it is not updated.

[0059] This embodiment maintains a data structure for metadata within the hardware information testing thread, and performs traversal testing based on this structure. This reduces the reading of the local control data linked list List1 and improves the efficiency of traversal testing.

[0060] In some embodiments of this application, after constructing a linked list of metadata to be sent based on the data identifier and data length of the updated metadata, the data synchronization method further includes: determining the data length of the updated metadata according to the data identifier and data length of the updated metadata; obtaining the sum of the data lengths of the updated metadata in the linked list of metadata to be sent to obtain the total length of the data to be synchronized; and determining that the data synchronization condition is met when the total length of the data to be synchronized reaches a preset threshold.

[0061] Specifically, with Figure 4For example, each node in the metadata list List3 to be sent is traversed, and the data length of the updated metadata corresponding to each node is calculated. Referring to Table 2, the formula for calculating the sum of the data lengths of the updated metadata is mod_data_len + 3 (mod_id, mod_data_id, and mod_data_len occupy 3 bytes). Then, the data lengths of the updated metadata corresponding to all nodes in the metadata list List3 to be sent are summed to obtain the total length of the data to be synchronized, Sumlenlist3. The total length of the data to be synchronized, Sumlenlist3, is compared with a preset threshold. When the total length of the data to be synchronized, Sumlenlist3, reaches the preset threshold, data synchronization is performed; when the total length of the data to be synchronized, Sumlenlist3, does not reach the preset threshold, and the system continues to wait for the updated metadata. The preset threshold can be set based on the actual situation and is used to determine the degree of matching between the total length of the data to be synchronized and the data transmission performance between the two modules. This embodiment performs data synchronization based on the condition that the total length of the data to be synchronized reaches the preset threshold, so as to improve the resource matching degree of data transmission and reduce resource waste while ensuring the quality of data synchronization.

[0062] In some embodiments of this application, the data synchronization method further includes: determining the effective bandwidth of the synchronization link between the local control module and the peer control module; determining the unit effective payload length based on the effective bandwidth of the synchronization link; and obtaining the product between the unit effective payload length and a preset coefficient to obtain a preset threshold.

[0063] In other words, the effective data length, or unit payload length, transmitted in a single transmission through the synchronization link is determined based on the effective bandwidth of the synchronization link between the local control module and the peer control module. Taking network connections as an example, the maximum data field of a TCP / IP (Transmission Control Protocol / Internet Protocol) packet is 1500 bytes, while the maximum data field of an IPMI packet is 249 bytes.

[0064] If the synchronization link between the local control module and the peer control module is a network, then the unit effective payload length is determined to be 1500 bytes. In this case, if the total length of the data to be synchronized, Sumlenlist3, is 1500, then a match is considered established, and the following data synchronization operation is performed. Alternatively, a threshold, or preset coefficient, can be set here. For example, reaching 90% of the effective bandwidth of the synchronization link is also considered a match. That is, when the total length of the data to be synchronized, Sumlenlist3, is 1350 (i.e., 1500 * 90%), a match is considered established, and the following data synchronization operation is performed. Otherwise, a mismatch is considered, and to avoid wasting link bandwidth, data synchronization enters a waiting state, awaiting the addition of new synchronization metadata.

[0065] This embodiment calculates the matching between the amount of data to be synchronized and the effective bandwidth of the synchronization link based on a preset threshold. On the one hand, it can improve the utilization rate of the effective bandwidth, and on the other hand, it can prevent the situation where additional unpacking and repacking software is needed to process the synchronized data when it exceeds the length of data transmitted once by the synchronization link, which would increase the complexity.

[0066] In some embodiments of this application, obtaining data to be synchronized from the local control metadata chain based on the metadata chain to be sent includes: matching metadata in the local control metadata chain according to the data identifier of the updated metadata in the metadata chain to be sent; copying the metadata in the local control metadata chain that is successfully matched to obtain at least one metadata to be synchronized; and determining the data to be synchronized based on the at least one metadata to be synchronized.

[0067] In other words, under the condition that the data synchronization conditions are met, the corresponding metadata is copied from the local control metadata linked list List1 based on the data identifier of the updated metadata to obtain the metadata to be synchronized, and then the metadata to be synchronized is processed according to... Figure 5 The data to be synchronized is constructed using the specified format and sent to the peer control module. If the data synchronization conditions are not yet met, the system continues to wait for the addition of new synchronization metadata.

[0068] This embodiment copies metadata from the local controller's metadata chain based on data identifiers to construct the data to be synchronized, thus ensuring the quality of data synchronization.

[0069] In some embodiments of this application, the data synchronization method further includes: after obtaining the data to be synchronized from the metadata list of the controller based on the metadata list to be sent, clearing the data in the metadata list to be sent.

[0070] In other words, after the pending metadata list meets the data synchronization conditions and the data to be synchronized is obtained from the local control metadata list List1 based on the pending metadata list List3, the data to be synchronized can be sent to the peer control module through the sending queue. Simultaneously, the pending metadata list List3 is cleared to receive new updated metadata and prevent duplicate data synchronization. This embodiment uses the pending metadata list List3 for data monitoring, distinguishing it from the data synchronization process. Without affecting data synchronization efficiency, the pending metadata list List3 is cleared to improve the monitoring quality of updated data.

[0071] In some embodiments of this application, the data synchronization method further includes: obtaining the actual synchronization interval duration of the local control module; determining that the data synchronization condition is met when the actual synchronization interval duration reaches a preset interval time; and re-timing the actual synchronization interval duration after obtaining the data to be synchronized from the local control module's metadata list based on the metadata list to be sent.

[0072] In other words, in addition to determining whether to perform data synchronization based on the total length of the data to be synchronized (Sumlenlist3), the system also considers the synchronization interval to determine when to initiate the data synchronization operation, thus meeting the timeliness requirements of data updates. The preset interval can be set according to actual conditions.

[0073] For example, data synchronization conditions include the total length of the data to be synchronized (Sumlenlist3) reaching a preset threshold (i.e., the total length of the data to be synchronized matches the effective bandwidth of the synchronization link), or the actual synchronization interval (timer) reaching a preset interval (i.e., the timer times out). Both the "matching the effective bandwidth of the synchronization link" and "timer timeout" conditions can trigger data synchronization, with the former having higher priority than the latter. Once triggered, all corresponding metadata in the metadata list (List3) to be sent must be sent. The purpose of setting the actual synchronization interval is to ensure that even when the length of the metadata to be synchronized is less than the effective bandwidth of the synchronization link, it can still be sent to the peer control system in a timely manner.

[0074] During the process of determining whether the data synchronization conditions are met, if the total length of the data to be synchronized does not match the effective bandwidth of the synchronization link, in order to avoid wasting the link bandwidth, the data synchronization will enter a waiting state, waiting for new synchronization metadata to be added. After the timer expires, according to the metadata information to be synchronized in the metadata list List3 to be sent, the data is copied sequentially from the metadata list List1 of this control module, sent to the peer control module, and the timer is restarted.

[0075] If the total length of the data to be synchronized matches the effective bandwidth of the synchronization link, even if the timer has not expired, the data should be immediately retrieved from the local controller's data linked list List1 and sent to the peer control module, and the timer should be restarted.

[0076] In some embodiments of this application, the data synchronization method further includes: if the actual synchronization interval reaches a preset interval and the metadata list to be sent is an empty list, determining that the data synchronization condition is not met, and re-timing the actual synchronization interval.

[0077] In other words, if the metadata list List3 to be sent is empty after the timer expires (i.e., the actual synchronization interval reaches the preset interval), meaning there is no metadata to be synchronized, the timer is reset to re-time the actual synchronization interval to avoid invalid data synchronization operations, thus optimizing the data synchronization process.

[0078] In some embodiments of this application, the data synchronization method further includes: upon receiving data to be synchronized sent by the peer control module, parsing the metadata of the data to be synchronized sent by the peer control module to determine at least one metadata to be synchronized sent by the peer control module; matching the peer control module's corresponding peer control mirror metadata linked list according to the data identifier of the at least one metadata to be synchronized sent by the peer control module; and updating the peer control mirror metadata linked list according to the matching result to complete the data synchronization of the peer control module.

[0079] Specifically, in combination Figure 1 As shown. Continuing with the example of the local control module being the A-controller and the opposing control module being the B-controller, the B-controller sends its internal data to be synchronized to the A-controller using the aforementioned data synchronization method. The A-controller then completes the data synchronization with the B-controller. The specific operation is as follows:

[0080] After receiving the synchronization data sent by the B control board management controller, the A control board management controller proceeds according to... Figure 5 The format is parsed sequentially to obtain at least one metadata to be synchronized sent by the B control board management controller. Then, based on the data identifiers mod_id and mod_data_id of the at least one metadata to be synchronized sent by the B control board management controller, the corresponding metadata is found in the control mirror data linked list List2 in the A control board management controller. Then, the metadata in the control mirror data linked list List2 is matched and updated according to the data identifiers (mod_id and mod_data_id).

[0081] This embodiment matches the metadata list of the control mirror with the data identifier of the metadata to be synchronized, and updates the data in the control mirror metadata list according to the matching result, thereby improving the data synchronization effect and the stability of the data mirror.

[0082] In some embodiments of this application, updating the metadata list of the peer control mirror based on the matching result includes: if the data identifier of the metadata to be synchronized sent by the peer control module matches the metadata list of the peer control mirror, updating the corresponding metadata in the metadata list of the peer control mirror based on the metadata to be synchronized sent by the peer control module; if the data identifier of the metadata to be synchronized sent by the peer control module fails to match the metadata list of the peer control mirror, discarding the metadata to be synchronized sent by the peer control module.

[0083] In other words, if the data identifiers mod_id and mod_data_id of the metadata to be synchronized sent by the B control board management controller are found in the counterpart mirror data linked list List2 in the A control board management controller, the corresponding metadata in the counterpart mirror data linked list List2 will be updated.

[0084] If the data identifiers mod_id and mod_data_id of the metadata to be synchronized sent by the B control board management controller are not found in the control mirror data linked list List2 in the A control board management controller, the metadata will be discarded directly without being updated. This can prevent memory overflow from causing the BMC software to crash and affecting the stability of the BMC software.

[0085] In addition, if the data identifier of the metadata to be synchronized sent by the counterpart control module fails to match the counterpart control mirror metadata chain, the metadata to be synchronized that failed to match can be pre-stored in the preset storage module and stored for a preset time. If it still fails to match within the preset time, the data will be deleted.

[0086] As one specific implementation of this application, such as Figure 6 As shown, the above data synchronization method can be implemented based on this system architecture, as detailed below:

[0087] STEP 1: After sorting out the metadata that needs to be synchronized for each module of the Baseboard Management Controller (BMC), output the metadata configuration file for each module as shown in Table 1. Taking Module 1 among the many modules of BMC as an example, after the Module 1 program starts, first parse the metadata configuration file of Module 1, refer to Table 2, generate a local control metadata linked list List1 for Module 1, and allocate corresponding memory for the data pointer part (mod_data_ptr) of the metadata of each node in the linked list.

[0088] STEP 2: Having obtained the complete list of metadata through STEP 1 module 1, each metadata record's key value and previous value are maintained within the hardware information test thread of module 1. After the hardware information acquisition thread of module 1 starts, each time a metadata value is acquired, it is first compared with the previous value of this metadata. If they are inconsistent, the value is updated in the local control data linked list List1 of module 1.

[0089] STEP3: After all metadata tests in module 1 have been completed in one round, send the updated metadata parameters (mod_id, mod_data_id, mod_data_len) to the data synchronization module one by one.

[0090] STEP 4: After the data synchronization module starts, a software timer is immediately started. The purpose of the timer is to ensure that the metadata to be synchronized is sent to the peer control BMC in a timely manner even when the length of the metadata to be synchronized is less than the effective bandwidth of the synchronization link.

[0091] After receiving the metadata parameters from Module 1, the data synchronization module adds them to its local list of metadata to be sent, List3, and calculates the match between the amount of data to be synchronized and the effective bandwidth of the synchronization link. The calculation method is as follows: traverse each node (metadata) in List3, and calculate the data length for each node using the formula (refer to Table 2): mod_data_len + 3 (mod_id, mod_data_id, and mod_data_len occupy 3 bytes). Then sum these values ​​to obtain the total length of the data to be synchronized, Sumlenlist3. If the synchronization link between BMCs is a network, the effective bandwidth of the BMC synchronization link corresponds to a unit effective payload length of 1500 bytes. If Sumlenlist3 = 1500, a match is considered. Alternatively, a threshold or preset coefficient can be set here, for example, a match is considered to be achieved when the total length of the data to be synchronized reaches 90% of the effective bandwidth of the synchronization link, i.e., Sumlenlist3 = 1350, which is considered a match.

[0092] If the total length of the data to be synchronized matches the effective bandwidth of the synchronization link, even if the timer has not expired, the metadata should be immediately retrieved from the local controller's metadata list List1 in module 1 and sent to the peer controller (according to...). Figure 5 (The format is as follows). After sending, remove this metadata from the list of metadata to be sent (List3).

[0093] It should be noted that each time a node is added to the metadata list List3 to be sent, the data synchronization module must calculate the total length of the data to be synchronized, Sumlenlist3. Both the "matching the effective bandwidth of the synchronization link" and "timer timeout" conditions can trigger data synchronization, with the former having higher priority than the latter. Once triggered, all the corresponding metadata in the metadata list List3 to be sent must be sent.

[0094] If there is a mismatch, to avoid wasting link bandwidth, data synchronization enters a waiting state, waiting for new synchronization metadata to be added. After the timer expires, data is copied sequentially from the local control metadata list List1 of module 1 according to the metadata information to be synchronized in the metadata list List3 to be sent, and sent to the peer control (according to...). Figure 5 (In the specified format), after sending one piece of metadata, remove this metadata from List3. After all data in List3 has been sent, reset the timer.

[0095] If the Timer has expired and List3 is an empty linked list (i.e., there is no metadata to be synchronized), then the timer is reset directly.

[0096] STEP 5: This step involves processing the synchronization data received from the counterpart. After receiving the data packet, proceed as follows: Figure 5 Each metadata element is parsed sequentially according to its format. After parsing, the corresponding metadata is found in the control mirror data linked list List2 of module 1 based on mod_id and mod_data_id, and then the metadata is updated.

[0097] STEP6: After completing STEP1~5, the local control BMC has obtained the metadata of local control module 1 and the image metadata of the counterpart control module 1. If the host computer queries the corresponding data, it can directly search from the local control metadata list List1 and the counterpart control image metadata list List2 of module 1 in the interface function of module 1 according to mod_data_id.

[0098] Based on the above, the data synchronization method of this application can bring the following beneficial effects:

[0099] 1. Improve the effective bandwidth utilization of the BMC data synchronization link;

[0100] 2. Adding synchronized metadata to each module of BMC will not cause memory overflow to trigger BMC software crash, thus improving the reliability of BMC software;

[0101] 3. Based on condition settings, the data to be synchronized is matched with the bandwidth of the synchronization link, eliminating the need for additional packet splitting and reassembly, thus reducing software complexity.

[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0103] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described data synchronization method embodiments.

[0104] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data synchronization method embodiments at runtime.

[0105] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0106] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data synchronization method embodiments.

[0107] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data synchronization method embodiments.

[0108] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software 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 beyond the scope of this application.

[0109] The foregoing has provided a detailed description of a data synchronization method, electronic device, computer storage medium, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A data synchronization method, characterized in that, Applied to a local control module, the method includes: Determine the local control metadata linked list corresponding to the module data to be synchronized, wherein the module data to be synchronized is divided into multiple metadata based on data attributes, and the local control metadata linked list is constructed using the metadata as linked list nodes; If updated metadata exists in the local control metadata chain, a metadata chain to be sent is constructed based on the data identifier and data length of the updated metadata. If the metadata list to be sent meets the data synchronization conditions, the data to be synchronized is obtained from the local control metadata list based on the metadata list to be sent, and the data to be synchronized is sent to the peer control module to complete the data synchronization of the peer control module. The process of determining the local controller's metadata linked list corresponding to the data of the module to be synchronized includes: The data of the module to be synchronized is determined based on the sub-modules in the local control module and the target synchronization data within the sub-modules. The data of the module to be synchronized is divided into multiple metadata based on data attributes to determine the metadata configuration file of the local control module, wherein the metadata configuration file corresponds to the sub-modules in the local control module; The metadata configuration file is parsed to obtain multiple metadata in a preset data structure, wherein the preset data structure includes data identifier, data length and data content; The local control metadata linked list is constructed by using multiple metadata in a preset data structure as linked list nodes.

2. The data synchronization method according to claim 1, characterized in that, If updated metadata exists in the current control metadata linked list, a metadata linked list to be sent is constructed based on the data identifier and data length of the updated metadata, including: Metadata traversal and detection are performed based on the aforementioned control data linked list; If the current traversal and detection are completed and updated metadata exists in the local control metadata chain, obtain the data identifier and data length of the updated metadata; The data identifier and data length of the updated metadata are used as linked list nodes to construct the linked list of metadata to be sent.

3. The data synchronization method according to claim 2, characterized in that, Metadata traversal and detection are performed based on the aforementioned control metadata linked list, including: Based on the aforementioned metadata linked list, a test data structure for metadata is constructed within the hardware information test thread, wherein the test data structure includes data identifier and data content; Based on the hardware information, the test thread traverses the hardware objects of the local control module according to the data identifier of the metadata to obtain the current data value of the metadata. If there is a deviation between the current data value of the metadata and the initial data value in the data content of the metadata, the current data value of the metadata is updated to the local control metadata linked list.

4. The data synchronization method according to claim 1, characterized in that, After constructing the linked list of metadata to be sent based on the data identifier and data length of the updated metadata, the process also includes: The data length of the updated metadata is determined based on the data identifier and data length of the updated metadata; Obtain the sum of the data lengths of the updated metadata in the metadata list to be sent, so as to obtain the total length of the data to be synchronized; If the total length of the data to be synchronized reaches a preset threshold, the data synchronization condition is determined to be met.

5. The data synchronization method according to claim 4, characterized in that, The method further includes: Determine the effective bandwidth of the synchronization link between the local control module and the peer control module; The unit payload length is determined based on the effective bandwidth of the synchronization link; The product between the unit effective load length and the preset coefficient is obtained to obtain the preset threshold.

6. The data synchronization method according to claim 4, characterized in that, Based on the metadata list to be sent, the data to be synchronized is obtained from the local control metadata list, including: Match the metadata in the local control metadata chain with the data identifier of the updated metadata in the metadata chain to be sent; Copy the metadata in the matched local control metadata chain to obtain at least one metadata to be synchronized; The data to be synchronized is determined based on the at least one piece of metadata to be synchronized.

7. The data synchronization method according to claim 6, characterized in that, The method further includes: After obtaining the data to be synchronized from the local control metadata list based on the metadata list to be sent, the data in the metadata list to be sent is cleared.

8. The data synchronization method according to claim 1, characterized in that, The method further includes: Obtain the actual synchronization interval duration of the local control module; If the actual synchronization interval reaches the preset interval, the data synchronization condition is determined to be met, and after obtaining the data to be synchronized from the local control metadata chain based on the metadata chain to be sent, the actual synchronization interval is re-timed.

9. The data synchronization method according to claim 8, characterized in that, Also includes: If the actual synchronization interval reaches the preset interval and the metadata list to be sent is empty, it is determined that the data synchronization condition is not met, and the actual synchronization interval is re-timed.

10. The data synchronization method according to claim 1, characterized in that, The method further includes: Upon receiving data to be synchronized from the peer control module, metadata parsing is performed on the data to be synchronized from the peer control module to determine at least one piece of metadata to be synchronized from the peer control module. The corresponding peer control mirror metadata linked list of the peer control module is matched according to the data identifier of at least one metadata to be synchronized sent by the peer control module. The data in the counterpart control mirror metadata chain is updated based on the matching results to complete the data synchronization of the counterpart control module.

11. The data synchronization method according to claim 10, characterized in that, The data in the controlled image metadata linked list is updated based on the matching results, including: If the data identifier of the metadata to be synchronized sent by the peer control module successfully matches the peer control mirror metadata chain, the corresponding metadata in the peer control mirror metadata chain is updated based on the metadata to be synchronized sent by the peer control module. If the data identifier of the metadata to be synchronized sent by the peer control module fails to match the peer control mirror metadata linked list, the metadata to be synchronized sent by the peer control module is discarded.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data synchronization method as described in any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data synchronization method as described in any one of claims 1 to 11.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data synchronization method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data synchronization method and device, electronic equipment and storage medium

    CN116431398A