Synchronization method of controller and electronic device

CN122450866BActive Publication Date: 2026-09-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610915907.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-09-11
Estimated Expiration
2046-06-24

AI Technical Summary

Technical Problem

[0003]本申请提供了一种控制器的同步方法及电子设备,以至少解决相关技术中控制器之间的同步效率较低的问题

Benefits of technology

[0006]In this application, the memory is connected to a first controller and at least one second controller. The first control unit included in the first controller stores the acquired first data request into a target storage space among multiple first storage spaces included in the first controller that does not store the data request. The first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The first control unit sends target notification information carrying the first and second virtual addresses to the second control unit. The second control unit responds to the notification message initiated by the first control unit and synchronizes the data requests stored in the multiple first storage spaces to the multiple second storage spaces. That is, the first control unit on the first controller determines the storage space of the acquired first data request on the first controller and the storage space to be stored on the second controller. The second control unit on the first controller, in conjunction with the virtual address of the storage space determined by the first control unit, synchronizes the data request on the first controller from the first controller to the second controller. The synchronization of data requests between controllers is no longer limited by serial execution. The first control unit and the second control unit can process different synchronization stages of different data requests at the same time, which shortens the overall synchronization time of data requests between controllers. Therefore, it can solve the technical problem of low synchronization efficiency between controllers in related technologies and achieve the technical effect of improving the synchronization efficiency between controllers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122450866B_ABST
    Figure CN122450866B_ABST
Patent Text Reader

Abstract

The application discloses a synchronization method of a controller and an electronic device, and relates to the technical field of computers, and comprises the following steps: a first control unit stores a first data request obtained by the first control unit into a target storage space of a plurality of first storage spaces which does not store data requests; the first control unit finds a second virtual address corresponding to a first virtual address of the target storage space from a target correspondence relationship, wherein a plurality of target virtual addresses of the plurality of first storage spaces and a plurality of reference virtual addresses of a plurality of second storage spaces establish the target correspondence relationship; and the first control unit sends target notification information carrying the first virtual address and the second virtual address to a second control unit, wherein the second control unit is used for responding to the notification information initiated by the first control unit. Through the application, the technical problem of low synchronization efficiency between controllers in the related art is solved, and the technical effect of improving the synchronization efficiency between the controllers is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to a synchronization method for a controller and an electronic device. Background Technology

[0002] In providing data access to the server, for data security, a storage device typically includes at least two controllers. When the server generates a data request, the controller receiving the request synchronizes it with the other controllers within the storage device. In related technologies, the controller receiving the data request can only proceed to the synchronization of the next data request after completing the synchronization process of an entire data request sequentially, resulting in low synchronization efficiency between controllers. Summary of the Invention

[0003] This application provides a synchronization method and electronic device for controllers, to at least solve the problem of low synchronization efficiency between controllers in the related art.

[0004] This application provides a synchronization method for a controller, comprising: a first control unit storing an acquired first data request to a target storage space among multiple first storage spaces where no data request has been stored; wherein the first data request is used to request the first controller to store target data in a memory; the memory is connected to the first controller and at least one second controller; the first controller includes a first control unit, a second control unit, and multiple first storage spaces; the second controller includes multiple second storage spaces; the first control unit searching for a second virtual address corresponding to a first virtual address of the target storage space from a target mapping relationship; wherein multiple target virtual addresses are allocated to the multiple first storage spaces in the virtual address space of the first controller. Multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller, and a target correspondence is established between multiple target virtual addresses and multiple reference virtual addresses. The first control unit sends target notification information carrying the first virtual address and the second virtual address to the second control unit. The target notification information is used to indicate that the target storage space has stored data requests to be synchronized to the reference storage space. The reference storage space is the storage space corresponding to the target storage space among the multiple second storage spaces. The second control unit is used to respond to the notification information initiated by the first control unit to synchronize the data requests stored in the multiple first storage spaces to the multiple second storage spaces. The notification information includes: target notification information.

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

[0006] In this application, the memory is connected to a first controller and at least one second controller. The first control unit included in the first controller stores the acquired first data request into a target storage space among multiple first storage spaces included in the first controller that does not store the data request. The first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The first control unit sends target notification information carrying the first and second virtual addresses to the second control unit. The second control unit responds to the notification message initiated by the first control unit and synchronizes the data requests stored in the multiple first storage spaces to the multiple second storage spaces. That is, the first control unit on the first controller determines the storage space of the acquired first data request on the first controller and the storage space to be stored on the second controller. The second control unit on the first controller, in conjunction with the virtual address of the storage space determined by the first control unit, synchronizes the data request on the first controller from the first controller to the second controller. The synchronization of data requests between controllers is no longer limited by serial execution. The first control unit and the second control unit can process different synchronization stages of different data requests at the same time, which shortens the overall synchronization time of data requests between controllers. Therefore, it can solve the technical problem of low synchronization efficiency between controllers in related technologies and achieve the technical effect of improving the synchronization efficiency between controllers. Attached Figure Description

[0007] 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.

[0008] Figure 1 This is a hardware structure block diagram of the controller synchronization method according to an embodiment of this application;

[0009] Figure 2 This is a flowchart of a controller synchronization method according to an embodiment of this application;

[0010] Figure 3 This is an application scenario diagram of a controller synchronization method according to an embodiment of this application;

[0011] Figure 4 This is a framework diagram of a lightweight data synchronization scheme between two storage controllers according to an embodiment of this application;

[0012] Figure 5 This is a schematic diagram of a send queue and a receive queue according to an embodiment of this application;

[0013] Figure 6This is a schematic diagram of a storage block partitioning according to an embodiment of this application;

[0014] Figure 7 This is a structural block diagram of a training device for a generative model according to an embodiment of this application. Detailed Implementation

[0015] 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.

[0016] 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.

[0017] 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.

[0018] The specific application environment architecture or specific hardware architecture on which the execution of the controller's synchronization method depends is described here.

[0019] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of the controller synchronization method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the image. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and a storage unit 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0020] Storage unit 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the controller synchronization method in this embodiment. Processor 102 executes various functional applications and data processing by running the computer program stored in storage unit 104, thus implementing the aforementioned method. Storage unit 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, storage unit 104 may further include storage units remotely located relative to processor 102, which can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0021] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0022] The embodiments of this application provide a controller synchronization method, and the method is described in detail in conjunction with the execution flow of the controller synchronization method.

[0023] The following explains the technical terms used in this application:

[0024] NTB: Non-Transparent Bridge is a hardware interconnect technology used for high-performance, low-latency, point-to-point DMA (Direct Memory Access) communication between two independent processors or controllers. NTB maps the physical memory of one party directly to the address space of the other party through a pre-configured window, enabling zero-copy, low-latency data exchange between the two parties through DMA without the intervention of the operating system.

[0025] This embodiment provides a controller synchronization method. Figure 2 This is a flowchart of a controller synchronization method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0026] Step S202: The first control unit stores the acquired first data request into a target storage space among multiple first storage spaces that does not store data requests. The first data request is used to request the first controller to store the target data into a memory. The memory is connected to the first controller and at least one second controller. The first controller includes: a first control unit, a second control unit, and multiple first storage spaces. The second controller includes: multiple second storage spaces.

[0027] In step S204, the first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. Here, multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller, and multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller. A target correspondence relationship is established between the multiple target virtual addresses and the multiple reference virtual addresses.

[0028] Step S206: The first control unit sends target notification information carrying the first virtual address and the second virtual address to the second control unit. The target notification information is used to indicate that the target storage space has stored data requests to be synchronized to the reference storage space. The reference storage space is the storage space corresponding to the target storage space in multiple second storage spaces. The second control unit is used to respond to the notification information initiated by the first control unit to synchronize the data requests stored in the multiple first storage spaces to the multiple second storage spaces. The notification information includes: target notification information.

[0029] Through the above steps, the memory is connected to the first controller and at least one second controller. The first control unit included in the first controller stores the acquired first data request into a target storage space among the multiple first storage spaces included in the first controller that does not store the data request. The first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The first control unit sends a target notification message carrying the first virtual address and the second virtual address to the second control unit. The second control unit responds to the notification message initiated by the first control unit and synchronizes the data requests stored in the multiple first storage spaces to the multiple second storage spaces. That is, the first control unit on the first controller determines the storage space of the acquired first data request on the first controller and the storage space to be stored on the second controller. The second control unit on the first controller, combined with the virtual address of the storage space determined by the first control unit, synchronizes the data request on the first controller from the first controller to the second controller. The synchronization of data requests between controllers is no longer limited by serial execution. The first control unit and the second control unit can process different synchronization stages of different data requests at the same time, which shortens the overall synchronization time of data requests between controllers. Therefore, it can solve the technical problem of low synchronization efficiency between controllers in related technologies and achieve the technical effect of improving the synchronization efficiency between controllers.

[0030] Figure 3 This is an application scenario diagram of a controller synchronization method according to an embodiment of this application. For example... Figure 3 As shown, the storage controller is primarily used for managing the storage disks / hard drives and the data stored on them, while also providing data access services to the server. Optionally, the control components of the storage section may consist of, but are not limited to, at least two controllers (such as...). Figure 3The system consists of controllers A and B. The front end of each controller connects to the server via technologies such as FC (Fibre Channel) and RDMA (Remote Direct Memory Access), while the back end connects to the disk via technologies such as SAS (Serial Attached SCSI) and NVME (Non-Volatile Memory Express), forming a redundant system. When an application on the server generates a write I / O (Input / Output) request, the request is first sent to a controller, such as controller A, via the front end card (FC). Controller A recognizes the write request and receives the data request. After receiving the data request, it does not immediately send a write I / O request completion response to the server. Instead, it sends the write request data to controller B as backup redundancy before finally sending a write I / O request completion response to the server. This way, if controller A fails, the server can retrieve the originally stored data from controller B. The method described in this application can be applied, but is not limited to, scenarios involving write I / O request synchronization between controllers A and B.

[0031] In the embodiment provided in step S202, the memory may be, but is not limited to, a collection of physical storage media used in a storage system for persistent or cached data. The memory may be, but is not limited to, shared access by multiple controllers to achieve data redundancy, synchronization, and high availability. The memory may include, but is not limited to, solid-state drives, hard disk drives, magnetic disks, etc.

[0032] Optionally, in this embodiment, the first controller and at least one second controller may be, but are not limited to, two or more independent, functionally equivalent control units deployed in the storage system to achieve high availability and data redundancy. The first controller and at least one second controller jointly manage the same set of memory. The first controller and at least one second controller may, but are not limited to, perform data synchronization and state coordination through an internal high-speed interconnect channel. In the event of a failure of any controller, the other controller can seamlessly take over the service, ensuring business continuity.

[0033] Optionally, in this embodiment, the control unit may be, but is not limited to, an independent execution entity within the controller used to perform specific functional tasks. The control unit may include, but is not limited to, a core, software thread, process, or hardware coprocessor, etc. The control unit may include, but is not limited to, the aforementioned first control unit and second control unit, as well as the third control unit, fourth control unit, and fifth control unit.

[0034] Optionally, in this embodiment, the first controller may have, but is not limited to, at least a first control unit and a second control unit, and the first data request may be synchronized to the second controller through the cooperation of the first control unit and the second control unit.

[0035] Optionally, in this embodiment, the first data request to be synchronized to the second controller may be obtained by the first control unit on the first controller, but is not limited to.

[0036] Optionally, in this embodiment, after obtaining the first data request, the first control unit may, but is not limited to, store the obtained first data request into a target storage space among multiple first storage spaces that does not store data requests.

[0037] Optionally, in this embodiment, the acquired data request to be synchronized may be stored in a first storage space where no data request is stored locally, but this is not limited to. This prepares the second storage space on the second controller where no data request is stored by combining the target virtual address of the first storage space with the reference virtual address of the second storage space.

[0038] As an optional implementation, the storage of the acquired first data request to a target storage space among multiple first storage spaces that do not store data requests can be achieved by the first control unit in the following manner, but not limited to: the first control unit searches for the first storage space in a first address order among the storage spaces that do not store data requests in the multiple first storage spaces as the target storage space, wherein the multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address order and the first storage amount, and the storage order of the multiple first storage spaces storing data requests is the first address order; the first virtual address of the target storage space is obtained from the multiple target virtual addresses; and the first data request is stored in the first virtual address.

[0039] Optionally, in this embodiment, the first control unit may, but is not limited to, use a cyclic allocation mechanism based on a fixed address order to search for the first free storage unit in multiple first storage spaces according to a preset first address order, use it as the target storage space, and write the first data request to its corresponding first virtual address, thereby achieving orderly and non-contending efficient queuing of data requests in the local cache pool.

[0040] Optionally, in this embodiment, the storage space allocation logic is abstracted into a linear circular buffer through the above data request local storage mechanism. Resource allocation is completed by relying on address order rather than dynamic lookup or locking mechanism, which ensures that multiple data requests under high concurrency can quickly locate available space in a deterministic manner, avoiding resource contention and management overhead.

[0041] Optionally, in this embodiment, the first address order may be, but is not limited to, an address order from low to high, or an address order from high to low, or other set order. This application does not specifically limit this.

[0042] Optionally, in this embodiment, the first storage amount may be, but is not limited to, the size of each of the multiple first storage spaces.

[0043] In the embodiment provided in step S204, after the first data request is stored in the target storage space, the first control unit may, but is not limited to, look up the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence.

[0044] Optionally, in this embodiment, in addition to the multiple first storage spaces on the first controller being allocated multiple target virtual addresses in the virtual address space of the first controller, the multiple second storage spaces on the second controller may also be allocated virtual addresses (i.e., reference virtual addresses) in the virtual address space of the first controller. The control units on the first controller (including the first control unit, the second control unit, etc.) may, but are not limited to, access the corresponding second storage space through the virtual addresses allocated to the second storage space in the virtual address space of the first controller.

[0045] Optionally, in this embodiment, the target mapping relationship may include, but is not limited to, the mapping relationship between multiple target virtual addresses allocated to multiple first storage spaces in the virtual address space of the first controller, and multiple reference virtual addresses allocated to multiple second storage spaces in the virtual address space of the first controller. Optionally, the second virtual address of the reference storage space may be obtained by finding the virtual address corresponding to the first virtual address through the first virtual address of the target storage space and the target mapping relationship.

[0046] Optionally, in this embodiment, the target correspondence may be stored on the first controller, and the second controller may initiate a request to the first controller to obtain and use the target correspondence when the second controller needs to use it; correspondingly, the target correspondence may also be stored on the second controller, and the first controller may initiate a request to the second controller to obtain and use the target correspondence when the first controller needs to use it.

[0047] Optionally, in this embodiment, the target correspondence may also be stored in an area accessible to both the first controller and the second controller. For example, it may be stored on an independent storage device accessible to both the first controller and the second controller, or in a storage space in the first controller that has granted access to the second controller, or in a storage space in the second controller that has granted access to the first controller. The first controller and the second controller may, but are not limited to, be able to access the target correspondence directly without the participation of other controllers.

[0048] As an optional implementation, the search for the second virtual address corresponding to the first virtual address of the target storage space by the first control unit from the target correspondence can be achieved in the following manner: the search for the second virtual address corresponding to the first virtual address by the first control unit from the target correspondence stored in the fourth storage space, wherein the second controller further includes: the fourth storage space.

[0049] Optionally, in this embodiment, the target mapping relationship may, but is not limited to, be stored in the storage space of the controller that is to receive the data request for synchronization.

[0050] As an optional implementation, the first control unit may search for the second virtual address corresponding to the first virtual address from the target correspondence stored in the fourth storage space in the following ways, but not limited to: the first control unit obtains the third virtual address; the first control unit accesses the fourth storage space through the third virtual address to obtain the target correspondence, wherein the third virtual address is a virtual address allocated to the fourth storage space on the first controller; and the first control unit searches for the second virtual address corresponding to the first virtual address from the target correspondence.

[0051] Optionally, in this embodiment, the fourth storage space may, but is not limited to, be allocated a third virtual address on the first controller, and the first control unit may, but is not limited to, access the fourth storage space through the third virtual address to obtain the target correspondence.

[0052] Optionally, in this embodiment, by mapping the storage space on the second controller to the virtual space of the first controller, the first control unit of the first controller can directly access the management data (such as target correspondence) stored in the storage space on the second controller. Compared with storing management data on both the first and second controllers, this reduces the waste of storage space and does not affect the access efficiency of management data.

[0053] As an optional implementation, the second virtual address corresponding to the first virtual address of the target storage space can also be found from the target correspondence by the first control unit in the following manner: the first control unit finds the reference address sequence corresponding to the target address sequence of the first virtual address in the first address sequence from the target correspondence, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address sequence and the first storage amount, the storage order of the multiple first storage spaces storing data requests is the first address sequence, multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller according to the second address sequence and the second address sequence, and there is a target correspondence between the first address sequence and the second address sequence; the second virtual address is determined from the multiple reference virtual addresses based on the first virtual address, reference address sequence and second storage amount of the third storage space located in the candidate address sequence in the second address sequence, wherein the multiple second storage spaces include the third storage space.

[0054] Optionally, in this embodiment, the target correspondence may be, but is not limited to, the correspondence between the address order of each of the multiple first storage spaces in the first address space when a target virtual address is allocated in the virtual address space of the first controller, and the address order of each of the multiple second storage spaces in the second address space when a reference virtual address is allocated in the virtual address space of the first controller. Optionally, but not limited to, the reference address order corresponding to the target address order may be determined based on the target address order of the first virtual address of the target storage space in the first address space and the target correspondence, and further, but not limited to, the second virtual address may be determined based on the first virtual address and reference address order of the third storage space known on the first controller in the second address space and the second storage amount of the multiple second storage spaces when a reference virtual address is allocated in the virtual address space of the first controller.

[0055] For example, the first controller may include, but is not limited to, three first storage spaces A, B, and C. These three first storage spaces may be allocated three target virtual addresses A1, B2, and C3 according to the first storage size of 2MB (Megabyte), 2MB, and 2MB and the consecutive address order from high to low (i.e., the first address order). The second controller may include, but is not limited to, three second storage spaces A, B, and C. These three first storage spaces may be allocated three reference virtual addresses A4, B5, and C6 according to the second storage size of 1MB, 2MB, and 1MB and the consecutive address order from high to low (i.e., the second address order). When the first data request to be synchronized is stored in the first storage space B, it is possible, but not limited to, to first determine that the second storage space on the second controller that receives the data request to be synchronized is also in the second order of its corresponding address sequence based on the second order of the target virtual address B1 of the first storage space B in A1, B2, and C3. Then, combined with the second storage amount of 1MB, 2MB, and 1MB, and the first virtual address A4 of the third storage space known by the first controller to be in the first order (i.e., the alternative address order) in the second address sequence, the second virtual address is calculated.

[0056] Optionally, in this embodiment, by establishing a one-to-one address order mapping relationship between the first and second storage spaces in the virtual address space, and combining a preset base virtual address with a known storage space step size, the first control unit can accurately calculate the reference virtual address of the target storage space of the data to be synchronized in the second controller locally without communicating with the second controller. This mechanism ensures that address allocation during data synchronization is deterministic and exclusive, avoiding address overlap or data overwriting caused by concurrent writes or resource contention, thereby achieving high concurrency, low latency, and zero-conflict cross-controller data synchronization in a lock-free environment.

[0057] Optionally, in this embodiment, a label may be used to indicate the address order of the virtual address of each storage space in the address sequence. For example, id=0 may be used to indicate that a certain virtual address is the first in the address sequence.

[0058] Optionally, in this embodiment, each tag may also represent, but is not limited to, each storage subspace, and the virtual address referred to by the tag may be stored in the storage subspace corresponding to the tag.

[0059] Optionally, in this embodiment, the first label id1 can refer to the first address position of the target virtual address in the first address sequence, and the second label id2 can refer to the second address position of the reference virtual address in the second address sequence. Therefore, the target correspondence can be, but is not limited to, the correspondence between the first label and the second label. For example, there is a target correspondence between id1=0 and id2=0, and between id1=1 and id2=1, etc.

[0060] Optionally, in this embodiment, the number of first tags and second tags may be equal to, but not limited to, the number of first storage spaces and second storage spaces, or may be less than, but not limited to, the number of first storage spaces and second storage spaces. If, but not limited to, the number of first tags and second tags is less than the number of first storage spaces and second storage spaces, after the first storage space and second storage space referred to by the first tag and second tag are used, the first storage space and second storage space referred to by the first tag and second tag are updated.

[0061] Optionally, in this embodiment, the first storage space indicated by the first tag may be updated by, but is not limited to, other control units on the first controller besides the first control unit and the second control unit.

[0062] As an optional implementation, the second virtual address can be determined from multiple reference virtual addresses based on the first virtual address, reference address order, and second storage amount of the third storage space located in the alternative address order in the second address order, in the following manner: when the second storage amounts of each second storage space are the same, the reference address order is converted into a target value, wherein the target value is used to indicate the order difference of the reference storage space relative to the third storage space; the second virtual address is calculated based on the target value, the second storage amount, and the first virtual address.

[0063] Optionally, in this embodiment, the second virtual address can be calculated by taking the order and multiplying by the step size when the second storage amount of each second storage space is the same, that is, when each second storage space is of equal size.

[0064] As an optional implementation, the second virtual address can be calculated based on the target value, the second storage amount, and the first virtual address in the following ways: calculate the product of the target value and the second storage amount to obtain the reference offset; calculate the sum of the reference offset and the first virtual address to obtain the second virtual address.

[0065] Optionally, in this embodiment, to improve computational efficiency and adapt to hardware accelerators, the calculation of the second virtual address can be implemented as two standard arithmetic operations, but is not limited to: first, multiplying the target value by the second storage amount to obtain the reference offset; then, adding the offset to the first virtual address of the third storage space to obtain the target reference virtual address. This calculation method consists entirely of basic arithmetic operations, requiring no table lookup, no locking mechanism, and no communication interaction. It can be completed by the controller in a single cycle, significantly reducing data synchronization latency and resource overhead.

[0066] In the embodiment provided in step S206, after determining the second virtual address according to the target correspondence, the first control unit may send target notification information carrying the first virtual address and the second virtual address to the second control unit to notify the second control unit to perform the data request synchronization.

[0067] Optionally, in this embodiment, the second control unit may, but is not limited to, receive notification information initiated by the first control unit in various forms to synchronize data requests stored in multiple first storage spaces to multiple second storage spaces. For example, the second control unit may, but is not limited to, synchronize the data request corresponding to the specific notification information from the first storage space to the second storage space when it receives the specific notification information initiated by the first control unit. Alternatively, the second control unit may, but is not limited to, store the notification information in a temporary storage area after receiving the notification information initiated by the first control unit, and retrieve the notification information received in this period from the temporary storage area and respond when the periodic synchronization opportunity arrives, etc.

[0068] Optionally, in this embodiment, the second controller may receive and respond to these data requests after the first controller synchronizes the data requests to the second controller.

[0069] As an optional implementation, when the second control unit has synchronized the first data request from the target storage space to the reference storage space, the data request synchronized from the first controller to the second controller can be processed in the following manner: the second control unit updates the request sending information stored on the first controller, wherein the request sending information is used to indicate that the first controller has synchronized the data request to the second controller; the third control unit detects the update information of the request sending information, wherein the update information is used to indicate that the second data request has been updated in the data request synchronized by the first controller to the second controller, the second controller further includes: a third control unit and a fourth control unit, the second data request includes the first data request; the third control unit updates the second data request to the pending response list according to the update information, wherein the pending response list is used to store data requests to be responded to, and the fourth control unit is used to execute the data requests stored in the pending response list.

[0070] Optionally, in this embodiment, the request to send information may be, but is not limited to, indicating all data requests that the first controller has synchronized with the second controller, or may be, but is not limited to, indicating data requests that the first controller has synchronized with the second controller in the previous time period, or may be, but is not limited to, indicating the most recent data request that the first controller has synchronized with the second controller, etc. This application does not limit this.

[0071] Optionally, in this embodiment, the update information may be used, but is not limited to, to indicate whether the first controller has newly updated the data request to the second controller. The update information of the request sending information may be detected by comparing different request sending information at different times or by detecting the currently received request sending information.

[0072] As an optional implementation, the detection of updated request information by the third control unit can be achieved, but is not limited to, through the following methods: the third control unit accesses the index set stored in the fifth storage space through the fourth virtual address, wherein the first controller further includes: the fifth storage space, the fourth virtual address is a virtual address allocated to the fifth storage space on the second controller, the indexes included in the index set are used to indicate that data requests stored in multiple first storage spaces have been synchronized to the storage space of the second controller, and the request information includes the index set; the third control unit detects whether the indexes in the index set have been updated; if an index update is detected in the index set, the third control unit extracts the updated reference index from the index set, wherein the reference index is used to indicate the storage space in multiple first storage spaces that stores the second data request, and the update information includes the reference index.

[0073] Optionally, in this embodiment, the index set may be, but is not limited to, a bitmap or array structure consisting of multiple index elements stored locally on the first controller (fifth storage space), and each index in the index set may be, but is not limited to, a number / tag of a stored data request that has been successfully synchronized to the first storage space of the second controller.

[0074] Optionally, in this embodiment, by setting an index set on the first controller side and mapping the fourth virtual address to the fifth storage space, the third control unit of the second controller can perceive the synchronization completion status in real time in a low-overhead, polling-free manner, thereby reducing communication overhead.

[0075] In some embodiments, the second controller may include, but is not limited to, a third control unit and a fourth control unit. The third control unit may sense the synchronization completion status of the data request, and the fourth control unit may respond to the data request that has been synchronized. This makes the response to the data request after synchronization no longer limited by the limitation of serial execution. The third control unit and the fourth control unit can handle different stages of the processing of the synchronized request, which improves the efficiency of the receiving end in processing the synchronized data request.

[0076] Optionally, in this embodiment, updating the second data request to the pending response list may include, but is not limited to, directly storing the second data request in the pending response list, or may include, but is not limited to, adding the address information of the second data request to the pending response list.

[0077] As an optional implementation, the third control unit may update the second data request to the pending response list based on the update information in the following manner: the third control unit determines the target address information of the storage space where the second data request is located in multiple second storage spaces based on the target correspondence and reference index; the third control unit updates the target address information to the pending response list, wherein the pending response list stores the address information of the data request to be responded to in multiple second storage spaces.

[0078] Optionally, in this embodiment, it is possible, but not limited to, first determining the storage space in a plurality of first storage spaces that stores the second data request based on the reference index, and then searching for the second storage space corresponding to the storage space obtained based on the reference index from the first storage space and the second storage space with corresponding relationship. It is possible, but not limited to, adding the address information of the found second storage space (e.g., the reference virtual address allocated to the found second storage space in the virtual address space of the second controller) to the list to be responded to.

[0079] As an optional implementation, the third control unit can determine the target address information of the storage space where the second data request is located in multiple second storage spaces according to the target correspondence and the reference index in the following manner: the third control unit searches the target correspondence for the candidate address sequence corresponding to the spare address sequence of the fifth virtual address included in the reference index in the first address sequence, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address sequence, the storage order of the data request in the multiple first storage spaces is the first address sequence, multiple second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller according to the second address sequence, the storage order of the data request in the multiple second storage spaces is the second address sequence, and there is a target correspondence between the first address sequence sequence and the second address sequence sequence sequence; the third control unit obtains the virtual address located in the candidate address sequence sequence in the second address sequence from the multiple spare virtual addresses to obtain the sixth virtual address, wherein the target address information includes the sixth virtual address.

[0080] Optionally, in this embodiment, the backup virtual address (i.e., the sixth virtual address) corresponding to the second storage space in the second controller can be derived in reverse by combining the reference index with the target correspondence and utilizing the address order mapping relationship of the first storage space in the first controller. This allows the precise physical storage location of the data to be processed to be located directly from the statically distributed set of backup virtual addresses without relying on a pre-stored address table or performing dynamic offset calculations, thus achieving zero-overhead and highly reliable acquisition of address information.

[0081] Optionally, in this embodiment, the order in which multiple second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller may, but is not limited to, be consistent with the order in which multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller, for example, both being second address order.

[0082] Optionally, in this embodiment, similarly to the previous one, labels can also be used to refer to the address order of the virtual addresses of each storage space in the address sequence.

[0083] Optionally, in this embodiment, the second storage space referred to by the second tag may be updated after the second storage space is used, but is not limited to. The first storage space referred to by the first tag that corresponds to the second tag may be updated after the second storage space referred to by the second tag is updated, but is not limited to.

[0084] The update mechanism of first and second tags makes it possible to use fewer tags to refer to more storage space, saving the number of tags and storage subspaces.

[0085] In addition, updating the storage space indicated by the first tag only after the second tag is updated ensures that the second storage space corresponding to the second tag of the first tag that is available in the sending end is always free and without stored data on the second controller, that is, it is usable, which can avoid accidental operation on unavailable storage space.

[0086] Optionally, in this embodiment, when the storage space indicated by the tag needs to be adjusted, the second storage space indicated by the second tag may be updated by other control units on the second controller besides the third control unit and the fourth control unit.

[0087] As an optional implementation, after the third control unit detects the update information of the request sending information, the third control unit may transmit reference storage information to the second control unit, wherein the reference storage information is used to indicate that a data request has been stored in the reference storage space; the second control unit updates the first data request to the pending return list according to the reference storage information, wherein the pending return list is used to store data requests for which a synchronization completion message is pending return, and the synchronization completion message is used to indicate that the synchronization of the data request has been completed. The first controller further includes: a fifth control unit, which is used to send the synchronization completion message of the data request stored in the pending return list to the device that initiated the corresponding data request.

[0088] Optionally, in this embodiment, after the third control unit of the second controller detects that the data request synchronization is complete, it can actively send reference storage information to the second control unit, triggering the second control unit to transfer the request from the synchronized state to the pending return list. The fifth control unit of the first controller then uniformly sends the synchronization completion message to the device that initiated the data request, thereby realizing the asynchronous decoupling and process separation of synchronization completion and response receipt between the controllers.

[0089] As an optional implementation, the transmission of reference storage information from the third control unit to the second control unit can be achieved, but is not limited to, by the following means: the third control unit stores the reference storage information in a fourth storage space, wherein the second controller further includes: the fourth storage space; the second control unit accesses the fourth storage space through a third virtual address and obtains the reference storage information from the fourth storage space, wherein the third virtual address is a virtual address assigned to the fourth storage space on the first controller.

[0090] Optionally, in this embodiment, the reference storage information may be stored in a storage area that can be accessed by the first controller but is also accessible on the second controller. The first controller may access the storage area through a third virtual address to obtain the reference storage information.

[0091] As an optional implementation, the second control unit can update the first data request to the pending return list based on the reference storage information in the following manner, but not limited to: the second control unit searches for the target address order corresponding to the reference address order of the second virtual address in the second address order from the target correspondence relationship, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller in accordance with the first address order, the storage order of the multiple first storage spaces storing data requests is the first address order, multiple second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller in accordance with the second address order, the storage order of the multiple second storage spaces storing data requests is the second address order, and there is a target correspondence between the first address order and the second address order; the second control unit obtains the virtual address located in the target address order in the first address order from the multiple target virtual addresses, and obtains the first virtual address allocated on the first controller for the target storage space storing the first data request; the second control unit updates the first virtual address to the pending return list.

[0092] Optionally, in this embodiment, the second control unit can, but is not limited to, use the bidirectional address mapping mechanism in the target correspondence to reverse-engineer the first virtual address of the original data request stored in the first controller after receiving the reference storage information, and write the address into the pending return list. This ensures that when the fifth control unit sends a synchronization completion message to the device that initiated the data request, it can accurately associate with and trace back the original storage location of the request, thereby realizing cross-controller request tracing and state closure.

[0093] Optionally, in this embodiment, similarly to the previous one, labels can also be used to refer to the address order of the virtual addresses of each storage space in the address sequence.

[0094] Optionally, in this embodiment, in addition to updating the first storage space corresponding to the second tag after the second storage space indicated by the second tag is updated, the first storage space indicated by the first tag that originally indicated the first virtual address can also be updated after the first virtual address is updated to the list to be returned. This can ensure that the first tag is updated only after the data request synchronization is completely completed, and can avoid the synchronization process of other data requests affecting the synchronization result feedback process of the previously synchronized data requests.

[0095] As an optional implementation, this application also provides a lightweight data synchronization scheme for the drive between storage dual controllers. Figure 4 This is a framework diagram of a lightweight data synchronization scheme between two storage controllers according to an embodiment of this application. Figure 4 As shown, this scheme may include, but is not limited to, three parts of data organization: first, a data sending and receiving memory management resource pool, i.e. Figure 4 The xfer pool (corresponding to the aforementioned multiple first storage spaces) and msg_buf pool (corresponding to the aforementioned multiple second storage spaces) shown are data sending and receiving memory management resource pools that can, but are not limited to, organize memory for sending and receiving data, that is, divide a portion of the system's memory into smaller, more manageable portions for use as resources; secondly, there are data sending and receiving queues, i.e. Figure 4 The xfer_ptr and msg_bug_ptr queues shown are mainly used to receive data to be sent from the business layer. Once enqueued, the data is driven to be sent out through the NTB link. Thirdly, there is the control data section, i.e. Figure 4 The workspace shown primarily includes the control for sending and receiving data in the send and receive queues. The operational mechanism of this system will be described in detail below.

[0096] Optionally, in this embodiment, the NTB driver kernel (corresponding to the aforementioned second control unit) running on node 1 (corresponding to the aforementioned first controller) may request a contiguous block of memory as a local workspace (corresponding to the aforementioned fifth storage space), and map it to the remote workspace (corresponding to the aforementioned fourth virtual address) of the peer node through the NTB window. For example, for a 4MB memory address on node 1 with local memory addresses 0x00000000~0x000fffff, the access address of node 2 (corresponding to the aforementioned second controller) on the peer node may be, but is not limited to, 0x20000000~0x200fffff; thus, node 2 accessing the remote workspace, i.e., address 0x20000000~0x200fffff, is equivalent to accessing node 1's local workspace, i.e., node 1's memory address 0x00000000~0x000fffff.

[0097] Optionally, in this embodiment, local_workspace may be used, but is not limited to, to record the following types of information: The first type is the usage status of xfers in the xfer queue, specifically including, but not limited to, the next available xfer, i.e., index_ready. Figure 5This is a schematic diagram of a send queue and a receive queue according to an embodiment of this application, as shown below. Figure 5 As shown, `index_ready` can, but is not limited to, point to `xfer_ptr 9`, and can, but is not limited to, represent the next available xfer as the xfer block corresponding to the address stored in `xfer_ptr 9`; xfers that have been transferred, i.e., `index_transfer_done`; xfers to be reclaimed, i.e., `index_to_be_reallocted`; and xfers that have been reclaimed, i.e., `index_reallocated`. The second category is the data reception status in the `msg_buf` queue, which can, but is not limited to, `msg_buf`s that have been processed, i.e., `index_handled`; and `msg_buf`s to be processed, i.e., `index_to_be_handled`. The third category is the maintenance information of `xfer_ptr` in the send queue and `msg_buf_ptr` in the receive queue. The fourth type is a one-to-one correspondence between elements in the sending queue and elements in the receiving queue. The number of elements in the sending queue and the receiving queue can be, but is not limited to, the same and a one-to-one correspondence. That is, data sent through xfer_ptr 1 (corresponding to the first tag mentioned above) must be received by msg_buf_ptr 1 (corresponding to the second tag mentioned above) at the other end (corresponding to the target correspondence mentioned above).

[0098] Optionally, in this embodiment, for the msg_buf_ptr queue, i.e. the receive queue, an array msg_buf_id may be maintained in the local_workspace, but is not limited to. The size of the array is the same as the number of elements in the msg_buf_ptr queue, and each array element records the sequence number of the msg_buf currently being used in the receive queue in the msg_buf pool.

[0099] Optionally, in this embodiment, the NTB driver core running on node 1 may, but is not limited to, request a contiguous block of memory as a data receiving space and map it to the peer node through the NTB window. For example, for a 1GB (Gigabyte) memory block with local memory addresses 0x40000000~0x7fffffff, the access address on the peer node may, but is not limited to, be 0x80000000~0xBfffffff. The starting address of this block (corresponding to the aforementioned first virtual address) may, but is not limited to, be recorded in the peer node's local workspace as remote_msg_buf_addr=0x80000000. This data receiving space may, but is not limited to, be divided into different blocks called msg_buf (corresponding to the aforementioned second storage space) according to a certain granularity, such as 1MB, and these msg_bufs may be organized into the msg_buf pool. Figure 6 This is a schematic diagram of a storage block partitioning method according to an embodiment of this application. Figure 6 As shown, for 1GB of memory, the granularity of the partition is 1MB, which can be divided into 1024 msg_bufs. The id number of each msg_buf (corresponding to the target value mentioned above) can be defined according to the distance between each msg_buf and the memory start address (i.e., the first msg_buf block with id=0) (corresponding to the aforementioned third storage space).

[0100] Optionally, in this embodiment, another block of memory may be allocated, but not limited to, and divided into xfers with the same granularity as msg_buf. These xfers are used to organize the data to be transmitted from the local end to the remote end. These xfers may be, but not limited to, uniformly organized into an xfer pool.

[0101] Optionally, in this embodiment, xfer resources can be allocated to the sending queue, but not limited to xfer_ptr, which is a pointer to xfer. An xfer can be requested from the xfer pool, and the address of the requested xfer is recorded in xfer_ptr0. The remaining xfers are allocated in a loop according to the above operation.

[0102] Optionally, in this embodiment, resources can be allocated for the receive queue, but not limited to: msg_buf_ptr is a pointer to msg_buf; a msg_buf can be requested from the msg_buf pool, the address of the requested msg_buf is recorded in msg_buf_ptr 0, and the id of the requested msg_buf is recorded in msg_buf_id 0; the above operations are repeated to allocate msg_bufs for the remaining msg_buf_ptr and msg_buf_id.

[0103] Optionally, in this embodiment, only the initialization preparation process on the node 1 side has been described above. Before the data request synchronization between node 1 and node 2, the above initialization preparation process may also be performed on node 2, but is not limited to.

[0104] Optionally, in this embodiment, after initialization preparation is completed, when node 1 needs to send data to the peer node, i.e., node 2, via the NTB link, the following steps may be performed by core A (corresponding to the aforementioned first control unit), which is not running the NTB driver:

[0105] Step ST1-1: Based on the next available xfer index, i.e. index_ready, find xfer_ptr, and then obtain the xfer resource (corresponding to finding the aforementioned target storage space).

[0106] Step ST1-2: Copy the data to be transmitted (corresponding to the first data request mentioned above) to xfer, and record the callback function call_back after the transmission is completed in xfer, and record the core of the callback function that should be run, that is, the core of receiving the data to be transmitted.

[0107] Step ST1-3: Based on index_ready (corresponding to the aforementioned target address sequence), read the ID of the received msg_buf from remote_workspace.msg_buf_id[index_ready], and record it as remote_msg_buf_id (corresponding to the aforementioned reference address sequence).

[0108] Step ST1-4: Calculate the address mapping of the received msg_buf from the peer end at this end (corresponding to the aforementioned second virtual address) using the following formula:

[0109] receive_msg_buf_addr = remote_msg_buf_addr (corresponding to the aforementioned first virtual address) + remote_msg_buf_id (corresponding to the aforementioned target value) × sizeof(msg_buf) (corresponding to the aforementioned second storage amount);

[0110] Steps ST1-5: After the above steps, we can obtain: the address for local data transmission, i.e., xfer address; the receiving address for the other end, i.e., receive_msg_buf_addr; and the data length sizeof(xfer). We can, but are not limited to, submit the xfer address, receive_msg_buf_addr, and sizeof(xfer) to the NTB to transmit data via DMA (corresponding to the aforementioned target notification information carrying the first virtual address and the second virtual address sent from the first control unit to the second control unit).

[0111] Step ST1-6: Update index_ready, that is, update the next available xfer index.

[0112] Through the above steps, the data (corresponding to the aforementioned data request) sending process from the source end is realized.

[0113] Optionally, in this embodiment, the core B-1 (corresponding to the aforementioned second control unit) running the NTB driver can detect the completion of data transmission at any time and update the index of the xfer that has been transmitted, i.e., index_transfer_done.

[0114] Optionally, in this embodiment, core B-1 may, but is not limited to, running only the NTB driver.

[0115] Optionally, in this embodiment, after the sending end sends data, the data receiving end driver can be run by the independent core B-2 (corresponding to the aforementioned third control unit) of the data receiving end, but is not limited to. That is, core B-2 can run only the NTB driver. The driver can read the sending end's index_transfer_done data (corresponding to the aforementioned update information) through remote_workspace and update the index of the msg_buf to be processed on this end, i.e., index_to_be_handled, with this value.

[0116] Optionally, in this embodiment, the msg_buf between index_handled and index_to_be_handled can be processed cyclically by core B-2 through the following steps:

[0117] Step ST2-1: Find msg_buf_ptr[index_handled] based on index_handled, and then obtain msg_buf;

[0118] Step ST2-2: The obtained msg_buf is attached to a pending linked list (denoted as list_to_be_handle) (corresponding to the aforementioned pending response list);

[0119] Step ST2-3: Request a msg_buf from the msg_buf pool, record the address of this msg_buf in msg_buf_ptr[index_handled], and record the id of this msg_buf in msg_buf_id[index_handled].

[0120] Step ST2-4, index_handled increments automatically.

[0121] Optionally, in this embodiment, the service data receiving program may, but is not limited to, run on a different core than the NTB driver, referred to as core C (corresponding to the aforementioned fourth control unit). The service data receiving program may, but is not limited to, extract the pending msg_bufs one by one from the pending linked list (referred to as list_to_be_handle) for processing, and return the msg_bufs to the msg_buf pool after processing is completed.

[0122] Optionally, after the receiving end receives a data request, the kernel B-1 running the NTB driver on the sending end may, but is not limited to, perform the following steps to reclaim xfer resources:

[0123] Step ST3-1: The driver reads the index of the msg_buf that has been processed by the receiver (corresponding to the aforementioned reference storage information), i.e., index_handled data, through remote_workspace, and updates the index of the xfer to be reclaimed, i.e. index_to_be_reallocted, with this value.

[0124] Step ST3-2, iteratively process the xfer between index_reallocated and index_to_be_reallocted:

[0125] Step ST3-2-1: Find xfer_ptr[index_reallocated] based on index_reallocated, and then obtain the xfer to be reclaimed;

[0126] Step ST3-2-2: Attach xfer to a waiting callback processing linked list (denoted as list_to_be_callback) (corresponding to the aforementioned list of pending returns) for processing;

[0127] Step ST3-2-3: Request an xfer from the xfer pool and record the address of this xfer in xfer_ptr[index_reallocated].

[0128] Step ST3-2-4, index_reallocated increments automatically.

[0129] Optionally, in this embodiment, the service recycling program may, but is not limited to, run on a different core than the NTB driver, denoted as core D (corresponding to the aforementioned fifth control unit). This program extracts xfers to be recycled one by one from the waiting callback processing list (denoted as list_to_be_callback), and returns the xfers to the xfer pool after processing.

[0130] By offloading all business scenarios unrelated to data transmission and reception on the link from the NTB driver core, the efficiency of NTB driver transmission and reception can be accelerated.

[0131] 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.

[0132] Embodiments of this application also provide a synchronization device for a controller. Figure 7 This is a structural block diagram of a training device for a generative model according to an embodiment of this application, such as... Figure 7 As shown, the device includes:

[0133] Storage module 702 is used to store the first data request obtained by the first control unit into a target storage space among multiple first storage spaces where no data request is stored. The first data request is used to request the first controller to store the target data into a memory. The memory is connected to the first controller and at least one second controller. The first controller includes: a first control unit, a second control unit and multiple first storage spaces. The second controller includes: multiple second storage spaces.

[0134] The lookup module 704 is used by the first control unit to look up the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller, and the multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller. A target correspondence relationship is established between the multiple target virtual addresses and the multiple reference virtual addresses.

[0135] The sending module 706 is used to send target notification information carrying a first virtual address and a second virtual address from the first control unit to the second control unit. The target notification information is used to indicate that a data request to be synchronized to a reference storage space has been stored in the target storage space. The reference storage space is the storage space corresponding to the target storage space in multiple second storage spaces. The second control unit is used to respond to the notification information initiated by the first control unit to synchronize the data requests stored in the multiple first storage spaces to the multiple second storage spaces. The notification information includes: target notification information.

[0136] Through the above device, the memory is connected to the first controller and at least one second controller. The first control unit included in the first controller stores the acquired first data request into the target storage space among the multiple first storage spaces included in the first controller that does not store the data request. The first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The first control unit sends target notification information carrying the first virtual address and the second virtual address to the second control unit. The second control unit responds to the notification message initiated by the first control unit and synchronizes the data requests stored in the multiple first storage spaces to the multiple second storage spaces. That is, the first control unit on the first controller determines the storage space of the acquired first data request on the first controller and the storage space to be stored on the second controller. The second control unit on the first controller, combined with the virtual address of the storage space determined by the first control unit, synchronizes the data request on the first controller from the first controller to the second controller. The synchronization of data requests between controllers is no longer limited by serial execution. The first control unit and the second control unit can process different synchronization stages of different data requests at the same time, which shortens the overall synchronization time of data requests between controllers. Therefore, it can solve the technical problem of low synchronization efficiency between controllers in related technologies and achieve the technical effect of improving the synchronization efficiency between controllers.

[0137] In some embodiments, the lookup module includes: a first lookup unit, configured to use a first control unit to look up a reference address sequence corresponding to a target address sequence of a first virtual address in a first address sequence from a target correspondence, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to a first address sequence and a first storage amount, the storage order of the multiple first storage spaces storing data requests is the first address sequence, multiple second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller according to a second address sequence and a second storage amount, and there is a target correspondence between the first address sequence in the first address sequence and the second address sequence in the second address sequence; and a first determination unit, configured to determine a second virtual address from multiple reference virtual addresses based on the first virtual address, reference address sequence, and second storage amount of a third storage space located in a candidate address sequence in the second address sequence, wherein the multiple second storage spaces include the third storage space.

[0138] In some embodiments, the first determining unit is further configured to: convert the reference address order into a target value when the second storage amount of each second storage space is the same, wherein the target value is used to indicate the order difference between the reference storage space and the third storage space; and calculate the second virtual address based on the target value, the second storage amount and the first virtual address.

[0139] In some embodiments, the first determining unit is further configured to: calculate the product of the target value and the second storage amount to obtain a reference offset; and calculate the sum of the reference offset and the first virtual address to obtain a second virtual address.

[0140] In some embodiments, the lookup module includes: a second lookup unit, configured to look up the second virtual address corresponding to the first virtual address from the target correspondence stored in the fourth storage space by the first control unit, wherein the second controller further includes: the fourth storage space.

[0141] In some embodiments, the second lookup unit is further configured to: obtain a third virtual address by the first control unit; access the fourth storage space through the third virtual address by the first control unit to obtain a target correspondence, wherein the third virtual address is a virtual address allocated to the fourth storage space on the first controller; and search for the second virtual address corresponding to the first virtual address from the target correspondence by the first control unit.

[0142] In some embodiments, the storage module includes: a third lookup unit, configured to have a first control unit search for the first storage space in a first address order from among the storage spaces containing unstored data requests included in a plurality of first storage spaces as the target storage space, wherein the plurality of first storage spaces are allocated a plurality of target virtual addresses in the virtual address space of the first controller according to the first address order and a first storage amount, and the storage order of the data requests in the plurality of first storage spaces is the first address order; a first acquisition unit, configured to acquire the first virtual address of the target storage space from the plurality of target virtual addresses; and a first storage unit, configured to store the first data request to the first virtual address.

[0143] In some embodiments, the aforementioned synchronization device further includes: a first update module, configured to update the request sending information stored on the first controller by the second control unit when the second control unit has synchronized the first data request from the target storage space to the reference storage space, wherein the request sending information is used to indicate that the first controller has synchronized the data request to the second controller; a detection module, configured to detect the update information of the request sending information by the third control unit, wherein the update information is used to indicate that the second data request has been updated in the data request synchronized by the first controller to the second controller, the second controller further including: a third control unit and a fourth control unit, the second data request including the first data request; and a second update module, configured to update the second data request to the pending response list by the third control unit according to the update information, wherein the pending response list is used to store pending data requests, and the fourth control unit is used to execute the data requests stored in the pending response list.

[0144] In some embodiments, the detection module includes: a second access unit, configured to access an index set stored in a fifth storage space via a fourth virtual address by a third control unit, wherein the first controller further includes: a fifth storage space, the fourth virtual address being a virtual address allocated to the fifth storage space on the second controller, the indexes included in the index set being used to indicate that data requests stored in multiple first storage spaces have been synchronized to the storage space of the second controller, and the request sending information including the index set; a detection unit, configured to detect whether an index has been updated in the index set by the third control unit; and an extraction unit, configured to extract an updated reference index from the index set by the third control unit if an index update is detected in the index set, wherein the reference index is used to indicate the storage space in multiple first storage spaces where the second data request is stored, and the update information including the reference index.

[0145] In some embodiments, the second update module includes: a second determining unit, configured to determine, by the third control unit, the target address information of the storage space where the second data request is located in a plurality of second storage spaces according to the target correspondence and reference index; and a first updating unit, configured to update the target address information to the pending response list by the third control unit, wherein the pending response list stores the address information of the data request to be responded to in the plurality of second storage spaces.

[0146] In some embodiments, the second determining unit is further configured to: have the third control unit search, from the target correspondence, for the candidate address sequence corresponding to the spare address sequence of the fifth virtual address included in the reference index in the first address sequence, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller in accordance with the first address sequence, the storage order of the multiple first storage spaces storing data requests is the first address sequence, multiple second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller in accordance with the second address sequence, the storage order of the multiple second storage spaces storing data requests is the second address sequence, and there is a target correspondence between the first address sequence sequence and the second address sequence sequence sequence; and have the third control unit obtain the virtual address located in the candidate address sequence sequence in the second address sequence from the multiple spare virtual addresses to obtain the sixth virtual address, wherein the target address information includes the sixth virtual address.

[0147] In some embodiments, the aforementioned synchronization device further includes: a transmission module, configured to transmit reference storage information to a second control unit after the third control unit detects the update information of the request to be sent, wherein the reference storage information is used to indicate that a data request has been stored in the reference storage space; a third update module, configured to update the first data request to the pending return list according to the reference storage information, wherein the pending return list is used to store data requests for which a synchronization completion message is pending return, and the synchronization completion message is used to indicate that the synchronization of the data request has been completed; the first controller further includes: a fifth control unit, configured to send the synchronization completion message of the data request stored in the pending return list to the device that initiated the corresponding data request.

[0148] In some embodiments, the transmission module includes: a second storage unit for storing reference storage information to a fourth storage space by a third control unit, wherein the second controller further includes: a fourth storage space; and a third access unit for accessing the fourth storage space by the second control unit through a third virtual address and obtaining reference storage information from the fourth storage space, wherein the third virtual address is a virtual address assigned to the fourth storage space on the first controller.

[0149] In some embodiments, the third update module includes: a fourth lookup unit, configured to have the second control unit look up the target address order corresponding to the reference address order of the second virtual address in the second address order from the target correspondence, wherein multiple first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address order, the storage order of the multiple first storage spaces storing data requests is the first address order, multiple second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller according to the second address order, the storage order of the multiple second storage spaces storing data requests is the second address order, and there is a target correspondence between the first address order and the second address order; a second acquisition unit, configured to have the second control unit acquire the virtual address located in the target address order in the first address order from the multiple target virtual addresses, to obtain the first virtual address allocated to the target storage space storing the first data request on the first controller; and a second update unit, configured to have the second control unit update the first virtual address to the list to be returned.

[0150] For a description of the features of the synchronization device of the controller in the corresponding embodiment, please refer to the relevant description of the synchronization method of the controller in the corresponding embodiment, which will not be repeated here.

[0151] 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 controller synchronization method embodiments.

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

[0153] 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.

[0154] 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 controller synchronization method embodiments.

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

[0156] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0157] 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.

[0158] The synchronization method and electronic device for a controller provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A synchronization method for a controller, characterized in that, include: The first control unit stores the acquired first data request into a target storage space among multiple first storage spaces that does not store the data request. The first data request is used to request the first controller to store the target data into a memory. The memory is connected to the first controller and at least one second controller. The first controller includes: the first control unit, the second control unit, and multiple first storage spaces. The second controller includes: multiple second storage spaces. The first control unit searches for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence relationship. The plurality of first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller, and the plurality of second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller. The target correspondence relationship is established between the plurality of target virtual addresses and the plurality of reference virtual addresses. The first control unit sends target notification information carrying the first virtual address and the second virtual address to the second control unit. The target notification information is used to indicate that the target storage space has stored data requests to be synchronized to the reference storage space. The reference storage space is the storage space corresponding to the target storage space in the plurality of second storage spaces. The second control unit is used to respond to the notification information initiated by the first control unit to synchronize the data requests stored in the plurality of first storage spaces to the plurality of second storage spaces. The notification information includes the target notification information.

2. The synchronization method for the controller according to claim 1, characterized in that, The step of the first control unit searching for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence includes: The first control unit searches the target correspondence relationship for the reference address sequence corresponding to the target address sequence of the first virtual address in the first address sequence. The plurality of first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address sequence and the first storage amount. The storage order of the data requests stored in the plurality of first storage spaces is the first address sequence. The plurality of second storage spaces are allocated multiple reference virtual addresses in the virtual address space of the first controller according to the second address sequence and the second storage amount. The target correspondence relationship exists between the first address sequence sequence and the second address sequence sequence. The second virtual address is determined from the plurality of reference virtual addresses based on the first virtual address of the third storage space located in the candidate address sequence in the second address sequence, the reference address sequence, and the second storage quantity, wherein the plurality of second storage spaces include the third storage space.

3. The synchronization method for the controller according to claim 2, characterized in that, The step of determining the second virtual address from the plurality of reference virtual addresses based on the first virtual address of the third storage space located in the candidate address sequence in the second address order, the reference address sequence, and the second storage amount includes: When the second storage amount in each of the second storage spaces is the same, the reference address order is converted into a target value, wherein the target value is used to indicate the order difference between the reference storage space and the third storage space; The second virtual address is calculated based on the target value, the second storage amount, and the first virtual address.

4. The synchronization method for the controller according to claim 3, characterized in that, The step of calculating the second virtual address based on the target value, the second storage amount, and the first virtual address includes: Calculate the product of the target value and the second storage amount to obtain the reference offset; The second virtual address is obtained by summing the reference offset and the first virtual address.

5. The synchronization method for the controller according to claim 1, characterized in that, The step of the first control unit searching for the second virtual address corresponding to the first virtual address of the target storage space from the target correspondence includes: The first control unit searches for the second virtual address corresponding to the first virtual address from the target correspondence stored in the fourth storage space, wherein the second controller further includes the fourth storage space.

6. The synchronization method for the controller according to claim 5, characterized in that, The step of the first control unit searching for the second virtual address corresponding to the first virtual address from the target correspondence stored in the fourth storage space includes: The third virtual address is obtained by the first control unit; The first control unit accesses the fourth storage space through the third virtual address to obtain the target correspondence, wherein the third virtual address is the virtual address allocated to the fourth storage space on the first controller; The first control unit searches for the second virtual address corresponding to the first virtual address from the target correspondence.

7. The synchronization method for the controller according to claim 1, characterized in that, The step of storing the acquired first data request by the first control unit into a target storage space among multiple first storage spaces that does not store data requests includes: The first control unit searches for the first storage space in the first address order from the storage spaces that have not stored data requests included in the plurality of first storage spaces as the target storage space. The plurality of first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address order and the first storage amount. The storage order of the data requests stored in the plurality of first storage spaces is the first address order. Obtain the first virtual address of the target storage space from the plurality of target virtual addresses; The first data request is stored in the first virtual address.

8. The synchronization method for the controller according to any one of claims 1 to 7, characterized in that, The method further includes, whereby the second control unit has synchronized the first data request from the target storage space to the reference storage space: The second control unit updates the request sending information stored on the first controller, wherein the request sending information is used to indicate that the first controller has made a data request to the second controller for synchronization; The third control unit detects the update information of the request sending information, wherein the update information is used to indicate that the first controller has updated the second data request in the data request synchronized to the second controller, and the second controller further includes: the third control unit and the fourth control unit, and the second data request includes the first data request; The third control unit updates the second data request to the pending response list according to the update information, wherein the pending response list is used to store data requests to be responded to, and the fourth control unit is used to execute the data requests stored in the pending response list.

9. The synchronization method for the controller according to claim 8, characterized in that, The update information of the request sent information detected by the third control unit includes: The third control unit accesses the index set stored in the fifth storage space through the fourth virtual address. The first controller further includes the fifth storage space, the fourth virtual address is a virtual address allocated to the fifth storage space on the second controller, and the indexes included in the index set are used to indicate that data requests stored in the plurality of first storage spaces have been synchronized to the storage space of the second controller. The request sending information includes the index set. The third control unit detects whether the index in the index set has been updated; If an index update is detected in the index set, the third control unit extracts the updated reference index from the index set, wherein the reference index is used to indicate the storage space in the plurality of first storage spaces where the second data request is stored, and the update information includes the reference index.

10. The synchronization method for the controller according to claim 9, characterized in that, The step of updating the second data request to the pending response list by the third control unit according to the update information includes: The third control unit determines the target address information of the storage space where the second data request is located in the plurality of second storage spaces based on the target correspondence and the reference index; The third control unit updates the target address information to the pending response list, wherein the pending response list stores the address information of the data requests to be responded to in the plurality of second storage spaces.

11. The synchronization method for the controller according to claim 10, characterized in that, The step of determining the target address information of the storage space where the second data request is located in the plurality of second storage spaces by the third control unit according to the target correspondence and the reference index includes: The third control unit searches the target correspondence for the candidate address order corresponding to the spare address order in the first address order of the fifth virtual address included in the reference index. The plurality of first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address order, and the storage order of data requests stored in the plurality of first storage spaces is the first address order. The plurality of second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller according to the second address order, and the storage order of data requests stored in the plurality of second storage spaces is the second address order. The target correspondence exists between the first address order and the second address order. The third control unit obtains the virtual address that is in the candidate address order in the second address sequence from the plurality of backup virtual addresses to obtain the sixth virtual address, wherein the target address information includes the sixth virtual address.

12. The synchronization method for the controller according to claim 8, characterized in that, After the third control unit detects the update information of the request transmission information, the method further includes: The third control unit transmits reference storage information to the second control unit, wherein the reference storage information is used to indicate that a data request has been stored in the reference storage space; The second control unit updates the first data request to the pending return list according to the reference storage information. The pending return list is used to store data requests for which a synchronization completion message is pending. The synchronization completion message is used to indicate that the synchronization of the data request has been completed. The first controller further includes a fifth control unit, which is used to send the synchronization completion message of the data request stored in the pending return list to the device that initiated the corresponding data request.

13. The synchronization method for the controller according to claim 12, characterized in that, The transmission of reference storage information from the third control unit to the second control unit includes: The reference storage information is stored in the fourth storage space by the third control unit, wherein the second controller further includes the fourth storage space; The second control unit accesses the fourth storage space through a third virtual address and obtains the reference storage information from the fourth storage space, wherein the third virtual address is a virtual address allocated to the fourth storage space on the first controller.

14. The synchronization method for the controller according to claim 12, characterized in that, The step of updating the first data request to the pending return list by the second control unit according to the reference storage information includes: The second control unit searches the target address sequence corresponding to the reference address sequence of the second virtual address in the second address sequence from the target correspondence relationship. The plurality of first storage spaces are allocated multiple target virtual addresses in the virtual address space of the first controller according to the first address sequence, and the storage order of data requests stored in the plurality of first storage spaces is the first address sequence. The plurality of second storage spaces are allocated multiple spare virtual addresses in the virtual address space of the second controller according to the second address sequence, and the storage order of data requests stored in the plurality of second storage spaces is the second address sequence. The target correspondence relationship exists between the first address sequence sequence and the second address sequence sequence. The second control unit obtains the virtual address that is located in the target address order in the first address order from the plurality of target virtual addresses, and obtains the first virtual address for storing the first data request; The second control unit updates the first virtual address to the list to be returned.

15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the synchronization method of the controller as described in any one of claims 1 to 14 when executing the computer program.

Citation Information

Patent Citations

  • Multi-controller task processing method and related device

    CN111125139A

  • Method of transmitting data between storage virtualization controllers and storage virtualization controller designed to implement the method

    US20060259650A1