Shared cache component and implementation method thereof, electronic device and storage medium
By designing a shared cache component, the latency and performance issues of the storage system are resolved, data migration is achieved in the event of a controller power failure, the risk of data loss and hardware costs are reduced, and system performance and reliability are improved.
Patent Information
- Application Number
- CN202511240499.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing storage systems suffer from poor latency and performance, and the controller's backup power supply increases space requirements and costs.
A shared cache component is adopted, including a switch chip, a conversion chip, and a control chip. The switch chip is connected to multiple controllers, the conversion chip performs protocol conversion, and the control chip divides the cache memory into intervals and migrates the cached data to non-volatile memory when the controller fails to power.
It significantly reduces the risk of data loss due to power failure, reduces equipment space occupation and overall cost, while improving system performance and reliability.
Smart Images

Figure CN120804019B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of servers, and in particular to a shared cache component and an implementation method thereof, an electronic device, and a storage medium. BACKGROUND
[0002] In related technologies, a storage system usually has multiple networking schemes such as two-control and four-control, and can implement system networking topology through networking such as one-frame two-control, one-frame four-control, and two-frame four-control. Taking one-frame two-control as an example, one-frame two-control refers to inserting two controllers in one chassis and implementing multi-control interconnection using an NTB (Non-Transparent Bridging) scheme or an ROCE (RDMA over Converged Ethernet) interconnection scheme. However, the NTB scheme or the ROCE interconnection scheme has poor latency and performance for storage system interconnection, which affects the overall machine performance. In addition, when the controller power supply fails, backup cache data is needed to prevent loss, and a BBU (Battery Backup Unit) battery needs to be provided for each controller to be ready for power, which increases space occupation and cost and has low cost performance. SUMMARY
[0003] The present application provides a shared cache component and an implementation method thereof, an electronic device, and a storage medium to at least solve the problems of poor latency and performance of a storage system in related technologies and the problem of increased space occupation and cost of a controller backup power supply.
[0004] The present application provides a shared cache component, which includes a switch chip, a conversion chip, a control chip, a cache memory, and a non-volatile memory. The switch chip is connected to a plurality of controllers respectively. The conversion chip is connected to the switch chip and the control chip respectively and is configured to implement conversion between a computing high-speed interconnection technology protocol and a protocol corresponding to the cache memory. The control chip is connected to the cache memory and the non-volatile memory respectively. The control chip is configured to divide the cache memory into a plurality of first sub-intervals according to the number of the plurality of controllers, and the first sub-intervals correspond to the controllers one by one. The first sub-intervals are configured to store cache data of the corresponding controllers. In the case of a power supply failure of the controller, the cache data of the controller is moved to the non-volatile memory.
[0005] The application further provides an implementation method of the shared cache component, the method comprising: dividing the cache memory into a plurality of first subintervals according to the number of the plurality of controllers, the first subintervals corresponding to the controllers one by one, and the first subintervals being used to store cache data of the corresponding controllers; and in the case of power failure of the controller, moving the cache data of the controller to the non-volatile memory.
[0006] The application further provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the implementation method of the shared cache component.
[0007] The application further provides a computer readable storage medium, the computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps of the implementation method of the shared cache component.
[0008] The application further provides a computer program product, comprising a computer program, the computer program being executed by a processor to implement the steps of the implementation method of the shared cache component.
[0009] The shared cache component of the application achieves effective management of cache data of the plurality of controllers by setting the switch chip, the conversion chip and the control chip, the component can accurately store the cache data of each controller in the specified area of the cache memory, and in the case of emergency of power failure of the controller, the control chip can automatically migrate the cache data of the affected controller to the non-volatile memory, thereby significantly reducing the risk of data loss caused by power failure; and the standby power supply of each controller is saved, which not only reduces the space occupied by the device, but also greatly reduces the overall cost. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0011] Figure 1 Communication topology diagram between integrated circuits of the storage system according to some embodiments of the application;
[0012] Figure 2 Mesh topology structure diagram of the ROCE network according to some embodiments of the application;
[0013] Figure 3 Schematic diagram of the shared cache component according to some embodiments of the application;
[0014] Figure 4 a schematic diagram of a shared cache component according to some embodiments of the present application;
[0015] Figure 5 a flowchart of a method for implementing a shared cache component according to some embodiments of the present application;
[0016] Figure 6 a block schematic diagram of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0018] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. The terms “first”, “second” and the like in the present application are applicable to distinguish similar objects, and are not used to describe a specific order or sequence.
[0019] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0020] In the related art, when a storage device is designed in hardware, a two-control or four-control design can be supported in a chassis, but to realize data sharing between multiple controllers, an NTB scheme or an ROCE scheme can be used, and at the same time, to solve the problem that after a power failure of a controller, the cache data of the controller needs to be written to a data disk to realize that data is not lost after the system is powered off.
[0021] Next, an ROCE scheme is used to illustrate a four-control sharing design in a chassis. Referring to Figure 1 , controller A can use three ROCE chips (memory access chips) to connect to other three controllers, such as controller B, controller C and controller D, to form a mesh topology. Referring to Figure 2The mesh ROCE structure can also be implemented by using CX6 chips (a kind of network card chip), and a four-control sharing scheme is achieved, that is, each controller uses three CX6 chips (for example, CX6_0, CX6_1 and CX6_2) to be connected to other controllers, to realize the network interconnection of the controller and the other three controllers. For example, the controller A uses the CX6_0 chip, the CX6_1 chip and the CX6_2 chip to be connected to the controller B, the controller C and the controller D respectively, specifically, the CX6_0 chip of the controller A is connected to the CX6_0 chip of the controller D, the CX6_1 chip of the controller A is connected to the CX6_1 chip of the controller C, and the CX6_2 chip of the controller A is connected to the CX6_2 chip of the controller B. As can be seen, one or more ROCE chips or CX6 chips need to be placed on each controller, which has an impact on the PCB layout and wiring of the board card, and the cost.
[0022] Further, the ROCE delay is tested by using network performance measurement tools such as ib_send_lat, ib_read_lat and ib_write_lat, and the delay time is different for different data packet sizes. For example, for a data packet of 8k, the maximum delay time can reach 5us, for a data packet of 32k, the maximum delay time can reach 8us, and for a data packet of 36k, the maximum delay time can reach 10us. The longer the delay time is, the greater the impact on performance. In view of the above ROCE networking scheme, the scheme is relatively complex, and the delay time reaches 10us, which has a greater impact on performance.
[0023] In addition, after the power supply of one of the controllers fails, the cache data in the controller needs to be backed up, and the data can be restored next time the system starts to prevent data loss. Therefore, in the design of the storage system, each controller has a corresponding BBU battery, which can provide backup power through the BBU after the AC (Alternating Current) power supply of the controller fails, to ensure that the cache data can be written to the system disk when the BBU provides backup power. However, each controller needs to have a corresponding BBU battery, which not only occupies space but also increases the cost, and is low in use and cost performance.
[0024] Based on this, the application provides a shared cache assembly, which realizes effective management of cache data of multiple controllers by setting a switch chip, a conversion chip and a control chip. The assembly can accurately store the cache data of each controller in a specified area of the cache memory, and in the case of a power failure of the controller, the control chip can automatically migrate the cache data of the affected controller to the non-volatile memory.
[0025] In some embodiments, reference is made to Figure 3The shared cache component 1 comprises an interchanger chip 11, a conversion chip 12, a control chip 13, a cache memory 14 and a non-volatile memory 15. The interchanger chip 11 is connected with a plurality of controllers 2 respectively. The conversion chip 12 is connected with the interchanger chip 11 and the control chip 13 respectively, and is configured to realize conversion between a protocol supported by a compute express link (CXL) 3.x technology and a protocol corresponding to the cache memory 14. The control chip 13 is connected with the cache memory 14 and the non-volatile memory 15 respectively. The control chip 13 is configured to divide the cache memory 14 into a plurality of first sub-intervals (not shown in the figure) according to a number of the plurality of controllers 2, so that each of the first sub-intervals corresponds to one of the controllers 2. The first sub-interval is configured to store cache data of the corresponding controller 2, and to move the cache data of the corresponding controller 2 to the non-volatile memory 15 in case of power failure of the controller 2.
[0026] In the embodiments of the present application, four controllers, for example, a controller A, a controller B, a controller C and a controller D are taken as an example for illustration, but this is not a limitation to the present application.
[0027] Specifically, the interchanger chip 11 can be an interchanger chip supporting CXL 3.x. The interchanger chip 11 supports a multihost function, that is, the interchanger chip 11 can be connected with a plurality of controllers 2. That is, the interchanger chip 11 is connected with the controller A, the controller B, the controller C and the controller D respectively, so as to realize simultaneous reading and writing of cache data in the memory by the controller A, the controller B, the controller C and the controller D.
[0028] The conversion chip 12 can be a DDR controller chip supporting CXL 3.x. The conversion chip 12 is connected with the interchanger chip 11 and the control chip 13 respectively, and serves as a bridge between the interchanger chip 11 and the control chip 13. The conversion chip 12 is configured to realize conversion between a protocol supported by a compute express link (CXL) 3.x technology and a protocol corresponding to the cache memory 14, that is, the conversion chip 12 realizes interaction and data conversion of the CXL protocol between the interchanger chip 11 and the conversion chip 12, and realizes connection of a DDR interface between the conversion chip 12 and the control chip 13.
[0029] The control chip 13 can be an FPGA (Field Programmable Gate Array) chip. The control chip 13 is connected with the conversion chip 12 through a DDR interface, and is connected with the cache memory 14 and the non-volatile memory 15 to realize a data saving function. Specifically, referring to Figure 4 , the control chip 13 needs to realize interactive data communication between a cache memory interface (not shown) and a non-volatile memory interface (not shown) inside the control chip 13.
[0030] The cache memory 14 connected below the control chip 13 is shared by the plurality of controllers 2. Each controller 2 has its own storage space, that is, the control chip 13 can divide the cache memory 14 into a plurality of first subintervals according to the number of the plurality of controllers 2, the first subintervals correspond to the controllers 2 one by one, and the first subintervals are used to store cache data of the corresponding controllers 2. For example, assuming that there are four controllers 2 including a controller A, a controller B, a controller C and a controller D, the control chip 13 can divide the cache memory 14 into four first subintervals, for example, a first subinterval A, a first subinterval B, a first subinterval C and a first subinterval D. The controller A corresponds to the first subinterval A, the controller B corresponds to the first subinterval B, the controller C corresponds to the first subinterval C, and the controller D corresponds to the first subinterval D. The first subinterval A is used to store cache data of the controller A, the first subinterval B is used to store cache data of the controller B, the first subinterval C is used to store cache data of the controller C, and the first subinterval D is used to store cache data of the controller D.
[0031] The controllers 2 are powered by corresponding power supplies. In the case that the power supplies are normally powered, the controllers 2 write data into the corresponding first subintervals through the switcher chip 11 and the conversion chip 12. For example, the controller A can write data into the first subinterval A through the switcher chip 11 and the conversion chip 12 when normally working, the controller B can write data into the first subinterval B through the switcher chip 11 and the conversion chip 12 when normally working, the controller C can write data into the first subinterval C through the switcher chip 11 and the conversion chip 12 when normally working, and the controller D can write data into the first subinterval D through the switcher chip 11 and the conversion chip 12 when normally working.
[0032] In the case of a power failure of the power supply corresponding to the controller 2, the control chip 13 can identify the power failure of the controller 2 through the CXL bus. The CXL bus has a built-in device state management mechanism. When the controller 2 is in normal operation, the controller 2 actively feeds back a “normal working” state through a protocol. If the controller 2 is powered off, it cannot respond to bus transactions, such as read / write request timeout. The power management state register will mark a “power failure” flag, thereby determining that the power supply corresponding to the controller 2 has failed. The control chip 13 can move the cache data stored in the cache memory 14 of the controller 2 that has failed to the non-volatile memory 15. For example, assuming that the power supply corresponding to the controller A has failed, the control chip 13 can move the cache data in the first sub-interval A in the cache memory 14 to the non-volatile memory 15 to avoid loss of cache data. In the case of a power failure of the power supplies corresponding to the controller B, the controller C, and the controller D, the cache data is moved to the non-volatile memory 15 in the above-described manner, which will not be described herein.
[0033] When the network performance measurement tools such as ib_send_lat, ib_read_lat, and ib_write_lat are used for testing, the delay time of the cache data from the controller to the cache memory 14 through the switch chip 11 is 400 ns to 500 ns for data packets of different sizes, which is greatly improved compared with the original ROCE scheme of 5 us to 10 us.
[0034] The shared cache assembly of the present application can effectively manage the cache data of multiple controllers by arranging the switch chip, the conversion chip, and the control chip. The assembly can accurately store the cache data of each controller in the specified area of the cache memory. In the case of a power failure of the controller, the control chip can automatically migrate the cache data of the affected controller to the non-volatile memory, thereby significantly reducing the risk of data loss caused by a power failure. The backup power supply of each controller is also saved, which not only reduces the space occupied by the device but also greatly reduces the overall cost, thereby exhibiting significant advantages in improving system reliability and economic benefits. Moreover, the latency is significantly reduced, and the system performance is improved.
[0035] In some embodiments, the control chip 13 is further configured to, in the case that the controller 2 that has failed is started again, read the cache data stored in the non-volatile memory 15 back to the first sub-interval corresponding to the controller 2.
[0036] Specifically, in the case that the controller 2 that has failed is started again, the control chip 13 can also read the cache data temporarily stored in the non-volatile memory 15 of the controller 2 that has failed back to the sub-interval corresponding to the controller 2 in the cache memory 14.
[0037] For example, assuming that the power supply of controller A fails, the control chip 13 can move the cache data in the first sub-interval A of the cache memory 14 to the non-volatile memory 15. When controller A is started again, the control chip 13 can read the cache data temporarily stored in the non-volatile memory 15 back to the first sub-interval A of the cache memory 14.
[0038] The application realizes an automatic cache data backup and recovery mechanism through the control chip, significantly improves the data security, system reliability and operation simplicity without increasing the additional hardware cost and space occupation, and optimizes the system performance and cost-effectiveness.
[0039] In some embodiments, the control chip 13 comprises a cache memory interface (not shown) and a non-volatile memory interface (not shown), the control chip 13 is connected with the cache memory 14 based on the cache memory interface and is connected with the non-volatile memory 15 based on the non-volatile memory interface, wherein the control chip 13 is further configured to, in the case of power failure of a controller, move the cache data of the first sub-interval corresponding to the failed controller to the non-volatile memory 15 through the cache memory interface and the non-volatile memory interface; and in the case of starting of the failed controller again, move the cache data of the failed controller stored in the non-volatile memory 15 to the first sub-interval corresponding to the failed controller through the non-volatile memory interface and the cache memory interface.
[0040] Specifically, the control chip 13 comprises a cache memory interface and a non-volatile memory interface, and the control chip 13 can realize the interactive data communication between the cache memory interface and the non-volatile memory interface. That is, the control chip 13 can move the cache data in the first sub-interval of the cache memory 14 to the non-volatile memory 15 through the cache memory interface and the non-volatile memory interface, and can also move the cache data in the non-volatile memory 15 back to the first sub-interval of the cache memory 14 through the cache memory interface and the non-volatile memory interface.
[0041] For example, assuming that the power supply of controller A fails, the control chip 13 can move the cache data in the first sub-interval A of the cache memory 14 to the non-volatile memory 15 through the cache memory interface and the non-volatile memory interface, to avoid the loss of cache data. When controller A is started again, the control chip 13 can move the cache data temporarily stored in the non-volatile memory 15 back to the first sub-interval A of the cache memory 14.
[0042] Therefore, the control chip can realize data interaction communication between the first non-volatile memory interface and the non-volatile memory interface, further enhance the flexibility and efficiency of data transmission, and significantly improve the data processing capability and system recovery speed in the case of power failure.
[0043] In some embodiments, the control chip 13 is further configured to, in the case that multiple controllers 2 have power failure, divide the non-volatile memory 15 into multiple second sub-intervals, the second sub-intervals corresponding to the first sub-intervals one by one; and in the case that the controller 2 with power failure is started again, read the cache data stored in the second sub-intervals back to the corresponding first sub-intervals.
[0044] Specifically, in the case that multiple controllers 2 have power failure, the control chip 13 will move the cache data in the sub-intervals corresponding to the multiple controllers 2 to the non-volatile memory 15, which will cause the cache data in the non-volatile memory 15 to be confused. Therefore, in the case that multiple controllers 2 have power failure, the control chip 13 needs to divide the non-volatile memory 15 into multiple second sub-intervals, the second sub-intervals corresponding to the first sub-intervals one by one, that is, the control chip 13 moves the cache data in the first sub-intervals to the corresponding second sub-intervals, thereby avoiding the confusion of the cache data in the non-volatile memory 15 to a certain extent.
[0045] For example, the non-volatile memory 15 can be divided according to the number of controllers 2 with power failure, so that in the case that the controller A and the controller B have power failure at the same time, the control chip 13 divides the non-volatile memory 15 into the second sub-interval A and the second sub-interval B, and the second sub-interval A corresponds to the first sub-interval A, and the second sub-interval B corresponds to the first sub-interval B; or the non-volatile memory 15 can be divided according to the size of the first sub-interval in the cache memory 14, so that the control chip 13 divides the non-volatile memory 15 into the second sub-interval A, the second sub-interval B, the second sub-interval C and the second sub-interval D, and the second sub-interval A corresponds to the first sub-interval A, the second sub-interval B corresponds to the first sub-interval B, the second sub-interval C corresponds to the first sub-interval C, and the second sub-interval D corresponds to the first sub-interval D.
[0046] Then, the control chip 13 moves the cache data in the first sub-interval A to the second sub-interval A, and moves the cache data in the first sub-interval B to the second sub-interval B. Further, in the case that the controller 2 with power failure is started again, the control chip 13 reads the cache data in the second sub-interval A back to the first sub-interval A, and reads the cache data in the second sub-interval B back to the first sub-interval B.
[0047] It should be noted that the order of moving and the order of reading back are not specifically limited here.
[0048] In this way, by dividing the non-volatile memory into intervals by the control chip, it is ensured that when power failures occur in multiple controllers at the same time, the cache data of each controller can be accurately stored and read back, thereby avoiding data confusion and loss to some extent, ensuring data consistency with the data after the last power-off shutdown, and improving the accuracy of data management and the reliability of the system.
[0049] In some embodiments, the control chip 13 is further configured to store the cache data of each controller 2 to the corresponding first sub-interval through the conversion chip 12 and the control chip 13; and in the case of data interaction among the multiple controllers 2, the control chip 13 is configured to control each controller 2 to read the cache data of other controllers 2.
[0050] Specifically, the controller 2 writes data into the corresponding first sub-interval through the switch chip 11 and the conversion chip 12. For example, the controller A can write data into the first sub-interval A through the switch chip 11 and the conversion chip 12, and only the controller A can read and write the memory data in the first sub-interval A, and other controllers, such as the controller B, cannot write cache data into the first sub-interval A, but the controller B can read the cache data of the first sub-interval A. The storage data in each first sub-interval in the cache memory 14 can be ensured not to be mistakenly written or deleted, and data interaction among multiple controllers can be achieved.
[0051] The present application can complete data interaction among multiple controllers without the need to equip each controller with a separate ROCE chip or CX6 chip. In this way, not only is the PCB (Printed Circuit Board) wiring work of the board card simplified, the design complexity is reduced, but also the hardware cost is significantly reduced, and the overall system cost performance and market competitiveness are improved.
[0052] In some embodiments, the control chip 13 is further configured to determine a master controller and a slave controller based on the multiple controllers 2; and in the case of a failure of the slave controller, the control chip 13 is configured to control the master controller to take over the task of the failed slave controller, and store the cache data generated by executing the task of the failed slave controller to the first sub-interval corresponding to the failed slave controller.
[0053] Specifically, a master controller in the plurality of controllers 2 can be assigned by the cache system, for example, controller A can be assigned as the master controller, and controller B, controller C and controller D are corresponding slave controllers. When a slave controller fails, the control chip 13 controls the master controller to take over the task of the failed slave controller, so that the master controller can perform write operation on the corresponding first sub-interval of the failed slave controller, that is, store the cache data generated by executing the task of the failed slave controller into the corresponding first sub-interval of the failed slave controller.
[0054] For example, when controller B fails, the control chip 13 can control controller A to take over the task of controller B, and controller A stores the cache data generated by executing the task of controller B into the first sub-interval B; when controller B and controller C fail, the control chip 13 can control controller A to take over the task of controller B and controller C, and controller A stores the cache data generated by executing the task of controller B and controller C into the first sub-interval B and the first sub-interval C respectively.
[0055] The application automatically takes over the task of the failed slave controller by the master controller, not only enhances the fault tolerance and task continuity of the system, ensures the uninterrupted execution of the key task, but also properly stores the cache data generated by the task of the failed controller in the corresponding first sub-interval, to a certain extent, avoids data confusion and loss, and enhances data security.
[0056] In some embodiments, the control chip 13 is further configured to, in the case that the master controller fails, determine one of the plurality of slave controllers as a new master controller, and control the new master controller to take over the task of the master controller and store the cache data generated by executing the task of the master controller into the corresponding first sub-interval of the master controller.
[0057] Specifically, the master controller can also fail, in which case, a new master controller needs to be assigned among the plurality of slave controllers, for example, the next adjacent slave controller of the original master controller is determined as the new master controller, if the next adjacent slave controller also fails, then the next next slave controller is determined as the new master controller, and so on. For example, assuming that the original master controller (controller A) fails, then the next adjacent controller of controller A, that is, controller B, is determined as the new master controller; if controller B also fails, then the next next adjacent controller of controller A, that is, controller C, is determined as the new master controller.
[0058] When the main controller fails, the control chip 13 controls the new main controller to take over the task of the failed main controller, so that the new main controller can perform a write operation on the first sub-interval corresponding to the failed main controller, that is, store the cache data generated by executing the task of the failed main controller into the first sub-interval corresponding to the failed main controller.
[0059] For example, when the main controller (controller A) fails, controller B is determined as the new main controller, and the control chip 13 can control controller B to take over the task of controller A, and controller B stores the cache data generated when executing the task of controller A into the first sub-interval A.
[0060] The application selects a new main controller from the slave controllers when the main controller fails, and realizes seamless takeover of the task, thereby ensuring continuous operation of the system and integrity of the data, which improves the fault tolerance of the system. In addition, the automatic master-slave controller switching mechanism simplifies the fault recovery process, reduces manual intervention, and reduces operation and maintenance costs. Furthermore, the new main controller can accurately store the cache data generated when executing the task of the original main controller into the corresponding first sub-interval, which to some extent avoids data confusion and loss, and enhances data security.
[0061] In some embodiments, the control chip 13 is configured to divide the cache memory 14 into intervals according to the number of controllers 2, including: determining the cache capacity of each controller 2 based on the number of tasks of the controller 2; and dividing the cache memory 14 into intervals based on the cache capacity of each controller 2.
[0062] Specifically, when dividing the cache memory 14 into intervals according to the number of controllers 2, the control chip 13 can determine the cache capacity of each controller 2 by looking up a two-dimensional relationship mapping table between the number of tasks of the controller 2 and the cache capacity, that is, determining the cache requirement of the controller 2, and dividing the cache memory 14 into intervals according to the cache capacity of the controller 2, wherein the two-dimensional relationship mapping table includes a plurality of task quantities and a cache capacity corresponding to each task quantity.
[0063] For example, assuming that there are four controllers, controller A, controller B, controller C and controller D, the control chip 13 can divide the cache memory 14 into four first sub-intervals. The control chip 13 looks up the above-mentioned two-dimensional relationship mapping table according to the number of tasks of controller A, controller B, controller C and controller D, respectively, to determine the cache capacity of controller A, controller B, controller C and controller D. Then, the control chip 13 divides the cache memory 14 into intervals according to the cache capacity of controller A, controller B, controller C and controller D, to form first sub-interval A, first sub-interval B, first sub-interval C and first sub-interval D.
[0064] It should be noted that the capacity of the cache memory 14 is limited, in order to avoid the cache capacity and value of the controller A, the controller B, the controller C and the controller D exceeding the capacity of the cache memory 14, the cache capacity ratio of the controller A, the controller B, the controller C and the controller D can be determined, and the cache memory 14 is divided into intervals according to the ratio.
[0065] The application can optimize the allocation and management of storage resources by controlling the chip to accurately divide the cache memory according to the number of tasks and cache requirements of the controller, and can ensure that the controller can obtain appropriate cache capacity to a certain extent to meet its specific task requirements, while improving the use efficiency and response speed of the memory.
[0066] In some embodiments, the control chip 13 is configured to divide the cache memory 14 into intervals according to the number of the plurality of controllers 2, including: dividing the cache memory 14 into a plurality of first subintervals of the same storage space according to the number of the plurality of controllers 2.
[0067] Specifically, when the control chip 13 divides the cache memory 14 into intervals according to the number of the plurality of controllers 2, the control chip 13 can also divide the cache memory 14 into intervals according to the number of the plurality of controllers 2.
[0068] For example, assuming that there are four controllers including the controller A, the controller B, the controller C and the controller D, the control chip 13 can divide the cache memory 14 into four first subintervals of the same storage space.
[0069] The application can achieve fair allocation and efficient management of storage resources by dividing the cache memory into intervals according to the number of the plurality of controllers 2.
[0070] In some embodiments, the switch chip 11 and the conversion chip 12 support the computing high-speed interconnection technology, the control chip 13 includes a field programmable gate array chip, the cache memory 14 can be a DDR cache memory, and the nonvolatile memory 15 can be a nand flash nonvolatile memory.
[0071] For example, the switch chip 11 can be a switch chip 11 supporting CXL3.x, the conversion chip 12 can be a DDR Controller chip supporting CXL3.x, that is, the switch chip 11 and the conversion chip 12 support the computing high-speed interconnection technology, and the control chip 13 can be a FPGA chip.
[0072] In some embodiments, with reference to Figure 3The shared cache assembly 1 comprises an interchanger chip 11, a conversion chip 12, a control chip 13, a cache memory 14 and a non-volatile memory 15, wherein the interchanger chip 11 is connected with the plurality of controllers 2 respectively, the conversion chip 12 is connected with the interchanger chip 11 and the control chip 13 respectively, and is configured to realize conversion between a protocol supported by a computing high-speed interconnection technology and a protocol corresponding to the cache memory 14, and the control chip 13 is connected with the cache memory 14 and the non-volatile memory 15 respectively.
[0073] Figure 5 A flowchart of an implementation method of the shared cache assembly according to some embodiments of the present application is shown in FIG. 6. Referring to FIG. 6, Figure 5 the implementation method of the shared cache assembly according to some embodiments of the present application can comprise the following steps:
[0074] S110, the cache memory 14 is divided into a plurality of first sub-intervals according to the number of the plurality of controllers 2, and each first sub-interval corresponds to one controller 2, and each first sub-interval is configured to store cache data of the corresponding controller 2.
[0075] Specifically, the cache memory 14 connected below the control chip 13 is shared by the plurality of controllers 2, and each controller 2 has its own storage space, i.e. the control chip 13 is configured to divide the cache memory 14 into a plurality of first sub-intervals according to the number of the plurality of controllers 2, each first sub-interval corresponds to one controller 2, and each first sub-interval is configured to store cache data of the corresponding controller 2. For example, assuming that there are four controllers 2, i.e. controller A, controller B, controller C and controller D, the control chip 13 can divide the cache memory 14 into four first sub-intervals, e.g. first sub-interval A, first sub-interval B, first sub-interval C and first sub-interval D, wherein the controller A corresponds to the first sub-interval A, the controller B corresponds to the first sub-interval B, the controller C corresponds to the first sub-interval C, and the controller D corresponds to the first sub-interval D, and the first sub-interval A is configured to store cache data of the controller A, the first sub-interval B is configured to store cache data of the controller B, the first sub-interval C is configured to store cache data of the controller C, and the first sub-interval D is configured to store cache data of the controller D.
[0076] For example, assuming that there are four controllers, controller A, controller B, controller C and controller D, the control chip 13 can divide the cache memory 14 into four first sub-intervals, and the control chip 13 can look up the above-mentioned two-dimensional relationship mapping table according to the number of tasks of the controller A, the controller B, the controller C and the controller D respectively, to determine the cache capacity of the controller A, the controller B, the controller C and the controller D, and then the control chip 13 can divide the cache memory 14 according to the cache capacity of the controller A, the controller B, the controller C and the controller D, to form the first sub-interval A, the first sub-interval B, the first sub-interval C and the first sub-interval D. It should be noted that the capacity of the cache memory 14 is limited, in order to avoid the cache capacity of the controller A, the controller B, the controller C and the controller D exceeding the capacity of the cache memory 14, the control chip 13 can determine the ratio of the cache capacity of the controller A, the controller B, the controller C and the controller D, and divide the cache memory 14 according to the ratio.
[0077] The cache memory 14 can also be divided according to the number of the plurality of controllers 2 to obtain a plurality of first sub-intervals of the same storage space. For example, assuming that there are four controllers, controller A, controller B, controller C and controller D, the control chip 13 can divide the cache memory 14 into four first sub-intervals of the same storage space.
[0078] S120, in the case of a power failure of the controller 2, the cache data corresponding to the controller 2 is moved to the non-volatile memory 15.
[0079] Specifically, the controller 2 has a corresponding power supply for power supply, in the case of normal power supply, the controller 2 writes data into the corresponding first sub-interval through the switch chip 11 and the conversion chip 12. For example, the controller A can write data into the first sub-interval A through the switch chip 11 and the conversion chip 12 when working normally, the controller B can write data into the first sub-interval B through the switch chip 11 and the conversion chip 12 when working normally, the controller C can write data into the first sub-interval C through the switch chip 11 and the conversion chip 12 when working normally, and the controller D can write data into the first sub-interval D through the switch chip 11 and the conversion chip 12 when working normally.
[0080] When the power supply corresponding to the controller 2 fails, the control chip 13 can move the cache data stored in the cache memory 14 of the failed controller 2 to the non-volatile memory 15 based on the cache memory interface and the non-volatile memory interface. For example, assuming that the power supply corresponding to the controller A fails, the control chip 13 can transmit the cache data in the first sub-interval A in the cache memory 14 to the non-volatile memory interface through the cache memory interface, and then move the cache data in the first sub-interval A to the non-volatile memory 15, so as to avoid the loss of cache data. When the power supply corresponding to the controller B, the controller C and the controller D fails, the cache data is also moved to the non-volatile memory 15 in the above-mentioned manner, which will not be described here.
[0081] In the case of emergency power failure of the controller, the application can automatically migrate the cache data of the affected controller to the non-volatile memory, thereby significantly reducing the risk of data loss caused by power failure. In addition, when using network performance measurement tools such as ib_send_lat, ib_read_lat and ib_write_lat for testing, the delay time of the cache data from the controller through the switch chip to the cache memory is 400ns-500ns for different data packet sizes, which is greatly improved compared with the original ROCE scheme of 5us-10us, significantly reducing the delay and improving the system performance.
[0082] In some embodiments, the above method further comprises: in the case that the controller 2 with power failure starts again, reading the cache data stored in the non-volatile memory 15 back to the sub-interval corresponding to the controller 2.
[0083] Specifically, when the controller 2 with power failure starts again, the control chip 13 can also read the cache data temporarily stored in the non-volatile memory 15 of the controller 2 with power failure back to the sub-interval corresponding to the controller 2 in the cache memory 14 based on the cache memory interface and the non-volatile memory interface.
[0084] For example, assuming that the power supply of controller A fails, the control chip 13 can transmit the cache data in the first sub-interval A in the cache memory 14 to the non-volatile memory interface through the cache memory interface, and then move the cache data in the first sub-interval A to the non-volatile memory 15. When controller A is started again, the control chip 13 can transmit the cache data temporarily stored in the non-volatile memory 15 to the cache memory interface through the non-volatile memory interface, and then read the cache data temporarily stored in the non-volatile memory 15 back to the first sub-interval A in the cache memory 14.
[0085] It should be noted that when the power supply of multiple controllers 2 fails, the control chip 13 will move the cache data in the sub-intervals corresponding to the multiple controllers 2 to the non-volatile memory 15, which will cause the cache data in the non-volatile memory 15 to be confused. Therefore, when the power supply of multiple controllers 2 fails, the control chip 13 needs to divide the non-volatile memory 15 into multiple second sub-intervals, and the second sub-intervals correspond one-to-one to the first sub-intervals, that is, the control chip 13 moves the cache data in the first sub-intervals to the corresponding second sub-intervals, thereby avoiding the confusion of the cache data in the non-volatile memory 15 to some extent. For example, assuming that the power supply of controller A and controller B fails at the same time, the control chip 13 divides the non-volatile memory 15 into multiple second sub-intervals. For example, the non-volatile memory 15 can be divided according to the number of power supply failures, so that when the power supply of controller A and controller B fails at the same time, the control chip 13 divides the non-volatile memory 15 into second sub-interval A and second sub-interval B evenly, and second sub-interval A corresponds to first sub-interval A, and second sub-interval B corresponds to first sub-interval B. For another example, the non-volatile memory 15 can be divided according to the size of the first sub-intervals in the cache memory 14, so that the control chip 13 divides the non-volatile memory 15 into second sub-interval A, second sub-interval B, second sub-interval C, and second sub-interval D, and second sub-interval A corresponds to first sub-interval A, second sub-interval B corresponds to first sub-interval B, second sub-interval C corresponds to first sub-interval C, and second sub-interval D corresponds to first sub-interval D. Then, the control chip 13 moves the cache data in the first sub-interval A to the second sub-interval A, and moves the cache data in the first sub-interval B to the second sub-interval B. Further, when the controller 2 whose power supply fails is started again, the control chip 13 reads the cache data in the second sub-interval A back to the first sub-interval A, and reads the cache data in the second sub-interval B back to the first sub-interval B. It should be noted that the order of moving and the order of reading back are not limited here.
[0086] The automatic cache data backup and recovery mechanism realized by the control chip improves the data security, system reliability and operation convenience without increasing the additional hardware cost and space occupation, and optimizes the system performance and cost efficiency. In addition, the interval division of the non-volatile memory by the control chip ensures that the cache data of each controller can be accurately stored and read when power failure occurs in multiple controllers at the same time, thereby avoiding data confusion and loss to a certain extent, ensuring the data consistency with the data after the last power-off shutdown, and improving the accuracy of data management and the reliability of the system.
[0087] In some embodiments, the above method further comprises: determining the master controller and the slave controllers based on the plurality of controllers 2; in the case of failure of the slave controller, controlling the master controller to take over the task of the failed slave controller and storing the cache data generated by executing the task of the failed slave controller to the first sub-interval corresponding to the failed slave controller; in the case of failure of the master controller, taking one of the plurality of slave controllers as a new master controller, and controlling the new master controller to take over the task of the master controller and storing the cache data generated by executing the task of the master controller to the first sub-interval corresponding to the master controller.
[0088] Specifically, the master controller in the plurality of controllers 2 can be assigned by the cache system, for example, controller A can be assigned as the master controller, and controllers B, C and D are the slave controllers accordingly. When a slave controller fails, the control chip 13 controls the master controller to take over the task of the failed slave controller, so that the master controller can perform write operation on the first sub-interval corresponding to the failed slave controller, i.e. store the cache data generated by executing the task of the failed slave controller to the first sub-interval corresponding to the failed slave controller. For example, in the case of failure of controller B, the control chip 13 can control controller A to take over the task of controller B, and controller A stores the cache data generated by executing the task of controller B into the first sub-interval B; in the case of failure of controller B and controller C, the control chip 13 can control controller A to take over the tasks of controller B and controller C, and controller A stores the cache data generated by executing the tasks of controller B and controller C into the first sub-interval B and the first sub-interval C respectively.
[0089] The main controller can also fail, in which case a new main controller needs to be assigned among the plurality of slave controllers, for example, the next adjacent slave controller of the original main controller is determined as the new main controller, if the next adjacent slave controller also fails, then the next next slave controller is determined as the new main controller, and so on. For example, assuming that the original main controller (controller A) fails, then the next adjacent controller 2 of controller A, i.e. controller B, is determined as the new main controller; if controller B also fails, then the next next adjacent controller 2 of controller A, i.e. controller C, is determined as the new main controller. When the main controller fails, the control chip 13 controls the new main controller to take over the task of the failed main controller, so that the new main controller can perform write operation on the first sub-interval corresponding to the failed main controller, i.e. store the cache data generated by executing the task of the failed main controller into the first sub-interval corresponding to the failed main controller. For example, in the case where the main controller (controller A) fails, controller B is determined as the new main controller, and the control chip 13 can control controller B to take over the task of controller A, and controller B stores the cache data generated by executing the task of controller A into the first sub-interval A.
[0090] The application automatically takes over the task of the slave controller by the main controller when the slave controller fails, not only enhances the fault tolerance and task continuity of the system, ensures the uninterrupted execution of critical tasks, but also properly stores the cache data generated by the task of the failed controller in the corresponding first sub-interval; when the main controller fails, a new main controller is selected among the slave controllers, and the task is seamlessly taken over, thereby ensuring the continuous operation of the system and the integrity of the data, so that the fault tolerance of the system is improved, and the automatic switching mechanism of the main and slave controllers simplifies the fault recovery process, reduces manual intervention, and reduces operation and maintenance costs; in addition, the new main controller can accurately store the cache data generated by executing the task of the original main controller into the corresponding first sub-interval, to a certain extent, avoiding data confusion and loss, and enhancing data security.
[0091] In summary, the shared cache assembly of the present application, by setting the switcher chip, the conversion chip and the control chip, realizes effective management of cache data of multiple controllers, the assembly can accurately store the cache data of each controller in the specified area of the cache memory, and in the emergency of controller power failure, the control chip can automatically migrate the cache data of the affected controller to the non-volatile memory, thereby significantly reducing the risk of data loss caused by power failure; the standby power supply of each controller is saved, not only reducing the space occupied by the device, but also greatly reducing the overall cost, showing its significant advantages in improving system reliability and economic benefits, and also significantly reducing the delay and improving the system performance; in addition, the present application can complete data interaction between multiple controllers without equipping each controller with a separate ROCE chip or CX6 chip, not only simplifying the PCB layout and wiring work of the board, reducing the design complexity, but also significantly reducing the hardware cost, improving the performance-price ratio and market competitiveness of the overall system.
[0092] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.
[0093] The embodiment of the present application also provides an electronic device.
[0094] With reference to Figure 6 The electronic device 300 of the present application comprises a memory 310 for storing a computer program, and a processor 320 for executing the computer program to realize the steps of the implementation method of the aforementioned shared cache assembly.
[0095] The embodiment of the present application also provides a computer readable storage medium.
[0096] The computer readable storage medium of the present application stores a computer program, wherein the computer program is executed by the processor to realize the steps of the implementation method of the aforementioned shared cache assembly.
[0097] In one exemplary embodiment, the aforementioned computer readable storage medium can include but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0098] The embodiment of the present application also provides a computer program product.
[0099] The computer program product of the present application comprises a computer program which, when executed by a processor, implements the steps of the implementation method of the aforementioned shared cache component.
[0100] Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the implementation method embodiments of the aforementioned shared cache component.
[0101] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or both, and that the implementation decisions are within the skill of an ordinary designer of such products. To clearly illustrate the interchangeability of hardware and software, and to avoid obscuring the disclosure with details of particular implementations, the descriptions herein have generally been presented in the context of particular examples. Those skilled in the art will recognize that the described examples are not the only ways to implement the described functionality, and that the described implementations are not the only ways to implement the described examples. The described examples are presented for purposes of illustration and not limitation.
[0102] The above provides a kind of shared cache component and its implementation method, electronic equipment and storage medium provided by the present application in detail.The principle and implementation of the present application are described in this paper by applying specific examples, the above description of the example is only for helping to understand the method of the present application and its core idea.It should be pointed out that, for the ordinary skilled in the art, under the premise of not departing from the principle of the present application, the present application can be improved and modified, these improvements and modifications also fall within the scope of the claims of the present application.
Claims
1. A shared cache component, characterized in that, include: The system comprises a switch chip, a conversion chip, a control chip, a cache memory, and a non-volatile memory. The switch chip is connected to multiple controllers, and the conversion chip is connected to both the switch chip and the control chip. These components enable conversion between high-speed interconnect technology protocols supporting computing and the protocols corresponding to the cache memory. The control chip is connected to both the cache memory and the non-volatile memory. The control chip is used to divide the cache memory into intervals according to the number of the plurality of controllers to obtain a plurality of first sub-intervals. Each first sub-interval corresponds to a controller. The first sub-interval is used to store the cache data of the corresponding controller. In the event of a power failure of the controller, the cache data corresponding to the controller is moved to the non-volatile memory. The control chip is also used to read back the cached data stored in the non-volatile memory to the first sub-interval corresponding to the controller when the controller restarts after a power failure. The control chip is also used to, when there are multiple controllers experiencing power failures, divide the non-volatile memory into multiple second sub-intervals, with each second sub-interval corresponding to a first sub-interval; and when a controller experiencing a power failure restarts, read back the cached data stored in the second sub-interval to the corresponding first sub-interval.
2. The shared cache component according to claim 1, characterized in that, The control chip includes a cache memory interface and a non-volatile memory interface. The control chip is connected to the cache memory via the cache memory interface and to the non-volatile memory via the non-volatile memory interface. The control chip is further used for... In the event of a power failure in the controller, the cached data of the first sub-interval corresponding to the faulty controller is moved to the non-volatile memory via the cache memory interface and the non-volatile memory interface. When the fault controller restarts, the cached data of the fault controller stored in the non-volatile memory is moved to the first sub-interval corresponding to the fault controller through the non-volatile memory interface and the cache memory interface.
3. The shared cache component according to claim 1, characterized in that, The control chip is also used for, The cached data of each controller is stored in the corresponding first sub-interval through the conversion chip and the control chip; In the case of multiple controllers interacting with each other, each controller is controlled to read cached data from the other controllers.
4. The shared cache component according to claim 1, characterized in that, The control chip is also used for, The master controller and slave controller are determined based on the multiple controllers; In the event of a failure in the slave controller, the master controller takes over the tasks of the failed slave controller and stores the cached data generated by executing the tasks of the failed slave controller in the first sub-interval corresponding to the failed slave controller.
5. The shared cache component according to claim 4, characterized in that, The control chip is also used for, In the event of a failure of the main controller, one of the multiple slave controllers is designated as the new main controller, and the new main controller takes over the tasks of the main controller and stores the cached data generated by executing the tasks of the main controller in the first sub-interval corresponding to the main controller.
6. The shared cache component according to claim 1, characterized in that, The control chip is used to divide the cache memory into intervals according to the number of the plurality of controllers, including: The cache capacity of the controller is determined based on the number of tasks performed by the controller. The cache memory is divided into intervals based on the cache capacity of each controller.
7. The shared cache component according to claim 1, characterized in that, The control chip is used to divide the cache memory into intervals according to the number of the plurality of controllers, including: The cache memory is divided equally according to the number of controllers to obtain multiple first sub-intervals with the same storage space.
8. A method for implementing a shared cache component as described in any one of claims 1-7, characterized in that, The method includes: The cache memory is divided into intervals based on the number of controllers to obtain multiple first sub-intervals. Each first sub-interval corresponds to a controller and is used to store the cache data of the corresponding controller. In the event of a power failure in the controller, the cached data corresponding to the controller is moved to non-volatile memory. In the event that the controller restarts after a power failure, the cached data stored in the non-volatile memory will be read back to the first sub-interval corresponding to the controller. When there are multiple controllers experiencing power failures, the non-volatile memory is divided into intervals to obtain multiple second sub-intervals, with each second sub-interval corresponding to a first sub-interval. If the controller restarts after a power failure, the cached data stored in the second sub-interval will be read back to the corresponding first sub-interval.
9. The method for implementing the shared cache component according to claim 8, characterized in that, The method further includes: In the event that the controller restarts after a power failure, the cached data stored in the non-volatile memory will be read back to the corresponding sub-interval of the controller.
10. The method for implementing the shared cache component according to claim 8, characterized in that, The method further includes: The master controller and slave controller are determined based on the multiple controllers; In the event of a failure of the slave controller, the master controller takes over the tasks of the failed slave controller and stores the cached data generated by executing the tasks of the failed slave controller in the first sub-interval corresponding to the failed slave controller. In the event of a failure of the main controller, one of the multiple slave controllers is designated as the new main controller, and the new main controller takes over the tasks of the main controller and stores the cached data generated by executing the tasks of the main controller in the first sub-interval corresponding to the main controller.
11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method of implementing the shared cache component as described in any one of claims 8 to 10 when executing the computer program.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method for implementing the shared cache component as described in any one of claims 8 to 10.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for implementing the shared cache component as described in any one of claims 8 to 10.
Citation Information
Patent Citations
Storage system, method and device, electronic equipment, medium and product
CN120447838A
Volatile cache reconstruction after power failure
US20170329706A1